This is an archive of the discontinued LLVM Phabricator instance.

[MemCpyOpt] Remove byval to clarify test case for smaller sized memcpy(NFC)
ClosedPublic

Authored by khei4 on May 28 2023, 12:52 AM.

Details

Summary

While reading MemCpyOpt's processByValArgument, removing alignment check here causes failure in a test named smaller.ll
attributing align to its argument reduces this case, so remove byval attribute on call site.

I think smaller size memcpy than the original type is valid and should be reduced in MemCpyOpt but in this case, I think the problem is unknown alignment for the arg.

Diff Detail

Event Timeline

khei4 created this revision.May 28 2023, 12:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2023, 12:52 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
khei4 requested review of this revision.May 28 2023, 12:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 28 2023, 12:52 AM
nikic added a comment.May 28 2023, 3:10 AM

Based on the commit that introduced the test (https://github.com/llvm/llvm-project/commit/19e30d5a7d3369feae36cbe7f4f4c1f358881c41), this is indeed about the length arguments, but for a different transform. It's not intended to test the byval transform at all. I think it would be best to drop the byval attribute from this test.

khei4 planned changes to this revision.May 28 2023, 11:44 PM

@nikic Ah, thanks! I failed to find its commit.

Although not sure its size criteria are necessary(I'll see), this patch removes byval for clarification, thanks!

khei4 updated this revision to Diff 526398.May 28 2023, 11:47 PM
khei4 edited the summary of this revision. (Show Details)

remove byval

khei4 retitled this revision from [MemCpyOpt] clarify the comment in byval alignment test(NFC) to [MemCpyOpt] clarify test case for smaller sized memcpy(NFC).May 28 2023, 11:51 PM
khei4 retitled this revision from [MemCpyOpt] clarify test case for smaller sized memcpy(NFC) to [MemCpyOpt] remove byval to clarify test case for smaller sized memcpy(NFC).
khei4 retitled this revision from [MemCpyOpt] remove byval to clarify test case for smaller sized memcpy(NFC) to [MemCpyOpt] Remove byval to clarify test case for smaller sized memcpy(NFC).
nikic accepted this revision.May 29 2023, 12:09 AM

LGTM

This revision is now accepted and ready to land.May 29 2023, 12:09 AM
This revision was landed with ongoing or failed builds.May 29 2023, 12:56 AM
This revision was automatically updated to reflect the committed changes.