[llvm] [Analysis] Use usub_sat during SCEV expansion in some cases (PR #216975)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 04:18:23 PDT 2026


fhahn wrote:

> Sorry, that's my fault for not making it clearer. The loop vectoriser also uses the generated IR output in the vector.scevcheck block for profitability analysis. For example, it may adjust the minimum trip count threshold required to even enter the scevcheck block based on the cost of doing the checks. By simplifying the expanded SCEV code in line with how it will be optimised by instcombine anyway, it gives the vectoriser a more accurate picture of the cost. 

Would it be possible to add a test highlighting where costs get more accurate (e.g. change in estimated cost of RT checks)?

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


More information about the llvm-commits mailing list