Skip to content

Commit

Permalink
[AMDGPU] Do not preserve UniformityInfo (#76696)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ssahasra committed Jan 2, 2024
1 parent b51f8f1 commit 4c2ad82
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions llvm/include/llvm/ADT/GenericUniformityImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
/// the propagation of the impact of divergent control flow on the divergence of
/// values (sync dependencies).
///
/// NOTE: In general, no interface exists for a transform to update
/// (Machine)UniformityInfo. Additionally, (Machine)CycleAnalysis is a
/// transitive dependence, but it also does not provide an interface for
/// updating itself. Given that, transforms should not preserve uniformity in
/// their getAnalysisUsage() callback.
///
//===----------------------------------------------------------------------===//

#ifndef LLVM_ADT_GENERICUNIFORMITYIMPL_H
Expand Down
1 change: 0 additions & 1 deletion llvm/lib/Target/AMDGPU/AMDGPURewriteUndefForPHI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ class AMDGPURewriteUndefForPHILegacy : public FunctionPass {
AU.addRequired<DominatorTreeWrapperPass>();

AU.addPreserved<DominatorTreeWrapperPass>();
AU.addPreserved<UniformityInfoWrapperPass>();
AU.setPreservesCFG();
}
};
Expand Down
3 changes: 0 additions & 3 deletions llvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4c2ad82

Please sign in to comment.