summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-21 16:42:48 +0000
committerChris Lattner <sabre@nondot.org>2008-11-21 16:42:48 +0000
commitdd7083452fd0b9f69ed71e00dca3dbf41831586d (patch)
tree5bfc47f2a29ed613c058dee3535d5175b53b717b /llvm/lib/CodeGen
parent5d58c3a568b64df97ec16b992c7be07adfdf69e6 (diff)
downloadbcm5719-llvm-dd7083452fd0b9f69ed71e00dca3dbf41831586d.tar.gz
bcm5719-llvm-dd7083452fd0b9f69ed71e00dca3dbf41831586d.zip
reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count. llvm-svn: 59823
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/IntrinsicLowering.cpp18
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp9
2 files changed, 9 insertions, 18 deletions
diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp
index 7c549bc9a18..960d660cb94 100644
--- a/llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp
@@ -98,22 +98,19 @@ void IntrinsicLowering::AddPrototypes(Module &M) {
EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(),
Type::VoidTy);
break;
- case Intrinsic::memcpy_i32:
- case Intrinsic::memcpy_i64:
+ case Intrinsic::memcpy:
M.getOrInsertFunction("memcpy", PointerType::getUnqual(Type::Int8Ty),
PointerType::getUnqual(Type::Int8Ty),
PointerType::getUnqual(Type::Int8Ty),
TD.getIntPtrType(), (Type *)0);
break;
- case Intrinsic::memmove_i32:
- case Intrinsic::memmove_i64:
+ case Intrinsic::memmove:
M.getOrInsertFunction("memmove", PointerType::getUnqual(Type::Int8Ty),
PointerType::getUnqual(Type::Int8Ty),
PointerType::getUnqual(Type::Int8Ty),
TD.getIntPtrType(), (Type *)0);
break;
- case Intrinsic::memset_i32:
- case Intrinsic::memset_i64:
+ case Intrinsic::memset:
M.getOrInsertFunction("memset", PointerType::getUnqual(Type::Int8Ty),
PointerType::getUnqual(Type::Int8Ty),
Type::Int32Ty,
@@ -784,8 +781,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
case Intrinsic::var_annotation:
break; // Strip out annotate intrinsic
- case Intrinsic::memcpy_i32:
- case Intrinsic::memcpy_i64: {
+ case Intrinsic::memcpy: {
static Constant *MemcpyFCache = 0;
Value *Size = CI->getOperand(3);
const Type *IntPtr = TD.getIntPtrType();
@@ -803,8 +799,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
MemcpyFCache);
break;
}
- case Intrinsic::memmove_i32:
- case Intrinsic::memmove_i64: {
+ case Intrinsic::memmove: {
static Constant *MemmoveFCache = 0;
Value *Size = CI->getOperand(3);
const Type *IntPtr = TD.getIntPtrType();
@@ -822,8 +817,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
MemmoveFCache);
break;
}
- case Intrinsic::memset_i32:
- case Intrinsic::memset_i64: {
+ case Intrinsic::memset: {
static Constant *MemsetFCache = 0;
Value *Size = CI->getOperand(3);
const Type *IntPtr = TD.getIntPtrType();
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 64bcd314c92..94170420d0f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -3663,8 +3663,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
case Intrinsic::longjmp:
return "_longjmp"+!TLI.usesUnderscoreLongJmp();
break;
- case Intrinsic::memcpy_i32:
- case Intrinsic::memcpy_i64: {
+ case Intrinsic::memcpy: {
SDValue Op1 = getValue(I.getOperand(1));
SDValue Op2 = getValue(I.getOperand(2));
SDValue Op3 = getValue(I.getOperand(3));
@@ -3673,8 +3672,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
I.getOperand(1), 0, I.getOperand(2), 0));
return 0;
}
- case Intrinsic::memset_i32:
- case Intrinsic::memset_i64: {
+ case Intrinsic::memset: {
SDValue Op1 = getValue(I.getOperand(1));
SDValue Op2 = getValue(I.getOperand(2));
SDValue Op3 = getValue(I.getOperand(3));
@@ -3683,8 +3681,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
I.getOperand(1), 0));
return 0;
}
- case Intrinsic::memmove_i32:
- case Intrinsic::memmove_i64: {
+ case Intrinsic::memmove: {
SDValue Op1 = getValue(I.getOperand(1));
SDValue Op2 = getValue(I.getOperand(2));
SDValue Op3 = getValue(I.getOperand(3));
OpenPOWER on IntegriCloud