InstCombine: match can find ConstantExprs, don't assume we have a Value
[oota-llvm.git] / test / Transforms / InstCombine / mul.ll
index a81ba726387cc6f79d3b7523cd44c63e7627d92a..4d1e6c700bda253ec3fca04506611a1247860464 100644 (file)
@@ -279,3 +279,12 @@ define i64 @test30(i32 %A, i32 %B) {
 ; CHECK-NEXT: %[[mul:.*]] = mul nuw i64 %[[zext1]], %[[zext2]]
 ; CHECK-NEXT: ret i64 %[[mul]]
 }
+
+@PR22087 = external global i32
+define i32 @test31(i32 %V) {
+; CHECK-LABEL: @test31
+  %mul = mul i32 %V, shl (i32 1, i32 zext (i1 icmp ne (i32* inttoptr (i64 1 to i32*), i32* @PR22087) to i32))
+  ret i32 %mul
+; CHECK:      %[[mul:.*]] = shl i32 %V, zext (i1 icmp ne (i32* inttoptr (i64 1 to i32*), i32* @PR22087) to i32)
+; CHECK-NEXT: ret i32 %[[mul]]
+}