[PATCH] D61048: [X86] Remove dead nodes left after ReplaceAllUsesWith calls during address matching

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 23 18:01:43 PDT 2019


craig.topper created this revision.
craig.topper added reviewers: niravd, RKSimon, spatel.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

ReplaceAllUsesWith doesn't remove the node that was replaced. So its left around in the graph messing up use counts on other nodes.

One thing to note, is that this isn't valid if the node being deleted is the root node of an LEA match that gets rejected. In that case the node needs to stay alive because the isel table walking code would still have a reference to it that its going to try to match next. I don't think that's the case here though because the nodes being deleted here should be "and", "srl", and "zero_extend" none of which can be the root node of an LEA match.


https://reviews.llvm.org/D61048

Files:
  llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
  llvm/test/CodeGen/X86/fold-and-shift.ll
  llvm/test/CodeGen/X86/pr32329.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D61048.196360.patch
Type: text/x-patch
Size: 5398 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190424/6e1d2f6a/attachment.bin>


More information about the llvm-commits mailing list