[llvm] r279759 - GlobalISel: mark pointer constants as legal on AArch64.
Tim Northover via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 25 10:37:35 PDT 2016
Author: tnorthover
Date: Thu Aug 25 12:37:35 2016
New Revision: 279759
URL: http://llvm.org/viewvc/llvm-project?rev=279759&view=rev
Log:
GlobalISel: mark pointer constants as legal on AArch64.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp
llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-constant.mir
Modified: llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp?rev=279759&r1=279758&r2=279759&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64MachineLegalizer.cpp Thu Aug 25 12:37:35 2016
@@ -72,6 +72,8 @@ AArch64MachineLegalizer::AArch64MachineL
setAction({TargetOpcode::G_FCONSTANT, Ty}, Legal);
}
+ setAction({G_CONSTANT, p0}, Legal);
+
for (auto Ty : {s1, s8, s16})
setAction({TargetOpcode::G_CONSTANT, Ty}, WidenScalar);
Modified: llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-constant.mir
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-constant.mir?rev=279759&r1=279758&r2=279759&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-constant.mir (original)
+++ llvm/trunk/test/CodeGen/AArch64/GlobalISel/legalize-constant.mir Thu Aug 25 12:37:35 2016
@@ -21,6 +21,7 @@ registers:
- { id: 2, class: _ }
- { id: 3, class: _ }
- { id: 4, class: _ }
+ - { id: 5, class: _ }
body: |
bb.0.entry:
; CHECK-LABEL: name: test_constant
@@ -32,12 +33,14 @@ body: |
; CHECK: %2(16) = G_TRUNC { s16, s32 } [[TMP]]
; CHECK: %3(32) = G_CONSTANT s32 -1
; CHECK: %4(64) = G_CONSTANT s64 1
+ ; CHECK: %5(64) = G_CONSTANT p0 0
%0(1) = G_CONSTANT s1 0
%1(8) = G_CONSTANT s8 42
%2(16) = G_CONSTANT s16 65535
%3(32) = G_CONSTANT s32 -1
%4(64) = G_CONSTANT s64 1
+ %5(64) = G_CONSTANT p0 0
...
---
More information about the llvm-commits
mailing list