Skip to content

Commit aa943b1

Browse files
committed
Precommit test
1 parent 8696d16 commit aa943b1

File tree

2 files changed

+64
-3
lines changed

2 files changed

+64
-3
lines changed
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --no_x86_scrub_sp --no_x86_scrub_mem_shuffle --version 5
2+
; RUN: llc < %s | FileCheck %s
3+
4+
target triple = "x86_64-sie-ps5"
5+
6+
declare hidden void @use_ptr(ptr readonly) local_unnamed_addr
7+
8+
define hidden noundef i32 @sincos_stack_slot_with_lifetime(float %in) local_unnamed_addr {
9+
; CHECK-LABEL: sincos_stack_slot_with_lifetime:
10+
; CHECK: # %bb.0: # %entry
11+
; CHECK-NEXT: pushq %rbx
12+
; CHECK-NEXT: .cfi_def_cfa_offset 16
13+
; CHECK-NEXT: subq $16, %rsp
14+
; CHECK-NEXT: .cfi_def_cfa_offset 32
15+
; CHECK-NEXT: .cfi_offset %rbx, -16
16+
; CHECK-NEXT: leaq 12(%rsp), %rdi
17+
; CHECK-NEXT: leaq 8(%rsp), %rbx
18+
; CHECK-NEXT: movq %rbx, %rsi
19+
; CHECK-NEXT: callq sincosf@PLT
20+
; CHECK-NEXT: movq %rbx, %rdi
21+
; CHECK-NEXT: callq use_ptr
22+
; CHECK-NEXT: movss 12(%rsp), %xmm0 # xmm0 = mem[0],zero,zero,zero
23+
; CHECK-NEXT: xorps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
24+
; CHECK-NEXT: movss %xmm0, 8(%rsp)
25+
; CHECK-NEXT: leaq 8(%rsp), %rdi
26+
; CHECK-NEXT: callq use_ptr
27+
; CHECK-NEXT: movss 8(%rsp), %xmm0 # xmm0 = mem[0],zero,zero,zero
28+
; CHECK-NEXT: xorps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
29+
; CHECK-NEXT: movss %xmm0, 8(%rsp)
30+
; CHECK-NEXT: leaq 8(%rsp), %rdi
31+
; CHECK-NEXT: callq use_ptr
32+
; CHECK-NEXT: xorl %eax, %eax
33+
; CHECK-NEXT: addq $16, %rsp
34+
; CHECK-NEXT: .cfi_def_cfa_offset 16
35+
; CHECK-NEXT: popq %rbx
36+
; CHECK-NEXT: .cfi_def_cfa_offset 8
37+
; CHECK-NEXT: retq
38+
entry:
39+
%computed = alloca float, align 4
40+
%computed1 = alloca float, align 4
41+
%computed3 = alloca float, align 4
42+
%0 = tail call { float, float } @llvm.sincos.f32(float %in)
43+
%1 = extractvalue { float, float } %0, 0
44+
%2 = extractvalue { float, float } %0, 1
45+
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %computed)
46+
store float %2, ptr %computed, align 4
47+
call void @use_ptr(ptr nonnull %computed)
48+
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %computed)
49+
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %computed1)
50+
%fneg = fneg float %1
51+
store float %fneg, ptr %computed1, align 4
52+
call void @use_ptr(ptr nonnull %computed1)
53+
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %computed1)
54+
call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %computed3)
55+
%fneg4 = fneg float %2
56+
store float %fneg4, ptr %computed3, align 4
57+
call void @use_ptr(ptr nonnull %computed3)
58+
call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %computed3)
59+
ret i32 0
60+
}
61+

llvm/utils/UpdateTestChecks/asm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,10 @@ def scrub_asm_x86(asm, args):
294294
else:
295295
asm = SCRUB_X86_SHUFFLES_RE.sub(r"\1 {{.*#+}} \2", asm)
296296

297-
# Detect stack spills and reloads and hide their exact offset and whether
298-
# they used the stack pointer or frame pointer.
299-
asm = SCRUB_X86_SPILL_RELOAD_RE.sub(r"{{[-0-9]+}}(%\1{{[sb]}}p)\2", asm)
300297
if getattr(args, "x86_scrub_sp", True):
298+
# Detect stack spills and reloads and hide their exact offset and whether
299+
# they used the stack pointer or frame pointer.
300+
asm = SCRUB_X86_SPILL_RELOAD_RE.sub(r"{{[-0-9]+}}(%\1{{[sb]}}p)\2", asm)
301301
# Generically match the stack offset of a memory operand.
302302
asm = SCRUB_X86_SP_RE.sub(r"{{[0-9]+}}(%\1)", asm)
303303
if getattr(args, "x86_scrub_rip", False):

0 commit comments

Comments
 (0)