aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorAtariDreams <gfunni234@gmail.com>2024-04-05 05:18:22 -0400
committerGitHub <noreply@github.com>2024-04-05 10:18:22 +0100
commitc5d000b1a84cfee99db157c6819e0a9c518f8ac8 (patch)
tree222ebfbdba2148abb72fcb38c547c2de01facf30 /llvm/lib/Bitcode/Reader
parent5ed60ffd790a2d1090dca9c685d6ccf09b3f08da (diff)
downloadllvm-c5d000b1a84cfee99db157c6819e0a9c518f8ac8.zip
llvm-c5d000b1a84cfee99db157c6819e0a9c518f8ac8.tar.gz
llvm-c5d000b1a84cfee99db157c6819e0a9c518f8ac8.tar.bz2
[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.
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
0 files changed, 0 insertions, 0 deletions