[Hexagon][NFC] Remove redundant condition
authorAdam Balogh <adam.balogh@ericsson.com>
Thu, 25 Jun 2020 13:48:10 +0000 (15:48 +0200)
committerAdam Balogh <adam.balogh@ericsson.com>
Wed, 1 Jul 2020 07:04:26 +0000 (09:04 +0200)
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.

Differential Revision: https://reviews.llvm.org/D82556

llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp

index e3579df..8dc1113 100644 (file)
@@ -291,7 +291,7 @@ static bool canCompareBeNewValueJump(const HexagonInstrInfo *QII,
     // 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;