diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-11-21 09:09:41 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-11-21 09:09:41 +0000 |
commit | dc770929cb2f97397970e2942b746839fc387992 (patch) | |
tree | 3312b6ce58ec7d18fab026d0c2ead719f8b40bc9 /lib | |
parent | 219ab405e6bea993da14cf3ce7b50983c3bb7a6f (diff) | |
download | external_llvm-dc770929cb2f97397970e2942b746839fc387992.zip external_llvm-dc770929cb2f97397970e2942b746839fc387992.tar.gz external_llvm-dc770929cb2f97397970e2942b746839fc387992.tar.bz2 |
Revert r59802. It was breaking the build of llvm-gcc:
g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic'
make[3]: *** [llvm-convert.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59809 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/IPA/Andersens.cpp | 7 | ||||
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 18 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp | 9 | ||||
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 11 | ||||
-rw-r--r-- | lib/Transforms/Scalar/MemCpyOptimizer.cpp | 11 | ||||
-rw-r--r-- | lib/Transforms/Scalar/SimplifyLibCalls.cpp | 7 | ||||
-rw-r--r-- | lib/Transforms/Utils/InlineFunction.cpp | 4 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 9 |
8 files changed, 41 insertions, 35 deletions
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp index 0cf31ab..9e07189 100644 --- a/lib/Analysis/IPA/Andersens.cpp +++ b/lib/Analysis/IPA/Andersens.cpp @@ -903,7 +903,8 @@ bool Andersens::AddConstraintsForExternalCall(CallSite CS, Function *F) { F->getName() == "atol" || F->getName() == "atoll" || F->getName() == "remove" || F->getName() == "unlink" || F->getName() == "rename" || F->getName() == "memcmp" || - F->getName() == "llvm.memset" || + F->getName() == "llvm.memset.i32" || + F->getName() == "llvm.memset.i64" || F->getName() == "strcmp" || F->getName() == "strncmp" || F->getName() == "execl" || F->getName() == "execlp" || F->getName() == "execle" || F->getName() == "execv" || @@ -941,8 +942,8 @@ bool Andersens::AddConstraintsForExternalCall(CallSite CS, Function *F) { // These functions do induce points-to edges. - if (F->getName() == "llvm.memcpy" || - F->getName() == "llvm.memmove" || + if (F->getName() == "llvm.memcpy.i32" || F->getName() == "llvm.memcpy.i64" || + F->getName() == "llvm.memmove.i32" ||F->getName() == "llvm.memmove.i64" || F->getName() == "memmove") { // *Dest = *Src, which requires an artificial graph node to represent the diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 960d660..7c549bc 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -98,19 +98,22 @@ void IntrinsicLowering::AddPrototypes(Module &M) { EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(), Type::VoidTy); break; - case Intrinsic::memcpy: + case Intrinsic::memcpy_i32: + case Intrinsic::memcpy_i64: M.getOrInsertFunction("memcpy", PointerType::getUnqual(Type::Int8Ty), PointerType::getUnqual(Type::Int8Ty), PointerType::getUnqual(Type::Int8Ty), TD.getIntPtrType(), (Type *)0); break; - case Intrinsic::memmove: + case Intrinsic::memmove_i32: + case Intrinsic::memmove_i64: M.getOrInsertFunction("memmove", PointerType::getUnqual(Type::Int8Ty), PointerType::getUnqual(Type::Int8Ty), PointerType::getUnqual(Type::Int8Ty), TD.getIntPtrType(), (Type *)0); break; - case Intrinsic::memset: + case Intrinsic::memset_i32: + case Intrinsic::memset_i64: M.getOrInsertFunction("memset", PointerType::getUnqual(Type::Int8Ty), PointerType::getUnqual(Type::Int8Ty), Type::Int32Ty, @@ -781,7 +784,8 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { case Intrinsic::var_annotation: break; // Strip out annotate intrinsic - case Intrinsic::memcpy: { + case Intrinsic::memcpy_i32: + case Intrinsic::memcpy_i64: { static Constant *MemcpyFCache = 0; Value *Size = CI->getOperand(3); const Type *IntPtr = TD.getIntPtrType(); @@ -799,7 +803,8 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { MemcpyFCache); break; } - case Intrinsic::memmove: { + case Intrinsic::memmove_i32: + case Intrinsic::memmove_i64: { static Constant *MemmoveFCache = 0; Value *Size = CI->getOperand(3); const Type *IntPtr = TD.getIntPtrType(); @@ -817,7 +822,8 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { MemmoveFCache); break; } - case Intrinsic::memset: { + case Intrinsic::memset_i32: + case Intrinsic::memset_i64: { static Constant *MemsetFCache = 0; Value *Size = CI->getOperand(3); const Type *IntPtr = TD.getIntPtrType(); diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp index 9417042..64bcd31 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp @@ -3663,7 +3663,8 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { case Intrinsic::longjmp: return "_longjmp"+!TLI.usesUnderscoreLongJmp(); break; - case Intrinsic::memcpy: { + case Intrinsic::memcpy_i32: + case Intrinsic::memcpy_i64: { SDValue Op1 = getValue(I.getOperand(1)); SDValue Op2 = getValue(I.getOperand(2)); SDValue Op3 = getValue(I.getOperand(3)); @@ -3672,7 +3673,8 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { I.getOperand(1), 0, I.getOperand(2), 0)); return 0; } - case Intrinsic::memset: { + case Intrinsic::memset_i32: + case Intrinsic::memset_i64: { SDValue Op1 = getValue(I.getOperand(1)); SDValue Op2 = getValue(I.getOperand(2)); SDValue Op3 = getValue(I.getOperand(3)); @@ -3681,7 +3683,8 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) { I.getOperand(1), 0)); return 0; } - case Intrinsic::memmove: { + case Intrinsic::memmove_i32: + case Intrinsic::memmove_i64: { SDValue Op1 = getValue(I.getOperand(1)); SDValue Op2 = getValue(I.getOperand(2)); SDValue Op3 = getValue(I.getOperand(3)); diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 717a46e..ee6b51c 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -9200,11 +9200,12 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) { if (GlobalVariable *GVSrc = dyn_cast<GlobalVariable>(MMI->getSource())) if (GVSrc->isConstant()) { Module *M = CI.getParent()->getParent()->getParent(); - Intrinsic::ID MemCpyID = Intrinsic::memcpy; - const Type *Tys[1]; - Tys[0] = CI.getOperand(3)->getType(); - CI.setOperand(0, - Intrinsic::getDeclaration(M, MemCpyID, Tys, 1)); + Intrinsic::ID MemCpyID; + if (CI.getOperand(3)->getType() == Type::Int32Ty) + MemCpyID = Intrinsic::memcpy_i32; + else + MemCpyID = Intrinsic::memcpy_i64; + CI.setOperand(0, Intrinsic::getDeclaration(M, MemCpyID)); Changed = true; } diff --git a/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/lib/Transforms/Scalar/MemCpyOptimizer.cpp index 6d27327..7ccca00 100644 --- a/lib/Transforms/Scalar/MemCpyOptimizer.cpp +++ b/lib/Transforms/Scalar/MemCpyOptimizer.cpp @@ -427,12 +427,9 @@ bool MemCpyOpt::processStore(StoreInst *SI, BasicBlock::iterator& BBI) { // instruction needed by the start of the block. BasicBlock::iterator InsertPt = BI; - if (MemSetF == 0) { - const Type *Tys[] = {Type::Int64Ty}; + if (MemSetF == 0) MemSetF = Intrinsic::getDeclaration(SI->getParent()->getParent() - ->getParent(), Intrinsic::memset, - Tys, 1); - } + ->getParent(), Intrinsic::memset_i64); // Get the starting pointer of the block. StartPtr = Range.StartPtr; @@ -674,11 +671,9 @@ bool MemCpyOpt::processMemCpy(MemCpyInst* M) { return false; // If all checks passed, then we can transform these memcpy's - const Type *Tys[1]; - Tys[0] = M->getLength()->getType(); Function* MemCpyFun = Intrinsic::getDeclaration( M->getParent()->getParent()->getParent(), - M->getIntrinsicID(), Tys, 1); + M->getIntrinsicID()); std::vector<Value*> args; args.push_back(M->getRawDest()); diff --git a/lib/Transforms/Scalar/SimplifyLibCalls.cpp b/lib/Transforms/Scalar/SimplifyLibCalls.cpp index 8952747..2fbc25e 100644 --- a/lib/Transforms/Scalar/SimplifyLibCalls.cpp +++ b/lib/Transforms/Scalar/SimplifyLibCalls.cpp @@ -130,10 +130,9 @@ Value *LibCallOptimization::EmitStrLen(Value *Ptr, IRBuilder<> &B) { Value *LibCallOptimization::EmitMemCpy(Value *Dst, Value *Src, Value *Len, unsigned Align, IRBuilder<> &B) { Module *M = Caller->getParent(); - Intrinsic::ID IID = Intrinsic::memcpy; - const Type *Tys[1]; - Tys[0] = Len->getType(); - Value *MemCpy = Intrinsic::getDeclaration(M, IID, Tys, 1); + Intrinsic::ID IID = Len->getType() == Type::Int32Ty ? + Intrinsic::memcpy_i32 : Intrinsic::memcpy_i64; + Value *MemCpy = Intrinsic::getDeclaration(M, IID); return B.CreateCall4(MemCpy, CastToCStr(Dst, B), CastToCStr(Src, B), Len, ConstantInt::get(Type::Int32Ty, Align)); } diff --git a/lib/Transforms/Utils/InlineFunction.cpp b/lib/Transforms/Utils/InlineFunction.cpp index 49131e8..26b4de5 100644 --- a/lib/Transforms/Utils/InlineFunction.cpp +++ b/lib/Transforms/Utils/InlineFunction.cpp @@ -257,10 +257,8 @@ bool llvm::InlineFunction(CallSite CS, CallGraph *CG, const TargetData *TD) { Value *NewAlloca = new AllocaInst(AggTy, 0, Align, I->getName(), Caller->begin()->begin()); // Emit a memcpy. - const Type *Tys[] = { Type::Int64Ty }; Function *MemCpyFn = Intrinsic::getDeclaration(Caller->getParent(), - Intrinsic::memcpy, - Tys, 1); + Intrinsic::memcpy_i64); Value *DestCast = new BitCastInst(NewAlloca, VoidPtrTy, "tmp", TheCall); Value *SrcCast = new BitCastInst(*AI, VoidPtrTy, "tmp", TheCall); diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 3662941..ffafc77 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1336,9 +1336,12 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) { switch (ID) { default: break; - case Intrinsic::memcpy: - case Intrinsic::memmove: - case Intrinsic::memset: + case Intrinsic::memcpy_i32: + case Intrinsic::memcpy_i64: + case Intrinsic::memmove_i32: + case Intrinsic::memmove_i64: + case Intrinsic::memset_i32: + case Intrinsic::memset_i64: Assert1(isa<ConstantInt>(CI.getOperand(4)), "alignment argument of memory intrinsics must be a constant int", &CI); |