Skip to content

Commit cbf931e

Browse files
authored
[TableGen][GlobalISel] Add GINodeEquiv for sdivrem/udivrem (#120819)
These nodes are not currently used in DAG patterns. Their GlobalISel equivalents are primarily useful for testing TableGen backend, as they produce two results. (There doesn't seem to be other such nodes.)
1 parent 5cd4274 commit cbf931e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

llvm/include/llvm/Target/GlobalISel/SelectionDAGCompat.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ def : GINodeEquiv<G_SDIV, sdiv>;
7070
def : GINodeEquiv<G_UDIV, udiv>;
7171
def : GINodeEquiv<G_SREM, srem>;
7272
def : GINodeEquiv<G_UREM, urem>;
73+
def : GINodeEquiv<G_SDIVREM, sdivrem>;
74+
def : GINodeEquiv<G_UDIVREM, udivrem>;
7375
def : GINodeEquiv<G_AND, and>;
7476
def : GINodeEquiv<G_OR, or>;
7577
def : GINodeEquiv<G_XOR, xor>;

llvm/include/llvm/Target/TargetSelectionDAG.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ def SDTIntShiftDOp: SDTypeProfile<1, 3, [ // fshl, fshr
128128
def SDTIntSatNoShOp : SDTypeProfile<1, 2, [ // ssat with no shift
129129
SDTCisSameAs<0, 1>, SDTCisInt<2>
130130
]>;
131-
def SDTIntBinHiLoOp : SDTypeProfile<2, 2, [ // mulhi, mullo, sdivrem, udivrem
132-
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>,SDTCisInt<0>
131+
def SDTIntBinHiLoOp : SDTypeProfile<2, 2, [ // smullohi, umullohi, sdivrem, udivrem
132+
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisSameAs<0, 3>, SDTCisInt<0>
133133
]>;
134134
def SDTIntScaledBinOp : SDTypeProfile<1, 3, [ // smulfix, sdivfix, etc
135135
SDTCisSameAs<0, 1>, SDTCisSameAs<0, 2>, SDTCisInt<0>, SDTCisInt<3>

0 commit comments

Comments
 (0)