brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 0b8d247 Raw
36 lines · plain
1; RUN: llc < %s -mtriple=nvptx64-unknown-unknown | FileCheck %s2; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64-unknown-unknown | %ptxas-verify %}3;4; NVPTXTargetLowering::getFunctionParamOptimizedAlign, which was introduces in5; D120129, contained a poorly designed assertion checking that a function with6; internal or private linkage is not a kernel. It relied on invariants that7; were not actually guaranteed, and that resulted in compiler crash with some8; CUDA versions (see discussion with @jdoerfert in D120129). This test contains9; metadata that caused compiler crash and a function with internal linkage10; which purpose is to let compiler run on path where the crash happened.11; Metadata was obtained from libdevice.10.bc shipped with cuda-11-0.12 13 14define internal i32 @foo() {15  ; CHECK-LABEL: .func (.param .b32 func_retval0) foo()16  ret i32 4217}18 19define i32 @bar() {20  ; CHECK-LABEL: .visible .func (.param .b32 func_retval0) bar()21  %x = call i32 @foo()22  ret i32 %x23}24 25!nvvmir.version = !{!0}26!nvvm.annotations = !{!1, !2, !1, !3, !3, !3, !3, !4, !4, !3}27 28!0 = !{i32 1, i32 4}29!1 = !{null, !"align", i32 8}30!2 = !{null, !"align", i32 8, !"align", i32 65544, !"align", i32 131080}31!3 = !{null, !"align", i32 16}32!4 = !{null, !"align", i32 16, !"align", i32 65552, !"align", i32 131088}33!5 = distinct !{!5, !6}34!6 = !{!"llvm.loop.unroll.count", i32 1}35!7 = distinct !{!7, !6}36