[PATCH] D88328: [InferAttrs] Improve DSE for libcalls (partial fix for PR47644)
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 18 07:51:59 PDT 2020
fhahn added a comment.
In D88328#2337212 <https://reviews.llvm.org/D88328#2337212>, @xbolva00 wrote:
> Test cases work for me with clang/opt 11 with mssa dse
>
> https://godbolt.org/z/648nMq
>
> https://godbolt.org/z/qPaMME
I think there was a change how `lifetime.end` is handled in MemorySSA. Adjusted DSE in f5cf7f544b7abe8488f76945537044f700b5548a <https://reviews.llvm.org/rGf5cf7f544b7abe8488f76945537044f700b5548a>.
================
Comment at: llvm/test/Transforms/PhaseOrdering/dse-libcalls.ll:13
+; OLDPM-LABEL: @dse_strcpy(
+; OLDPM-NEXT: ret void
+;
----------------
jdoerfert wrote:
> I'm unsure how this is optimized because I don't see `argmemonly` on the `strcpy`. Did I miss it? If not, what is the justification here?
I think this is due to an inconsistency with the attributes. The implicit assumption is that MemoryLocation::getForArgument currently only returns a proper location for `argmemonly` I think. We should mark them as `argmemonly` and then probably have an assert in `getLocationFor` that is is only used for such functions.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88328/new/
https://reviews.llvm.org/D88328
More information about the llvm-commits
mailing list