Skip to content

Commit b3ed33d

Browse files
IanWood1KyleHerndon
authored andcommitted
- Carries the same 4 reverts from iree-org#20674. - Uses enum when building `LLVM::GEPOp` (llvm/llvm-project#137272) - Reverts llvm/llvm-project@7318074 which can be undone after torch-mlir and stablehlo have been updated. - Reverts llvm/llvm-project#137930 and llvm/llvm-project@e1cff21 to fix correctness failure of e2e_matmul_cdna3_pad_i8_rocm_hip. --------- Signed-off-by: Ian Wood <[email protected]>
1 parent 2a0f47a commit b3ed33d

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

compiler/src/iree/compiler/Codegen/Common/GPU/test/gpu_nested_layout_vector_distribution_mask.mlir

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,9 @@ builtin.module attributes { transform.with_named_sequence } {
223223
// CHECK: %[[RED_IDENTITY:.+]] = arith.constant dense<0.000000e+00> : vector<2x1x2x1x2x8xf16>
224224

225225
// CHECK: %[[MASK:.+]] = vector.create_mask
226-
// CHECK: %[[MASK_PCK:.+]] = vector.shape_cast %[[MASK]] : vector<8x8xi1> to vector<2x2x2x1x1x8xi1>
227-
// CHECK: %[[MASK_ITL_PCK:.+]] = vector.transpose %[[MASK_PCK]], [0, 3, 1, 4, 2, 5] : vector<2x2x2x1x1x8xi1> to vector<2x1x2x1x2x8xi1>
226+
// CHECK: %[[MASK_PCK:.+]] = vector.shape_cast %[[MASK]] : vector<8x8xi1> to vector<2x1x2x1x2x8xi1>
228227

229-
// CHECK: %[[SELECT:.+]] = arith.select %[[MASK_ITL_PCK]], {{.*}}, %[[RED_IDENTITY]] : vector<2x1x2x1x2x8xi1>, vector<2x1x2x1x2x8xf16>
228+
// CHECK: %[[SELECT:.+]] = arith.select %[[MASK_PCK]], {{.*}}, %[[RED_IDENTITY]] : vector<2x1x2x1x2x8xi1>, vector<2x1x2x1x2x8xf16>
230229
// CHECK: vector.multi_reduction <add>, %[[SELECT]], {{.*}} [0, 2, 4] : vector<2x1x2x1x2x8xf16> to vector<1x1x8xf16>
231230

232231
// -----
@@ -308,8 +307,7 @@ builtin.module attributes { transform.with_named_sequence } {
308307
// Currently, it does not fold away.
309308
// CHECK-DAG: %[[MASK_OP_1D:.+]] = vector.extract %[[MASK_OP]][0] : vector<2xi1> from vector<2x2xi1>
310309
// CHECK-DAG: %[[MASK_OP_1D_PACKED:.+]] = vector.shape_cast %[[MASK_OP_1D]] : vector<2xi1> to vector<1x1x2xi1>
311-
// CHECK-DAG: %[[MASK_OP_PACKED:.+]] = vector.shape_cast %[[MASK_OP]] : vector<2x2xi1> to vector<1x1x2x1x1x2xi1>
312-
// CHECK-DAG: %[[MASK_OP_INTERLEAVED:.+]] = vector.transpose %[[MASK_OP_PACKED]], [0, 3, 1, 4, 2, 5] : vector<1x1x2x1x1x2xi1> to vector<1x1x1x1x2x2xi1>
310+
// CHECK-DAG: %[[MASK_OP_PACKED:.+]] = vector.shape_cast %[[MASK_OP]] : vector<2x2xi1> to vector<1x1x1x1x2x2xi1>
313311
// CHECK-DAG: %[[MASK_OUT:.+]] = vector.create_mask {{.*}} : vector<2xi1>
314312

315313
// CHECK-DAG: %[[LHS_READ:.+]] = vector.transfer_read %arg0{{.*}} %[[MASK_LHS]] {in_bounds = [true]} : memref<?xf16>, vector<2xf16>
@@ -318,6 +316,6 @@ builtin.module attributes { transform.with_named_sequence } {
318316
// CHECK-DAG: %[[RHS:.+]] = vector.insert_strided_slice %[[RHS_READ]]
319317

320318
// CHECK-DAG: %[[LHS_SELECT:.+]] = arith.select %[[MASK_OP_1D_PACKED]], %[[LHS]], %[[RED_IDENTITY_LHS]] : vector<1x1x2xi1>, vector<1x1x2xf16>
321-
// CHECK-DAG: %[[RHS_SELECT:.+]] = arith.select %[[MASK_OP_INTERLEAVED]], %[[RHS]], %[[RED_IDENTITY_RHS]] : vector<1x1x1x1x2x2xi1>, vector<1x1x1x1x2x2xf16>
319+
// CHECK-DAG: %[[RHS_SELECT:.+]] = arith.select %[[MASK_OP_PACKED]], %[[RHS]], %[[RED_IDENTITY_RHS]] : vector<1x1x1x1x2x2xi1>, vector<1x1x1x1x2x2xf16>
322320

323321
// CHECK: vector.contract {{.*}} %[[LHS_SELECT]], %[[RHS_SELECT]]

compiler/src/iree/compiler/Codegen/LLVMCPU/ConvertToLLVM.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,9 +349,9 @@ acquireInstrumentationEntry(Location loc, Value buffer, Value bufferPtr,
349349
Value offsetIndex =
350350
builder.create<LLVM::ConstantOp>(loc, i64Type, headOffset);
351351
auto i8Type = builder.getI8Type();
352-
Value offsetPtr = builder.create<LLVM::GEPOp>(loc, basePtr.getType(), i8Type,
353-
basePtr, offsetIndex,
354-
/*inbounds=*/true);
352+
Value offsetPtr = builder.create<LLVM::GEPOp>(
353+
loc, basePtr.getType(), i8Type, basePtr, offsetIndex,
354+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
355355
Value rawOffset = builder.create<LLVM::AtomicRMWOp>(
356356
loc, LLVM::AtomicBinOp::add, offsetPtr, entrySize,
357357
LLVM::AtomicOrdering::monotonic);

compiler/src/iree/compiler/Codegen/LLVMCPU/DispatchABI.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -952,11 +952,12 @@ Value HALDispatchABI::updateProcessorDataFromTargetAttr(
952952
for (int64_t i = 1, e = ProcessorDataCapacity; i < e; ++i) {
953953
Value loadPtr = builder.create<LLVM::GEPOp>(
954954
loc, processorDataPtrValue.getType(), i64Ty, processorDataPtrValue,
955-
LLVM::GEPArg(int32_t(i)), /*inbounds =*/true);
955+
LLVM::GEPArg(int32_t(i)),
956+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
956957
Value loadVal = builder.create<LLVM::LoadOp>(loc, i64Ty, loadPtr);
957958
Value storePtr = builder.create<LLVM::GEPOp>(
958959
loc, alloca.getType(), i64Ty, alloca, LLVM::GEPArg(int32_t(i)),
959-
/*inbounds =*/true);
960+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
960961
builder.create<LLVM::StoreOp>(loc, loadVal, storePtr);
961962
}
962963
return alloca;
@@ -978,12 +979,12 @@ Value HALDispatchABI::loadProcessorData(Operation *forOp, OpBuilder &builder) {
978979
loc, LLVM::LLVMPointerType::get(context),
979980
LLVM::LLVMPointerType::get(context), environmentPtrValue,
980981
LLVM::GEPArg(int32_t(EnvironmentField::processor)),
981-
/*inbounds=*/true);
982+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
982983
Value processorDataPtrValue = builder.create<LLVM::GEPOp>(
983984
loc, LLVM::LLVMPointerType::get(context),
984985
LLVM::LLVMPointerType::get(context), processorPtrValue,
985986
LLVM::GEPArg(int32_t(ProcessorField::data)),
986-
/*inbounds=*/true);
987+
/*noWrapFlags =*/LLVM::GEPNoWrapFlags::inbounds);
987988
Value updatedProcessorData =
988989
updateProcessorDataFromTargetAttr(forOp, processorDataPtrValue, builder);
989990
return buildValueDI(forOp, updatedProcessorData, "processor_data",

third_party/llvm-project

0 commit comments

Comments
 (0)