[PATCH] D143897: [CodeGenPrepare] Estimate liveness of loop invariants when checking for address folding profitability

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 1 14:28:05 PDT 2023


rupprecht added a comment.

I'm not making very good progress with a test case. So far the only interesting insights I may have:

- This only reproduces in optimized builds. Setting `-UNDEBUG` makes the problem go away. Maybe debug builds are normalizing something?
- The problem obvious goes away with `-mllvm -cgp-max-loop-inv-users-to-scan=0`. One of my guesses was that `V->uses()` ordering might be non-deterministic, so you could get different answers in `isUsedInLoop` if the loop is terminated before you visit the instruction that would cause you to return true. That is not the case: the problem still exists with `-mllvm -cgp-max-loop-inv-users-to-scan=10000`.

Otherwise, if I do the usual process of getting clang to dump the IR and pipe that into opt, or various things like that, the process is deterministic. If you have any guess for what might get a reproducer, I can give it a shot.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143897/new/

https://reviews.llvm.org/D143897



More information about the llvm-commits mailing list