[RISCV] Remove dead code from doPeepholeMaskedRVV [nfc]
authorPhilip Reames <preames@rivosinc.com>
Wed, 14 Jun 2023 19:57:49 +0000 (12:57 -0700)
committerPhilip Reames <listmail@philipreames.com>
Wed, 14 Jun 2023 19:59:41 +0000 (12:59 -0700)
This is after lowering of undef to IMPLICIT_DEF, so the condition is always false.  Rather than fixing the intent (which was to match implicit_def per the comment), just delete it.  We're in the process of migrating away from the TA pseudos, so using _TA more often is fine.

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

index ccd0acd..2a001a6 100644 (file)
@@ -3193,14 +3193,11 @@ bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(SDNode *N) {
       TailPolicyOpIdx = getVecPolicyOpIdx(N, MaskedMCID);
       if (!(N->getConstantOperandVal(*TailPolicyOpIdx) &
             RISCVII::TAIL_AGNOSTIC)) {
-        // We can't use TA if the tie-operand is not IMPLICIT_DEF
-        if (!N->getOperand(0).isUndef()) {
-          // Keep the true-masked instruction when there is no unmasked TU
-          // instruction
-          if (I->UnmaskedTUPseudo == I->MaskedPseudo)
-            return false;
-          UseTUPseudo = true;
-        }
+        // Keep the true-masked instruction when there is no unmasked TU
+        // instruction
+        if (I->UnmaskedTUPseudo == I->MaskedPseudo)
+          return false;
+        UseTUPseudo = true;
       }
     }
   }