[PATCH] D94015: [LoopIdiom] Replace cttz loop by call to cttz intrinsic.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 11 10:00:28 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1885
+  // Step 1: Get the phi after the loop and check everything about it.
+  // Thanks jdoerfert from irc to this elegant method to get the first
+  // instruction from a BB.
----------------
Drop the comment about jdoerfert. Its fine for a commit message, but doesn't add anything to the understanding of the code.


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1892
+
+  Instruction *AddIncValue0 =
+      dyn_cast<Instruction>(CntPhi->getIncomingValue(0));
----------------
Use `auto *AddIncValue0`


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1900
+
+  ConstantInt *Int = dyn_cast<ConstantInt>(AddIncValue0->getOperand(1));
+
----------------
`auto`


================
Comment at: llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp:1906
+
+  PHINode *PhiIntValue1 = dyn_cast<PHINode>(CntPhi->getIncomingValue(1));
+
----------------
`auto`


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

https://reviews.llvm.org/D94015



More information about the llvm-commits mailing list