[PATCH] D41361: [SimplifyCFG] Avoid quadratic on a predecessors number behavior in instruction sinking.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 16:10:11 PST 2017

hfinkel added a subscriber: Carrot.
hfinkel added a comment.

In https://reviews.llvm.org/D41361#961498, @efriedma wrote:

> The change to arm64-jumptable.ll looks fine.  I think something is going wrong in avoid-cpsr-rmw.ll.
> > Since we're not changing logic for generating selects and we're ending up with them now, I assume that it's also a desirable form of IR in this case.
> We have thresholds in various places to avoid transforming control flow into straight-line computation if it gets too expensive; they're scattered all over the place, though, so we might not handle it consistently.

Exactly. Also, @Carrot has been working on this problem recently (see https://reviews.llvm.org/D39352). Our heuristics in this regard should soon get significantly smarter (although it's not clear that it will, or should, change the  avoid-cpsr-rmw.ll case). @efriedma, based on the IR above, it does not seem that what's happening is wrong (the branchy code does not seem obviously superior to me because it's not clear we're missing opportunities for speculative execution). Can you elaborate?


More information about the llvm-commits mailing list