Skip to content

Commit e129570

Browse files
authored
[Uniformity] Legacy PM: Set UniformityInfoWrapperPass isCFGOnly to false (#148165)
Currently, Uniformity Analysis is preserved in the Legacy PM when a pass sets `setPreservesCFG()`. This is incorrect: any values' uniformity not only depends on the CFG, but also on the uniformity of other values, so a CFG-preserving change in many cases doesn't preserve uniformity analysis. This corrected behavior also matches the behavior of the new PM. --- On its own, this change does not affect the pass pipeline because of the happenstance of pass ordering. I also created a PR to change AMDGPULateCodeGenPrepare (#148167), this will have an actual impact on pass executions. That PR also includes changes to the `amdgpu/llc-pipeline.ll` test in order to check that this change works, but if this is preferred, I would also be happy to try to extend this PR to add an isolated test case; though my personal opinion is that the test in #148167 should suffice, as it should also accurately pinpoint failures related to this change. --- I ran `git-clang-format` on my changes. I tested them using the `check-llvm` target; no unexpected failures occurred.
1 parent 9693056 commit e129570

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Analysis/UniformityAnalysis.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,12 @@ char UniformityInfoWrapperPass::ID = 0;
146146
UniformityInfoWrapperPass::UniformityInfoWrapperPass() : FunctionPass(ID) {}
147147

148148
INITIALIZE_PASS_BEGIN(UniformityInfoWrapperPass, "uniformity",
149-
"Uniformity Analysis", true, true)
149+
"Uniformity Analysis", false, true)
150150
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
151151
INITIALIZE_PASS_DEPENDENCY(CycleInfoWrapperPass)
152152
INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass)
153153
INITIALIZE_PASS_END(UniformityInfoWrapperPass, "uniformity",
154-
"Uniformity Analysis", true, true)
154+
"Uniformity Analysis", false, true)
155155

156156
void UniformityInfoWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
157157
AU.setPreservesAll();

0 commit comments

Comments
 (0)