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

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 11 12:52:26 PDT 2025


preames wrote:

@michaelmaitland Can I ask you to file a bug for the regression you noted?  I think this may have been reduced a bit past usefulness.   Looking at the after assembly, the "right" answer for this case is for this:
```
        beqz    zero, .LBB0_9
# %bb.8:
        li      s1, 1
        j       .LBB0_10
.LBB0_9:                                # %if.then108
        li      s1, 0
.LBB0_10:                               # %cleanup
```

To become a snez.  However, when I opened up the precodegen IR for the routine you mentioned, I don't see this pattern in the IR.  I'm not claiming that my particular snapshot from some time ago is evidence against there being a regression here.  I'm just saying I need to know how to reproduce the original example, not just the reduced case which may or may not be representative.  I suspect that e.g. LTO vs non-LTO might be very important here.  

For the record, I do not plan to revert this without significant investigation first.  It's been four months since this landed.  


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


More information about the llvm-commits mailing list