[PATCH] D73943: [WebAssembly] Make stack pointer args inhibit tail calls
Heejin Ahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 5 17:14:54 PST 2020
aheejin added a comment.
I also did a quick search for what other backends are doing, and they are all kind of different. Many targets seem to implement some function called `isEligibleForTailCallOptimization` <https://github.com/llvm/llvm-project/search?q=isEligibleForTailCallOptimization&unscoped_q=isEligibleForTailCallOptimization>, even though the superclass `TargetLowering` does not have that method. Anyway, I think it would be fine if we add things we need on an as-needed basis.
================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:738
+ Val = Src;
+ }
+ if (isa<AllocaInst>(Val)) {
----------------
I think there can be other cases other than geps and aliases; looking at [[ https://github.com/llvm/llvm-project/blob/0c3b2986ac6b71abc649811c3ec9cb0bf073c7d8/llvm/lib/IR/Value.cpp#L466-L527 | this function ]] might give some ideas. Skimming at the code, it looks [[ https://github.com/llvm/llvm-project/blob/0c3b2986ac6b71abc649811c3ec9cb0bf073c7d8/llvm/lib/IR/Value.cpp#L605-L607 | `stripPointerCastsAndOffsets` ]] does the most comprehensive checking we need.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73943/new/
https://reviews.llvm.org/D73943
More information about the llvm-commits
mailing list