[llvm] e129570 - [Uniformity] Legacy PM: Set UniformityInfoWrapperPass isCFGOnly to false (#148165)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 11 11:56:33 PDT 2025
Author: Jim M. R. Teichgräber
Date: 2025-07-11T11:56:30-07:00
New Revision: e12957080ce145fa137ed6a1b16b660719a9cbb5
URL: https://github.com/llvm/llvm-project/commit/e12957080ce145fa137ed6a1b16b660719a9cbb5
DIFF: https://github.com/llvm/llvm-project/commit/e12957080ce145fa137ed6a1b16b660719a9cbb5.diff
LOG: [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.
Added:
Modified:
llvm/lib/Analysis/UniformityAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/UniformityAnalysis.cpp b/llvm/lib/Analysis/UniformityAnalysis.cpp
index 2101fdfacfc8f..15107c262980c 100644
--- a/llvm/lib/Analysis/UniformityAnalysis.cpp
+++ b/llvm/lib/Analysis/UniformityAnalysis.cpp
@@ -146,12 +146,12 @@ char UniformityInfoWrapperPass::ID = 0;
UniformityInfoWrapperPass::UniformityInfoWrapperPass() : FunctionPass(ID) {}
INITIALIZE_PASS_BEGIN(UniformityInfoWrapperPass, "uniformity",
- "Uniformity Analysis", true, true)
+ "Uniformity Analysis", false, true)
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
INITIALIZE_PASS_DEPENDENCY(CycleInfoWrapperPass)
INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass)
INITIALIZE_PASS_END(UniformityInfoWrapperPass, "uniformity",
- "Uniformity Analysis", true, true)
+ "Uniformity Analysis", false, true)
void UniformityInfoWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
More information about the llvm-commits
mailing list