[PATCH] D82555: [AMDGPU][NFC] Remove redundant condition

Balogh, Ádám via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 25 08:01:07 PDT 2020


baloghadamsoftware created this revision.
baloghadamsoftware added a reviewer: tstellarAMD.
baloghadamsoftware added a project: llvm-amdgpu-spb.
Herald added subscribers: martong, kerbowa, gamesh411, Szelethus, dkrupp, rnkovacs, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, wdng, jvesely, kzhuravl, arsenm.
Herald added a project: LLVM.
baloghadamsoftware added a reviewer: tstellar.

Condition `LiteralCount` is checked both in an outer and in an inner `if` statement in `SIInstrInfo::verifyInstruction()`. This patch removes the redundant inner check.

The issue was found using `clang-tidy` check under review `misc-redundant-condition`. See https://reviews.llvm.org/D81272.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82555

Files:
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp


Index: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -3775,7 +3775,7 @@
     }
 
     if (isVOP3(MI) && LiteralCount) {
-      if (LiteralCount && !ST.hasVOP3Literal()) {
+      if (!ST.hasVOP3Literal()) {
         ErrInfo = "VOP3 instruction uses literal";
         return false;
       }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82555.273357.patch
Type: text/x-patch
Size: 440 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200625/832a45db/attachment.bin>


More information about the llvm-commits mailing list