[llvm] [X86] Don't always separate conditions in `(br (and/or cond0, cond1))` into separate branches (PR #81689)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 2 00:42:55 PST 2024


goldsteinn wrote:

> > This will also likely help for APX targets with the new CCMP and
> > CTEST instructions.
> 
> In fact, this causes some downstream CCMP tests to fail b/c branch is already eliminated. @goldsteinn Is there a flag to undo the change in test?

```
static cl::opt<int> BrMergingBaseCostThresh(
    "x86-br-merging-base-cost", cl::init(1),
    cl::desc(
        "Sets the cost threshold for when multiple conditionals will be merged "
        "into one branch versus be split in multiple branches. Merging "
        "conditionals saves branches at the cost of additional instructions. "
        "This value sets the instruction cost limit, below which conditionals "
        "will be merged, and above which conditionals will be split."),
    cl::Hidden);

```

if you set that to `-1` it will disable the branch merging.

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


More information about the llvm-commits mailing list