[Mlir-commits] [mlir] [mlir][spirv] Add folding for IAddCarry/[S|U]MulExtended (PR #73340)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Wed Nov 29 09:14:34 PST 2023
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 59fab2264217648ff11412666b69fb4c5fc9451c 6a51740dc26c3f5907f1945faaac6223413f3d68 -- mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp b/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
index c83014f3c5..48523cd31c 100644
--- a/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
+++ b/mlir/lib/Dialect/SPIRV/IR/SPIRVCanonicalization.cpp
@@ -180,11 +180,11 @@ struct IAddCarryFold final : OpRewritePattern<spirv::IAddCarryOp> {
// Create empty struct
Value undef = rewriter.create<spirv::UndefOp>(loc, op.getType());
// Fill in adds at id 0
- Value intermediate = rewriter.create<spirv::CompositeInsertOp>(loc,
- addsVal, undef, 0);
+ Value intermediate =
+ rewriter.create<spirv::CompositeInsertOp>(loc, addsVal, undef, 0);
// Fill in carrys at id 1
rewriter.replaceOpWithNewOp<spirv::CompositeInsertOp>(op, carrysVal,
- intermediate, 1);
+ intermediate, 1);
return success();
}
};
@@ -265,11 +265,11 @@ struct MulExtendedFold final : OpRewritePattern<MulOp> {
// Create empty struct
Value undef = rewriter.create<spirv::UndefOp>(loc, op.getType());
// Fill in lowBits at id 0
- Value intermediate = rewriter.create<spirv::CompositeInsertOp>(loc,
- lowBitsVal, undef, 0);
+ Value intermediate =
+ rewriter.create<spirv::CompositeInsertOp>(loc, lowBitsVal, undef, 0);
// Fill in highBits at id 1
rewriter.replaceOpWithNewOp<spirv::CompositeInsertOp>(op, highBitsVal,
- intermediate, 1);
+ intermediate, 1);
return success();
}
};
``````````
</details>
https://github.com/llvm/llvm-project/pull/73340
More information about the Mlir-commits
mailing list