reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

lib/IR/AutoUpgrade.cpp
  491   assert(F && "Illegal to upgrade a non-existent Function.");
  494   StringRef Name = F->getName();
  503       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::bitreverse,
  504                                         F->arg_begin()->getType());
  509         F->arg_begin()->getType(),
  510         Type::getInt1Ty(F->getContext())
  515       FunctionType* fType = FunctionType::get(F->getReturnType(), args, false);
  516       NewFn = Function::Create(fType, F->getLinkage(), F->getAddressSpace(),
  516       NewFn = Function::Create(fType, F->getLinkage(), F->getAddressSpace(),
  517                                "llvm.ctlz." + Name.substr(14), F->getParent());
  521       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::ctpop,
  522                                         F->arg_begin()->getType());
  527       auto fArgs = F->getFunctionType()->params();
  531       FunctionType* fType = FunctionType::get(F->getReturnType(), Tys, false);
  532       NewFn = Function::Create(fType, F->getLinkage(), F->getAddressSpace(),
  532       NewFn = Function::Create(fType, F->getLinkage(), F->getAddressSpace(),
  533                                "llvm." + Name + ".p0i8", F->getParent());
  548       auto fArgs = F->getFunctionType()->params();
  551         NewFn = Intrinsic::getDeclaration(F->getParent(),
  554         NewFn = Intrinsic::getDeclaration(F->getParent(),
  559       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::thread_pointer);
  563       if (F->arg_size() != 2)
  565       auto fArgs = F->getFunctionType()->params();
  568         NewFn = Intrinsic::getDeclaration(F->getParent(),
  577     if (Name.startswith("ctlz.") && F->arg_size() == 1) {
  578       rename(F);
  579       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::ctlz,
  580                                         F->arg_begin()->getType());
  583     if (Name.startswith("cttz.") && F->arg_size() == 1) {
  584       rename(F);
  585       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::cttz,
  586                                         F->arg_begin()->getType());
  592     if (Name == "dbg.value" && F->arg_size() == 4) {
  593       rename(F);
  594       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::dbg_value);
  610         rename(F);
  611         auto Args = F->getFunctionType()->params();
  612         Type *Tys[] = {F->getFunctionType()->getReturnType(), Args[1]};
  613         NewFn = Intrinsic::getDeclaration(F->getParent(), ID, Tys);
  625       auto Args = F->getFunctionType()->params();
  627       if (F->getName() != Intrinsic::getName(ID, ObjectPtr)) {
  628         rename(F);
  629         NewFn = Intrinsic::getDeclaration(F->getParent(), ID, ObjectPtr);
  639       auto Args = F->getFunctionType()->params();
  641       if (F->getName() != Intrinsic::getName(ID, ObjectPtr)) {
  642         rename(F);
  643         NewFn = Intrinsic::getDeclaration(F->getParent(), ID, ObjectPtr);
  649       auto Args = F->getFunctionType()->params();
  651       rename(F);
  652       NewFn = Intrinsic::getDeclaration(F->getParent(),
  662       Type *Tys[] = { F->getReturnType(), F->arg_begin()->getType() };
  662       Type *Tys[] = { F->getReturnType(), F->arg_begin()->getType() };
  663       if (F->getName() != Intrinsic::getName(Intrinsic::masked_load, Tys)) {
  664         rename(F);
  665         NewFn = Intrinsic::getDeclaration(F->getParent(),
  672       auto Args = F->getFunctionType()->params();
  674       if (F->getName() != Intrinsic::getName(Intrinsic::masked_store, Tys)) {
  675         rename(F);
  676         NewFn = Intrinsic::getDeclaration(F->getParent(),
  685       Type *Tys[] = {F->getReturnType(), F->arg_begin()->getType()};
  685       Type *Tys[] = {F->getReturnType(), F->arg_begin()->getType()};
  686       if (F->getName() != Intrinsic::getName(Intrinsic::masked_gather, Tys)) {
  687         rename(F);
  688         NewFn = Intrinsic::getDeclaration(F->getParent(),
  694       auto Args = F->getFunctionType()->params();
  696       if (F->getName() != Intrinsic::getName(Intrinsic::masked_scatter, Tys)) {
  697         rename(F);
  698         NewFn = Intrinsic::getDeclaration(F->getParent(),
  706     if (Name.startswith("memcpy.") && F->arg_size() == 5) {
  707       rename(F);
  709       ArrayRef<Type *> ParamTypes = F->getFunctionType()->params().slice(0, 3);
  710       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memcpy,
  714     if (Name.startswith("memmove.") && F->arg_size() == 5) {
  715       rename(F);
  717       ArrayRef<Type *> ParamTypes = F->getFunctionType()->params().slice(0, 3);
  718       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memmove,
  722     if (Name.startswith("memset.") && F->arg_size() == 5) {
  723       rename(F);
  725       const auto *FT = F->getFunctionType();
  730       NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::memset,
  746       if (IID != Intrinsic::not_intrinsic && F->arg_size() == 1) {
  747         NewFn = Intrinsic::getDeclaration(F->getParent(), IID,
  748                                           {F->getReturnType()});
  775       Type *Tys[2] = { F->getReturnType(), F->arg_begin()->getType() };
  775       Type *Tys[2] = { F->getReturnType(), F->arg_begin()->getType() };
  776       if (F->arg_size() == 2 || F->arg_size() == 3 ||
  776       if (F->arg_size() == 2 || F->arg_size() == 3 ||
  777           F->getName() != Intrinsic::getName(Intrinsic::objectsize, Tys)) {
  778         rename(F);
  779         NewFn = Intrinsic::getDeclaration(F->getParent(), Intrinsic::objectsize,
  789       Type *Tys[] = {F->arg_begin()->getType()};
  790       if (F->getName() != Intrinsic::getName(Intrinsic::prefetch, Tys)) {
  791         rename(F);
  793             Intrinsic::getDeclaration(F->getParent(), Intrinsic::prefetch, Tys);
  807     if (UpgradeX86IntrinsicFunction(F, Name, NewFn))
  811   auto Result = llvm::Intrinsic::remangleIntrinsicFunction(F);