Skip to content

Commit 6965a0d

Browse files
Bump LLVM to 4ac4726d00644f6c6b0e2de1df0d00deed0015bf (#21175)
Carrying reverts from #21162 Also added a revert for [4d21da002a056c64231fb89ee9e4eba90080e9bb](http://github.com/llvm/llvm-project/pull/144158) (not a hard fix, just is a load bearing change that should be done as a seperate cherry pick) Adds a local commit to stablehlo to allow compiling with the new llvm patch Co-authored-by: Kunwar Grover <[email protected]>
1 parent 3c81533 commit 6965a0d

File tree

20 files changed

+37
-37
lines changed

20 files changed

+37
-37
lines changed

compiler/plugins/input/StableHLO/Conversion/MapStableHLOToScalarOp.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ inline Value mapStableHloOpToStdScalarOp<stablehlo::ReducePrecisionOp>(
489489
expBitsMask = ((expBitsMask << srcExponentBits) - 1) << srcMantissaBits;
490490

491491
auto createConstant = [&](const APInt &v) {
492-
return b.create<arith::ConstantIntOp>(v.getZExtValue(), intType)
492+
return b.create<arith::ConstantIntOp>(intType, v.getZExtValue())
493493
.getResult();
494494
};
495495

@@ -510,7 +510,7 @@ inline Value mapStableHloOpToStdScalarOp<stablehlo::ReducePrecisionOp>(
510510
APInt baseRoundingBias = lastMantissaBitMask.lshr(1) - 1;
511511

512512
Value mantissaDiff = b.create<arith::ConstantIntOp>(
513-
srcMantissaBits - destMantissaBits, intType);
513+
intType, srcMantissaBits - destMantissaBits);
514514
Value highestMantissaMaskVal = createConstant(lastMantissaBitMask);
515515
Value baseRoundingBiasVal = createConstant(baseRoundingBias);
516516
Value xLastMantissaBit = b.create<arith::ShRUIOp>(

compiler/src/iree/compiler/Codegen/Common/GPU/GPULowerToUKernels.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ struct LowerInnerTiledMmaToUKernelPattern
157157
return rewriter.create<arith::IndexCastOp>(loc, I32Type, val);
158158
};
159159
auto constI32 = [&](int val) {
160-
return rewriter.create<arith::ConstantIntOp>(loc, val, I32Type);
160+
return rewriter.create<arith::ConstantIntOp>(loc, I32Type, val);
161161
};
162162
int64_t sharedMemoryBytes = ukernelAttr.getSharedMemoryBytes();
163163
auto sharedMemory = createSharedMemory(rewriter, loc, sharedMemoryBytes);

compiler/src/iree/compiler/Codegen/Common/SpecializeExports.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ static void specializeExportedFunction(
284284
builder.setInsertionPointToStart(newCondition);
285285

286286
Value exportCondition =
287-
builder.create<arith::ConstantIntOp>(loc, 1, builder.getI1Type());
287+
builder.create<arith::ConstantIntOp>(loc, builder.getI1Type(), 1);
288288

289289
for (auto [range, assumedSize] :
290290
llvm::zip(specializationRange, workloadMapping)) {

compiler/src/iree/compiler/Codegen/Dialect/GPU/TargetUtils/ConfigUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ static bool isNonMatvecContraction(Operation *op) {
551551
if (!linalgOp) {
552552
return false;
553553
}
554-
SmallVector<int64_t, 4> bounds = linalgOp.getStaticLoopRanges();
554+
SmallVector<int64_t> bounds = linalgOp.getStaticLoopRanges();
555555
FailureOr<mlir::linalg::ContractionDimensions> contractionDims =
556556
mlir::linalg::inferContractionDims(linalgOp);
557557
if (failed(contractionDims)) {

compiler/src/iree/compiler/Codegen/LLVMGPU/KernelConfig.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ getVectorDistributeReductionConfig(
352352
op.getParallelDims(parallelDims);
353353
op.getReductionDims(reductionDims);
354354

355-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
355+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
356356

357357
SmallVector<int64_t> workgroupTileSizes(op.getNumLoops(), 0);
358358
SmallVector<int64_t> threadTileSizes(op.getNumLoops(), 0);
@@ -724,7 +724,7 @@ setReductionVectorDistributionConfig(IREE::GPU::TargetAttr target,
724724
op.getParallelDims(parallelDims);
725725
op.getReductionDims(reductionDims);
726726

727-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
727+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
728728
IREE::GPU::TargetWgpAttr wgp = target.getWgp();
729729
int64_t reductionSize = bounds[reductionDims.back()];
730730

@@ -836,7 +836,7 @@ setConvolutionVectorDistributionConfig(IREE::GPU::TargetAttr target,
836836

837837
const int64_t targetSubgroupSize = target.getPreferredSubgroupSize();
838838

839-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
839+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
840840
FailureOr<mlir::linalg::ConvolutionDimensions> convolutionDims =
841841
mlir::linalg::inferConvolutionDims(op);
842842
if (failed(convolutionDims)) {
@@ -1040,7 +1040,7 @@ setMatmulVectorDistributionConfig(IREE::GPU::TargetAttr target,
10401040

10411041
const int64_t targetSubgroupSize = target.getPreferredSubgroupSize();
10421042

1043-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
1043+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
10441044
FailureOr<mlir::linalg::ContractionDimensions> contractionDims =
10451045
mlir::linalg::inferContractionDims(op);
10461046
if (failed(contractionDims)) {
@@ -1881,7 +1881,7 @@ static LogicalResult setContractConfig(IREE::GPU::TargetAttr target,
18811881
// They should go down different pipelines.
18821882
// Currently dynamic dimensions are tiled with size=1 in codegen.
18831883
int staticNonUnitParallelDimCount = 0;
1884-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
1884+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
18851885
FailureOr<mlir::linalg::ContractionDimensions> contractionDims =
18861886
mlir::linalg::inferContractionDims(op);
18871887
assert(succeeded(contractionDims) && "Could not infer contraction dims");
@@ -2424,7 +2424,7 @@ setWarpReductionConfig(IREE::GPU::TargetAttr target,
24242424
op.getParallelDims(parallelDims);
24252425
op.getReductionDims(reductionDims);
24262426

2427-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
2427+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
24282428
int64_t numParallelDims = op.getNumParallelLoops();
24292429

24302430
if (reductionDims.empty())
@@ -2714,7 +2714,7 @@ static LogicalResult setArgmaxUkernelConfig(
27142714
return failure();
27152715

27162716
// Make sure reduction dimensions are static and innermost ones.
2717-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
2717+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
27182718
int64_t numParallelDims = op.getNumParallelLoops();
27192719
int64_t numDynamicReductionDims = 0;
27202720
for (unsigned dim : reductionDims) {

compiler/src/iree/compiler/Codegen/LLVMGPU/ROCDLKernelConfig.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static bool isMatvecLike(linalg::LinalgOp linalgOp) {
5555

5656
// Check if the first parallel dimension has bound 1, indicating we found a
5757
// vector shape.
58-
SmallVector<int64_t, 4> bounds = linalgOp.getStaticLoopRanges();
58+
SmallVector<int64_t> bounds = linalgOp.getStaticLoopRanges();
5959
if (bounds[dims->m.front()] != 1)
6060
return false;
6161

@@ -74,7 +74,7 @@ setWarpReductionConfig(IREE::GPU::TargetAttr target,
7474
op.getParallelDims(parallelDims);
7575
op.getReductionDims(reductionDims);
7676

77-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
77+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
7878
int64_t numParallelDims = op.getNumParallelLoops();
7979

8080
if (reductionDims.empty())

compiler/src/iree/compiler/Codegen/SPIRV/KernelConfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ static LogicalResult setReductionConfig(IREE::GPU::TargetAttr target,
10621062
op.getParallelDims(parallelDims);
10631063
op.getReductionDims(reductionDims);
10641064

1065-
SmallVector<int64_t, 4> bounds = op.getStaticLoopRanges();
1065+
SmallVector<int64_t> bounds = op.getStaticLoopRanges();
10661066
int64_t numParallelDims = op.getNumParallelLoops();
10671067

10681068
// We should have reduction dimensions.

compiler/src/iree/compiler/Codegen/Utils/LinalgOpInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ bool isMatmulOrBatchMatmul(linalg::LinalgOp linalgOp) {
133133
// Also exclude the case of matvec, which has only one non-unit parallel dim.
134134
// They should go down different pipelines.
135135
int nonUnitParallelDimCount = 0;
136-
SmallVector<int64_t, 4> bounds = linalgOp.getStaticLoopRanges();
136+
SmallVector<int64_t> bounds = linalgOp.getStaticLoopRanges();
137137
FailureOr<mlir::linalg::ContractionDimensions> contractionDims =
138138
mlir::linalg::inferContractionDims(linalgOp);
139139
assert(succeeded(contractionDims) && "Could not infer contraction dims");

compiler/src/iree/compiler/Dialect/Flow/Transforms/AnnotateDispatches.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static bool isMatvecLike(linalg::LinalgOp linalgOp) {
196196
return false;
197197

198198
// One of the input should have all the parallel dimensions with size one.
199-
SmallVector<int64_t, 4> bounds = linalgOp.getStaticLoopRanges();
199+
SmallVector<int64_t> bounds = linalgOp.getStaticLoopRanges();
200200
SmallVector<AffineMap> maps = linalgOp.getIndexingMapsArray();
201201
SmallVector<utils::IteratorType> iterators = linalgOp.getIteratorTypesArray();
202202

compiler/src/iree/compiler/Dialect/LinalgExt/IR/TilingInterfaceImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ void FftOp::generateScalarImplWithoutCoeffBuf(OpBuilder &b, Location loc,
764764
// We will need exp(-2 * PI * j / m * I), compute "-2 * PI / m" for imag part
765765
// first.
766766
Value coeff = b.create<arith::ConstantFloatOp>(
767-
loc, llvm::APFloat(static_cast<float>(-2 * acos(-1))), f32Type);
767+
loc, f32Type, llvm::APFloat(static_cast<float>(-2 * acos(-1))));
768768
coeff = b.create<arith::DivFOp>(loc, coeff, indexToF32(b, loc, wholeSize));
769769

770770
b.create<linalg::GenericOp>(

0 commit comments

Comments
 (0)