Skip to content

Commit b69c5b8

Browse files
committed
format
1 parent 5b7efd8 commit b69c5b8

File tree

285 files changed

+5866
-5467
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

285 files changed

+5866
-5467
lines changed

flang/lib/Optimizer/Dialect/FIRCG/CGOps.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313
#include "flang/Optimizer/Dialect/FIRCG/CGOps.h"
1414
#include "flang/Optimizer/Dialect/FIRDialect.h"
15-
#include "mlir/IR/ImplicitLocOpBuilder.h"
1615
#include "flang/Optimizer/Dialect/FIROps.h"
1716
#include "flang/Optimizer/Dialect/FIRType.h"
17+
#include "mlir/IR/ImplicitLocOpBuilder.h"
1818

1919
/// FIR codegen dialect constructor.
2020
fir::FIRCodeGenDialect::FIRCodeGenDialect(mlir::MLIRContext *ctx)

mlir/examples/standalone/lib/Standalone/StandaloneDialect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
#include "Standalone/StandaloneDialect.h"
1010
#include "Standalone/StandaloneOps.h"
11-
#include "mlir/IR/ImplicitLocOpBuilder.h"
1211
#include "Standalone/StandaloneTypes.h"
12+
#include "mlir/IR/ImplicitLocOpBuilder.h"
1313

1414
using namespace mlir;
1515
using namespace mlir::standalone;

mlir/lib/Conversion/AMDGPUToROCDL/AMDGPUToROCDL.cpp

Lines changed: 90 additions & 82 deletions
Large diffs are not rendered by default.

mlir/lib/Conversion/AffineToStandard/AffineToStandard.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class AffineForLowering : public OpRewritePattern<AffineForOp> {
156156
Value step =
157157
arith::ConstantIndexOp::create(rewriter, loc, op.getStepAsInt());
158158
auto scfForOp = scf::ForOp::create(rewriter, loc, lowerBound, upperBound,
159-
step, op.getInits());
159+
step, op.getInits());
160160
rewriter.eraseBlock(scfForOp.getBody());
161161
rewriter.inlineRegionBefore(op.getRegion(), scfForOp.getRegion(),
162162
scfForOp.getRegion().end());
@@ -206,8 +206,8 @@ class AffineParallelLowering : public OpRewritePattern<AffineParallelOp> {
206206
if (op.getResults().empty()) {
207207
// Case with no reduction operations/return values.
208208
parOp = scf::ParallelOp::create(rewriter, loc, lowerBoundTuple,
209-
upperBoundTuple, steps,
210-
/*bodyBuilderFn=*/nullptr);
209+
upperBoundTuple, steps,
210+
/*bodyBuilderFn=*/nullptr);
211211
rewriter.eraseBlock(parOp.getBody());
212212
rewriter.inlineRegionBefore(op.getRegion(), parOp.getRegion(),
213213
parOp.getRegion().end());
@@ -233,9 +233,9 @@ class AffineParallelLowering : public OpRewritePattern<AffineParallelOp> {
233233
identityVals.push_back(
234234
arith::getIdentityValue(reductionOpValue, resultType, rewriter, loc));
235235
}
236-
parOp = scf::ParallelOp::create(rewriter,
237-
loc, lowerBoundTuple, upperBoundTuple, steps, identityVals,
238-
/*bodyBuilderFn=*/nullptr);
236+
parOp = scf::ParallelOp::create(rewriter, loc, lowerBoundTuple,
237+
upperBoundTuple, steps, identityVals,
238+
/*bodyBuilderFn=*/nullptr);
239239

240240
// Copy the body of the affine.parallel op.
241241
rewriter.eraseBlock(parOp.getBody());
@@ -299,17 +299,17 @@ class AffineIfLowering : public OpRewritePattern<AffineIfOp> {
299299
isEquality ? arith::CmpIPredicate::eq : arith::CmpIPredicate::sge;
300300
Value cmpVal =
301301
arith::CmpIOp::create(rewriter, loc, pred, affResult, zeroConstant);
302-
cond = cond
303-
? arith::AndIOp::create(rewriter, loc, cond, cmpVal).getResult()
304-
: cmpVal;
302+
cond =
303+
cond ? arith::AndIOp::create(rewriter, loc, cond, cmpVal).getResult()
304+
: cmpVal;
305305
}
306306
cond = cond ? cond
307307
: arith::ConstantIntOp::create(rewriter, loc, /*value=*/1,
308-
/*width=*/1);
308+
/*width=*/1);
309309

310310
bool hasElseRegion = !op.getElseRegion().empty();
311311
auto ifOp = scf::IfOp::create(rewriter, loc, op.getResultTypes(), cond,
312-
hasElseRegion);
312+
hasElseRegion);
313313
rewriter.inlineRegionBefore(op.getThenRegion(),
314314
&ifOp.getThenRegion().back());
315315
rewriter.eraseBlock(&ifOp.getThenRegion().back());

mlir/lib/Conversion/ArithToAMDGPU/ArithToAMDGPU.cpp

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,16 @@ ExtFOnFloat8RewritePattern::matchAndRewrite(arith::ExtFOp op,
139139
Type outElemType = getElementTypeOrSelf(op.getOut().getType());
140140
VectorType extResType = VectorType::get(2, rewriter.getF32Type());
141141
if (!inVecType) {
142-
Value asFloat = amdgpu::ExtPackedFp8Op::create(rewriter,
143-
loc, rewriter.getF32Type(), in, 0);
142+
Value asFloat = amdgpu::ExtPackedFp8Op::create(
143+
rewriter, loc, rewriter.getF32Type(), in, 0);
144144
Value result = castF32To(outElemType, asFloat, loc, rewriter);
145145
rewriter.replaceOp(op, result);
146146
return success();
147147
}
148148
int64_t numElements = inVecType.getNumElements();
149149

150-
Value zero = arith::ConstantOp::create(rewriter,
151-
loc, outElemType, rewriter.getFloatAttr(outElemType, 0.0));
150+
Value zero = arith::ConstantOp::create(
151+
rewriter, loc, outElemType, rewriter.getFloatAttr(outElemType, 0.0));
152152
VectorType outType = cast<VectorType>(op.getOut().getType());
153153

154154
if (inVecType.getShape().empty()) {
@@ -158,8 +158,8 @@ ExtFOnFloat8RewritePattern::matchAndRewrite(arith::ExtFOp op,
158158
vector::ExtractOp::create(rewriter, loc, in, ArrayRef<int64_t>{});
159159
Value scalarExt =
160160
arith::ExtFOp::create(rewriter, loc, outElemType, scalarIn);
161-
Value result = vector::InsertOp::create(rewriter, loc, scalarExt, zerodSplat,
162-
ArrayRef<int64_t>{});
161+
Value result = vector::InsertOp::create(rewriter, loc, scalarExt,
162+
zerodSplat, ArrayRef<int64_t>{});
163163
rewriter.replaceOp(op, result);
164164
return success();
165165
}
@@ -176,19 +176,19 @@ ExtFOnFloat8RewritePattern::matchAndRewrite(arith::ExtFOp op,
176176

177177
for (int64_t i = 0; i < numElements; i += 4) {
178178
int64_t elemsThisOp = std::min(numElements, i + 4) - i;
179-
Value inSlice = vector::ExtractStridedSliceOp::create(rewriter,
180-
loc, in, i, elemsThisOp, 1);
179+
Value inSlice = vector::ExtractStridedSliceOp::create(rewriter, loc, in, i,
180+
elemsThisOp, 1);
181181
for (int64_t j = 0; j < elemsThisOp; j += 2) {
182182
if (i + j + 1 < numElements) { // Convert two 8-bit elements
183-
Value asFloats = amdgpu::ExtPackedFp8Op::create(rewriter,
184-
loc, extResType, inSlice, j / 2);
183+
Value asFloats = amdgpu::ExtPackedFp8Op::create(
184+
rewriter, loc, extResType, inSlice, j / 2);
185185
Type desType = VectorType::get(2, outElemType);
186186
Value asType = castF32To(desType, asFloats, loc, rewriter);
187-
result = vector::InsertStridedSliceOp::create(rewriter,
188-
loc, asType, result, i + j, 1);
187+
result = vector::InsertStridedSliceOp::create(rewriter, loc, asType,
188+
result, i + j, 1);
189189
} else { // Convert a 8-bit element
190-
Value asFloat = amdgpu::ExtPackedFp8Op::create(rewriter,
191-
loc, rewriter.getF32Type(), inSlice, j / 2 * 2);
190+
Value asFloat = amdgpu::ExtPackedFp8Op::create(
191+
rewriter, loc, rewriter.getF32Type(), inSlice, j / 2 * 2);
192192
Value asType = castF32To(outElemType, asFloat, loc, rewriter);
193193
result = vector::InsertOp::create(rewriter, loc, asType, result, i + j);
194194
}
@@ -250,11 +250,13 @@ static Value clampInput(PatternRewriter &rewriter, Location loc,
250250
loc, arith::CmpFPredicate::OEQ, source, negInf);
251251
Value isNan = rewriter.createOrFold<arith::CmpFOp>(
252252
loc, arith::CmpFPredicate::UNO, source, source);
253-
Value isNonFinite = arith::OrIOp::create(rewriter,
254-
loc, arith::OrIOp::create(rewriter, loc, isInf, isNegInf), isNan);
253+
Value isNonFinite = arith::OrIOp::create(
254+
rewriter, loc, arith::OrIOp::create(rewriter, loc, isInf, isNegInf),
255+
isNan);
255256

256257
Value clampedBelow = arith::MaximumFOp::create(rewriter, loc, source, minCst);
257-
Value clamped = arith::MinimumFOp::create(rewriter, loc, clampedBelow, maxCst);
258+
Value clamped =
259+
arith::MinimumFOp::create(rewriter, loc, clampedBelow, maxCst);
258260
Value res =
259261
arith::SelectOp::create(rewriter, loc, isNonFinite, source, clamped);
260262
return res;
@@ -290,25 +292,25 @@ TruncFToFloat8RewritePattern::matchAndRewrite(arith::TruncFOp op,
290292
VectorType truncResType = VectorType::get(4, outElemType);
291293
if (!inVectorTy) {
292294
Value asFloat = castToF32(in, loc, rewriter);
293-
Value asF8s = amdgpu::PackedTrunc2xFp8Op::create(rewriter,
294-
loc, truncResType, asFloat, /*sourceB=*/nullptr, 0,
295+
Value asF8s = amdgpu::PackedTrunc2xFp8Op::create(
296+
rewriter, loc, truncResType, asFloat, /*sourceB=*/nullptr, 0,
295297
/*existing=*/nullptr);
296298
Value result = vector::ExtractOp::create(rewriter, loc, asF8s, 0);
297299
rewriter.replaceOp(op, result);
298300
return success();
299301
}
300302

301303
int64_t numElements = outVecType.getNumElements();
302-
Value zero = arith::ConstantOp::create(rewriter,
303-
loc, outElemType, rewriter.getFloatAttr(outElemType, 0.0));
304+
Value zero = arith::ConstantOp::create(
305+
rewriter, loc, outElemType, rewriter.getFloatAttr(outElemType, 0.0));
304306
if (outVecType.getShape().empty()) {
305307
Value scalarIn =
306308
vector::ExtractOp::create(rewriter, loc, in, ArrayRef<int64_t>{});
307309
// Recurse to send the 0-D vector case to the 1-D vector case
308310
Value scalarTrunc =
309311
arith::TruncFOp::create(rewriter, loc, outElemType, scalarIn);
310312
Value result = vector::InsertOp::create(rewriter, loc, scalarTrunc, zero,
311-
ArrayRef<int64_t>{});
313+
ArrayRef<int64_t>{});
312314
rewriter.replaceOp(op, result);
313315
return success();
314316
}
@@ -334,14 +336,14 @@ TruncFToFloat8RewritePattern::matchAndRewrite(arith::TruncFOp op,
334336
Value elemB = vector::ExtractOp::create(rewriter, loc, in, i + j + 1);
335337
asFloatB = castToF32(elemB, loc, rewriter);
336338
}
337-
thisResult = amdgpu::PackedTrunc2xFp8Op::create(rewriter,
338-
loc, truncResType, asFloatA, asFloatB, j / 2, thisResult);
339+
thisResult = amdgpu::PackedTrunc2xFp8Op::create(
340+
rewriter, loc, truncResType, asFloatA, asFloatB, j / 2, thisResult);
339341
}
340342
if (elemsThisOp < 4)
341-
thisResult = vector::ExtractStridedSliceOp::create(rewriter,
342-
loc, thisResult, 0, elemsThisOp, 1);
343+
thisResult = vector::ExtractStridedSliceOp::create(
344+
rewriter, loc, thisResult, 0, elemsThisOp, 1);
343345
result = vector::InsertStridedSliceOp::create(rewriter, loc, thisResult,
344-
result, i, 1);
346+
result, i, 1);
345347
}
346348

347349
if (inVectorTy.getRank() != outVecType.getRank()) {
@@ -407,10 +409,10 @@ LogicalResult TruncfToFloat16RewritePattern::matchAndRewrite(
407409
ROCDL::CvtPkRtz::create(rewriter, loc, truncResType, elemA, elemB);
408410
// Place back the truncated result into the possibly larger vector. If we
409411
// are operating on a size 2 vector, these operations should be folded away
410-
thisResult = vector::ExtractStridedSliceOp::create(rewriter,
411-
loc, thisResult, 0, elemsThisOp, 1);
412+
thisResult = vector::ExtractStridedSliceOp::create(
413+
rewriter, loc, thisResult, 0, elemsThisOp, 1);
412414
result = vector::InsertStridedSliceOp::create(rewriter, loc, thisResult,
413-
result, i, 1);
415+
result, i, 1);
414416
}
415417

416418
if (inVectorTy.getRank() != outVecType.getRank()) {

mlir/lib/Conversion/ArithToArmSME/ArithToArmSME.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ struct ConstantOpToArmSMELowering : public OpRewritePattern<arith::ConstantOp> {
8181
Value currentTile) {
8282
// Create 'arm_sme.insert_tile_slice' to write vector to tile
8383
// slice.
84-
auto nextTile = arm_sme::InsertTileSliceOp::create(b,
85-
loc, tileType, constantOp1D, currentTile, tileSliceIndex);
84+
auto nextTile = arm_sme::InsertTileSliceOp::create(
85+
b, loc, tileType, constantOp1D, currentTile, tileSliceIndex);
8686
return nextTile.getResult();
8787
};
8888
auto forOp = mlir::arm_sme::createLoopOverTileSlices(

0 commit comments

Comments
 (0)