[llvm] [SCEV] Extend isImpliedCondOperandsViaRanges to independent predicates (PR #71110)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 13:39:18 PST 2023


nikic wrote:

> test/Analysis/ScalarEvolution/trip-count-negative-stride.ll -- This looks mildly concerning on the surface, but I think it's safe to ignore. The entire loop nest is immediate UB, and the inner loop expression simplifies to 7 /u 0. (We're missing that simplification.)

Yeah, this is fine.

> test/CodeGen/BPF/loop-exit-cond.ll - I'm clearly breaking the intention of the test here. However, looking at the commit that introduced this, the patch made a cost model change and asserted that disabled LFTR. That was never true to begin with beyond one very narrow test case, so I don't feel bad effectively reverting that behavior. I'm honestly tempted just to delete the test.

I think it's okay to land this, but we should let BPF maintainers know that this broke, so they can find a new solution (cc @yonghong-song). I agree that the cost model change doesn't really prevent LFTR, and just happened to work in that specific case.

This seems like something that may be hard to undo in the backend, so I might be open to have a TTI hook to disable LFTR -- it's kind of part of the canonical form, but also not really, because we can only actually form it rarely and it's TTI driven anyway.

(Though more generally, I have some doubts that performing LFTR to replace inequality exit conditions with equality exit conditions is really a useful transform in the first place.)

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


More information about the llvm-commits mailing list