[PATCH] D33222: [LegacyPassManager] Remove TargetMachine constructors
Francis Visoiu Mistrih via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon May 15 17:25:25 PDT 2017
thegameg created this revision.
Herald added subscribers: jgravelle-google, sbc100, javed.absar, nhaehnle, nemanjai, jyknight, dschuff, arsenm, jfb.
[LegacyPassManager] Remove TargetMachine constructors
This provides a new way to access the TargetMachine through TargetPassConfig, as a dependency.
The patterns replaced here are:
- Passes handling a null TargetMachine call `getAnalysisIfAvailable<TargetPassConfig>`.
- Passes not handling a null TargetMachine `addRequired<TargetPassConfig>` and call `getAnalysis<TargetPassConfig>`.
- MachineFunctionPasses now use MF.getTarget().
- Remove all the TargetMachine constructors. Remove INITIALIZE_TM_PASS.
This fixes a crash when running `llc -start-before prologepilog`.
PEI needs StackProtector, which gets constructed without a TargetMachine by the pass manager. The StackProtector pass doesn't handle the case where there is no TargetMachine, so it segfaults.
Related to PR30324.
https://reviews.llvm.org/D33222
Files:
include/llvm/CodeGen/Passes.h
include/llvm/CodeGen/StackProtector.h
include/llvm/PassInfo.h
include/llvm/PassSupport.h
lib/CodeGen/AtomicExpandPass.cpp
lib/CodeGen/CodeGenPrepare.cpp
lib/CodeGen/DwarfEHPrepare.cpp
lib/CodeGen/InterleavedAccessPass.cpp
lib/CodeGen/LLVMTargetMachine.cpp
lib/CodeGen/LowerEmuTLS.cpp
lib/CodeGen/MachineModuleInfo.cpp
lib/CodeGen/PrologEpilogInserter.cpp
lib/CodeGen/SafeStack.cpp
lib/CodeGen/StackProtector.cpp
lib/CodeGen/TargetPassConfig.cpp
lib/CodeGen/WinEHPrepare.cpp
lib/IR/PassRegistry.cpp
lib/Target/AArch64/AArch64TargetMachine.cpp
lib/Target/AMDGPU/AMDGPU.h
lib/Target/AMDGPU/AMDGPUAnnotateKernelFeatures.cpp
lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
lib/Target/AMDGPU/AMDGPULowerIntrinsics.cpp
lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp
lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
lib/Target/AMDGPU/R600ClauseMergePass.cpp
lib/Target/AMDGPU/R600ControlFlowFinalizer.cpp
lib/Target/AMDGPU/R600ExpandSpecialInstrs.cpp
lib/Target/AMDGPU/R600OptimizeVectorRegisters.cpp
lib/Target/AMDGPU/R600Packetizer.cpp
lib/Target/AMDGPU/SILoadStoreOptimizer.cpp
lib/Target/ARM/ARMTargetMachine.cpp
lib/Target/Hexagon/HexagonTargetMachine.cpp
lib/Target/Mips/Mips.h
lib/Target/Mips/Mips16HardFloat.cpp
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/Mips/MipsLongBranch.cpp
lib/Target/Mips/MipsModuleISelDAGToDAG.cpp
lib/Target/Mips/MipsOptimizePICCall.cpp
lib/Target/Mips/MipsOs16.cpp
lib/Target/Mips/MipsTargetMachine.cpp
lib/Target/PowerPC/PPCTargetMachine.cpp
lib/Target/Sparc/DelaySlotFiller.cpp
lib/Target/Sparc/LeonPasses.cpp
lib/Target/Sparc/LeonPasses.h
lib/Target/Sparc/Sparc.h
lib/Target/Sparc/SparcTargetMachine.cpp
lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
lib/Target/X86/X86TargetMachine.cpp
lib/Target/XCore/XCoreTargetMachine.cpp
tools/llc/llc.cpp
tools/opt/opt.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33222.99085.patch
Type: text/x-patch
Size: 73987 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170516/e4a632ac/attachment.bin>
More information about the llvm-commits
mailing list