diff options
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ARM/ARMInstrNEON.td | 2 | ||||
| -rw-r--r-- | llvm/lib/VMCore/AutoUpgrade.cpp | 25 | 
2 files changed, 26 insertions, 1 deletions
| diff --git a/llvm/lib/Target/ARM/ARMInstrNEON.td b/llvm/lib/Target/ARM/ARMInstrNEON.td index 404b3ad176e..c540d0ddd70 100644 --- a/llvm/lib/Target/ARM/ARMInstrNEON.td +++ b/llvm/lib/Target/ARM/ARMInstrNEON.td @@ -4825,7 +4825,7 @@ defm VCLS     : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,  //   VCLZ     : Vector Count Leading Zeros  defm VCLZ     : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,                             IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i", -                           int_arm_neon_vclz>; +                           ctlz>;  //   VCNT     : Vector Count One Bits  def  VCNTd    : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,                          IIC_VCNTiD, "vcnt", "8", diff --git a/llvm/lib/VMCore/AutoUpgrade.cpp b/llvm/lib/VMCore/AutoUpgrade.cpp index 1defd20728f..8febce18c03 100644 --- a/llvm/lib/VMCore/AutoUpgrade.cpp +++ b/llvm/lib/VMCore/AutoUpgrade.cpp @@ -52,6 +52,22 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {    switch (Name[0]) {    default: break; +  case 'a': { +    if (Name.startswith("arm.neon.vclz")) { +      Type* args[2] = { +        F->arg_begin()->getType(),  +        Type::getInt1Ty(F->getContext()) +      }; +      // Can't use Intrinsic::getDeclaration here as it adds a ".i1" to +      // the end of the name. Change name from llvm.arm.neon.vclz.* to +      //  llvm.ctlz.* +      FunctionType* fType = FunctionType::get(F->getReturnType(), args, false); +      NewFn = Function::Create(fType, F->getLinkage(),  +                               "llvm.ctlz." + Name.substr(14), F->getParent()); +      return true; +    } +    break; +  }    case 'c': {      if (Name.startswith("ctlz.") && F->arg_size() == 1) {        F->setName(Name + ".old"); @@ -295,6 +311,15 @@ void llvm::UpgradeIntrinsicCall(CallInst *CI, Function *NewFn) {      CI->eraseFromParent();      return; +  case Intrinsic::arm_neon_vclz: { +    // Change name from llvm.arm.neon.vclz.* to llvm.ctlz.* +    CI->replaceAllUsesWith(Builder.CreateCall2(NewFn, CI->getArgOperand(0), +                                               Builder.getFalse(),  +                                               "llvm.ctlz." + Name.substr(14))); +    CI->eraseFromParent(); +    return; +  } +    case Intrinsic::x86_xop_vfrcz_ss:    case Intrinsic::x86_xop_vfrcz_sd:      CI->replaceAllUsesWith(Builder.CreateCall(NewFn, CI->getArgOperand(1), | 

