LLVM API Documentation

AutoUpgrade.cpp
Go to the documentation of this file.
00001 //===-- AutoUpgrade.cpp - Implement auto-upgrade helper functions ---------===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file implements the auto-upgrade helper functions
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #include "llvm/IR/AutoUpgrade.h"
00015 #include "llvm/IR/CFG.h"
00016 #include "llvm/IR/CallSite.h"
00017 #include "llvm/IR/Constants.h"
00018 #include "llvm/IR/DebugInfo.h"
00019 #include "llvm/IR/DiagnosticInfo.h"
00020 #include "llvm/IR/Function.h"
00021 #include "llvm/IR/IRBuilder.h"
00022 #include "llvm/IR/Instruction.h"
00023 #include "llvm/IR/IntrinsicInst.h"
00024 #include "llvm/IR/LLVMContext.h"
00025 #include "llvm/IR/Module.h"
00026 #include "llvm/Support/ErrorHandling.h"
00027 #include <cstring>
00028 using namespace llvm;
00029 
00030 // Upgrade the declarations of the SSE4.1 functions whose arguments have
00031 // changed their type from v4f32 to v2i64.
00032 static bool UpgradeSSE41Function(Function* F, Intrinsic::ID IID,
00033                                  Function *&NewFn) {
00034   // Check whether this is an old version of the function, which received
00035   // v4f32 arguments.
00036   Type *Arg0Type = F->getFunctionType()->getParamType(0);
00037   if (Arg0Type != VectorType::get(Type::getFloatTy(F->getContext()), 4))
00038     return false;
00039 
00040   // Yes, it's old, replace it with new version.
00041   F->setName(F->getName() + ".old");
00042   NewFn = Intrinsic::getDeclaration(F->getParent(), IID);
00043   return true;
00044 }
00045 
00046 static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
00047   assert(F && "Illegal to upgrade a non-existent Function.");
00048 
00049   // Quickly eliminate it, if it's not a candidate.
00050   StringRef Name = F->getName();
00051   if (Name.size() <= 8 || !Name.startswith("llvm."))
00052     return false;
00053   Name = Name.substr(5); // Strip off "llvm."
00054 
00055   switch (Name[0]) {
00056   default: break;
00057   case 'a': {
00058     if (Name.startswith("arm.neon.vclz")) {
00059       Type* args[2] = {
00060         F->arg_begin()->getType(),
00061         Type::getInt1Ty(F->getContext())
00062       };
00063       // Can't use Intrinsic::getDeclaration here as it adds a ".i1" to
00064       // the end of the name. Change name from llvm.arm.neon.vclz.* to
00065       //  llvm.ctlz.*
00066       FunctionType* fType = FunctionType::get(F->getReturnType(), args, false);
00067       NewFn = Function::Create(fType, F->getLinkage(),
00068                                "llvm.ctlz." + Name.substr(14), F->getParent());
00069       return true;
00070     }
00071     if (Name.startswith("arm.neon.vcnt")) {
00072       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::ctpop,
00073                                         F->arg_begin()->getType());
00074       return true;
00075     }
00076     break;
00077   }
00078   case 'c': {
00079     if (Name.startswith("ctlz.") && F->arg_size() == 1) {
00080       F->setName(Name + ".old");
00081       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::ctlz,
00082                                         F->arg_begin()->getType());
00083       return true;
00084     }
00085     if (Name.startswith("cttz.") && F->arg_size() == 1) {
00086       F->setName(Name + ".old");
00087       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::cttz,
00088                                         F->arg_begin()->getType());
00089       return true;
00090     }
00091     break;
00092   }
00093   case 'o':
00094     // We only need to change the name to match the mangling including the
00095     // address space.
00096     if (F->arg_size() == 2 && Name.startswith("objectsize.")) {
00097       Type *Tys[2] = { F->getReturnType(), F->arg_begin()->getType() };
00098       if (F->getName() != Intrinsic::getName(Intrinsic::objectsize, Tys)) {
00099         F->setName(Name + ".old");
00100         NewFn = Intrinsic::getDeclaration(F->getParent(),
00101                                           Intrinsic::objectsize, Tys);
00102         return true;
00103       }
00104     }
00105     break;
00106 
00107   case 'x': {
00108     if (Name.startswith("x86.sse2.pcmpeq.") ||
00109         Name.startswith("x86.sse2.pcmpgt.") ||
00110         Name.startswith("x86.avx2.pcmpeq.") ||
00111         Name.startswith("x86.avx2.pcmpgt.") ||
00112         Name.startswith("x86.avx.vpermil.") ||
00113         Name == "x86.avx.movnt.dq.256" ||
00114         Name == "x86.avx.movnt.pd.256" ||
00115         Name == "x86.avx.movnt.ps.256" ||
00116         Name == "x86.sse42.crc32.64.8" ||
00117         Name == "x86.avx.vbroadcast.ss" ||
00118         Name == "x86.avx.vbroadcast.ss.256" ||
00119         Name == "x86.avx.vbroadcast.sd.256" ||
00120         (Name.startswith("x86.xop.vpcom") && F->arg_size() == 2)) {
00121       NewFn = nullptr;
00122       return true;
00123     }
00124     // SSE4.1 ptest functions may have an old signature.
00125     if (Name.startswith("x86.sse41.ptest")) {
00126       if (Name == "x86.sse41.ptestc")
00127         return UpgradeSSE41Function(F, Intrinsic::x86_sse41_ptestc, NewFn);
00128       if (Name == "x86.sse41.ptestz")
00129         return UpgradeSSE41Function(F, Intrinsic::x86_sse41_ptestz, NewFn);
00130       if (Name == "x86.sse41.ptestnzc")
00131         return UpgradeSSE41Function(F, Intrinsic::x86_sse41_ptestnzc, NewFn);
00132     }
00133     // frcz.ss/sd may need to have an argument dropped
00134     if (Name.startswith("x86.xop.vfrcz.ss") && F->arg_size() == 2) {
00135       F->setName(Name + ".old");
00136       NewFn = Intrinsic::getDeclaration(F->getParent(),
00137                                         Intrinsic::x86_xop_vfrcz_ss);
00138       return true;
00139     }
00140     if (Name.startswith("x86.xop.vfrcz.sd") && F->arg_size() == 2) {
00141       F->setName(Name + ".old");
00142       NewFn = Intrinsic::getDeclaration(F->getParent(),
00143                                         Intrinsic::x86_xop_vfrcz_sd);
00144       return true;
00145     }
00146     // Fix the FMA4 intrinsics to remove the 4
00147     if (Name.startswith("x86.fma4.")) {
00148       F->setName("llvm.x86.fma" + Name.substr(8));
00149       NewFn = F;
00150       return true;
00151     }
00152     break;
00153   }
00154   }
00155 
00156   //  This may not belong here. This function is effectively being overloaded
00157   //  to both detect an intrinsic which needs upgrading, and to provide the
00158   //  upgraded form of the intrinsic. We should perhaps have two separate
00159   //  functions for this.
00160   return false;
00161 }
00162 
00163 bool llvm::UpgradeIntrinsicFunction(Function *F, Function *&NewFn) {
00164   NewFn = nullptr;
00165   bool Upgraded = UpgradeIntrinsicFunction1(F, NewFn);
00166 
00167   // Upgrade intrinsic attributes.  This does not change the function.
00168   if (NewFn)
00169     F = NewFn;
00170   if (unsigned id = F->getIntrinsicID())
00171     F->setAttributes(Intrinsic::getAttributes(F->getContext(),
00172                                               (Intrinsic::ID)id));
00173   return Upgraded;
00174 }
00175 
00176 bool llvm::UpgradeGlobalVariable(GlobalVariable *GV) {
00177   // Nothing to do yet.
00178   return false;
00179 }
00180 
00181 // UpgradeIntrinsicCall - Upgrade a call to an old intrinsic to be a call the
00182 // upgraded intrinsic. All argument and return casting must be provided in
00183 // order to seamlessly integrate with existing context.
00184 void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {
00185   Function *F = CI->getCalledFunction();
00186   LLVMContext &C = CI->getContext();
00187   IRBuilder<> Builder(C);
00188   Builder.SetInsertPoint(CI->getParent(), CI);
00189 
00190   assert(F && "Intrinsic call is not direct?");
00191 
00192   if (!NewFn) {
00193     // Get the Function's name.
00194     StringRef Name = F->getName();
00195 
00196     Value *Rep;
00197     // Upgrade packed integer vector compares intrinsics to compare instructions
00198     if (Name.startswith("llvm.x86.sse2.pcmpeq.") ||
00199         Name.startswith("llvm.x86.avx2.pcmpeq.")) {
00200       Rep = Builder.CreateICmpEQ(CI->getArgOperand(0), CI->getArgOperand(1),
00201                                  "pcmpeq");
00202       // need to sign extend since icmp returns vector of i1
00203       Rep = Builder.CreateSExt(Rep, CI->getType(), "");
00204     } else if (Name.startswith("llvm.x86.sse2.pcmpgt.") ||
00205                Name.startswith("llvm.x86.avx2.pcmpgt.")) {
00206       Rep = Builder.CreateICmpSGT(CI->getArgOperand(0), CI->getArgOperand(1),
00207                                   "pcmpgt");
00208       // need to sign extend since icmp returns vector of i1
00209       Rep = Builder.CreateSExt(Rep, CI->getType(), "");
00210     } else if (Name == "llvm.x86.avx.movnt.dq.256" ||
00211                Name == "llvm.x86.avx.movnt.ps.256" ||
00212                Name == "llvm.x86.avx.movnt.pd.256") {
00213       IRBuilder<> Builder(C);
00214       Builder.SetInsertPoint(CI->getParent(), CI);
00215 
00216       Module *M = F->getParent();
00217       SmallVector<Value *, 1> Elts;
00218       Elts.push_back(ConstantInt::get(Type::getInt32Ty(C), 1));
00219       MDNode *Node = MDNode::get(C, Elts);
00220 
00221       Value *Arg0 = CI->getArgOperand(0);
00222       Value *Arg1 = CI->getArgOperand(1);
00223 
00224       // Convert the type of the pointer to a pointer to the stored type.
00225       Value *BC = Builder.CreateBitCast(Arg0,
00226                                         PointerType::getUnqual(Arg1->getType()),
00227                                         "cast");
00228       StoreInst *SI = Builder.CreateStore(Arg1, BC);
00229       SI->setMetadata(M->getMDKindID("nontemporal"), Node);
00230       SI->setAlignment(16);
00231 
00232       // Remove intrinsic.
00233       CI->eraseFromParent();
00234       return;
00235     } else if (Name.startswith("llvm.x86.xop.vpcom")) {
00236       Intrinsic::ID intID;
00237       if (Name.endswith("ub"))
00238         intID = Intrinsic::x86_xop_vpcomub;
00239       else if (Name.endswith("uw"))
00240         intID = Intrinsic::x86_xop_vpcomuw;
00241       else if (Name.endswith("ud"))
00242         intID = Intrinsic::x86_xop_vpcomud;
00243       else if (Name.endswith("uq"))
00244         intID = Intrinsic::x86_xop_vpcomuq;
00245       else if (Name.endswith("b"))
00246         intID = Intrinsic::x86_xop_vpcomb;
00247       else if (Name.endswith("w"))
00248         intID = Intrinsic::x86_xop_vpcomw;
00249       else if (Name.endswith("d"))
00250         intID = Intrinsic::x86_xop_vpcomd;
00251       else if (Name.endswith("q"))
00252         intID = Intrinsic::x86_xop_vpcomq;
00253       else
00254         llvm_unreachable("Unknown suffix");
00255 
00256       Name = Name.substr(18); // strip off "llvm.x86.xop.vpcom"
00257       unsigned Imm;
00258       if (Name.startswith("lt"))
00259         Imm = 0;
00260       else if (Name.startswith("le"))
00261         Imm = 1;
00262       else if (Name.startswith("gt"))
00263         Imm = 2;
00264       else if (Name.startswith("ge"))
00265         Imm = 3;
00266       else if (Name.startswith("eq"))
00267         Imm = 4;
00268       else if (Name.startswith("ne"))
00269         Imm = 5;
00270       else if (Name.startswith("true"))
00271         Imm = 6;
00272       else if (Name.startswith("false"))
00273         Imm = 7;
00274       else
00275         llvm_unreachable("Unknown condition");
00276 
00277       Function *VPCOM = Intrinsic::getDeclaration(F->getParent(), intID);
00278       Rep = Builder.CreateCall3(VPCOM, CI->getArgOperand(0),
00279                                 CI->getArgOperand(1), Builder.getInt8(Imm));
00280     } else if (Name == "llvm.x86.sse42.crc32.64.8") {
00281       Function *CRC32 = Intrinsic::getDeclaration(F->getParent(),
00282                                                Intrinsic::x86_sse42_crc32_32_8);
00283       Value *Trunc0 = Builder.CreateTrunc(CI->getArgOperand(0), Type::getInt32Ty(C));
00284       Rep = Builder.CreateCall2(CRC32, Trunc0, CI->getArgOperand(1));
00285       Rep = Builder.CreateZExt(Rep, CI->getType(), "");
00286     } else if (Name.startswith("llvm.x86.avx.vbroadcast")) {
00287       // Replace broadcasts with a series of insertelements.
00288       Type *VecTy = CI->getType();
00289       Type *EltTy = VecTy->getVectorElementType();
00290       unsigned EltNum = VecTy->getVectorNumElements();
00291       Value *Cast = Builder.CreateBitCast(CI->getArgOperand(0),
00292                                           EltTy->getPointerTo());
00293       Value *Load = Builder.CreateLoad(Cast);
00294       Type *I32Ty = Type::getInt32Ty(C);
00295       Rep = UndefValue::get(VecTy);
00296       for (unsigned I = 0; I < EltNum; ++I)
00297         Rep = Builder.CreateInsertElement(Rep, Load,
00298                                           ConstantInt::get(I32Ty, I));
00299     } else {
00300       bool PD128 = false, PD256 = false, PS128 = false, PS256 = false;
00301       if (Name == "llvm.x86.avx.vpermil.pd.256")
00302         PD256 = true;
00303       else if (Name == "llvm.x86.avx.vpermil.pd")
00304         PD128 = true;
00305       else if (Name == "llvm.x86.avx.vpermil.ps.256")
00306         PS256 = true;
00307       else if (Name == "llvm.x86.avx.vpermil.ps")
00308         PS128 = true;
00309 
00310       if (PD256 || PD128 || PS256 || PS128) {
00311         Value *Op0 = CI->getArgOperand(0);
00312         unsigned Imm = cast<ConstantInt>(CI->getArgOperand(1))->getZExtValue();
00313         SmallVector<Constant*, 8> Idxs;
00314 
00315         if (PD128)
00316           for (unsigned i = 0; i != 2; ++i)
00317             Idxs.push_back(Builder.getInt32((Imm >> i) & 0x1));
00318         else if (PD256)
00319           for (unsigned l = 0; l != 4; l+=2)
00320             for (unsigned i = 0; i != 2; ++i)
00321               Idxs.push_back(Builder.getInt32(((Imm >> (l+i)) & 0x1) + l));
00322         else if (PS128)
00323           for (unsigned i = 0; i != 4; ++i)
00324             Idxs.push_back(Builder.getInt32((Imm >> (2 * i)) & 0x3));
00325         else if (PS256)
00326           for (unsigned l = 0; l != 8; l+=4)
00327             for (unsigned i = 0; i != 4; ++i)
00328               Idxs.push_back(Builder.getInt32(((Imm >> (2 * i)) & 0x3) + l));
00329         else
00330           llvm_unreachable("Unexpected function");
00331 
00332         Rep = Builder.CreateShuffleVector(Op0, Op0, ConstantVector::get(Idxs));
00333       } else {
00334         llvm_unreachable("Unknown function for CallInst upgrade.");
00335       }
00336     }
00337 
00338     CI->replaceAllUsesWith(Rep);
00339     CI->eraseFromParent();
00340     return;
00341   }
00342 
00343   std::string Name = CI->getName().str();
00344   CI->setName(Name + ".old");
00345 
00346   switch (NewFn->getIntrinsicID()) {
00347   default:
00348     llvm_unreachable("Unknown function for CallInst upgrade.");
00349 
00350   case Intrinsic::ctlz:
00351   case Intrinsic::cttz:
00352     assert(CI->getNumArgOperands() == 1 &&
00353            "Mismatch between function args and call args");
00354     CI->replaceAllUsesWith(Builder.CreateCall2(NewFn, CI->getArgOperand(0),
00355                                                Builder.getFalse(), Name));
00356     CI->eraseFromParent();
00357     return;
00358 
00359   case Intrinsic::objectsize:
00360     CI->replaceAllUsesWith(Builder.CreateCall2(NewFn,
00361                                                CI->getArgOperand(0),
00362                                                CI->getArgOperand(1),
00363                                                Name));
00364     CI->eraseFromParent();
00365     return;
00366 
00367   case Intrinsic::arm_neon_vclz: {
00368     // Change name from llvm.arm.neon.vclz.* to llvm.ctlz.*
00369     CI->replaceAllUsesWith(Builder.CreateCall2(NewFn, CI->getArgOperand(0),
00370                                                Builder.getFalse(),
00371                                                "llvm.ctlz." + Name.substr(14)));
00372     CI->eraseFromParent();
00373     return;
00374   }
00375   case Intrinsic::ctpop: {
00376     CI->replaceAllUsesWith(Builder.CreateCall(NewFn, CI->getArgOperand(0)));
00377     CI->eraseFromParent();
00378     return;
00379   }
00380 
00381   case Intrinsic::x86_xop_vfrcz_ss:
00382   case Intrinsic::x86_xop_vfrcz_sd:
00383     CI->replaceAllUsesWith(Builder.CreateCall(NewFn, CI->getArgOperand(1),
00384                                               Name));
00385     CI->eraseFromParent();
00386     return;
00387 
00388   case Intrinsic::x86_sse41_ptestc:
00389   case Intrinsic::x86_sse41_ptestz:
00390   case Intrinsic::x86_sse41_ptestnzc: {
00391     // The arguments for these intrinsics used to be v4f32, and changed
00392     // to v2i64. This is purely a nop, since those are bitwise intrinsics.
00393     // So, the only thing required is a bitcast for both arguments.
00394     // First, check the arguments have the old type.
00395     Value *Arg0 = CI->getArgOperand(0);
00396     if (Arg0->getType() != VectorType::get(Type::getFloatTy(C), 4))
00397       return;
00398 
00399     // Old intrinsic, add bitcasts
00400     Value *Arg1 = CI->getArgOperand(1);
00401 
00402     Value *BC0 =
00403       Builder.CreateBitCast(Arg0,
00404                             VectorType::get(Type::getInt64Ty(C), 2),
00405                             "cast");
00406     Value *BC1 =
00407       Builder.CreateBitCast(Arg1,
00408                             VectorType::get(Type::getInt64Ty(C), 2),
00409                             "cast");
00410 
00411     CallInst* NewCall = Builder.CreateCall2(NewFn, BC0, BC1, Name);
00412     CI->replaceAllUsesWith(NewCall);
00413     CI->eraseFromParent();
00414     return;
00415   }
00416   }
00417 }
00418 
00419 // This tests each Function to determine if it needs upgrading. When we find
00420 // one we are interested in, we then upgrade all calls to reflect the new
00421 // function.
00422 void llvm::UpgradeCallsToIntrinsic(Function* F) {
00423   assert(F && "Illegal attempt to upgrade a non-existent intrinsic.");
00424 
00425   // Upgrade the function and check if it is a totaly new function.
00426   Function *NewFn;
00427   if (UpgradeIntrinsicFunction(F, NewFn)) {
00428     if (NewFn != F) {
00429       // Replace all uses to the old function with the new one if necessary.
00430       for (Value::user_iterator UI = F->user_begin(), UE = F->user_end();
00431            UI != UE; ) {
00432         if (CallInst *CI = dyn_cast<CallInst>(*UI++))
00433           UpgradeIntrinsicCall(CI, NewFn);
00434       }
00435       // Remove old function, no longer used, from the module.
00436       F->eraseFromParent();
00437     }
00438   }
00439 }
00440 
00441 void llvm::UpgradeInstWithTBAATag(Instruction *I) {
00442   MDNode *MD = I->getMetadata(LLVMContext::MD_tbaa);
00443   assert(MD && "UpgradeInstWithTBAATag should have a TBAA tag");
00444   // Check if the tag uses struct-path aware TBAA format.
00445   if (isa<MDNode>(MD->getOperand(0)) && MD->getNumOperands() >= 3)
00446     return;
00447 
00448   if (MD->getNumOperands() == 3) {
00449     Value *Elts[] = {
00450       MD->getOperand(0),
00451       MD->getOperand(1)
00452     };
00453     MDNode *ScalarType = MDNode::get(I->getContext(), Elts);
00454     // Create a MDNode <ScalarType, ScalarType, offset 0, const>
00455     Value *Elts2[] = {
00456       ScalarType, ScalarType,
00457       Constant::getNullValue(Type::getInt64Ty(I->getContext())),
00458       MD->getOperand(2)
00459     };
00460     I->setMetadata(LLVMContext::MD_tbaa, MDNode::get(I->getContext(), Elts2));
00461   } else {
00462     // Create a MDNode <MD, MD, offset 0>
00463     Value *Elts[] = {MD, MD,
00464       Constant::getNullValue(Type::getInt64Ty(I->getContext()))};
00465     I->setMetadata(LLVMContext::MD_tbaa, MDNode::get(I->getContext(), Elts));
00466   }
00467 }
00468 
00469 Instruction *llvm::UpgradeBitCastInst(unsigned Opc, Value *V, Type *DestTy,
00470                                       Instruction *&Temp) {
00471   if (Opc != Instruction::BitCast)
00472     return nullptr;
00473 
00474   Temp = nullptr;
00475   Type *SrcTy = V->getType();
00476   if (SrcTy->isPtrOrPtrVectorTy() && DestTy->isPtrOrPtrVectorTy() &&
00477       SrcTy->getPointerAddressSpace() != DestTy->getPointerAddressSpace()) {
00478     LLVMContext &Context = V->getContext();
00479 
00480     // We have no information about target data layout, so we assume that
00481     // the maximum pointer size is 64bit.
00482     Type *MidTy = Type::getInt64Ty(Context);
00483     Temp = CastInst::Create(Instruction::PtrToInt, V, MidTy);
00484 
00485     return CastInst::Create(Instruction::IntToPtr, Temp, DestTy);
00486   }
00487 
00488   return nullptr;
00489 }
00490 
00491 Value *llvm::UpgradeBitCastExpr(unsigned Opc, Constant *C, Type *DestTy) {
00492   if (Opc != Instruction::BitCast)
00493     return nullptr;
00494 
00495   Type *SrcTy = C->getType();
00496   if (SrcTy->isPtrOrPtrVectorTy() && DestTy->isPtrOrPtrVectorTy() &&
00497       SrcTy->getPointerAddressSpace() != DestTy->getPointerAddressSpace()) {
00498     LLVMContext &Context = C->getContext();
00499 
00500     // We have no information about target data layout, so we assume that
00501     // the maximum pointer size is 64bit.
00502     Type *MidTy = Type::getInt64Ty(Context);
00503 
00504     return ConstantExpr::getIntToPtr(ConstantExpr::getPtrToInt(C, MidTy),
00505                                      DestTy);
00506   }
00507 
00508   return nullptr;
00509 }
00510 
00511 /// Check the debug info version number, if it is out-dated, drop the debug
00512 /// info. Return true if module is modified.
00513 bool llvm::UpgradeDebugInfo(Module &M) {
00514   unsigned Version = getDebugMetadataVersionFromModule(M);
00515   if (Version == DEBUG_METADATA_VERSION)
00516     return false;
00517 
00518   bool RetCode = StripDebugInfo(M);
00519   if (RetCode) {
00520     DiagnosticInfoDebugMetadataVersion DiagVersion(M, Version);
00521     M.getContext().diagnose(DiagVersion);
00522   }
00523   return RetCode;
00524 }
00525 
00526 void llvm::UpgradeMDStringConstant(std::string &String) {
00527   const std::string OldPrefix = "llvm.vectorizer.";
00528   if (String == "llvm.vectorizer.unroll") {
00529     String = "llvm.loop.interleave.count";
00530   } else if (String.find(OldPrefix) == 0) {
00531     String.replace(0, OldPrefix.size(), "llvm.loop.vectorize.");
00532   }
00533 }