[Mlir-commits] [mlir] [mlir] Remove unnecessary casts (NFC) (PR #146465)

Kazu Hirata llvmlistbot at llvm.org
Mon Jun 30 21:12:55 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/146465

Note that encodeStringLiteralInto returns void.


>From 50f61cfa2fdf68869c0f7faea2b55f8fc146841a Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Mon, 30 Jun 2025 10:19:14 -0700
Subject: [PATCH] [mlir] Remove unnecessary casts (NFC)

Note that encodeStringLiteralInto returns void.
---
 mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp b/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
index 13c83c00d1523..ffe815b9be5e2 100644
--- a/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
+++ b/mlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
@@ -188,11 +188,11 @@ TEST_F(DeserializationTest, OpMemberNameSuccess) {
   std::swap(typeDecl, binary);
 
   SmallVector<uint32_t, 5> operands1 = {structType, 0};
-  (void)spirv::encodeStringLiteralInto(operands1, "i1");
+  spirv::encodeStringLiteralInto(operands1, "i1");
   addInstruction(spirv::Opcode::OpMemberName, operands1);
 
   SmallVector<uint32_t, 5> operands2 = {structType, 1};
-  (void)spirv::encodeStringLiteralInto(operands2, "i2");
+  spirv::encodeStringLiteralInto(operands2, "i2");
   addInstruction(spirv::Opcode::OpMemberName, operands2);
 
   binary.append(typeDecl.begin(), typeDecl.end());
@@ -227,7 +227,7 @@ TEST_F(DeserializationTest, OpMemberNameExcessOperands) {
   std::swap(typeDecl, binary);
 
   SmallVector<uint32_t, 5> operands = {structType, 0};
-  (void)spirv::encodeStringLiteralInto(operands, "int32");
+  spirv::encodeStringLiteralInto(operands, "int32");
   operands.push_back(42);
   addInstruction(spirv::Opcode::OpMemberName, operands);
 



More information about the Mlir-commits mailing list