1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
llvm-mirror/test/CodeGen/Hexagon/zextloadi1.ll
Krzysztof Parzyszek fb2c0df237 [Hexagon] Minimize number of repeated constant extenders
Each constant extender requires an extra instruction, which adds to the
code size and also reduces the number of available slots in an instruction
packet. In most cases, the value of a repeated constant extender could be
loaded into a register, and the instructions using the extender could be
replaced with their counterparts that use that register instead.

This patch adds a pass that tries to reduce the number of constant
extenders, including extenders which differ only in an immediate offset
known at compile time, e.g. @global and @global+12.

llvm-svn: 315735
2017-10-13 19:02:59 +00:00

31 lines
939 B
LLVM

; RUN: llc -march=hexagon -hexagon-cext=0 < %s | FileCheck %s
@i65_l = external global i65
@i65_s = external global i65
@i129_l = external global i129
@i129_s = external global i129
; CHECK-LABEL: i129_ls
; CHECK-DAG: r[[REG0:[0-9:]+]] = memd(##i129_l)
; CHECK-DAG: r[[REG1:[0-9:]+]] = memd(##i129_l+8)
; CHECK-DAG: r[[REG2:[0-9]+]] = memub(##i129_l+16)
; CHECK-DAG: memb(##i129_s+16) = r[[REG2]]
; CHECK-DAG: memd(##i129_s+8) = r[[REG1]]
; CHECK-DAG: memd(##i129_s) = r[[REG0]]
define void @i129_ls() nounwind {
%tmp = load i129, i129* @i129_l
store i129 %tmp, i129* @i129_s
ret void
}
; CHECK-LABEL: i65_ls
; CHECK-DAG: r[[REG0:[0-9:]+]] = memd(##i65_l)
; CHECK-DAG: r[[REG1:[0-9]+]] = memub(##i65_l+8)
; CHECK-DAG: memd(##i65_s) = r[[REG0]]
; CHECK-DAG: memb(##i65_s+8) = r[[REG1]]
define void @i65_ls() nounwind {
%tmp = load i65, i65* @i65_l
store i65 %tmp, i65* @i65_s
ret void
}