summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-10-31 18:31:09 +0000
committerTim Northover <tnorthover@apple.com>2016-10-31 18:31:09 +0000
commit037af52c8bc13a9d92a8a51f5fd9bb61691ffe3d (patch)
treeb27e844f70e423afefacc12c49d5ea0cb1b7f0b3 /llvm/lib
parentcdf23f1d93c974d038033305d2f2a7b98bd022a4 (diff)
downloadbcm5719-llvm-037af52c8bc13a9d92a8a51f5fd9bb61691ffe3d.tar.gz
bcm5719-llvm-037af52c8bc13a9d92a8a51f5fd9bb61691ffe3d.zip
GlobalISel: allow truncating pointer casts on AArch64.
llvm-svn: 285615
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp2
-rw-r--r--llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
index c5777598b65..0dd725ea1d1 100644
--- a/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
+++ b/llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
@@ -748,6 +748,7 @@ bool AArch64InstructionSelector::select(MachineInstr &I) const {
return constrainSelectedInstRegOperands(I, TII, TRI, RBI);
}
+ case TargetOpcode::G_PTRTOINT:
case TargetOpcode::G_TRUNC: {
const LLT DstTy = MRI.getType(I.getOperand(0).getReg());
const LLT SrcTy = MRI.getType(I.getOperand(1).getReg());
@@ -918,7 +919,6 @@ bool AArch64InstructionSelector::select(MachineInstr &I) const {
case TargetOpcode::G_INTTOPTR:
- case TargetOpcode::G_PTRTOINT:
case TargetOpcode::G_BITCAST:
return selectCopy(I, TII, MRI, TRI, RBI);
diff --git a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
index b8f1136b23b..83f276a8161 100644
--- a/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
+++ b/llvm/lib/Target/AArch64/AArch64LegalizerInfo.cpp
@@ -169,7 +169,9 @@ AArch64LegalizerInfo::AArch64LegalizerInfo() {
setAction({G_FRAME_INDEX, p0}, Legal);
setAction({G_GLOBAL_VALUE, p0}, Legal);
- setAction({G_PTRTOINT, 0, s64}, Legal);
+ for (auto Ty : {s1, s8, s16, s32, s64})
+ setAction({G_PTRTOINT, 0, Ty}, Legal);
+
setAction({G_PTRTOINT, 1, p0}, Legal);
setAction({G_INTTOPTR, 0, p0}, Legal);
OpenPOWER on IntegriCloud