[PATCH] D97974: [gvn] CSE gc.relocates based on meaning, not spelling
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 4 12:40:56 PST 2021
reames created this revision.
reames added reviewers: skatkov, dantrushin.
Herald added subscribers: hiraditya, mcrosier.
Herald added a reviewer: bollu.
reames requested review of this revision.
Herald added a subscriber: jdoerfert.
Herald added a project: LLVM.
The last two operands to a gc.relocate represent indices into the associated gc.statepoint's gc bundle list. (Effectively, gc.relocates are projections from the gc.statepoints multiple return values.)
We can use this to recognize when two gc.relocates are equivalent (and can be CSEd), even when the indices are non-equal. This is particular useful when considering a chain of multiple statepoints as it lets us eliminate all duplicate gc.relocates in a single pass.
The meat of the change isn't actually in GVN. For some reason, we had been marking gc.relocates as reading memory. This change undoes that. I believe this to be a legacy of very early implementation conservatism, but a skeptical view is appreciated. (The EarlyCSE change is simply moving the special casing from readonly to readnone handling.)
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D97974
Files:
llvm/include/llvm/IR/Intrinsics.td
llvm/lib/Transforms/Scalar/EarlyCSE.cpp
llvm/lib/Transforms/Scalar/GVN.cpp
llvm/test/Transforms/GVN/gc_relocate.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97974.328274.patch
Type: text/x-patch
Size: 6905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210304/b07d2535/attachment.bin>
More information about the llvm-commits
mailing list