brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · b54976c Raw
31 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 22; RUN: opt -mtriple=amdgcn--amdhsa -passes=amdgpu-printf-runtime-binding -S < %s | FileCheck %s3; RUN: opt -mtriple=amdgcn--amdhsa -O0 -S < %s | FileCheck %s4 5; Check that the call to printf is removed when AMDGPUPrintfRuntimeBindingPass is executed6;   And that this pass is executed in the -O0 and -OX pipelines7 8@.str = private unnamed_addr addrspace(4) constant [7 x i8] c"hello\0A\00", align 19 10define void @foo() {11; CHECK-LABEL: define void @foo() {12; CHECK-NEXT:    [[PRINTF_ALLOC_FN:%.*]] = call ptr addrspace(1) @__printf_alloc(i32 4)13; CHECK-NEXT:    br label [[DOTSPLIT:%.*]]14; CHECK:       .split:15; CHECK-NEXT:    [[TMP1:%.*]] = icmp ne ptr addrspace(1) [[PRINTF_ALLOC_FN]], null16; CHECK-NEXT:    br i1 [[TMP1]], label [[TMP2:%.*]], label [[TMP3:%.*]]17; CHECK:       2:18; CHECK-NEXT:    [[PRINTBUFFID:%.*]] = getelementptr i8, ptr addrspace(1) [[PRINTF_ALLOC_FN]], i32 019; CHECK-NEXT:    [[PRINTBUFFIDCAST:%.*]] = bitcast ptr addrspace(1) [[PRINTBUFFID]] to ptr addrspace(1)20; CHECK-NEXT:    store i32 1, ptr addrspace(1) [[PRINTBUFFIDCAST]], align 421; CHECK-NEXT:    [[PRINTBUFFGEP:%.*]] = getelementptr i8, ptr addrspace(1) [[PRINTF_ALLOC_FN]], i32 422; CHECK-NEXT:    br label [[TMP3]]23; CHECK:       3:24; CHECK-NEXT:    ret void25;26  %call = call i32 @printf(ptr addrspace(4) @.str)27  ret void28}29 30declare hidden i32 @printf(ptr addrspace(4), ...)31