Skip to content

Commit

Permalink
[AMDGPU] Simplify alias stripping to use utility function
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuber6 committed Jul 17, 2024
1 parent 60b6f43 commit 351a4b2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions llvm/lib/Target/AMDGPU/AMDGPUResourceUsageAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,7 @@ static const Function *getCalleeFunction(const MachineOperand &Op) {
assert(Op.getImm() == 0);
return nullptr;
}
const GlobalValue *GV = Op.getGlobal();
while (auto *GA = dyn_cast<GlobalAlias>(GV))
GV = cast<GlobalValue>(GA->getOperand(0));
return cast<Function>(GV);
return cast<Function>(Op.getGlobal()->stripPointerCastsAndAliases());
}

static bool hasAnyNonFlatUseOfReg(const MachineRegisterInfo &MRI,
Expand Down

0 comments on commit 351a4b2

Please sign in to comment.