[llvm] [TTI][RISCV] Unconditionally break critical edges to sink ADDI (PR #108889)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 25 12:51:29 PST 2024


preames wrote:

> Looking at the diff for this with the GCC torture suite, I think there's one case where it seems this change makes codegen slightly worse that it would be worth you having a quick look at - 20020413-1.c. Previously, each conditional BB loaded an immediate then branched to the common exit block. After this change, the BBs conditionally branch to the BB that loads the needed immediate, which then branches to the common exit block.
> 
> This isn't a blocker I don't think, as overall the change is positive.

I took a look at this, and it's basically the patch working as intended.  One interesting quirk is that it turned out to be specific to having a series of branches.  With branch dispatch you see a code change with this patch.  With switch dispatch, we *already* sink into the successor blocks (by construction).  So, if anything, it's another reason to land this patch - consistency!

Can I get an LGTM here?

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


More information about the llvm-commits mailing list