[PATCH] D153392: [PhaseOrdering] Don't speculate blocks in simplifycfg before jump-threading
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 23 05:19:01 PDT 2023
nikic added a comment.
I've looked into this, and concluded that jump threading isn't performing any essential optimization here.
The real problem is that we end up losing an inbounds on the GEP due to our questionable "gep 0 is not always inbounds" semantics. But in this case, we can still recover from that by making SCEV smarter. I've made a few changes (https://github.com/llvm/llvm-project/commit/7cf567d46121f4aa8f659554b5e8584cd0fac056, https://github.com/llvm/llvm-project/commit/406e9c93726ed929ca09ffed2fd3a60cfd633f4b, https://reviews.llvm.org/D153624) that will allow us to optimize your example with the current pipeline.
Not to say that this change isn't also reasonable, but I think it needs a different motivating example.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D153392/new/
https://reviews.llvm.org/D153392
More information about the llvm-commits
mailing list