[llvm] [AMDGPU] AMDGPULateCodeGenPrepare Legacy PM: replace `setPreservesAll()` with `setPreservesCFG()` (PR #148167)

Nicolai Hähnle via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 11 07:24:38 PDT 2025


================
@@ -546,7 +546,9 @@ class AMDGPULateCodeGenPrepareLegacy : public FunctionPass {
     AU.addRequired<TargetPassConfig>();
     AU.addRequired<AssumptionCacheTracker>();
     AU.addRequired<UniformityInfoWrapperPass>();
-    AU.setPreservesAll();
+    // This pass makes changes that can invalidate Uniformity Analysis,
+    // so don't setPreserveAll() here (see new PM version above).
+    AU.setPreservesCFG();
----------------
nhaehnle wrote:

My personal opinion is that this comment is distracting when coming to the code without the historical context, and it is also a bit beside the point. The analysis preservation here is in terms of categories: the pass preserves the CFG, which is obvious; it doesn't blanket-preserve anything else. So arguing about an individual analysis in the comment is a category error.

It's like when you take an exam and write something additional on your answer that isn't relevant to the question but happens to be wrong. I'm going to subtract points for that.

https://github.com/llvm/llvm-project/pull/148167


More information about the llvm-commits mailing list