1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -verify-machineinstrs -O3 -enable-implicit-null-checks -mcpu=skylake -x86-align-branch-boundary=32 -x86-align-branch=call+jmp+indirect+ret+jcc < %s | FileCheck %s
4 ;; The tests in this file check that various constructs which need to disable
5 ;; prefix and/or nop padding do so in the right places. However, since we
6 ;; don't yet have assembler syntax for this, they're only able to check
7 ;; comments and must hope the assembler does the right thing.
9 target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
10 target triple = "x86_64-pc-linux-gnu"
12 ; If we have autopadding enabled, make sure the label isn't separated from
14 define i32 @implicit_null_check(ptr %x) {
15 ; CHECK-LABEL: implicit_null_check:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: #noautopadding
19 ; CHECK-NEXT: movl (%rdi), %eax # on-fault: .LBB0_1
20 ; CHECK-NEXT: #autopadding
21 ; CHECK-NEXT: # %bb.2: # %not_null
23 ; CHECK-NEXT: .LBB0_1: # %is_null
24 ; CHECK-NEXT: movl $42, %eax
28 %c = icmp eq ptr %x, null
29 br i1 %c, label %is_null, label %not_null, !make.implicit !{}
35 %t = load atomic i32, ptr %x unordered, align 4
39 ; Label must bind to call before
40 define void @test_statepoint(ptr addrspace(1) %ptr) gc "statepoint-example" {
41 ; CHECK-LABEL: test_statepoint:
42 ; CHECK: # %bb.0: # %entry
43 ; CHECK-NEXT: pushq %rax
44 ; CHECK-NEXT: .cfi_def_cfa_offset 16
45 ; CHECK-NEXT: #noautopadding
46 ; CHECK-NEXT: callq return_i1@PLT
48 ; CHECK-NEXT: #autopadding
49 ; CHECK-NEXT: popq %rax
50 ; CHECK-NEXT: .cfi_def_cfa_offset 8
53 call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0)
57 declare zeroext i1 @return_i1()
58 declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)
61 ; Label must bind to following nop sequence
62 define void @patchpoint(i64 %a, i64 %b) {
63 ; CHECK-LABEL: patchpoint:
64 ; CHECK: # %bb.0: # %entry
65 ; CHECK-NEXT: pushq %rbp
66 ; CHECK-NEXT: .cfi_def_cfa_offset 16
67 ; CHECK-NEXT: .cfi_offset %rbp, -16
68 ; CHECK-NEXT: movq %rsp, %rbp
69 ; CHECK-NEXT: .cfi_def_cfa_register %rbp
70 ; CHECK-NEXT: #noautopadding
72 ; CHECK-NEXT: .byte 102
73 ; CHECK-NEXT: .byte 102
74 ; CHECK-NEXT: .byte 102
75 ; CHECK-NEXT: .byte 102
76 ; CHECK-NEXT: .byte 102
77 ; CHECK-NEXT: nopw %cs:512(%rax,%rax)
78 ; CHECK-NEXT: #autopadding
79 ; CHECK-NEXT: popq %rbp
80 ; CHECK-NEXT: .cfi_def_cfa %rsp, 8
83 call void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 4, i32 15, ptr null, i32 0, i64 %a, i64 %b)
88 declare void @llvm.experimental.stackmap(i64, i32, ...)
89 declare void @llvm.experimental.patchpoint.void(i64, i32, ptr, i32, ...)