Index: lib/IR/AutoUpgrade.cpp =================================================================== --- lib/IR/AutoUpgrade.cpp +++ lib/IR/AutoUpgrade.cpp @@ -345,7 +345,6 @@ if (IsX86 && (Name.startswith("avx512.mask.pslli.") || Name.startswith("avx512.mask.psrai.") || Name.startswith("avx512.mask.psrli."))) { - F->setName("llvm.x86." + Name + ".old"); Intrinsic::ID ShiftID; if (Name.slice(12, 16) == "psll") ShiftID = Name[18] == 'd' ? Intrinsic::x86_avx512_mask_psll_di_512 @@ -356,6 +355,7 @@ else ShiftID = Name[18] == 'd' ? Intrinsic::x86_avx512_mask_psrl_di_512 : Intrinsic::x86_avx512_mask_psrl_qi_512; + F->setName("llvm.x86." + Name + ".old"); NewFn = Intrinsic::getDeclaration(F->getParent(), ShiftID); return true; }