This is an archive of the discontinued LLVM Phabricator instance.

[X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand.
ClosedPublic

Authored by craig.topper on Apr 3 2019, 12:50 PM.

Details

Summary

This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between Jcc instructions and condition codes.

Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 3 2019, 12:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2019, 12:50 PM
RKSimon added inline comments.Apr 4 2019, 5:11 AM
llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
1333

Worth doing a LLVM_FALLTHROUGH here?

craig.topper marked an inline comment as done.Apr 4 2019, 8:08 AM
craig.topper added inline comments.
llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
1333

By hoisting Adder out of the switch and initializing to 0?

RKSimon added inline comments.Apr 4 2019, 8:19 AM
llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
1333

Yeah - "OpcodeOffset" or something.......

Use LLVM_FALLTHROUGH in the encoder

RKSimon accepted this revision.Apr 5 2019, 5:20 AM

LGTM

This revision is now accepted and ready to land.Apr 5 2019, 5:20 AM
This revision was automatically updated to reflect the committed changes.