[PATCH] D87614: [SelectionDAG] Remove unused FP constant in getNegatedExpression

Qiu Chaofan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 06:06:31 PDT 2020


qiucf added a comment.

After running sanitizer, I think the bug is not totally covered by this patch.

In D86689 <https://reviews.llvm.org/D86689>, we introduced such pattern:

  // Negate the X if its cost is less or equal than Y.
  if (NegX && (CostX <= CostY)) {
    Cost = CostX;
    SDValue N = DAG.getNode(ISD::FSUB, DL, VT, NegX, Y, Flags);
    RemoveDeadNode(NegY);
    return N;
  }

Somewhere in this test case, `N=3.0`, `NegY=3.0`, `NegY->use_size()=0`, so NegY is just deleted but N also gets deleted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87614/new/

https://reviews.llvm.org/D87614



More information about the llvm-commits mailing list