[llvm] [Sparc] Optimize compare instruction (PR #167140)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 8 18:05:02 PST 2025
koachan wrote:
> This is something that should be done at SelectionDAG level.
> It is much easier to do and doesn't depend on cmp+branch scheduled next to each other, and as such should trigger in more cases.
Hmm, I thought `optimizeCompareInstr` is the place to do it? I see other backends like ARM and AArch64 ones seem to implement it too, with similar set of optimizations.
Also in the SMULO test, at least, it seems to be able to fold the or/cmp pair even when it's at a distance from the corresponding branch.
That's why I cherrypicked this patch.
https://github.com/llvm/llvm-project/pull/167140
More information about the llvm-commits
mailing list