[llvm-bugs] [Bug 27740] extra memory load in loop

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Dec 28 07:12:02 PST 2020


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

Florian Hahn <florian_hahn at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |florian_hahn at apple.com

--- Comment #29 from Florian Hahn <florian_hahn at apple.com> ---
I think this has been resolved in current trunk. BasicAA will now look through
phis and we also eliminate/forward loads across BBs.

Trunk generates https://godbolt.org/z/f4Eo3x



foo:                                    # @foo
        cmpwi   5, 1
        bltlr   0
        li 7, 8
        lwz 6, 4(3)
        clrldi  5, 5, 32
        addi 4, 4, -16
        lfs 0, 8(3)
        mtctr 5
        li 5, 4
.LBB0_2:                                # =>This Inner Loop Header: Depth=1
        lwzu 8, 20(4)
        lfsx 1, 4, 5
        add 6, 6, 8
        stw 6, 4(3)
        xssubsp 0, 0, 1
        stfsx 0, 3, 7
        lwz 8, 8(4)
        stw 8, 12(3)
        bdnz .LBB0_2
        blr
        .long   0
        .quad   0

-- 
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/20201228/232783da/attachment.html>


More information about the llvm-bugs mailing list