Yes, it can be vectorized with your suggestion. ~/install-4.8/bin/gcc vect-ifconv-2.c -O2 -fdump-tree-ifcvt-details -ftree-vectorize -save-temps --param max-jump-thread-duplication-stmts=0
See attached assemble file. Bingfeng -----Original Message----- From: James Greenhalgh [mailto:james.greenha...@arm.com] Sent: 22 November 2013 11:50 To: Bingfeng Mei Cc: Andrew Pinski; gcc@gcc.gnu.org Subject: Re: Jump threading in tree dom pass prevents if-conversion & following vectorization On Fri, Nov 22, 2013 at 11:03:22AM +0000, Bingfeng Mei wrote: > Well, in your modified example, it is still due to jump threading that produce > code of bad control flow that cannot be if-converted and vectorized, though in > tree-vrp pass this time. > > Try this > ~/install-4.8/bin/gcc vect-ifconv-2.c -O2 -fdump-tree-ifcvt-details > -ftree-vectorize -save-temps -fno-tree-vrp > > The code can be vectorized. > > Grep "threading" in gcc, it seems that dom and vrp passes are two places that > apply > jump threading. Any other place? I think we need an target hook to control > it. > You can effectively disable jump-threading using: --param max-jump-thread-duplication-stmts=0 (grep dump files for "Jumps threaded") I don't see Andrew's code vectorized even with jump-threading disabled so I think Andrew is correct and this is some other missed optimization. James
vect-ifconv-2.s
Description: vect-ifconv-2.s