On Wed, Feb 07, 2018 at 08:06:53AM +0100, Richard Biener wrote: > >Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > OK.
Committed, thanks. > I wonder why we have to re-implement all this in DOM. there's enough of > match and simplify interfaces to make it use that? It would certainly be nicer to be able to just use match.pd here. I guess the intent is only do it if it folds into a constant. While we could use a valueize hook that would return the same SSA_NAME for both values, wonder if gimplify-match.c has some API to create stmts in a sequence only instead of replacing the stmt(s) in the IL that we could use, test if it is a constant and use it, otherwise throw away. Jakub