[PATCH] D31704: [BPI] NFC: reorder ifs to bail out earlier

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 5 10:59:36 PDT 2017


chandlerc added inline comments.


================
Comment at: lib/Analysis/BranchProbabilityInfo.cpp:190-192
+  // Skip probabilities if this block has a single successor.
+  if (TI->getNumSuccessors() == 1)
+    return false;
----------------
Sholud we even get here? should this be in the caller?


================
Comment at: lib/Analysis/BranchProbabilityInfo.cpp:340-342
+  // Skip probabilities if this block has a single successor.
+  if (TI->getNumSuccessors() == 1)
+    return false;
----------------
This seems like it should merge into the above if? But my comment about hoisting all of this to the caller still applies. I feel like thes eshould be able to assume there are interesting successor counts.


https://reviews.llvm.org/D31704





More information about the llvm-commits mailing list