[PATCH] D58260: [INLINER] allow inlining of blockaddresses if sole uses are callbrs
Bill Wendling via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 29 13:38:49 PDT 2019
void added a comment.
In D58260#1482993 <https://reviews.llvm.org/D58260#1482993>, @efriedma wrote:
> > But should it?
>
> It seems like a reasonable optimization, depending on the code structure.
>
> > That implies that a blockaddress that's propagated to other functions aren't used by anything other than arithmetic and comparison instructions.
>
> The important thing is that it can also be returned back to the original function, either directly, or indirectly through memory.
Right. My point is that it's equivalent to passing a pointer around, except that the pointer cannot be dereferenced anywhere except the originating function. (For the purposes of what Nick's trying to do, "originating function" includes code that's inlined into a function.) As long as IPSCCP and the like don't violate that constraint, passing the pointer around isn't going to cause semantic changes to the program. (A function that tries to jump to a block address that's not within that function is already undefined and still should be.)
Perhaps I'm missing something though...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D58260/new/
https://reviews.llvm.org/D58260
More information about the llvm-commits
mailing list