[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 21:54:06 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:
> That's definitely it, seems to just be a `do {..} while` loop. Want to just push a fix for it?
Can you do it?
https://github.com/llvm/llvm-project/pull/99034
More information about the llvm-commits
mailing list