[llvm] [X86] Set up the framework for optimization of CCMP/CTEST (PR #84603)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 21:31:24 PST 2024


================
@@ -3377,7 +3377,9 @@ X86TargetLowering::getJumpConditionMergingParams(Instruction::BinaryOps Opc,
                                                  const Value *Lhs,
                                                  const Value *Rhs) const {
   using namespace llvm::PatternMatch;
-  int BaseCost = BrMergingBaseCostThresh.getValue();
+  // Disable condition merging when CCMP is available b/c we can eliminate
+  // branches in a more efficient way.
+  int BaseCost = Subtarget.hasCCMP() ? -1 : BrMergingBaseCostThresh.getValue();
----------------
KanRobert wrote:

Thinking

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


More information about the llvm-commits mailing list