Skip to content

Commit 351a4b2

Browse files
committed
[AMDGPU] Simplify alias stripping to use utility function
1 parent 60b6f43 commit 351a4b2

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,7 @@ static const Function *getCalleeFunction(const MachineOperand &Op) {
6565
assert(Op.getImm() == 0);
6666
return nullptr;
6767
}
68-
const GlobalValue *GV = Op.getGlobal();
69-
while (auto *GA = dyn_cast<GlobalAlias>(GV))
70-
GV = cast<GlobalValue>(GA->getOperand(0));
71-
return cast<Function>(GV);
68+
return cast<Function>(Op.getGlobal()->stripPointerCastsAndAliases());
7269
}
7370

7471
static bool hasAnyNonFlatUseOfReg(const MachineRegisterInfo &MRI,

0 commit comments

Comments
 (0)