[llvm] [SCEVExpander] Relax hoisting condition for AddRec start (PR #75916)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 29 06:21:51 PST 2023


averine wrote:

> I don't think this fix is right. There is a check in isSafeToExpand() that makes sure there is a pre-header for addrecs in non-canonical mode. If you hit this assertion failure, it means that an isSafeToExpand() check is missing somewhere.

Thanks for pointing this out. I added such a check before SCEV expansion is attempted (I did not use isSafeToExpand() but a weaker version of it which just checks the presence of the preheader, else indvars pass would not hoist some divisions in unit tests).

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


More information about the llvm-commits mailing list