Skip to content

Commit

Permalink
rebase to the latest llvm
Browse files Browse the repository at this point in the history
  • Loading branch information
zhczhong committed Jun 27, 2024
1 parent 6f1445c commit 79b277d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmake/llvm-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
763b96c86d81d51d0db430791a61fd1e8a406bce
891ec2af45c02718c65f539cb6dad1758f079e73
3 changes: 2 additions & 1 deletion include/gc/Dialect/Arith/Utils/EasyBuild.h
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,9 @@ inline EBUnsigned extend(Type type, const EBUnsigned &a) {
}

inline EBFloatPoint extend(Type type, const EBFloatPoint &a) {
arith::FastMathFlagsAttr fastMathAttr;
return OperatorHandlers::create<EBFloatPoint, arith::ExtFOp>(a.builder, type,
a);
a, fastMathAttr);
}

inline EBSigned trunc(Type type, const EBSigned &a) {
Expand Down
10 changes: 6 additions & 4 deletions lib/gc/Transforms/DeepTileContractionNamedOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,12 @@ generateOuterLoop(RewriterBase &b, linalg::LinalgOp linalgOp,
auto tilingResult = linalgX::tileAllUsingForall(
b, cast<PartialReductionOpInterface>(currentOp.getOperation()), {},
tileSizes, newParallelDims, std::nullopt);
if (failed(tilingResult))
if (failed(tilingResult) &&
tilingResult->parallelTiledOps.size() == 1UL)
return failure();
currentOp = dyn_cast<linalg::LinalgOp>(tilingResult->parallelTiledOp);
if (tilingResult->mergeOp) {
currentOp =
dyn_cast<linalg::LinalgOp>(tilingResult->parallelTiledOps.back());
if (!tilingResult->mergeOps.empty()) {
for (const auto &fn : option.finalReduceCallBacks) {
auto result = fn(b, currentOp.getLoc(), *tilingResult);
if (succeeded(result)) {
Expand Down Expand Up @@ -672,7 +674,7 @@ struct deepTileMatmul : public OpInterfaceRewritePattern<linalg::LinalgOp> {
initValue[0].getDefiningOp())
.getDpsInits()[0]);
}
return dyn_cast<linalg::LinalgOp>(result.parallelTiledOp);
return dyn_cast<linalg::LinalgOp>(result.parallelTiledOps.back());
};
option.finalReduceCallBacks.push_back(removeReduncantFill);
}
Expand Down
10 changes: 5 additions & 5 deletions lib/gc/Transforms/Tiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ static void calculateTileOffsetsAndSizes(
OpBuilder::InsertionGuard g(b);
b.setInsertionPointToStart(forallOp.getBody(0));

ValueRange threadIds = forallOp.getInductionVars();
SmallVector<Value> threadIds = forallOp.getInductionVars();
SmallVector<OpFoldResult> nonZeroNumThreads =
llvm::to_vector(llvm::make_filter_range(numThreads, [](OpFoldResult ofr) {
return !isConstantIntValue(ofr, 0);
Expand Down Expand Up @@ -755,8 +755,8 @@ FailureOr<linalg::ForallReductionTilingResult> tileReductionUsingForall(
ForallReductionTilingResult results;
results.initialValues = initTensors;
results.loops = forallOp;
results.parallelTiledOp = tiledOp;
results.mergeOp = mergeOp;
results.parallelTiledOps = {tiledOp};
results.mergeOps = {mergeOp};
return results;
}

Expand Down Expand Up @@ -1069,8 +1069,8 @@ FailureOr<linalg::ForallReductionTilingResult> tileAllUsingForall(
ForallReductionTilingResult results;
results.initialValues = initTensors;
results.loops = forallOp;
results.parallelTiledOp = tiledOp;
results.mergeOp = mergeOp;
results.parallelTiledOps = SmallVector<Operation *>{tiledOp};
results.mergeOps = SmallVector<Operation *>{mergeOp};
return results;
}

Expand Down

0 comments on commit 79b277d

Please sign in to comment.