[PATCH] D39011: [SimplifyCFG] try harder to forward switch condition to phi (PR34471)

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 22 11:04:01 PDT 2017


dberlin added a comment.

So, in the original test and code it's hard to tell,  but yes, if it's trying to undo the propagation of constants into phi nodes, it's already going to be fighting, because everything else is trying to do that transform specifically :)

It's probably worth taking a look at codegen and seeing how hard it is.
So i'd say "delay it all to latesimplifycfg for now, see how hard codegen is".
I'm hopeful it's not that tricky to fix codegen. But if it is, yeah let's see how far we want to go here, i don't think you should be on the hook for cleaning all of this up if it's hard.

(One could also argue about the value of constant propagation in this case.  It's mostly useful for range analysis, jump threading, transformation into select, etc.  I'm indifferent if we want to canonicalize late to some other form if we can show it's better)


Repository:
  rL LLVM

https://reviews.llvm.org/D39011





More information about the llvm-commits mailing list