[llvm] 28be4b7 - [RISCV] Simplify InstrInfo access in doPeepholeMaskedRVV [nfc]

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 9 17:02:51 PDT 2022


Author: Philip Reames
Date: 2022-06-09T17:02:40-07:00
New Revision: 28be4b74549853f7f8befa2204275a949c7a6431

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

LOG: [RISCV] Simplify InstrInfo access in doPeepholeMaskedRVV [nfc]

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 8e01c055c3315..c1524e9808bf0 100644
--- a/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -2416,10 +2416,8 @@ bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(SDNode *N) {
 
   // Retrieve the tail policy operand index, if any.
   Optional<unsigned> TailPolicyOpIdx;
-  const RISCVInstrInfo *TII = static_cast<const RISCVInstrInfo *>(
-      CurDAG->getSubtarget().getInstrInfo());
-
-  const MCInstrDesc &MaskedMCID = TII->get(N->getMachineOpcode());
+  const RISCVInstrInfo &TII = *Subtarget->getInstrInfo();
+  const MCInstrDesc &MaskedMCID = TII.get(N->getMachineOpcode());
 
   bool IsTA = true;
   if (RISCVII::hasVecPolicyOp(MaskedMCID.TSFlags)) {
@@ -2444,7 +2442,7 @@ bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(SDNode *N) {
   }
 
   if (IsTA) {
-    uint64_t TSFlags = TII->get(I->UnmaskedPseudo).TSFlags;
+    uint64_t TSFlags = TII.get(I->UnmaskedPseudo).TSFlags;
 
     // Check that we're dropping the merge operand, the mask operand, and any
     // policy operand when we transform to this unmasked pseudo.
@@ -2453,7 +2451,7 @@ bool RISCVDAGToDAGISel::doPeepholeMaskedRVV(SDNode *N) {
            "Unexpected pseudo to transform to");
     (void)TSFlags;
   } else {
-    uint64_t TSFlags = TII->get(I->UnmaskedTUPseudo).TSFlags;
+    uint64_t TSFlags = TII.get(I->UnmaskedTUPseudo).TSFlags;
 
     // Check that we're dropping the mask operand, and any policy operand
     // when we transform to this unmasked tu pseudo.


        


More information about the llvm-commits mailing list