summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir51
1 files changed, 51 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir
index 7821db4e823..dd34790ce35 100644
--- a/llvm/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir
+++ b/llvm/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir
@@ -10,6 +10,11 @@
ret i32 0
}
+ define i64* @legalize_phi_ptr(i64* %a, i64* %b, i1 %cond) {
+ entry:
+ ret i64* null
+ }
+
define i32 @legalize_phi_empty(i32 %argc) {
entry:
ret i32 0
@@ -104,6 +109,52 @@ body: |
...
---
+name: legalize_phi_ptr
+alignment: 2
+exposesReturnsTwice: false
+legalized: false
+regBankSelected: false
+selected: false
+tracksRegLiveness: true
+registers:
+ - { id: 0, class: _, preferred-register: '' }
+ - { id: 1, class: _, preferred-register: '' }
+ - { id: 2, class: _, preferred-register: '' }
+ - { id: 3, class: _, preferred-register: '' }
+ - { id: 4, class: _, preferred-register: '' }
+ - { id: 5, class: _, preferred-register: '' }
+liveins:
+body: |
+ bb.1:
+ ; CHECK-LABEL: name: legalize_phi_ptr
+ ; CHECK-LABEL: bb.0:
+ ; CHECK: %0(p0) = COPY %x0
+ ; CHECK: %1(p0) = COPY %x1
+ ; CHECK: %2(s1) = COPY %w2
+
+ ; CHECK-LABEL: bb.1:
+ ; CHECK-LABEL: bb.2:
+ ; CHECK: %3(p0) = G_PHI %0(p0), %bb.0, %1(p0), %bb.1
+ ; CHECK: %x0 = COPY %3(p0)
+ successors: %bb.2, %bb.3
+ liveins: %w2, %x0, %x1
+
+ %0(p0) = COPY %x0
+ %1(p0) = COPY %x1
+ %2(s1) = COPY %w2
+ G_BRCOND %2(s1), %bb.2
+ G_BR %bb.3
+
+ bb.2:
+ successors: %bb.3
+
+ bb.3:
+ %3(p0) = G_PHI %0(p0), %bb.1, %1(p0), %bb.2
+ %x0 = COPY %3(p0)
+ RET_ReallyLR implicit %x0
+
+...
+---
name: legalize_phi_empty
alignment: 2
exposesReturnsTwice: false
OpenPOWER on IntegriCloud