[PATCH] D34952: [ARM] Adjust ifcvt heuristic for the diamond ifcvt case

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 04:02:07 PDT 2017


samparker added inline comments.


================
Comment at: lib/Target/ARM/ARMBaseInstrInfo.cpp:1885
+      // discount it from PredCost.
+      PredCost -= 1 * ScalingUpFactor;
     }
----------------
Does the '1' represent the single branch instruction that we will not have to execute? Does it not have to be the number of cycles saved?


================
Comment at: test/CodeGen/Thumb2/ifcvt-no-branch-predictor.ll:98
 ; CHECK-LABEL: diamond2:
-; CHECK-BP: itte
-; CHECK-BP: streq
-; CHECK-BP: ldreq
-; CHECK-BP: strne
-; CHECK-NOBP: cbz
-; CHECK-NOBP: str
-; CHECK-NOBP: b
-; CHECK-NOBP: str
-; CHECK-NOBP: ldr
+; CHECK-BP: cbz
+; CHECK-BP: str
----------------
why does this patch affect targets with a branch predictor?


Repository:
  rL LLVM

https://reviews.llvm.org/D34952





More information about the llvm-commits mailing list