[PATCH] D128860: [llvm][NFC] Refactor code to use ProfDataUtils

Justin Bogner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 15:04:50 PDT 2022


bogner added inline comments.


================
Comment at: llvm/include/llvm/IR/Instruction.h:356
   /// Returns false if no metadata or invalid metadata was found.
   bool extractProfMetadata(uint64_t &TrueVal, uint64_t &FalseVal) const;
 
----------------
There's an argument for removing this entirely and updating the users to just use extractBranchWeights directly (possibly with a specialization of that function that makes the True/False case convenient). I'm not sure how strongly I feel about it, but all of the branch weight stuff being in one place seems kind of nice. WDYT?


================
Comment at: llvm/include/llvm/IR/Instruction.h:361
+  /// Returns false if no metadata or invalid metadata was found.
+  bool extractProfMetadata(SmallVector<uint32_t> &Weights) const;
+
----------------
Is this used anywhere? We can probably omit it until it is.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128860



More information about the llvm-commits mailing list