[llvm] [AMDGPU] Fix resource analysis crash on alias-to-alias function (PR #99034)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 10:28:22 PDT 2024
================
@@ -65,9 +65,10 @@ static const Function *getCalleeFunction(const MachineOperand &Op) {
assert(Op.getImm() == 0);
return nullptr;
}
- if (auto *GA = dyn_cast<GlobalAlias>(Op.getGlobal()))
- return cast<Function>(GA->getOperand(0));
- return cast<Function>(Op.getGlobal());
+ const GlobalValue *GV = Op.getGlobal();
+ while (auto *GA = dyn_cast<GlobalAlias>(GV))
+ GV = cast<GlobalValue>(GA->getOperand(0));
----------------
arsenm wrote:
https://llvm.org/doxygen/classllvm_1_1Value.html#a3111ed9ce005478f88fbf8d102a89fe9
https://github.com/llvm/llvm-project/pull/99034
More information about the llvm-commits
mailing list