[PATCH] D114009: [BPI] Look-up tables for non-loop branches. NFC.

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 16 17:43:49 PST 2021


yrouban added a comment.

instead of storing a bool value (swap the probability or not) it would be better to store final array of branch probabilities to set so it would not need to define probabilities every time and optionally swap them.

  auto Search = PointerTable.find(CI->getPredicate());
  if (Search == PointerTable.end())
    return false;
  setEdgeProbability(BB, Search->second);
  return true;



================
Comment at: llvm/lib/Analysis/BranchProbabilityInfo.cpp:87
+///   X > 0   ->  Likely
+static std::map<llvm::CmpInst::Predicate, bool> ICmpWithZeroTable {
+  { CmpInst::ICMP_EQ,  Unlikely },
----------------
+const


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

https://reviews.llvm.org/D114009



More information about the llvm-commits mailing list