[llvm] [EarlyIfCvt] Take branch probablities into consideration (PR #97808)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 02:47:08 PDT 2024


================
@@ -561,6 +565,49 @@ bool SSAIfConv::canConvertIf(MachineBasicBlock *MBB, bool Predicate) {
   return true;
 }
 
+/// Apply the target heuristic to decide if the transformation is profitable.
+bool SSAIfConv::isProfitableToConvertIf(
+    const MachineBranchProbabilityInfo *MBPI, TargetSchedModel SchedModel,
+    bool Predicate) {
+  if (!Predicate && TII->shouldConvertPredictableBranches())
----------------
fhahn wrote:

Could you separate out the code movement to a NFC patch, so the functional change of this patch is easier to see?

https://github.com/llvm/llvm-project/pull/97808


More information about the llvm-commits mailing list