[PATCH] D82254: [RISCV] Simplify calling use_empty()

Ben Shi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 19 23:57:29 PDT 2020


benshi001 created this revision.
benshi001 added a reviewer: MaskRay.
Herald added subscribers: llvm-commits, evandro, luismarques, apazos, sameer.abuasal, pzheng, s.egerton, lenary, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya.
Herald added a project: LLVM.

The check of the possible dead node can be performed via SDValue::use_empty() instead of SDNode::use_empty().


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D82254

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


Index: llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
+++ llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
@@ -246,7 +246,7 @@
                                  ImmOperand, N->getOperand(3));
 
     // The add-immediate may now be dead, in which case remove it.
-    if (Base.getNode()->use_empty())
+    if (Base.use_empty())
       CurDAG->RemoveDeadNode(Base.getNode());
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D82254.272241.patch
Type: text/x-patch
Size: 490 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200620/332738da/attachment-0001.bin>


More information about the llvm-commits mailing list