Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Unified Diff: test/Transforms/NaCl/expand-mul-with-overflow.ll

Issue 15688011: PNaCl: Extend ExpandMulWithOverflow pass to handle uadd.with.overflow too (Closed) Base URL: http://git.chromium.org/native_client/pnacl-llvm.git@master
Patch Set: Rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/Transforms/NaCl/expand-arith-with-overflow.ll ('k') | tools/opt/opt.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/Transforms/NaCl/expand-mul-with-overflow.ll
diff --git a/test/Transforms/NaCl/expand-mul-with-overflow.ll b/test/Transforms/NaCl/expand-mul-with-overflow.ll
deleted file mode 100644
index f6957988b0af994aa18e5774512eedb18e8bd34e..0000000000000000000000000000000000000000
--- a/test/Transforms/NaCl/expand-mul-with-overflow.ll
+++ /dev/null
@@ -1,64 +0,0 @@
-; RUN: opt %s -expand-mul-with-overflow -S | FileCheck %s
-
-declare {i32, i1} @llvm.umul.with.overflow.i32(i32, i32)
-declare {i64, i1} @llvm.umul.with.overflow.i64(i64, i64)
-
-; CHECK-NOT: @llvm.umul.with.overflow
-
-
-define void @umul32_by_const(i32 %x, i32* %result_val, i1* %result_overflow) {
- %pair = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %x, i32 256)
- %val = extractvalue {i32, i1} %pair, 0
- %overflow = extractvalue {i32, i1} %pair, 1
-
- store i32 %val, i32* %result_val
- store i1 %overflow, i1* %result_overflow
- ret void
-}
-
-; The bound is 16777215 == 0xffffff == ((1 << 32) - 1) / 256
-; CHECK: define void @umul32_by_const(
-; CHECK-NEXT: %pair.mul = mul i32 %x, 256
-; CHECK-NEXT: %pair.overflow = icmp ugt i32 %x, 16777215
-; CHECK-NEXT: store i32 %pair.mul, i32* %result_val
-; CHECK-NEXT: store i1 %pair.overflow, i1* %result_overflow
-
-
-; Check that the pass can expand multiple uses of the same intrinsic.
-define void @umul32_by_const2(i32 %x, i32* %result_val, i1* %result_overflow) {
- %pair = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %x, i32 65536)
- %val = extractvalue {i32, i1} %pair, 0
- ; Check that the pass can expand multiple uses of %pair.
- %overflow1 = extractvalue {i32, i1} %pair, 1
- %overflow2 = extractvalue {i32, i1} %pair, 1
-
- store i32 %val, i32* %result_val
- store i1 %overflow1, i1* %result_overflow
- store i1 %overflow2, i1* %result_overflow
- ret void
-}
-
-; CHECK: define void @umul32_by_const2(
-; CHECK-NEXT: %pair.mul = mul i32 %x, 65536
-; CHECK-NEXT: %pair.overflow = icmp ugt i32 %x, 65535
-; CHECK-NEXT: store i32 %pair.mul, i32* %result_val
-; CHECK-NEXT: store i1 %pair.overflow, i1* %result_overflow
-; CHECK-NEXT: store i1 %pair.overflow, i1* %result_overflow
-
-
-define void @umul64_by_const(i64 %x, i64* %result_val, i1* %result_overflow) {
- ; Multiply by 1 << 55.
- %pair = call {i64, i1} @llvm.umul.with.overflow.i64(i64 36028797018963968, i64 %x)
- %val = extractvalue {i64, i1} %pair, 0
- %overflow = extractvalue {i64, i1} %pair, 1
-
- store i64 %val, i64* %result_val
- store i1 %overflow, i1* %result_overflow
- ret void
-}
-
-; CHECK: define void @umul64_by_const(i64 %x, i64* %result_val, i1* %result_overflow) {
-; CHECK-NEXT: %pair.mul = mul i64 %x, 36028797018963968
-; CHECK-NEXT: %pair.overflow = icmp ugt i64 %x, 511
-; CHECK-NEXT: store i64 %pair.mul, i64* %result_val
-; CHECK-NEXT: store i1 %pair.overflow, i1* %result_overflow
« no previous file with comments | « test/Transforms/NaCl/expand-arith-with-overflow.ll ('k') | tools/opt/opt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698