[PATCH] D36404: TTI interface for creating jump-threaded branches into loop headers

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 2 12:59:44 PDT 2017


hfinkel added a comment.

In https://reviews.llvm.org/D36404#852556, @kparzysz wrote:

> Any thoughts on this?


I think that we should just disable this for all targets. JumpThreading is run early in the pipeline where we are supposed to be simplifying the IR, but importantly, canonicalizing it. Our canonical form must be chosen to enable subsequent optimizations, and if it's not, then we should fix that. The whole reason that LoopHeaders exists in the first place is to avoid this kind of thing. The comment above FindLoopHeaders reads:

  /// FindLoopHeaders - We do not want jump threading to turn proper loop
  /// structures into irreducible loops.  Doing this breaks up the loop nesting
  /// hierarchy and pessimizes later transformations.  To prevent this from
  /// happening, we first have to find the loop headers. ...

If this optimization is a good thing to do, then we should have a special run of JumpThreading late in the pipeline where we allow it to put loops into efficient-but-hard-to-analyze forms. That can certainly be follow-up work if it is found to be helpful.


Repository:
  rL LLVM

https://reviews.llvm.org/D36404





More information about the llvm-commits mailing list