diff options
author | Tim Northover <tnorthover@apple.com> | 2016-10-18 20:03:51 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2016-10-18 20:03:51 +0000 |
commit | 6e9043009ed79a64a6df648f5c5c5a55bc0cee70 (patch) | |
tree | 236089aa1308312c4bdf09c97d727e9ffd15e2e9 /llvm/lib/CodeGen/GlobalISel | |
parent | 55782222c0500de1dea1aeee40e1fdf31dc853eb (diff) | |
download | bcm5719-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.cpp | 7 |
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}; |