Arnold Schwaighofer
2014-Dec-02 22:57 UTC
[LLVMdev] PR21302: Vectorize only bottom-tested loops
LGTM. Thanks! On 12/02/14, Michael Zolotukhin wrote:> Hi, > > This patch fixes the problem described in PR21302. > > The issue is that currently vectorizer sometimes vectorizes loops that are not bottom-tested, i.e. in which each iteration starts from checking the termination condition. That causes an extra-iteration to be executed in vectorized version in some cases. > > The patch consists of two parts: > 1) Update three existing tests, that contained loop in such forms. After the fix these loops aren’t vectorized any longer, so I applied loop-rotate+simplifycfg to them. This change is quite mechanical. > 2) The fix itself and a regression test. > > > > > > Do they look ok? > > Thanks, > Michael
Michael Zolotukhin
2014-Dec-02 23:01 UTC
[LLVMdev] PR21302: Vectorize only bottom-tested loops
Thanks! Committed in r223170 and r223171. Michael> On Dec 2, 2014, at 2:57 PM, Arnold Schwaighofer <aschwaighofer at apple.com> wrote: > > LGTM. > > Thanks! > > On 12/02/14, Michael Zolotukhin wrote: >> Hi, >> >> This patch fixes the problem described in PR21302. >> >> The issue is that currently vectorizer sometimes vectorizes loops that are not bottom-tested, i.e. in which each iteration starts from checking the termination condition. That causes an extra-iteration to be executed in vectorized version in some cases. >> >> The patch consists of two parts: >> 1) Update three existing tests, that contained loop in such forms. After the fix these loops aren’t vectorized any longer, so I applied loop-rotate+simplifycfg to them. This change is quite mechanical. >> 2) The fix itself and a regression test. >> >> >> >> >> >> Do they look ok? >> >> Thanks, >> Michael >