13
13
14
14
#include " AMDGPU.h"
15
15
#include " GCNSubtarget.h"
16
- #include " llvm/Analysis/LegacyDivergenceAnalysis.h"
17
16
#include " llvm/Analysis/LoopInfo.h"
17
+ #include " llvm/Analysis/UniformityAnalysis.h"
18
18
#include " llvm/CodeGen/TargetPassConfig.h"
19
19
#include " llvm/IR/BasicBlock.h"
20
20
#include " llvm/IR/Constants.h"
@@ -36,7 +36,7 @@ using StackEntry = std::pair<BasicBlock *, Value *>;
36
36
using StackVector = SmallVector<StackEntry, 16 >;
37
37
38
38
class SIAnnotateControlFlow : public FunctionPass {
39
- LegacyDivergenceAnalysis *DA ;
39
+ UniformityInfo *UA ;
40
40
41
41
Type *Boolean;
42
42
Type *Void;
@@ -99,7 +99,7 @@ class SIAnnotateControlFlow : public FunctionPass {
99
99
void getAnalysisUsage (AnalysisUsage &AU) const override {
100
100
AU.addRequired <LoopInfoWrapperPass>();
101
101
AU.addRequired <DominatorTreeWrapperPass>();
102
- AU.addRequired <LegacyDivergenceAnalysis >();
102
+ AU.addRequired <UniformityInfoWrapperPass >();
103
103
AU.addPreserved <LoopInfoWrapperPass>();
104
104
AU.addPreserved <DominatorTreeWrapperPass>();
105
105
AU.addRequired <TargetPassConfig>();
@@ -112,7 +112,7 @@ class SIAnnotateControlFlow : public FunctionPass {
112
112
INITIALIZE_PASS_BEGIN (SIAnnotateControlFlow, DEBUG_TYPE,
113
113
" Annotate SI Control Flow" , false , false )
114
114
INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass)
115
- INITIALIZE_PASS_DEPENDENCY(LegacyDivergenceAnalysis )
115
+ INITIALIZE_PASS_DEPENDENCY(UniformityInfoWrapperPass )
116
116
INITIALIZE_PASS_DEPENDENCY(TargetPassConfig)
117
117
INITIALIZE_PASS_END(SIAnnotateControlFlow, DEBUG_TYPE,
118
118
" Annotate SI Control Flow" , false , false )
@@ -146,7 +146,7 @@ void SIAnnotateControlFlow::initialize(Module &M, const GCNSubtarget &ST) {
146
146
// / Is the branch condition uniform or did the StructurizeCFG pass
147
147
// / consider it as such?
148
148
bool SIAnnotateControlFlow::isUniform (BranchInst *T) {
149
- return DA ->isUniform (T) ||
149
+ return UA ->isUniform (T) ||
150
150
T->getMetadata (" structurizecfg.uniform" ) != nullptr ;
151
151
}
152
152
@@ -336,7 +336,7 @@ bool SIAnnotateControlFlow::closeControlFlow(BasicBlock *BB) {
336
336
bool SIAnnotateControlFlow::runOnFunction (Function &F) {
337
337
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree ();
338
338
LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo ();
339
- DA = &getAnalysis<LegacyDivergenceAnalysis> ();
339
+ UA = &getAnalysis<UniformityInfoWrapperPass>(). getUniformityInfo ();
340
340
TargetPassConfig &TPC = getAnalysis<TargetPassConfig>();
341
341
const TargetMachine &TM = TPC.getTM <TargetMachine>();
342
342
0 commit comments