]> granicus.if.org Git - llvm/commitdiff
[InstCombine] Add test case demonstrating that we don't propagate nsw flag when conve...
authorCraig Topper <craig.topper@gmail.com>
Tue, 27 Jun 2017 17:16:03 +0000 (17:16 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 27 Jun 2017 17:16:03 +0000 (17:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306427 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/mul.ll

index ff389a495d3148469fa09cd708e987cd2ff5a6e7..a775339c7b2e26f26ea61d4418ef5a9fa8af05c0 100644 (file)
@@ -324,3 +324,13 @@ define <2 x i32> @test33vec(<2 x i32> %X) {
   %mul = mul nsw <2 x i32> %X, <i32 1073741824, i32 1073741824>
   ret <2 x i32> %mul
 }
+
+; TODO: we should propagate nsw flag to the shift here, but we only handle i64 and smaller
+define i128 @test34(i128 %X) {
+; CHECK-LABEL: @test34(
+; CHECK-NEXT:    [[MUL:%.*]] = shl i128 [[X:%.*]], 1
+; CHECK-NEXT:    ret i128 [[MUL]]
+;
+  %mul = mul nsw i128 %X, 2
+  ret i128 %mul
+}