OLD | NEW |
1 ; This tests some of the subtleties of Phi lowering. In particular, | 1 ; This tests some of the subtleties of Phi lowering. In particular, |
2 ; it tests that it does the right thing when it tries to enable | 2 ; it tests that it does the right thing when it tries to enable |
3 ; compare/branch fusing. | 3 ; compare/branch fusing. |
4 | 4 |
5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=0 \ | 5 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=0 \ |
6 ; RUN: | FileCheck %s | 6 ; RUN: | FileCheck %s |
7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=1 \ | 7 ; RUN: %p2i -i %s --filetype=obj --disassemble --args -O2 --phi-edge-split=1 \ |
8 ; RUN: | FileCheck --check-prefix=SPLIT %s | 8 ; RUN: | FileCheck --check-prefix=SPLIT %s |
9 | 9 |
10 define internal i32 @testPhi1(i32 %arg) { | 10 define internal i32 @testPhi1(i32 %arg) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 define internal i32 @testPhi3(i32 %arg) { | 52 define internal i32 @testPhi3(i32 %arg) { |
53 entry: | 53 entry: |
54 br label %body | 54 br label %body |
55 body: | 55 body: |
56 %merge = phi i32 [ %arg, %entry ], [ %elt, %body ] | 56 %merge = phi i32 [ %arg, %entry ], [ %elt, %body ] |
57 %interior = add i32 %merge, 1000 | 57 %interior = add i32 %merge, 1000 |
58 ; Trick to make a basic block local copy of interior for | 58 ; Trick to make a basic block local copy of interior for |
59 ; addressing mode optimization. | 59 ; addressing mode optimization. |
60 %interior__4 = add i32 %interior, 0 | 60 %interior__4 = add i32 %interior, 0 |
61 %__4 = inttoptr i32 %interior__4 to i32* | 61 %__4 = inttoptr i32 %interior__4 to i32* |
62 %elt = load i32* %__4, align 1 | 62 %elt = load i32, i32* %__4, align 1 |
63 %cmp = icmp eq i32 %elt, 0 | 63 %cmp = icmp eq i32 %elt, 0 |
64 br i1 %cmp, label %exit, label %body | 64 br i1 %cmp, label %exit, label %body |
65 exit: | 65 exit: |
66 ; Same trick (making a basic block local copy). | 66 ; Same trick (making a basic block local copy). |
67 %interior__6 = add i32 %interior, 0 | 67 %interior__6 = add i32 %interior, 0 |
68 %__6 = inttoptr i32 %interior__6 to i32* | 68 %__6 = inttoptr i32 %interior__6 to i32* |
69 store i32 %arg, i32* %__6, align 1 | 69 store i32 %arg, i32* %__6, align 1 |
70 ret i32 %arg | 70 ret i32 %arg |
71 } | 71 } |
72 ; I can't figure out how to reliably test this for correctness, so I | 72 ; I can't figure out how to reliably test this for correctness, so I |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 %cmp = icmp eq i32 %cond, 0 | 148 %cmp = icmp eq i32 %cond, 0 |
149 br i1 %cmp, label %eq, label %exit | 149 br i1 %cmp, label %eq, label %exit |
150 eq: | 150 eq: |
151 br label %exit | 151 br label %exit |
152 exit: | 152 exit: |
153 %merge = phi float [ %arg, %entry ], [ undef, %eq ] | 153 %merge = phi float [ %arg, %entry ], [ undef, %eq ] |
154 ret float %merge | 154 ret float %merge |
155 } | 155 } |
156 ; SPLIT-LABEL: test_split_undef_float_scalar | 156 ; SPLIT-LABEL: test_split_undef_float_scalar |
157 ; SPLIT: movss {{.*}},DWORD PTR | 157 ; SPLIT: movss {{.*}},DWORD PTR |
OLD | NEW |