Integrate llvm-project to 2c0078b22469. (#24062)
Changes:
- Updated op descriptions and references to new types after upstream
changes
https://github.com/iree-org/llvm-project/commit/12d53fd227f353e20e5b2c83037f8f6a19262590
and
https://github.com/iree-org/llvm-project/commit/fd32048b7e1991ffbad05dcacf6b628b6f0cefca
- Added handling for `llvm` prefix added to SME attributes in ARM after
https://github.com/llvm/llvm-project/pull/190864
Removed local reverts:
-
https://github.com/iree-org/llvm-project/commit/12d53fd227f353e20e5b2c83037f8f6a19262590
- applied fix to `iree-org/torch-mlir`
https://github.com/iree-org/torch-mlir/tree/sm-iree-integrates/torch-20260409
-
https://github.com/iree-org/llvm-project/commit/fd32048b7e1991ffbad05dcacf6b628b6f0cefca
- Performed llvm bump for StableHLO
https://github.com/openxla/stablehlo/pull/2933
Made-with: Cursor
---------
Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
diff --git a/compiler/src/iree/compiler/API/api_exports.c b/compiler/src/iree/compiler/API/api_exports.c
index cf978fe..dc9e588 100644
--- a/compiler/src/iree/compiler/API/api_exports.c
+++ b/compiler/src/iree/compiler/API/api_exports.c
@@ -612,6 +612,7 @@
extern void mlirLLVMDIBasicTypeAttrGetName();
extern void mlirLLVMDICompileUnitAttrGet();
extern void mlirLLVMDICompileUnitAttrGetName();
+extern void mlirLLVMDICompileUnitAttrGetRecSelf();
extern void mlirLLVMDICompositeTypeAttrGet();
extern void mlirLLVMDICompositeTypeAttrGetName();
extern void mlirLLVMDICompositeTypeAttrGetRecSelf();
@@ -1774,6 +1775,7 @@
x += (uintptr_t)&mlirLLVMDIBasicTypeAttrGetName;
x += (uintptr_t)&mlirLLVMDICompileUnitAttrGet;
x += (uintptr_t)&mlirLLVMDICompileUnitAttrGetName;
+ x += (uintptr_t)&mlirLLVMDICompileUnitAttrGetRecSelf;
x += (uintptr_t)&mlirLLVMDICompositeTypeAttrGet;
x += (uintptr_t)&mlirLLVMDICompositeTypeAttrGetName;
x += (uintptr_t)&mlirLLVMDICompositeTypeAttrGetRecSelf;
diff --git a/compiler/src/iree/compiler/API/api_exports.def b/compiler/src/iree/compiler/API/api_exports.def
index e6ba266..95c2baa 100644
--- a/compiler/src/iree/compiler/API/api_exports.def
+++ b/compiler/src/iree/compiler/API/api_exports.def
@@ -602,6 +602,7 @@
mlirLLVMDIBasicTypeAttrGetName
mlirLLVMDICompileUnitAttrGet
mlirLLVMDICompileUnitAttrGetName
+ mlirLLVMDICompileUnitAttrGetRecSelf
mlirLLVMDICompositeTypeAttrGet
mlirLLVMDICompositeTypeAttrGetName
mlirLLVMDICompositeTypeAttrGetRecSelf
diff --git a/compiler/src/iree/compiler/API/api_exports.ld b/compiler/src/iree/compiler/API/api_exports.ld
index 71b092e..4cb0255 100644
--- a/compiler/src/iree/compiler/API/api_exports.ld
+++ b/compiler/src/iree/compiler/API/api_exports.ld
@@ -603,6 +603,7 @@
mlirLLVMDIBasicTypeAttrGetName;
mlirLLVMDICompileUnitAttrGet;
mlirLLVMDICompileUnitAttrGetName;
+ mlirLLVMDICompileUnitAttrGetRecSelf;
mlirLLVMDICompositeTypeAttrGet;
mlirLLVMDICompositeTypeAttrGetName;
mlirLLVMDICompositeTypeAttrGetRecSelf;
diff --git a/compiler/src/iree/compiler/API/api_exports.macos.lst b/compiler/src/iree/compiler/API/api_exports.macos.lst
index 38c536c..eb62d90 100644
--- a/compiler/src/iree/compiler/API/api_exports.macos.lst
+++ b/compiler/src/iree/compiler/API/api_exports.macos.lst
@@ -601,6 +601,7 @@
_mlirLLVMDIBasicTypeAttrGetName
_mlirLLVMDICompileUnitAttrGet
_mlirLLVMDICompileUnitAttrGetName
+_mlirLLVMDICompileUnitAttrGetRecSelf
_mlirLLVMDICompositeTypeAttrGet
_mlirLLVMDICompositeTypeAttrGetName
_mlirLLVMDICompositeTypeAttrGetRecSelf
diff --git a/compiler/src/iree/compiler/Codegen/LLVMCPU/ConvertToLLVM.cpp b/compiler/src/iree/compiler/Codegen/LLVMCPU/ConvertToLLVM.cpp
index 7d6bce8..844619a 100644
--- a/compiler/src/iree/compiler/Codegen/LLVMCPU/ConvertToLLVM.cpp
+++ b/compiler/src/iree/compiler/Codegen/LLVMCPU/ConvertToLLVM.cpp
@@ -135,14 +135,26 @@
signatureConverter.addInputs(abiInputTypes);
// Copy all attributes onto the LLVM function except the ones handled by
- // MLIR implicitly.
+ // MLIR implicitly. Discardable attributes prefixed with "llvm." are
+ // stripped to their unprefixed name if they correspond to inherent
+ // LLVMFuncOp attributes, mirroring the standard FuncToLLVM conversion.
+ llvm::SmallDenseSet<StringRef> odsAttrNames(
+ LLVM::LLVMFuncOp::getAttributeNames().begin(),
+ LLVM::LLVMFuncOp::getAttributeNames().end());
SmallVector<NamedAttribute> funcAttrs;
for (auto attr : stdFuncOp->getAttrs()) {
if (attr.getName() == SymbolTable::getSymbolAttrName() ||
attr.getName() == stdFuncOp.getFunctionTypeAttrName()) {
continue;
}
- funcAttrs.push_back(attr);
+ StringRef name = attr.getName().strref();
+ StringRef stripped = name;
+ if (stripped.consume_front("llvm.") && odsAttrNames.contains(stripped)) {
+ funcAttrs.push_back(
+ NamedAttribute(rewriter.getStringAttr(stripped), attr.getValue()));
+ } else {
+ funcAttrs.push_back(attr);
+ }
}
// Clone the function as an LLVMFuncOp and convert all interior types.
diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp
index 4a43edc..be59659 100644
--- a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp
+++ b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.cpp
@@ -3834,7 +3834,7 @@
LogicalResult AsyncParameterGatherOp::inferReturnTypes(
MLIRContext *context, std::optional<Location> location, ValueRange operands,
- DictionaryAttr attributes, OpaqueProperties properties, RegionRange regions,
+ DictionaryAttr attributes, PropertyRef properties, RegionRange regions,
SmallVectorImpl<Type> &inferredReturnTypes) {
// The result type matches the target operand type.
AsyncParameterGatherOpAdaptor adaptor(operands, attributes, properties,
@@ -3900,7 +3900,7 @@
LogicalResult AsyncParameterScatterOp::inferReturnTypes(
MLIRContext *context, std::optional<Location> location, ValueRange operands,
- DictionaryAttr attributes, OpaqueProperties properties, RegionRange regions,
+ DictionaryAttr attributes, PropertyRef properties, RegionRange regions,
SmallVectorImpl<Type> &inferredReturnTypes) {
// The result type matches the source operand type.
AsyncParameterScatterOpAdaptor adaptor(operands, attributes, properties,
diff --git a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.td b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.td
index 1295b8b..09d9728 100644
--- a/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.td
+++ b/compiler/src/iree/compiler/Dialect/Stream/IR/StreamOps.td
@@ -5212,7 +5212,7 @@
"IREE::Stream::CmdConcurrentOp",
]>,
Pure,
- DeclareOpInterfaceMethods<RegionBranchTerminatorOpInterface>,
+ DeclareOpInterfaceMethods<RegionBranchTerminatorOpInterface, ["getMutableSuccessorOperands"]>,
Terminator,
SameVariadicOperandSize,
DeclareOpInterfaceMethods<Util_ClosureYieldOpInterface, [
diff --git a/third_party/llvm-project b/third_party/llvm-project
index 4fd6a8a..6a7c141 160000
--- a/third_party/llvm-project
+++ b/third_party/llvm-project
@@ -1 +1 @@
-Subproject commit 4fd6a8a2afd7250b9a89acba8cbbec7e6d22cde6
+Subproject commit 6a7c14115c7ae0a8460e6717ff6f4e9091fc32e1
diff --git a/third_party/stablehlo b/third_party/stablehlo
index b744df4..0dc0fd7 160000
--- a/third_party/stablehlo
+++ b/third_party/stablehlo
@@ -1 +1 @@
-Subproject commit b744df4fa70fa87ccb04b3809dffcded294d8c33
+Subproject commit 0dc0fd71ccb5eab0f6edc7a8cab0a489a83a91f2
diff --git a/third_party/torch-mlir b/third_party/torch-mlir
index 7629fd5..172a8b4 160000
--- a/third_party/torch-mlir
+++ b/third_party/torch-mlir
@@ -1 +1 @@
-Subproject commit 7629fd5363ee1ec1a18f94652e237ffba8d54860
+Subproject commit 172a8b4d5caddbb3af9045f7329dd4121b590cbf