960cbc53 immediately removes nodes that won't be used to avoid compilation time explosion. This patch adds the removal to constants to fix PR47517.
Details
Details
- Reviewers
RKSimon spatel efriedma hans steven.zhang uabelho - Group Reviewers
Restricted Project - Commits
- rG2508ef014e8b: [SelectionDAG] Remove unused FP constant in getNegatedExpression
Diff Detail
Diff Detail
Event Timeline
llvm/test/CodeGen/X86/pr47517.ll | ||
---|---|---|
2 | Please update the test with FileCheck |
Comment Actions
LGTM and thank you for doing this. But please for a while to see if RKSimon has more comments.
Comment Actions
After running sanitizer, I think the bug is not totally covered by this patch.
In 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.
Please update the test with FileCheck