Skip to content

Commit 8b98cb4

Browse files
authored
[LLVM Pulldown] LLVM HEAD rev bump to 04e2e581ac0009 (#1088)
1 parent 0764baf commit 8b98cb4

File tree

5 files changed

+37
-449
lines changed

5 files changed

+37
-449
lines changed

build_tools/llvm_version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
306148b5412ab87b518becffa85908ba04611fc8
1+
04e2e581ac000934782398e05853338040bf7c46

build_tools/patches/0001-Add-support-for-VectorAnyINTEL-capability.patch

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From c10fb55e593cff647d3d8835799b3c39d208cfcc Mon Sep 17 00:00:00 2001
1+
From 46f1b01b6cde4956f4b08985adc59dd530788d4a Mon Sep 17 00:00:00 2001
22
From: Garra1980 <[email protected]>
3-
Date: Fri, 21 Feb 2025 19:20:18 +0100
4-
Subject: [PATCH 1/1] Add support for VectorAnyINTEL capability
3+
Date: Fri, 13 Jun 2025 19:12:11 +0200
4+
Subject: [PATCH] Add support for VectorAnyINTEL capability
55

66
---
77
.../mlir/Dialect/SPIRV/IR/SPIRVBase.td | 11 +-
@@ -24,13 +24,13 @@ Subject: [PATCH 1/1] Add support for VectorAnyINTEL capability
2424
17 files changed, 322 insertions(+), 69 deletions(-)
2525

2626
diff --git a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
27-
index cafe14046957..b01e581e0f15 100644
27+
index d2ba76cdad90..ac491f6068a0 100644
2828
--- a/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
2929
+++ b/mlir/include/mlir/Dialect/SPIRV/IR/SPIRVBase.td
30-
@@ -4163,7 +4163,14 @@ def SPIRV_Int32 : TypeAlias<I32, "Int32">;
31-
def SPIRV_Float32 : TypeAlias<F32, "Float32">;
30+
@@ -4194,7 +4194,14 @@ def SPIRV_BFloat16KHR : TypeAlias<BF16, "BFloat16">;
3231
def SPIRV_Float : FloatOfWidths<[16, 32, 64]>;
3332
def SPIRV_Float16or32 : FloatOfWidths<[16, 32]>;
33+
def SPIRV_AnyFloat : AnyTypeOf<[SPIRV_Float, SPIRV_BFloat16KHR]>;
3434
-def SPIRV_Vector : VectorOfLengthAndType<[2, 3, 4, 8, 16],
3535
+// Remove the vector size restriction.
3636
+// Vector type is quite restrictive in SPIR-V.
@@ -40,10 +40,10 @@ index cafe14046957..b01e581e0f15 100644
4040
+// via VectorAnyINTEL capability (SPV_INTEL_vector_compute extension).
4141
+// It allows vector length of 2 to 2^32-1.
4242
+def SPIRV_Vector : VectorOfLengthRangeAndType<[2, 0xFFFFFFFF],
43-
[SPIRV_Bool, SPIRV_Integer, SPIRV_Float]>;
43+
[SPIRV_Bool, SPIRV_Integer, SPIRV_AnyFloat]>;
4444
// Component type check is done in the type parser for the following SPIR-V
4545
// dialect-specific types so we use "Any" here.
46-
@@ -4213,7 +4220,7 @@ class SPIRV_MatrixOfType<list<Type> allowedTypes> :
46+
@@ -4245,7 +4252,7 @@ class SPIRV_MatrixOfType<list<Type> allowedTypes> :
4747
"Matrix">;
4848

4949
class SPIRV_VectorOf<Type type> :
@@ -53,10 +53,10 @@ index cafe14046957..b01e581e0f15 100644
5353
class SPIRV_ScalarOrVectorOf<Type type> :
5454
AnyTypeOf<[type, SPIRV_VectorOf<type>]>;
5555
diff --git a/mlir/include/mlir/IR/CommonTypeConstraints.td b/mlir/include/mlir/IR/CommonTypeConstraints.td
56-
index a18b32253d85..4ba962fbeecc 100644
56+
index 45ec1846580f..6ca59f91eee9 100644
5757
--- a/mlir/include/mlir/IR/CommonTypeConstraints.td
5858
+++ b/mlir/include/mlir/IR/CommonTypeConstraints.td
59-
@@ -643,6 +643,92 @@ class ScalableVectorOfRankAndLengthAndType<list<int> allowedRanks,
59+
@@ -648,6 +648,92 @@ class ScalableVectorOfRankAndLengthAndType<list<int> allowedRanks,
6060
ScalableVectorOfLength<allowedLengths>.summary,
6161
"::mlir::VectorType">;
6262

@@ -150,10 +150,10 @@ index a18b32253d85..4ba962fbeecc 100644
150150
// Negative values for `n` index in reverse.
151151
class ShapedTypeWithNthDimOfSize<int n, list<int> allowedSizes> : Type<
152152
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
153-
index 0cf5f0823be6..92f0319db022 100644
153+
index a21acef1c4b4..a7c60f6bf1cb 100644
154154
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
155155
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVDialect.cpp
156-
@@ -191,9 +191,12 @@ static Type parseAndVerifyType(SPIRVDialect const &dialect,
156+
@@ -188,9 +188,12 @@ static Type parseAndVerifyType(SPIRVDialect const &dialect,
157157
parser.emitError(typeLoc, "only 1-D vector allowed but found ") << t;
158158
return Type();
159159
}
@@ -169,7 +169,7 @@ index 0cf5f0823be6..92f0319db022 100644
169169
return Type();
170170
}
171171
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
172-
index 337df3a5a65f..275b5aa507fb 100644
172+
index 93e0c9b33c54..a349da00027e 100644
173173
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
174174
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVTypes.cpp
175175
@@ -100,9 +100,10 @@ bool CompositeType::classof(Type type) {
@@ -210,10 +210,10 @@ index 337df3a5a65f..275b5aa507fb 100644
210210
capabilities.push_back(ref);
211211
}
212212
diff --git a/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp b/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
213-
index c56dbcca2175..03777d4a98b8 100644
213+
index f5a58c58e05d..406e81235e10 100644
214214
--- a/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
215215
+++ b/mlir/lib/Dialect/SPIRV/Transforms/SPIRVConversion.cpp
216-
@@ -88,9 +88,13 @@ static std::optional<SmallVector<int64_t>> getTargetShape(VectorType vecType) {
216+
@@ -87,9 +87,13 @@ static std::optional<SmallVector<int64_t>> getTargetShape(VectorType vecType) {
217217
template <typename LabelT>
218218
static LogicalResult checkExtensionRequirements(
219219
LabelT label, const spirv::TargetEnv &targetEnv,
@@ -229,7 +229,7 @@ index c56dbcca2175..03777d4a98b8 100644
229229
continue;
230230

231231
LLVM_DEBUG({
232-
@@ -116,9 +120,13 @@ static LogicalResult checkExtensionRequirements(
232+
@@ -115,9 +119,13 @@ static LogicalResult checkExtensionRequirements(
233233
template <typename LabelT>
234234
static LogicalResult checkCapabilityRequirements(
235235
LabelT label, const spirv::TargetEnv &targetEnv,
@@ -245,7 +245,7 @@ index c56dbcca2175..03777d4a98b8 100644
245245
continue;
246246

247247
LLVM_DEBUG({
248-
@@ -135,6 +143,55 @@ static LogicalResult checkCapabilityRequirements(
248+
@@ -134,6 +142,55 @@ static LogicalResult checkCapabilityRequirements(
249249
return success();
250250
}
251251

@@ -301,7 +301,7 @@ index c56dbcca2175..03777d4a98b8 100644
301301
/// Returns true if the given `storageClass` needs explicit layout when used in
302302
/// Shader environments.
303303
static bool needsExplicitLayout(spirv::StorageClass storageClass) {
304-
@@ -280,11 +337,14 @@ convertScalarType(const spirv::TargetEnv &targetEnv,
304+
@@ -279,11 +336,14 @@ convertScalarType(const spirv::TargetEnv &targetEnv,
305305
return nullptr;
306306
}
307307

@@ -316,7 +316,7 @@ index c56dbcca2175..03777d4a98b8 100644
316316
auto intType = cast<IntegerType>(type);
317317
LLVM_DEBUG(llvm::dbgs() << type << " converted to 32-bit for SPIR-V\n");
318318
return IntegerType::get(targetEnv.getContext(), /*width=*/32,
319-
@@ -359,10 +419,13 @@ convertVectorType(const spirv::TargetEnv &targetEnv,
319+
@@ -358,10 +418,13 @@ convertVectorType(const spirv::TargetEnv &targetEnv,
320320

321321
if (type.getRank() <= 1 && type.getNumElements() == 1)
322322
return elementType;
@@ -334,7 +334,7 @@ index c56dbcca2175..03777d4a98b8 100644
334334
return nullptr;
335335
}
336336

337-
@@ -384,16 +447,40 @@ convertVectorType(const spirv::TargetEnv &targetEnv,
337+
@@ -383,16 +446,40 @@ convertVectorType(const spirv::TargetEnv &targetEnv,
338338
cast<spirv::CompositeType>(type).getExtensions(extensions, storageClass);
339339
cast<spirv::CompositeType>(type).getCapabilities(capabilities, storageClass);
340340

@@ -382,7 +382,7 @@ index c56dbcca2175..03777d4a98b8 100644
382382
}
383383

384384
static Type
385-
@@ -1562,16 +1649,18 @@ bool SPIRVConversionTarget::isLegalOp(Operation *op) {
385+
@@ -1563,16 +1650,18 @@ bool SPIRVConversionTarget::isLegalOp(Operation *op) {
386386
SmallVector<ArrayRef<spirv::Extension>, 4> typeExtensions;
387387
SmallVector<ArrayRef<spirv::Capability>, 8> typeCapabilities;
388388
for (Type valueType : valueTypes) {
@@ -471,10 +471,10 @@ index 1abe0fd2ec46..f64436fa2632 100644
471471
}
472472

473473
diff --git a/mlir/test/Conversion/FuncToSPIRV/types-to-spirv.mlir b/mlir/test/Conversion/FuncToSPIRV/types-to-spirv.mlir
474-
index 82d750755ffe..6f364c5b0875 100644
474+
index 1737f4a906bf..13f4e17167ef 100644
475475
--- a/mlir/test/Conversion/FuncToSPIRV/types-to-spirv.mlir
476476
+++ b/mlir/test/Conversion/FuncToSPIRV/types-to-spirv.mlir
477-
@@ -351,8 +351,21 @@ module attributes {
477+
@@ -345,8 +345,21 @@ module attributes {
478478
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [], []>, #spirv.resource_limits<>>
479479
} {
480480

@@ -499,10 +499,10 @@ index 82d750755ffe..6f364c5b0875 100644
499499
} // end module
500500

501501
diff --git a/mlir/test/Dialect/SPIRV/IR/arithmetic-ops.mlir b/mlir/test/Dialect/SPIRV/IR/arithmetic-ops.mlir
502-
index 2d0c86e08de5..f60bd10c115b 100644
502+
index d58c27598f2b..4c22244c08e0 100644
503503
--- a/mlir/test/Dialect/SPIRV/IR/arithmetic-ops.mlir
504504
+++ b/mlir/test/Dialect/SPIRV/IR/arithmetic-ops.mlir
505-
@@ -283,7 +283,7 @@ func.func @dot(%arg0: vector<4xf32>, %arg1: vector<4xf32>) -> f16 {
505+
@@ -339,7 +339,7 @@ func.func @dot(%arg0: vector<4xf32>, %arg1: vector<4xf32>) -> f16 {
506506
// -----
507507

508508
func.func @dot(%arg0: vector<4xi32>, %arg1: vector<4xi32>) -> i32 {
@@ -543,7 +543,7 @@ index f3f0ebf60f46..1138f38bcef2 100644
543543
return %0 : f16
544544
}
545545
diff --git a/mlir/test/Dialect/SPIRV/IR/gl-ops.mlir b/mlir/test/Dialect/SPIRV/IR/gl-ops.mlir
546-
index beda3872bc8d..75e4c1b9a43d 100644
546+
index 642346cc40b0..10ede222ada7 100644
547547
--- a/mlir/test/Dialect/SPIRV/IR/gl-ops.mlir
548548
+++ b/mlir/test/Dialect/SPIRV/IR/gl-ops.mlir
549549
@@ -27,7 +27,7 @@ func.func @exp(%arg0 : i32) -> () {
@@ -578,7 +578,7 @@ index bb15d018a6c4..f23c2b329a51 100644
578578
spirv.Return
579579
}
580580
diff --git a/mlir/test/Dialect/SPIRV/IR/logical-ops.mlir b/mlir/test/Dialect/SPIRV/IR/logical-ops.mlir
581-
index 5c24f0e6a7d3..5cbdc5e1e5ef 100644
581+
index d6c34645f574..c24892a00d5a 100644
582582
--- a/mlir/test/Dialect/SPIRV/IR/logical-ops.mlir
583583
+++ b/mlir/test/Dialect/SPIRV/IR/logical-ops.mlir
584584
@@ -166,7 +166,7 @@ func.func @logicalUnary(%arg0 : i1)
@@ -591,10 +591,10 @@ index 5c24f0e6a7d3..5cbdc5e1e5ef 100644
591591
return
592592
}
593593
diff --git a/mlir/test/Dialect/SPIRV/IR/non-uniform-ops.mlir b/mlir/test/Dialect/SPIRV/IR/non-uniform-ops.mlir
594-
index 60ae1584d29f..ac6598b42b03 100644
594+
index 7ab94f17360d..07d85ca5fa90 100644
595595
--- a/mlir/test/Dialect/SPIRV/IR/non-uniform-ops.mlir
596596
+++ b/mlir/test/Dialect/SPIRV/IR/non-uniform-ops.mlir
597-
@@ -495,7 +495,7 @@ func.func @group_non_uniform_bitwise_and(%val: i32) -> i32 {
597+
@@ -511,7 +511,7 @@ func.func @group_non_uniform_bitwise_and(%val: i32) -> i32 {
598598
// -----
599599

600600
func.func @group_non_uniform_bitwise_and(%val: i1) -> i1 {
@@ -603,7 +603,7 @@ index 60ae1584d29f..ac6598b42b03 100644
603603
%0 = spirv.GroupNonUniformBitwiseAnd <Workgroup> <Reduce> %val : i1 -> i1
604604
return %0: i1
605605
}
606-
@@ -516,7 +516,7 @@ func.func @group_non_uniform_bitwise_or(%val: i32) -> i32 {
606+
@@ -532,7 +532,7 @@ func.func @group_non_uniform_bitwise_or(%val: i32) -> i32 {
607607
// -----
608608

609609
func.func @group_non_uniform_bitwise_or(%val: i1) -> i1 {
@@ -612,7 +612,7 @@ index 60ae1584d29f..ac6598b42b03 100644
612612
%0 = spirv.GroupNonUniformBitwiseOr <Workgroup> <Reduce> %val : i1 -> i1
613613
return %0: i1
614614
}
615-
@@ -537,7 +537,7 @@ func.func @group_non_uniform_bitwise_xor(%val: i32) -> i32 {
615+
@@ -553,7 +553,7 @@ func.func @group_non_uniform_bitwise_xor(%val: i32) -> i32 {
616616
// -----
617617

618618
func.func @group_non_uniform_bitwise_xor(%val: i1) -> i1 {
@@ -621,7 +621,7 @@ index 60ae1584d29f..ac6598b42b03 100644
621621
%0 = spirv.GroupNonUniformBitwiseXor <Workgroup> <Reduce> %val : i1 -> i1
622622
return %0: i1
623623
}
624-
@@ -558,7 +558,7 @@ func.func @group_non_uniform_logical_and(%val: i1) -> i1 {
624+
@@ -574,7 +574,7 @@ func.func @group_non_uniform_logical_and(%val: i1) -> i1 {
625625
// -----
626626

627627
func.func @group_non_uniform_logical_and(%val: i32) -> i32 {
@@ -630,7 +630,7 @@ index 60ae1584d29f..ac6598b42b03 100644
630630
%0 = spirv.GroupNonUniformLogicalAnd <Workgroup> <Reduce> %val : i32 -> i32
631631
return %0: i32
632632
}
633-
@@ -579,7 +579,7 @@ func.func @group_non_uniform_logical_or(%val: i1) -> i1 {
633+
@@ -595,7 +595,7 @@ func.func @group_non_uniform_logical_or(%val: i1) -> i1 {
634634
// -----
635635

636636
func.func @group_non_uniform_logical_or(%val: i32) -> i32 {
@@ -639,7 +639,7 @@ index 60ae1584d29f..ac6598b42b03 100644
639639
%0 = spirv.GroupNonUniformLogicalOr <Workgroup> <Reduce> %val : i32 -> i32
640640
return %0: i32
641641
}
642-
@@ -600,7 +600,7 @@ func.func @group_non_uniform_logical_xor(%val: i1) -> i1 {
642+
@@ -616,7 +616,7 @@ func.func @group_non_uniform_logical_xor(%val: i1) -> i1 {
643643
// -----
644644

645645
func.func @group_non_uniform_logical_xor(%val: i32) -> i32 {

0 commit comments

Comments
 (0)