[llvm] [AMDGPU] Fix resource analysis crash on alias-to-alias function (PR #99034)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 16 10:19:42 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));
----------------
jhuber6 wrote:
I thought there might be one, so I did a cursory look at `Alias.h` but didn't find anything. Maybe there's one I missed.
https://github.com/llvm/llvm-project/pull/99034
More information about the llvm-commits
mailing list