[cfe-commits] r59821 - in /cfe/trunk/lib/CodeGen: CGExprAgg.cpp CodeGenModule.cpp
Chris Lattner
sabre at nondot.org
Fri Nov 21 08:26:46 PST 2008
Author: lattner
Date: Fri Nov 21 10:26:37 2008
New Revision: 59821
URL: http://llvm.org/viewvc/llvm-project?rev=59821&view=rev
Log:
temporarily revert Sangiv's patch.
Modified:
cfe/trunk/lib/CodeGen/CGExprAgg.cpp
cfe/trunk/lib/CodeGen/CodeGenModule.cpp
Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=59821&r1=59820&r2=59821&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Fri Nov 21 10:26:37 2008
@@ -327,7 +327,7 @@
// There's a potential optimization opportunity in combining
// memsets; that would be easy for arrays, but relatively
// difficult for structures with the current code.
- llvm::Value *MemSet = CGF.CGM.getIntrinsic(llvm::Intrinsic::memset);
+ llvm::Value *MemSet = CGF.CGM.getIntrinsic(llvm::Intrinsic::memset_i64);
uint64_t Size = CGF.getContext().getTypeSize(T);
const llvm::Type *BP = llvm::PointerType::getUnqual(llvm::Type::Int8Ty);
Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=59821&r1=59820&r2=59821&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Fri Nov 21 10:26:37 2008
@@ -757,17 +757,38 @@
llvm::Function *CodeGenModule::getMemCpyFn() {
if (MemCpyFn) return MemCpyFn;
- return MemCpyFn = getIntrinsic(llvm::Intrinsic::memcpy);
+ llvm::Intrinsic::ID IID;
+ switch (Context.Target.getPointerWidth(0)) {
+ default: assert(0 && "Unknown ptr width");
+ case 16: IID = llvm::Intrinsic::memcpy_i16; break;
+ case 32: IID = llvm::Intrinsic::memcpy_i32; break;
+ case 64: IID = llvm::Intrinsic::memcpy_i64; break;
+ }
+ return MemCpyFn = getIntrinsic(IID);
}
llvm::Function *CodeGenModule::getMemMoveFn() {
if (MemMoveFn) return MemMoveFn;
- return MemMoveFn = getIntrinsic(llvm::Intrinsic::memmove);
+ llvm::Intrinsic::ID IID;
+ switch (Context.Target.getPointerWidth(0)) {
+ default: assert(0 && "Unknown ptr width");
+ case 16: IID = llvm::Intrinsic::memmove_i16; break;
+ case 32: IID = llvm::Intrinsic::memmove_i32; break;
+ case 64: IID = llvm::Intrinsic::memmove_i64; break;
+ }
+ return MemMoveFn = getIntrinsic(IID);
}
llvm::Function *CodeGenModule::getMemSetFn() {
if (MemSetFn) return MemSetFn;
- return MemSetFn = getIntrinsic(llvm::Intrinsic::memset);
+ llvm::Intrinsic::ID IID;
+ switch (Context.Target.getPointerWidth(0)) {
+ default: assert(0 && "Unknown ptr width");
+ case 16: IID = llvm::Intrinsic::memset_i16; break;
+ case 32: IID = llvm::Intrinsic::memset_i32; break;
+ case 64: IID = llvm::Intrinsic::memset_i64; break;
+ }
+ return MemSetFn = getIntrinsic(IID);
}
static void appendFieldAndPadding(CodeGenModule &CGM,
More information about the cfe-commits
mailing list