Skip to content

Commit cb3cea5

Browse files
s-barannikovGroverkss
authored andcommitted
[TableGen][SelectionDAG] Remove the implicit DAG node (llvm#115295)
The node was introduced in 59c39dc and was intended to allow writing patterns like this: `[(set AL, (mul AL, GR8:$src1)), (implicit EFLAGS)]` However, it does not introduce new functionality because the same pattern can be equivalently expressed as: `[(set AL, EFLAGS, (mul 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 74f40d3 commit cb3cea5

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

@@ -5912,34 +5911,34 @@ multiclass FPComparison<bit signalAllNans, string asm,
59125911
SDPatternOperator OpNode = null_frag> {
59135912
let Defs = [NZCV] in {
59145913
def Hrr : BaseTwoOperandFPComparison<signalAllNans, FPR16, asm,
5915-
[(OpNode (f16 FPR16:$Rn), (f16 FPR16:$Rm)), (implicit NZCV)]> {
5914+
[(OpNode (f16 FPR16:$Rn), (f16 FPR16:$Rm))]> {
59165915
let Inst{23-22} = 0b11;
59175916
let Predicates = [HasFullFP16];
59185917
}
59195918

59205919
def Hri : BaseOneOperandFPComparison<signalAllNans, FPR16, asm,
5921-
[(OpNode (f16 FPR16:$Rn), fpimm0), (implicit NZCV)]> {
5920+
[(OpNode (f16 FPR16:$Rn), fpimm0)]> {
59225921
let Inst{23-22} = 0b11;
59235922
let Predicates = [HasFullFP16];
59245923
}
59255924

59265925
def Srr : BaseTwoOperandFPComparison<signalAllNans, FPR32, asm,
5927-
[(OpNode FPR32:$Rn, (f32 FPR32:$Rm)), (implicit NZCV)]> {
5926+
[(OpNode FPR32:$Rn, (f32 FPR32:$Rm))]> {
59285927
let Inst{23-22} = 0b00;
59295928
}
59305929

59315930
def Sri : BaseOneOperandFPComparison<signalAllNans, FPR32, asm,
5932-
[(OpNode (f32 FPR32:$Rn), fpimm0), (implicit NZCV)]> {
5931+
[(OpNode (f32 FPR32:$Rn), fpimm0)]> {
59335932
let Inst{23-22} = 0b00;
59345933
}
59355934

59365935
def Drr : BaseTwoOperandFPComparison<signalAllNans, FPR64, asm,
5937-
[(OpNode FPR64:$Rn, (f64 FPR64:$Rm)), (implicit NZCV)]> {
5936+
[(OpNode FPR64:$Rn, (f64 FPR64:$Rm))]> {
59385937
let Inst{23-22} = 0b01;
59395938
}
59405939

59415940
def Dri : BaseOneOperandFPComparison<signalAllNans, FPR64, asm,
5942-
[(OpNode (f64 FPR64:$Rn), fpimm0), (implicit NZCV)]> {
5941+
[(OpNode (f64 FPR64:$Rn), fpimm0)]> {
59435942
let Inst{23-22} = 0b01;
59445943
}
59455944
} // Defs = [NZCV]

0 commit comments

Comments
 (0)