| 1 |
; RUN: llvm-as < %s -o %t.bc |
| 2 |
; RUN: llvm-spirv %t.bc -spirv-text -o - | FileCheck %s |
| 3 |
|
| 4 |
;CHECK: Decorate [[#FUNC_NAME:]] LinkageAttributes "_Z10BitReversei" |
| 5 |
;CHECK-NOT: BitReverse |
| 6 |
;CHECK: FunctionCall [[#]] [[#]] [[#FUNC_NAME]] |
| 7 |
|
| 8 |
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" |
| 9 |
target triple = "spir64-unknown-linux" |
| 10 |
|
| 11 |
%"class._ZTSZ4mainE3$_0.anon" = type { i8 } |
| 12 |
|
| 13 |
$_Z10BitReversei = comdat any |
| 14 |
|
| 15 |
; Function Attrs: norecurse |
| 16 |
define dso_local spir_kernel void @_ZTSZ4mainE15kernel_function() #0 !kernel_arg_addr_space !4 !kernel_arg_access_qual !4 !kernel_arg_type !4 !kernel_arg_base_type !4 !kernel_arg_type_qual !4 { |
| 17 |
entry: |
| 18 |
%call = call spir_func i32 @_Z10BitReversei(i32 1) |
| 19 |
ret void |
| 20 |
} |
| 21 |
|
| 22 |
; Function Attrs: argmemonly nounwind willreturn |
| 23 |
declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #1 |
| 24 |
|
| 25 |
; Function Attrs: argmemonly nounwind willreturn |
| 26 |
declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #1 |
| 27 |
|
| 28 |
; Function Attrs: inlinehint norecurse nounwind |
| 29 |
define linkonce_odr dso_local spir_func i32 @_Z10BitReversei(i32 %value) #3 comdat { |
| 30 |
entry: |
| 31 |
%value.addr = alloca i32, align 4 |
| 32 |
%reversed = alloca i32, align 4 |
| 33 |
store i32 %value, i32* %value.addr, align 4, !tbaa !9 |
| 34 |
%0 = bitcast i32* %reversed to i8* |
| 35 |
call void @llvm.lifetime.start.p0i8(i64 4, i8* %0) #4 |
| 36 |
store i32 0, i32* %reversed, align 4, !tbaa !9 |
| 37 |
%1 = load i32, i32* %reversed, align 4, !tbaa !9 |
| 38 |
%2 = bitcast i32* %reversed to i8* |
| 39 |
call void @llvm.lifetime.end.p0i8(i64 4, i8* %2) #4 |
| 40 |
ret i32 %1 |
| 41 |
} |
| 42 |
|
| 43 |
attributes #0 = { norecurse "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "sycl-module-id"="Test.cpp" "uniform-work-group-size"="true" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 44 |
attributes #1 = { argmemonly nounwind willreturn } |
| 45 |
attributes #2 = { inlinehint norecurse "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 46 |
attributes #3 = { inlinehint norecurse nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 47 |
attributes #4 = { nounwind } |
| 48 |
|
| 49 |
!llvm.module.flags = !{!0} |
| 50 |
!opencl.spir.version = !{!1} |
| 51 |
!spirv.Source = !{!2} |
| 52 |
!llvm.ident = !{!3} |
| 53 |
|
| 54 |
!0 = !{i32 1, !"wchar_size", i32 4} |
| 55 |
!1 = !{i32 1, i32 2} |
| 56 |
!2 = !{i32 4, i32 100000} |
| 57 |
!3 = !{!"clang version 11.0.0 (https://github.com/c199914007/llvm.git dc6656ef210464a1c4721eb793b6b6f78a9a2048)"} |
| 58 |
!4 = !{} |
| 59 |
!5 = !{!6, !6, i64 0} |
| 60 |
!6 = !{!"any pointer", !7, i64 0} |
| 61 |
!7 = !{!"omnipotent char", !8, i64 0} |
| 62 |
!8 = !{!"Simple C++ TBAA"} |
| 63 |
!9 = !{!10, !10, i64 0} |
| 64 |
!10 = !{!"int", !7, i64 0} |