From b85e4eba85a38698f3b3332f82554bf8442547e2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 18 Jun 2011 06:05:24 +0000 Subject: [PATCH] rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which is for pre-2.9 bitcode files. We keep x86 unaligned loads, movnt, crc32, and the target indep prefetch change. As usual, updating the testsuite is a PITA. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133337 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/AutoUpgrade.cpp | 1220 +---------------- test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll | 6 +- test/Analysis/BasicAA/modref.ll | 22 +- test/Analysis/ScalarEvolution/avoid-smax-1.ll | 13 +- test/Analysis/ScalarEvolution/trip-count3.ll | 86 +- test/Assembler/AutoUpgradeIntrinsics.ll | 85 +- test/Assembler/AutoUpgradeMMXIntrinsics.ll | 223 --- test/Bitcode/memcpy.ll | 23 - test/CodeGen/ARM/2007-05-07-jumptoentry.ll | 58 - .../2007-05-31-RegScavengerInfiniteLoop.ll | 237 ---- test/CodeGen/ARM/2009-03-07-SpillerBug.ll | 121 +- .../ARM/2009-06-12-RegScavengerAssert.ll | 77 -- test/CodeGen/ARM/2009-08-31-LSDA-Name.ll | 74 +- test/CodeGen/ARM/dyn-stackalloc.ll | 72 +- test/CodeGen/ARM/memcpy-inline.ll | 7 +- test/CodeGen/ARM/memfunc.ll | 15 +- .../Generic/2005-07-12-memcpy-i64-length.ll | 11 - .../Generic/2007-11-21-UndeadIllegalNode.ll | 157 --- test/CodeGen/Generic/invalid-memcpy.ll | 14 +- .../PowerPC/2008-10-30-IllegalShift.ll | 14 - test/CodeGen/PowerPC/2009-11-15-ReMatBug.ll | 155 --- test/CodeGen/PowerPC/atomic-1.ll | 26 +- test/CodeGen/PowerPC/atomic-2.ll | 26 +- test/CodeGen/PowerPC/invalid-memcpy.ll | 20 - test/CodeGen/Thumb/dyn-stackalloc.ll | 4 +- .../Thumb2/2009-08-04-SubregLoweringBug.ll | 5 +- test/CodeGen/X86/2004-02-12-Memcpy.ll | 25 - test/CodeGen/X86/2006-11-28-Memcpy.ll | 34 - test/CodeGen/X86/2007-05-05-Personality.ll | 40 +- test/CodeGen/X86/2007-06-05-LSR-Dominator.ll | 129 -- .../X86/2008-06-04-MemCpyLoweringBug.ll | 19 - .../X86/2008-10-27-StackRealignment.ll | 8 +- test/CodeGen/X86/2009-01-25-NoSSE.ll | 16 +- .../X86/2009-04-27-LiveIntervalsBug.ll | 165 --- test/CodeGen/X86/2009-11-16-UnfoldMemOpBug.ll | 4 +- test/CodeGen/X86/darwin-bzero.ll | 4 +- test/CodeGen/X86/memcpy-2.ll | 10 +- test/CodeGen/X86/memmove-4.ll | 12 - test/CodeGen/X86/memset-2.ll | 4 +- test/CodeGen/X86/memset-3.ll | 4 +- test/CodeGen/X86/memset.ll | 4 +- test/CodeGen/X86/memset64-on-x86-32.ll | 7 +- test/CodeGen/X86/optimize-max-0.ll | 888 ++++++------ test/CodeGen/X86/personality.ll | 41 +- test/CodeGen/X86/pre-split2.ll | 26 - test/CodeGen/X86/pre-split3.ll | 26 - test/CodeGen/X86/unaligned-load.ll | 19 +- .../X86/variable-sized-darwin-bzero.ll | 6 +- test/Transforms/DeadStoreElimination/crash.ll | 4 +- .../DeadStoreElimination/lifetime.ll | 4 +- .../DeadStoreElimination/memintrinsics.ll | 12 +- .../Transforms/DeadStoreElimination/simple.ll | 22 +- .../FunctionAttrs/2008-10-04-LocalMemory.ll | 64 - .../GVN/2008-02-24-NonDominatedMemcpy.ll | 25 - test/Transforms/GVN/2008-02-26-MemCpySize.ll | 46 - test/Transforms/GVN/nonescaping-malloc.ll | 98 +- test/Transforms/GVN/rle.ll | 21 +- test/Transforms/GlobalOpt/memcpy.ll | 12 +- test/Transforms/GlobalOpt/memset.ll | 19 +- test/Transforms/Inline/inline-invoke-tail.ll | 10 +- .../InstCombine/2006-11-03-Memmove64.ll | 16 - .../InstCombine/2007-05-04-Crash.ll | 30 - .../InstCombine/2007-10-10-EliminateMemCpy.ll | 19 +- .../2009-02-20-InstCombine-SROA.ll | 489 +++---- test/Transforms/InstCombine/memcpy-to-load.ll | 11 +- test/Transforms/InstCombine/memmove.ll | 21 +- test/Transforms/InstCombine/memset.ll | 19 +- .../Transforms/InstCombine/stack-overalign.ll | 14 +- .../MemCpyOpt/2008-02-24-MultipleUseofSRet.ll | 44 +- .../MemCpyOpt/2008-03-13-ReturnSlotBitcast.ll | 26 +- test/Transforms/MemCpyOpt/memcpy.ll | 54 +- test/Transforms/MemCpyOpt/memmove.ll | 14 +- test/Transforms/MemCpyOpt/sret.ll | 40 +- .../ScalarRepl/2007-05-24-LargeAggregate.ll | 27 - .../ScalarRepl/2007-05-29-MemcpyPreserve.ll | 27 +- .../ScalarRepl/2008-06-22-LargeArray.ll | 16 +- .../2008-08-22-out-of-range-array-promote.ll | 23 +- .../ScalarRepl/2008-09-22-vector-gep.ll | 4 +- .../ScalarRepl/2009-03-04-MemCpyAlign.ll | 5 +- .../ScalarRepl/2009-12-11-NeonTypes.ll | 95 +- .../ScalarRepl/2010-01-18-SelfCopy.ll | 6 +- test/Transforms/ScalarRepl/badarray.ll | 4 +- test/Transforms/ScalarRepl/crash.ll | 8 +- .../Transforms/ScalarRepl/memset-aggregate.ll | 13 +- test/Transforms/SimplifyLibCalls/MemCpy.ll | 21 +- 85 files changed, 1390 insertions(+), 4255 deletions(-) delete mode 100644 test/Assembler/AutoUpgradeMMXIntrinsics.ll delete mode 100644 test/Bitcode/memcpy.ll delete mode 100644 test/CodeGen/ARM/2007-05-07-jumptoentry.ll delete mode 100644 test/CodeGen/ARM/2007-05-31-RegScavengerInfiniteLoop.ll delete mode 100644 test/CodeGen/ARM/2009-06-12-RegScavengerAssert.ll delete mode 100644 test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll delete mode 100644 test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll delete mode 100644 test/CodeGen/PowerPC/2008-10-30-IllegalShift.ll delete mode 100644 test/CodeGen/PowerPC/2009-11-15-ReMatBug.ll delete mode 100644 test/CodeGen/PowerPC/invalid-memcpy.ll delete mode 100644 test/CodeGen/X86/2004-02-12-Memcpy.ll delete mode 100644 test/CodeGen/X86/2006-11-28-Memcpy.ll delete mode 100644 test/CodeGen/X86/2007-06-05-LSR-Dominator.ll delete mode 100644 test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll delete mode 100644 test/CodeGen/X86/2009-04-27-LiveIntervalsBug.ll delete mode 100644 test/CodeGen/X86/memmove-4.ll delete mode 100644 test/CodeGen/X86/pre-split2.ll delete mode 100644 test/CodeGen/X86/pre-split3.ll delete mode 100644 test/Transforms/FunctionAttrs/2008-10-04-LocalMemory.ll delete mode 100644 test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll delete mode 100644 test/Transforms/GVN/2008-02-26-MemCpySize.ll delete mode 100644 test/Transforms/InstCombine/2006-11-03-Memmove64.ll delete mode 100644 test/Transforms/InstCombine/2007-05-04-Crash.ll delete mode 100644 test/Transforms/ScalarRepl/2007-05-24-LargeAggregate.ll diff --git a/lib/VMCore/AutoUpgrade.cpp b/lib/VMCore/AutoUpgrade.cpp index 9d4543ded48..3ffcfdcbaf5 100644 --- a/lib/VMCore/AutoUpgrade.cpp +++ b/lib/VMCore/AutoUpgrade.cpp @@ -42,248 +42,7 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { Module *M = F->getParent(); switch (Name[5]) { default: break; - case 'a': - // This upgrades the llvm.atomic.lcs, llvm.atomic.las, llvm.atomic.lss, - // and atomics with default address spaces to their new names to their new - // function name (e.g. llvm.atomic.add.i32 => llvm.atomic.add.i32.p0i32) - if (Name.compare(5,7,"atomic.",7) == 0) { - if (Name.compare(12,3,"lcs",3) == 0) { - std::string::size_type delim = Name.find('.',12); - F->setName("llvm.atomic.cmp.swap" + Name.substr(delim) + - ".p0" + Name.substr(delim+1)); - NewFn = F; - return true; - } - else if (Name.compare(12,3,"las",3) == 0) { - std::string::size_type delim = Name.find('.',12); - F->setName("llvm.atomic.load.add"+Name.substr(delim) - + ".p0" + Name.substr(delim+1)); - NewFn = F; - return true; - } - else if (Name.compare(12,3,"lss",3) == 0) { - std::string::size_type delim = Name.find('.',12); - F->setName("llvm.atomic.load.sub"+Name.substr(delim) - + ".p0" + Name.substr(delim+1)); - NewFn = F; - return true; - } - else if (Name.rfind(".p") == std::string::npos) { - // We don't have an address space qualifier so this has be upgraded - // to the new name. Copy the type name at the end of the intrinsic - // and add to it - std::string::size_type delim = Name.find_last_of('.'); - assert(delim != std::string::npos && "can not find type"); - F->setName(Name + ".p0" + Name.substr(delim+1)); - NewFn = F; - return true; - } - } else if (Name.compare(5, 9, "arm.neon.", 9) == 0) { - if (((Name.compare(14, 5, "vmovl", 5) == 0 || - Name.compare(14, 5, "vaddl", 5) == 0 || - Name.compare(14, 5, "vsubl", 5) == 0 || - Name.compare(14, 5, "vaddw", 5) == 0 || - Name.compare(14, 5, "vsubw", 5) == 0 || - Name.compare(14, 5, "vmlal", 5) == 0 || - Name.compare(14, 5, "vmlsl", 5) == 0 || - Name.compare(14, 5, "vabdl", 5) == 0 || - Name.compare(14, 5, "vabal", 5) == 0) && - (Name.compare(19, 2, "s.", 2) == 0 || - Name.compare(19, 2, "u.", 2) == 0)) || - - (Name.compare(14, 4, "vaba", 4) == 0 && - (Name.compare(18, 2, "s.", 2) == 0 || - Name.compare(18, 2, "u.", 2) == 0)) || - - (Name.compare(14, 6, "vmovn.", 6) == 0)) { - - // Calls to these are transformed into IR without intrinsics. - NewFn = 0; - return true; - } - // Old versions of NEON ld/st intrinsics are missing alignment arguments. - bool isVLd = (Name.compare(14, 3, "vld", 3) == 0); - bool isVSt = (Name.compare(14, 3, "vst", 3) == 0); - if (isVLd || isVSt) { - unsigned NumVecs = Name.at(17) - '0'; - if (NumVecs == 0 || NumVecs > 4) - return false; - bool isLaneOp = (Name.compare(18, 5, "lane.", 5) == 0); - if (!isLaneOp && Name.at(18) != '.') - return false; - unsigned ExpectedArgs = 2; // for the address and alignment - if (isVSt || isLaneOp) - ExpectedArgs += NumVecs; - if (isLaneOp) - ExpectedArgs += 1; // for the lane number - unsigned NumP = FTy->getNumParams(); - if (NumP != ExpectedArgs - 1) - return false; - - // Change the name of the old (bad) intrinsic, because - // its type is incorrect, but we cannot overload that name. - F->setName(""); - - // One argument is missing: add the alignment argument. - std::vector NewParams; - for (unsigned p = 0; p < NumP; ++p) - NewParams.push_back(FTy->getParamType(p)); - NewParams.push_back(Type::getInt32Ty(F->getContext())); - FunctionType *NewFTy = FunctionType::get(FTy->getReturnType(), - NewParams, false); - NewFn = cast(M->getOrInsertFunction(Name, NewFTy)); - return true; - } - } - break; - case 'b': - // This upgrades the name of the llvm.bswap intrinsic function to only use - // a single type name for overloading. We only care about the old format - // 'llvm.bswap.i*.i*', so check for 'bswap.' and then for there being - // a '.' after 'bswap.' - if (Name.compare(5,6,"bswap.",6) == 0) { - std::string::size_type delim = Name.find('.',11); - - if (delim != std::string::npos) { - // Construct the new name as 'llvm.bswap' + '.i*' - F->setName(Name.substr(0,10)+Name.substr(delim)); - NewFn = F; - return true; - } - } - break; - - case 'c': - // We only want to fix the 'llvm.ct*' intrinsics which do not have the - // correct return type, so we check for the name, and then check if the - // return type does not match the parameter type. - if ( (Name.compare(5,5,"ctpop",5) == 0 || - Name.compare(5,4,"ctlz",4) == 0 || - Name.compare(5,4,"cttz",4) == 0) && - FTy->getReturnType() != FTy->getParamType(0)) { - // We first need to change the name of the old (bad) intrinsic, because - // its type is incorrect, but we cannot overload that name. We - // arbitrarily unique it here allowing us to construct a correctly named - // and typed function below. - F->setName(""); - - // Now construct the new intrinsic with the correct name and type. We - // leave the old function around in order to query its type, whatever it - // may be, and correctly convert up to the new type. - NewFn = cast(M->getOrInsertFunction(Name, - FTy->getParamType(0), - FTy->getParamType(0), - (Type *)0)); - return true; - } - break; - - case 'e': - // The old llvm.eh.selector.i32 is equivalent to the new llvm.eh.selector. - if (Name.compare("llvm.eh.selector.i32") == 0) { - F->setName("llvm.eh.selector"); - NewFn = F; - return true; - } - // The old llvm.eh.typeid.for.i32 is equivalent to llvm.eh.typeid.for. - if (Name.compare("llvm.eh.typeid.for.i32") == 0) { - F->setName("llvm.eh.typeid.for"); - NewFn = F; - return true; - } - // Convert the old llvm.eh.selector.i64 to a call to llvm.eh.selector. - if (Name.compare("llvm.eh.selector.i64") == 0) { - NewFn = Intrinsic::getDeclaration(M, Intrinsic::eh_selector); - return true; - } - // Convert the old llvm.eh.typeid.for.i64 to a call to llvm.eh.typeid.for. - if (Name.compare("llvm.eh.typeid.for.i64") == 0) { - NewFn = Intrinsic::getDeclaration(M, Intrinsic::eh_typeid_for); - return true; - } - break; - - case 'm': { - // This upgrades the llvm.memcpy, llvm.memmove, and llvm.memset to the - // new format that allows overloading the pointer for different address - // space (e.g., llvm.memcpy.i16 => llvm.memcpy.p0i8.p0i8.i16) - const char* NewFnName = NULL; - if (Name.compare(5,8,"memcpy.i",8) == 0) { - if (Name[13] == '8') - NewFnName = "llvm.memcpy.p0i8.p0i8.i8"; - else if (Name.compare(13,2,"16") == 0) - NewFnName = "llvm.memcpy.p0i8.p0i8.i16"; - else if (Name.compare(13,2,"32") == 0) - NewFnName = "llvm.memcpy.p0i8.p0i8.i32"; - else if (Name.compare(13,2,"64") == 0) - NewFnName = "llvm.memcpy.p0i8.p0i8.i64"; - } else if (Name.compare(5,9,"memmove.i",9) == 0) { - if (Name[14] == '8') - NewFnName = "llvm.memmove.p0i8.p0i8.i8"; - else if (Name.compare(14,2,"16") == 0) - NewFnName = "llvm.memmove.p0i8.p0i8.i16"; - else if (Name.compare(14,2,"32") == 0) - NewFnName = "llvm.memmove.p0i8.p0i8.i32"; - else if (Name.compare(14,2,"64") == 0) - NewFnName = "llvm.memmove.p0i8.p0i8.i64"; - } - else if (Name.compare(5,8,"memset.i",8) == 0) { - if (Name[13] == '8') - NewFnName = "llvm.memset.p0i8.i8"; - else if (Name.compare(13,2,"16") == 0) - NewFnName = "llvm.memset.p0i8.i16"; - else if (Name.compare(13,2,"32") == 0) - NewFnName = "llvm.memset.p0i8.i32"; - else if (Name.compare(13,2,"64") == 0) - NewFnName = "llvm.memset.p0i8.i64"; - } - if (NewFnName) { - NewFn = cast(M->getOrInsertFunction(NewFnName, - FTy->getReturnType(), - FTy->getParamType(0), - FTy->getParamType(1), - FTy->getParamType(2), - FTy->getParamType(3), - Type::getInt1Ty(F->getContext()), - (Type *)0)); - return true; - } - break; - } case 'p': - // This upgrades the llvm.part.select overloaded intrinsic names to only - // use one type specifier in the name. We only care about the old format - // 'llvm.part.select.i*.i*', and solve as above with bswap. - if (Name.compare(5,12,"part.select.",12) == 0) { - std::string::size_type delim = Name.find('.',17); - - if (delim != std::string::npos) { - // Construct a new name as 'llvm.part.select' + '.i*' - F->setName(Name.substr(0,16)+Name.substr(delim)); - NewFn = F; - return true; - } - break; - } - - // This upgrades the llvm.part.set intrinsics similarly as above, however - // we care about 'llvm.part.set.i*.i*.i*', but only the first two types - // must match. There is an additional type specifier after these two - // matching types that we must retain when upgrading. Thus, we require - // finding 2 periods, not just one, after the intrinsic name. - if (Name.compare(5,9,"part.set.",9) == 0) { - std::string::size_type delim = Name.find('.',14); - - if (delim != std::string::npos && - Name.find('.',delim+1) != std::string::npos) { - // Construct a new name as 'llvm.part.select' + '.i*.i*' - F->setName(Name.substr(0,13)+Name.substr(delim)); - NewFn = F; - return true; - } - break; - } - // This upgrades the llvm.prefetch intrinsic to accept one more parameter, // which is a instruction / data cache identifier. The old version only // implicitly accepted the data version. @@ -336,270 +95,21 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { } } - // This fixes all MMX shift intrinsic instructions to take a - // x86_mmx instead of a v1i64, v2i32, v4i16, or v8i8. - if (Name.compare(5, 8, "x86.mmx.", 8) == 0) { - const Type *X86_MMXTy = VectorType::getX86_MMXTy(FTy->getContext()); - - if (Name.compare(13, 4, "padd", 4) == 0 || - Name.compare(13, 4, "psub", 4) == 0 || - Name.compare(13, 4, "pmul", 4) == 0 || - Name.compare(13, 5, "pmadd", 5) == 0 || - Name.compare(13, 4, "pand", 4) == 0 || - Name.compare(13, 3, "por", 3) == 0 || - Name.compare(13, 4, "pxor", 4) == 0 || - Name.compare(13, 4, "pavg", 4) == 0 || - Name.compare(13, 4, "pmax", 4) == 0 || - Name.compare(13, 4, "pmin", 4) == 0 || - Name.compare(13, 4, "psad", 4) == 0 || - Name.compare(13, 4, "psll", 4) == 0 || - Name.compare(13, 4, "psrl", 4) == 0 || - Name.compare(13, 4, "psra", 4) == 0 || - Name.compare(13, 4, "pack", 4) == 0 || - Name.compare(13, 6, "punpck", 6) == 0 || - Name.compare(13, 4, "pcmp", 4) == 0) { - assert(FTy->getNumParams() == 2 && "MMX intrinsic takes 2 args!"); - const Type *SecondParamTy = X86_MMXTy; - - if (Name.compare(13, 5, "pslli", 5) == 0 || - Name.compare(13, 5, "psrli", 5) == 0 || - Name.compare(13, 5, "psrai", 5) == 0) - SecondParamTy = FTy->getParamType(1); - - // Don't do anything if it has the correct types. - if (FTy->getReturnType() == X86_MMXTy && - FTy->getParamType(0) == X86_MMXTy && - FTy->getParamType(1) == SecondParamTy) - break; - - // We first need to change the name of the old (bad) intrinsic, because - // its type is incorrect, but we cannot overload that name. We - // arbitrarily unique it here allowing us to construct a correctly named - // and typed function below. - F->setName(""); - - // Now construct the new intrinsic with the correct name and type. We - // leave the old function around in order to query its type, whatever it - // may be, and correctly convert up to the new type. - NewFn = cast(M->getOrInsertFunction(Name, - X86_MMXTy, X86_MMXTy, - SecondParamTy, (Type*)0)); - return true; - } - - if (Name.compare(13, 8, "maskmovq", 8) == 0) { - // Don't do anything if it has the correct types. - if (FTy->getParamType(0) == X86_MMXTy && - FTy->getParamType(1) == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - FTy->getReturnType(), - X86_MMXTy, - X86_MMXTy, - FTy->getParamType(2), - (Type*)0)); - return true; - } - - if (Name.compare(13, 8, "pmovmskb", 8) == 0) { - if (FTy->getParamType(0) == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - FTy->getReturnType(), - X86_MMXTy, - (Type*)0)); - return true; - } - - if (Name.compare(13, 5, "movnt", 5) == 0) { - if (FTy->getParamType(1) == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - FTy->getReturnType(), - FTy->getParamType(0), - X86_MMXTy, - (Type*)0)); - return true; - } - - if (Name.compare(13, 7, "palignr", 7) == 0) { - if (FTy->getReturnType() == X86_MMXTy && - FTy->getParamType(0) == X86_MMXTy && - FTy->getParamType(1) == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - X86_MMXTy, - X86_MMXTy, - X86_MMXTy, - FTy->getParamType(2), - (Type*)0)); - return true; - } - - if (Name.compare(13, 5, "pextr", 5) == 0) { - if (FTy->getParamType(0) == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - FTy->getReturnType(), - X86_MMXTy, - FTy->getParamType(1), - (Type*)0)); - return true; - } - - if (Name.compare(13, 5, "pinsr", 5) == 0) { - if (FTy->getReturnType() == X86_MMXTy && - FTy->getParamType(0) == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - X86_MMXTy, - X86_MMXTy, - FTy->getParamType(1), - FTy->getParamType(2), - (Type*)0)); - return true; - } - - if (Name.compare(13, 12, "cvtsi32.si64", 12) == 0) { - if (FTy->getReturnType() == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - X86_MMXTy, - FTy->getParamType(0), - (Type*)0)); - return true; - } - - if (Name.compare(13, 12, "cvtsi64.si32", 12) == 0) { - if (FTy->getParamType(0) == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - FTy->getReturnType(), - X86_MMXTy, - (Type*)0)); - return true; - } - - if (Name.compare(13, 8, "vec.init", 8) == 0) { - if (FTy->getReturnType() == X86_MMXTy) - break; - - F->setName(""); - - if (Name.compare(21, 2, ".b", 2) == 0) - NewFn = cast(M->getOrInsertFunction(Name, - X86_MMXTy, - FTy->getParamType(0), - FTy->getParamType(1), - FTy->getParamType(2), - FTy->getParamType(3), - FTy->getParamType(4), - FTy->getParamType(5), - FTy->getParamType(6), - FTy->getParamType(7), - (Type*)0)); - else if (Name.compare(21, 2, ".w", 2) == 0) - NewFn = cast(M->getOrInsertFunction(Name, - X86_MMXTy, - FTy->getParamType(0), - FTy->getParamType(1), - FTy->getParamType(2), - FTy->getParamType(3), - (Type*)0)); - else if (Name.compare(21, 2, ".d", 2) == 0) - NewFn = cast(M->getOrInsertFunction(Name, - X86_MMXTy, - FTy->getParamType(0), - FTy->getParamType(1), - (Type*)0)); - return true; - } - - - if (Name.compare(13, 9, "vec.ext.d", 9) == 0) { - if (FTy->getReturnType() == X86_MMXTy && - FTy->getParamType(0) == X86_MMXTy) - break; - - F->setName(""); - NewFn = cast(M->getOrInsertFunction(Name, - X86_MMXTy, - X86_MMXTy, - FTy->getParamType(1), - (Type*)0)); - return true; - } - - if (Name.compare(13, 9, "emms", 4) == 0 || - Name.compare(13, 9, "femms", 5) == 0) { - NewFn = 0; - break; - } - - // We really shouldn't get here ever. - assert(0 && "Invalid MMX intrinsic!"); - break; - } else if (Name.compare(5,17,"x86.sse2.loadh.pd",17) == 0 || - Name.compare(5,17,"x86.sse2.loadl.pd",17) == 0 || - Name.compare(5,16,"x86.sse2.movl.dq",16) == 0 || - Name.compare(5,15,"x86.sse2.movs.d",15) == 0 || - Name.compare(5,16,"x86.sse2.shuf.pd",16) == 0 || - Name.compare(5,18,"x86.sse2.unpckh.pd",18) == 0 || - Name.compare(5,18,"x86.sse2.unpckl.pd",18) == 0 || - Name.compare(5,20,"x86.sse2.punpckh.qdq",20) == 0 || - Name.compare(5,20,"x86.sse2.punpckl.qdq",20) == 0) { - // Calls to these intrinsics are transformed into ShuffleVector's. - NewFn = 0; - return true; - } else if (Name.compare(5, 16, "x86.sse41.pmulld", 16) == 0) { - // Calls to these intrinsics are transformed into vector multiplies. - NewFn = 0; - return true; - } else if (Name.compare(5, 18, "x86.ssse3.palign.r", 18) == 0 || - Name.compare(5, 22, "x86.ssse3.palign.r.128", 22) == 0) { - // Calls to these intrinsics are transformed into vector shuffles, shifts, - // or 0. - NewFn = 0; - return true; - } else if (Name.compare(5, 16, "x86.sse.loadu.ps", 16) == 0 || - Name.compare(5, 17, "x86.sse2.loadu.dq", 17) == 0 || - Name.compare(5, 17, "x86.sse2.loadu.pd", 17) == 0) { + if (Name.compare(5, 16, "x86.sse.loadu.ps", 16) == 0 || + Name.compare(5, 17, "x86.sse2.loadu.dq", 17) == 0 || + Name.compare(5, 17, "x86.sse2.loadu.pd", 17) == 0) { // Calls to these instructions are transformed into unaligned loads. NewFn = 0; return true; - } else if (Name.compare(5, 16, "x86.sse.movnt.ps", 16) == 0 || - Name.compare(5, 17, "x86.sse2.movnt.dq", 17) == 0 || - Name.compare(5, 17, "x86.sse2.movnt.pd", 17) == 0 || - Name.compare(5, 17, "x86.sse2.movnt.i", 16) == 0) { + } + + if (Name.compare(5, 16, "x86.sse.movnt.ps", 16) == 0 || + Name.compare(5, 17, "x86.sse2.movnt.dq", 17) == 0 || + Name.compare(5, 17, "x86.sse2.movnt.pd", 17) == 0 || + Name.compare(5, 17, "x86.sse2.movnt.i", 16) == 0) { // Calls to these instructions are transformed into nontemporal stores. NewFn = 0; return true; - } else if (Name.compare(5, 17, "x86.ssse3.pshuf.w", 17) == 0) { - // This is an SSE/MMX instruction. - const Type *X86_MMXTy = VectorType::getX86_MMXTy(FTy->getContext()); - NewFn = - cast(M->getOrInsertFunction("llvm.x86.sse.pshuf.w", - X86_MMXTy, - X86_MMXTy, - Type::getInt8Ty(F->getContext()), - (Type*)0)); - return true; } break; @@ -625,105 +135,10 @@ bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn) { } bool llvm::UpgradeGlobalVariable(GlobalVariable *GV) { - StringRef Name(GV->getName()); - - // We are only upgrading one symbol here. - if (Name == ".llvm.eh.catch.all.value") { - GV->setName("llvm.eh.catch.all.value"); - return true; - } - + // Nothing to do yet. return false; } -/// ExtendNEONArgs - For NEON "long" and "wide" operations, where the results -/// have vector elements twice as big as one or both source operands, do the -/// sign- or zero-extension that used to be handled by intrinsics. The -/// extended values are returned via V0 and V1. -static void ExtendNEONArgs(CallInst *CI, Value *Arg0, Value *Arg1, - Value *&V0, Value *&V1) { - Function *F = CI->getCalledFunction(); - const std::string& Name = F->getName(); - bool isLong = (Name.at(18) == 'l'); - bool isSigned = (Name.at(19) == 's'); - - if (isSigned) { - if (isLong) - V0 = new SExtInst(Arg0, CI->getType(), "", CI); - else - V0 = Arg0; - V1 = new SExtInst(Arg1, CI->getType(), "", CI); - } else { - if (isLong) - V0 = new ZExtInst(Arg0, CI->getType(), "", CI); - else - V0 = Arg0; - V1 = new ZExtInst(Arg1, CI->getType(), "", CI); - } -} - -/// CallVABD - As part of expanding a call to one of the old NEON vabdl, vaba, -/// or vabal intrinsics, construct a call to a vabd intrinsic. Examine the -/// name of the old intrinsic to determine whether to use a signed or unsigned -/// vabd intrinsic. Get the type from the old call instruction, adjusted for -/// half-size vector elements if the old intrinsic was vabdl or vabal. -static Instruction *CallVABD(CallInst *CI, Value *Arg0, Value *Arg1) { - Function *F = CI->getCalledFunction(); - const std::string& Name = F->getName(); - bool isLong = (Name.at(18) == 'l'); - bool isSigned = (Name.at(isLong ? 19 : 18) == 's'); - - Intrinsic::ID intID; - if (isSigned) - intID = Intrinsic::arm_neon_vabds; - else - intID = Intrinsic::arm_neon_vabdu; - - const Type *Ty = CI->getType(); - if (isLong) - Ty = VectorType::getTruncatedElementVectorType(cast(Ty)); - - Function *VABD = Intrinsic::getDeclaration(F->getParent(), intID, &Ty, 1); - Value *Operands[2]; - Operands[0] = Arg0; - Operands[1] = Arg1; - return CallInst::Create(VABD, Operands, Operands+2, - "upgraded."+CI->getName(), CI); -} - -/// ConstructNewCallInst - Construct a new CallInst with the signature of NewFn. -static void ConstructNewCallInst(Function *NewFn, CallInst *OldCI, - Value **Operands, unsigned NumOps, - bool AssignName = true) { - // Construct a new CallInst. - CallInst *NewCI = - CallInst::Create(NewFn, Operands, Operands + NumOps, - AssignName ? "upgraded." + OldCI->getName() : "", OldCI); - - NewCI->setTailCall(OldCI->isTailCall()); - NewCI->setCallingConv(OldCI->getCallingConv()); - - // Handle any uses of the old CallInst. If the type has changed, add a cast. - if (!OldCI->use_empty()) { - if (OldCI->getType() != NewCI->getType()) { - Function *OldFn = OldCI->getCalledFunction(); - CastInst *RetCast = - CastInst::Create(CastInst::getCastOpcode(NewCI, true, - OldFn->getReturnType(), true), - NewCI, OldFn->getReturnType(), NewCI->getName(),OldCI); - - // Replace all uses of the old call with the new cast which has the - // correct type. - OldCI->replaceAllUsesWith(RetCast); - } else { - OldCI->replaceAllUsesWith(NewCI); - } - } - - // Clean up the old call now that it has been completely upgraded. - OldCI->eraseFromParent(); -} - // UpgradeIntrinsicCall - Upgrade a call to an old intrinsic to be a call the // upgraded intrinsic. All argument and return casting must be provided in // order to seamlessly integrate with existing context. @@ -735,284 +150,9 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { assert(F && "CallInst has no function associated with it."); if (!NewFn) { - // Get the Function's name. - const std::string& Name = F->getName(); - - // Upgrade ARM NEON intrinsics. - if (Name.compare(5, 9, "arm.neon.", 9) == 0) { - Instruction *NewI; - Value *V0, *V1; - if (Name.compare(14, 7, "vmovls.", 7) == 0) { - NewI = new SExtInst(CI->getArgOperand(0), CI->getType(), - "upgraded." + CI->getName(), CI); - } else if (Name.compare(14, 7, "vmovlu.", 7) == 0) { - NewI = new ZExtInst(CI->getArgOperand(0), CI->getType(), - "upgraded." + CI->getName(), CI); - } else if (Name.compare(14, 4, "vadd", 4) == 0) { - ExtendNEONArgs(CI, CI->getArgOperand(0), CI->getArgOperand(1), V0, V1); - NewI = BinaryOperator::CreateAdd(V0, V1, "upgraded."+CI->getName(), CI); - } else if (Name.compare(14, 4, "vsub", 4) == 0) { - ExtendNEONArgs(CI, CI->getArgOperand(0), CI->getArgOperand(1), V0, V1); - NewI = BinaryOperator::CreateSub(V0, V1,"upgraded."+CI->getName(),CI); - } else if (Name.compare(14, 4, "vmul", 4) == 0) { - ExtendNEONArgs(CI, CI->getArgOperand(0), CI->getArgOperand(1), V0, V1); - NewI = BinaryOperator::CreateMul(V0, V1,"upgraded."+CI->getName(),CI); - } else if (Name.compare(14, 4, "vmla", 4) == 0) { - ExtendNEONArgs(CI, CI->getArgOperand(1), CI->getArgOperand(2), V0, V1); - Instruction *MulI = BinaryOperator::CreateMul(V0, V1, "", CI); - NewI = BinaryOperator::CreateAdd(CI->getArgOperand(0), MulI, - "upgraded."+CI->getName(), CI); - } else if (Name.compare(14, 4, "vmls", 4) == 0) { - ExtendNEONArgs(CI, CI->getArgOperand(1), CI->getArgOperand(2), V0, V1); - Instruction *MulI = BinaryOperator::CreateMul(V0, V1, "", CI); - NewI = BinaryOperator::CreateSub(CI->getArgOperand(0), MulI, - "upgraded."+CI->getName(), CI); - } else if (Name.compare(14, 4, "vabd", 4) == 0) { - NewI = CallVABD(CI, CI->getArgOperand(0), CI->getArgOperand(1)); - NewI = new ZExtInst(NewI, CI->getType(), "upgraded."+CI->getName(), CI); - } else if (Name.compare(14, 4, "vaba", 4) == 0) { - NewI = CallVABD(CI, CI->getArgOperand(1), CI->getArgOperand(2)); - if (Name.at(18) == 'l') - NewI = new ZExtInst(NewI, CI->getType(), "", CI); - NewI = BinaryOperator::CreateAdd(CI->getArgOperand(0), NewI, - "upgraded."+CI->getName(), CI); - } else if (Name.compare(14, 6, "vmovn.", 6) == 0) { - NewI = new TruncInst(CI->getArgOperand(0), CI->getType(), - "upgraded." + CI->getName(), CI); - } else { - llvm_unreachable("Unknown arm.neon function for CallInst upgrade."); - } - // Replace any uses of the old CallInst. - if (!CI->use_empty()) - CI->replaceAllUsesWith(NewI); - CI->eraseFromParent(); - return; - } - - bool isLoadH = false, isLoadL = false, isMovL = false; - bool isMovSD = false, isShufPD = false; - bool isUnpckhPD = false, isUnpcklPD = false; - bool isPunpckhQPD = false, isPunpcklQPD = false; - if (F->getName() == "llvm.x86.sse2.loadh.pd") - isLoadH = true; - else if (F->getName() == "llvm.x86.sse2.loadl.pd") - isLoadL = true; - else if (F->getName() == "llvm.x86.sse2.movl.dq") - isMovL = true; - else if (F->getName() == "llvm.x86.sse2.movs.d") - isMovSD = true; - else if (F->getName() == "llvm.x86.sse2.shuf.pd") - isShufPD = true; - else if (F->getName() == "llvm.x86.sse2.unpckh.pd") - isUnpckhPD = true; - else if (F->getName() == "llvm.x86.sse2.unpckl.pd") - isUnpcklPD = true; - else if (F->getName() == "llvm.x86.sse2.punpckh.qdq") - isPunpckhQPD = true; - else if (F->getName() == "llvm.x86.sse2.punpckl.qdq") - isPunpcklQPD = true; - - if (isLoadH || isLoadL || isMovL || isMovSD || isShufPD || - isUnpckhPD || isUnpcklPD || isPunpckhQPD || isPunpcklQPD) { - std::vector Idxs; - Value *Op0 = CI->getArgOperand(0); - ShuffleVectorInst *SI = NULL; - if (isLoadH || isLoadL) { - Value *Op1 = UndefValue::get(Op0->getType()); - Value *Addr = new BitCastInst(CI->getArgOperand(1), - Type::getDoublePtrTy(C), - "upgraded.", CI); - Value *Load = new LoadInst(Addr, "upgraded.", false, 8, CI); - Value *Idx = ConstantInt::get(Type::getInt32Ty(C), 0); - Op1 = InsertElementInst::Create(Op1, Load, Idx, "upgraded.", CI); - - if (isLoadH) { - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 0)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 2)); - } else { - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 2)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 1)); - } - Value *Mask = ConstantVector::get(Idxs); - SI = new ShuffleVectorInst(Op0, Op1, Mask, "upgraded.", CI); - } else if (isMovL) { - Constant *Zero = ConstantInt::get(Type::getInt32Ty(C), 0); - Idxs.push_back(Zero); - Idxs.push_back(Zero); - Idxs.push_back(Zero); - Idxs.push_back(Zero); - Value *ZeroV = ConstantVector::get(Idxs); - - Idxs.clear(); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 4)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 5)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 2)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 3)); - Value *Mask = ConstantVector::get(Idxs); - SI = new ShuffleVectorInst(ZeroV, Op0, Mask, "upgraded.", CI); - } else if (isMovSD || - isUnpckhPD || isUnpcklPD || isPunpckhQPD || isPunpcklQPD) { - Value *Op1 = CI->getArgOperand(1); - if (isMovSD) { - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 2)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 1)); - } else if (isUnpckhPD || isPunpckhQPD) { - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 1)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 3)); - } else { - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 0)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), 2)); - } - Value *Mask = ConstantVector::get(Idxs); - SI = new ShuffleVectorInst(Op0, Op1, Mask, "upgraded.", CI); - } else if (isShufPD) { - Value *Op1 = CI->getArgOperand(1); - unsigned MaskVal = - cast(CI->getArgOperand(2))->getZExtValue(); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), MaskVal & 1)); - Idxs.push_back(ConstantInt::get(Type::getInt32Ty(C), - ((MaskVal >> 1) & 1)+2)); - Value *Mask = ConstantVector::get(Idxs); - SI = new ShuffleVectorInst(Op0, Op1, Mask, "upgraded.", CI); - } - - assert(SI && "Unexpected!"); - - // Handle any uses of the old CallInst. - if (!CI->use_empty()) - // Replace all uses of the old call with the new cast which has the - // correct type. - CI->replaceAllUsesWith(SI); - - // Clean up the old call now that it has been completely upgraded. - CI->eraseFromParent(); - } else if (F->getName() == "llvm.x86.sse41.pmulld") { - // Upgrade this set of intrinsics into vector multiplies. - Instruction *Mul = BinaryOperator::CreateMul(CI->getArgOperand(0), - CI->getArgOperand(1), - CI->getName(), - CI); - // Fix up all the uses with our new multiply. - if (!CI->use_empty()) - CI->replaceAllUsesWith(Mul); - - // Remove upgraded multiply. - CI->eraseFromParent(); - } else if (F->getName() == "llvm.x86.ssse3.palign.r") { - Value *Op1 = CI->getArgOperand(0); - Value *Op2 = CI->getArgOperand(1); - Value *Op3 = CI->getArgOperand(2); - unsigned shiftVal = cast(Op3)->getZExtValue(); - Value *Rep; - IRBuilder<> Builder(C); - Builder.SetInsertPoint(CI->getParent(), CI); - - // If palignr is shifting the pair of input vectors less than 9 bytes, - // emit a shuffle instruction. - if (shiftVal <= 8) { - const Type *IntTy = Type::getInt32Ty(C); - const Type *EltTy = Type::getInt8Ty(C); - const Type *VecTy = VectorType::get(EltTy, 8); - - Op2 = Builder.CreateBitCast(Op2, VecTy); - Op1 = Builder.CreateBitCast(Op1, VecTy); - - llvm::SmallVector Indices; - for (unsigned i = 0; i != 8; ++i) - Indices.push_back(ConstantInt::get(IntTy, shiftVal + i)); - - Value *SV = ConstantVector::get(Indices); - Rep = Builder.CreateShuffleVector(Op2, Op1, SV, "palignr"); - Rep = Builder.CreateBitCast(Rep, F->getReturnType()); - } - - // If palignr is shifting the pair of input vectors more than 8 but less - // than 16 bytes, emit a logical right shift of the destination. - else if (shiftVal < 16) { - // MMX has these as 1 x i64 vectors for some odd optimization reasons. - const Type *EltTy = Type::getInt64Ty(C); - const Type *VecTy = VectorType::get(EltTy, 1); - - Op1 = Builder.CreateBitCast(Op1, VecTy, "cast"); - Op2 = ConstantInt::get(VecTy, (shiftVal-8) * 8); - - // create i32 constant - Function *I = - Intrinsic::getDeclaration(F->getParent(), Intrinsic::x86_mmx_psrl_q); - Rep = Builder.CreateCall2(I, Op1, Op2, "palignr"); - } - - // If palignr is shifting the pair of vectors more than 32 bytes, emit zero. - else { - Rep = Constant::getNullValue(F->getReturnType()); - } - - // Replace any uses with our new instruction. - if (!CI->use_empty()) - CI->replaceAllUsesWith(Rep); - - // Remove upgraded instruction. - CI->eraseFromParent(); - - } else if (F->getName() == "llvm.x86.ssse3.palign.r.128") { - Value *Op1 = CI->getArgOperand(0); - Value *Op2 = CI->getArgOperand(1); - Value *Op3 = CI->getArgOperand(2); - unsigned shiftVal = cast(Op3)->getZExtValue(); - Value *Rep; - IRBuilder<> Builder(C); - Builder.SetInsertPoint(CI->getParent(), CI); - - // If palignr is shifting the pair of input vectors less than 17 bytes, - // emit a shuffle instruction. - if (shiftVal <= 16) { - const Type *IntTy = Type::getInt32Ty(C); - const Type *EltTy = Type::getInt8Ty(C); - const Type *VecTy = VectorType::get(EltTy, 16); - - Op2 = Builder.CreateBitCast(Op2, VecTy); - Op1 = Builder.CreateBitCast(Op1, VecTy); - - llvm::SmallVector Indices; - for (unsigned i = 0; i != 16; ++i) - Indices.push_back(ConstantInt::get(IntTy, shiftVal + i)); - - Value *SV = ConstantVector::get(Indices); - Rep = Builder.CreateShuffleVector(Op2, Op1, SV, "palignr"); - Rep = Builder.CreateBitCast(Rep, F->getReturnType()); - } - - // If palignr is shifting the pair of input vectors more than 16 but less - // than 32 bytes, emit a logical right shift of the destination. - else if (shiftVal < 32) { - const Type *EltTy = Type::getInt64Ty(C); - const Type *VecTy = VectorType::get(EltTy, 2); - const Type *IntTy = Type::getInt32Ty(C); - - Op1 = Builder.CreateBitCast(Op1, VecTy, "cast"); - Op2 = ConstantInt::get(IntTy, (shiftVal-16) * 8); - - // create i32 constant - Function *I = - Intrinsic::getDeclaration(F->getParent(), Intrinsic::x86_sse2_psrl_dq); - Rep = Builder.CreateCall2(I, Op1, Op2, "palignr"); - } - - // If palignr is shifting the pair of vectors more than 32 bytes, emit zero. - else { - Rep = Constant::getNullValue(F->getReturnType()); - } - - // Replace any uses with our new instruction. - if (!CI->use_empty()) - CI->replaceAllUsesWith(Rep); - - // Remove upgraded instruction. - CI->eraseFromParent(); - - } else if (F->getName() == "llvm.x86.sse.loadu.ps" || - F->getName() == "llvm.x86.sse2.loadu.dq" || - F->getName() == "llvm.x86.sse2.loadu.pd") { + if (F->getName() == "llvm.x86.sse.loadu.ps" || + F->getName() == "llvm.x86.sse2.loadu.dq" || + F->getName() == "llvm.x86.sse2.loadu.pd") { // Convert to a native, unaligned load. const Type *VecTy = CI->getType(); const Type *IntTy = IntegerType::get(C, 128); @@ -1064,310 +204,6 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) { } switch (NewFn->getIntrinsicID()) { - default: llvm_unreachable("Unknown function for CallInst upgrade."); - case Intrinsic::arm_neon_vld1: - case Intrinsic::arm_neon_vld2: - case Intrinsic::arm_neon_vld3: - case Intrinsic::arm_neon_vld4: - case Intrinsic::arm_neon_vst1: - case Intrinsic::arm_neon_vst2: - case Intrinsic::arm_neon_vst3: - case Intrinsic::arm_neon_vst4: - case Intrinsic::arm_neon_vld2lane: - case Intrinsic::arm_neon_vld3lane: - case Intrinsic::arm_neon_vld4lane: - case Intrinsic::arm_neon_vst2lane: - case Intrinsic::arm_neon_vst3lane: - case Intrinsic::arm_neon_vst4lane: { - // Add a default alignment argument of 1. - SmallVector Operands(CS.arg_begin(), CS.arg_end()); - Operands.push_back(ConstantInt::get(Type::getInt32Ty(C), 1)); - CallInst *NewCI = CallInst::Create(NewFn, Operands.begin(), Operands.end(), - CI->getName(), CI); - NewCI->setTailCall(CI->isTailCall()); - NewCI->setCallingConv(CI->getCallingConv()); - - // Handle any uses of the old CallInst. - if (!CI->use_empty()) - // Replace all uses of the old call with the new cast which has the - // correct type. - CI->replaceAllUsesWith(NewCI); - - // Clean up the old call now that it has been completely upgraded. - CI->eraseFromParent(); - break; - } - - case Intrinsic::x86_mmx_padd_b: - case Intrinsic::x86_mmx_padd_w: - case Intrinsic::x86_mmx_padd_d: - case Intrinsic::x86_mmx_padd_q: - case Intrinsic::x86_mmx_padds_b: - case Intrinsic::x86_mmx_padds_w: - case Intrinsic::x86_mmx_paddus_b: - case Intrinsic::x86_mmx_paddus_w: - case Intrinsic::x86_mmx_psub_b: - case Intrinsic::x86_mmx_psub_w: - case Intrinsic::x86_mmx_psub_d: - case Intrinsic::x86_mmx_psub_q: - case Intrinsic::x86_mmx_psubs_b: - case Intrinsic::x86_mmx_psubs_w: - case Intrinsic::x86_mmx_psubus_b: - case Intrinsic::x86_mmx_psubus_w: - case Intrinsic::x86_mmx_pmulh_w: - case Intrinsic::x86_mmx_pmull_w: - case Intrinsic::x86_mmx_pmulhu_w: - case Intrinsic::x86_mmx_pmulu_dq: - case Intrinsic::x86_mmx_pmadd_wd: - case Intrinsic::x86_mmx_pand: - case Intrinsic::x86_mmx_pandn: - case Intrinsic::x86_mmx_por: - case Intrinsic::x86_mmx_pxor: - case Intrinsic::x86_mmx_pavg_b: - case Intrinsic::x86_mmx_pavg_w: - case Intrinsic::x86_mmx_pmaxu_b: - case Intrinsic::x86_mmx_pmaxs_w: - case Intrinsic::x86_mmx_pminu_b: - case Intrinsic::x86_mmx_pmins_w: - case Intrinsic::x86_mmx_psad_bw: - case Intrinsic::x86_mmx_psll_w: - case Intrinsic::x86_mmx_psll_d: - case Intrinsic::x86_mmx_psll_q: - case Intrinsic::x86_mmx_pslli_w: - case Intrinsic::x86_mmx_pslli_d: - case Intrinsic::x86_mmx_pslli_q: - case Intrinsic::x86_mmx_psrl_w: - case Intrinsic::x86_mmx_psrl_d: - case Intrinsic::x86_mmx_psrl_q: - case Intrinsic::x86_mmx_psrli_w: - case Intrinsic::x86_mmx_psrli_d: - case Intrinsic::x86_mmx_psrli_q: - case Intrinsic::x86_mmx_psra_w: - case Intrinsic::x86_mmx_psra_d: - case Intrinsic::x86_mmx_psrai_w: - case Intrinsic::x86_mmx_psrai_d: - case Intrinsic::x86_mmx_packsswb: - case Intrinsic::x86_mmx_packssdw: - case Intrinsic::x86_mmx_packuswb: - case Intrinsic::x86_mmx_punpckhbw: - case Intrinsic::x86_mmx_punpckhwd: - case Intrinsic::x86_mmx_punpckhdq: - case Intrinsic::x86_mmx_punpcklbw: - case Intrinsic::x86_mmx_punpcklwd: - case Intrinsic::x86_mmx_punpckldq: - case Intrinsic::x86_mmx_pcmpeq_b: - case Intrinsic::x86_mmx_pcmpeq_w: - case Intrinsic::x86_mmx_pcmpeq_d: - case Intrinsic::x86_mmx_pcmpgt_b: - case Intrinsic::x86_mmx_pcmpgt_w: - case Intrinsic::x86_mmx_pcmpgt_d: { - Value *Operands[2]; - - // Cast the operand to the X86 MMX type. - Operands[0] = new BitCastInst(CI->getArgOperand(0), - NewFn->getFunctionType()->getParamType(0), - "upgraded.", CI); - - switch (NewFn->getIntrinsicID()) { - default: - // Cast to the X86 MMX type. - Operands[1] = new BitCastInst(CI->getArgOperand(1), - NewFn->getFunctionType()->getParamType(1), - "upgraded.", CI); - break; - case Intrinsic::x86_mmx_pslli_w: - case Intrinsic::x86_mmx_pslli_d: - case Intrinsic::x86_mmx_pslli_q: - case Intrinsic::x86_mmx_psrli_w: - case Intrinsic::x86_mmx_psrli_d: - case Intrinsic::x86_mmx_psrli_q: - case Intrinsic::x86_mmx_psrai_w: - case Intrinsic::x86_mmx_psrai_d: - // These take an i32 as their second parameter. - Operands[1] = CI->getArgOperand(1); - break; - } - - ConstructNewCallInst(NewFn, CI, Operands, 2); - break; - } - case Intrinsic::x86_mmx_maskmovq: { - Value *Operands[3]; - - // Cast the operands to the X86 MMX type. - Operands[0] = new BitCastInst(CI->getArgOperand(0), - NewFn->getFunctionType()->getParamType(0), - "upgraded.", CI); - Operands[1] = new BitCastInst(CI->getArgOperand(1), - NewFn->getFunctionType()->getParamType(1), - "upgraded.", CI); - Operands[2] = CI->getArgOperand(2); - - ConstructNewCallInst(NewFn, CI, Operands, 3, false); - break; - } - case Intrinsic::x86_mmx_pmovmskb: { - Value *Operands[1]; - - // Cast the operand to the X86 MMX type. - Operands[0] = new BitCastInst(CI->getArgOperand(0), - NewFn->getFunctionType()->getParamType(0), - "upgraded.", CI); - - ConstructNewCallInst(NewFn, CI, Operands, 1); - break; - } - case Intrinsic::x86_mmx_movnt_dq: { - Value *Operands[2]; - - Operands[0] = CI->getArgOperand(0); - - // Cast the operand to the X86 MMX type. - Operands[1] = new BitCastInst(CI->getArgOperand(1), - NewFn->getFunctionType()->getParamType(1), - "upgraded.", CI); - - ConstructNewCallInst(NewFn, CI, Operands, 2, false); - break; - } - case Intrinsic::x86_mmx_palignr_b: { - Value *Operands[3]; - - // Cast the operands to the X86 MMX type. - Operands[0] = new BitCastInst(CI->getArgOperand(0), - NewFn->getFunctionType()->getParamType(0), - "upgraded.", CI); - Operands[1] = new BitCastInst(CI->getArgOperand(1), - NewFn->getFunctionType()->getParamType(1), - "upgraded.", CI); - Operands[2] = CI->getArgOperand(2); - - ConstructNewCallInst(NewFn, CI, Operands, 3); - break; - } - case Intrinsic::x86_mmx_pextr_w: { - Value *Operands[2]; - - // Cast the operands to the X86 MMX type. - Operands[0] = new BitCastInst(CI->getArgOperand(0), - NewFn->getFunctionType()->getParamType(0), - "upgraded.", CI); - Operands[1] = CI->getArgOperand(1); - - ConstructNewCallInst(NewFn, CI, Operands, 2); - break; - } - case Intrinsic::x86_mmx_pinsr_w: { - Value *Operands[3]; - - // Cast the operands to the X86 MMX type. - Operands[0] = new BitCastInst(CI->getArgOperand(0), - NewFn->getFunctionType()->getParamType(0), - "upgraded.", CI); - Operands[1] = CI->getArgOperand(1); - Operands[2] = CI->getArgOperand(2); - - ConstructNewCallInst(NewFn, CI, Operands, 3); - break; - } - case Intrinsic::x86_sse_pshuf_w: { - IRBuilder<> Builder(C); - Builder.SetInsertPoint(CI->getParent(), CI); - - // Cast the operand to the X86 MMX type. - Value *Operands[2]; - Operands[0] = - Builder.CreateBitCast(CI->getArgOperand(0), - NewFn->getFunctionType()->getParamType(0), - "upgraded."); - Operands[1] = - Builder.CreateTrunc(CI->getArgOperand(1), - Type::getInt8Ty(C), - "upgraded."); - - ConstructNewCallInst(NewFn, CI, Operands, 2); - break; - } - - case Intrinsic::ctlz: - case Intrinsic::ctpop: - case Intrinsic::cttz: { - // Build a small vector of the original arguments. - SmallVector Operands(CS.arg_begin(), CS.arg_end()); - - // Construct a new CallInst - CallInst *NewCI = CallInst::Create(NewFn, Operands.begin(), Operands.end(), - "upgraded."+CI->getName(), CI); - NewCI->setTailCall(CI->isTailCall()); - NewCI->setCallingConv(CI->getCallingConv()); - - // Handle any uses of the old CallInst. - if (!CI->use_empty()) { - // Check for sign extend parameter attributes on the return values. - bool SrcSExt = NewFn->getAttributes().paramHasAttr(0, Attribute::SExt); - bool DestSExt = F->getAttributes().paramHasAttr(0, Attribute::SExt); - - // Construct an appropriate cast from the new return type to the old. - CastInst *RetCast = CastInst::Create( - CastInst::getCastOpcode(NewCI, SrcSExt, - F->getReturnType(), - DestSExt), - NewCI, F->getReturnType(), - NewCI->getName(), CI); - NewCI->moveBefore(RetCast); - - // Replace all uses of the old call with the new cast which has the - // correct type. - CI->replaceAllUsesWith(RetCast); - } - - // Clean up the old call now that it has been completely upgraded. - CI->eraseFromParent(); - } - break; - case Intrinsic::eh_selector: - case Intrinsic::eh_typeid_for: { - // Only the return type changed. - SmallVector Operands(CS.arg_begin(), CS.arg_end()); - CallInst *NewCI = CallInst::Create(NewFn, Operands.begin(), Operands.end(), - "upgraded." + CI->getName(), CI); - NewCI->setTailCall(CI->isTailCall()); - NewCI->setCallingConv(CI->getCallingConv()); - - // Handle any uses of the old CallInst. - if (!CI->use_empty()) { - // Construct an appropriate cast from the new return type to the old. - CastInst *RetCast = - CastInst::Create(CastInst::getCastOpcode(NewCI, true, - F->getReturnType(), true), - NewCI, F->getReturnType(), NewCI->getName(), CI); - CI->replaceAllUsesWith(RetCast); - } - CI->eraseFromParent(); - } - break; - case Intrinsic::memcpy: - case Intrinsic::memmove: - case Intrinsic::memset: { - // Add isVolatile - const llvm::Type *I1Ty = llvm::Type::getInt1Ty(CI->getContext()); - Value *Operands[5] = { CI->getArgOperand(0), CI->getArgOperand(1), - CI->getArgOperand(2), CI->getArgOperand(3), - llvm::ConstantInt::get(I1Ty, 0) }; - CallInst *NewCI = CallInst::Create(NewFn, Operands, Operands+5, - CI->getName(), CI); - NewCI->setTailCall(CI->isTailCall()); - NewCI->setCallingConv(CI->getCallingConv()); - // Handle any uses of the old CallInst. - if (!CI->use_empty()) - // Replace all uses of the old call with the new cast which has the - // correct type. - CI->replaceAllUsesWith(NewCI); - - // Clean up the old call now that it has been completely upgraded. - CI->eraseFromParent(); - break; - } case Intrinsic::prefetch: { IRBuilder<> Builder(C); Builder.SetInsertPoint(CI->getParent(), CI); @@ -1401,13 +237,13 @@ void llvm::UpgradeCallsToIntrinsic(Function* F) { assert(F && "Illegal attempt to upgrade a non-existent intrinsic."); // Upgrade the function and check if it is a totaly new function. - Function* NewFn; + Function *NewFn; if (UpgradeIntrinsicFunction(F, NewFn)) { if (NewFn != F) { // Replace all uses to the old function with the new one if necessary. for (Value::use_iterator UI = F->use_begin(), UE = F->use_end(); UI != UE; ) { - if (CallInst* CI = dyn_cast(*UI++)) + if (CallInst *CI = dyn_cast(*UI++)) UpgradeIntrinsicCall(CI, NewFn); } // Remove old function, no longer used, from the module. @@ -1420,37 +256,27 @@ void llvm::UpgradeCallsToIntrinsic(Function* F) { /// If an llvm.dbg.declare intrinsic is invalid, then this function simply /// strips that use. void llvm::CheckDebugInfoIntrinsics(Module *M) { - - if (Function *FuncStart = M->getFunction("llvm.dbg.func.start")) { - while (!FuncStart->use_empty()) { - CallInst *CI = cast(FuncStart->use_back()); - CI->eraseFromParent(); - } + while (!FuncStart->use_empty()) + cast(FuncStart->use_back())->eraseFromParent(); FuncStart->eraseFromParent(); } if (Function *StopPoint = M->getFunction("llvm.dbg.stoppoint")) { - while (!StopPoint->use_empty()) { - CallInst *CI = cast(StopPoint->use_back()); - CI->eraseFromParent(); - } + while (!StopPoint->use_empty()) + cast(StopPoint->use_back())->eraseFromParent(); StopPoint->eraseFromParent(); } if (Function *RegionStart = M->getFunction("llvm.dbg.region.start")) { - while (!RegionStart->use_empty()) { - CallInst *CI = cast(RegionStart->use_back()); - CI->eraseFromParent(); - } + while (!RegionStart->use_empty()) + cast(RegionStart->use_back())->eraseFromParent(); RegionStart->eraseFromParent(); } if (Function *RegionEnd = M->getFunction("llvm.dbg.region.end")) { - while (!RegionEnd->use_empty()) { - CallInst *CI = cast(RegionEnd->use_back()); - CI->eraseFromParent(); - } + while (!RegionEnd->use_empty()) + cast(RegionEnd->use_back())->eraseFromParent(); RegionEnd->eraseFromParent(); } diff --git a/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll b/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll index 062ea59f128..ebd349a6aa4 100644 --- a/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll +++ b/test/Analysis/BasicAA/getmodrefinfo-cs-cs.ll @@ -15,12 +15,12 @@ define void @test0() { ; CHECK: NoModRef: call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i32 1, i1 false) <-> call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i32 1, i1 false) ; CHECK: NoModRef: call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i32 1, i1 false) <-> call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i32 1, i1 false) -declare void @llvm.memset.i64(i8*, i8, i64, i32) +declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind @A = external global i8 @B = external global i8 define void @test1() { - call void @llvm.memset.i64(i8* @A, i8 0, i64 1, i32 1) - call void @llvm.memset.i64(i8* @B, i8 0, i64 1, i32 1) + call void @llvm.memset.p0i8.i64(i8* @A, i8 0, i64 1, i32 1, i1 false) + call void @llvm.memset.p0i8.i64(i8* @B, i8 0, i64 1, i32 1, i1 false) ret void } diff --git a/test/Analysis/BasicAA/modref.ll b/test/Analysis/BasicAA/modref.ll index 7318a899a6e..233396b7e5c 100644 --- a/test/Analysis/BasicAA/modref.ll +++ b/test/Analysis/BasicAA/modref.ll @@ -1,10 +1,6 @@ ; RUN: opt < %s -basicaa -gvn -dse -S | FileCheck %s target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128" -declare void @llvm.memset.i32(i8*, i8, i32, i32) -declare void @llvm.memset.i8(i8*, i8, i8, i32) -declare void @llvm.memcpy.i8(i8*, i8*, i8, i32) -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) declare void @llvm.lifetime.end(i64, i8* nocapture) declare void @external(i32*) @@ -15,7 +11,7 @@ define i32 @test0(i8* %P) { store i32 0, i32* %A - call void @llvm.memset.i32(i8* %P, i8 0, i32 42, i32 1) + call void @llvm.memset.p0i8.i32(i8* %P, i8 0, i32 42, i32 1, i1 false) %B = load i32* %A ret i32 %B @@ -31,7 +27,7 @@ define i8 @test1() { store i8 2, i8* %B ;; Not written to by memcpy - call void @llvm.memcpy.i8(i8* %A, i8* %B, i8 -1, i32 0) + call void @llvm.memcpy.p0i8.p0i8.i8(i8* %A, i8* %B, i8 -1, i32 0, i1 false) %C = load i8* %B ret i8 %C @@ -42,7 +38,7 @@ define i8 @test2(i8* %P) { ; CHECK: @test2 %P2 = getelementptr i8* %P, i32 127 store i8 1, i8* %P2 ;; Not dead across memset - call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0) + call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false) %A = load i8* %P2 ret i8 %A ; CHECK: ret i8 1 @@ -55,7 +51,7 @@ define i8 @test2a(i8* %P) { ;; FIXME: DSE isn't zapping this dead store. store i8 1, i8* %P2 ;; Dead, clobbered by memset. - call void @llvm.memset.i8(i8* %P, i8 2, i8 127, i32 0) + call void @llvm.memset.p0i8.i8(i8* %P, i8 2, i8 127, i32 0, i1 false) %A = load i8* %P2 ret i8 %A ; CHECK-NOT: load @@ -95,7 +91,7 @@ define void @test3a(i8* %P, i8 %X) { define i32 @test4(i8* %P) { %tmp = load i32* @G1 - call void @llvm.memset.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8 0, i32 4000, i32 1) + call void @llvm.memset.p0i8.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8 0, i32 4000, i32 1, i1 false) %tmp2 = load i32* @G1 %sub = sub i32 %tmp2, %tmp ret i32 %sub @@ -110,7 +106,7 @@ define i32 @test4(i8* %P) { ; write to G1. define i32 @test5(i8* %P, i32 %Len) { %tmp = load i32* @G1 - call void @llvm.memcpy.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8* bitcast (i32* @G1 to i8*), i32 %Len, i32 1) + call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([4000 x i32]* @G2 to i8*), i8* bitcast (i32* @G1 to i8*), i32 %Len, i32 1, i1 false) %tmp2 = load i32* @G1 %sub = sub i32 %tmp2, %tmp ret i32 %sub @@ -132,3 +128,9 @@ define i8 @test6(i8* %p, i8* noalias %a) { ; CHECK-NOT: load ; CHECK: ret } + +declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind +declare void @llvm.memset.p0i8.i8(i8* nocapture, i8, i8, i32, i1) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i8(i8* nocapture, i8* nocapture, i8, i32, i1) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind + diff --git a/test/Analysis/ScalarEvolution/avoid-smax-1.ll b/test/Analysis/ScalarEvolution/avoid-smax-1.ll index 89e8b983c0c..474d564c70c 100644 --- a/test/Analysis/ScalarEvolution/avoid-smax-1.ll +++ b/test/Analysis/ScalarEvolution/avoid-smax-1.ll @@ -173,7 +173,7 @@ bb23: ; preds = %bb24, %bb.nph %55 = mul i32 %y.21, %w ; [#uses=1] %.sum5 = add i32 %55, %.sum3 ; [#uses=1] %56 = getelementptr i8* %j, i32 %.sum5 ; [#uses=1] - tail call void @llvm.memcpy.i32(i8* %56, i8* %54, i32 %w, i32 1) + tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %56, i8* %54, i32 %w, i32 1, i1 false) %57 = add i32 %y.21, 1 ; [#uses=2] br label %bb24 @@ -190,7 +190,7 @@ bb26: ; preds = %bb24.bb26_crit_edge, %bb22 %60 = getelementptr i8* %j, i32 %.sum4 ; [#uses=1] %61 = mul i32 %x, %w ; [#uses=1] %62 = sdiv i32 %61, 2 ; [#uses=1] - tail call void @llvm.memset.i32(i8* %60, i8 -128, i32 %62, i32 1) + tail call void @llvm.memset.p0i8.i32(i8* %60, i8 -128, i32 %62, i32 1, i1 false) ret void bb29: ; preds = %bb20, %entry @@ -208,7 +208,7 @@ bb30: ; preds = %bb31, %bb.nph11 %67 = getelementptr i8* %r, i32 %66 ; [#uses=1] %68 = mul i32 %y.310, %w ; [#uses=1] %69 = getelementptr i8* %j, i32 %68 ; [#uses=1] - tail call void @llvm.memcpy.i32(i8* %69, i8* %67, i32 %w, i32 1) + tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %69, i8* %67, i32 %w, i32 1, i1 false) %70 = add i32 %y.310, 1 ; [#uses=2] br label %bb31 @@ -224,13 +224,12 @@ bb33: ; preds = %bb31.bb33_crit_edge, %bb29 %73 = getelementptr i8* %j, i32 %72 ; [#uses=1] %74 = mul i32 %x, %w ; [#uses=1] %75 = sdiv i32 %74, 2 ; [#uses=1] - tail call void @llvm.memset.i32(i8* %73, i8 -128, i32 %75, i32 1) + tail call void @llvm.memset.p0i8.i32(i8* %73, i8 -128, i32 %75, i32 1, i1 false) ret void return: ; preds = %bb20 ret void } -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind - -declare void @llvm.memset.i32(i8*, i8, i32, i32) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind +declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind diff --git a/test/Analysis/ScalarEvolution/trip-count3.ll b/test/Analysis/ScalarEvolution/trip-count3.ll index 10b798b5067..1bf86ae9be8 100644 --- a/test/Analysis/ScalarEvolution/trip-count3.ll +++ b/test/Analysis/ScalarEvolution/trip-count3.ll @@ -5,15 +5,14 @@ ; dividing by the stride will have a remainder. This could theoretically ; be teaching it how to use a more elaborate trip count computation. -target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" -target triple = "x86_64-unknown-linux-gnu" - %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] } - %struct.SHA_INFO = type { [5 x i32], i32, i32, [16 x i32] } - %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 } -@_2E_str = external constant [26 x i8] ; <[26 x i8]*> [#uses=0] -@stdin = external global %struct.FILE* ; <%struct.FILE**> [#uses=0] -@_2E_str1 = external constant [3 x i8] ; <[3 x i8]*> [#uses=0] -@_2E_str12 = external constant [30 x i8] ; <[30 x i8]*> [#uses=0] +%struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] } +%struct.SHA_INFO = type { [5 x i32], i32, i32, [16 x i32] } +%struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 } + +@_2E_str = external constant [26 x i8] +@stdin = external global %struct.FILE* +@_2E_str1 = external constant [3 x i8] +@_2E_str12 = external constant [30 x i8] declare void @sha_init(%struct.SHA_INFO* nocapture) nounwind @@ -25,12 +24,8 @@ declare i32 @printf(i8* nocapture, ...) nounwind declare void @sha_final(%struct.SHA_INFO* nocapture) nounwind -declare void @llvm.memset.i64(i8* nocapture, i8, i64, i32) nounwind - declare void @sha_update(%struct.SHA_INFO* nocapture, i8* nocapture, i32) nounwind -declare void @llvm.memcpy.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind - declare i64 @fread(i8* noalias nocapture, i64, i64, %struct.FILE* noalias nocapture) nounwind declare i32 @main(i32, i8** nocapture) nounwind @@ -43,36 +38,41 @@ declare void @sha_stream(%struct.SHA_INFO* nocapture, %struct.FILE* nocapture) n define void @sha_stream_bb3_2E_i(%struct.SHA_INFO* %sha_info, i8* %data1, i32, i8** %buffer_addr.0.i.out, i32* %count_addr.0.i.out) nounwind { newFuncRoot: - br label %bb3.i - -sha_update.exit.exitStub: ; preds = %bb3.i - store i8* %buffer_addr.0.i, i8** %buffer_addr.0.i.out - store i32 %count_addr.0.i, i32* %count_addr.0.i.out - ret void - -bb2.i: ; preds = %bb3.i - %1 = getelementptr %struct.SHA_INFO* %sha_info, i64 0, i32 3 ; <[16 x i32]*> [#uses=1] - %2 = bitcast [16 x i32]* %1 to i8* ; [#uses=1] - call void @llvm.memcpy.i64(i8* %2, i8* %buffer_addr.0.i, i64 64, i32 1) nounwind - %3 = getelementptr %struct.SHA_INFO* %sha_info, i64 0, i32 3, i64 0 ; [#uses=1] - %4 = bitcast i32* %3 to i8* ; [#uses=1] - br label %codeRepl - -codeRepl: ; preds = %bb2.i - call void @sha_stream_bb3_2E_i_bb1_2E_i_2E_i(i8* %4) - br label %byte_reverse.exit.i - -byte_reverse.exit.i: ; preds = %codeRepl - call fastcc void @sha_transform(%struct.SHA_INFO* %sha_info) nounwind - %5 = getelementptr i8* %buffer_addr.0.i, i64 64 ; [#uses=1] - %6 = add i32 %count_addr.0.i, -64 ; [#uses=1] - br label %bb3.i - -bb3.i: ; preds = %byte_reverse.exit.i, %newFuncRoot - %buffer_addr.0.i = phi i8* [ %data1, %newFuncRoot ], [ %5, %byte_reverse.exit.i ] ; [#uses=3] - %count_addr.0.i = phi i32 [ %0, %newFuncRoot ], [ %6, %byte_reverse.exit.i ] ; [#uses=3] - %7 = icmp sgt i32 %count_addr.0.i, 63 ; [#uses=1] - br i1 %7, label %bb2.i, label %sha_update.exit.exitStub + br label %bb3.i + +sha_update.exit.exitStub: ; preds = %bb3.i + store i8* %buffer_addr.0.i, i8** %buffer_addr.0.i.out + store i32 %count_addr.0.i, i32* %count_addr.0.i.out + ret void + +bb2.i: ; preds = %bb3.i + %1 = getelementptr %struct.SHA_INFO* %sha_info, i64 0, i32 3 + %2 = bitcast [16 x i32]* %1 to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %2, i8* %buffer_addr.0.i, i64 64, i32 1, i1 false) + %3 = getelementptr %struct.SHA_INFO* %sha_info, i64 0, i32 3, i64 0 + %4 = bitcast i32* %3 to i8* + br label %codeRepl + +codeRepl: ; preds = %bb2.i + call void @sha_stream_bb3_2E_i_bb1_2E_i_2E_i(i8* %4) + br label %byte_reverse.exit.i + +byte_reverse.exit.i: ; preds = %codeRepl + call fastcc void @sha_transform(%struct.SHA_INFO* %sha_info) nounwind + %5 = getelementptr i8* %buffer_addr.0.i, i64 64 + %6 = add i32 %count_addr.0.i, -64 + br label %bb3.i + +bb3.i: ; preds = %byte_reverse.exit.i, %newFuncRoot + %buffer_addr.0.i = phi i8* [ %data1, %newFuncRoot ], [ %5, %byte_reverse.exit.i ] + %count_addr.0.i = phi i32 [ %0, %newFuncRoot ], [ %6, %byte_reverse.exit.i ] + %7 = icmp sgt i32 %count_addr.0.i, 63 + br i1 %7, label %bb2.i, label %sha_update.exit.exitStub } declare void @sha_stream_bb3_2E_i_bb1_2E_i_2E_i(i8*) nounwind + +declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind + +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind + diff --git a/test/Assembler/AutoUpgradeIntrinsics.ll b/test/Assembler/AutoUpgradeIntrinsics.ll index 20beb495667..eb4ac769be0 100644 --- a/test/Assembler/AutoUpgradeIntrinsics.ll +++ b/test/Assembler/AutoUpgradeIntrinsics.ll @@ -1,87 +1,6 @@ ; Tests to make sure intrinsics are automatically upgraded. -; RUN: llvm-as < %s | llvm-dis | not grep {i32 @llvm\\.ct} -; RUN: llvm-as < %s | llvm-dis | \ -; RUN: not grep {llvm\\.part\\.set\\.i\[0-9\]*\\.i\[0-9\]*\\.i\[0-9\]*} -; RUN: llvm-as < %s | llvm-dis | \ -; RUN: not grep {llvm\\.part\\.select\\.i\[0-9\]*\\.i\[0-9\]*} -; RUN: llvm-as < %s | llvm-dis | \ -; RUN: not grep {llvm\\.bswap\\.i\[0-9\]*\\.i\[0-9\]*} -; RUN: llvm-as < %s | llvm-dis | \ -; RUN: not grep {llvm\\.x86\\.sse2\\.loadu} -; RUN: llvm-as < %s | llvm-dis | \ -; RUN: grep {llvm\\.x86\\.mmx\\.ps} | grep {x86_mmx} | count 16 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s -declare i32 @llvm.ctpop.i28(i28 %val) -declare i32 @llvm.cttz.i29(i29 %val) -declare i32 @llvm.ctlz.i30(i30 %val) - -define i32 @test_ct(i32 %A) { - %c1 = call i32 @llvm.ctpop.i28(i28 1234) - %c2 = call i32 @llvm.cttz.i29(i29 2345) - %c3 = call i32 @llvm.ctlz.i30(i30 3456) - %r1 = add i32 %c1, %c2 - %r2 = add i32 %r1, %c3 - ret i32 %r2 -} - -declare i32 @llvm.part.set.i32.i32.i32(i32 %x, i32 %rep, i32 %hi, i32 %lo) -declare i16 @llvm.part.set.i16.i16.i16(i16 %x, i16 %rep, i32 %hi, i32 %lo) -define i32 @test_part_set(i32 %A, i16 %B) { - %a = call i32 @llvm.part.set.i32.i32.i32(i32 %A, i32 27, i32 8, i32 0) - %b = call i16 @llvm.part.set.i16.i16.i16(i16 %B, i16 27, i32 8, i32 0) - %c = zext i16 %b to i32 - %d = add i32 %a, %c - ret i32 %d -} - -declare i32 @llvm.part.select.i32.i32(i32 %x, i32 %hi, i32 %lo) -declare i16 @llvm.part.select.i16.i16(i16 %x, i32 %hi, i32 %lo) -define i32 @test_part_select(i32 %A, i16 %B) { - %a = call i32 @llvm.part.select.i32.i32(i32 %A, i32 8, i32 0) - %b = call i16 @llvm.part.select.i16.i16(i16 %B, i32 8, i32 0) - %c = zext i16 %b to i32 - %d = add i32 %a, %c - ret i32 %d -} - -declare i32 @llvm.bswap.i32.i32(i32 %x) -declare i16 @llvm.bswap.i16.i16(i16 %x) -define i32 @test_bswap(i32 %A, i16 %B) { - %a = call i32 @llvm.bswap.i32.i32(i32 %A) - %b = call i16 @llvm.bswap.i16.i16(i16 %B) - %c = zext i16 %b to i32 - %d = add i32 %a, %c - ret i32 %d -} - -declare <4 x i16> @llvm.x86.mmx.psra.w(<4 x i16>, <2 x i32>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.psll.w(<4 x i16>, <2 x i32>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.psrl.w(<4 x i16>, <2 x i32>) nounwind readnone -define void @sh16(<4 x i16> %A, <2 x i32> %B) { - %r1 = call <4 x i16> @llvm.x86.mmx.psra.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0] - %r2 = call <4 x i16> @llvm.x86.mmx.psll.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0] - %r3 = call <4 x i16> @llvm.x86.mmx.psrl.w( <4 x i16> %A, <2 x i32> %B ) ; <<4 x i16>> [#uses=0] - ret void -} - -declare <2 x i32> @llvm.x86.mmx.psra.d(<2 x i32>, <2 x i32>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.psll.d(<2 x i32>, <2 x i32>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.psrl.d(<2 x i32>, <2 x i32>) nounwind readnone -define void @sh32(<2 x i32> %A, <2 x i32> %B) { - %r1 = call <2 x i32> @llvm.x86.mmx.psra.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0] - %r2 = call <2 x i32> @llvm.x86.mmx.psll.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0] - %r3 = call <2 x i32> @llvm.x86.mmx.psrl.d( <2 x i32> %A, <2 x i32> %B ) ; <<2 x i32>> [#uses=0] - ret void -} - -declare <1 x i64> @llvm.x86.mmx.psll.q(<1 x i64>, <2 x i32>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.psrl.q(<1 x i64>, <2 x i32>) nounwind readnone -define void @sh64(<1 x i64> %A, <2 x i32> %B) { - %r1 = call <1 x i64> @llvm.x86.mmx.psll.q( <1 x i64> %A, <2 x i32> %B ) ; <<1 x i64>> [#uses=0] - %r2 = call <1 x i64> @llvm.x86.mmx.psrl.q( <1 x i64> %A, <2 x i32> %B ) ; <<1 x i64>> [#uses=0] - ret void -} declare <4 x float> @llvm.x86.sse.loadu.ps(i8*) nounwind readnone declare <16 x i8> @llvm.x86.sse2.loadu.dq(i8*) nounwind readnone @@ -90,6 +9,10 @@ define void @test_loadu(i8* %a, double* %b) { %v0 = call <4 x float> @llvm.x86.sse.loadu.ps(i8* %a) %v1 = call <16 x i8> @llvm.x86.sse2.loadu.dq(i8* %a) %v2 = call <2 x double> @llvm.x86.sse2.loadu.pd(double* %b) + +; CHECK: load i128* {{.*}}, align 1 +; CHECK: load i128* {{.*}}, align 1 +; CHECK: load i128* {{.*}}, align 1 ret void } diff --git a/test/Assembler/AutoUpgradeMMXIntrinsics.ll b/test/Assembler/AutoUpgradeMMXIntrinsics.ll deleted file mode 100644 index 54120ff9dce..00000000000 --- a/test/Assembler/AutoUpgradeMMXIntrinsics.ll +++ /dev/null @@ -1,223 +0,0 @@ -; Tests to make sure MMX intrinsics are automatically upgraded. -; RUN: llvm-as < %s | llvm-dis -o %t -; RUN: grep {llvm\\.x86\\.mmx} %t | not grep {\\\<1 x i64\\\>} -; RUN: grep {llvm\\.x86\\.mmx} %t | not grep {\\\<2 x i32\\\>} -; RUN: grep {llvm\\.x86\\.mmx} %t | not grep {\\\<4 x i16\\\>} -; RUN: grep {llvm\\.x86\\.mmx} %t | not grep {\\\<8 x i8\\\>} -; RUN: grep {llvm\\.x86\\.sse\\.pshuf\\.w} %t | not grep i32 - -; Addition -declare <8 x i8> @llvm.x86.mmx.padd.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.padd.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.padd.d(<2 x i32>, <2 x i32>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.padd.q(<1 x i64>, <1 x i64>) nounwind readnone -declare <8 x i8> @llvm.x86.mmx.padds.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.padds.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <8 x i8> @llvm.x86.mmx.paddus.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.paddus.w(<4 x i16>, <4 x i16>) nounwind readnone -define void @add(<8 x i8> %A, <8 x i8> %B, <4 x i16> %C, <4 x i16> %D, - <2 x i32> %E, <2 x i32> %F, <1 x i64> %G, <1 x i64> %H) { - %r1 = call <8 x i8> @llvm.x86.mmx.padd.b(<8 x i8> %A, <8 x i8> %B) - %r2 = call <4 x i16> @llvm.x86.mmx.padd.w(<4 x i16> %C, <4 x i16> %D) - %r3 = call <2 x i32> @llvm.x86.mmx.padd.d(<2 x i32> %E, <2 x i32> %F) - %r4 = call <1 x i64> @llvm.x86.mmx.padd.q(<1 x i64> %G, <1 x i64> %H) - %r5 = call <8 x i8> @llvm.x86.mmx.padds.b(<8 x i8> %A, <8 x i8> %B) - %r6 = call <4 x i16> @llvm.x86.mmx.padds.w(<4 x i16> %C, <4 x i16> %D) - %r7 = call <8 x i8> @llvm.x86.mmx.paddus.b(<8 x i8> %A, <8 x i8> %B) - %r8 = call <4 x i16> @llvm.x86.mmx.paddus.w(<4 x i16> %C, <4 x i16> %D) - ret void -} - -; Subtraction -declare <8 x i8> @llvm.x86.mmx.psub.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.psub.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.psub.d(<2 x i32>, <2 x i32>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.psub.q(<1 x i64>, <1 x i64>) nounwind readnone -declare <8 x i8> @llvm.x86.mmx.psubs.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.psubs.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <8 x i8> @llvm.x86.mmx.psubus.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.psubus.w(<4 x i16>, <4 x i16>) nounwind readnone -define void @sub(<8 x i8> %A, <8 x i8> %B, <4 x i16> %C, <4 x i16> %D, - <2 x i32> %E, <2 x i32> %F, <1 x i64> %G, <1 x i64> %H) { - %r1 = call <8 x i8> @llvm.x86.mmx.psub.b(<8 x i8> %A, <8 x i8> %B) - %r2 = call <4 x i16> @llvm.x86.mmx.psub.w(<4 x i16> %C, <4 x i16> %D) - %r3 = call <2 x i32> @llvm.x86.mmx.psub.d(<2 x i32> %E, <2 x i32> %F) - %r4 = call <1 x i64> @llvm.x86.mmx.psub.q(<1 x i64> %G, <1 x i64> %H) - %r5 = call <8 x i8> @llvm.x86.mmx.psubs.b(<8 x i8> %A, <8 x i8> %B) - %r6 = call <4 x i16> @llvm.x86.mmx.psubs.w(<4 x i16> %C, <4 x i16> %D) - %r7 = call <8 x i8> @llvm.x86.mmx.psubus.b(<8 x i8> %A, <8 x i8> %B) - %r8 = call <4 x i16> @llvm.x86.mmx.psubus.w(<4 x i16> %C, <4 x i16> %D) - ret void -} - -; Multiplication -declare <4 x i16> @llvm.x86.mmx.pmulh.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pmull.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pmulhu.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pmulu.dq(<4 x i16>, <4 x i16>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.pmadd.wd(<4 x i16>, <4 x i16>) nounwind readnone -define void @mul(<4 x i16> %A, <4 x i16> %B) { - %r1 = call <4 x i16> @llvm.x86.mmx.pmulh.w(<4 x i16> %A, <4 x i16> %B) - %r2 = call <4 x i16> @llvm.x86.mmx.pmull.w(<4 x i16> %A, <4 x i16> %B) - %r3 = call <4 x i16> @llvm.x86.mmx.pmulhu.w(<4 x i16> %A, <4 x i16> %B) - %r4 = call <4 x i16> @llvm.x86.mmx.pmulu.dq(<4 x i16> %A, <4 x i16> %B) - %r5 = call <2 x i32> @llvm.x86.mmx.pmadd.wd(<4 x i16> %A, <4 x i16> %B) - ret void -} - -; Bitwise operations -declare <1 x i64> @llvm.x86.mmx.pand(<1 x i64>, <1 x i64>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.pandn(<1 x i64>, <1 x i64>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.por(<1 x i64>, <1 x i64>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.pxor(<1 x i64>, <1 x i64>) nounwind readnone -define void @bit(<1 x i64> %A, <1 x i64> %B) { - %r1 = call <1 x i64> @llvm.x86.mmx.pand(<1 x i64> %A, <1 x i64> %B) - %r2 = call <1 x i64> @llvm.x86.mmx.pandn(<1 x i64> %A, <1 x i64> %B) - %r3 = call <1 x i64> @llvm.x86.mmx.por(<1 x i64> %A, <1 x i64> %B) - %r4 = call <1 x i64> @llvm.x86.mmx.pxor(<1 x i64> %A, <1 x i64> %B) - ret void -} - -; Averages -declare <8 x i8> @llvm.x86.mmx.pavg.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pavg.w(<4 x i16>, <4 x i16>) nounwind readnone -define void @avg(<8 x i8> %A, <8 x i8> %B, <4 x i16> %C, <4 x i16> %D) { - %r1 = call <8 x i8> @llvm.x86.mmx.pavg.b(<8 x i8> %A, <8 x i8> %B) - %r2 = call <4 x i16> @llvm.x86.mmx.pavg.w(<4 x i16> %C, <4 x i16> %D) - ret void -} - -; Maximum -declare <8 x i8> @llvm.x86.mmx.pmaxu.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pmaxs.w(<4 x i16>, <4 x i16>) nounwind readnone -define void @max(<8 x i8> %A, <8 x i8> %B, <4 x i16> %C, <4 x i16> %D) { - %r1 = call <8 x i8> @llvm.x86.mmx.pmaxu.b(<8 x i8> %A, <8 x i8> %B) - %r2 = call <4 x i16> @llvm.x86.mmx.pmaxs.w(<4 x i16> %C, <4 x i16> %D) - ret void -} - -; Minimum -declare <8 x i8> @llvm.x86.mmx.pminu.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pmins.w(<4 x i16>, <4 x i16>) nounwind readnone -define void @min(<8 x i8> %A, <8 x i8> %B, <4 x i16> %C, <4 x i16> %D) { - %r1 = call <8 x i8> @llvm.x86.mmx.pminu.b(<8 x i8> %A, <8 x i8> %B) - %r2 = call <4 x i16> @llvm.x86.mmx.pmins.w(<4 x i16> %C, <4 x i16> %D) - ret void -} - -; Packed sum of absolute differences -declare <4 x i16> @llvm.x86.mmx.psad.bw(<8 x i8>, <8 x i8>) nounwind readnone -define void @psad(<8 x i8> %A, <8 x i8> %B) { - %r1 = call <4 x i16> @llvm.x86.mmx.psad.bw(<8 x i8> %A, <8 x i8> %B) - ret void -} - -; Shift left -declare <4 x i16> @llvm.x86.mmx.psll.w(<4 x i16>, <1 x i64>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.psll.d(<2 x i32>, <1 x i64>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.psll.q(<1 x i64>, <1 x i64>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pslli.w(<4 x i16>, i32) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.pslli.d(<2 x i32>, i32) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.pslli.q(<1 x i64>, i32) nounwind readnone -define void @shl(<4 x i16> %A, <2 x i32> %B, <1 x i64> %C, i32 %D) { - %r1 = call <4 x i16> @llvm.x86.mmx.psll.w(<4 x i16> %A, <1 x i64> %C) - %r2 = call <2 x i32> @llvm.x86.mmx.psll.d(<2 x i32> %B, <1 x i64> %C) - %r3 = call <1 x i64> @llvm.x86.mmx.psll.q(<1 x i64> %C, <1 x i64> %C) - %r4 = call <4 x i16> @llvm.x86.mmx.pslli.w(<4 x i16> %A, i32 %D) - %r5 = call <2 x i32> @llvm.x86.mmx.pslli.d(<2 x i32> %B, i32 %D) - %r6 = call <1 x i64> @llvm.x86.mmx.pslli.q(<1 x i64> %C, i32 %D) - ret void -} - -; Shift right logical -declare <4 x i16> @llvm.x86.mmx.psrl.w(<4 x i16>, <1 x i64>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.psrl.d(<2 x i32>, <1 x i64>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.psrl.q(<1 x i64>, <1 x i64>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.psrli.w(<4 x i16>, i32) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.psrli.d(<2 x i32>, i32) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.psrli.q(<1 x i64>, i32) nounwind readnone -define void @shr(<4 x i16> %A, <2 x i32> %B, <1 x i64> %C, i32 %D) { - %r1 = call <4 x i16> @llvm.x86.mmx.psrl.w(<4 x i16> %A, <1 x i64> %C) - %r2 = call <2 x i32> @llvm.x86.mmx.psrl.d(<2 x i32> %B, <1 x i64> %C) - %r3 = call <1 x i64> @llvm.x86.mmx.psrl.q(<1 x i64> %C, <1 x i64> %C) - %r4 = call <4 x i16> @llvm.x86.mmx.psrli.w(<4 x i16> %A, i32 %D) - %r5 = call <2 x i32> @llvm.x86.mmx.psrli.d(<2 x i32> %B, i32 %D) - %r6 = call <1 x i64> @llvm.x86.mmx.psrli.q(<1 x i64> %C, i32 %D) - ret void -} - -; Shift right arithmetic -declare <4 x i16> @llvm.x86.mmx.psra.w(<4 x i16>, <1 x i64>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.psra.d(<2 x i32>, <1 x i64>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.psrai.w(<4 x i16>, i32) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.psrai.d(<2 x i32>, i32) nounwind readnone -define void @sra(<4 x i16> %A, <2 x i32> %B, <1 x i64> %C, i32 %D) { - %r1 = call <4 x i16> @llvm.x86.mmx.psra.w(<4 x i16> %A, <1 x i64> %C) - %r2 = call <2 x i32> @llvm.x86.mmx.psra.d(<2 x i32> %B, <1 x i64> %C) - %r3 = call <4 x i16> @llvm.x86.mmx.psrai.w(<4 x i16> %A, i32 %D) - %r4 = call <2 x i32> @llvm.x86.mmx.psrai.d(<2 x i32> %B, i32 %D) - ret void -} - -; Pack/Unpack ops -declare <8 x i8> @llvm.x86.mmx.packsswb(<4 x i16>, <4 x i16>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.packssdw(<2 x i32>, <2 x i32>) nounwind readnone -declare <8 x i8> @llvm.x86.mmx.packuswb(<4 x i16>, <4 x i16>) nounwind readnone -declare <8 x i8> @llvm.x86.mmx.punpckhbw(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.punpckhwd(<4 x i16>, <4 x i16>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.punpckhdq(<2 x i32>, <2 x i32>) nounwind readnone -declare <8 x i8> @llvm.x86.mmx.punpcklbw(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.punpcklwd(<4 x i16>, <4 x i16>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.punpckldq(<2 x i32>, <2 x i32>) nounwind readnone -define void @pack_unpack(<8 x i8> %A, <8 x i8> %B, <4 x i16> %C, <4 x i16> %D, - <2 x i32> %E, <2 x i32> %F) { - %r1 = call <8 x i8> @llvm.x86.mmx.packsswb(<4 x i16> %C, <4 x i16> %D) - %r2 = call <4 x i16> @llvm.x86.mmx.packssdw(<2 x i32> %E, <2 x i32> %F) - %r3 = call <8 x i8> @llvm.x86.mmx.packuswb(<4 x i16> %C, <4 x i16> %D) - %r4 = call <8 x i8> @llvm.x86.mmx.punpckhbw(<8 x i8> %A, <8 x i8> %B) - %r5 = call <4 x i16> @llvm.x86.mmx.punpckhwd(<4 x i16> %C, <4 x i16> %D) - %r6 = call <2 x i32> @llvm.x86.mmx.punpckhdq(<2 x i32> %E, <2 x i32> %F) - %r7 = call <8 x i8> @llvm.x86.mmx.punpcklbw(<8 x i8> %A, <8 x i8> %B) - %r8 = call <4 x i16> @llvm.x86.mmx.punpcklwd(<4 x i16> %C, <4 x i16> %D) - %r9 = call <2 x i32> @llvm.x86.mmx.punpckldq(<2 x i32> %E, <2 x i32> %F) - ret void -} - -; Integer comparison ops -declare <8 x i8> @llvm.x86.mmx.pcmpeq.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pcmpeq.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.pcmpeq.d(<2 x i32>, <2 x i32>) nounwind readnone -declare <8 x i8> @llvm.x86.mmx.pcmpgt.b(<8 x i8>, <8 x i8>) nounwind readnone -declare <4 x i16> @llvm.x86.mmx.pcmpgt.w(<4 x i16>, <4 x i16>) nounwind readnone -declare <2 x i32> @llvm.x86.mmx.pcmpgt.d(<2 x i32>, <2 x i32>) nounwind readnone -define void @cmp(<8 x i8> %A, <8 x i8> %B, <4 x i16> %C, <4 x i16> %D, - <2 x i32> %E, <2 x i32> %F) { - %r1 = call <8 x i8> @llvm.x86.mmx.pcmpeq.b(<8 x i8> %A, <8 x i8> %B) - %r2 = call <4 x i16> @llvm.x86.mmx.pcmpeq.w(<4 x i16> %C, <4 x i16> %D) - %r3 = call <2 x i32> @llvm.x86.mmx.pcmpeq.d(<2 x i32> %E, <2 x i32> %F) - %r4 = call <8 x i8> @llvm.x86.mmx.pcmpgt.b(<8 x i8> %A, <8 x i8> %B) - %r5 = call <4 x i16> @llvm.x86.mmx.pcmpgt.w(<4 x i16> %C, <4 x i16> %D) - %r6 = call <2 x i32> @llvm.x86.mmx.pcmpgt.d(<2 x i32> %E, <2 x i32> %F) - ret void -} - -; Miscellaneous -declare void @llvm.x86.mmx.maskmovq(<8 x i8>, <8 x i8>, i32*) nounwind readnone -declare i32 @llvm.x86.mmx.pmovmskb(<8 x i8>) nounwind readnone -declare void @llvm.x86.mmx.movnt.dq(i32*, <1 x i64>) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.palignr.b(<1 x i64>, <1 x i64>, i8) nounwind readnone -declare i32 @llvm.x86.mmx.pextr.w(<1 x i64>, i32) nounwind readnone -declare <1 x i64> @llvm.x86.mmx.pinsr.w(<1 x i64>, i32, i32) nounwind readnone -declare <4 x i16> @llvm.x86.ssse3.pshuf.w(<4 x i16>, i32) nounwind readnone -define void @misc(<8 x i8> %A, <8 x i8> %B, <4 x i16> %C, <4 x i16> %D, - <2 x i32> %E, <2 x i32> %F, <1 x i64> %G, <1 x i64> %H, - i32* %I, i8 %J, i16 %K, i32 %L) { - call void @llvm.x86.mmx.maskmovq(<8 x i8> %A, <8 x i8> %B, i32* %I) - %r1 = call i32 @llvm.x86.mmx.pmovmskb(<8 x i8> %A) - call void @llvm.x86.mmx.movnt.dq(i32* %I, <1 x i64> %G) - %r2 = call <1 x i64> @llvm.x86.mmx.palignr.b(<1 x i64> %G, <1 x i64> %H, i8 %J) - %r3 = call i32 @llvm.x86.mmx.pextr.w(<1 x i64> %G, i32 37) - %r4 = call <1 x i64> @llvm.x86.mmx.pinsr.w(<1 x i64> %G, i32 37, i32 927) - %r5 = call <4 x i16> @llvm.x86.ssse3.pshuf.w(<4 x i16> %C, i32 37) - ret void -} diff --git a/test/Bitcode/memcpy.ll b/test/Bitcode/memcpy.ll deleted file mode 100644 index 299eb1ed41e..00000000000 --- a/test/Bitcode/memcpy.ll +++ /dev/null @@ -1,23 +0,0 @@ -; RUN: llvm-as %s -o /dev/null - -define void @test(i32* %P, i32* %Q) { -entry: - %tmp.1 = bitcast i32* %P to i8* ; [#uses=3] - %tmp.3 = bitcast i32* %Q to i8* ; [#uses=4] - tail call void @llvm.memcpy.i32( i8* %tmp.1, i8* %tmp.3, i32 100000, i32 1 ) - tail call void @llvm.memcpy.i64( i8* %tmp.1, i8* %tmp.3, i64 100000, i32 1 ) - tail call void @llvm.memset.i32( i8* %tmp.3, i8 14, i32 10000, i32 0 ) - tail call void @llvm.memmove.i32( i8* %tmp.1, i8* %tmp.3, i32 123124, i32 1 ) - tail call void @llvm.memmove.i64( i8* %tmp.1, i8* %tmp.3, i64 123124, i32 1 ) - ret void -} - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - -declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) - -declare void @llvm.memset.i32(i8*, i8, i32, i32) - -declare void @llvm.memmove.i32(i8*, i8*, i32, i32) - -declare void @llvm.memmove.i64(i8*, i8*, i64, i32) diff --git a/test/CodeGen/ARM/2007-05-07-jumptoentry.ll b/test/CodeGen/ARM/2007-05-07-jumptoentry.ll deleted file mode 100644 index 26864f18a69..00000000000 --- a/test/CodeGen/ARM/2007-05-07-jumptoentry.ll +++ /dev/null @@ -1,58 +0,0 @@ -; RUN: llc < %s | not grep 1_0 -; This used to create an extra branch to 'entry', LBB1_0. - -; ModuleID = 'bug.bc' -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64" -target triple = "arm-apple-darwin8" - %struct.HexxagonMove = type { i8, i8, i32 } - %struct.HexxagonMoveList = type { i32, %struct.HexxagonMove* } - -define void @_ZN16HexxagonMoveList8sortListEv(%struct.HexxagonMoveList* %this) { -entry: - %tmp51 = getelementptr %struct.HexxagonMoveList* %this, i32 0, i32 0 ; [#uses=1] - %tmp2 = getelementptr %struct.HexxagonMoveList* %this, i32 0, i32 1 ; <%struct.HexxagonMove**> [#uses=2] - br label %bb49 - -bb1: ; preds = %bb49 - %tmp3 = load %struct.HexxagonMove** %tmp2 ; <%struct.HexxagonMove*> [#uses=5] - %tmp6 = getelementptr %struct.HexxagonMove* %tmp3, i32 %i.1, i32 2 ; [#uses=1] - %tmp7 = load i32* %tmp6 ; [#uses=2] - %tmp12 = add i32 %i.1, 1 ; [#uses=7] - %tmp14 = getelementptr %struct.HexxagonMove* %tmp3, i32 %tmp12, i32 2 ; [#uses=1] - %tmp15 = load i32* %tmp14 ; [#uses=1] - %tmp16 = icmp slt i32 %tmp7, %tmp15 ; [#uses=1] - br i1 %tmp16, label %cond_true, label %bb49 - -cond_true: ; preds = %bb1 - %tmp23.0 = getelementptr %struct.HexxagonMove* %tmp3, i32 %i.1, i32 0 ; [#uses=2] - %tmp67 = load i8* %tmp23.0 ; [#uses=1] - %tmp23.1 = getelementptr %struct.HexxagonMove* %tmp3, i32 %i.1, i32 1 ; [#uses=1] - %tmp68 = load i8* %tmp23.1 ; [#uses=1] - %tmp3638 = getelementptr %struct.HexxagonMove* %tmp3, i32 %tmp12, i32 0 ; [#uses=1] - tail call void @llvm.memcpy.i32( i8* %tmp23.0, i8* %tmp3638, i32 8, i32 4 ) - %tmp41 = load %struct.HexxagonMove** %tmp2 ; <%struct.HexxagonMove*> [#uses=3] - %tmp44.0 = getelementptr %struct.HexxagonMove* %tmp41, i32 %tmp12, i32 0 ; [#uses=1] - store i8 %tmp67, i8* %tmp44.0 - %tmp44.1 = getelementptr %struct.HexxagonMove* %tmp41, i32 %tmp12, i32 1 ; [#uses=1] - store i8 %tmp68, i8* %tmp44.1 - %tmp44.2 = getelementptr %struct.HexxagonMove* %tmp41, i32 %tmp12, i32 2 ; [#uses=1] - store i32 %tmp7, i32* %tmp44.2 - br label %bb49 - -bb49: ; preds = %bb59, %cond_true, %bb1, %entry - %i.1 = phi i32 [ 0, %entry ], [ %tmp12, %bb1 ], [ %tmp12, %cond_true ], [ 0, %bb59 ] ; [#uses=5] - %move.2 = phi i32 [ 0, %entry ], [ 1, %cond_true ], [ %move.2, %bb1 ], [ 0, %bb59 ] ; [#uses=2] - %tmp52 = load i32* %tmp51 ; [#uses=1] - %tmp53 = add i32 %tmp52, -1 ; [#uses=1] - %tmp55 = icmp sgt i32 %tmp53, %i.1 ; [#uses=1] - br i1 %tmp55, label %bb1, label %bb59 - -bb59: ; preds = %bb49 - %tmp61 = icmp eq i32 %move.2, 0 ; [#uses=1] - br i1 %tmp61, label %return, label %bb49 - -return: ; preds = %bb59 - ret void -} - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) diff --git a/test/CodeGen/ARM/2007-05-31-RegScavengerInfiniteLoop.ll b/test/CodeGen/ARM/2007-05-31-RegScavengerInfiniteLoop.ll deleted file mode 100644 index 7ba2a190be7..00000000000 --- a/test/CodeGen/ARM/2007-05-31-RegScavengerInfiniteLoop.ll +++ /dev/null @@ -1,237 +0,0 @@ -; RUN: llc < %s -; PR1424 - -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64" -target triple = "arm-unknown-linux-gnueabi" - %struct.AVClass = type { i8*, i8* (i8*)*, %struct.AVOption* } - %struct.AVCodec = type { i8*, i32, i32, i32, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32, i8*)*, i32 (%struct.AVCodecContext*)*, i32 (%struct.AVCodecContext*, i8*, i32*, i8*, i32)*, i32, %struct.AVCodec*, void (%struct.AVCodecContext*)*, %struct.AVRational*, i32* } - %struct.AVCodecContext = type { %struct.AVClass*, i32, i32, i32, i32, i32, i8*, i32, %struct.AVRational, i32, i32, i32, i32, i32, void (%struct.AVCodecContext*, %struct.AVFrame*, i32*, i32, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, float, float, i32, i32, i32, i32, float, i32, i32, i32, %struct.AVCodec*, i8*, i32, i32, void (%struct.AVCodecContext*, i8*, i32, i32)*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, [32 x i8], i32, i32, i32, i32, i32, i32, i32, float, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, void (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i8*, i8*, float, float, i32, %struct.RcOverride*, i32, i8*, i32, i32, i32, float, float, float, float, i32, float, float, float, float, float, i32, i32, i32, i32*, i32, i32, i32, i32, %struct.AVRational, %struct.AVFrame*, i32, i32, [4 x i64], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32*)*, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, i32, i16*, i16*, i32, i32, i32, i32, %struct.AVPaletteControl*, i32, i32 (%struct.AVCodecContext*, %struct.AVFrame*)*, i32, i32, i32, i32, i32, i32, i32, i32 (%struct.AVCodecContext*, i32 (%struct.AVCodecContext*, i8*)*, i8**, i32*, i32)*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, float, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64 } - %struct.AVEvalExpr = type opaque - %struct.AVFrame = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*] } - %struct.AVOption = type opaque - %struct.AVPaletteControl = type { i32, [256 x i32] } - %struct.AVPanScan = type { i32, i32, i32, [3 x [2 x i16]] } - %struct.AVRational = type { i32, i32 } - %struct.BlockNode = type { i16, i16, i8, [3 x i8], i8, i8 } - %struct.DSPContext = type { void (i16*, i8*, i32)*, void (i16*, i8*, i8*, i32)*, void (i16*, i8*, i32)*, void (i16*, i8*, i32)*, void (i16*, i8*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, i32 (i16*)*, void (i8*, i8*, i32, i32, i32, i32, i32)*, void (i8*, i8*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32)*, void (i16*)*, i32 (i8*, i32)*, i32 (i8*, i32)*, [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], [5 x i32 (i8*, i8*, i8*, i32, i32)*], i32 (i8*, i16*, i32)*, [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [4 x [4 x void (i8*, i8*, i32, i32)*]], [2 x void (i8*, i8*, i8*, i32, i32)*], [11 x void (i8*, i8*, i32, i32, i32)*], [11 x void (i8*, i8*, i32, i32, i32)*], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], [8 x void (i8*, i8*, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [3 x void (i8*, i8*, i32, i32, i32, i32)*], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [4 x [16 x void (i8*, i8*, i32)*]], [10 x void (i8*, i32, i32, i32, i32)*], [10 x void (i8*, i8*, i32, i32, i32, i32, i32)*], [2 x [16 x void (i8*, i8*, i32)*]], [2 x [16 x void (i8*, i8*, i32)*]], void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i32, i32, i32, i32, i32, i32)*, void (i8*, i16*, i32)*, [2 x [4 x i32 (i8*, i8*, i8*, i32, i32)*]], void (i8*, i8*, i32)*, void (i8*, i8*, i8*, i32)*, void (i8*, i8*, i8*, i32, i32*, i32*)*, void (i32*, i32*, i32)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32, i8*)*, void (i8*, i32, i32, i32)*, void (i8*, i32, i32, i32)*, void ([4 x [4 x i16]]*, i8*, [40 x i8]*, [40 x [2 x i16]]*, i32, i32, i32, i32, i32)*, void (i8*, i32, i32)*, void (i8*, i32, i32)*, void (i8*, i32)*, void (float*, float*, i32)*, void (float*, float*, i32)*, void (float*, float*, float*, i32)*, void (float*, float*, float*, float*, i32, i32, i32)*, void (i16*, float*, i32)*, void (i16*)*, void (i16*)*, void (i16*)*, void (i8*, i32, i16*)*, void (i8*, i32, i16*)*, [64 x i8], i32, i32 (i16*, i16*, i16*, i32)*, void (i16*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void (i8*, i16*, i32)*, void ([4 x i16]*)*, void (i32*, i32*, i32*, i32*, i32*, i32*, i32)*, void (i32*, i32)*, void (i8*, i32, i8**, i32, i32, i32, i32, i32, %struct.slice_buffer*, i32, i8*)*, void (i8*, i32, i32)*, [4 x void (i8*, i32, i8*, i32, i32, i32)*], void (i16*)*, void (i16*, i32)*, void (i16*, i32)*, void (i16*, i32)*, void (i8*, i32)*, void (i8*, i32)*, [16 x void (i8*, i8*, i32, i32)*] } - %struct.FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct.FILE*, i32, i32, i32, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i32, i32, [40 x i8] } - %struct.GetBitContext = type { i8*, i8*, i32*, i32, i32, i32, i32 } - %struct.MJpegContext = type opaque - %struct.MotionEstContext = type { %struct.AVCodecContext*, i32, [4 x [2 x i32]], [4 x [2 x i32]], i8*, i8*, [2 x i8*], i8*, i32, i32*, i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x [4 x i8*]], [4 x [4 x i8*]], i32, i32, i32, i32, i32, [4 x void (i8*, i8*, i32, i32)*]*, [4 x void (i8*, i8*, i32, i32)*]*, [16 x void (i8*, i8*, i32)*]*, [16 x void (i8*, i8*, i32)*]*, [4097 x i8]*, i8*, i32 (%struct.MpegEncContext*, i32*, i32*, i32, i32, i32, i32, i32)* } - %struct.MpegEncContext = type { %struct.AVCodecContext*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.PutBitContext, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.Picture*, %struct.Picture**, %struct.Picture**, i32, i32, [8 x %struct.MpegEncContext*], %struct.Picture, %struct.Picture, %struct.Picture, %struct.Picture, %struct.Picture*, %struct.Picture*, %struct.Picture*, [3 x i8*], [3 x i32], i16*, [3 x i16*], [20 x i16], i32, i32, i8*, i8*, i8*, i8*, i8*, [16 x i16]*, [3 x [16 x i16]*], i32, i8*, i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, i32, i32*, i32, i32, i32, i32, i32, i32, i32, [5 x i32], i32, i32, i32, i32, %struct.DSPContext, i32, i32, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x [2 x [2 x i16]*]], [2 x [2 x [2 x [2 x i16]*]]], [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x i16]*, [2 x [2 x [2 x i16]*]], [2 x [2 x [2 x [2 x i16]*]]], [2 x i8*], [2 x [2 x i8*]], i32, i32, i32, [2 x [4 x [2 x i32]]], [2 x [2 x i32]], [2 x [2 x [2 x i32]]], i8*, [2 x [64 x i16]], %struct.MotionEstContext, i32, i32, i32, i32, i32, i32, i16*, [6 x i32], [6 x i32], [3 x i8*], i32*, [64 x i16], [64 x i16], [64 x i16], [64 x i16], i32, i32, i32, i32, i32, i8*, i8*, i8*, i8*, i8*, i8*, [8 x i32], [64 x i32]*, [64 x i32]*, [2 x [64 x i16]]*, [2 x [64 x i16]]*, [12 x i32], %struct.ScanTable, %struct.ScanTable, %struct.ScanTable, %struct.ScanTable, [64 x i32]*, [2 x i32], [64 x i16]*, i8*, i64, i64, i32, i32, %struct.RateControlContext, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i32, i32, %struct.GetBitContext, i32, i32, i32, %struct.ParseContext, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i16, i16, i16, i16, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x [2 x i32]], [2 x [2 x i32]], [2 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, %struct.PutBitContext, %struct.PutBitContext, i32, i32, i32, i32, i32, i32, i8*, i32, i32, i32, i32, i32, [3 x i32], %struct.MJpegContext*, [3 x i32], [3 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x [65 x [65 x [2 x i32]]]]*, i32, i32, %struct.GetBitContext, i32, i32, i32, i8*, i32, [2 x [2 x i32]], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [2 x i32], i32, i32, i32, i32, i8*, i32, [12 x i16*], [64 x i16]*, [8 x [64 x i16]]*, i32 (%struct.MpegEncContext*, [64 x i16]*)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, void (%struct.MpegEncContext*, i16*, i32, i32)*, i32 (%struct.MpegEncContext*, i16*, i32, i32, i32*)*, i32 (%struct.MpegEncContext*, i16*, i32, i32, i32*)*, void (%struct.MpegEncContext*, i16*)* } - %struct.ParseContext = type { i8*, i32, i32, i32, i32, i32, i32, i32 } - %struct.Picture = type { [4 x i8*], [4 x i32], [4 x i8*], i32, i32, i64, i32, i32, i32, i32, i32, i8*, i32, i8*, [2 x [2 x i16]*], i32*, i8, i8*, [4 x i64], i32, i32, i32, i32, i32, %struct.AVPanScan*, i32, i32, i16*, [2 x i8*], [3 x i8*], [2 x [2 x i16]*], i32*, [2 x i32], i32, i32, i32, i32, [2 x [16 x i32]], [2 x i32], i32, i32, i16*, i16*, i8*, i32*, i32 } - %struct.Plane = type { i32, i32, [8 x [4 x %struct.SubBand]] } - %struct.Predictor = type { double, double, double } - %struct.PutBitContext = type { i32, i32, i8*, i8*, i8* } - %struct.RangeCoder = type { i32, i32, i32, i32, [256 x i8], [256 x i8], i8*, i8*, i8* } - %struct.RateControlContext = type { %struct.FILE*, i32, %struct.RateControlEntry*, double, [5 x %struct.Predictor], double, double, double, double, double, [5 x double], i32, i32, [5 x i64], [5 x i64], [5 x i64], [5 x i64], [5 x i32], i32, i8*, float, i32, %struct.AVEvalExpr* } - %struct.RateControlEntry = type { i32, float, i32, i32, i32, i32, i32, i64, i32, float, i32, i32, i32, i32, i32, i32 } - %struct.RcOverride = type { i32, i32, i32, float } - %struct.ScanTable = type { i8*, [64 x i8], [64 x i8] } - %struct.SnowContext = type { %struct.AVCodecContext*, %struct.RangeCoder, %struct.DSPContext, %struct.AVFrame, %struct.AVFrame, %struct.AVFrame, [8 x %struct.AVFrame], %struct.AVFrame, [32 x i8], [4224 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [8 x [2 x i16]*], [8 x i32*], i32*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [4 x %struct.Plane], %struct.BlockNode*, [1024 x i32], i32, %struct.slice_buffer, %struct.MpegEncContext } - %struct.SubBand = type { i32, i32, i32, i32, i32, i32*, i32, i32, i32, %struct.x_and_coeff*, %struct.SubBand*, [519 x [32 x i8]] } - %struct._IO_marker = type { %struct._IO_marker*, %struct.FILE*, i32 } - %struct.slice_buffer = type { i32**, i32**, i32, i32, i32, i32, i32* } - %struct.x_and_coeff = type { i16, i16 } - -define fastcc void @iterative_me(%struct.SnowContext* %s) { -entry: - %state = alloca [4224 x i8], align 8 ; <[4224 x i8]*> [#uses=0] - %best_rd4233 = alloca i32, align 4 ; [#uses=0] - %tmp21 = getelementptr %struct.SnowContext* %s, i32 0, i32 36 ; [#uses=2] - br label %bb4198 - -bb79: ; preds = %bb4189.preheader - br i1 false, label %cond_next239, label %cond_true - -cond_true: ; preds = %bb79 - ret void - -cond_next239: ; preds = %bb79 - %tmp286 = alloca i8, i32 0 ; [#uses=0] - ret void - -bb4198: ; preds = %bb4189.preheader, %entry - br i1 false, label %bb4189.preheader, label %bb4204 - -bb4189.preheader: ; preds = %bb4198 - br i1 false, label %bb79, label %bb4198 - -bb4204: ; preds = %bb4198 - br i1 false, label %bb4221, label %cond_next4213 - -cond_next4213: ; preds = %bb4204 - ret void - -bb4221: ; preds = %bb4204 - br i1 false, label %bb5242.preheader, label %UnifiedReturnBlock - -bb5242.preheader: ; preds = %bb4221 - br label %bb5242 - -bb4231: ; preds = %bb5233 - %tmp4254.sum = add i32 0, 1 ; [#uses=2] - br i1 false, label %bb4559, label %cond_next4622 - -bb4559: ; preds = %bb4231 - ret void - -cond_next4622: ; preds = %bb4231 - %tmp4637 = load i16* null ; [#uses=1] - %tmp46374638 = sext i16 %tmp4637 to i32 ; [#uses=1] - %tmp4642 = load i16* null ; [#uses=1] - %tmp46424643 = sext i16 %tmp4642 to i32 ; [#uses=1] - %tmp4648 = load i16* null ; [#uses=1] - %tmp46484649 = sext i16 %tmp4648 to i32 ; [#uses=1] - %tmp4653 = getelementptr %struct.BlockNode* null, i32 %tmp4254.sum, i32 0 ; [#uses=1] - %tmp4654 = load i16* %tmp4653 ; [#uses=1] - %tmp46544655 = sext i16 %tmp4654 to i32 ; [#uses=1] - %tmp4644 = add i32 %tmp46374638, 2 ; [#uses=1] - %tmp4650 = add i32 %tmp4644, %tmp46424643 ; [#uses=1] - %tmp4656 = add i32 %tmp4650, %tmp46484649 ; [#uses=1] - %tmp4657 = add i32 %tmp4656, %tmp46544655 ; [#uses=2] - %tmp4658 = ashr i32 %tmp4657, 2 ; [#uses=1] - %tmp4662 = load i16* null ; [#uses=1] - %tmp46624663 = sext i16 %tmp4662 to i32 ; [#uses=1] - %tmp4672 = getelementptr %struct.BlockNode* null, i32 0, i32 1 ; [#uses=1] - %tmp4673 = load i16* %tmp4672 ; [#uses=1] - %tmp46734674 = sext i16 %tmp4673 to i32 ; [#uses=1] - %tmp4678 = getelementptr %struct.BlockNode* null, i32 %tmp4254.sum, i32 1 ; [#uses=1] - %tmp4679 = load i16* %tmp4678 ; [#uses=1] - %tmp46794680 = sext i16 %tmp4679 to i32 ; [#uses=1] - %tmp4669 = add i32 %tmp46624663, 2 ; [#uses=1] - %tmp4675 = add i32 %tmp4669, 0 ; [#uses=1] - %tmp4681 = add i32 %tmp4675, %tmp46734674 ; [#uses=1] - %tmp4682 = add i32 %tmp4681, %tmp46794680 ; [#uses=2] - %tmp4683 = ashr i32 %tmp4682, 2 ; [#uses=1] - %tmp4703 = load i32* %tmp21 ; [#uses=1] - %tmp4707 = shl i32 %tmp4703, 0 ; [#uses=4] - %tmp4710 = load %struct.BlockNode** null ; <%struct.BlockNode*> [#uses=6] - %tmp4713 = mul i32 %tmp4707, %mb_y.4 ; [#uses=1] - %tmp4715 = add i32 %tmp4713, %mb_x.7 ; [#uses=7] - store i8 0, i8* null - store i8 0, i8* null - %tmp47594761 = bitcast %struct.BlockNode* null to i8* ; [#uses=2] - call void @llvm.memcpy.i32( i8* null, i8* %tmp47594761, i32 10, i32 0 ) - %tmp4716.sum5775 = add i32 %tmp4715, 1 ; [#uses=1] - %tmp4764 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4716.sum5775 ; <%struct.BlockNode*> [#uses=1] - %tmp47644766 = bitcast %struct.BlockNode* %tmp4764 to i8* ; [#uses=1] - %tmp4716.sum5774 = add i32 %tmp4715, %tmp4707 ; [#uses=0] - %tmp47704772 = bitcast %struct.BlockNode* null to i8* ; [#uses=1] - %tmp4774 = add i32 %tmp4707, 1 ; [#uses=1] - %tmp4716.sum5773 = add i32 %tmp4774, %tmp4715 ; [#uses=1] - %tmp4777 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4716.sum5773 ; <%struct.BlockNode*> [#uses=1] - %tmp47774779 = bitcast %struct.BlockNode* %tmp4777 to i8* ; [#uses=1] - %tmp4781 = icmp slt i32 %mb_x.7, 0 ; [#uses=1] - %tmp4788 = or i1 %tmp4781, %tmp4784 ; [#uses=2] - br i1 %tmp4788, label %cond_true4791, label %cond_next4794 - -cond_true4791: ; preds = %cond_next4622 - unreachable - -cond_next4794: ; preds = %cond_next4622 - %tmp4797 = icmp slt i32 %mb_x.7, %tmp4707 ; [#uses=1] - br i1 %tmp4797, label %cond_next4803, label %cond_true4800 - -cond_true4800: ; preds = %cond_next4794 - unreachable - -cond_next4803: ; preds = %cond_next4794 - %tmp4825 = ashr i32 %tmp4657, 12 ; [#uses=1] - shl i32 %tmp4682, 4 ; :0 [#uses=1] - %tmp4828 = and i32 %0, -64 ; [#uses=1] - %tmp4831 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4715, i32 2 ; [#uses=0] - %tmp4826 = add i32 %tmp4828, %tmp4825 ; [#uses=1] - %tmp4829 = add i32 %tmp4826, 0 ; [#uses=1] - %tmp4835 = add i32 %tmp4829, 0 ; [#uses=1] - store i32 %tmp4835, i32* null - %tmp48534854 = trunc i32 %tmp4658 to i16 ; [#uses=1] - %tmp4856 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4715, i32 0 ; [#uses=1] - store i16 %tmp48534854, i16* %tmp4856 - %tmp48574858 = trunc i32 %tmp4683 to i16 ; [#uses=1] - %tmp4860 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4715, i32 1 ; [#uses=1] - store i16 %tmp48574858, i16* %tmp4860 - %tmp4866 = getelementptr %struct.BlockNode* %tmp4710, i32 %tmp4715, i32 4 ; [#uses=0] - br i1 false, label %bb4933, label %cond_false4906 - -cond_false4906: ; preds = %cond_next4803 - call void @llvm.memcpy.i32( i8* %tmp47594761, i8* null, i32 10, i32 0 ) - call void @llvm.memcpy.i32( i8* %tmp47644766, i8* null, i32 10, i32 0 ) - call void @llvm.memcpy.i32( i8* %tmp47704772, i8* null, i32 10, i32 0 ) - call void @llvm.memcpy.i32( i8* %tmp47774779, i8* null, i32 10, i32 0 ) - br label %bb5215 - -bb4933: ; preds = %bb5215, %cond_next4803 - br i1 false, label %cond_true4944, label %bb5215 - -cond_true4944: ; preds = %bb4933 - %tmp4982 = load i32* %tmp21 ; [#uses=1] - %tmp4986 = shl i32 %tmp4982, 0 ; [#uses=2] - %tmp4992 = mul i32 %tmp4986, %mb_y.4 ; [#uses=1] - %tmp4994 = add i32 %tmp4992, %mb_x.7 ; [#uses=5] - %tmp4995.sum5765 = add i32 %tmp4994, 1 ; [#uses=1] - %tmp5043 = getelementptr %struct.BlockNode* null, i32 %tmp4995.sum5765 ; <%struct.BlockNode*> [#uses=1] - %tmp50435045 = bitcast %struct.BlockNode* %tmp5043 to i8* ; [#uses=2] - call void @llvm.memcpy.i32( i8* null, i8* %tmp50435045, i32 10, i32 0 ) - %tmp4995.sum5764 = add i32 %tmp4994, %tmp4986 ; [#uses=1] - %tmp5049 = getelementptr %struct.BlockNode* null, i32 %tmp4995.sum5764 ; <%struct.BlockNode*> [#uses=1] - %tmp50495051 = bitcast %struct.BlockNode* %tmp5049 to i8* ; [#uses=2] - call void @llvm.memcpy.i32( i8* null, i8* %tmp50495051, i32 10, i32 0 ) - %tmp4995.sum5763 = add i32 0, %tmp4994 ; [#uses=1] - %tmp5056 = getelementptr %struct.BlockNode* null, i32 %tmp4995.sum5763 ; <%struct.BlockNode*> [#uses=1] - %tmp50565058 = bitcast %struct.BlockNode* %tmp5056 to i8* ; [#uses=1] - br i1 %tmp4788, label %cond_true5070, label %cond_next5073 - -cond_true5070: ; preds = %cond_true4944 - unreachable - -cond_next5073: ; preds = %cond_true4944 - %tmp5139 = getelementptr %struct.BlockNode* null, i32 %tmp4994, i32 1 ; [#uses=0] - %tmp5145 = getelementptr %struct.BlockNode* null, i32 %tmp4994, i32 4 ; [#uses=0] - call void @llvm.memcpy.i32( i8* %tmp50435045, i8* null, i32 10, i32 0 ) - call void @llvm.memcpy.i32( i8* %tmp50495051, i8* null, i32 10, i32 0 ) - call void @llvm.memcpy.i32( i8* %tmp50565058, i8* null, i32 10, i32 0 ) - br label %bb5215 - -bb5215: ; preds = %cond_next5073, %bb4933, %cond_false4906 - %i4232.3 = phi i32 [ 0, %cond_false4906 ], [ 0, %cond_next5073 ], [ 0, %bb4933 ] ; [#uses=1] - %tmp5217 = icmp slt i32 %i4232.3, 4 ; [#uses=1] - br i1 %tmp5217, label %bb4933, label %bb5220 - -bb5220: ; preds = %bb5215 - br i1 false, label %bb5230, label %cond_true5226 - -cond_true5226: ; preds = %bb5220 - ret void - -bb5230: ; preds = %bb5220 - %indvar.next = add i32 %indvar, 1 ; [#uses=1] - br label %bb5233 - -bb5233: ; preds = %bb5233.preheader, %bb5230 - %indvar = phi i32 [ 0, %bb5233.preheader ], [ %indvar.next, %bb5230 ] ; [#uses=2] - %mb_x.7 = shl i32 %indvar, 1 ; [#uses=4] - br i1 false, label %bb4231, label %bb5239 - -bb5239: ; preds = %bb5233 - %indvar.next37882 = add i32 %indvar37881, 1 ; [#uses=1] - br label %bb5242 - -bb5242: ; preds = %bb5239, %bb5242.preheader - %indvar37881 = phi i32 [ 0, %bb5242.preheader ], [ %indvar.next37882, %bb5239 ] ; [#uses=2] - %mb_y.4 = shl i32 %indvar37881, 1 ; [#uses=3] - br i1 false, label %bb5233.preheader, label %bb5248 - -bb5233.preheader: ; preds = %bb5242 - %tmp4784 = icmp slt i32 %mb_y.4, 0 ; [#uses=1] - br label %bb5233 - -bb5248: ; preds = %bb5242 - ret void - -UnifiedReturnBlock: ; preds = %bb4221 - ret void -} - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) diff --git a/test/CodeGen/ARM/2009-03-07-SpillerBug.ll b/test/CodeGen/ARM/2009-03-07-SpillerBug.ll index 0ec17ae23d6..377bbd21175 100644 --- a/test/CodeGen/ARM/2009-03-07-SpillerBug.ll +++ b/test/CodeGen/ARM/2009-03-07-SpillerBug.ll @@ -1,16 +1,15 @@ ; RUN: llc < %s -mtriple=armv6-apple-darwin9 -mattr=+vfp2 ; rdar://6653182 - %struct.ggBRDF = type { i32 (...)** } - %struct.ggPoint2 = type { [2 x double] } - %struct.ggPoint3 = type { [3 x double] } - %struct.ggSpectrum = type { [8 x float] } - %struct.ggSphere = type { %struct.ggPoint3, double } - %struct.mrDiffuseAreaSphereLuminaire = type { %struct.mrSphere, %struct.ggSpectrum } - %struct.mrDiffuseCosineSphereLuminaire = type { %struct.mrDiffuseAreaSphereLuminaire } - %struct.mrSphere = type { %struct.ggBRDF, %struct.ggSphere } -declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind +%struct.ggBRDF = type { i32 (...)** } +%struct.ggPoint2 = type { [2 x double] } +%struct.ggPoint3 = type { [3 x double] } +%struct.ggSpectrum = type { [8 x float] } +%struct.ggSphere = type { %struct.ggPoint3, double } +%struct.mrDiffuseAreaSphereLuminaire = type { %struct.mrSphere, %struct.ggSpectrum } +%struct.mrDiffuseCosineSphereLuminaire = type { %struct.mrDiffuseAreaSphereLuminaire } +%struct.mrSphere = type { %struct.ggBRDF, %struct.ggSphere } declare double @llvm.sqrt.f64(double) nounwind readonly @@ -20,59 +19,61 @@ declare double @acos(double) nounwind readonly define i32 @_ZNK34mrDiffuseSolidAngleSphereLuminaire18selectVisiblePointERK8ggPoint3RK9ggVector3RK8ggPoint2dRS0_Rd(%struct.mrDiffuseCosineSphereLuminaire* nocapture %this, %struct.ggPoint3* nocapture %x, %struct.ggPoint3* nocapture %unnamed_arg, %struct.ggPoint2* nocapture %uv, double %unnamed_arg2, %struct.ggPoint3* nocapture %on_light, double* nocapture %invProb) nounwind { entry: - %0 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind ; [#uses=4] - %1 = fcmp ult double 0.000000e+00, %0 ; [#uses=1] - br i1 %1, label %bb3, label %bb7 + %0 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind + %1 = fcmp ult double 0.000000e+00, %0 + br i1 %1, label %bb3, label %bb7 -bb3: ; preds = %entry - %2 = fdiv double 1.000000e+00, 0.000000e+00 ; [#uses=1] - %3 = fmul double 0.000000e+00, %2 ; [#uses=2] - %4 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind ; [#uses=1] - %5 = fdiv double 1.000000e+00, %4 ; [#uses=2] - %6 = fmul double %3, %5 ; [#uses=2] - %7 = fmul double 0.000000e+00, %5 ; [#uses=2] - %8 = fmul double %3, %7 ; [#uses=1] - %9 = fsub double %8, 0.000000e+00 ; [#uses=1] - %10 = fmul double 0.000000e+00, %6 ; [#uses=1] - %11 = fsub double 0.000000e+00, %10 ; [#uses=1] - %12 = fsub double -0.000000e+00, %11 ; [#uses=1] - %13 = fmul double %0, %0 ; [#uses=2] - %14 = fsub double %13, 0.000000e+00 ; [#uses=1] - %15 = call double @llvm.sqrt.f64(double %14) ; [#uses=1] - %16 = fmul double 0.000000e+00, %15 ; [#uses=1] - %17 = fdiv double %16, %0 ; [#uses=1] - %18 = fadd double 0.000000e+00, %17 ; [#uses=1] - %19 = call double @acos(double %18) nounwind readonly ; [#uses=1] - %20 = load double* null, align 4 ; [#uses=1] - %21 = fmul double %20, 0x401921FB54442D18 ; [#uses=1] - %22 = call double @sin(double %19) nounwind readonly ; [#uses=2] - %23 = fmul double %22, 0.000000e+00 ; [#uses=2] - %24 = fmul double %6, %23 ; [#uses=1] - %25 = fmul double %7, %23 ; [#uses=1] - %26 = call double @sin(double %21) nounwind readonly ; [#uses=1] - %27 = fmul double %22, %26 ; [#uses=2] - %28 = fmul double %9, %27 ; [#uses=1] - %29 = fmul double %27, %12 ; [#uses=1] - %30 = fadd double %24, %28 ; [#uses=1] - %31 = fadd double 0.000000e+00, %29 ; [#uses=1] - %32 = fadd double %25, 0.000000e+00 ; [#uses=1] - %33 = fadd double %30, 0.000000e+00 ; [#uses=1] - %34 = fadd double %31, 0.000000e+00 ; [#uses=1] - %35 = fadd double %32, 0.000000e+00 ; [#uses=1] - %36 = bitcast %struct.ggPoint3* %x to i8* ; [#uses=1] - call void @llvm.memcpy.i32(i8* null, i8* %36, i32 24, i32 4) nounwind - store double %33, double* null, align 8 - br i1 false, label %_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit, label %bb5.i.i.i +bb3: ; preds = %entry + %2 = fdiv double 1.000000e+00, 0.000000e+00 + %3 = fmul double 0.000000e+00, %2 + %4 = call double @llvm.sqrt.f64(double 0.000000e+00) nounwind + %5 = fdiv double 1.000000e+00, %4 + %6 = fmul double %3, %5 + %7 = fmul double 0.000000e+00, %5 + %8 = fmul double %3, %7 + %9 = fsub double %8, 0.000000e+00 + %10 = fmul double 0.000000e+00, %6 + %11 = fsub double 0.000000e+00, %10 + %12 = fsub double -0.000000e+00, %11 + %13 = fmul double %0, %0 + %14 = fsub double %13, 0.000000e+00 + %15 = call double @llvm.sqrt.f64(double %14) + %16 = fmul double 0.000000e+00, %15 + %17 = fdiv double %16, %0 + %18 = fadd double 0.000000e+00, %17 + %19 = call double @acos(double %18) nounwind readonly + %20 = load double* null, align 4 + %21 = fmul double %20, 0x401921FB54442D18 + %22 = call double @sin(double %19) nounwind readonly + %23 = fmul double %22, 0.000000e+00 + %24 = fmul double %6, %23 + %25 = fmul double %7, %23 + %26 = call double @sin(double %21) nounwind readonly + %27 = fmul double %22, %26 + %28 = fmul double %9, %27 + %29 = fmul double %27, %12 + %30 = fadd double %24, %28 + %31 = fadd double 0.000000e+00, %29 + %32 = fadd double %25, 0.000000e+00 + %33 = fadd double %30, 0.000000e+00 + %34 = fadd double %31, 0.000000e+00 + %35 = fadd double %32, 0.000000e+00 + %36 = bitcast %struct.ggPoint3* %x to i8* + call void @llvm.memcpy.p0i8.p0i8.i32(i8* null, i8* %36, i32 24, i32 4, i1 false) + store double %33, double* null, align 8 + br i1 false, label %_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit, label %bb5.i.i.i -bb5.i.i.i: ; preds = %bb3 - unreachable +bb5.i.i.i: ; preds = %bb3 + unreachable -_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit: ; preds = %bb3 - %37 = fsub double %13, 0.000000e+00 ; [#uses=0] - %38 = fsub double -0.000000e+00, %34 ; [#uses=0] - %39 = fsub double -0.000000e+00, %35 ; [#uses=0] - ret i32 1 +_Z20ggRaySphereIntersectRK6ggRay3RK8ggSphereddRd.exit: ; preds = %bb3 + %37 = fsub double %13, 0.000000e+00 + %38 = fsub double -0.000000e+00, %34 + %39 = fsub double -0.000000e+00, %35 + ret i32 1 -bb7: ; preds = %entry - ret i32 0 +bb7: ; preds = %entry + ret i32 0 } + +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind diff --git a/test/CodeGen/ARM/2009-06-12-RegScavengerAssert.ll b/test/CodeGen/ARM/2009-06-12-RegScavengerAssert.ll deleted file mode 100644 index 27888d75f67..00000000000 --- a/test/CodeGen/ARM/2009-06-12-RegScavengerAssert.ll +++ /dev/null @@ -1,77 +0,0 @@ -; RUN: llc < %s -mtriple=armv6-apple-darwin - - type { i32, i32, %struct.D_Sym**, [3 x %struct.D_Sym*] } ; type %0 - type { i32, %struct.D_Reduction** } ; type %1 - type { i32, %struct.D_RightEpsilonHint* } ; type %2 - type { i32, %struct.D_ErrorRecoveryHint* } ; type %3 - type { i32, i32, %struct.D_Reduction**, [3 x %struct.D_Reduction*] } ; type %4 - %struct.D_ErrorRecoveryHint = type { i16, i16, i8* } - %struct.D_ParseNode = type { i32, %struct.d_loc_t, i8*, i8*, %struct.D_Scope*, void (%struct.D_Parser*, %struct.d_loc_t*, i8**)*, i8*, i8* } - %struct.D_Parser = type { i8*, void (%struct.D_Parser*, %struct.d_loc_t*, i8**)*, %struct.D_Scope*, void (%struct.D_Parser*)*, %struct.D_ParseNode* (%struct.D_Parser*, i32, %struct.D_ParseNode**)*, void (%struct.D_ParseNode*)*, %struct.d_loc_t, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } - %struct.D_ParserTables = type { i32, %struct.D_State*, i16*, i32, i32, %struct.D_Symbol*, void (%struct.D_Parser*, %struct.d_loc_t*, i8**)*, i32, %struct.D_Pass*, i32 } - %struct.D_Pass = type { i8*, i32, i32, i32 } - %struct.D_Reduction = type { i16, i16, i32 (i8*, i8**, i32, i32, %struct.D_Parser*)*, i32 (i8*, i8**, i32, i32, %struct.D_Parser*)*, i16, i16, i32, i32, i32, i32, i32 (i8*, i8**, i32, i32, %struct.D_Parser*)** } - %struct.D_RightEpsilonHint = type { i16, i16, %struct.D_Reduction* } - %struct.D_Scope = type { i8, %struct.D_Sym*, %struct.D_SymHash*, %struct.D_Sym*, %struct.D_Scope*, %struct.D_Scope*, %struct.D_Scope*, %struct.D_Scope*, %struct.D_Scope* } - %struct.D_Shift = type { i16, i8, i8, i32, i32, i32 (i8*, i8**, i32, i32, %struct.D_Parser*)* } - %struct.D_State = type { i8*, i32, %1, %2, %3, %struct.D_Shift**, i32 (i8**, i32*, i32*, i16*, i32*, i8*, i32*)*, i8*, i8, i8, i8, i8*, %struct.D_Shift***, i32 } - %struct.D_Sym = type { i8*, i32, i32, %struct.D_Sym*, %struct.D_Sym*, i32 } - %struct.D_SymHash = type { i32, i32, %0 } - %struct.D_Symbol = type { i32, i8*, i32 } - %struct.PNode = type { i32, i32, i32, i32, %struct.D_Reduction*, %struct.D_Shift*, i32, %struct.VecPNode, i32, i8, i8, %struct.PNode*, %struct.PNode*, %struct.PNode*, %struct.PNode*, i8*, i8*, %struct.D_Scope*, i8*, %struct.D_ParseNode } - %struct.PNodeHash = type { %struct.PNode**, i32, i32, i32, %struct.PNode* } - %struct.Parser = type { %struct.D_Parser, i8*, i8*, %struct.D_ParserTables*, i32, i32, i32, i32, i32, i32, i32, %struct.PNodeHash, %struct.SNodeHash, %struct.Reduction*, %struct.Shift*, %struct.D_Scope*, %struct.SNode*, i32, %struct.Reduction*, %struct.Shift*, i32, %struct.PNode*, %struct.SNode*, %struct.ZNode*, %4, %struct.ShiftResult*, %struct.D_Shift, %struct.Parser*, i8* } - %struct.Reduction = type { %struct.ZNode*, %struct.SNode*, %struct.D_Reduction*, %struct.SNode*, i32, %struct.Reduction* } - %struct.SNode = type { %struct.D_State*, %struct.D_Scope*, i8*, %struct.d_loc_t, i32, %struct.PNode*, %struct.VecZNode, i32, %struct.SNode*, %struct.SNode* } - %struct.SNodeHash = type { %struct.SNode**, i32, i32, i32, %struct.SNode*, %struct.SNode* } - %struct.Shift = type { %struct.SNode*, %struct.Shift* } - %struct.ShiftResult = type { %struct.D_Shift*, %struct.d_loc_t } - %struct.VecPNode = type { i32, i32, %struct.PNode**, [3 x %struct.PNode*] } - %struct.VecSNode = type { i32, i32, %struct.SNode**, [3 x %struct.SNode*] } - %struct.VecZNode = type { i32, i32, %struct.ZNode**, [3 x %struct.ZNode*] } - %struct.ZNode = type { %struct.PNode*, %struct.VecSNode } - %struct.d_loc_t = type { i8*, i8*, i32, i32, i32 } - -declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind - -define fastcc i32 @exhaustive_parse(%struct.Parser* %p, i32 %state) nounwind { -entry: - store i8* undef, i8** undef, align 4 - %0 = getelementptr %struct.Parser* %p, i32 0, i32 0, i32 6 ; <%struct.d_loc_t*> [#uses=1] - %1 = bitcast %struct.d_loc_t* %0 to i8* ; [#uses=1] - call void @llvm.memcpy.i32(i8* undef, i8* %1, i32 20, i32 4) - br label %bb10 - -bb10: ; preds = %bb30, %bb29, %bb26, %entry - br i1 undef, label %bb18, label %bb20 - -bb18: ; preds = %bb10 - br i1 undef, label %bb20, label %bb19 - -bb19: ; preds = %bb18 - br label %bb20 - -bb20: ; preds = %bb19, %bb18, %bb10 - br i1 undef, label %bb21, label %bb22 - -bb21: ; preds = %bb20 - unreachable - -bb22: ; preds = %bb20 - br i1 undef, label %bb24, label %bb26 - -bb24: ; preds = %bb22 - unreachable - -bb26: ; preds = %bb22 - br i1 undef, label %bb10, label %bb29 - -bb29: ; preds = %bb26 - br i1 undef, label %bb10, label %bb30 - -bb30: ; preds = %bb29 - br i1 undef, label %bb31, label %bb10 - -bb31: ; preds = %bb30 - unreachable -} diff --git a/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll b/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll index 397eba410b1..8bde7489d9b 100644 --- a/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll +++ b/test/CodeGen/ARM/2009-08-31-LSDA-Name.ll @@ -1,32 +1,35 @@ ; RUN: llc < %s -mtriple=arm-apple-darwin9 -march=arm | FileCheck %s +; CHECK: L_LSDA_0: + + %struct.A = type { i32* } define void @"\01-[MyFunction Name:]"() { entry: - %save_filt.1 = alloca i32 ; [#uses=2] - %save_eptr.0 = alloca i8* ; [#uses=2] - %a = alloca %struct.A ; <%struct.A*> [#uses=3] - %eh_exception = alloca i8* ; [#uses=5] - %eh_selector = alloca i32 ; [#uses=3] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] - call void @_ZN1AC1Ev(%struct.A* %a) - invoke void @_Z3barv() + %save_filt.1 = alloca i32 + %save_eptr.0 = alloca i8* + %a = alloca %struct.A + %eh_exception = alloca i8* + %eh_selector = alloca i32 + %"alloca point" = bitcast i32 0 to i32 + call void @_ZN1AC1Ev(%struct.A* %a) + invoke void @_Z3barv() to label %invcont unwind label %lpad invcont: ; preds = %entry - call void @_ZN1AD1Ev(%struct.A* %a) nounwind + call void @_ZN1AD1Ev(%struct.A* %a) nounwind br label %return bb: ; preds = %ppad - %eh_select = load i32* %eh_selector ; [#uses=1] + %eh_select = load i32* %eh_selector store i32 %eh_select, i32* %save_filt.1, align 4 - %eh_value = load i8** %eh_exception ; [#uses=1] + %eh_value = load i8** %eh_exception store i8* %eh_value, i8** %save_eptr.0, align 4 - call void @_ZN1AD1Ev(%struct.A* %a) nounwind - %0 = load i8** %save_eptr.0, align 4 ; [#uses=1] + call void @_ZN1AD1Ev(%struct.A* %a) nounwind + %0 = load i8** %save_eptr.0, align 4 store i8* %0, i8** %eh_exception, align 4 - %1 = load i32* %save_filt.1, align 4 ; [#uses=1] + %1 = load i32* %save_filt.1, align 4 store i32 %1, i32* %eh_selector, align 4 br label %Unwind @@ -34,10 +37,10 @@ return: ; preds = %invcont ret void lpad: ; preds = %entry - %eh_ptr = call i8* @llvm.eh.exception() ; [#uses=1] + %eh_ptr = call i8* @llvm.eh.exception() store i8* %eh_ptr, i8** %eh_exception - %eh_ptr1 = load i8** %eh_exception ; [#uses=1] - %eh_select2 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr1, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i32 0) ; [#uses=1] + %eh_ptr1 = load i8** %eh_exception + %eh_select2 = call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %eh_ptr1, i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*), i32 0) store i32 %eh_select2, i32* %eh_selector br label %ppad @@ -45,20 +48,20 @@ ppad: ; preds = %lpad br label %bb Unwind: ; preds = %bb - %eh_ptr3 = load i8** %eh_exception ; [#uses=1] - call void @_Unwind_SjLj_Resume(i8* %eh_ptr3) + %eh_ptr3 = load i8** %eh_exception + call void @_Unwind_SjLj_Resume(i8* %eh_ptr3) unreachable } define linkonce_odr void @_ZN1AC1Ev(%struct.A* %this) { entry: - %this_addr = alloca %struct.A* ; <%struct.A**> [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %this_addr = alloca %struct.A* + %"alloca point" = bitcast i32 0 to i32 store %struct.A* %this, %struct.A** %this_addr - %0 = call i8* @_Znwm(i32 4) ; [#uses=1] - %1 = bitcast i8* %0 to i32* ; [#uses=1] - %2 = load %struct.A** %this_addr, align 4 ; <%struct.A*> [#uses=1] - %3 = getelementptr inbounds %struct.A* %2, i32 0, i32 0 ; [#uses=1] + %0 = call i8* @_Znwm(i32 4) + %1 = bitcast i8* %0 to i32* + %2 = load %struct.A** %this_addr, align 4 + %3 = getelementptr inbounds %struct.A* %2, i32 0, i32 0 store i32* %1, i32** %3, align 4 br label %return @@ -70,14 +73,14 @@ declare i8* @_Znwm(i32) define linkonce_odr void @_ZN1AD1Ev(%struct.A* %this) nounwind { entry: - %this_addr = alloca %struct.A* ; <%struct.A**> [#uses=2] - %"alloca point" = bitcast i32 0 to i32 ; [#uses=0] + %this_addr = alloca %struct.A* + %"alloca point" = bitcast i32 0 to i32 store %struct.A* %this, %struct.A** %this_addr - %0 = load %struct.A** %this_addr, align 4 ; <%struct.A*> [#uses=1] - %1 = getelementptr inbounds %struct.A* %0, i32 0, i32 0 ; [#uses=1] - %2 = load i32** %1, align 4 ; [#uses=1] - %3 = bitcast i32* %2 to i8* ; [#uses=1] - call void @_ZdlPv(i8* %3) nounwind + %0 = load %struct.A** %this_addr, align 4 + %1 = getelementptr inbounds %struct.A* %0, i32 0, i32 0 + %2 = load i32** %1, align 4 + %3 = bitcast i32* %2 to i8* + call void @_ZdlPv(i8* %3) nounwind br label %bb bb: ; preds = %entry @@ -86,17 +89,16 @@ bb: ; preds = %entry return: ; preds = %bb ret void } -;CHECK: L_LSDA_0: declare void @_ZdlPv(i8*) nounwind declare void @_Z3barv() -declare i8* @llvm.eh.exception() nounwind +declare i8* @llvm.eh.exception() nounwind readonly -declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind +declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind -declare i32 @llvm.eh.typeid.for.i32(i8*) nounwind +declare i32 @llvm.eh.typeid.for(i8*) nounwind declare i32 @__gxx_personality_sj0(...) diff --git a/test/CodeGen/ARM/dyn-stackalloc.ll b/test/CodeGen/ARM/dyn-stackalloc.ll index 92e2d136af6..de2820e98a1 100644 --- a/test/CodeGen/ARM/dyn-stackalloc.ll +++ b/test/CodeGen/ARM/dyn-stackalloc.ll @@ -1,48 +1,48 @@ ; RUN: llc < %s -march=arm - %struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* } - %struct.info = type { i32, i32, i32, i32, i32, i32, i32, i8* } +%struct.comment = type { i8**, i32*, i32, i8* } +%struct.info = type { i32, i32, i32, i32, i32, i32, i32, i8* } +%struct.state = type { i32, %struct.info*, float**, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i64, i64, i64, i64, i8* } + +@str215 = external global [2 x i8] define void @t1(%struct.state* %v) { - %tmp6 = load i32* null - %tmp8 = alloca float, i32 %tmp6 - store i32 1, i32* null - br i1 false, label %bb123.preheader, label %return - -bb123.preheader: - br i1 false, label %bb43, label %return - -bb43: - call fastcc void @f1( float* %tmp8, float* null, i32 0 ) - %tmp70 = load i32* null - %tmp85 = getelementptr float* %tmp8, i32 0 - call fastcc void @f2( float* null, float* null, float* %tmp85, i32 %tmp70 ) - ret void - -return: - ret void + %tmp6 = load i32* null + %tmp8 = alloca float, i32 %tmp6 + store i32 1, i32* null + br i1 false, label %bb123.preheader, label %return + +bb123.preheader: ; preds = %0 + br i1 false, label %bb43, label %return + +bb43: ; preds = %bb123.preheader + call fastcc void @f1(float* %tmp8, float* null, i32 0) + %tmp70 = load i32* null + %tmp85 = getelementptr float* %tmp8, i32 0 + call fastcc void @f2(float* null, float* null, float* %tmp85, i32 %tmp70) + ret void + +return: ; preds = %bb123.preheader, %0 + ret void } declare fastcc void @f1(float*, float*, i32) declare fastcc void @f2(float*, float*, float*, i32) - %struct.comment = type { i8**, i32*, i32, i8* } -@str215 = external global [2 x i8] - define void @t2(%struct.comment* %vc, i8* %tag, i8* %contents) { - %tmp1 = call i32 @strlen( i8* %tag ) - %tmp3 = call i32 @strlen( i8* %contents ) - %tmp4 = add i32 %tmp1, 2 - %tmp5 = add i32 %tmp4, %tmp3 - %tmp6 = alloca i8, i32 %tmp5 - %tmp9 = call i8* @strcpy( i8* %tmp6, i8* %tag ) - %tmp6.len = call i32 @strlen( i8* %tmp6 ) - %tmp6.indexed = getelementptr i8* %tmp6, i32 %tmp6.len - call void @llvm.memcpy.i32( i8* %tmp6.indexed, i8* getelementptr ([2 x i8]* @str215, i32 0, i32 0), i32 2, i32 1 ) - %tmp15 = call i8* @strcat( i8* %tmp6, i8* %contents ) - call fastcc void @comment_add( %struct.comment* %vc, i8* %tmp6 ) - ret void + %tmp1 = call i32 @strlen(i8* %tag) + %tmp3 = call i32 @strlen(i8* %contents) + %tmp4 = add i32 %tmp1, 2 + %tmp5 = add i32 %tmp4, %tmp3 + %tmp6 = alloca i8, i32 %tmp5 + %tmp9 = call i8* @strcpy(i8* %tmp6, i8* %tag) + %tmp6.len = call i32 @strlen(i8* %tmp6) + %tmp6.indexed = getelementptr i8* %tmp6, i32 %tmp6.len + call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp6.indexed, i8* getelementptr inbounds ([2 x i8]* @str215, i32 0, i32 0), i32 2, i32 1, i1 false) + %tmp15 = call i8* @strcat(i8* %tmp6, i8* %contents) + call fastcc void @comment_add(%struct.comment* %vc, i8* %tmp6) + ret void } declare i32 @strlen(i8*) @@ -51,6 +51,6 @@ declare i8* @strcat(i8*, i8*) declare fastcc void @comment_add(%struct.comment*, i8*) -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - declare i8* @strcpy(i8*, i8*) + +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind diff --git a/test/CodeGen/ARM/memcpy-inline.ll b/test/CodeGen/ARM/memcpy-inline.ll index 5bae037cafb..30b9f59a8b3 100644 --- a/test/CodeGen/ARM/memcpy-inline.ll +++ b/test/CodeGen/ARM/memcpy-inline.ll @@ -6,13 +6,14 @@ ; CHECK: ldrb %struct.x = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } + @src = external global %struct.x @dst = external global %struct.x define i32 @t() { entry: - call void @llvm.memcpy.i32( i8* getelementptr (%struct.x* @dst, i32 0, i32 0), i8* getelementptr (%struct.x* @src, i32 0, i32 0), i32 11, i32 8 ) - ret i32 0 + call void @llvm.memcpy.p0i8.p0i8.i32(i8* getelementptr inbounds (%struct.x* @dst, i32 0, i32 0), i8* getelementptr inbounds (%struct.x* @src, i32 0, i32 0), i32 11, i32 8, i1 false) + ret i32 0 } -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind diff --git a/test/CodeGen/ARM/memfunc.ll b/test/CodeGen/ARM/memfunc.ll index 757364b8d77..aeda02282b9 100644 --- a/test/CodeGen/ARM/memfunc.ll +++ b/test/CodeGen/ARM/memfunc.ll @@ -9,24 +9,21 @@ entry: ; CHECK: memmove ; EABI: __aeabi_memmove - call void @llvm.memmove.i32( i8* bitcast ([500 x i32]* @from to i8*), i8* bitcast ([500 x i32]* @to to i8*), i32 500, i32 0 ) + call void @llvm.memmove.p0i8.p0i8.i32(i8* bitcast ([500 x i32]* @from to i8*), i8* bitcast ([500 x i32]* @to to i8*), i32 500, i32 0, i1 false) ; CHECK: memcpy ; EABI: __aeabi_memcpy - call void @llvm.memcpy.i32( i8* bitcast ([500 x i32]* @from to i8*), i8* bitcast ([500 x i32]* @to to i8*), i32 500, i32 0 ) + call void @llvm.memcpy.p0i8.p0i8.i32(i8* bitcast ([500 x i32]* @from to i8*), i8* bitcast ([500 x i32]* @to to i8*), i32 500, i32 0, i1 false) ; EABI memset swaps arguments ; CHECK: mov r1, #0 ; CHECK: memset ; EABI: mov r2, #0 ; EABI: __aeabi_memset - call void @llvm.memset.i32( i8* bitcast ([500 x i32]* @from to i8*), i8 0, i32 500, i32 0 ) + call void @llvm.memset.p0i8.i32(i8* bitcast ([500 x i32]* @from to i8*), i8 0, i32 500, i32 0, i1 false) unreachable } -declare void @llvm.memmove.i32(i8*, i8*, i32, i32) - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - -declare void @llvm.memset.i32(i8*, i8, i32, i32) - +declare void @llvm.memmove.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind +declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind diff --git a/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll b/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll deleted file mode 100644 index 733202c8a96..00000000000 --- a/test/CodeGen/Generic/2005-07-12-memcpy-i64-length.ll +++ /dev/null @@ -1,11 +0,0 @@ -; RUN: llc < %s -; Test that llvm.memcpy works with a i64 length operand on all targets. - -declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) - -define void @l12_l94_bc_divide_endif_2E_3_2E_ce() { -newFuncRoot: - tail call void @llvm.memcpy.i64( i8* null, i8* null, i64 0, i32 1 ) - unreachable -} - diff --git a/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll b/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll deleted file mode 100644 index 3090857d964..00000000000 --- a/test/CodeGen/Generic/2007-11-21-UndeadIllegalNode.ll +++ /dev/null @@ -1,157 +0,0 @@ -; RUN: llc < %s -o - - - %struct.RETURN = type { i32, i32 } - %struct.ada__finalization__controlled = type { %struct.system__finalization_root__root_controlled } - %struct.ada__streams__root_stream_type = type { %struct.ada__tags__dispatch_table* } - %struct.ada__strings__unbounded__string_access = type { i8*, %struct.RETURN* } - %struct.ada__strings__unbounded__unbounded_string = type { %struct.ada__finalization__controlled, %struct.ada__strings__unbounded__string_access, i32 } - %struct.ada__tags__dispatch_table = type { [1 x i32] } - %struct.exception = type { i8, i8, i32, i8*, i8*, i32, i8* } - %struct.system__finalization_root__root_controlled = type { %struct.ada__streams__root_stream_type, %struct.system__finalization_root__root_controlled*, %struct.system__finalization_root__root_controlled* } - %struct.system__standard_library__exception_data = type { i8, i8, i32, i32, %struct.system__standard_library__exception_data*, i32, void ()* } -@C.495.7639 = internal constant %struct.RETURN { i32 1, i32 16 } ; <%struct.RETURN*> [#uses=1] -@ada__strings__index_error = external global %struct.exception ; <%struct.exception*> [#uses=1] -@.str5 = internal constant [16 x i8] c"a-strunb.adb:690" ; <[16 x i8]*> [#uses=1] - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - -declare void @ada__strings__unbounded__realloc_for_chunk(%struct.ada__strings__unbounded__unbounded_string*, i32) - -declare void @__gnat_raise_exception(%struct.system__standard_library__exception_data*, i64) - -define void @ada__strings__unbounded__insert__2(%struct.ada__strings__unbounded__unbounded_string* %source, i32 %before, i64 %new_item.0.0) { -entry: - %tmp24636 = lshr i64 %new_item.0.0, 32 ; [#uses=1] - %tmp24637 = trunc i64 %tmp24636 to i32 ; [#uses=1] - %tmp24638 = inttoptr i32 %tmp24637 to %struct.RETURN* ; <%struct.RETURN*> [#uses=2] - %tmp25 = getelementptr %struct.RETURN* %tmp24638, i32 0, i32 0 ; [#uses=1] - %tmp26 = load i32* %tmp25, align 4 ; [#uses=1] - %tmp29 = getelementptr %struct.RETURN* %tmp24638, i32 0, i32 1 ; [#uses=1] - %tmp30 = load i32* %tmp29, align 4 ; [#uses=1] - %tmp63 = getelementptr %struct.ada__strings__unbounded__unbounded_string* %source, i32 0, i32 1, i32 1 ; <%struct.RETURN**> [#uses=5] - %tmp64 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1] - %tmp65 = getelementptr %struct.RETURN* %tmp64, i32 0, i32 0 ; [#uses=1] - %tmp66 = load i32* %tmp65, align 4 ; [#uses=1] - %tmp67 = icmp sgt i32 %tmp66, %before ; [#uses=1] - br i1 %tmp67, label %bb77, label %bb - -bb: ; preds = %entry - %tmp71 = getelementptr %struct.ada__strings__unbounded__unbounded_string* %source, i32 0, i32 2 ; [#uses=4] - %tmp72 = load i32* %tmp71, align 4 ; [#uses=1] - %tmp73 = add i32 %tmp72, 1 ; [#uses=1] - %tmp74 = icmp slt i32 %tmp73, %before ; [#uses=1] - br i1 %tmp74, label %bb77, label %bb84 - -bb77: ; preds = %bb, %entry - tail call void @__gnat_raise_exception( %struct.system__standard_library__exception_data* bitcast (%struct.exception* @ada__strings__index_error to %struct.system__standard_library__exception_data*), i64 or (i64 zext (i32 ptrtoint ([16 x i8]* @.str5 to i32) to i64), i64 shl (i64 zext (i32 ptrtoint (%struct.RETURN* @C.495.7639 to i32) to i64), i64 32)) ) - unreachable - -bb84: ; preds = %bb - %tmp93 = sub i32 %tmp30, %tmp26 ; [#uses=2] - %tmp9394 = sext i32 %tmp93 to i36 ; [#uses=1] - %tmp95 = shl i36 %tmp9394, 3 ; [#uses=1] - %tmp96 = add i36 %tmp95, 8 ; [#uses=2] - %tmp97 = icmp sgt i36 %tmp96, -1 ; [#uses=1] - %tmp100 = select i1 %tmp97, i36 %tmp96, i36 0 ; [#uses=2] - %tmp101 = icmp slt i36 %tmp100, 17179869177 ; [#uses=1] - %tmp100.cast = trunc i36 %tmp100 to i32 ; [#uses=1] - %min102 = select i1 %tmp101, i32 %tmp100.cast, i32 -8 ; [#uses=1] - tail call void @ada__strings__unbounded__realloc_for_chunk( %struct.ada__strings__unbounded__unbounded_string* %source, i32 %min102 ) - %tmp148 = load i32* %tmp71, align 4 ; [#uses=4] - %tmp152 = add i32 %tmp93, 1 ; [#uses=2] - %tmp153 = icmp sgt i32 %tmp152, -1 ; [#uses=1] - %max154 = select i1 %tmp153, i32 %tmp152, i32 0 ; [#uses=5] - %tmp155 = add i32 %tmp148, %max154 ; [#uses=5] - %tmp315 = getelementptr %struct.ada__strings__unbounded__unbounded_string* %source, i32 0, i32 1, i32 0 ; [#uses=4] - %tmp328 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1] - %tmp329 = getelementptr %struct.RETURN* %tmp328, i32 0, i32 0 ; [#uses=1] - %tmp330 = load i32* %tmp329, align 4 ; [#uses=4] - %tmp324 = add i32 %max154, %before ; [#uses=3] - %tmp331 = sub i32 %tmp324, %tmp330 ; [#uses=1] - %tmp349 = sub i32 %before, %tmp330 ; [#uses=1] - %tmp356 = icmp sgt i32 %tmp331, %tmp349 ; [#uses=1] - %tmp431 = icmp sgt i32 %tmp324, %tmp155 ; [#uses=2] - br i1 %tmp356, label %bb420, label %bb359 - -bb359: ; preds = %bb84 - br i1 %tmp431, label %bb481, label %bb382 - -bb382: ; preds = %bb382, %bb359 - %indvar = phi i32 [ 0, %bb359 ], [ %indvar.next, %bb382 ] ; [#uses=2] - %max379.pn = phi i32 [ %max154, %bb359 ], [ %L492b.0, %bb382 ] ; [#uses=1] - %before.pn = phi i32 [ %before, %bb359 ], [ 1, %bb382 ] ; [#uses=1] - %L492b.0 = add i32 %before.pn, %max379.pn ; [#uses=3] - %tmp386 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1] - %tmp387 = getelementptr %struct.RETURN* %tmp386, i32 0, i32 0 ; [#uses=1] - %tmp388 = load i32* %tmp387, align 4 ; [#uses=2] - %tmp392 = load i8** %tmp315, align 4 ; [#uses=2] - %R493b.0 = add i32 %indvar, %before ; [#uses=1] - %tmp405 = sub i32 %R493b.0, %tmp388 ; [#uses=1] - %tmp406 = getelementptr i8* %tmp392, i32 %tmp405 ; [#uses=1] - %tmp407 = load i8* %tmp406, align 1 ; [#uses=1] - %tmp408 = sub i32 %L492b.0, %tmp388 ; [#uses=1] - %tmp409 = getelementptr i8* %tmp392, i32 %tmp408 ; [#uses=1] - store i8 %tmp407, i8* %tmp409, align 1 - %tmp414 = icmp eq i32 %L492b.0, %tmp155 ; [#uses=1] - %indvar.next = add i32 %indvar, 1 ; [#uses=1] - br i1 %tmp414, label %bb481, label %bb382 - -bb420: ; preds = %bb84 - br i1 %tmp431, label %bb481, label %bb436.preheader - -bb436.preheader: ; preds = %bb420 - %tmp4468 = load i8** %tmp315, align 4 ; [#uses=2] - %tmp4599 = sub i32 %tmp148, %tmp330 ; [#uses=1] - %tmp46010 = getelementptr i8* %tmp4468, i32 %tmp4599 ; [#uses=1] - %tmp46111 = load i8* %tmp46010, align 1 ; [#uses=1] - %tmp46212 = sub i32 %tmp155, %tmp330 ; [#uses=1] - %tmp46313 = getelementptr i8* %tmp4468, i32 %tmp46212 ; [#uses=1] - store i8 %tmp46111, i8* %tmp46313, align 1 - %exitcond14 = icmp eq i32 %tmp155, %tmp324 ; [#uses=1] - br i1 %exitcond14, label %bb481, label %bb.nph - -bb.nph: ; preds = %bb436.preheader - %tmp5 = sub i32 %tmp148, %before ; [#uses=1] - br label %bb478 - -bb478: ; preds = %bb478, %bb.nph - %indvar6422 = phi i32 [ 0, %bb.nph ], [ %indvar.next643, %bb478 ] ; [#uses=1] - %indvar.next643 = add i32 %indvar6422, 1 ; [#uses=4] - %L490b.0 = sub i32 %tmp155, %indvar.next643 ; [#uses=1] - %R491b.0 = sub i32 %tmp148, %indvar.next643 ; [#uses=1] - %tmp440 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1] - %tmp441 = getelementptr %struct.RETURN* %tmp440, i32 0, i32 0 ; [#uses=1] - %tmp442 = load i32* %tmp441, align 4 ; [#uses=2] - %tmp446 = load i8** %tmp315, align 4 ; [#uses=2] - %tmp459 = sub i32 %R491b.0, %tmp442 ; [#uses=1] - %tmp460 = getelementptr i8* %tmp446, i32 %tmp459 ; [#uses=1] - %tmp461 = load i8* %tmp460, align 1 ; [#uses=1] - %tmp462 = sub i32 %L490b.0, %tmp442 ; [#uses=1] - %tmp463 = getelementptr i8* %tmp446, i32 %tmp462 ; [#uses=1] - store i8 %tmp461, i8* %tmp463, align 1 - %exitcond = icmp eq i32 %indvar.next643, %tmp5 ; [#uses=1] - br i1 %exitcond, label %bb481, label %bb478 - -bb481: ; preds = %bb478, %bb436.preheader, %bb420, %bb382, %bb359 - %tmp577 = add i32 %before, -1 ; [#uses=3] - %tmp578 = add i32 %max154, %tmp577 ; [#uses=2] - %tmp581 = icmp sge i32 %tmp578, %tmp577 ; [#uses=1] - %max582 = select i1 %tmp581, i32 %tmp578, i32 %tmp577 ; [#uses=1] - %tmp584 = sub i32 %max582, %before ; [#uses=1] - %tmp585 = add i32 %tmp584, 1 ; [#uses=2] - %tmp586 = icmp sgt i32 %tmp585, -1 ; [#uses=1] - %max587 = select i1 %tmp586, i32 %tmp585, i32 0 ; [#uses=1] - %tmp591 = load %struct.RETURN** %tmp63, align 4 ; <%struct.RETURN*> [#uses=1] - %tmp592 = getelementptr %struct.RETURN* %tmp591, i32 0, i32 0 ; [#uses=1] - %tmp593 = load i32* %tmp592, align 4 ; [#uses=1] - %tmp597 = load i8** %tmp315, align 4 ; [#uses=1] - %tmp600621 = trunc i64 %new_item.0.0 to i32 ; [#uses=1] - %tmp600622 = inttoptr i32 %tmp600621 to i8* ; [#uses=1] - %tmp601 = sub i32 %before, %tmp593 ; [#uses=1] - %tmp602 = getelementptr i8* %tmp597, i32 %tmp601 ; [#uses=1] - tail call void @llvm.memcpy.i32( i8* %tmp602, i8* %tmp600622, i32 %max587, i32 1 ) - %tmp606 = load i32* %tmp71, align 4 ; [#uses=1] - %tmp613 = add i32 %tmp606, %max154 ; [#uses=1] - store i32 %tmp613, i32* %tmp71, align 4 - ret void -} diff --git a/test/CodeGen/Generic/invalid-memcpy.ll b/test/CodeGen/Generic/invalid-memcpy.ll index 8448565a2b8..2dfa28bac48 100644 --- a/test/CodeGen/Generic/invalid-memcpy.ll +++ b/test/CodeGen/Generic/invalid-memcpy.ll @@ -4,16 +4,14 @@ ; greater than the alignment guaranteed for Qux or C.0.1173), but it ; should compile, not crash the code generator. -@C.0.1173 = external constant [33 x i8] ; <[33 x i8]*> [#uses=1] +@C.0.1173 = external constant [33 x i8] define void @Bork() { entry: - %Qux = alloca [33 x i8] ; <[33 x i8]*> [#uses=1] - %Qux1 = bitcast [33 x i8]* %Qux to i8* ; [#uses=1] - call void @llvm.memcpy.i64( i8* %Qux1, i8* getelementptr ([33 x i8]* @C.0.1173, i32 0, i32 0), i64 33, i32 8 ) - ret void + %Qux = alloca [33 x i8] + %Qux1 = bitcast [33 x i8]* %Qux to i8* + call void @llvm.memcpy.p0i8.p0i8.i64(i8* %Qux1, i8* getelementptr inbounds ([33 x i8]* @C.0.1173, i32 0, i32 0), i64 33, i32 8, i1 false) + ret void } -declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) - - +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind diff --git a/test/CodeGen/PowerPC/2008-10-30-IllegalShift.ll b/test/CodeGen/PowerPC/2008-10-30-IllegalShift.ll deleted file mode 100644 index 83f3f6f8a76..00000000000 --- a/test/CodeGen/PowerPC/2008-10-30-IllegalShift.ll +++ /dev/null @@ -1,14 +0,0 @@ -; RUN: llc < %s -march=ppc32 -; PR2986 -@argc = external global i32 ; [#uses=1] -@buffer = external global [32 x i8], align 4 ; <[32 x i8]*> [#uses=1] - -define void @test1() nounwind noinline { -entry: - %0 = load i32* @argc, align 4 ; [#uses=1] - %1 = trunc i32 %0 to i8 ; [#uses=1] - tail call void @llvm.memset.i32(i8* getelementptr ([32 x i8]* @buffer, i32 0, i32 0), i8 %1, i32 17, i32 4) - unreachable -} - -declare void @llvm.memset.i32(i8*, i8, i32, i32) nounwind diff --git a/test/CodeGen/PowerPC/2009-11-15-ReMatBug.ll b/test/CodeGen/PowerPC/2009-11-15-ReMatBug.ll deleted file mode 100644 index 54f4b2ef689..00000000000 --- a/test/CodeGen/PowerPC/2009-11-15-ReMatBug.ll +++ /dev/null @@ -1,155 +0,0 @@ -; RUN: llc < %s -mtriple=powerpc-apple-darwin8 - -%struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 } -%struct.__gcov_var = type { %struct.FILE*, i32, i32, i32, i32, i32, i32, [1025 x i32] } -%struct.__sFILEX = type opaque -%struct.__sbuf = type { i8*, i32 } -%struct.gcov_ctr_info = type { i32, i64*, void (i64*, i32)* } -%struct.gcov_ctr_summary = type { i32, i32, i64, i64, i64 } -%struct.gcov_fn_info = type { i32, i32, [0 x i32] } -%struct.gcov_info = type { i32, %struct.gcov_info*, i32, i8*, i32, %struct.gcov_fn_info*, i32, [0 x %struct.gcov_ctr_info] } -%struct.gcov_summary = type { i32, [1 x %struct.gcov_ctr_summary] } - -@__gcov_var = external global %struct.__gcov_var ; <%struct.__gcov_var*> [#uses=1] -@__sF = external global [0 x %struct.FILE] ; <[0 x %struct.FILE]*> [#uses=1] -@.str = external constant [56 x i8], align 4 ; <[56 x i8]*> [#uses=1] -@gcov_list = external global %struct.gcov_info* ; <%struct.gcov_info**> [#uses=1] -@.str7 = external constant [35 x i8], align 4 ; <[35 x i8]*> [#uses=1] -@.str8 = external constant [9 x i8], align 4 ; <[9 x i8]*> [#uses=1] -@.str9 = external constant [10 x i8], align 4 ; <[10 x i8]*> [#uses=1] -@.str10 = external constant [36 x i8], align 4 ; <[36 x i8]*> [#uses=1] - -declare i32 @"\01_fprintf$LDBL128"(%struct.FILE*, i8*, ...) nounwind - -define void @gcov_exit() nounwind { -entry: - %gi_ptr.0357 = load %struct.gcov_info** @gcov_list, align 4 ; <%struct.gcov_info*> [#uses=1] - %0 = alloca i8, i32 undef, align 1 ; [#uses=3] - br i1 undef, label %return, label %bb.nph341 - -bb.nph341: ; preds = %entry - %object27 = bitcast %struct.gcov_summary* undef to i8* ; [#uses=1] - br label %bb25 - -bb25: ; preds = %read_fatal, %bb.nph341 - %gi_ptr.1329 = phi %struct.gcov_info* [ %gi_ptr.0357, %bb.nph341 ], [ undef, %read_fatal ] ; <%struct.gcov_info*> [#uses=1] - call void @llvm.memset.i32(i8* %object27, i8 0, i32 36, i32 8) - br i1 undef, label %bb49.1, label %bb48 - -bb48: ; preds = %bb25 - br label %bb49.1 - -bb51: ; preds = %bb48.4, %bb49.3 - switch i32 undef, label %bb58 [ - i32 0, label %rewrite - i32 1734567009, label %bb59 - ] - -bb58: ; preds = %bb51 - %1 = call i32 (%struct.FILE*, i8*, ...)* @"\01_fprintf$LDBL128"(%struct.FILE* getelementptr inbounds ([0 x %struct.FILE]* @__sF, i32 0, i32 2), i8* getelementptr inbounds ([35 x i8]* @.str7, i32 0, i32 0), i8* %0) nounwind ; [#uses=0] - br label %read_fatal - -bb59: ; preds = %bb51 - br i1 undef, label %bb60, label %bb3.i156 - -bb3.i156: ; preds = %bb59 - store i8 52, i8* undef, align 1 - store i8 42, i8* undef, align 1 - %2 = call i32 (%struct.FILE*, i8*, ...)* @"\01_fprintf$LDBL128"(%struct.FILE* getelementptr inbounds ([0 x %struct.FILE]* @__sF, i32 0, i32 2), i8* getelementptr inbounds ([56 x i8]* @.str, i32 0, i32 0), i8* %0, i8* undef, i8* undef) nounwind ; [#uses=0] - br label %read_fatal - -bb60: ; preds = %bb59 - br i1 undef, label %bb78.preheader, label %rewrite - -bb78.preheader: ; preds = %bb60 - br i1 undef, label %bb62, label %bb80 - -bb62: ; preds = %bb78.preheader - br i1 undef, label %bb64, label %read_mismatch - -bb64: ; preds = %bb62 - br i1 undef, label %bb65, label %read_mismatch - -bb65: ; preds = %bb64 - br i1 undef, label %bb75, label %read_mismatch - -read_mismatch: ; preds = %bb98, %bb119.preheader, %bb72, %bb71, %bb65, %bb64, %bb62 - %3 = icmp eq i32 undef, -1 ; [#uses=1] - %iftmp.11.0 = select i1 %3, i8* getelementptr inbounds ([10 x i8]* @.str9, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8]* @.str8, i32 0, i32 0) ; [#uses=1] - %4 = call i32 (%struct.FILE*, i8*, ...)* @"\01_fprintf$LDBL128"(%struct.FILE* getelementptr inbounds ([0 x %struct.FILE]* @__sF, i32 0, i32 2), i8* getelementptr inbounds ([36 x i8]* @.str10, i32 0, i32 0), i8* %0, i8* %iftmp.11.0) nounwind ; [#uses=0] - br label %read_fatal - -bb71: ; preds = %bb75 - %5 = load i32* undef, align 4 ; [#uses=1] - %6 = getelementptr inbounds %struct.gcov_info* %gi_ptr.1329, i32 0, i32 7, i32 undef, i32 2 ; [#uses=1] - %7 = load void (i64*, i32)** %6, align 4 ; [#uses=1] - %8 = call i32 @__gcov_read_unsigned() nounwind ; [#uses=1] - %9 = call i32 @__gcov_read_unsigned() nounwind ; [#uses=1] - %10 = icmp eq i32 %tmp386, %8 ; [#uses=1] - br i1 %10, label %bb72, label %read_mismatch - -bb72: ; preds = %bb71 - %11 = icmp eq i32 undef, %9 ; [#uses=1] - br i1 %11, label %bb73, label %read_mismatch - -bb73: ; preds = %bb72 - call void %7(i64* null, i32 %5) nounwind - unreachable - -bb74: ; preds = %bb75 - %12 = add i32 %13, 1 ; [#uses=1] - br label %bb75 - -bb75: ; preds = %bb74, %bb65 - %13 = phi i32 [ %12, %bb74 ], [ 0, %bb65 ] ; [#uses=2] - %tmp386 = add i32 0, 27328512 ; [#uses=1] - %14 = shl i32 1, %13 ; [#uses=1] - %15 = load i32* undef, align 4 ; [#uses=1] - %16 = and i32 %15, %14 ; [#uses=1] - %17 = icmp eq i32 %16, 0 ; [#uses=1] - br i1 %17, label %bb74, label %bb71 - -bb80: ; preds = %bb78.preheader - unreachable - -read_fatal: ; preds = %read_mismatch, %bb3.i156, %bb58 - br i1 undef, label %return, label %bb25 - -rewrite: ; preds = %bb60, %bb51 - store i32 -1, i32* getelementptr inbounds (%struct.__gcov_var* @__gcov_var, i32 0, i32 6), align 4 - br i1 undef, label %bb94, label %bb119.preheader - -bb94: ; preds = %rewrite - unreachable - -bb119.preheader: ; preds = %rewrite - br i1 undef, label %read_mismatch, label %bb98 - -bb98: ; preds = %bb119.preheader - br label %read_mismatch - -return: ; preds = %read_fatal, %entry - ret void - -bb49.1: ; preds = %bb48, %bb25 - br i1 undef, label %bb49.2, label %bb48.2 - -bb49.2: ; preds = %bb48.2, %bb49.1 - br i1 undef, label %bb49.3, label %bb48.3 - -bb48.2: ; preds = %bb49.1 - br label %bb49.2 - -bb49.3: ; preds = %bb48.3, %bb49.2 - br i1 undef, label %bb51, label %bb48.4 - -bb48.3: ; preds = %bb49.2 - br label %bb49.3 - -bb48.4: ; preds = %bb49.3 - br label %bb51 -} - -declare i32 @__gcov_read_unsigned() nounwind - -declare void @llvm.memset.i32(i8* nocapture, i8, i32, i32) nounwind diff --git a/test/CodeGen/PowerPC/atomic-1.ll b/test/CodeGen/PowerPC/atomic-1.ll index ec4e42defdc..a2cf1709e75 100644 --- a/test/CodeGen/PowerPC/atomic-1.ll +++ b/test/CodeGen/PowerPC/atomic-1.ll @@ -1,21 +1,23 @@ ; RUN: llc < %s -march=ppc32 | grep lwarx | count 3 ; RUN: llc < %s -march=ppc32 | grep stwcx. | count 4 -define i32 @exchange_and_add(i32* %mem, i32 %val) nounwind { - %tmp = call i32 @llvm.atomic.load.add.i32( i32* %mem, i32 %val ) - ret i32 %tmp +define i32 @exchange_and_add(i32* %mem, i32 %val) nounwind { + %tmp = call i32 @llvm.atomic.load.add.i32.p0i32(i32* %mem, i32 %val) + ret i32 %tmp } -define i32 @exchange_and_cmp(i32* %mem) nounwind { - %tmp = call i32 @llvm.atomic.cmp.swap.i32( i32* %mem, i32 0, i32 1 ) - ret i32 %tmp +define i32 @exchange_and_cmp(i32* %mem) nounwind { + %tmp = call i32 @llvm.atomic.cmp.swap.i32.p0i32(i32* %mem, i32 0, i32 1) + ret i32 %tmp } -define i32 @exchange(i32* %mem, i32 %val) nounwind { - %tmp = call i32 @llvm.atomic.swap.i32( i32* %mem, i32 1 ) - ret i32 %tmp +define i32 @exchange(i32* %mem, i32 %val) nounwind { + %tmp = call i32 @llvm.atomic.swap.i32.p0i32(i32* %mem, i32 1) + ret i32 %tmp } -declare i32 @llvm.atomic.load.add.i32(i32*, i32) nounwind -declare i32 @llvm.atomic.cmp.swap.i32(i32*, i32, i32) nounwind -declare i32 @llvm.atomic.swap.i32(i32*, i32) nounwind +declare i32 @llvm.atomic.load.add.i32.p0i32(i32* nocapture, i32) nounwind + +declare i32 @llvm.atomic.cmp.swap.i32.p0i32(i32* nocapture, i32, i32) nounwind + +declare i32 @llvm.atomic.swap.i32.p0i32(i32* nocapture, i32) nounwind diff --git a/test/CodeGen/PowerPC/atomic-2.ll b/test/CodeGen/PowerPC/atomic-2.ll index 6d9daef9285..0fa2a29d322 100644 --- a/test/CodeGen/PowerPC/atomic-2.ll +++ b/test/CodeGen/PowerPC/atomic-2.ll @@ -1,21 +1,23 @@ ; RUN: llc < %s -march=ppc64 | grep ldarx | count 3 ; RUN: llc < %s -march=ppc64 | grep stdcx. | count 4 -define i64 @exchange_and_add(i64* %mem, i64 %val) nounwind { - %tmp = call i64 @llvm.atomic.load.add.i64( i64* %mem, i64 %val ) - ret i64 %tmp +define i64 @exchange_and_add(i64* %mem, i64 %val) nounwind { + %tmp = call i64 @llvm.atomic.load.add.i64.p0i64(i64* %mem, i64 %val) + ret i64 %tmp } -define i64 @exchange_and_cmp(i64* %mem) nounwind { - %tmp = call i64 @llvm.atomic.cmp.swap.i64( i64* %mem, i64 0, i64 1 ) - ret i64 %tmp +define i64 @exchange_and_cmp(i64* %mem) nounwind { + %tmp = call i64 @llvm.atomic.cmp.swap.i64.p0i64(i64* %mem, i64 0, i64 1) + ret i64 %tmp } -define i64 @exchange(i64* %mem, i64 %val) nounwind { - %tmp = call i64 @llvm.atomic.swap.i64( i64* %mem, i64 1 ) - ret i64 %tmp +define i64 @exchange(i64* %mem, i64 %val) nounwind { + %tmp = call i64 @llvm.atomic.swap.i64.p0i64(i64* %mem, i64 1) + ret i64 %tmp } -declare i64 @llvm.atomic.load.add.i64(i64*, i64) nounwind -declare i64 @llvm.atomic.cmp.swap.i64(i64*, i64, i64) nounwind -declare i64 @llvm.atomic.swap.i64(i64*, i64) nounwind +declare i64 @llvm.atomic.load.add.i64.p0i64(i64* nocapture, i64) nounwind + +declare i64 @llvm.atomic.cmp.swap.i64.p0i64(i64* nocapture, i64, i64) nounwind + +declare i64 @llvm.atomic.swap.i64.p0i64(i64* nocapture, i64) nounwind diff --git a/test/CodeGen/PowerPC/invalid-memcpy.ll b/test/CodeGen/PowerPC/invalid-memcpy.ll deleted file mode 100644 index 3b1f3060a1c..00000000000 --- a/test/CodeGen/PowerPC/invalid-memcpy.ll +++ /dev/null @@ -1,20 +0,0 @@ -; RUN: llc < %s -march=ppc32 -; RUN: llc < %s -march=ppc64 - -; This testcase is invalid (the alignment specified for memcpy is -; greater than the alignment guaranteed for Qux or C.0.1173, but it -; should compile, not crash the code generator. - -@C.0.1173 = external constant [33 x i8] ; <[33 x i8]*> [#uses=1] - -define void @Bork() { -entry: - %Qux = alloca [33 x i8] ; <[33 x i8]*> [#uses=1] - %Qux1 = bitcast [33 x i8]* %Qux to i8* ; [#uses=1] - call void @llvm.memcpy.i64( i8* %Qux1, i8* getelementptr ([33 x i8]* @C.0.1173, i32 0, i32 0), i64 33, i32 8 ) - ret void -} - -declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) - - diff --git a/test/CodeGen/Thumb/dyn-stackalloc.ll b/test/CodeGen/Thumb/dyn-stackalloc.ll index cd35be69f5c..f3f08347ae6 100644 --- a/test/CodeGen/Thumb/dyn-stackalloc.ll +++ b/test/CodeGen/Thumb/dyn-stackalloc.ll @@ -60,7 +60,7 @@ define void @t2(%struct.comment* %vc, i8* %tag, i8* %contents) { %tmp9 = call i8* @strcpy( i8* %tmp6, i8* %tag ) %tmp6.len = call i32 @strlen( i8* %tmp6 ) %tmp6.indexed = getelementptr i8* %tmp6, i32 %tmp6.len - call void @llvm.memcpy.i32( i8* %tmp6.indexed, i8* getelementptr ([2 x i8]* @str215, i32 0, i32 0), i32 2, i32 1 ) + call void @llvm.memcpy.p0i8.p0i8.i32(i8* %tmp6.indexed, i8* getelementptr inbounds ([2 x i8]* @str215, i32 0, i32 0), i32 2, i32 1, i1 false) %tmp15 = call i8* @strcat( i8* %tmp6, i8* %contents ) call fastcc void @comment_add( %struct.comment* %vc, i8* %tmp6 ) ret void @@ -72,6 +72,6 @@ declare i8* @strcat(i8*, i8*) declare fastcc void @comment_add(%struct.comment*, i8*) -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind declare i8* @strcpy(i8*, i8*) diff --git a/test/CodeGen/Thumb2/2009-08-04-SubregLoweringBug.ll b/test/CodeGen/Thumb2/2009-08-04-SubregLoweringBug.ll index bfea003fb46..779e100d419 100644 --- a/test/CodeGen/Thumb2/2009-08-04-SubregLoweringBug.ll +++ b/test/CodeGen/Thumb2/2009-08-04-SubregLoweringBug.ll @@ -1,4 +1,3 @@ -; RUN: llc < %s -mtriple=thumbv7-apple-darwin9 -mcpu=cortex-a8 ; RUN: llc < %s -mtriple=thumbv7-apple-darwin9 -mcpu=cortex-a8 | not grep fcpys ; rdar://7117307 @@ -13,7 +12,7 @@ entry: br i1 undef, label %bb, label %bb6.preheader bb6.preheader: ; preds = %entry - call void @llvm.memcpy.i32(i8* undef, i8* undef, i32 12, i32 4) + call void @llvm.memcpy.p0i8.p0i8.i32(i8* undef, i8* undef, i32 12, i32 4, i1 false) br i1 undef, label %bb15, label %bb13 bb: ; preds = %entry @@ -31,4 +30,4 @@ bb15: ; preds = %bb13, %bb6.preheader ret void } -declare void @llvm.memcpy.i32(i8* nocapture, i8* nocapture, i32, i32) nounwind +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture, i32, i32, i1) nounwind diff --git a/test/CodeGen/X86/2004-02-12-Memcpy.ll b/test/CodeGen/X86/2004-02-12-Memcpy.ll deleted file mode 100644 index f15a1b44181..00000000000 --- a/test/CodeGen/X86/2004-02-12-Memcpy.ll +++ /dev/null @@ -1,25 +0,0 @@ -; RUN: llc < %s -march=x86 -mtriple=i686-pc-linux-gnu | grep movs | count 1 - -@A = global [32 x i32] zeroinitializer -@B = global [32 x i32] zeroinitializer - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - -define void @main() nounwind { - ; dword copy - call void @llvm.memcpy.i32(i8* bitcast ([32 x i32]* @A to i8*), - i8* bitcast ([32 x i32]* @B to i8*), - i32 128, i32 4 ) - - ; word copy - call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*), - i8* bitcast ([32 x i32]* @B to i8*), - i32 128, i32 2 ) - - ; byte copy - call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*), - i8* bitcast ([32 x i32]* @B to i8*), - i32 128, i32 1 ) - - ret void -} diff --git a/test/CodeGen/X86/2006-11-28-Memcpy.ll b/test/CodeGen/X86/2006-11-28-Memcpy.ll deleted file mode 100644 index 8c1573f130b..00000000000 --- a/test/CodeGen/X86/2006-11-28-Memcpy.ll +++ /dev/null @@ -1,34 +0,0 @@ -; PR1022, PR1023 -; RUN: llc < %s -march=x86 | grep -- -573785174 | count 2 -; RUN: llc < %s -march=x86 | grep -E {movl _?bytes2} | count 1 - -@fmt = constant [4 x i8] c"%x\0A\00" ; <[4 x i8]*> [#uses=2] -@bytes = constant [4 x i8] c"\AA\BB\CC\DD" ; <[4 x i8]*> [#uses=1] -@bytes2 = global [4 x i8] c"\AA\BB\CC\DD" ; <[4 x i8]*> [#uses=1] - -define i32 @test1() nounwind { - %y = alloca i32 ; [#uses=2] - %c = bitcast i32* %y to i8* ; [#uses=1] - %z = getelementptr [4 x i8]* @bytes, i32 0, i32 0 ; [#uses=1] - call void @llvm.memcpy.i32( i8* %c, i8* %z, i32 4, i32 1 ) - %r = load i32* %y ; [#uses=1] - %t = bitcast [4 x i8]* @fmt to i8* ; [#uses=1] - %tmp = call i32 (i8*, ...)* @printf( i8* %t, i32 %r ) ; [#uses=0] - ret i32 0 -} - -define void @test2() nounwind { - %y = alloca i32 ; [#uses=2] - %c = bitcast i32* %y to i8* ; [#uses=1] - %z = getelementptr [4 x i8]* @bytes2, i32 0, i32 0 ; [#uses=1] - call void @llvm.memcpy.i32( i8* %c, i8* %z, i32 4, i32 1 ) - %r = load i32* %y ; [#uses=1] - %t = bitcast [4 x i8]* @fmt to i8* ; [#uses=1] - %tmp = call i32 (i8*, ...)* @printf( i8* %t, i32 %r ) ; [#uses=0] - ret void -} - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) - -declare i32 @printf(i8*, ...) - diff --git a/test/CodeGen/X86/2007-05-05-Personality.ll b/test/CodeGen/X86/2007-05-05-Personality.ll index 0f49d2e10cb..d1fc70d8367 100644 --- a/test/CodeGen/X86/2007-05-05-Personality.ll +++ b/test/CodeGen/X86/2007-05-05-Personality.ll @@ -3,35 +3,35 @@ ; CHECK: .cfi_personality 0, __gnat_eh_personality ; CHECK: .cfi_lsda 0, .Lexception0 -@error = external global i8 ; [#uses=2] +@error = external global i8 define void @_ada_x() { entry: - invoke void @raise( ) - to label %eh_then unwind label %unwind - -unwind: ; preds = %entry - %eh_ptr = tail call i8* @llvm.eh.exception( ) ; [#uses=2] - %eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i8* @error ) ; [#uses=1] - %eh_typeid = tail call i32 @llvm.eh.typeid.for.i32( i8* @error ) ; [#uses=1] - %tmp2 = icmp eq i32 %eh_select, %eh_typeid ; [#uses=1] - br i1 %tmp2, label %eh_then, label %Unwind - -eh_then: ; preds = %unwind, %entry - ret void - -Unwind: ; preds = %unwind - tail call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; :0 [#uses=0] - unreachable + invoke void @raise() + to label %eh_then unwind label %unwind + +unwind: ; preds = %entry + %eh_ptr = tail call i8* @llvm.eh.exception() + %eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector(i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i8* @error) + %eh_typeid = tail call i32 @llvm.eh.typeid.for(i8* @error) + %tmp2 = icmp eq i32 %eh_select, %eh_typeid + br i1 %tmp2, label %eh_then, label %Unwind + +eh_then: ; preds = %unwind, %entry + ret void + +Unwind: ; preds = %unwind + %0 = tail call i32 (...)* @_Unwind_Resume(i8* %eh_ptr) + unreachable } declare void @raise() -declare i8* @llvm.eh.exception() +declare i8* @llvm.eh.exception() nounwind readonly -declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) +declare i32 @llvm.eh.selector(i8*, i8*, ...) nounwind -declare i32 @llvm.eh.typeid.for.i32(i8*) +declare i32 @llvm.eh.typeid.for(i8*) nounwind declare i32 @__gnat_eh_personality(...) diff --git a/test/CodeGen/X86/2007-06-05-LSR-Dominator.ll b/test/CodeGen/X86/2007-06-05-LSR-Dominator.ll deleted file mode 100644 index 36a97ef9c3c..00000000000 --- a/test/CodeGen/X86/2007-06-05-LSR-Dominator.ll +++ /dev/null @@ -1,129 +0,0 @@ -; PR1495 -; RUN: llc < %s -march=x86 - -target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64" -target triple = "i686-pc-linux-gnu" - %struct.AVRational = type { i32, i32 } - %struct.FFTComplex = type { float, float } - %struct.FFTContext = type { i32, i32, i16*, %struct.FFTComplex*, %struct.FFTComplex*, void (%struct.FFTContext*, %struct.FFTComplex*)*, void (%struct.MDCTContext*, float*, float*, float*)* } - %struct.MDCTContext = type { i32, i32, float*, float*, %struct.FFTContext } - %struct.Minima = type { i32, i32, i32, i32 } - %struct.codebook_t = type { i32, i8*, i32*, i32, float, float, i32, i32, i32*, float*, float* } - %struct.floor_class_t = type { i32, i32, i32, i32* } - %struct.floor_t = type { i32, i32*, i32, %struct.floor_class_t*, i32, i32, i32, %struct.Minima* } - %struct.mapping_t = type { i32, i32*, i32*, i32*, i32, i32*, i32* } - %struct.residue_t = type { i32, i32, i32, i32, i32, i32, [8 x i8]*, [2 x float]* } - %struct.venc_context_t = type { i32, i32, [2 x i32], [2 x %struct.MDCTContext], [2 x float*], i32, float*, float*, float*, float*, float, i32, %struct.codebook_t*, i32, %struct.floor_t*, i32, %struct.residue_t*, i32, %struct.mapping_t*, i32, %struct.AVRational* } - -define fastcc i32 @put_main_header(%struct.venc_context_t* %venc, i8** %out) { -entry: - br i1 false, label %bb1820, label %bb288.bb148_crit_edge - -bb288.bb148_crit_edge: ; preds = %entry - ret i32 0 - -cond_next1712: ; preds = %bb1820.bb1680_crit_edge - ret i32 0 - -bb1817: ; preds = %bb1820.bb1680_crit_edge - br label %bb1820 - -bb1820: ; preds = %bb1817, %entry - %pb.1.50 = phi i32 [ %tmp1693, %bb1817 ], [ 8, %entry ] ; [#uses=3] - br i1 false, label %bb2093, label %bb1820.bb1680_crit_edge - -bb1820.bb1680_crit_edge: ; preds = %bb1820 - %tmp1693 = add i32 %pb.1.50, 8 ; [#uses=2] - %tmp1702 = icmp slt i32 %tmp1693, 0 ; [#uses=1] - br i1 %tmp1702, label %cond_next1712, label %bb1817 - -bb2093: ; preds = %bb1820 - %tmp2102 = add i32 %pb.1.50, 65 ; [#uses=0] - %tmp2236 = add i32 %pb.1.50, 72 ; [#uses=1] - %tmp2237 = sdiv i32 %tmp2236, 8 ; [#uses=2] - br i1 false, label %bb2543, label %bb2536.bb2396_crit_edge - -bb2536.bb2396_crit_edge: ; preds = %bb2093 - ret i32 0 - -bb2543: ; preds = %bb2093 - br i1 false, label %cond_next2576, label %bb2690 - -cond_next2576: ; preds = %bb2543 - ret i32 0 - -bb2682: ; preds = %bb2690 - ret i32 0 - -bb2690: ; preds = %bb2543 - br i1 false, label %bb2682, label %bb2698 - -bb2698: ; preds = %bb2690 - br i1 false, label %cond_next2726, label %bb2831 - -cond_next2726: ; preds = %bb2698 - ret i32 0 - -bb2831: ; preds = %bb2698 - br i1 false, label %cond_next2859, label %bb2964 - -cond_next2859: ; preds = %bb2831 - br i1 false, label %bb2943, label %cond_true2866 - -cond_true2866: ; preds = %cond_next2859 - br i1 false, label %cond_true2874, label %cond_false2897 - -cond_true2874: ; preds = %cond_true2866 - ret i32 0 - -cond_false2897: ; preds = %cond_true2866 - ret i32 0 - -bb2943: ; preds = %cond_next2859 - ret i32 0 - -bb2964: ; preds = %bb2831 - br i1 false, label %cond_next2997, label %bb4589 - -cond_next2997: ; preds = %bb2964 - ret i32 0 - -bb3103: ; preds = %bb4589 - ret i32 0 - -bb4589: ; preds = %bb2964 - br i1 false, label %bb3103, label %bb4597 - -bb4597: ; preds = %bb4589 - br i1 false, label %cond_next4630, label %bb4744 - -cond_next4630: ; preds = %bb4597 - br i1 false, label %bb4744, label %cond_true4724 - -cond_true4724: ; preds = %cond_next4630 - br i1 false, label %bb4736, label %bb7531 - -bb4736: ; preds = %cond_true4724 - ret i32 0 - -bb4744: ; preds = %cond_next4630, %bb4597 - ret i32 0 - -bb7531: ; preds = %cond_true4724 - %v_addr.023.0.i6 = add i32 %tmp2237, -255 ; [#uses=1] - br label %bb.i14 - -bb.i14: ; preds = %bb.i14, %bb7531 - %n.021.0.i8 = phi i32 [ 0, %bb7531 ], [ %indvar.next, %bb.i14 ] ; [#uses=2] - %tmp..i9 = mul i32 %n.021.0.i8, -255 ; [#uses=1] - %tmp5.i11 = add i32 %v_addr.023.0.i6, %tmp..i9 ; [#uses=1] - %tmp10.i12 = icmp ugt i32 %tmp5.i11, 254 ; [#uses=1] - %indvar.next = add i32 %n.021.0.i8, 1 ; [#uses=1] - br i1 %tmp10.i12, label %bb.i14, label %bb12.loopexit.i18 - -bb12.loopexit.i18: ; preds = %bb.i14 - call void @llvm.memcpy.i32( i8* null, i8* null, i32 %tmp2237, i32 1 ) - ret i32 0 -} - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) diff --git a/test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll b/test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll deleted file mode 100644 index 236b7cd6121..00000000000 --- a/test/CodeGen/X86/2008-06-04-MemCpyLoweringBug.ll +++ /dev/null @@ -1,19 +0,0 @@ -; RUN: llc < %s -mtriple=i386-apple-darwin -mattr=+sse2 -disable-fp-elim | grep subl | grep 24 - - %struct.argument_t = type { i8*, %struct.argument_t*, i32, %struct.ipc_type_t*, i32, void (...)*, void (...)*, void (...)*, void (...)*, void (...)*, i8*, i8*, i8*, i8*, i8*, i32, i32, i32, %struct.routine*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, %struct.argument_t*, i32, i32, i32, i32, i32, i32 } - %struct.ipc_type_t = type { i8*, %struct.ipc_type_t*, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8*, i8*, i32, i32, i32, i32, i32, i32, %struct.ipc_type_t*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8* } - %struct.routine = type opaque -@"\01LC" = external constant [11 x i8] ; <[11 x i8]*> [#uses=1] - -define i8* @InArgMsgField(%struct.argument_t* %arg, i8* %str) nounwind { -entry: - %who = alloca [20 x i8] ; <[20 x i8]*> [#uses=1] - %who1 = getelementptr [20 x i8]* %who, i32 0, i32 0 ; [#uses=2] - call void @llvm.memset.i32( i8* %who1, i8 0, i32 20, i32 1 ) - call void @llvm.memcpy.i32( i8* %who1, i8* getelementptr ([11 x i8]* @"\01LC", i32 0, i32 0), i32 11, i32 1 ) - unreachable -} - -declare void @llvm.memset.i32(i8*, i8, i32, i32) nounwind - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind diff --git a/test/CodeGen/X86/2008-10-27-StackRealignment.ll b/test/CodeGen/X86/2008-10-27-StackRealignment.ll index 3d0766cde84..a57f7166cad 100644 --- a/test/CodeGen/X86/2008-10-27-StackRealignment.ll +++ b/test/CodeGen/X86/2008-10-27-StackRealignment.ll @@ -11,12 +11,12 @@ target triple = "i386-pc-linux-gnu" define void @foo(i32 %t) nounwind { %tmp1210 = alloca i8, i32 32, align 4 - call void @llvm.memset.i64(i8* %tmp1210, i8 0, i64 32, i32 4) - + call void @llvm.memset.p0i8.i64(i8* %tmp1210, i8 0, i64 32, i32 4, i1 false) %x = alloca i8, i32 %t call void @dummy(i8* %x) ret void } -declare void @dummy(i8* %x) -declare void @llvm.memset.i64(i8*, i8, i64, i32) nounwind +declare void @dummy(i8*) + +declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind diff --git a/test/CodeGen/X86/2009-01-25-NoSSE.ll b/test/CodeGen/X86/2009-01-25-NoSSE.ll index 0583ef19091..8406c4a2cc8 100644 --- a/test/CodeGen/X86/2009-01-25-NoSSE.ll +++ b/test/CodeGen/X86/2009-01-25-NoSSE.ll @@ -3,18 +3,18 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" target triple = "x86_64-unknown-linux-gnu" - %struct.ktermios = type { i32, i32, i32, i32, i8, [19 x i8], i32, i32 } + +%struct.ktermios = type { i32, i32, i32, i32, i8, [19 x i8], i32, i32 } define void @foo() nounwind { entry: - %termios = alloca %struct.ktermios, align 8 - %termios1 = bitcast %struct.ktermios* %termios to i8* - call void @llvm.memset.i64(i8* %termios1, i8 0, i64 44, i32 8) - call void @bar(%struct.ktermios* %termios) nounwind - ret void + %termios = alloca %struct.ktermios, align 8 + %termios1 = bitcast %struct.ktermios* %termios to i8* + call void @llvm.memset.p0i8.i64(i8* %termios1, i8 0, i64 44, i32 8, i1 false) + call void @bar(%struct.ktermios* %termios) nounwind + ret void } -declare void @llvm.memset.i64(i8* nocapture, i8, i64, i32) nounwind - declare void @bar(%struct.ktermios*) +declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind diff --git a/test/CodeGen/X86/2009-04-27-LiveIntervalsBug.ll b/test/CodeGen/X86/2009-04-27-LiveIntervalsBug.ll deleted file mode 100644 index 0a2fcdbf6c0..00000000000 --- a/test/CodeGen/X86/2009-04-27-LiveIntervalsBug.ll +++ /dev/null @@ -1,165 +0,0 @@ -; RUN: llc < %s -mtriple=i386-unknown-linux-gnu | grep cmpxchgl | not grep eax -; PR4076 - - type { i8, i8, i8 } ; type %0 - type { i32, i8** } ; type %1 - type { %3* } ; type %2 - type { %4 } ; type %3 - type { %5 } ; type %4 - type { %6, i32, %7 } ; type %5 - type { i8* } ; type %6 - type { i32, [12 x i8] } ; type %7 - type { %9 } ; type %8 - type { %10, %11*, i8 } ; type %9 - type { %11* } ; type %10 - type { i32, %6, i8*, %12, %13*, i8, i32, %28, %29, i32, %30, i32, i32, i32, i8*, i8*, i8, i8 } ; type %11 - type { %13* } ; type %12 - type { %14, i32, %13*, %21 } ; type %13 - type { %15, %16 } ; type %14 - type { i32 (...)** } ; type %15 - type { %17, i8* (i32)*, void (i8*)*, i8 } ; type %16 - type { i32 (...)**, i8*, i8*, i8*, i8*, i8*, i8*, %18 } ; type %17 - type { %19* } ; type %18 - type { i32, %20**, i32, %20**, i8** } ; type %19 - type { i32 (...)**, i32 } ; type %20 - type { %22, %25*, i8, i8, %17*, %26*, %27*, %27* } ; type %21 - type { i32 (...)**, i32, i32, i32, i32, i32, %23*, %24, [8 x %24], i32, %24*, %18 } ; type %22 - type { %23*, void (i32, %22*, i32)*, i32, i32 } ; type %23 - type { i8*, i32 } ; type %24 - type { i32 (...)**, %21 } ; type %25 - type { %20, i32*, i8, i32*, i32*, i16*, i8, [256 x i8], [256 x i8], i8 } ; type %26 - type { %20 } ; type %27 - type { void (%9*)*, i32 } ; type %28 - type { %15* } ; type %29 - type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8* } ; type %30 -@AtomicOps_Internalx86CPUFeatures = external global %0 ; <%0*> [#uses=1] -internal constant [19 x i8] c"xxxxxxxxxxxxxxxxxx\00" ; <[19 x i8]*>:0 [#uses=1] -internal constant [47 x i8] c"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\00" ; <[47 x i8]*>:1 [#uses=1] - -define i8** @func6(i8 zeroext, i32, i32, %1*) nounwind { -;