[mlir][llvm] Fix bswap naming (NFC)
authorChristian Ulmann <christianulmann@gmail.com>
Fri, 7 Apr 2023 14:19:10 +0000 (16:19 +0200)
committerChristian Ulmann <christianulmann@gmail.com>
Fri, 7 Apr 2023 14:22:59 +0000 (16:22 +0200)
As pointed out in https://reviews.llvm.org/D147711#inline-1427665, the
bswap intrinsic is called byteswap, not bitswap.

mlir/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.td
mlir/test/Target/LLVMIR/Import/intrinsic.ll
mlir/test/Target/LLVMIR/llvmir-intrinsics.mlir

index ea84f8a..09f0a4d 100644 (file)
@@ -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">;
index 99197a6..7fc1f39 100644 (file)
@@ -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>
index 0daf1e6..7f3c26a 100644 (file)
@@ -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