diff options
author | Pete Cooper <peter_cooper@apple.com> | 2015-11-19 05:56:52 +0000 |
---|---|---|
committer | Pete Cooper <peter_cooper@apple.com> | 2015-11-19 05:56:52 +0000 |
commit | 67cf9a723ba5cf0a711efcb317b241104b558779 (patch) | |
tree | e362be29f8f95e45470715ea59a93f2b8ad86de9 /llvm/lib/IR/AutoUpgrade.cpp | |
parent | 3b39e88ae0e1f260ebb89f874d8006cb0b87fd2f (diff) | |
download | bcm5719-llvm-67cf9a723ba5cf0a711efcb317b241104b558779.tar.gz bcm5719-llvm-67cf9a723ba5cf0a711efcb317b241104b558779.zip |
Revert "Change memcpy/memset/memmove to have dest and source alignments."
This reverts commit r253511.
This likely broke the bots in
http://lab.llvm.org:8011/builders/clang-ppc64-elf-linux2/builds/20202
http://bb.pgr.jp/builders/clang-3stage-i686-linux/builds/3787
llvm-svn: 253543
Diffstat (limited to 'llvm/lib/IR/AutoUpgrade.cpp')
-rw-r--r-- | llvm/lib/IR/AutoUpgrade.cpp | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp index c83313fa654..12c354c89b2 100644 --- a/llvm/lib/IR/AutoUpgrade.cpp +++ b/llvm/lib/IR/AutoUpgrade.cpp @@ -144,36 +144,6 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { } break; } - case 'm': { - if (Name.startswith("memcpy.") && F->arg_size() == 5) { - F->setName(Name + ".old"); - // Get the types of dest, src, and len. - ArrayRef<Type *> ParamTypes = F->getFunctionType()->params().slice(0, 3); - NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memcpy, - ParamTypes); - return true; - } - if (Name.startswith("memmove.") && F->arg_size() == 5) { - F->setName(Name + ".old"); - // Get the types of dest, src, and len. - ArrayRef<Type *> ParamTypes = F->getFunctionType()->params().slice(0, 3); - NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memmove, - ParamTypes); - return true; - } - if (Name.startswith("memset.") && F->arg_size() == 5) { - F->setName(Name + ".old"); - // Get the types of dest and len. - Type *ParamTypes[2] = { - F->getFunctionType()->getParamType(0), - F->getFunctionType()->getParamType(2) - }; - NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memset, - ParamTypes); - return true; - } - break; - } case 'o': // We only need to change the name to match the mangling including the @@ -757,31 +727,6 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { CI->eraseFromParent(); return; - case Intrinsic::memcpy: - case Intrinsic::memmove: - case Intrinsic::memset: { - // Remove alignment argument (3), and add alignment attributes to the - // dest/src pointers. - Value *Args[4] = { - CI->getArgOperand(0), - CI->getArgOperand(1), - CI->getArgOperand(2), - CI->getArgOperand(4) - }; - auto *MemCI = cast<MemIntrinsic>(Builder.CreateCall(NewFn, Args, Name)); - - // All mem intrinsics support dest alignment. - const ConstantInt *Align = cast<ConstantInt>(CI->getArgOperand(3)); - MemCI->setDestAlignment(Align->getZExtValue()); - - // Memcpy/Memmove also support source alignment. - if (auto *MemTransferI = dyn_cast<MemTransferInst>(MemCI)) - MemTransferI->setSrcAlignment(Align->getZExtValue()); - CI->replaceAllUsesWith(MemCI); - CI->eraseFromParent(); - return; - } - case Intrinsic::objectsize: CI->replaceAllUsesWith(Builder.CreateCall( NewFn, {CI->getArgOperand(0), CI->getArgOperand(1)}, Name)); |