aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
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
commitd0118a2371f35faa6af97e67be69e1debc615c42 (patch)
tree24b7621d4b4a78dc49a907abdb65fa045ee4a03d /lib/CodeGen
parenta3f88148e66b6b42d5843f33db675ffa935ccb15 (diff)
Fix a FIXME by moving the fast-isel implementation of the objectsize intrinsic from the x86 code to the generic code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131332 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 621e8efd40..2f5adcc556 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/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.