Skip to content

Commit 321d423

Browse files
committed
[RISCV] RISCVISD::SELECT_CC is for integer comparisons only which can't create poison
The result type is irrelevant - its the comparison type that matters
1 parent a24fae3 commit 321d423

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21478,11 +21478,10 @@ bool RISCVTargetLowering::canCreateUndefOrPoisonForTargetNode(
2147821478
// TODO: Add more target nodes.
2147921479
switch (Op.getOpcode()) {
2148021480
case RISCVISD::SELECT_CC:
21481-
// Integer select_cc cannot create poison.
21482-
// TODO: What are the FP poison semantics?
21483-
// TODO: This instruction blocks poison from the unselected operand, can
21484-
// we do anything with that?
21485-
return !Op.getValueType().isInteger();
21481+
// Integer comparisons cannot create poison.
21482+
assert(Op.getOperand(0).getValueType().isInteger() &&
21483+
"RISCVISD::SELECT_CC only compares integers");
21484+
return false;
2148621485
}
2148721486
return TargetLowering::canCreateUndefOrPoisonForTargetNode(
2148821487
Op, DemandedElts, DAG, PoisonOnly, ConsiderFlags, Depth);

0 commit comments

Comments
 (0)