Skip to content

Commit 753eddd

Browse files
authored
[RISCV] Mark OR used in czero select lowering as disjoint (llvm#155654)
This has no test impact at the moment, just being pedantic. Since one of the arms must always be zero, there are no common bits.
1 parent aa46657 commit 753eddd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9339,7 +9339,8 @@ SDValue RISCVTargetLowering::lowerSELECT(SDValue Op, SelectionDAG &DAG) const {
93399339
return DAG.getNode(
93409340
ISD::OR, DL, VT,
93419341
DAG.getNode(RISCVISD::CZERO_EQZ, DL, VT, TrueV, CondV),
9342-
DAG.getNode(RISCVISD::CZERO_NEZ, DL, VT, FalseV, CondV));
9342+
DAG.getNode(RISCVISD::CZERO_NEZ, DL, VT, FalseV, CondV),
9343+
SDNodeFlags::Disjoint);
93439344
}
93449345

93459346
if (SDValue V = combineSelectToBinOp(Op.getNode(), DAG, Subtarget))
@@ -16071,9 +16072,10 @@ static SDValue combineOrOfCZERO(SDNode *N, SDValue N0, SDValue N1,
1607116072

1607216073
SDValue NewN0 = DAG.getNode(RISCVISD::CZERO_EQZ, DL, VT, TrueV.getOperand(0),
1607316074
Cond);
16074-
SDValue NewN1 = DAG.getNode(RISCVISD::CZERO_NEZ, DL, VT, FalseV.getOperand(0),
16075-
Cond);
16076-
SDValue NewOr = DAG.getNode(ISD::OR, DL, VT, NewN0, NewN1);
16075+
SDValue NewN1 =
16076+
DAG.getNode(RISCVISD::CZERO_NEZ, DL, VT, FalseV.getOperand(0), Cond);
16077+
SDValue NewOr =
16078+
DAG.getNode(ISD::OR, DL, VT, NewN0, NewN1, SDNodeFlags::Disjoint);
1607716079
return DAG.getNode(ISD::XOR, DL, VT, NewOr, TrueV.getOperand(1));
1607816080
}
1607916081

0 commit comments

Comments
 (0)