summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-10-18 20:03:51 +0000
committerTim Northover <tnorthover@apple.com>2016-10-18 20:03:51 +0000
commit6e9043009ed79a64a6df648f5c5c5a55bc0cee70 (patch)
tree236089aa1308312c4bdf09c97d727e9ffd15e2e9 /llvm/lib/CodeGen/GlobalISel
parent55782222c0500de1dea1aeee40e1fdf31dc853eb (diff)
downloadbcm5719-llvm-6e9043009ed79a64a6df648f5c5c5a55bc0cee70.tar.gz
bcm5719-llvm-6e9043009ed79a64a6df648f5c5c5a55bc0cee70.zip
GlobalISel: translate the @llvm.objectsize intrinsic.
llvm-svn: 284527
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
index e0737172d2a..dd64cc7fab6 100644
--- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
@@ -392,6 +392,13 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI,
case Intrinsic::smul_with_overflow: Op = TargetOpcode::G_SMULO; break;
case Intrinsic::memcpy:
return translateMemcpy(CI);
+ case Intrinsic::objectsize: {
+ // If we don't know by now, we're never going to know.
+ const ConstantInt *Min = cast<ConstantInt>(CI.getArgOperand(1));
+
+ MIRBuilder.buildConstant(getOrCreateVReg(CI), Min->isZero() ? -1ULL : 0);
+ return true;
+ }
}
LLT Ty{*CI.getOperand(0)->getType(), *DL};
OpenPOWER on IntegriCloud