summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2011-05-14 00:47:51 +0000
committerEli Friedman <eli.friedman@gmail.com>2011-05-14 00:47:51 +0000
commit8f1e11cde907abec8aee78c68f233db97fd0f2fe (patch)
treece56a7703989f919cc0a979943694a28c6c06e8f /llvm/lib/CodeGen/SelectionDAG
parent67eb68d260c71126d10256d02017a71d4fa2e93c (diff)
downloadbcm5719-llvm-8f1e11cde907abec8aee78c68f233db97fd0f2fe.tar.gz
bcm5719-llvm-8f1e11cde907abec8aee78c68f233db97fd0f2fe.zip
Fix a FIXME by moving the fast-isel implementation of the objectsize intrinsic from the x86 code to the generic code.
llvm-svn: 131332
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 621e8efd408..2f5adcc5565 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -628,6 +628,16 @@ bool FastISel::SelectCall(const User *I) {
return true;
}
+ case Intrinsic::objectsize: {
+ ConstantInt *CI = cast<ConstantInt>(Call->getArgOperand(1));
+ unsigned long long Res = CI->isZero() ? -1ULL : 0;
+ Constant *ResCI = ConstantInt::get(Call->getType(), Res);
+ unsigned ResultReg = getRegForValue(ResCI);
+ if (ResultReg == 0)
+ return false;
+ UpdateValueMap(Call, ResultReg);
+ return true;
+ }
}
// An arbitrary call. Bail.
OpenPOWER on IntegriCloud