Files
clang-p2996/llvm/test/CodeGen/Mips/buildpairf64-extractelementf64-implicit-sp.ll
Vladimir Stefanovic 0ef60da858 [mips] Prevent shrink-wrap for BuildPairF64, ExtractElementF64 when they use $sp
For a certain combination of options, BuildPairF64_{64}, ExtractElementF64{_64}
may be expanded into instructions using stack.
Add implicit operand $sp for such cases so that ShrinkWrapping doesn't move
prologue setup below them.

Fixes MultiSource/Benchmarks/MallocBench/cfrac for
'--target=mips-img-linux-gnu -mcpu=mips32r6 -mfpxx -mnan=2008'
and
'--target=mips-img-linux-gnu -mcpu=mips32r6 -mfp64 -mnan=2008 -mno-odd-spreg'.

Differential Revision: https://reviews.llvm.org/D50986

llvm-svn: 340927
2018-08-29 14:07:14 +00:00

33 lines
1.4 KiB
LLVM

; RUN: llc -o - %s -mtriple=mips-unknown-linux-gnu \
; RUN: -mcpu=mips32 -mattr=+fpxx \
; RUN: -stop-after=expand-isel-pseudos | \
; RUN: FileCheck %s -check-prefix=FPXX-IMPLICIT-SP
; RUN: llc -o - %s -mtriple=mips-unknown-linux-gnu \
; RUN: -mcpu=mips32r6 -mattr=+fp64,+nooddspreg \
; RUN: -stop-after=expand-isel-pseudos | \
; RUN: FileCheck %s -check-prefix=FP64-IMPLICIT-SP
; RUN: llc -o - %s -mtriple=mips-unknown-linux-gnu \
; RUN: -mcpu=mips32r2 -mattr=+fpxx \
; RUN: -stop-after=expand-isel-pseudos | \
; RUN: FileCheck %s -check-prefix=NO-IMPLICIT-SP
define double @foo2(i32 signext %v1, double %d1) {
entry:
; FPXX-IMPLICIT-SP: BuildPairF64 %{{[0-9]+}}, %{{[0-9]+}}, implicit $sp
; FPXX-IMPLICIT-SP: ExtractElementF64 killed %{{[0-9]+}}, 1, implicit $sp
; FP64-IMPLICIT-SP: BuildPairF64_64 %{{[0-9]+}}, %{{[0-9]+}}, implicit $sp
; FP64-IMPLICIT-SP: ExtractElementF64_64 killed %{{[0-9]+}}, 1, implicit $sp
; NO-IMPLICIT-SP: BuildPairF64 %{{[0-9]+}}, %{{[0-9]+}}
; NO-IMPLICIT-SP-NOT: BuildPairF64 %{{[0-9]+}}, %{{[0-9]+}}, implicit $sp
; NO-IMPLICIT-SP: ExtractElementF64 killed %{{[0-9]+}}, 1
; NO-IMPLICIT-SP-NOT: ExtractElementF64 killed %{{[0-9]+}}, 1, implicit $sp
%conv = fptrunc double %d1 to float
%0 = tail call float @llvm.copysign.f32(float 1.000000e+00, float %conv)
%conv1 = fpext float %0 to double
ret double %conv1
}
declare float @llvm.copysign.f32(float, float)