[PATCH] D157462: LoopRotate: Add code to update branch weights

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 24 10:07:08 PDT 2023


mtrofin added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopRotationUtils.cpp:294
+
+  uint32_t ExitWeight0; // aka x0
+  if (!ConditionalPreHeader) {
----------------
nit: can you init ExitWeight0 at declaration (to avoid potential joys due to uninitialization later). In fact, setting it to 0 and flipping the conditional below and not having an else would do it.


================
Comment at: llvm/lib/Transforms/Utils/LoopRotationUtils.cpp:703
+    const Value *Cond = PHBI->getCondition();
+    bool ConditionalPreHeader =
+        !isa<ConstantInt>(Cond) ||
----------------
const bool?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157462



More information about the llvm-commits mailing list