Fixes https://github.com/llvm/llvm-project/issues/59617.
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D141038
IntegerValueRange IntegerValueRange::getMaxRange(Value value) {
unsigned width = ConstantIntRanges::getStorageBitwidth(value.getType());
+ if (width == 0)
+ return {};
APInt umin = APInt::getMinValue(width);
APInt umax = APInt::getMaxValue(width);
APInt smin = width != 0 ? APInt::getSignedMinValue(width) : umin;
%1 = arith.floordivsi %0, %0 : i8
return
}
+
+// Make sure not crash.
+// CHECK-LABEL: @no_integer_or_index
+func.func @no_integer_or_index() {
+ // CHECK: arith.cmpi
+ %cst_0 = arith.constant dense<[0]> : vector<1xi32>
+ %cmp = arith.cmpi slt, %cst_0, %cst_0 : vector<1xi32>
+ return
+}