[PATCH] D74651: Add IR constructs for inalloca replacement preallocated call setup
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 23 15:47:55 PDT 2020
efriedma added a comment.
> I think if we model calls with preallocated bundles as modifying inaccessible state (i.e. the stack pointer), LLVM transforms won't do this.
I don't think that's enough in general. Well, maybe it's enough for the transforms we actually implement... LLVM currently has very few transforms that fold code together.
But a simple example, suppose we had a transform that took `void g(); void f() { g();g();g();g();g(); }` and transformed it into something like `void g(); void f() { for (int i =0; i < n; ++i) g(); }`. Looks fine generally. If the loop body is a sequence containing calls to `llvm.call.preallocated.setup()`/`llvm.call.preallocated.arg()`, maybe not so fine. (I think this is only an issue if there is no call actually consuming the stack; if there were, the token would block the transform.)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74651/new/
https://reviews.llvm.org/D74651
More information about the llvm-commits
mailing list