[Mlir-commits] [clang] [llvm] [mlir] [clang][NVPTX] Add support for pzo in f32 to f16/bf16 conversions (PR #214667)

Erich Keane llvmlistbot at llvm.org
Wed Aug 26 07:54:59 PDT 2026


================
@@ -253,6 +253,23 @@ llvm::Constant *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
   return GetOrCreateLLVMFunction(Name, Ty, D, /*ForVTable=*/false);
 }
 
+void appendDefaultIntrinsicArgs(SmallVectorImpl<llvm::Value *> &Args,
+                                llvm::Function *F) {
+  llvm::FunctionType *FTy = F->getFunctionType();
+  if (Args.size() == FTy->getNumParams())
+    return;
+
+  auto [FirstDefault, Defaults] =
+      Intrinsic::getAllDefaultArgValues(F->getIntrinsicID());
+  for (unsigned I = Args.size(), E = FTy->getNumParams(); I != E; ++I) {
+    unsigned DefaultIdx = I - FirstDefault;
+    if (DefaultIdx < 0 || DefaultIdx >= Defaults.size())
----------------
erichkeane wrote:

Further, when could/should the 2nd thing happen?  Don't the intrinsics have a rule that we are guaranteed that all the 'end' arguments are default (ala C?).  Should this `if` just be some sort of assert? 


https://github.com/llvm/llvm-project/pull/214667


More information about the Mlir-commits mailing list