[Mlir-commits] [mlir] [MLIR][NVVM] Add Permute Op (PR #169793)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Nov 28 02:20:52 PST 2025
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 origin/main HEAD --extensions cpp -- mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
index 6e1bf71e6..7343d77d1 100644
--- a/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
+++ b/mlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
@@ -457,8 +457,8 @@ LogicalResult PermuteOp::verify() {
case Mode::F4E:
case Mode::B4E:
if (!hasHi)
- return emitError("mode '") << stringifyPermuteMode(getMode())
- << "' requires 'hi' operand.";
+ return emitError("mode '")
+ << stringifyPermuteMode(getMode()) << "' requires 'hi' operand.";
break;
case Mode::RC8:
case Mode::ECL:
@@ -3885,23 +3885,23 @@ PermuteOp::getIntrinsicIDAndArgs(Operation &op, LLVM::ModuleTranslation &mt,
llvm::IRBuilderBase &builder) {
auto thisOp = cast<NVVM::PermuteOp>(op);
NVVM::PermuteMode mode = thisOp.getMode();
-
+
static constexpr llvm::Intrinsic::ID IDs[] = {
llvm::Intrinsic::nvvm_prmt, llvm::Intrinsic::nvvm_prmt_f4e,
llvm::Intrinsic::nvvm_prmt_b4e, llvm::Intrinsic::nvvm_prmt_rc8,
llvm::Intrinsic::nvvm_prmt_ecl, llvm::Intrinsic::nvvm_prmt_ecr,
llvm::Intrinsic::nvvm_prmt_rc16};
-
+
unsigned modeIndex = static_cast<unsigned>(mode);
llvm::SmallVector<llvm::Value *> args;
args.push_back(mt.lookupValue(thisOp.getLo()));
-
- // First 3 modes (Default, f4e, b4e) use 3 operands.
+
+ // First 3 modes (Default, f4e, b4e) use 3 operands.
if (modeIndex < 3)
args.push_back(mt.lookupValue(thisOp.getHi()));
-
+
args.push_back(mt.lookupValue(thisOp.getSelector()));
-
+
return {IDs[modeIndex], args};
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/169793
More information about the Mlir-commits
mailing list