[PATCH] D76439: [SDAG] fix crash in getNegatedExpression() from altered number of uses

qshanz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 19 19:14:42 PDT 2020


steven.zhang added a comment.

Shall we also need to update the cost evaluation for FMUL/FDIV, that is calculating both operands and select the cheapest cost of them ?  And it seems that FADD also have such issues. -(A+B)->-A - B or -B-A
Technical speaking, we can't have the same expensive cost for both operands when negating the expression but now, we indeed have sometimes. And we choose one by chance which also would have problems.

I am not clear on the origin design but I wonder if we can remove the check of cost before calling the getNegateExpression, but call it directly, which allow to be null value to avoid such kind of out of sync between these two calls.


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

https://reviews.llvm.org/D76439





More information about the llvm-commits mailing list