[llvm] [ARM][NFC] Remove redundant sub-expressions (PR #122911)

Longsheng Mou via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 06:47:14 PST 2025


https://github.com/CoTinker created https://github.com/llvm/llvm-project/pull/122911

This PR removes redundant sub-expressions `Mnemonic != "vqmovnt"`, which is mentioned in https://pvs-studio.com/en/blog/posts/cpp/1188/.

>From af4beef6c9dd6f0e43b901b7cb0b040d62f55012 Mon Sep 17 00:00:00 2001
From: Longsheng Mou <longshengmou at gmail.com>
Date: Tue, 14 Jan 2025 22:43:13 +0800
Subject: [PATCH] [ARM][NFC] Remove redundant sub-expressions

This PR removes redundant sub-expressions `Mnemonic != "vqmovnt"`,
which is mentioned in https://pvs-studio.com/en/blog/posts/cpp/1188/.
---
 llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 024a64aceedbdc..dad91c6a969e87 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -6663,9 +6663,9 @@ StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic, StringRef ExtraToken,
       Mnemonic != "vshllt" && Mnemonic != "vrshrnt" && Mnemonic != "vshrnt" &&
       Mnemonic != "vqrshrunt" && Mnemonic != "vqshrunt" &&
       Mnemonic != "vqrshrnt" && Mnemonic != "vqshrnt" && Mnemonic != "vmullt" &&
-      Mnemonic != "vqmovnt" && Mnemonic != "vqmovunt" &&
-      Mnemonic != "vqmovnt" && Mnemonic != "vmovnt" && Mnemonic != "vqdmullt" &&
-      Mnemonic != "vpnot" && Mnemonic != "vcvtt" && Mnemonic != "vcvt") {
+      Mnemonic != "vqmovnt" && Mnemonic != "vqmovunt" && Mnemonic != "vmovnt" &&
+      Mnemonic != "vqdmullt" && Mnemonic != "vpnot" && Mnemonic != "vcvtt" &&
+      Mnemonic != "vcvt") {
     unsigned VCC =
         ARMVectorCondCodeFromString(Mnemonic.substr(Mnemonic.size() - 1));
     if (VCC != ~0U) {



More information about the llvm-commits mailing list