GlobalISel: allow G_GLOBAL_VALUEs in AArch64 legalization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@283808 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Tim Northover 2016-10-10 21:49:53 +00:00
parent f3542eee12
commit 138850bfa1
2 changed files with 15 additions and 0 deletions

View File

@ -168,6 +168,7 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() {
// Pointer-handling
setAction({G_FRAME_INDEX, p0}, Legal);
setAction({G_GLOBAL_VALUE, p0}, Legal);
setAction({G_PTRTOINT, 0, s64}, Legal);
setAction({G_PTRTOINT, 1, p0}, Legal);

View File

@ -11,6 +11,8 @@
entry:
ret void
}
@var = global i8 0
define i8* @test_global() { ret i8* undef }
...
---
@ -61,3 +63,15 @@ body: |
%1(s64) = G_FCONSTANT double 2.0
%2(s16) = G_FCONSTANT half 0.0
...
---
name: test_global
registers:
- { id: 0, class: _ }
body: |
bb.0:
; CHECK-LABEL: name: test_global
; CHECK: %0(p0) = G_GLOBAL_VALUE @var
%0(p0) = G_GLOBAL_VALUE @var
...