brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 9ac1c63 Raw
28 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=infer-address-spaces %s | FileCheck %s3 4%0 = type { i8, i8, i8 }5 6; Make sure there is only one addrspacecast. The original cast should7; not be cloned to satisfy the second user.8define void @bar(ptr addrspace(1) %orig.ptr) {9; CHECK-LABEL: @bar(10; CHECK-NEXT:  bb:11; CHECK-NEXT:    [[ORIG_CAST:%.*]] = addrspacecast ptr addrspace(1) [[ORIG_PTR:%.*]] to ptr12; CHECK-NEXT:    [[GEP0:%.*]] = getelementptr inbounds [[TMP0:%.*]], ptr [[ORIG_CAST]], i64 0, i32 113; CHECK-NEXT:    call void @foo(ptr [[GEP0]])14; CHECK-NEXT:    [[GEP1:%.*]] = getelementptr inbounds [[TMP0]], ptr [[ORIG_CAST]], i64 0, i32 215; CHECK-NEXT:    call void @foo(ptr [[GEP1]])16; CHECK-NEXT:    ret void17;18bb:19  %orig.cast = addrspacecast ptr addrspace(1) %orig.ptr to ptr20  %gep0 = getelementptr inbounds %0, ptr %orig.cast, i64 0, i32 121  call void @foo(ptr %gep0)22  %gep1 = getelementptr inbounds %0, ptr %orig.cast, i64 0, i32 223  call void @foo(ptr %gep1)24  ret void25}26 27declare void @foo(ptr)28