[llvm] [SCEV] Improve applyLoopGuards to support Mul (PR #83428)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 01:29:50 PST 2024


https://github.com/nikic requested changes to this pull request.

> It does so by preserving the information that a SCEVMul with a SCEVConstant operand divides by this constant.

Maybe I'm misunderstanding what you are doing, but I don't think that's correct due to overflow? E.g. consider https://alive2.llvm.org/ce/z/Ljc8Jj.

You'd have to restrict this to either power of two constants, or check for appropriate nowrap flags.

> It also generalized the assumption cache divisibility propagation to non-SCEVUnknowns.

This improvement sounds unrelated to the other one -- can it be split into a separate patch?

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


More information about the llvm-commits mailing list