This is an archive of the discontinued LLVM Phabricator instance.

[ArgumentPromotion] Fix byval alignment handling.
ClosedPublic

Authored by efriedma on Oct 20 2020, 1:17 PM.

Details

Summary

Make sure the alignment of the generated operations matches the alignment of the byval argument. Previously, we were just ignoring alignment and getting lucky.

While I'm here, also delete the unnecessary "tail" handling. Passing a pointer to a byval argument to a "tail" call is UB, so rewriting to an alloca doesn't require any special handling.

Diff Detail

Event Timeline

efriedma created this revision.Oct 20 2020, 1:17 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 20 2020, 1:17 PM
efriedma requested review of this revision.Oct 20 2020, 1:17 PM
fhahn accepted this revision.Nov 2 2020, 1:37 PM

LGTM, thanks!

It looks like all relevant tests have been updated to add parameter alignment. Could you also add a test without alignment and check that it is not transformed? (or perhaps such a test already exists)

This revision is now accepted and ready to land.Nov 2 2020, 1:37 PM
fhahn added a comment.May 11 2021, 8:59 AM

reverse ping :)

@efriedma are you still planning on landing this change?

Sorry, forgot about this; I'll fix up the test and land it now.

This revision was landed with ongoing or failed builds.May 11 2021, 11:22 AM
This revision was automatically updated to reflect the committed changes.
llvm/test/Transforms/ArgumentPromotion/dbg.ll