[IR] Remove uses of the oddly named ConstantFP::getZeroValueForNegation in integer code.
Confusingly ConstantFP's getZeroValueForNegation intentionally handles non-FP constants. It calls getNullValue in Constant. Nearly all uses in tree are for integers rather than FP. Maybe due to replacing FSub -0.0, X idiom with an FNeg instructions a few years ago. This patch replaces all the integer uses in tree with ConstantInt::get(0, Ty). The one remaining use is in clang with a FIXME that it should use fneg. I'll fix that next and then delete ConstantFP::getZeroValueForNegation. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D147492
Loading
Please sign in to comment