[Mlir-commits] [mlir] [mlir][LLVMIR] Extend FP array-splat constant lowering (PR #192378)

Christian Ulmann llvmlistbot at llvm.org
Mon Apr 20 02:08:57 PDT 2026


================
@@ -683,6 +682,26 @@ llvm::Constant *mlir::LLVM::detail::getLLVMConstant(
             }
           }
         }
+        if (elementType->isFloatingPointTy()) {
+          if (llvm::ConstantFP *cfp = dyn_cast<llvm::ConstantFP>(child)) {
+            APInt bitPattern = cfp->getValueAPF().bitcastToAPInt();
+            uint64_t value = bitPattern.getZExtValue();
+            // TODO: This code only handles 16, 32, and 64 bit floats. Handle
----------------
Dinistro wrote:

Do you know how constant arrays are constructed for `fp8` or `fp4`?
I did not manage to find a nice API to construct any of these.

This is not a blocking comment, just something I was wondering

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


More information about the Mlir-commits mailing list