This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Make tied inline asm operands work again
ClosedPublic

Authored by aheejin on Sep 12 2018, 9:00 AM.

Details

Summary

rL341389 broke code with tied register operands in inline assembly. For
example, asm("" : "=r"(var) : "0"(var));
The code above specifies the input operand to be in the same register
with the output operand, tying the two register. This patch makes this
kind of code work again. Without this, this assertion fails.

Diff Detail

Repository
rL LLVM

Event Timeline

aheejin created this revision.Sep 12 2018, 9:00 AM

I don't know this code myself, but if I'm right in assuming this fixes the current waterfall failures then please commit and we can followup is others have comments.

aheejin updated this revision to Diff 165123.Sep 12 2018, 10:59 AM
  • Add comment

Without this, this assertion fails.

aheejin edited the summary of this revision. (Show Details)Sep 12 2018, 11:04 AM
dschuff accepted this revision.Sep 12 2018, 11:48 AM
This revision is now accepted and ready to land.Sep 12 2018, 11:48 AM
aheejin added a comment.EditedSep 12 2018, 2:26 PM

@dschuff Re: about your question asked in person:
If a reg operand gets tied to another operand in instruction selection, they become the same register in here in TwoAddressInstructionPass. So they are assigned to a same local in this ExplicitLocal pass, so we don't need to worry two tied operands ending up in different locals.

This revision was automatically updated to reflect the committed changes.