Files
clang-p2996/llvm/test/CodeGen/ARM
AtariDreams c5d000b1a8 [Thumb] Resolve FIXME: Use 'mov hi, $src; mov $dst, hi' (#81908)
Consider the following:

        ldr     r0, [r4]
        ldr     r7, [r0, #4]
        cmp     r7, r3
        bhi     .LBB0_6
        cmp     r0, r2
        push    {r0}
        pop     {r4}
        bne     .LBB0_3
        movs    r0, r6
        pop     {r4, r5, r6, r7}
        pop     {r1}
        bx      r1

Here is a snippet of the generated THUMB1 code of the K&R malloc
function that clang currently compiles to.

push    {r0} ends up being popped to pop {r4}.

movs r4, r0 would destroy the flags set by cmp right above.

The compiler has no alternative in this case, except one:
the only alternative is to transfer through a high register.

However, it seems like LLVM does not consider that this is a valid
approach, even though it is a free clobbering a high register.

This patch addresses the FIXME so the compiler can do that when it can
in r10 or r11, or r12.
2024-04-05 10:18:22 +01:00
..
2016-01-26 00:03:25 +00:00
2022-09-26 11:31:23 +01:00
2022-10-02 11:51:08 +01:00
2017-04-07 22:01:23 +00:00
2016-01-28 18:59:04 +00:00
2014-08-26 12:47:26 +00:00
2019-10-08 08:25:42 +00:00
2019-02-26 12:02:12 +00:00
2019-12-12 13:51:39 +00:00
2014-04-03 17:35:22 +00:00
2014-12-04 19:34:50 +00:00
2016-06-16 16:09:53 +00:00
2024-02-01 11:42:18 +00:00
2014-04-03 17:35:22 +00:00
2014-04-03 17:35:22 +00:00
2015-01-19 15:16:06 +00:00
2021-11-21 18:33:29 +00:00
2020-01-21 10:40:17 +00:00
2022-11-02 22:34:05 +00:00
2023-05-09 16:16:07 -04:00