[llvm] r315179 - [AArch64][GlobalISel] Add a test case for G_PHI of p0 instruction selection.
Amara Emerson via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 8 08:29:35 PDT 2017
Author: aemerson
Date: Sun Oct 8 08:29:35 2017
New Revision: 315179
URL: http://llvm.org/viewvc/llvm-project?rev=315179&view=rev
Log:
[AArch64][GlobalISel] Add a test case for G_PHI of p0 instruction selection.
Modified:
llvm/trunk/test/CodeGen/AArch64/GlobalISel/select-phi.mir
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/select-phi.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/select-phi.mir?rev=315179&r1=315178&r2=315179&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/select-phi.mir (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/select-phi.mir Sun Oct 8 08:29:35 2017
@@ -23,6 +23,11 @@
ret i32 %res
}
+ define i64* @test_phi_ptr(i64* %a, i64* %b, i1 %cond) {
+ entry:
+ ret i64* null
+ }
+
...
---
name: test_phi
@@ -76,3 +81,43 @@ body: |
RET_ReallyLR implicit %w0
...
+
+---
+name: test_phi_ptr
+alignment: 2
+exposesReturnsTwice: false
+legalized: true
+regBankSelected: true
+selected: false
+tracksRegLiveness: true
+registers:
+ - { id: 0, class: gpr, preferred-register: '' }
+ - { id: 1, class: gpr, preferred-register: '' }
+ - { id: 2, class: gpr, preferred-register: '' }
+ - { id: 3, class: gpr, preferred-register: '' }
+ - { id: 4, class: _, preferred-register: '' }
+ - { id: 5, class: _, preferred-register: '' }
+liveins:
+body: |
+ bb.0:
+ successors: %bb.1, %bb.2
+ liveins: %w2, %x0, %x1
+ ; CHECK-LABEL: name: test_phi_ptr
+
+ %0(p0) = COPY %x0
+ %1(p0) = COPY %x1
+ %2(s1) = COPY %w2
+ G_BRCOND %2(s1), %bb.1
+ G_BR %bb.2
+
+ bb.1:
+ successors: %bb.2
+
+
+ bb.2:
+ ; CHECK: %{{[0-9]+}} = PHI %{{[0-9]+}}, %bb.0, %{{[0-9]+}}, %bb.1
+ %3(p0) = G_PHI %0(p0), %bb.0, %1(p0), %bb.1
+ %x0 = COPY %3(p0)
+ RET_ReallyLR implicit %x0
+
+...
More information about the llvm-commits
mailing list