[llvm] [ARM] Stop gluing ALU nodes to branches / selects (PR #116970)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 05:40:33 PST 2024


s-barannikov wrote:

The guilty function is `ARMDAGToDAGISel::SelectCMPZ`. Before the patch, CMPZ could only have one use. This function replaces AND feeding CMPZ with a shift and notifies the caller that it should change the condition code in the using node (eq -> pl).

After this patch, CMPZ can have multiple uses, but only one of them is updated.

This can be worked around by checking that CMPZ has exactly one use, but ideally this optimization should happen earlier, in PerformTargetDAGCombine. I'll add a workaround now and will try to move this optimization to ARMTargetLowering in a later patch.


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


More information about the llvm-commits mailing list