This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Avoid deleting volatile memcpys.
ClosedPublic

Authored by pcwalton on Oct 29 2022, 5:36 PM.

Details

Summary

InstCombine can replace memcpy to an alloca with a pointer directly to the
source in certain cases. Unfortunately, it also did so for volatile memcpys.
This patch makes it stop doing that.

This was discovered in D136822.

Diff Detail

Event Timeline

pcwalton created this revision.Oct 29 2022, 5:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2022, 5:36 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
pcwalton requested review of this revision.Oct 29 2022, 5:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2022, 5:36 PM

I noticed that the memcpy in the asan test case is volatile without any changes, so I shouldn't need to touch that test case now.

nikic accepted this revision.Oct 30 2022, 12:54 AM

LGTM

FYI If you add "Depends on D137029." when submitting the review, this will add a child revision and make the pre-commit CI work.

This revision is now accepted and ready to land.Oct 30 2022, 12:54 AM
This revision was landed with ongoing or failed builds.Oct 30 2022, 2:40 AM
This revision was automatically updated to reflect the committed changes.