[PATCH] D37816: Experimental late jump threading pass

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 14 08:36:40 PDT 2017


kparzysz added inline comments.


================
Comment at: lib/Transforms/Scalar/JumpThreading.cpp:1824
   // See the comments above FindLoopHeaders for justifications and caveats.
-  if (LoopHeaders.count(BB) || LoopHeaders.count(SuccBB)) {
+  if (LoopHeaders.count(BB) || (!IsLate && LoopHeaders.count(SuccBB))) {
     DEBUG({
----------------
bmakam wrote:
> kparzysz wrote:
> > bmakam wrote:
> > > Should this be 
> > > if (!IsLate && (LoopHeaders.count(BB) || LoopHeaders.count(SuccBB))) {
> > Jump threading over loop headers was never allowed.  You can try it and see what happens, but I'm not sure if it would be a good idea to enable it for all target.
> I'm testing with a similar patch and I used this check. Wasn't JT over loop headers never allowed because it would turn the loop into irreducible loop, if that is the case this shouldn't be a concern for LateJumpThreading? However, I admit there is no difference in spec2017/perlbench with this.
It could be a problem for the CodeGen passes that use MachineLoopInfo, since some loops would become non-optimizable.


Repository:
  rL LLVM

https://reviews.llvm.org/D37816





More information about the llvm-commits mailing list