1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 12:43:36 +01:00
llvm-mirror/test/CodeGen/ARM/minsize-call-cse.ll
James Molloy c0ff091d95 [ARM] Prefer indirect calls in minsize mode
... When we emit several calls to the same function in the same basic block.

An indirect call uses a "BLX r0" instruction which has a 16-bit encoding. If many calls are made to the same target, this can enable significant code size reductions.

llvm-svn: 275537
2016-07-15 07:55:21 +00:00

29 lines
547 B
LLVM

; RUN: llc < %s | FileCheck %s
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv7m-arm-none-eabi"
; CHECK-LABEL: f:
; CHECK: blx r
; CHECK: blx r
; CHECK: blx r
define void @f() minsize optsize {
entry:
call void @g(i32 45, i32 66)
call void @g(i32 88, i32 32)
call void @g(i32 55, i32 33)
ret void
}
; CHECK-LABEL: h:
; CHECK: bl g
; CHECK: bl g
define void @h() minsize optsize {
entry:
call void @g(i32 45, i32 66)
call void @g(i32 88, i32 32)
ret void
}
declare void @g(i32,i32)