[llvm] Reapply [AMDGPU] Avoid resource propagation for recursion through multiple functions (PR #112251)
Janek van Oirschot via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 31 06:35:55 PDT 2024
JanekvO wrote:
> What is the problem with creating a recursive expression?
The evaluation of the `MCExpr` will infinitely loop: https://github.com/llvm/llvm-project/issues/110863
> Can you deal with the recursion when the expression is evaluated instead of avoiding creating it?
It'd have to be in the `SymbolRef` case of `MCExpr::evaluateAsRelocatableImpl` which is an interface overloaded by all the target specific `MCExpr`. Perhaps I could add something in `AMDGPUMCExpr::evaluateAsRelocatableImpl` that deviates from the recursive walk to detect recursion but it would more than likely move the recursion detection I have here to `AMDGPUMCExpr::evaluateAsRelocatableImpl`. Additionally, that would still assume the recursion occurs within one of the AMDGPU specific `MCExpr` and not cover the case only looking through generic `MCExpr`.
https://github.com/llvm/llvm-project/pull/112251
More information about the llvm-commits
mailing list