The patch exclude a case from zero check skip in
authorEvgeny Stupachenko <evstupac@gmail.com>
Tue, 16 May 2017 21:44:59 +0000 (21:44 +0000)
committerEvgeny Stupachenko <evstupac@gmail.com>
Tue, 16 May 2017 21:44:59 +0000 (21:44 +0000)
commitcc19560253cfba353d118476e344252a1aeb8f7c
tree9088ee42175e86738576797598ba4ba890b01b30
parentc9916d7e97029e22dae2e4fc4d3959cae3bdd2cf
The patch exclude a case from zero check skip in
 CTLZ idiom recognition (r303102).

Summary:

The following case:
i = 1;
if(n)
  while (n >>= 1)
    i++;
use(i);

Was converted to:

i = 1;
if(n)
  i += builtin_ctlz(n >> 1, false);
use(i);

Which is not correct. The patch make it:

i = 1;
if(n)
  i += builtin_ctlz(n >> 1, true);
use(i);

From: Evgeny Stupachenko <evstupac@gmail.com>
llvm-svn: 303212
llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp