Remove "Rewrite Symbols" from codegen pipeline
authorArthur Eubanks <aeubanks@google.com>
Thu, 1 Apr 2021 06:12:36 +0000 (23:12 -0700)
committerArthur Eubanks <aeubanks@google.com>
Mon, 31 May 2021 15:32:36 +0000 (08:32 -0700)
commit8815ce03e8575cb27e951b5f5a11384421730e20
treef563622d2b1b988f029df989e93cb66fb823c9fa
parentd39f5c3cb97e769f960681b3132724e16b756e80
Remove "Rewrite Symbols" from codegen pipeline

It breaks up the function pass manager in the codegen pipeline.

With empty parameters, it looks at the -mllvm flag -rewrite-map-file.
This is likely not in use.

Add a check that we only have one function pass manager in the codegen
pipeline.

Some tests relied on the fact that we had a module pass somewhere in the
codegen pipeline.

addr-label.ll crashes on ARM due to this change. This is because a
ARMConstantPoolConstant containing a BasicBlock to represent a
blockaddress may hold an invalid pointer to a BasicBlock if the
blockaddress is invalidated by its BasicBlock getting removed. In that
case all referencing blockaddresses are RAUW a constant int. Making
ARMConstantPoolConstant::CVal a WeakVH fixes the crash, but I'm not sure
that's the right fix. As a workaround, create a barrier right before
ISel so that IR optimizations can't happen while a
ARMConstantPoolConstant has been created.

Reviewed By: rnk, MaskRay, compnerd

Differential Revision: https://reviews.llvm.org/D99707
13 files changed:
llvm/lib/CodeGen/TargetPassConfig.cpp
llvm/lib/Target/ARM/ARMTargetMachine.cpp
llvm/lib/Target/ARM/CMakeLists.txt
llvm/test/CodeGen/AArch64/O0-pipeline.ll
llvm/test/CodeGen/AArch64/O3-pipeline.ll
llvm/test/CodeGen/AMDGPU/llc-pipeline.ll
llvm/test/CodeGen/ARM/O3-pipeline.ll
llvm/test/CodeGen/Generic/addr-label.ll
llvm/test/CodeGen/X86/O0-pipeline.ll
llvm/test/CodeGen/X86/opt-pipeline.ll
llvm/test/CodeGen/X86/select_meta.ll
llvm/test/Other/2010-05-06-Printer.ll
llvm/utils/gn/secondary/llvm/lib/Target/ARM/BUILD.gn