Skip to content

Commit bcb8f4a

Browse files
committed
[AMDGPU] Push amdgpu-preload-kern-arg-prolog after livedebugvalues
This is effectively a workaround for a bug in livedebugvalues, but seems to potentially be a general improvement, as BB sections seems like it could ruin the special 256-byte prelude scheme that amdgpu-preload-kern-arg-prolog requires anyway. Moving it even later doesn't seem to have any material impact, and just adds livedebugvalues to the list of things which no longer have to deal with pseudo multiple-entry functions. AMDGPU debug-info isn't supported upstream yet, so the bug being avoided isn't testable here. I am posting the patch upstream to avoid an unnecessary diff with AMD's fork.
1 parent bc50ff1 commit bcb8f4a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ class GCNPassConfig final : public AMDGPUPassConfig {
11471147
void addPostRegAlloc() override;
11481148
void addPreSched2() override;
11491149
void addPreEmitPass() override;
1150+
void addPostBBSections() override;
11501151
};
11511152

11521153
} // end anonymous namespace
@@ -1686,6 +1687,11 @@ void GCNPassConfig::addPreEmitPass() {
16861687
addPass(&AMDGPUInsertDelayAluID);
16871688

16881689
addPass(&BranchRelaxationPassID);
1690+
}
1691+
1692+
void GCNPassConfig::addPostBBSections() {
1693+
// We run this later to avoid passes like livedebugvalues and BBSections
1694+
// having to deal with the apparent multi-entry functions we may generate.
16891695
addPass(createAMDGPUPreloadKernArgPrologLegacyPass());
16901696
}
16911697

0 commit comments

Comments
 (0)