[llvm] [TypePromotion] Support positive addition amounts in isSafeWrap. (PR #81690)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 16:49:02 PST 2024


topperc wrote:

> Given how this seems to increase the number of generated instructions, I think this should be done in cases where if OverflowConst.isNonPositive() holds false, instead of doing it to all numbers.

 A lot of the signed-truncation-check and lack-of-signed-truncation-check test cases are not the output that InstCombine produces. So I'm not sure increases there reflect real behavior.

I don't think the increases are directly related to the sign of the constants. We see increases on these test files from negative constants too. See https://github.com/llvm/llvm-project/pull/81574 If anything we should be costing the constants based on target specific cost like getImmCost not making decisions based on the sign.

https://github.com/llvm/llvm-project/pull/81690


More information about the llvm-commits mailing list