1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_sp --version 5
2 ; RUN: llc < %s -mtriple=i386-unknown-linux-gnu | FileCheck %s
3 ; Test for issue https://github.com/llvm/llvm-project/issues/115323
5 declare double @g(double, double)
7 ; Though not visible within the IR, this will lower to an FSINCOS node, with
8 ; store users, that are within a (callseq_start, callseq_end) pair. In this
9 ; case, the stores cannot be folded into the sincos call.
10 define double @negative_sincos_with_stores_within_call_sequence(double %a) {
11 ; CHECK-LABEL: negative_sincos_with_stores_within_call_sequence:
12 ; CHECK: # %bb.0: # %entry
13 ; CHECK-NEXT: subl $44, %esp
14 ; CHECK-NEXT: .cfi_def_cfa_offset 48
15 ; CHECK-NEXT: fldl 48(%esp)
16 ; CHECK-NEXT: leal 24(%esp), %eax
17 ; CHECK-NEXT: movl %eax, 12(%esp)
18 ; CHECK-NEXT: leal 32(%esp), %eax
19 ; CHECK-NEXT: movl %eax, 8(%esp)
20 ; CHECK-NEXT: fstpl (%esp)
21 ; CHECK-NEXT: calll sincos
22 ; CHECK-NEXT: fldl 32(%esp)
23 ; CHECK-NEXT: fldl 24(%esp)
24 ; CHECK-NEXT: faddl {{\.?LCPI[0-9]+_[0-9]+}}
25 ; CHECK-NEXT: fxch %st(1)
26 ; CHECK-NEXT: fstpl 8(%esp)
27 ; CHECK-NEXT: fstpl (%esp)
28 ; CHECK-NEXT: calll g@PLT
29 ; CHECK-NEXT: addl $44, %esp
30 ; CHECK-NEXT: .cfi_def_cfa_offset 4
33 %0 = tail call double @llvm.sin.f64(double %a)
34 %1 = tail call double @llvm.cos.f64(double %a)
35 %add = fadd double %1, 3.140000e+00
36 %call = tail call double @g(double %add, double %0)