90 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; 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 %s3 4;; The tests in this file check that various constructs which need to disable5;; prefix and/or nop padding do so in the right places. However, since we6;; don't yet have assembler syntax for this, they're only able to check7;; comments and must hope the assembler does the right thing.8 9target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"10target triple = "x86_64-pc-linux-gnu"11 12; If we have autopadding enabled, make sure the label isn't separated from13; the mov.14define i32 @implicit_null_check(ptr %x) {15; CHECK-LABEL: implicit_null_check:16; CHECK: # %bb.0: # %entry17; CHECK-NEXT: #noautopadding18; CHECK-NEXT: .Ltmp0:19; CHECK-NEXT: movl (%rdi), %eax # on-fault: .LBB0_120; CHECK-NEXT: #autopadding21; CHECK-NEXT: # %bb.2: # %not_null22; CHECK-NEXT: retq23; CHECK-NEXT: .LBB0_1: # %is_null24; CHECK-NEXT: movl $42, %eax25; CHECK-NEXT: retq26 27 entry:28 %c = icmp eq ptr %x, null29 br i1 %c, label %is_null, label %not_null, !make.implicit !{}30 31 is_null:32 ret i32 4233 34 not_null:35 %t = load atomic i32, ptr %x unordered, align 436 ret i32 %t37}38 39; Label must bind to call before40define void @test_statepoint(ptr addrspace(1) %ptr) gc "statepoint-example" {41; CHECK-LABEL: test_statepoint:42; CHECK: # %bb.0: # %entry43; CHECK-NEXT: pushq %rax44; CHECK-NEXT: .cfi_def_cfa_offset 1645; CHECK-NEXT: #noautopadding46; CHECK-NEXT: callq return_i1@PLT47; CHECK-NEXT: .Ltmp1:48; CHECK-NEXT: #autopadding49; CHECK-NEXT: popq %rax50; CHECK-NEXT: .cfi_def_cfa_offset 851; CHECK-NEXT: retq52entry: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)54 ret void55}56 57declare zeroext i1 @return_i1()58declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)59 60 61; Label must bind to following nop sequence62define void @patchpoint(i64 %a, i64 %b) {63; CHECK-LABEL: patchpoint:64; CHECK: # %bb.0: # %entry65; CHECK-NEXT: pushq %rbp66; CHECK-NEXT: .cfi_def_cfa_offset 1667; CHECK-NEXT: .cfi_offset %rbp, -1668; CHECK-NEXT: movq %rsp, %rbp69; CHECK-NEXT: .cfi_def_cfa_register %rbp70; CHECK-NEXT: #noautopadding71; CHECK-NEXT: .Ltmp2:72; CHECK-NEXT: .byte 10273; CHECK-NEXT: .byte 10274; CHECK-NEXT: .byte 10275; CHECK-NEXT: .byte 10276; CHECK-NEXT: .byte 10277; CHECK-NEXT: nopw %cs:512(%rax,%rax)78; CHECK-NEXT: #autopadding79; CHECK-NEXT: popq %rbp80; CHECK-NEXT: .cfi_def_cfa %rsp, 881; CHECK-NEXT: retq82entry:83 call void (i64, i32, ptr, i32, ...) @llvm.experimental.patchpoint.void(i64 4, i32 15, ptr null, i32 0, i64 %a, i64 %b)84 ret void85}86 87 88declare void @llvm.experimental.stackmap(i64, i32, ...)89declare void @llvm.experimental.patchpoint.void(i64, i32, ptr, i32, ...)90