[llvm] [X86] Set up the framework for optimization of CCMP/CTEST (PR #84603)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 9 10:03:15 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();
----------------
goldsteinn wrote:
Also note, if we are going to merge the BBs anyways, probably best to do as soon as possible so we have more context during DAG lowering.
https://github.com/llvm/llvm-project/pull/84603
More information about the llvm-commits
mailing list