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

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 03:15:22 PST 2024


mstorsjo wrote:

Now I see the fault with the code change.

```diff
@@ -11514,18 +11515,18 @@
 .LBB59_6:                               @ %sw.bb5.i
        movs    r6, #29
        movs    r5, #13
-       ands    r4, lr, #16777216
-       it      eq                       
-       moveq   r6, #23                  
+       lsls.w  r4, lr, #7
+       it      pl
+       movpl   r6, #23
        it      eq
        moveq   r5, #7
        b       .LBB59_11
```

The updated `lsls.w` followed by `movpl` should be equivalent to the previous `ands` and `moveq`, as far as I can see.

But after the flag setting instruction and conditional mov, we have another `moveq r5`, which no longer gets the specific condition set that it is expecting. I would guess that this is the bug.

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


More information about the llvm-commits mailing list