This patch removes the bail out for signed predicates and non-positive strides in howManyLessThans and updates computeMaxBECountForLT to return SCEVCouldNotCompute for signed predicates with negative strides. AFAICT bail-out was only added because computeMaxBECountForLT may not handle negative signed strides correctly. Instead of not calling computeMaxBECountForLT at all because we bail out earlier, we can instead return SCEVCouldNotCompute in computeMaxBECountForLT. The max backedge taken count will be computed as the max value of the symbolic backedge taken count. This improves precision in cases where we can compute symbolic backedge taken counts and also fixes a crash. Fixes #57818. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D135667
572 KiB
572 KiB