This is an archive of the discontinued LLVM Phabricator instance.

Relax assertion in x86_64 byval argument handling for 32-bit pointers
ClosedPublic

Authored by dschuff on Jun 24 2015, 11:27 AM.

Details

Summary

Byval argument pair formation assumes that if a type is less than 8 bytes
it must be an integer and not a pointer, which is not true for x32 and NaCl.

Relax the assertion and add a test for a codegen case that triggered it.

Diff Detail

Repository
rL LLVM

Event Timeline

dschuff updated this revision to Diff 28375.Jun 24 2015, 11:27 AM
dschuff retitled this revision from to Relax assertion in x86_64 byval argument handling for 32-bit pointers.
dschuff added a reviewer: jvoung.
dschuff updated this object.
dschuff added a subscriber: Unknown Object (MLST).
jvoung added inline comments.Jun 24 2015, 2:04 PM
lib/CodeGen/TargetInfo.cpp
2501 ↗(On Diff #28375)

For the old "two sorts of types..." comment, technically a pointer type is still a separate type from i8/i16/i32, so it would be worth updating the comment for x32 pointers.

I assume that the rest of the code knows how to cast a pointer type to the wider i64 type.

dschuff updated this revision to Diff 28407.Jun 24 2015, 2:22 PM
  • update comment
lib/CodeGen/TargetInfo.cpp
2501 ↗(On Diff #28375)

Updated the comment.
And yes, the rest of the code handles this case just fine.

jvoung accepted this revision.Jun 24 2015, 3:03 PM
jvoung edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jun 24 2015, 3:03 PM
This revision was automatically updated to reflect the committed changes.

Oops, this was rL240600 and rL240601 because I fail at git-svn.