Skip to content

Commit 2259a80

Browse files
authored
[ARM] Simplify LowerCMP (NFC) (#156198)
Pass the opcode directly.
1 parent 34fbf1f commit 2259a80

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10539,19 +10539,11 @@ SDValue ARMTargetLowering::LowerCMP(SDValue Op, SelectionDAG &DAG) const {
1053910539
}
1054010540

1054110541
// Generate the operation with flags
10542-
SDValue OpWithFlags;
10543-
if (Opcode == ARMISD::ADDC) {
10544-
// Use ADDC: LHS + RHS (where RHS was 0 - X, now X)
10545-
OpWithFlags = DAG.getNode(ARMISD::ADDC, dl,
10546-
DAG.getVTList(MVT::i32, FlagsVT), LHS, RHS);
10547-
} else {
10548-
// Use ARMISD::SUBC to generate SUBS instruction (subtract with flags)
10549-
OpWithFlags = DAG.getNode(ARMISD::SUBC, dl,
10550-
DAG.getVTList(MVT::i32, FlagsVT), LHS, RHS);
10551-
}
10542+
SDValue OpWithFlags =
10543+
DAG.getNode(Opcode, dl, DAG.getVTList(MVT::i32, FlagsVT), LHS, RHS);
1055210544

10553-
SDValue OpResult = OpWithFlags.getValue(0); // The operation result
10554-
SDValue Flags = OpWithFlags.getValue(1); // The flags
10545+
SDValue OpResult = OpWithFlags.getValue(0);
10546+
SDValue Flags = OpWithFlags.getValue(1);
1055510547

1055610548
// Constants for conditional moves
1055710549
SDValue One = DAG.getConstant(1, dl, MVT::i32);

0 commit comments

Comments
 (0)