This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel] Fix offsets to valueIsSplit
ClosedPublic

Authored by aemerson on Jul 17 2018, 11:48 AM.

Details

Summary

This fix is for IRtranslator. Offsets passed to valueIsSplit() are stored by appending which ends up continuously appending offsets which were already resolved for the same type.

Here is a test case for our target were the two structs are passed in 4x 64b registers.

define i64 @param_two_struct([2 x i64] %t.coerce, [2 x i64] %s.coerce) {
entry:

%t.coerce.fca.0.extract = extractvalue [2 x i64] %t.coerce, 0
%s.coerce.fca.1.extract = extractvalue [2 x i64] %s.coerce, 1
%add = add nsw i64 %s.coerce.fca.1.extract, %t.coerce.fca.0.extract
ret i64 %add

Diff Detail

Repository
rL LLVM

Event Timeline

asmith created this revision.Jul 17 2018, 11:48 AM
aemerson accepted this revision.Aug 7 2018, 12:30 PM

Could you upload with more context please, and a test case?

Thanks,
Amara

This revision is now accepted and ready to land.Aug 7 2018, 12:30 PM
aemerson requested changes to this revision.Aug 7 2018, 12:30 PM
This revision now requires changes to proceed.Aug 7 2018, 12:30 PM

Thinking about this more, I can't think of any reason why we'd ever want to add offsets to an existing offset list. It would probably be better if valueIsSpit cleared the vector (and the doc comment made this clear).

aemerson added a subscriber: llvm-commits.
aemerson commandeered this revision.Aug 14 2018, 4:56 AM
aemerson edited reviewers, added: asmith; removed: aemerson.

I'll take over and fix this in the way I suggested. Thanks for reporting this!

This revision was not accepted when it landed; it landed in state Needs Revision.Aug 14 2018, 5:05 AM
This revision was automatically updated to reflect the committed changes.

Been out of town. Thanks for fixing this!