OLD | NEW |
1 ; Test reading phi instructions. | 1 ; Test reading phi instructions. |
2 | 2 |
3 ; RUN: %p2i -i %s --insts | FileCheck %s | 3 ; RUN: %p2i -i %s --insts | FileCheck %s |
4 ; RUN: %if --need=allow_disable_ir_gen --command \ | 4 ; RUN: %if --need=allow_disable_ir_gen --command \ |
5 ; RUN: %p2i -i %s --args -notranslate -timing -no-ir-gen \ | 5 ; RUN: %p2i -i %s --args -notranslate -timing \ |
6 ; RUN: | %if --need=allow_disable_ir_gen --command \ | 6 ; RUN: | %if --need=allow_disable_ir_gen --command \ |
7 ; RUN: FileCheck --check-prefix=NOIR %s | 7 ; RUN: FileCheck --check-prefix=NOIR %s |
8 | 8 |
9 ; TODO(kschimpf) Add forward reference examples. | 9 ; TODO(kschimpf) Add forward reference examples. |
10 | 10 |
11 define internal i32 @testPhi1(i32 %arg) { | 11 define internal i32 @testPhi1(i32 %arg) { |
12 entry: | 12 entry: |
13 %cmp1 = icmp sgt i32 %arg, 0 | 13 %cmp1 = icmp sgt i32 %arg, 0 |
14 br i1 %cmp1, label %next, label %target | 14 br i1 %cmp1, label %next, label %target |
15 next: | 15 next: |
(...skipping 10 matching lines...) Expand all Loading... |
26 ; CHECK-NEXT: br i1 %cmp1, label %next, label %target | 26 ; CHECK-NEXT: br i1 %cmp1, label %next, label %target |
27 ; CHECK-NEXT: next: | 27 ; CHECK-NEXT: next: |
28 ; CHECK-NEXT: br label %target | 28 ; CHECK-NEXT: br label %target |
29 ; CHECK-NEXT: target: | 29 ; CHECK-NEXT: target: |
30 ; CHECK-NEXT: %merge = phi i1 [ %cmp1, %entry ], [ false, %next ] | 30 ; CHECK-NEXT: %merge = phi i1 [ %cmp1, %entry ], [ false, %next ] |
31 ; CHECK-NEXT: %result = zext i1 %merge to i32 | 31 ; CHECK-NEXT: %result = zext i1 %merge to i32 |
32 ; CHECK-NEXT: ret i32 %result | 32 ; CHECK-NEXT: ret i32 %result |
33 ; CHECK-NEXT: } | 33 ; CHECK-NEXT: } |
34 | 34 |
35 ; NOIR: Total across all functions | 35 ; NOIR: Total across all functions |
OLD | NEW |