Skip to content

Commit ddd649a

Browse files
committed
1 parent 7d04ae0 commit ddd649a

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

mlir/lib/Conversion/RockToGPU/RockToGPU.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ void LowerRockOpsToGPUPass::runOnOperation() {
317317
auto blockVal = b.create<arith::ConstantIndexOp>(loc, blockSize);
318318
auto cst1 = b.create<arith::ConstantIndexOp>(loc, 1);
319319
auto dynamicSharedMemSize =
320-
b.create<arith::ConstantIntOp>(loc, 0, b.getI32Type());
320+
b.create<arith::ConstantIntOp>(loc, b.getI32Type(), 0);
321321
gpu::KernelDim3 gridDims{gridVal, cst1, cst1};
322322
gpu::KernelDim3 blockDims{blockVal, cst1, cst1};
323323
b.create<gpu::LaunchFuncOp>(loc, gpuFunc, gridDims, blockDims,

mlir/lib/Dialect/Rock/Transforms/ConvToGemm.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ struct ZeroInitKernelRewritePattern final
353353
Value zeroIndex = b.createOrFold<arith::ConstantIndexOp>(loc, 0);
354354
Value memref = makeGpuAllocContaining(b, initOp);
355355
Value trueOp =
356-
b.createOrFold<arith::ConstantIntOp>(loc, true, b.getI1Type());
356+
b.createOrFold<arith::ConstantIntOp>(loc, b.getI1Type(), true);
357357
GemmFeatures features = op.getFeatures();
358358

359359
auto loopBody = [&memref, &initVectorLen, &trueOp, &features, &zeroIndex,
@@ -397,7 +397,7 @@ struct ConvertingCopyKernelRewritePattern final
397397

398398
Type loadType = vectorTypeOrSelf(inputDataType, conversionVectorLen);
399399
Type storeType = vectorTypeOrSelf(outputDataType, conversionVectorLen);
400-
Value trueOp = b.create<arith::ConstantIntOp>(loc, true, b.getI1Type());
400+
Value trueOp = b.create<arith::ConstantIntOp>(loc, b.getI1Type(), true);
401401
GemmFeatures features = op.getFeatures();
402402
bool needs64BitIdx =
403403
is4GBMemoryType(input.getType()) || is4GBMemoryType(output.getType());

mlir/lib/Dialect/Rock/Transforms/SugarToLoops.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ struct TransformingForRewritePattern
199199
if (!useDiffs || transforms.empty()) {
200200
AffineResults computed;
201201
Value isValid =
202-
b.create<arith::ConstantIntOp>(loc, true, b.getI1Type());
202+
b.create<arith::ConstantIntOp>(loc, b.getI1Type(), true);
203203
// Start by offsetting the upper inputs.
204204
for (auto p : llvm::zip(op.getUpperInits(i), ivs)) {
205205
computed.push_back(
@@ -227,7 +227,7 @@ struct TransformingForRewritePattern
227227
} else { // index diff maps
228228
IndexDiffUpdateOp lastDiff;
229229
Value isValid =
230-
b.create<arith::ConstantIntOp>(loc, true, b.getI1Type());
230+
b.create<arith::ConstantIntOp>(loc, b.getI1Type(), true);
231231
for (const auto &[t, lowerInit] : llvm::zip(
232232
transforms.getAsRange<TransformMapAttr>(), lowerInits[i])) {
233233
if (!lastDiff)

mlir/lib/Dialect/Rock/Transforms/ThreadwiseGemmLowering.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,8 @@ LogicalResult ThreadwiseReadIntoRewritePattern::matchAndRewrite(
572572
op.getValidityRecord() && !op.getValidityRecord().use_empty();
573573
Value validityInit = nullptr;
574574
if (recordsValidity) {
575-
Value trueConst = b.createOrFold<arith::ConstantIntOp>(loc, true, 1);
575+
Value trueConst =
576+
b.createOrFold<arith::ConstantIntOp>(loc, b.getI1Type(), true);
576577
validityInit = b.create<vector::SplatOp>(
577578
loc, op.getValidityRecord().getType(), trueConst);
578579
}

mlir/lib/Dialect/Rock/utility/transformMapUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ Value mlir::rock::updateValidityAfter(OpBuilder &b, Location loc,
10751075
TransformMapAttr map,
10761076
ValueRange outputs) {
10771077
Value isValid =
1078-
b.createOrFold<arith::ConstantIntOp>(loc, true, b.getI1Type());
1078+
b.createOrFold<arith::ConstantIntOp>(loc, b.getI1Type(), true);
10791079
ArrayRef<int64_t> lowerBounds = map.getLowerBounds();
10801080

10811081
// unsigned < catches both negatives (as all negatives are > the bound)

mlir/tools/rocmlir-gen/rocmlir-gen.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,8 +1361,8 @@ static func::FuncOp createGPUWrapper(ModuleOp module,
13611361
// Emit device selection
13621362
if (deviceNum.getNumOccurrences() > 0)
13631363
b.create<gpu::SetDefaultDeviceOp>(
1364-
loc, b.create<arith::ConstantIntOp>(loc, deviceNum.getValue(),
1365-
b.getIntegerType(32)));
1364+
loc, b.create<arith::ConstantIntOp>(loc, b.getIntegerType(32),
1365+
deviceNum.getValue()));
13661366

13671367
SmallVector<Value, 4> cpuMem;
13681368
SmallVector<Value, 4> gpuMem;
@@ -1569,7 +1569,7 @@ static LogicalResult populateRandomTensorFillLogic(OpBuilder &b, Location loc,
15691569
if (i16vals.find(v) == i16vals.end()) {
15701570
auto i16Type = b.getIntegerType(16);
15711571
i16vals.try_emplace(
1572-
v, b.createOrFold<arith::ConstantIntOp>(loc, v, i16Type));
1572+
v, b.createOrFold<arith::ConstantIntOp>(loc, i16Type, v));
15731573
}
15741574
return i16vals[v];
15751575
};
@@ -3924,7 +3924,7 @@ static func::FuncOp createVerifierFunc(ModuleOp module, const KernelIF &kernel,
39243924

39253925
auto getF32Val = [&](float val) -> Value {
39263926
llvm::APFloat apVal(val);
3927-
return b.create<arith::ConstantFloatOp>(loc, apVal, floatType);
3927+
return b.create<arith::ConstantFloatOp>(loc, floatType, apVal);
39283928
};
39293929
// Thresholds for different metrics
39303930
// RMS: 0.00003f for all data types
@@ -4386,7 +4386,7 @@ static LogicalResult populateHostHarnessLogic(
43864386
if (isRandom) {
43874387
auto seedFunc = makeFuncDecl(module, "seedRandomValues", {b.getI32Type()});
43884388
int seed = getRandomSeed();
4389-
Value seedConst = b.create<arith::ConstantIntOp>(loc, seed, b.getI32Type());
4389+
Value seedConst = b.create<arith::ConstantIntOp>(loc, b.getI32Type(), seed);
43904390
b.create<func::CallOp>(loc, seedFunc, seedConst);
43914391
}
43924392

@@ -4458,7 +4458,7 @@ static LogicalResult populateHostHarnessLogic(
44584458
for (auto pair : llvm::enumerate(currentSeqLen)) {
44594459
Value index = b.create<arith::ConstantIndexOp>(loc, pair.index());
44604460
Value value =
4461-
b.create<arith::ConstantIntOp>(loc, pair.value(), b.getI32Type());
4461+
b.create<arith::ConstantIntOp>(loc, b.getI32Type(), pair.value());
44624462
b.create<memref::StoreOp>(loc, value, lvar, ValueRange{index});
44634463
}
44644464
} else if (!isRandom) {

0 commit comments

Comments
 (0)