[PATCH] D138912: [RS4GC] Rematerialize derived pointers before uses.
Denis Antrushin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 21 03:42:52 PST 2022
dantrushin marked 2 inline comments as done.
dantrushin added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp:2518
+ // Current rematerialization algorithm is very simple: we rematerialize
+ // immediately before EVERY use, even if there are several uses in same
+ // block of if use is local to Cand Def. The reason is that this allows
----------------
anna wrote:
> So, these remats will be present till the end right? Seems suboptimal (in terms of compile time) especially if we have multiple uses within a single BB.
I left it as a follow up improvement because implementing it will complicate implementation.
There may be several statepoints intermixed with uses in the same block. Handling of this is not so trivial. I think we will need some refactoring
and this initial implementation would be motivating case for it :-)
Regarding compile time:
1. Duplicating chains will be optimized away by LocalCSE (hopefully).
2. Profitability heuristic accounts for every such copy and we guaranteed to have not more copies that we would have if we rematerialized after every statepoint.
3. As a job security, this would be opportunity for possible compile time improvement project (just kidding)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138912/new/
https://reviews.llvm.org/D138912
More information about the llvm-commits
mailing list