[all-commits] [llvm/llvm-project] deb4b2: [DAGCombine] Don't delete the node if it has uses ...

QingShan Zhang via All-commits all-commits at lists.llvm.org
Fri Aug 28 09:14:09 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: deb4b2580715810ecd5cb7eefa5ffbe65e5eedc8
      https://github.com/llvm/llvm-project/commit/deb4b2580715810ecd5cb7eefa5ffbe65e5eedc8
  Author: QingShan Zhang <qshanz at cn.ibm.com>
  Date:   2020-08-28 (Fri, 28 Aug 2020)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/test/CodeGen/PowerPC/fneg.ll

  Log Message:
  -----------
  [DAGCombine] Don't delete the node if it has uses immediately

This is the follow up patch for https://reviews.llvm.org/D86183 as we miss to delete the node if NegX == NegY, which has use after we create the node.
```
    if (NegX && (CostX <= CostY)) {
      Cost = std::min(CostX, CostZ);
      RemoveDeadNode(NegY);
      return DAG.getNode(Opcode, DL, VT, NegX, Y, NegZ, Flags);  #<-- NegY is used here if NegY == NegX.
    }
```

Reviewed By: spatel

Differential Revision: https://reviews.llvm.org/D86689




More information about the All-commits mailing list