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

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 29 04:35:09 PDT 2021


jaykang10 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)) {
----------------
fhahn wrote:
> nit: no `llvm::` prefix should be needed. (e.g. we are also not using `llvm::Instruction`)
You are right!!! I will update it.


================
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.
----------------
fhahn wrote:
> 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.
Yep, I will remove it.


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

https://reviews.llvm.org/D99496



More information about the llvm-commits mailing list