This is an archive of the discontinued LLVM Phabricator instance.

Resolve a long-standing FIXME in memcpyopt.
ClosedPublic

Authored by resistor on Dec 22 2022, 8:27 PM.

Details

Summary

Inspecting the downstream use of the cpyAlign, it is clear that
performCallSlotOptzn is expecting it to represent the alignment
of the copy destination, not the minimum of the src and dest
alignments. This patch renames the parameter to make this more
obvious.

I believe this change is NFC, because the downstream code has
alignment checks such that it all works out in the end. I have not
been able to construct a test case that actually triggers a change
in output.

Diff Detail

Event Timeline

resistor created this revision.Dec 22 2022, 8:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 8:27 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
resistor requested review of this revision.Dec 22 2022, 8:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 8:27 PM
resistor updated this revision to Diff 485030.Dec 22 2022, 8:28 PM

Remove accidentally added cruft.

resistor updated this revision to Diff 485032.Dec 22 2022, 8:29 PM

Actually remove the FIXME

nikic requested changes to this revision.Dec 23 2022, 12:32 AM

You should be able to test this as follows: https://llvm.godbolt.org/z/ascrvMxPd Both should be equivalent after this change.

This revision now requires changes to proceed.Dec 23 2022, 12:32 AM

Thank you for the test case.

Something strange is occurring here. When I run the test you provided through opt manually, I see the expected outcome. When I add that test to test/Transforms/MemCpyOpt/callslot.ll I don't see the transformation happening.

I need to dig into what's going wrong...

resistor updated this revision to Diff 485153.Dec 23 2022, 1:18 PM

Add testcase

nikic accepted this revision.Dec 23 2022, 3:13 PM

LGTM, thanks!

This revision is now accepted and ready to land.Dec 23 2022, 3:13 PM
resistor updated this revision to Diff 485163.Dec 23 2022, 3:15 PM

Rebase and update commit message.

This revision was landed with ongoing or failed builds.Dec 23 2022, 3:15 PM
This revision was automatically updated to reflect the committed changes.