[llvm] c4a3bd7 - [RISCV] Remove dead code from doPeepholeMaskedRVV [nfc]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 12:59:55 PDT 2023


Author: Philip Reames
Date: 2023-06-14T12:59:41-07:00
New Revision: c4a3bd7f8b7c587813d0e54d8d2dde7385895d09

URL: https://github.com/llvm/llvm-project/commit/c4a3bd7f8b7c587813d0e54d8d2dde7385895d09
DIFF: https://github.com/llvm/llvm-project/commit/c4a3bd7f8b7c587813d0e54d8d2dde7385895d09.diff

LOG: [RISCV] Remove dead code from doPeepholeMaskedRVV [nfc]

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.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
index ccd0acde29745..2a001a6e78c69 100644
--- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -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;
       }
     }
   }


        


More information about the llvm-commits mailing list