[llvm] r315177 - [AArch64][GlobalISel] Make G_PHI of p0 types legal.
Amara Emerson via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 8 08:29:12 PDT 2017
Author: aemerson
Date: Sun Oct 8 08:29:11 2017
New Revision: 315177
URL: http://llvm.org/viewvc/llvm-project?rev=315177&view=rev
Log:
[AArch64][GlobalISel] Make G_PHI of p0 types legal.
Differential Revision: https://reviews.llvm.org/D38621
Modified:
llvm/trunk/lib/Target/AArch64/AArch64LegalizerInfo.cpp
llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir
Modified: llvm/trunk/lib/Target/AArch64/AArch64LegalizerInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64LegalizerInfo.cpp?rev=315177&r1=315176&r2=315177&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64LegalizerInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64LegalizerInfo.cpp Sun Oct 8 08:29:11 2017
@@ -38,7 +38,7 @@ AArch64LegalizerInfo::AArch64LegalizerIn
for (auto Ty : {p0, s1, s8, s16, s32, s64})
setAction({G_IMPLICIT_DEF, Ty}, Legal);
- for (auto Ty : {s16, s32, s64})
+ for (auto Ty : {s16, s32, s64, p0})
setAction({G_PHI, Ty}, Legal);
for (auto Ty : {s1, s8})
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir?rev=315177&r1=315176&r2=315177&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-phi.mir Sun Oct 8 08:29:11 2017
@@ -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
More information about the llvm-commits
mailing list