[PATCH] D72029: [LoopUtils][NFC] Minor refactoring in getLoopEstimatedTripCount.

Evgeniy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 21:47:05 PST 2020


ebrevnov marked 4 inline comments as done.
ebrevnov added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:718
   // we exited the loop.
-  uint64_t TrueVal, FalseVal;
-  if (!LatchBR->extractProfMetadata(TrueVal, FalseVal))
+  uint64_t LatchCycleWeight, LatchExitWeight;
+  if (!LatchBR->extractProfMetadata(LatchCycleWeight, LatchExitWeight))
----------------
Ayal wrote:
> Can we agree on `BackedgeTakenWeight` and `LatchExitWeight`? They directly correspond to "the number of times the backedge was taken" and "the number of times we exited the loop" documented above, and the comment removed below.
Works for me.


================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:727
     return 0;
 
+  return llvm::divideNearest(LatchCycleWeight, LatchExitWeight);
----------------
Ayal wrote:
> Original "// Divide the count ..." comment removed deliberately?
Restored.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D72029





More information about the llvm-commits mailing list