This is an archive of the discontinued LLVM Phabricator instance.

[Intrinsics] Make MemCpyInlineInst a MemCpyInst
ClosedPublic

Authored by jroelofs on Jun 30 2021, 4:49 PM.

Details

Summary

This opens up more optimization opportunities in passes that already handle MemCpyInst's.

Diff Detail

Event Timeline

jroelofs created this revision.Jun 30 2021, 4:49 PM
jroelofs requested review of this revision.Jun 30 2021, 4:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2021, 4:49 PM
jroelofs updated this revision to Diff 355726.Jun 30 2021, 4:50 PM

clang-format

paquette added inline comments.Jun 30 2021, 5:09 PM
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
834

This HasMemcpy variable is being used in a bunch of places, so I'm surprised this is the only change in this pass. Why is that?

jroelofs added inline comments.Jun 30 2021, 5:34 PM
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
834

We really only need to check HasMemcpy if we're about to emit one that's not inline, and there's only one spot in this pass that does that. Looks to me like the other two places that read HasMemcpy are short-cut optimizations of this fact. The one in isLegalStore probably could be relaxed this same way, but given we that we don't yet have dynamic sized llvm.memcpy.inline, I decided not to pursue that one.

paquette accepted this revision.Jul 1 2021, 5:57 PM

LGTM

This revision is now accepted and ready to land.Jul 1 2021, 5:57 PM
This revision was landed with ongoing or failed builds.Jul 2 2021, 10:26 AM
This revision was automatically updated to reflect the committed changes.