This is an archive of the discontinued LLVM Phabricator instance.

MIR Serialization: Serialize the implicit register flags.
ClosedPublic

Authored by arphaman on Jun 24 2015, 1:39 PM.

Details

Summary

This patch is based on a previous serialization patch that serializes register mask machine operands (http://reviews.llvm.org/D10673).

This patch serializes the implicit register flag. This patch introduces two new keywords into the
machine instruction syntax: 'implicit' and 'implicit-def'. The 'implicit' keyword is used for the implicit
register operands, and the 'implicit-def' keyword is used for the register operands that have the
implicit and define flag. Examples:

CMP32ri8 %edi, 10, implicit-def %eflags
JG_1 %bb.2.exit, implicit %eflags

This patch also adds a way to control the implicit machine operands - if a parser encounters a
register operand with an 'implicit' or 'implicit-def' flag, it will assume that this instruction specifies
all the implicit operands explicitly. But if the parser encounters an instruction that has no implicit register
operands, it will add the implicit register operands that are specified by the instruction information.
This means that the instruction:

CMP32ri8 %edi, 10

Is equivalent to:

CMP32ri8 %edi, 10, implicit-def %eflags

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 28394.Jun 24 2015, 1:39 PM
arphaman retitled this revision from to MIR Serialization: Serialize the implicit register flags..
arphaman updated this object.
arphaman edited the test plan for this revision. (Show Details)
arphaman added reviewers: dexonsmith, bob.wilson, bogner.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: Unknown Object (MLST).
arphaman updated this revision to Diff 28587.Jun 26 2015, 11:58 AM

The updated patch now follows a more conservative approach, where the machine instruction parser doesn't add the implicit register operands to instructions that don't specify any implicit operands.

arphaman updated this revision to Diff 28809.Jun 30 2015, 12:35 PM

I rebased this patch on top of trunk.

This revision was automatically updated to reflect the committed changes.