File: avx512-trap.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (27 lines) | stat: -rw-r--r-- 1,086 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Check that BOLT inserts trap instruction at entry to functions that use AVX-512.
# Check that AVX-512 instruction is updated correctly when -trap-avx512=0 is passed.

RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-unknown -o %t.o \
RUN:   %S/Inputs/avx512.s
RUN: ld.lld %t.o -o %t -q
RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t | \
RUN:   FileCheck %s --check-prefix=CHECK-DIS-NO-TRAP

RUN: llvm-bolt %t --trap-avx512=1 -o %t.bolt --lite=0 2>&1 | FileCheck %s
RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t.bolt | \
RUN:   FileCheck %s --check-prefix=CHECK-DIS

RUN: llvm-bolt %t --trap-avx512=0 -o %t.bolt --lite=0
RUN: llvm-objdump -d --disassemble-symbols=use_avx512 %t.bolt | \
RUN:   FileCheck %s --check-prefix=CHECK-DIS-NO-TRAP

CHECK: BOLT-WARNING: 1 function will trap on entry

# Check that we have two ud2 instructions - one per entry.
CHECK-DIS:      use_avx512
CHECK-DIS-NEXT:    ud2
CHECK-DIS-NEXT:    ud2

# Check that we generate correct AVX-512
CHECK-DIS-NO-TRAP:      use_avx512
CHECK-DIS-NO-TRAP:          62 e2 f5 70 2c da    	vscalefpd