[PATCH] D39585: PR35131 Fix a misprint in CTLZ recognition

Evgeny Stupachenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 11:50:36 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL317348: The patch fixes PR35131 (authored by evstupac).

Changed prior to commit:
  https://reviews.llvm.org/D39585?vs=121425&id=121518#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D39585

Files:
  llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp


Index: llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
===================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
@@ -1326,9 +1326,9 @@
   // step 2: detect instructions corresponding to "x.next = x >> 1"
   if (!DefX || DefX->getOpcode() != Instruction::AShr)
     return false;
-  if (ConstantInt *Shft = dyn_cast<ConstantInt>(DefX->getOperand(1)))
-    if (!Shft || !Shft->isOne())
-      return false;
+  ConstantInt *Shft = dyn_cast<ConstantInt>(DefX->getOperand(1));
+  if (!Shft || !Shft->isOne())
+    return false;
   VarX = DefX->getOperand(0);
 
   // step 3: Check the recurrence of variable X


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39585.121518.patch
Type: text/x-patch
Size: 743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171103/ac616a77/attachment.bin>


More information about the llvm-commits mailing list