// Shifting by the bitwidth or more is undefined.
if (Op1LV.isConstant()) {
- auto *ShiftAmt = Op1LV.getConstantInt();
- if (ShiftAmt->getLimitedValue() >=
- ShiftAmt->getType()->getScalarSizeInBits())
- break;
+ if (auto *ShiftAmt = Op1LV.getConstantInt())
+ if (ShiftAmt->getLimitedValue() >=
+ ShiftAmt->getType()->getScalarSizeInBits())
+ break;
}
// undef >>a X -> all ones
// Shifting by the bitwidth or more is undefined.
if (Op1LV.isConstant()) {
- auto *ShiftAmt = Op1LV.getConstantInt();
- if (ShiftAmt->getLimitedValue() >=
- ShiftAmt->getType()->getScalarSizeInBits())
- break;
+ if (auto *ShiftAmt = Op1LV.getConstantInt())
+ if (ShiftAmt->getLimitedValue() >=
+ ShiftAmt->getType()->getScalarSizeInBits())
+ break;
}
// undef << X -> 0
; CHECK-LABEL: @test10(
; CHECK: ret i64 undef
}
+
+@GV = external global i32
+
+define i32 @test11(i1 %tobool) {
+entry:
+ %shr4 = ashr i32 undef, zext (i1 icmp eq (i32* bitcast (i32 (i1)* @test11 to i32*), i32* @GV) to i32)
+ ret i32 %shr4
+; CHECK-LABEL: @test11(
+; CHECK: ret i32 -1
+}