[PATCH] D32605: Recognize CTLZ builtin
Evgeny Stupachenko via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 16 15:07:45 PDT 2017
evstupac added inline comments.
================
Comment at: llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1296
+ // check in CTLZ intrinsic.
+ if (BasicBlock *PreCondBB = PH->getSinglePredecessor())
+ if (BranchInst *PreCondBr =
----------------
Just made a follow up commit r303212 adding "!IsCntPhiUsedOutsideLoop" check here.
Previously the code was potentially buggy because in case IsCntPhiUsedOutsideLoop we inserted CTLZ(X >> 1) and rely on check X != 0 (instead of (X >> 1) != 0).
Repository:
rL LLVM
https://reviews.llvm.org/D32605
More information about the llvm-commits
mailing list