[clang] [llvm] [NVPTX] Add ex2.approx bf16 support and cleanup intrinsic definition (PR #165446)
Alex MacLean via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 28 10:44:34 PDT 2025
================
@@ -2550,6 +2554,11 @@ static Value *upgradeNVVMIntrinsicCall(StringRef Name, CallBase *CI,
Intrinsic::ID IID = (Name == "fabs.ftz.f") ? Intrinsic::nvvm_fabs_ftz
: Intrinsic::nvvm_fabs;
Rep = Builder.CreateUnaryIntrinsic(IID, CI->getArgOperand(0));
+ } else if (Name.consume_front("ex2.approx.")) {
+ // nvvm.ex2.approx.{f,ftz.f,d,f16x2}
+ Intrinsic::ID IID = Name.starts_with("ftz") ? Intrinsic::nvvm_ex2_approx_ftz
+ : Intrinsic::nvvm_ex2_approx;
----------------
AlexMaclean wrote:
This seems like too complex and potentially problematic a transformation to make in AutoUpgrade. We do similar transformations in `convertNvvmIntrinsicToLlvm` which is called during InstCombine, but I think we don't do this for "approx" intrinsics because the semantics don't match the llvm versions.
https://github.com/llvm/llvm-project/pull/165446
More information about the cfe-commits
mailing list