[llvm] [X86][CodeGen] Support lowering for CCMP/CTEST (PR #91747)

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 23:13:12 PDT 2024


================
@@ -3405,6 +3405,9 @@ X86TargetLowering::getJumpConditionMergingParams(Instruction::BinaryOps Opc,
                                                  const Value *Rhs) const {
   using namespace llvm::PatternMatch;
   int BaseCost = BrMergingBaseCostThresh.getValue();
+  // With CCMP, branches can be merged in a more efficient way.
+  if (BaseCost >=0 && Subtarget.hasCCMP())
+    BaseCost += 6;
----------------
KanRobert wrote:

It's not tuned yet. I just pick a minimum value to make the test pass.

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


More information about the llvm-commits mailing list