diff options
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp index 3bd334c2082..7a8fd019593 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp @@ -168,6 +168,7 @@ extern "C" void LLVMInitializeAMDGPUTarget() { initializeSIMemoryLegalizerPass(*PR); initializeSIDebuggerInsertNopsPass(*PR); initializeSIOptimizeExecMaskingPass(*PR); + initializeSIFixWWMLivenessPass(*PR); initializeAMDGPUUnifyDivergentExitNodesPass(*PR); initializeAMDGPUAAWrapperPassPass(*PR); } @@ -792,6 +793,10 @@ void GCNPassConfig::addFastRegAlloc(FunctionPass *RegAllocPass) { // SI_ELSE will introduce a copy of the tied operand source after the else. insertPass(&PHIEliminationID, &SILowerControlFlowID, false); + // This must be run after SILowerControlFlow, since it needs to use the + // machine-level CFG, but before register allocation. + insertPass(&SILowerControlFlowID, &SIFixWWMLivenessID, false); + TargetPassConfig::addFastRegAlloc(RegAllocPass); } @@ -808,6 +813,10 @@ void GCNPassConfig::addOptimizedRegAlloc(FunctionPass *RegAllocPass) { // SI_ELSE will introduce a copy of the tied operand source after the else. insertPass(&PHIEliminationID, &SILowerControlFlowID, false); + // This must be run after SILowerControlFlow, since it needs to use the + // machine-level CFG, but before register allocation. + insertPass(&SILowerControlFlowID, &SIFixWWMLivenessID, false); + TargetPassConfig::addOptimizedRegAlloc(RegAllocPass); } |