GlobalISel: mark pointer casts legal on AArch64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279553 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover 2016-08-23 19:30:38 +00:00
parent c016311937
commit 3891c455e2
2 changed files with 32 additions and 0 deletions

View File

@ -72,5 +72,8 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() {
setAction(G_FRAME_INDEX, LLT::pointer(0), Legal);
setAction(G_PTRTOINT, s64, Legal);
setAction(G_INTTOPTR, LLT::pointer(0), Legal);
computeTables();
}

View File

@ -0,0 +1,29 @@
# RUN: llc -O0 -run-pass=legalize-mir -global-isel %s -o - 2>&1 | FileCheck %s
--- |
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-apple-ios"
define void @test_simple() {
entry:
ret void
}
...
---
name: test_simple
isSSA: true
registers:
- { id: 0, class: _ }
- { id: 1, class: _ }
- { id: 2, class: _ }
body: |
bb.0.entry:
liveins: %x0, %x1, %x2, %x3
%0(64) = COPY %x0
; CHECK-LABEL: name: test_simple
; CHECK: %1(64) = G_PTRTOINT { s64, p0 } %0
; CHECK: %2(64) = G_INTTOPTR { p0, s64 } %1
%1(64) = G_PTRTOINT { s64, p0 } %0
%2(64) = G_INTTOPTR { p0, s64 } %1
...