brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 0b65ef8 Raw
93 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52; RUN: llc < %s -mtriple=nvptx -mcpu=sm_20 -verify-machineinstrs -trap-unreachable=false \3; RUN:     | FileCheck %s --check-prefixes=CHECK,NO-TRAP-UNREACHABLE4; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable=false \5; RUN:     | FileCheck %s --check-prefixes=CHECK,NO-TRAP-UNREACHABLE6; RUN: llc < %s -mtriple=nvptx -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -no-trap-after-noreturn \7; RUN:     | FileCheck %s --check-prefixes=CHECK,NO-TRAP-AFTER-NORETURN8; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -no-trap-after-noreturn \9; RUN:     | FileCheck %s --check-prefixes=CHECK,NO-TRAP-AFTER-NORETURN10; RUN: llc < %s -mtriple=nvptx -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -no-trap-after-noreturn=false \11; RUN:     | FileCheck %s --check-prefixes=CHECK,TRAP12; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -no-trap-after-noreturn=false \13; RUN:     | FileCheck %s --check-prefixes=CHECK,TRAP14; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_20 -verify-machineinstrs -trap-unreachable -mattr=+ptx83 \15; RUN:     | FileCheck %s --check-prefixes=BUG-FIXED16; RUN: %if ptxas-ptr32 %{ llc < %s -mtriple=nvptx -mcpu=sm_20 -verify-machineinstrs | %ptxas-verify %}17; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_20 -verify-machineinstrs | %ptxas-verify %}18 19target triple = "nvptx-unknown-cuda"20 21declare void @throw() #022declare void @llvm.trap() #023 24define ptx_kernel void @kernel_func() {25; NO-TRAP-UNREACHABLE-LABEL: kernel_func(26; NO-TRAP-UNREACHABLE:       {27; NO-TRAP-UNREACHABLE-EMPTY:28; NO-TRAP-UNREACHABLE-EMPTY:29; NO-TRAP-UNREACHABLE-NEXT:  // %bb.0:30; NO-TRAP-UNREACHABLE-NEXT:    { // callseq 0, 031; NO-TRAP-UNREACHABLE-NEXT:    call.uni throw, ();32; NO-TRAP-UNREACHABLE-NEXT:    } // callseq 033; NO-TRAP-UNREACHABLE-NEXT:    // begin inline asm34; NO-TRAP-UNREACHABLE-NEXT:    exit;35; NO-TRAP-UNREACHABLE-NEXT:    // end inline asm36;37; NO-TRAP-AFTER-NORETURN-LABEL: kernel_func(38; NO-TRAP-AFTER-NORETURN:       {39; NO-TRAP-AFTER-NORETURN-EMPTY:40; NO-TRAP-AFTER-NORETURN-EMPTY:41; NO-TRAP-AFTER-NORETURN-NEXT:  // %bb.0:42; NO-TRAP-AFTER-NORETURN-NEXT:    { // callseq 0, 043; NO-TRAP-AFTER-NORETURN-NEXT:    call.uni throw, ();44; NO-TRAP-AFTER-NORETURN-NEXT:    } // callseq 045; NO-TRAP-AFTER-NORETURN-NEXT:    // begin inline asm46; NO-TRAP-AFTER-NORETURN-NEXT:    exit;47; NO-TRAP-AFTER-NORETURN-NEXT:    // end inline asm48; NO-TRAP-AFTER-NORETURN-NEXT:    trap; exit;49;50; TRAP-LABEL: kernel_func(51; TRAP:       {52; TRAP-EMPTY:53; TRAP-EMPTY:54; TRAP-NEXT:  // %bb.0:55; TRAP-NEXT:    { // callseq 0, 056; TRAP-NEXT:    call.uni throw, ();57; TRAP-NEXT:    } // callseq 058; TRAP-NEXT:    trap; exit;59;60; BUG-FIXED-LABEL: kernel_func(61; BUG-FIXED:       {62; BUG-FIXED-EMPTY:63; BUG-FIXED-EMPTY:64; BUG-FIXED-NEXT:  // %bb.0:65; BUG-FIXED-NEXT:    { // callseq 0, 066; BUG-FIXED-NEXT:    call.uni throw, ();67; BUG-FIXED-NEXT:    } // callseq 068; BUG-FIXED-NEXT:    trap;69  call void @throw()70  unreachable71}72 73define void @kernel_func_2() {74; CHECK-LABEL: kernel_func_2(75; CHECK:       {76; CHECK-EMPTY:77; CHECK-EMPTY:78; CHECK-NEXT:  // %bb.0:79; CHECK-NEXT:    trap; exit;80;81; BUG-FIXED-LABEL: kernel_func_2(82; BUG-FIXED:       {83; BUG-FIXED-EMPTY:84; BUG-FIXED-EMPTY:85; BUG-FIXED-NEXT:  // %bb.0:86; BUG-FIXED-NEXT:    trap;87  call void @llvm.trap()88; Make sure we avoid emitting two trap instructions.89  unreachable90}91 92attributes #0 = { noreturn }93