[PATCH] D81393: [ScheduleDAG][NFC] Use MCInstrDesc API to check PhysReg definition.

Denis Antrushin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 07:06:16 PDT 2020


dantrushin created this revision.
dantrushin added reviewers: t.p.northover, bogner.
Herald added subscribers: llvm-commits, hiraditya, MatzeB.
Herald added a project: LLVM.

Use API provided by MCInstrDesc to check if instruction implicitly
defines physical register instead of direct unchecked access to
MCInstrDesc::ImplicitDefs array (which might be null).
This makes CheckForPhysRegDependency() more robust.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D81393

Files:
  llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp


Index: llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
+++ llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp
@@ -125,8 +125,7 @@
     PhysReg = Reg;
   } else if (Def->isMachineOpcode()) {
     const MCInstrDesc &II = TII->get(Def->getMachineOpcode());
-    if (ResNo >= II.getNumDefs() &&
-        II.ImplicitDefs[ResNo - II.getNumDefs()] == Reg)
+    if (ResNo >= II.getNumDefs() && II.hasImplicitDefOfPhysReg(Reg))
       PhysReg = Reg;
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D81393.269215.patch
Type: text/x-patch
Size: 580 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200608/0ff7e2b2/attachment.bin>


More information about the llvm-commits mailing list