Skip to content

Commit 4127b86

Browse files
New Revert: - llvm/llvm-project@8c05b5c causes numerical errors see (#22354 (comment)) Still carrying these reverts: - llvm/llvm-project#160615 (See #22171) Fixes: - API change to linalg::rewriteAsPaddedOp (llvm/llvm-project@1508a8e) - API change to populateMathToROCDLConversionPatterns (llvm/llvm-project@fbbffc1) - Changes to lit tests --------- Signed-off-by: Muzammiluddin Syed <[email protected]>
1 parent 9e7183e commit 4127b86

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,15 @@ static LogicalResult applyPaddingLevel(RewriterBase &rewriter,
210210
}
211211

212212
// 4. Pad.
213-
SmallVector<tensor::PadOp> padOps;
214-
FailureOr<TilingInterface> maybePaddedOp =
215-
linalg::rewriteAsPaddedOp(rewriter, tilingInterfaceOp, options, padOps);
216-
if (failed(maybePaddedOp)) {
213+
FailureOr<linalg::PadTilingInterfaceResult> maybePadResult =
214+
linalg::rewriteAsPaddedOp(rewriter, tilingInterfaceOp, options);
215+
if (failed(maybePadResult)) {
217216
tilingInterfaceOp.emitWarning("failed to pad op");
218217
return failure();
219218
}
220-
221-
TilingInterface paddedOp = *maybePaddedOp;
219+
const linalg::PadTilingInterfaceResult &padResult = maybePadResult.value();
220+
rewriter.replaceOp(tilingInterfaceOp, padResult.replacements);
221+
TilingInterface paddedOp = padResult.paddedOp;
222222
Location loc = paddedOp.getLoc();
223223

224224
if (auto paddedLinalgOp =
@@ -304,7 +304,7 @@ static LogicalResult applyPaddingLevel(RewriterBase &rewriter,
304304
}
305305

306306
// 5. For each PadOp, create a linalg::CopyOp to allow dim propagations.
307-
for (tensor::PadOp padOp : padOps) {
307+
for (tensor::PadOp padOp : padResult.padOps) {
308308
OpBuilder::InsertionGuard g(rewriter);
309309
rewriter.setInsertionPointAfter(padOp);
310310

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ static LogicalResult padToStaticSizes(RewriterBase &rewriter,
3333
.setPaddingValues(paddingValues)
3434
.setPadToMultipleOf(true);
3535

36-
SmallVector<tensor::PadOp> padOps;
37-
FailureOr<TilingInterface> maybePaddedOp =
38-
linalg::rewriteAsPaddedOp(rewriter, tilingInterfaceOp, options, padOps);
39-
if (failed(maybePaddedOp)) {
36+
FailureOr<linalg::PadTilingInterfaceResult> maybePadResult =
37+
linalg::rewriteAsPaddedOp(rewriter, tilingInterfaceOp, options);
38+
if (failed(maybePadResult)) {
4039
return tilingInterfaceOp->emitOpError("failed to pad op");
4140
}
41+
rewriter.replaceOp(tilingInterfaceOp, maybePadResult->replacements);
4242

4343
return success();
4444
}

compiler/src/iree/compiler/Codegen/Common/test/flatten_memref_subspan.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,4 +632,4 @@ func.func @reinterpret_cast_lowering_dynamic_zero_offset() -> f32 {
632632
}
633633
// CHECK-LABEL: func @reinterpret_cast_lowering_dynamic_zero_offset()
634634
// CHECK: %[[C0:.+]] = arith.constant 0 : index
635-
// CHECK: memref.reinterpret_cast %{{.+}} to offset: [%[[C0]]], sizes: [], strides: [] : memref<?xf32> to memref<f32, strided<[], offset: ?>>
635+
// CHECK: memref.reinterpret_cast %{{.+}} to offset: [0], sizes: [], strides: [] : memref<?xf32> to memref<f32, strided<[]>>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ struct ConvertToROCDLPass final
348348
LLVMConversionTarget target(getContext());
349349
populateFuncToLLVMFuncOpConversionPattern(converter, llvmPatterns);
350350
configureGpuToROCDLConversionLegality(target);
351-
populateMathToROCDLConversionPatterns(converter, llvmPatterns);
351+
populateMathToROCDLConversionPatterns(converter, llvmPatterns,
352+
/*chipset=*/*maybeChipset);
352353
ub::populateUBToLLVMConversionPatterns(converter, llvmPatterns);
353354

354355
if (failed(applyPartialConversion(m, target, std::move(llvmPatterns)))) {

third_party/llvm-project

Submodule llvm-project updated 1705 files

0 commit comments

Comments
 (0)