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

QingShan Zhang via All-commits all-commits at lists.llvm.org
Mon Aug 31 05:17:48 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: defbc77a7c951d8cc47daf49df15c7f548cada05
      https://github.com/llvm/llvm-project/commit/defbc77a7c951d8cc47daf49df15c7f548cada05
  Author: QingShan Zhang <qshanz at cn.ibm.com>
  Date:   2020-08-31 (Mon, 31 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

(cherry picked from commit deb4b2580715810ecd5cb7eefa5ffbe65e5eedc8)




More information about the All-commits mailing list