[PATCH] D99496: [LoopUnswitch] Use reference variables instead of pointer one

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 04:28:34 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:850
       !findOptionMDForLoop(CurrentLoop, "llvm.loop.unswitch.partial.disable")) {
-    if (auto Info =
-            llvm::hasPartialIVCondition(CurrentLoop, MSSAThreshold, MSSA, AA)) {
+    if (auto Info = llvm::hasPartialIVCondition(*CurrentLoop, MSSAThreshold,
+                                                *MSSA, *AA)) {
----------------
nit: no `llvm::` prefix should be needed. (e.g. we are also not using `llvm::Instruction`)


================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:1714
 /// is, duplicate the instructions feeding the condition in the pre-header. Then
 /// unswitch on the duplicated condition. The condition is now known in the
 /// unswitched version for the 'invariant' path through the original loop.
----------------
Not sure if the comment should be there. It should be in the header (which is what doxygen uses) and duplicating it here means it will probably diverge in the future, which is even more confusing.


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

https://reviews.llvm.org/D99496



More information about the llvm-commits mailing list