summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-10-10 21:49:42 +0000
committerTim Northover <tnorthover@apple.com>2016-10-10 21:49:42 +0000
commit4edc60d7855ae7bc3d07531b12e442ba1c6b683d (patch)
tree43d849029b4f1d13ddd372d7eb5c30f41fd93f67 /llvm/lib/Target
parent84287abf431fe40b6b689a5a725a536d964c4dc2 (diff)
downloadbcm5719-llvm-4edc60d7855ae7bc3d07531b12e442ba1c6b683d.tar.gz
bcm5719-llvm-4edc60d7855ae7bc3d07531b12e442ba1c6b683d.zip
GlobalISel: support selecting constants on AArch64.
llvm-svn: 283806
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
index efb2dbc64a9..addf60a102d 100644
--- a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
@@ -229,6 +229,16 @@ bool AArch64InstructionSelector::select(MachineInstr &I) const {
return true;
}
+ case TargetOpcode::G_CONSTANT: {
+ if (Ty.getSizeInBits() <= 32)
+ I.setDesc(TII.get(AArch64::MOVi32imm));
+ else if (Ty.getSizeInBits() <= 64)
+ I.setDesc(TII.get(AArch64::MOVi64imm));
+ else
+ return false;
+ return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
+ }
+
case TargetOpcode::G_FRAME_INDEX: {
// allocas and G_FRAME_INDEX are only supported in addrspace(0).
if (Ty != LLT::pointer(0, 64)) {
OpenPOWER on IntegriCloud