Skip to content

Commit 3987ffb

Browse files
committed
[TableGen][SelectionDAG] Remove the implicit DAG node
The node was introduced in 59c39dc and was intended to allow writing patterns like this: `[(set AL, (MULr8 AL, GR8:$src1)), (implicit EFLAGS)]` However, it does not introduce new functionality because the same pattern can be equivalently expressed as: `[(set AL, EFLAGS, (node AL, GR8:$src1))]` The latter form is also more flexible as it allows reordering output operands. In most places uses of `implicit` were redundant -- removing them didn't change anything in the generated DAG tables. The only three cases where it did have effect are in X86InstrArithmetic.td and X86InstrSystem.td -- those were rewritten to use `set` node. Removing `implicit` from some patterns made them importable by GISel, hence the change in a test.
1 parent 2d7f34f commit 3987ffb

File tree

12 files changed

+149
-257
lines changed

12 files changed

+149
-257
lines changed

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2579,8 +2579,7 @@ class BaseAddSubCarry<bit isSub, RegisterClass regtype, string asm,
25792579
class BaseAddSubCarrySetFlags<bit isSub, RegisterClass regtype, string asm,
25802580
SDNode OpNode>
25812581
: BaseBaseAddSubCarry<isSub, regtype, asm,
2582-
[(set regtype:$Rd, (OpNode regtype:$Rn, regtype:$Rm, NZCV)),
2583-
(implicit NZCV)]> {
2582+
[(set regtype:$Rd, (OpNode regtype:$Rn, regtype:$Rm, NZCV))]> {
25842583
let Defs = [NZCV];
25852584
}
25862585

@@ -5891,34 +5890,34 @@ multiclass FPComparison<bit signalAllNans, string asm,
58915890
SDPatternOperator OpNode = null_frag> {
58925891
let Defs = [NZCV] in {
58935892
def Hrr : BaseTwoOperandFPComparison<signalAllNans, FPR16, asm,
5894-
[(OpNode (f16 FPR16:$Rn), (f16 FPR16:$Rm)), (implicit NZCV)]> {
5893+
[(OpNode (f16 FPR16:$Rn), (f16 FPR16:$Rm))]> {
58955894
let Inst{23-22} = 0b11;
58965895
let Predicates = [HasFullFP16];
58975896
}
58985897

58995898
def Hri : BaseOneOperandFPComparison<signalAllNans, FPR16, asm,
5900-
[(OpNode (f16 FPR16:$Rn), fpimm0), (implicit NZCV)]> {
5899+
[(OpNode (f16 FPR16:$Rn), fpimm0)]> {
59015900
let Inst{23-22} = 0b11;
59025901
let Predicates = [HasFullFP16];
59035902
}
59045903

59055904
def Srr : BaseTwoOperandFPComparison<signalAllNans, FPR32, asm,
5906-
[(OpNode FPR32:$Rn, (f32 FPR32:$Rm)), (implicit NZCV)]> {
5905+
[(OpNode FPR32:$Rn, (f32 FPR32:$Rm))]> {
59075906
let Inst{23-22} = 0b00;
59085907
}
59095908

59105909
def Sri : BaseOneOperandFPComparison<signalAllNans, FPR32, asm,
5911-
[(OpNode (f32 FPR32:$Rn), fpimm0), (implicit NZCV)]> {
5910+
[(OpNode (f32 FPR32:$Rn), fpimm0)]> {
59125911
let Inst{23-22} = 0b00;
59135912
}
59145913

59155914
def Drr : BaseTwoOperandFPComparison<signalAllNans, FPR64, asm,
5916-
[(OpNode FPR64:$Rn, (f64 FPR64:$Rm)), (implicit NZCV)]> {
5915+
[(OpNode FPR64:$Rn, (f64 FPR64:$Rm))]> {
59175916
let Inst{23-22} = 0b01;
59185917
}
59195918

59205919
def Dri : BaseOneOperandFPComparison<signalAllNans, FPR64, asm,
5921-
[(OpNode (f64 FPR64:$Rn), fpimm0), (implicit NZCV)]> {
5920+
[(OpNode (f64 FPR64:$Rn), fpimm0)]> {
59225921
let Inst{23-22} = 0b01;
59235922
}
59245923
} // Defs = [NZCV]

0 commit comments

Comments
 (0)