Skip to content

Commit 4c2ad82

Browse files
authored
[AMDGPU] Do not preserve UniformityInfo (#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.
1 parent b51f8f1 commit 4c2ad82

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

llvm/include/llvm/ADT/GenericUniformityImpl.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
/// the propagation of the impact of divergent control flow on the divergence of
3434
/// values (sync dependencies).
3535
///
36+
/// NOTE: In general, no interface exists for a transform to update
37+
/// (Machine)UniformityInfo. Additionally, (Machine)CycleAnalysis is a
38+
/// transitive dependence, but it also does not provide an interface for
39+
/// updating itself. Given that, transforms should not preserve uniformity in
40+
/// their getAnalysisUsage() callback.
41+
///
3642
//===----------------------------------------------------------------------===//
3743

3844
#ifndef LLVM_ADT_GENERICUNIFORMITYIMPL_H

llvm/lib/Target/AMDGPU/AMDGPURewriteUndefForPHI.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ class AMDGPURewriteUndefForPHILegacy : public FunctionPass {
8585
AU.addRequired<DominatorTreeWrapperPass>();
8686

8787
AU.addPreserved<DominatorTreeWrapperPass>();
88-
AU.addPreserved<UniformityInfoWrapperPass>();
8988
AU.setPreservesCFG();
9089
}
9190
};

llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ void AMDGPUUnifyDivergentExitNodes::getAnalysisUsage(AnalysisUsage &AU) const {
109109
// FIXME: preserve PostDominatorTreeWrapperPass
110110
}
111111

112-
// No divergent values are changed, only blocks and branch edges.
113-
AU.addPreserved<UniformityInfoWrapperPass>();
114-
115112
// We preserve the non-critical-edgeness property
116113
AU.addPreservedID(BreakCriticalEdgesID);
117114

0 commit comments

Comments
 (0)