[llvm] [AMDGPU] Do not preserve UniformityInfo (PR #76696)

Sameer Sahasrabuddhe via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 1 21:19:39 PST 2024


https://github.com/ssahasra created https://github.com/llvm/llvm-project/pull/76696

UniformityInfo has a transitive dependence on CycleInfo. A transform may change the CFG in trivial ways that do not affect uniformity, but that can leave cycles in a slightly inconsistent state. In the absence of updates to CycleInfo, it's cleaner to just invalidate both analyses.

This supersedes #76011, which tries to recompute CycleInfo when computing UniformityInfo.

>From 7806a549b45a8d0cb6e42b66cac93dcecad56207 Mon Sep 17 00:00:00 2001
From: Sameer Sahasrabuddhe <sameer.sahasrabuddhe at amd.com>
Date: Sat, 23 Dec 2023 13:52:18 +0530
Subject: [PATCH] [AMDGPU] Do not preserve UniformityInfo

UniformityInfo has a transitive dependence on CycleInfo. A transform may change
the CFG in trivial ways that do not affect uniformity, but that can leave cycles
in a slightly inconsistent state. In the absence of updates to CycleInfo, it's
cleaner to just invalidate both analyses.
---
 llvm/lib/Target/AMDGPU/AMDGPURewriteUndefForPHI.cpp      | 1 -
 llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/llvm/lib/Target/AMDGPU/AMDGPURewriteUndefForPHI.cpp b/llvm/lib/Target/AMDGPU/AMDGPURewriteUndefForPHI.cpp
index 459400e3359ca1..79e9312034da45 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPURewriteUndefForPHI.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPURewriteUndefForPHI.cpp
@@ -85,7 +85,6 @@ class AMDGPURewriteUndefForPHILegacy : public FunctionPass {
     AU.addRequired<DominatorTreeWrapperPass>();
 
     AU.addPreserved<DominatorTreeWrapperPass>();
-    AU.addPreserved<UniformityInfoWrapperPass>();
     AU.setPreservesCFG();
   }
 };
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp b/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
index 9bc3ba161c9ebe..1bfb7c0edd80a9 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
@@ -109,9 +109,6 @@ void AMDGPUUnifyDivergentExitNodes::getAnalysisUsage(AnalysisUsage &AU) const {
     // FIXME: preserve PostDominatorTreeWrapperPass
   }
 
-  // No divergent values are changed, only blocks and branch edges.
-  AU.addPreserved<UniformityInfoWrapperPass>();
-
   // We preserve the non-critical-edgeness property
   AU.addPreservedID(BreakCriticalEdgesID);
 



More information about the llvm-commits mailing list