[RISCV] Add a check for integer setcc to RISCVDAGToDAGISel::selectCondOp
authorCraig Topper <craig.topper@sifive.com>
Sat, 25 Feb 2023 18:39:57 +0000 (10:39 -0800)
committerCraig Topper <craig.topper@sifive.com>
Sat, 25 Feb 2023 18:39:57 +0000 (10:39 -0800)
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

index 8516520..66845aa 100644 (file)
@@ -2450,6 +2450,9 @@ bool RISCVDAGToDAGISel::selectCondOp(SDValue N, bool Inverse, SDValue &Val) {
   SDValue LHS = N->getOperand(0);
   SDValue RHS = N->getOperand(1);
 
+  if (!LHS.getValueType().isInteger())
+    return false;
+
   // If the RHS side is 0, we don't need any extra instructions, return the LHS.
   if (isNullConstant(RHS)) {
     Val = LHS;