Integrate LLVM to llvm/llvm-project@480b2c9eb47f (#24793)
Bumpy `llvm-project` from `8c5193b41f2f` to `480b2c9eb47f`, no
carried-over or new reverts.
One adaptation was required:
llvm/llvm-project@9e43e04108dd stops arith-expand from expanding
`arith.maximumf/minimumf/maxnumf/minnumf` unless the new
`include-min-max-f` option is set. For VMVX, `ArithToVM` has conversion
patterns for `arith.maximumf/minimumf` but none for
`arith.maxnumf/minnumf`, so the `arith.maxnumf` emitted by the
`linalg.softmax` decomposition no longer legalized and `VMVX -> VM`
conversion failed in `tests/e2e/linalg/softmax.mlir`.
Setting `includeMinMaxF` on the VMVX arith-expand invocation restores
the previous behavior. `include-min-max-i` is left off because the VM
dialect has native integer min/max ops for both i32 and i64.
LLVMCPU has direct lowerings to the `llvm.intr.maximum/maxnum`.
Assisted-by: Claude Code and reviewed by me.
---------
Signed-off-by: Ege Beysel <beysel@roofline.ai>
diff --git a/compiler/src/iree/compiler/API/api_exports.c b/compiler/src/iree/compiler/API/api_exports.c
index f7f5e1b..d19af65 100644
--- a/compiler/src/iree/compiler/API/api_exports.c
+++ b/compiler/src/iree/compiler/API/api_exports.c
@@ -506,6 +506,9 @@
extern void mlirFloat8E5M2TypeGet();
extern void mlirFloat8E5M2TypeGetName();
extern void mlirFloat8E5M2TypeGetTypeID();
+extern void mlirFloat8E5M3FNUTypeGet();
+extern void mlirFloat8E5M3FNUTypeGetName();
+extern void mlirFloat8E5M3FNUTypeGetTypeID();
extern void mlirFloat8E8M0FNUTypeGet();
extern void mlirFloat8E8M0FNUTypeGetName();
extern void mlirFloat8E8M0FNUTypeGetTypeID();
@@ -633,7 +636,7 @@
extern void mlirLLVMArrayTypeGetNumElements();
extern void mlirLLVMArrayTypeGetTypeID();
extern void mlirLLVMAttrIsAMDConstantAttr();
-extern void mlirLLVMAttrIsAMDFuncAttr();
+extern void mlirLLVMAttrIsAMDGlobalValueAttr();
extern void mlirLLVMAttrIsAMDNodeAttr();
extern void mlirLLVMAttrIsAMDStringAttr();
extern void mlirLLVMCConvAttrGet();
@@ -699,9 +702,9 @@
extern void mlirLLVMMDConstantAttrGet();
extern void mlirLLVMMDConstantAttrGetTypeID();
extern void mlirLLVMMDConstantAttrGetValue();
-extern void mlirLLVMMDFuncAttrGet();
-extern void mlirLLVMMDFuncAttrGetName();
-extern void mlirLLVMMDFuncAttrGetTypeID();
+extern void mlirLLVMMDGlobalValueAttrGet();
+extern void mlirLLVMMDGlobalValueAttrGetName();
+extern void mlirLLVMMDGlobalValueAttrGetTypeID();
extern void mlirLLVMMDNodeAttrGet();
extern void mlirLLVMMDNodeAttrGetNumOperands();
extern void mlirLLVMMDNodeAttrGetOperand();
@@ -883,6 +886,7 @@
extern void mlirOperationImplementsInterface();
extern void mlirOperationImplementsInterfaceStatic();
extern void mlirOperationIsBeforeInBlock();
+extern void mlirOperationIsStructurallyEquivalent();
extern void mlirOperationMoveAfter();
extern void mlirOperationMoveBefore();
extern void mlirOperationNameHasTrait();
@@ -907,6 +911,7 @@
extern void mlirOperationStateAddSuccessors();
extern void mlirOperationStateEnableResultTypeInference();
extern void mlirOperationStateGet();
+extern void mlirOperationStructuralHashValue();
extern void mlirOperationVerify();
extern void mlirOperationWalk();
extern void mlirOperationWriteBytecode();
@@ -1006,6 +1011,8 @@
extern void mlirRewriterBaseReplaceOpUsesWithinBlock();
extern void mlirRewriterBaseReplaceOpWithOperation();
extern void mlirRewriterBaseReplaceOpWithValues();
+extern void mlirRewriterBaseRestoreInsertionPoint();
+extern void mlirRewriterBaseSaveInsertionPoint();
extern void mlirRewriterBaseSetInsertionPointAfter();
extern void mlirRewriterBaseSetInsertionPointAfterValue();
extern void mlirRewriterBaseSetInsertionPointBefore();
@@ -1147,6 +1154,7 @@
extern void mlirTypeIsAFloat8E4M3FNUZ();
extern void mlirTypeIsAFloat8E5M2();
extern void mlirTypeIsAFloat8E5M2FNUZ();
+extern void mlirTypeIsAFloat8E5M3FNU();
extern void mlirTypeIsAFloat8E8M0FNU();
extern void mlirTypeIsAFunction();
extern void mlirTypeIsAGPUAsyncTokenType();
@@ -1216,6 +1224,7 @@
extern void mlirValuePrintAsOperand();
extern void mlirValueReplaceAllUsesExcept();
extern void mlirValueReplaceAllUsesOfWith();
+extern void mlirValueReplaceUsesWithIf();
extern void mlirValueSetType();
extern void mlirVectorTypeGet();
extern void mlirVectorTypeGetChecked();
@@ -1725,6 +1734,9 @@
x += (uintptr_t)&mlirFloat8E5M2TypeGet;
x += (uintptr_t)&mlirFloat8E5M2TypeGetName;
x += (uintptr_t)&mlirFloat8E5M2TypeGetTypeID;
+ x += (uintptr_t)&mlirFloat8E5M3FNUTypeGet;
+ x += (uintptr_t)&mlirFloat8E5M3FNUTypeGetName;
+ x += (uintptr_t)&mlirFloat8E5M3FNUTypeGetTypeID;
x += (uintptr_t)&mlirFloat8E8M0FNUTypeGet;
x += (uintptr_t)&mlirFloat8E8M0FNUTypeGetName;
x += (uintptr_t)&mlirFloat8E8M0FNUTypeGetTypeID;
@@ -1852,7 +1864,7 @@
x += (uintptr_t)&mlirLLVMArrayTypeGetNumElements;
x += (uintptr_t)&mlirLLVMArrayTypeGetTypeID;
x += (uintptr_t)&mlirLLVMAttrIsAMDConstantAttr;
- x += (uintptr_t)&mlirLLVMAttrIsAMDFuncAttr;
+ x += (uintptr_t)&mlirLLVMAttrIsAMDGlobalValueAttr;
x += (uintptr_t)&mlirLLVMAttrIsAMDNodeAttr;
x += (uintptr_t)&mlirLLVMAttrIsAMDStringAttr;
x += (uintptr_t)&mlirLLVMCConvAttrGet;
@@ -1918,9 +1930,9 @@
x += (uintptr_t)&mlirLLVMMDConstantAttrGet;
x += (uintptr_t)&mlirLLVMMDConstantAttrGetTypeID;
x += (uintptr_t)&mlirLLVMMDConstantAttrGetValue;
- x += (uintptr_t)&mlirLLVMMDFuncAttrGet;
- x += (uintptr_t)&mlirLLVMMDFuncAttrGetName;
- x += (uintptr_t)&mlirLLVMMDFuncAttrGetTypeID;
+ x += (uintptr_t)&mlirLLVMMDGlobalValueAttrGet;
+ x += (uintptr_t)&mlirLLVMMDGlobalValueAttrGetName;
+ x += (uintptr_t)&mlirLLVMMDGlobalValueAttrGetTypeID;
x += (uintptr_t)&mlirLLVMMDNodeAttrGet;
x += (uintptr_t)&mlirLLVMMDNodeAttrGetNumOperands;
x += (uintptr_t)&mlirLLVMMDNodeAttrGetOperand;
@@ -2102,6 +2114,7 @@
x += (uintptr_t)&mlirOperationImplementsInterface;
x += (uintptr_t)&mlirOperationImplementsInterfaceStatic;
x += (uintptr_t)&mlirOperationIsBeforeInBlock;
+ x += (uintptr_t)&mlirOperationIsStructurallyEquivalent;
x += (uintptr_t)&mlirOperationMoveAfter;
x += (uintptr_t)&mlirOperationMoveBefore;
x += (uintptr_t)&mlirOperationNameHasTrait;
@@ -2126,6 +2139,7 @@
x += (uintptr_t)&mlirOperationStateAddSuccessors;
x += (uintptr_t)&mlirOperationStateEnableResultTypeInference;
x += (uintptr_t)&mlirOperationStateGet;
+ x += (uintptr_t)&mlirOperationStructuralHashValue;
x += (uintptr_t)&mlirOperationVerify;
x += (uintptr_t)&mlirOperationWalk;
x += (uintptr_t)&mlirOperationWriteBytecode;
@@ -2225,6 +2239,8 @@
x += (uintptr_t)&mlirRewriterBaseReplaceOpUsesWithinBlock;
x += (uintptr_t)&mlirRewriterBaseReplaceOpWithOperation;
x += (uintptr_t)&mlirRewriterBaseReplaceOpWithValues;
+ x += (uintptr_t)&mlirRewriterBaseRestoreInsertionPoint;
+ x += (uintptr_t)&mlirRewriterBaseSaveInsertionPoint;
x += (uintptr_t)&mlirRewriterBaseSetInsertionPointAfter;
x += (uintptr_t)&mlirRewriterBaseSetInsertionPointAfterValue;
x += (uintptr_t)&mlirRewriterBaseSetInsertionPointBefore;
@@ -2366,6 +2382,7 @@
x += (uintptr_t)&mlirTypeIsAFloat8E4M3FNUZ;
x += (uintptr_t)&mlirTypeIsAFloat8E5M2;
x += (uintptr_t)&mlirTypeIsAFloat8E5M2FNUZ;
+ x += (uintptr_t)&mlirTypeIsAFloat8E5M3FNU;
x += (uintptr_t)&mlirTypeIsAFloat8E8M0FNU;
x += (uintptr_t)&mlirTypeIsAFunction;
x += (uintptr_t)&mlirTypeIsAGPUAsyncTokenType;
@@ -2435,6 +2452,7 @@
x += (uintptr_t)&mlirValuePrintAsOperand;
x += (uintptr_t)&mlirValueReplaceAllUsesExcept;
x += (uintptr_t)&mlirValueReplaceAllUsesOfWith;
+ x += (uintptr_t)&mlirValueReplaceUsesWithIf;
x += (uintptr_t)&mlirValueSetType;
x += (uintptr_t)&mlirVectorTypeGet;
x += (uintptr_t)&mlirVectorTypeGetChecked;
diff --git a/compiler/src/iree/compiler/API/api_exports.def b/compiler/src/iree/compiler/API/api_exports.def
index d04c6a8..f145b59 100644
--- a/compiler/src/iree/compiler/API/api_exports.def
+++ b/compiler/src/iree/compiler/API/api_exports.def
@@ -496,6 +496,9 @@
mlirFloat8E5M2TypeGet
mlirFloat8E5M2TypeGetName
mlirFloat8E5M2TypeGetTypeID
+ mlirFloat8E5M3FNUTypeGet
+ mlirFloat8E5M3FNUTypeGetName
+ mlirFloat8E5M3FNUTypeGetTypeID
mlirFloat8E8M0FNUTypeGet
mlirFloat8E8M0FNUTypeGetName
mlirFloat8E8M0FNUTypeGetTypeID
@@ -623,7 +626,7 @@
mlirLLVMArrayTypeGetNumElements
mlirLLVMArrayTypeGetTypeID
mlirLLVMAttrIsAMDConstantAttr
- mlirLLVMAttrIsAMDFuncAttr
+ mlirLLVMAttrIsAMDGlobalValueAttr
mlirLLVMAttrIsAMDNodeAttr
mlirLLVMAttrIsAMDStringAttr
mlirLLVMCConvAttrGet
@@ -689,9 +692,9 @@
mlirLLVMMDConstantAttrGet
mlirLLVMMDConstantAttrGetTypeID
mlirLLVMMDConstantAttrGetValue
- mlirLLVMMDFuncAttrGet
- mlirLLVMMDFuncAttrGetName
- mlirLLVMMDFuncAttrGetTypeID
+ mlirLLVMMDGlobalValueAttrGet
+ mlirLLVMMDGlobalValueAttrGetName
+ mlirLLVMMDGlobalValueAttrGetTypeID
mlirLLVMMDNodeAttrGet
mlirLLVMMDNodeAttrGetNumOperands
mlirLLVMMDNodeAttrGetOperand
@@ -873,6 +876,7 @@
mlirOperationImplementsInterface
mlirOperationImplementsInterfaceStatic
mlirOperationIsBeforeInBlock
+ mlirOperationIsStructurallyEquivalent
mlirOperationMoveAfter
mlirOperationMoveBefore
mlirOperationNameHasTrait
@@ -897,6 +901,7 @@
mlirOperationStateAddSuccessors
mlirOperationStateEnableResultTypeInference
mlirOperationStateGet
+ mlirOperationStructuralHashValue
mlirOperationVerify
mlirOperationWalk
mlirOperationWriteBytecode
@@ -996,6 +1001,8 @@
mlirRewriterBaseReplaceOpUsesWithinBlock
mlirRewriterBaseReplaceOpWithOperation
mlirRewriterBaseReplaceOpWithValues
+ mlirRewriterBaseRestoreInsertionPoint
+ mlirRewriterBaseSaveInsertionPoint
mlirRewriterBaseSetInsertionPointAfter
mlirRewriterBaseSetInsertionPointAfterValue
mlirRewriterBaseSetInsertionPointBefore
@@ -1137,6 +1144,7 @@
mlirTypeIsAFloat8E4M3FNUZ
mlirTypeIsAFloat8E5M2
mlirTypeIsAFloat8E5M2FNUZ
+ mlirTypeIsAFloat8E5M3FNU
mlirTypeIsAFloat8E8M0FNU
mlirTypeIsAFunction
mlirTypeIsAGPUAsyncTokenType
@@ -1206,6 +1214,7 @@
mlirValuePrintAsOperand
mlirValueReplaceAllUsesExcept
mlirValueReplaceAllUsesOfWith
+ mlirValueReplaceUsesWithIf
mlirValueSetType
mlirVectorTypeGet
mlirVectorTypeGetChecked
diff --git a/compiler/src/iree/compiler/API/api_exports.ld b/compiler/src/iree/compiler/API/api_exports.ld
index 621aeec..09bd58e 100644
--- a/compiler/src/iree/compiler/API/api_exports.ld
+++ b/compiler/src/iree/compiler/API/api_exports.ld
@@ -497,6 +497,9 @@
mlirFloat8E5M2TypeGet;
mlirFloat8E5M2TypeGetName;
mlirFloat8E5M2TypeGetTypeID;
+ mlirFloat8E5M3FNUTypeGet;
+ mlirFloat8E5M3FNUTypeGetName;
+ mlirFloat8E5M3FNUTypeGetTypeID;
mlirFloat8E8M0FNUTypeGet;
mlirFloat8E8M0FNUTypeGetName;
mlirFloat8E8M0FNUTypeGetTypeID;
@@ -624,7 +627,7 @@
mlirLLVMArrayTypeGetNumElements;
mlirLLVMArrayTypeGetTypeID;
mlirLLVMAttrIsAMDConstantAttr;
- mlirLLVMAttrIsAMDFuncAttr;
+ mlirLLVMAttrIsAMDGlobalValueAttr;
mlirLLVMAttrIsAMDNodeAttr;
mlirLLVMAttrIsAMDStringAttr;
mlirLLVMCConvAttrGet;
@@ -690,9 +693,9 @@
mlirLLVMMDConstantAttrGet;
mlirLLVMMDConstantAttrGetTypeID;
mlirLLVMMDConstantAttrGetValue;
- mlirLLVMMDFuncAttrGet;
- mlirLLVMMDFuncAttrGetName;
- mlirLLVMMDFuncAttrGetTypeID;
+ mlirLLVMMDGlobalValueAttrGet;
+ mlirLLVMMDGlobalValueAttrGetName;
+ mlirLLVMMDGlobalValueAttrGetTypeID;
mlirLLVMMDNodeAttrGet;
mlirLLVMMDNodeAttrGetNumOperands;
mlirLLVMMDNodeAttrGetOperand;
@@ -874,6 +877,7 @@
mlirOperationImplementsInterface;
mlirOperationImplementsInterfaceStatic;
mlirOperationIsBeforeInBlock;
+ mlirOperationIsStructurallyEquivalent;
mlirOperationMoveAfter;
mlirOperationMoveBefore;
mlirOperationNameHasTrait;
@@ -898,6 +902,7 @@
mlirOperationStateAddSuccessors;
mlirOperationStateEnableResultTypeInference;
mlirOperationStateGet;
+ mlirOperationStructuralHashValue;
mlirOperationVerify;
mlirOperationWalk;
mlirOperationWriteBytecode;
@@ -997,6 +1002,8 @@
mlirRewriterBaseReplaceOpUsesWithinBlock;
mlirRewriterBaseReplaceOpWithOperation;
mlirRewriterBaseReplaceOpWithValues;
+ mlirRewriterBaseRestoreInsertionPoint;
+ mlirRewriterBaseSaveInsertionPoint;
mlirRewriterBaseSetInsertionPointAfter;
mlirRewriterBaseSetInsertionPointAfterValue;
mlirRewriterBaseSetInsertionPointBefore;
@@ -1138,6 +1145,7 @@
mlirTypeIsAFloat8E4M3FNUZ;
mlirTypeIsAFloat8E5M2;
mlirTypeIsAFloat8E5M2FNUZ;
+ mlirTypeIsAFloat8E5M3FNU;
mlirTypeIsAFloat8E8M0FNU;
mlirTypeIsAFunction;
mlirTypeIsAGPUAsyncTokenType;
@@ -1207,6 +1215,7 @@
mlirValuePrintAsOperand;
mlirValueReplaceAllUsesExcept;
mlirValueReplaceAllUsesOfWith;
+ mlirValueReplaceUsesWithIf;
mlirValueSetType;
mlirVectorTypeGet;
mlirVectorTypeGetChecked;
diff --git a/compiler/src/iree/compiler/API/api_exports.macos.lst b/compiler/src/iree/compiler/API/api_exports.macos.lst
index 5078892..858ef35 100644
--- a/compiler/src/iree/compiler/API/api_exports.macos.lst
+++ b/compiler/src/iree/compiler/API/api_exports.macos.lst
@@ -495,6 +495,9 @@
_mlirFloat8E5M2TypeGet
_mlirFloat8E5M2TypeGetName
_mlirFloat8E5M2TypeGetTypeID
+_mlirFloat8E5M3FNUTypeGet
+_mlirFloat8E5M3FNUTypeGetName
+_mlirFloat8E5M3FNUTypeGetTypeID
_mlirFloat8E8M0FNUTypeGet
_mlirFloat8E8M0FNUTypeGetName
_mlirFloat8E8M0FNUTypeGetTypeID
@@ -622,7 +625,7 @@
_mlirLLVMArrayTypeGetNumElements
_mlirLLVMArrayTypeGetTypeID
_mlirLLVMAttrIsAMDConstantAttr
-_mlirLLVMAttrIsAMDFuncAttr
+_mlirLLVMAttrIsAMDGlobalValueAttr
_mlirLLVMAttrIsAMDNodeAttr
_mlirLLVMAttrIsAMDStringAttr
_mlirLLVMCConvAttrGet
@@ -688,9 +691,9 @@
_mlirLLVMMDConstantAttrGet
_mlirLLVMMDConstantAttrGetTypeID
_mlirLLVMMDConstantAttrGetValue
-_mlirLLVMMDFuncAttrGet
-_mlirLLVMMDFuncAttrGetName
-_mlirLLVMMDFuncAttrGetTypeID
+_mlirLLVMMDGlobalValueAttrGet
+_mlirLLVMMDGlobalValueAttrGetName
+_mlirLLVMMDGlobalValueAttrGetTypeID
_mlirLLVMMDNodeAttrGet
_mlirLLVMMDNodeAttrGetNumOperands
_mlirLLVMMDNodeAttrGetOperand
@@ -872,6 +875,7 @@
_mlirOperationImplementsInterface
_mlirOperationImplementsInterfaceStatic
_mlirOperationIsBeforeInBlock
+_mlirOperationIsStructurallyEquivalent
_mlirOperationMoveAfter
_mlirOperationMoveBefore
_mlirOperationNameHasTrait
@@ -896,6 +900,7 @@
_mlirOperationStateAddSuccessors
_mlirOperationStateEnableResultTypeInference
_mlirOperationStateGet
+_mlirOperationStructuralHashValue
_mlirOperationVerify
_mlirOperationWalk
_mlirOperationWriteBytecode
@@ -995,6 +1000,8 @@
_mlirRewriterBaseReplaceOpUsesWithinBlock
_mlirRewriterBaseReplaceOpWithOperation
_mlirRewriterBaseReplaceOpWithValues
+_mlirRewriterBaseRestoreInsertionPoint
+_mlirRewriterBaseSaveInsertionPoint
_mlirRewriterBaseSetInsertionPointAfter
_mlirRewriterBaseSetInsertionPointAfterValue
_mlirRewriterBaseSetInsertionPointBefore
@@ -1136,6 +1143,7 @@
_mlirTypeIsAFloat8E4M3FNUZ
_mlirTypeIsAFloat8E5M2
_mlirTypeIsAFloat8E5M2FNUZ
+_mlirTypeIsAFloat8E5M3FNU
_mlirTypeIsAFloat8E8M0FNU
_mlirTypeIsAFunction
_mlirTypeIsAGPUAsyncTokenType
@@ -1205,6 +1213,7 @@
_mlirValuePrintAsOperand
_mlirValueReplaceAllUsesExcept
_mlirValueReplaceAllUsesOfWith
+_mlirValueReplaceUsesWithIf
_mlirValueSetType
_mlirVectorTypeGet
_mlirVectorTypeGetChecked
diff --git a/compiler/src/iree/compiler/Dialect/VMVX/Transforms/Passes.cpp b/compiler/src/iree/compiler/Dialect/VMVX/Transforms/Passes.cpp
index 8377ec5..42c2b07 100644
--- a/compiler/src/iree/compiler/Dialect/VMVX/Transforms/Passes.cpp
+++ b/compiler/src/iree/compiler/Dialect/VMVX/Transforms/Passes.cpp
@@ -60,6 +60,9 @@
arith::ArithExpandOpsPassOptions options;
options.includeBf16 = true;
options.includeF8E8M0 = true;
+ // The VM dialect has no maxnumf/minnumf equivalent, so these have to be
+ // expanded to cmp+select here.
+ options.includeMinMaxF = true;
return arith::createArithExpandOpsPass(options);
})
.addPass(createConvertUnsupportedFloatArithPass)
diff --git a/third_party/llvm-project b/third_party/llvm-project
index 8c5193b..480b2c9 160000
--- a/third_party/llvm-project
+++ b/third_party/llvm-project
@@ -1 +1 @@
-Subproject commit 8c5193b41f2f1f5fb704a70e1f4bb7c0153d2d9d
+Subproject commit 480b2c9eb47f1c105432a99b1623abda97e88259