Skip to content

Commit 952194c

Browse files
authored
Updated LIT test from landing llvm/llvm-project#136640 which folds linalg.index when size is unit dim (1). Added chipSet argument into populateGpuToROCDLConversionPatterns based on changes in llvm/llvm-project#137360 This patch carries revert of llvm/llvm-project#133231. This PR breaks fp_to_subbytes and emulation_subbyte_types on llvm-cpu tests. iree-test-deps. tracker issue in #20645. llvm/llvm-project#137122. StableHLO and Torch-mlir needs to update their usage of GreedyRewriteConfig to use fluent API. i.e enableRegionSimplification = VS setRegionSimplificationLevel llvm/llvm-project#135970. StableHLO has issue with VHLO_IntegerAttr and APInt not being updated. StableHLO needs to be updated with that PR's change for us to be able to integrate. llvm/llvm-project#121389. Torch-MLIR needs to be updated with that PR's change for us to be able to integrate. --------- Signed-off-by: Stanley Winata <[email protected]>
1 parent 8e2b322 commit 952194c

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,10 @@ struct ConvertToROCDLPass final
314314
populateFuncToLLVMConversionPatterns(converter, llvmPatterns);
315315
cf::populateControlFlowToLLVMConversionPatterns(converter, llvmPatterns);
316316
arith::populateArithToLLVMConversionPatterns(converter, llvmPatterns);
317-
StringRef chipset = getGPUTargetAttr(m).getArch();
318-
FailureOr<amdgpu::Chipset> maybeChipset = amdgpu::Chipset::parse(chipset);
319-
populateAMDGPUToROCDLConversionPatterns(
320-
converter, llvmPatterns, maybeChipset.value_or(amdgpu::Chipset()));
317+
StringRef targetArch = getGPUTargetAttr(m).getArch();
318+
amdgpu::Chipset chipset =
319+
amdgpu::Chipset::parse(targetArch).value_or(amdgpu::Chipset());
320+
populateAMDGPUToROCDLConversionPatterns(converter, llvmPatterns, chipset);
321321
vector::populateVectorRankReducingFMAPattern(llvmPatterns);
322322
vector::populateVectorInsertExtractStridedSliceTransforms(llvmPatterns);
323323
vector::populateVectorStepLoweringPatterns(llvmPatterns);
@@ -326,7 +326,7 @@ struct ConvertToROCDLPass final
326326
vector::populateVectorTransferLoweringPatterns(llvmPatterns,
327327
/*maxTransferRank=*/1);
328328
populateGpuToROCDLConversionPatterns(converter, llvmPatterns,
329-
gpu::amd::Runtime::Unknown);
329+
gpu::amd::Runtime::Unknown, chipset);
330330
LLVMConversionTarget target(getContext());
331331
populateFuncToLLVMFuncOpConversionPattern(converter, llvmPatterns);
332332
configureGpuToROCDLConversionLegality(target);

compiler/src/iree/compiler/GlobalOptimization/test/raise_special_ops.mlir

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -341,18 +341,17 @@ util.func public @test_slice_negate_cat_peephole(%arg0: tensor<1x32x1x128xf16>)
341341

342342
// CHECK-LABEL: util.func public @test_slice_negate_cat_peephole
343343
// CHECK-SAME: %[[ARG0:.+]]: tensor<1x32x1x128xf16>
344+
// CHECK: %[[C0:.+]] = arith.constant 0 : index
344345
// CHECK: %[[C1:.+]] = arith.constant 1 : index
345346
// CHECK: %[[EXPIN:.+]] = tensor.expand_shape %[[ARG0]] {{\[\[}}0], [1], [2], [3, 4]] output_shape [1, 32, 1, 2, 64] : tensor<1x32x1x128xf16> into tensor<1x32x1x2x64xf16>
346347
// CHECK: %[[NREV:.+]] = linalg.generic
347348
// CHECK-SAME: iterator_types = ["parallel", "parallel", "parallel", "parallel", "parallel"]
348349

349-
// CHECK: %[[I0:.+]] = linalg.index 0 : index
350350
// CHECK: %[[I1:.+]] = linalg.index 1 : index
351-
// CHECK: %[[I2:.+]] = linalg.index 2 : index
352351
// CHECK: %[[I3:.+]] = linalg.index 3 : index
353352
// CHECK: %[[I4:.+]] = linalg.index 4 : index
354353
// CHECK: %[[R3:.+]] = arith.subi %[[C1]], %[[I3]] : index
355-
// CHECK: %[[EXTR:.+]] = tensor.extract %expanded[%[[I0]], %[[I1]], %[[I2]], %[[R3]], %[[I4]]] : tensor<1x32x1x2x64xf16>
354+
// CHECK: %[[EXTR:.+]] = tensor.extract %expanded[%[[C0]], %[[I1]], %[[C0]], %[[R3]], %[[I4]]] : tensor<1x32x1x2x64xf16>
356355
// CHECK: %[[NEGF:.+]] = arith.negf %[[EXTR]] : f16
357356
// CHECK: %[[CMP:.+]] = arith.cmpi eq, %[[R3]], %[[C1]] : index
358357
// CHECK: %[[SEL:.+]] = arith.select %[[CMP]], %[[NEGF]], %[[EXTR]] : f16

third_party/llvm-project

Submodule llvm-project updated 177 files

0 commit comments

Comments
 (0)