mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-01 16:33:37 +01:00
e43aca1c39
Coalescing can remove copy-like instructions with sub-register operands that constrained the register class. Examples are: x86: GR32_ABCD:sub_8bit_hi -> GR32 arm: DPR_VFP2:ssub0 -> DPR Recompute the register class of any virtual registers that are used by less instructions after coalescing. This affects code generation for the Cortex-A8 where we use NEON instructions for f32 operations, c.f. fp_convert.ll: vadd.f32 d16, d1, d0 vcvt.s32.f32 d0, d16 The register allocator is now free to use d16 for the temporary, and that comes first in the allocation order because it doesn't interfere with any s-registers. llvm-svn: 137133
30 lines
798 B
LLVM
30 lines
798 B
LLVM
; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s -check-prefix=VFP2
|
|
; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s -check-prefix=NFP0
|
|
; RUN: llc < %s -march=arm -mcpu=cortex-a8 | FileCheck %s -check-prefix=CORTEXA8
|
|
; RUN: llc < %s -march=arm -mcpu=cortex-a9 | FileCheck %s -check-prefix=CORTEXA9
|
|
|
|
define float @test(float %a, float %b) {
|
|
entry:
|
|
%dum = fadd float %a, %b
|
|
%0 = tail call float @fabsf(float %dum)
|
|
%dum1 = fadd float %0, %b
|
|
ret float %dum1
|
|
}
|
|
|
|
declare float @fabsf(float)
|
|
|
|
; VFP2: test:
|
|
; VFP2: vabs.f32 s1, s1
|
|
|
|
; NFP1: test:
|
|
; NFP1: vabs.f32 d1, d1
|
|
; NFP0: test:
|
|
; NFP0: vabs.f32 s1, s1
|
|
|
|
; CORTEXA8: test:
|
|
; CORTEXA8: vadd.f32 [[D1:d[0-9]+]]
|
|
; CORTEXA8: vabs.f32 {{d[0-9]+}}, [[D1]]
|
|
|
|
; CORTEXA9: test:
|
|
; CORTEXA9: vabs.f32 s{{.}}, s{{.}}
|