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

Side by Side Diff: test/Transforms/InstCombine/overflow-mul.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 ; RUN: opt -S -instcombine < %s | FileCheck %s 1 ; RUN: opt -S -instcombine < %s | FileCheck %s
2 2
3 ; @LOCALMOD-BEGIN
4 ; PNaCl does not support the with.overflow intrinsics in its stable
5 ; ABI, so these optimizations are disabled.
6
7 ; RUN: opt -S -instcombine -mtriple=le32-nacl < %s | FileCheck %s -check-prefix= PNACL
8 ; PNACL-NOT: with.overflow
9 ; @LOCALMOD-END
10
3 ; return mul(zext x, zext y) > MAX 11 ; return mul(zext x, zext y) > MAX
4 define i32 @pr4917_1(i32 %x, i32 %y) nounwind { 12 define i32 @pr4917_1(i32 %x, i32 %y) nounwind {
5 ; CHECK-LABEL: @pr4917_1( 13 ; CHECK-LABEL: @pr4917_1(
6 entry: 14 entry:
7 %l = zext i32 %x to i64 15 %l = zext i32 %x to i64
8 %r = zext i32 %y to i64 16 %r = zext i32 %y to i64
9 ; CHECK-NOT: zext i32 17 ; CHECK-NOT: zext i32
10 %mul64 = mul i64 %l, %r 18 %mul64 = mul i64 %l, %r
11 ; CHECK: [[MUL:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %x, i32 %y) 19 ; CHECK: [[MUL:%.*]] = call { i32, i1 } @llvm.umul.with.overflow.i32(i32 %x, i32 %y)
12 %overflow = icmp ugt i64 %mul64, 4294967295 20 %overflow = icmp ugt i64 %mul64, 4294967295
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 ; CHECK-LABEL: @pr21445( 187 ; CHECK-LABEL: @pr21445(
180 ; CHECK-NEXT: %[[umul:.*]] = call { i8, i1 } @llvm.umul.with.overflow.i8(i8 %a, i8 ptrtoint (i32* @pr21445_data to i8)) 188 ; CHECK-NEXT: %[[umul:.*]] = call { i8, i1 } @llvm.umul.with.overflow.i8(i8 %a, i8 ptrtoint (i32* @pr21445_data to i8))
181 ; CHECK-NEXT: %[[cmp:.*]] = extractvalue { i8, i1 } %[[umul]], 1 189 ; CHECK-NEXT: %[[cmp:.*]] = extractvalue { i8, i1 } %[[umul]], 1
182 ; CHECK-NEXT: ret i1 %[[cmp]] 190 ; CHECK-NEXT: ret i1 %[[cmp]]
183 %ext = zext i8 %a to i32 191 %ext = zext i8 %a to i32
184 %mul = mul i32 %ext, zext (i8 ptrtoint (i32* @pr21445_data to i8) to i32) 192 %mul = mul i32 %ext, zext (i8 ptrtoint (i32* @pr21445_data to i8) to i32)
185 %and = and i32 %mul, 255 193 %and = and i32 %mul, 255
186 %cmp = icmp ne i32 %mul, %and 194 %cmp = icmp ne i32 %mul, %and
187 ret i1 %cmp 195 ret i1 %cmp
188 } 196 }
OLDNEW
« no previous file with comments | « test/Transforms/InstCombine/overflow.ll ('k') | test/Transforms/MinSFI/abi-verifier-whitelist-syscalls.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698