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

Yevgeny Rouban via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 17:56:58 PST 2021


yrouban accepted this revision.
yrouban added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Analysis/BranchProbabilityInfo.cpp:121-122
+static const ProbabilityTable PointerTable {
+    /// p != 0  ->  Likely
+    /// p != q  ->  Likely
+    { ICmpInst::ICMP_NE, { PtrTakenProb, PtrUntakenProb } },
----------------
I do not see any diff between these two lines. I think one is enough: p != q -> Likely.



================
Comment at: llvm/lib/Analysis/BranchProbabilityInfo.cpp:123
+    /// p != q  ->  Likely
+    { ICmpInst::ICMP_NE, { PtrTakenProb, PtrUntakenProb } },
+    /// p == 0  ->  Unlikely
----------------
value followed by comment would be more concise, like the following:
```
{ ICmpInst::ICMP_NE, { PtrTakenProb, PtrUntakenProb } }, // p != q  ->  Likely.
``` 



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

https://reviews.llvm.org/D114009



More information about the llvm-commits mailing list