summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2019-02-04 11:58:48 +0000
committerDavid Green <david.green@arm.com>2019-02-04 11:58:48 +0000
commitb4f36a2196eb5d85e7596a4f9b5411c0568bf473 (patch)
treed7e474d27268b66f3f7272f4d8bfd600308b8c27 /llvm/test/CodeGen
parent75d79f472e92a99597d99b4ff96c2b20da353cd4 (diff)
downloadbcm5719-llvm-b4f36a2196eb5d85e7596a4f9b5411c0568bf473.tar.gz
bcm5719-llvm-b4f36a2196eb5d85e7596a4f9b5411c0568bf473.zip
[ARM] Mark 255 and 65535 as cheap for Thumb1 "And"
This prevents Constant Hoisting from pulling the constant out of the block, allowing us to still produce LDRH/UXTH nodes. LDRB/UXTB (255) is already cheap by the default getIntImmCost, but I've added it for clarity. Differential Revision: https://reviews.llvm.org/D57671 llvm-svn: 353040
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/Thumb/uxth.ll26
1 files changed, 10 insertions, 16 deletions
diff --git a/llvm/test/CodeGen/Thumb/uxth.ll b/llvm/test/CodeGen/Thumb/uxth.ll
index 11514d80899..e1e5117b394 100644
--- a/llvm/test/CodeGen/Thumb/uxth.ll
+++ b/llvm/test/CodeGen/Thumb/uxth.ll
@@ -68,24 +68,18 @@ for.cond.cleanup:
define void @uxth_loop_2(i32* %a, i32 %n) {
; V6M-LABEL: uxth_loop_2:
-; V6M: .save {r4, r5, r7, lr}
-; V6M-NEXT: push {r4, r5, r7, lr}
-; V6M-NEXT: movs r3, #0
-; V6M-NEXT: ldr r2, .LCPI5_0
+; V6M: .save {r4, lr}
+; V6M-NEXT: push {r4, lr}
+; V6M-NEXT: movs r2, #0
; V6M-NEXT: .LBB5_1:
-; V6M-NEXT: adds r4, r3, #1
-; V6M-NEXT: ands r3, r2
-; V6M-NEXT: ldr r5, [r0]
-; V6M-NEXT: ands r5, r2
-; V6M-NEXT: muls r5, r3, r5
-; V6M-NEXT: stm r0!, {r5}
-; V6M-NEXT: cmp r1, r4
-; V6M-NEXT: mov r3, r4
+; V6M-NEXT: uxth r3, r2
+; V6M-NEXT: ldrh r4, [r0]
+; V6M-NEXT: muls r4, r3, r4
+; V6M-NEXT: stm r0!, {r4}
+; V6M-NEXT: adds r2, r2, #1
+; V6M-NEXT: cmp r1, r2
; V6M-NEXT: bne .LBB5_1
-; V6M-NEXT: pop {r4, r5, r7, pc}
-; V6M-NEXT: .p2align 2
-; V6M-NEXT: .LCPI5_0:
-; V6M-NEXT: .long 65535
+; V6M-NEXT: pop {r4, pc}
entry:
br label %for.body
OpenPOWER on IntegriCloud