summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-09-15 10:40:38 +0000
committerTim Northover <tnorthover@apple.com>2016-09-15 10:40:38 +0000
commit4cf0a482bca734dd6cc3d976727feaaf458f2ff4 (patch)
treec08a18a29698958097a1fec9c9b86a4b99f0622c /llvm/lib
parent32a078ad1a60eb2bc838d7bd341edefb0c0179d1 (diff)
downloadbcm5719-llvm-4cf0a482bca734dd6cc3d976727feaaf458f2ff4.tar.gz
bcm5719-llvm-4cf0a482bca734dd6cc3d976727feaaf458f2ff4.zip
GlobalISel: relax type constraints on G_ICMP to allow pointers.
llvm-svn: 281600
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp4
-rw-r--r--llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp1
2 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
index 7aa5405ef20..afb80798b17 100644
--- a/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/MachineIRBuilder.cpp
@@ -321,11 +321,9 @@ MachineInstrBuilder MachineIRBuilder::buildICmp(CmpInst::Predicate Pred,
unsigned Res, unsigned Op0,
unsigned Op1) {
#ifndef NDEBUG
- assert((MRI->getType(Op0).isScalar() || MRI->getType(Op0).isVector()) &&
- "invalid operand type");
assert(MRI->getType(Op0) == MRI->getType(Op0) && "type mismatch");
assert(CmpInst::isIntPredicate(Pred) && "invalid predicate");
- if (MRI->getType(Op0).isScalar())
+ if (MRI->getType(Op0).isScalar() || MRI->getType(Op0).isPointer())
assert(MRI->getType(Res).isScalar() && "type mismatch");
else
assert(MRI->getType(Res).isVector() &&
diff --git a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
index e2165b58df5..a5a7ed60ba1 100644
--- a/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
+++ b/llvm/lib/Target/AArch64/AArch64MachineLegalizer.cpp
@@ -95,6 +95,7 @@ AArch64MachineLegalizer::AArch64MachineLegalizer() {
setAction({G_ICMP, s1}, Legal);
setAction({G_ICMP, 1, s32}, Legal);
setAction({G_ICMP, 1, s64}, Legal);
+ setAction({G_ICMP, 1, p0}, Legal);
for (auto Ty : {s1, s8, s16}) {
setAction({G_ICMP, 1, Ty}, WidenScalar);
OpenPOWER on IntegriCloud