[Mlir-commits] [mlir] 3f4d160 - [mlir][llvm] Fix bswap naming (NFC)
Christian Ulmann
llvmlistbot at llvm.org
Fri Apr 7 07:23:33 PDT 2023
Author: Christian Ulmann
Date: 2023-04-07T16:22:59+02:00
New Revision: 3f4d16018d51c9deff8e7deb01cefcf52e966cd3
URL: https://github.com/llvm/llvm-project/commit/3f4d16018d51c9deff8e7deb01cefcf52e966cd3
DIFF: https://github.com/llvm/llvm-project/commit/3f4d16018d51c9deff8e7deb01cefcf52e966cd3.diff
LOG: [mlir][llvm] Fix bswap naming (NFC)
As pointed out in https://reviews.llvm.org/D147711#inline-1427665, the
bswap intrinsic is called byteswap, not bitswap.
Added:
Modified:
mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
mlir/test/Target/LLVMIR/Import/intrinsic.ll
mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
index ea84f8a2f5e0b..09f0a4d2447b4 100644
--- a/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
+++ b/mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
@@ -129,7 +129,7 @@ def LLVM_PowIOp : LLVM_OneResultIntrOp<"powi", [], [0,1],
"functional-type(operands, results)";
}
def LLVM_BitReverseOp : LLVM_UnaryIntrOpI<"bitreverse">;
-def LLVM_BitSwapOp : LLVM_UnaryIntrOpI<"bswap">;
+def LLVM_ByteSwapOp : LLVM_UnaryIntrOpI<"bswap">;
def LLVM_CountLeadingZerosOp : LLVM_CountZerosIntrOp<"ctlz">;
def LLVM_CountTrailingZerosOp : LLVM_CountZerosIntrOp<"cttz">;
def LLVM_CtPopOp : LLVM_UnaryIntrOpI<"ctpop">;
diff --git a/mlir/test/Target/LLVMIR/Import/intrinsic.ll b/mlir/test/Target/LLVMIR/Import/intrinsic.ll
index 99197a652f4aa..7fc1f39148e79 100644
--- a/mlir/test/Target/LLVMIR/Import/intrinsic.ll
+++ b/mlir/test/Target/LLVMIR/Import/intrinsic.ll
@@ -125,8 +125,8 @@ define void @bitreverse_test(i32 %0, <8 x i32> %1) {
%4 = call <8 x i32> @llvm.bitreverse.v8i32(<8 x i32> %1)
ret void
}
-; CHECK-LABEL: llvm.func @bitswap_test
-define void @bitswap_test(i32 %0, <8 x i32> %1) {
+; CHECK-LABEL: llvm.func @byteswap_test
+define void @byteswap_test(i32 %0, <8 x i32> %1) {
; CHECK: llvm.intr.bswap(%{{.*}}) : (i32) -> i32
%3 = call i32 @llvm.bswap.i32(i32 %0)
; CHECK: llvm.intr.bswap(%{{.*}}) : (vector<8xi32>) -> vector<8xi32>
diff --git a/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir b/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
index 0daf1e61abb61..7f3c26ab33b82 100644
--- a/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
+++ b/mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir
@@ -143,8 +143,8 @@ llvm.func @bitreverse_test(%arg0: i32, %arg1: vector<8xi32>) {
llvm.return
}
-// CHECK-LABEL: @bitswap_test
-llvm.func @bitswap_test(%arg0: i32, %arg1: vector<8xi32>) {
+// CHECK-LABEL: @byteswap_test
+llvm.func @byteswap_test(%arg0: i32, %arg1: vector<8xi32>) {
// CHECK: call i32 @llvm.bswap.i32
"llvm.intr.bswap"(%arg0) : (i32) -> i32
// CHECK: call <8 x i32> @llvm.bswap.v8i32
More information about the Mlir-commits
mailing list