[llvm-bugs] [Bug 46581] New: peeling stores to after branch

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 3 14:50:41 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46581

            Bug ID: 46581
           Summary: peeling stores to after branch
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: slandden at gmail.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org

I am sorry this test case is not reduced, but I am getting assembly that
repetedly writes to the same pointer without reading it, because it doesn't
want to have to pass a register that it is using to a branch (it would have to
alternate registers, and then have a label right before it to rename the other
register, as one possible solution).

        cmp     w10, #116               // =116
        b.ne    .LBB1_952
        add     x10, x9, #3             // =3
        str     x10, [x27] <=====
        ldrb    w10, [x9, #3]
        cmp     w10, #117               // =117
        b.ne    .LBB1_952
        add     x10, x9, #4             // =4
        str     x10, [x27] <=====
        ldrb    w10, [x9, #4]
        cmp     w10, #114               // =114
        b.ne    .LBB1_952
        add     x10, x9, #5             // =5
        str     x10, [x27] <=====
        ldrb    w10, [x9, #5]
        cmp     w10, #110               // =110
        b.ne    .LBB1_952
        add     x10, x9, #6             // =6
        str     x10, [x27] <=====
        ldrb    w9, [x9, #6]


.LBB1_951:                              //   in Loop: Header=BB1_1 Depth=1
        ldr     x9, [x27]
        ldrb    w10, [x9]

https://godbolt.org/z/o3_5FV

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200703/30305097/attachment.html>


More information about the llvm-bugs mailing list