[PATCH] D39011: [SimplifyCFG] try harder to forward switch condition to phi (PR34471)
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 22 11:18:17 PDT 2017
spatel added a comment.
In https://reviews.llvm.org/D39011#903105, @dberlin wrote:
> 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)
Yeah, I can see the existing -simplifycfg code fights -gvn on this. Let me add another simplifycfg option bit to delay the whole thing. Then, I'll look at the codegen side. Thanks everyone for pointing out the problems!
Repository:
rL LLVM
https://reviews.llvm.org/D39011
More information about the llvm-commits
mailing list