| OLD | NEW |
| 1 ; RUN: opt -S -instcombine < %s | FileCheck %s | 1 ; RUN: opt -S -instcombine < %s | FileCheck %s |
| 2 ; <rdar://problem/8558713> | 2 ; <rdar://problem/8558713> |
| 3 | 3 |
| 4 ; @LOCALMOD-BEGIN |
| 5 ; PNaCl does not support the with.overflow intrinsics in its stable |
| 6 ; ABI, so these optimizations are disabled. |
| 7 |
| 8 ; RUN: opt -S -instcombine -mtriple=le32-nacl < %s | FileCheck %s -check-prefix=
PNACL |
| 9 ; PNACL-NOT: with.overflow |
| 10 ; @LOCALMOD-END |
| 11 |
| 4 declare void @throwAnExceptionOrWhatever() | 12 declare void @throwAnExceptionOrWhatever() |
| 5 | 13 |
| 6 ; CHECK-LABEL: @test1( | 14 ; CHECK-LABEL: @test1( |
| 7 define i32 @test1(i32 %a, i32 %b) nounwind ssp { | 15 define i32 @test1(i32 %a, i32 %b) nounwind ssp { |
| 8 entry: | 16 entry: |
| 9 ; CHECK-NOT: sext | 17 ; CHECK-NOT: sext |
| 10 %conv = sext i32 %a to i64 | 18 %conv = sext i32 %a to i64 |
| 11 %conv2 = sext i32 %b to i64 | 19 %conv2 = sext i32 %b to i64 |
| 12 %add = add nsw i64 %conv2, %conv | 20 %add = add nsw i64 %conv2, %conv |
| 13 %add.off = add i64 %add, 2147483648 | 21 %add.off = add i64 %add, 2147483648 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 br i1 %0, label %if.then, label %if.end | 154 br i1 %0, label %if.then, label %if.end |
| 147 | 155 |
| 148 if.then: | 156 if.then: |
| 149 tail call void @throwAnExceptionOrWhatever() nounwind | 157 tail call void @throwAnExceptionOrWhatever() nounwind |
| 150 br label %if.end | 158 br label %if.end |
| 151 | 159 |
| 152 if.end: | 160 if.end: |
| 153 %conv9 = trunc i64 %add to i32 | 161 %conv9 = trunc i64 %add to i32 |
| 154 ret i32 %conv9 | 162 ret i32 %conv9 |
| 155 } | 163 } |
| OLD | NEW |