[PATCH] D55669: [LIR] Add CTTZ support

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 18 11:13:46 PST 2018


craig.topper added a comment.

Can you split this into two patches? One for the cttz shift until zero and one for the second idiom.



================
Comment at: lib/Transforms/Scalar/LoopIdiomRecognize.cpp:191
+  bool recognizeAndInsertFFS();  /// Find First Set: ctlz or cttz
+  void transformLoopToCountable(const Intrinsic::ID IntrinID,
+                                BasicBlock *PreCondBB, const uint64_t InitShift,
----------------
No need to make IntrinID or InitShift const.


================
Comment at: lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1123
+/// zero.
+static Value *matchCondition(BranchInst *BI, BasicBlock *LoopEntry = nullptr,
+                             bool JmpOnZero = false) {
----------------
Can this be split into two different functions? One that returns Value* and one that returns BasicBlock*? Maybe the shared code could be a helper function they both use?


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55669/new/

https://reviews.llvm.org/D55669





More information about the llvm-commits mailing list