This is an archive of the discontinued LLVM Phabricator instance.

[test][InstCombine] Add tests for removing memcpy to an alloca that is passed to a readonly nocapture function parameter, in preparation for D136822.
ClosedPublic

Authored by pcwalton on Oct 29 2022, 7:07 PM.

Details

Summary

This commit adds tests to Transforms/InstCombine/memcpy-from-global.ll that
test various situations involving memcpy from a constant to an alloca that is
then passed to function parameters with various attributes. The forthcoming
D136822 allows InstCombine to remove these memcpys if they're passed to a
single readonly nocapture parameter.

Diff Detail

Event Timeline

pcwalton created this revision.Oct 29 2022, 7:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2022, 7:07 PM
pcwalton requested review of this revision.Oct 29 2022, 7:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 29 2022, 7:07 PM

I'm unsure if this needs review, but I thought I would ask to be safe.

At the top right, you will find Edit Related Revisions.... .

nikic accepted this revision.Oct 30 2022, 1:00 AM

LGTM

This revision is now accepted and ready to land.Oct 30 2022, 1:00 AM