[Mlir-commits] [mlir] 6a37f5b - [MLIR] Make the pass_thru argument of llvm masked.load intrinsic Optional instead of Variadic (#156917)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Sep 4 10:15:27 PDT 2025


Author: Mehdi Amini
Date: 2025-09-04T19:15:23+02:00
New Revision: 6a37f5bdd19ee51d1d3e5a8f55f0d17b8c2f2b66

URL: https://github.com/llvm/llvm-project/commit/6a37f5bdd19ee51d1d3e5a8f55f0d17b8c2f2b66
DIFF: https://github.com/llvm/llvm-project/commit/6a37f5bdd19ee51d1d3e5a8f55f0d17b8c2f2b66.diff

LOG: [MLIR] Make the pass_thru argument of llvm masked.load intrinsic Optional instead of Variadic (#156917)

This is meant as NFC as multiple values there was never supported
anyway. Extra values would be dropped when translating to LLVM IR.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
index fa2e10c9cdee5..dd00d67974d28 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
@@ -1000,17 +1000,17 @@ def LLVM_GetActiveLaneMaskOp
 /// Create a call to Masked Load intrinsic.
 def LLVM_MaskedLoadOp : LLVM_OneResultIntrOp<"masked.load"> {
   let arguments = (ins LLVM_AnyPointer:$data, LLVM_VectorOf<I1>:$mask,
-                   Variadic<LLVM_AnyVector>:$pass_thru, I32Attr:$alignment,
+                   Optional<LLVM_AnyVector>:$pass_thru, I32Attr:$alignment,
                    UnitAttr:$nontemporal);
   let results = (outs LLVM_AnyVector:$res);
   let assemblyFormat =
     "operands attr-dict `:` functional-type(operands, results)";
 
   string llvmBuilder = [{
-    auto *inst = $pass_thru.empty() ? builder.CreateMaskedLoad(
-        $_resultType, $data, llvm::Align($alignment), $mask) :
+    auto *inst = $pass_thru ? builder.CreateMaskedLoad(
+        $_resultType, $data, llvm::Align($alignment), $mask, $pass_thru) :
       builder.CreateMaskedLoad(
-        $_resultType, $data, llvm::Align($alignment), $mask, $pass_thru[0]);
+        $_resultType, $data, llvm::Align($alignment), $mask);
     $res = inst;
   }] #setNonTemporalMetadataCode;
   string mlirBuilder = [{


        


More information about the Mlir-commits mailing list