[PATCH] D82556: [Hexagon][NFC] Remove redundant condition

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


baloghadamsoftware created this revision.
baloghadamsoftware added a reviewer: kparzysz.
baloghadamsoftware added a project: LLVM.
Herald added subscribers: martong, gamesh411, Szelethus, dkrupp, rnkovacs, hiraditya.

Condition `secondReg` is checked both in an outer and in an inner `if` statement in static function `canCompareBeNewValueJump()` in file `HexagonNewValueJump.cpp`. 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/D82556

Files:
  llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp


Index: llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp
===================================================================
--- llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp
+++ llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp
@@ -291,7 +291,7 @@
     // at machine code level, we don't need this, but if we decide
     // to move new value jump prior to RA, we would be needing this.
     MachineRegisterInfo &MRI = MF.getRegInfo();
-    if (secondReg && !Register::isPhysicalRegister(cmpOp2)) {
+    if (!Register::isPhysicalRegister(cmpOp2)) {
       MachineInstr *def = MRI.getVRegDef(cmpOp2);
       if (def->getOpcode() == TargetOpcode::COPY)
         return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82556.273359.patch
Type: text/x-patch
Size: 672 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200625/61a04ea3/attachment.bin>


More information about the llvm-commits mailing list