[llvm] [X86] Set up the framework for optimization of CCMP/CTEST (PR #84603)
Shengchen Kan via llvm-commits
llvm-commits at lists.llvm.org
Sat May 11 19:32:34 PDT 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:
> Is that https://github.com/llvm/llvm-project/pull/91747?
Yes.
> Based on the two missing cases in https://github.com/llvm/llvm-project/pull/91747, can they not be fixed on in simplifyCFG?
For the case that two compares are not in same BB, maybe we can fix it simplifyCFG.
For the case that DAGCombine only revisit the direct users after simplifying a node, we can only expect #91772 or similar PRs. TBH, I don't known when it can be ready.
https://github.com/llvm/llvm-project/pull/84603
More information about the llvm-commits
mailing list