Skip to content

Commit f3b9878

Browse files
committed
[DAG] ComputeNumSignBits - add ISD::SCMP/UCMP handling
1 parent bcb4984 commit f3b9878

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4999,6 +4999,11 @@ unsigned SelectionDAG::ComputeNumSignBits(SDValue Op, const APInt &DemandedElts,
49994999
TargetLowering::ZeroOrNegativeOneBooleanContent)
50005000
return VTBits;
50015001
break;
5002+
case ISD::SCMP:
5003+
case ISD::UCMP:
5004+
// Returns -1/0/1 with i2 type or larger.
5005+
assert(VTBits >= 2 && "Result type not large enough for SCMP/UCMP node");
5006+
return VTBits - 1;
50025007
case ISD::SETCC:
50035008
case ISD::SETCCCARRY:
50045009
case ISD::STRICT_FSETCC:

0 commit comments

Comments
 (0)