brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 070bcd4 Raw
67 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S < %s | FileCheck %s3 4; Make sure that opaque pointer intrinsic remangling upgrade works.5 6%int8x16x2_t = type { <16 x i8>, <16 x i8> }7 8declare ptr @fake_personality_function()9declare void @func()10 11; Upgrading of invoked intrinsic.12define void @test_invoke(ptr addrspace(1) %b) gc "statepoint-example" personality ptr @fake_personality_function {13; CHECK-LABEL: @test_invoke(14; CHECK-NEXT:  entry:15; CHECK-NEXT:    [[D:%.*]] = getelementptr i32, ptr addrspace(1) [[B:%.*]], i64 1616; CHECK-NEXT:    [[SAFEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) [[B]], ptr addrspace(1) [[B]], ptr addrspace(1) [[D]], ptr addrspace(1) [[D]]) ]17; CHECK-NEXT:    to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]18; CHECK:       normal_dest:19; CHECK-NEXT:    ret void20; CHECK:       unwind_dest:21; CHECK-NEXT:    [[LPAD:%.*]] = landingpad token22; CHECK-NEXT:    cleanup23; CHECK-NEXT:    ret void24;25entry:26  %d = getelementptr i32, ptr addrspace(1) %b, i64 1627  %safepoint_token = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) ["gc-live" (ptr addrspace(1) %b, ptr addrspace(1) %b, ptr addrspace(1) %d, ptr addrspace(1) %d)]28  to label %normal_dest unwind label %unwind_dest29 30normal_dest:31  ret void32 33unwind_dest:34  %lpad = landingpad token35  cleanup36  ret void37}38 39define ptr @test_ptr_annotation(ptr %p) {40; CHECK-LABEL: @test_ptr_annotation(41; CHECK-NEXT:    [[P2:%.*]] = call ptr @llvm.ptr.annotation.p0.p0(ptr [[P:%.*]], ptr undef, ptr undef, i32 undef, ptr undef)42; CHECK-NEXT:    ret ptr [[P2]]43;44  %p2 = call ptr @llvm.ptr.annotation.p0(ptr %p, ptr undef, ptr undef, i32 undef, ptr undef)45  ret ptr %p246}47 48 49define void @test_struct_return(ptr %res.p, ptr %a) {50; CHECK-LABEL: @test_struct_return(51; CHECK-NEXT:    [[TMP1:%.*]] = call { <16 x i8>, <16 x i8> } @llvm.aarch64.neon.ld1x2.v16i8.p0(ptr [[A:%.*]])52; CHECK-NEXT:    [[TMP2:%.*]] = extractvalue { <16 x i8>, <16 x i8> } [[TMP1]], 053; CHECK-NEXT:    [[TMP3:%.*]] = insertvalue [[INT8X16X2_T:%.*]] poison, <16 x i8> [[TMP2]], 054; CHECK-NEXT:    [[TMP4:%.*]] = extractvalue { <16 x i8>, <16 x i8> } [[TMP1]], 155; CHECK-NEXT:    [[TMP5:%.*]] = insertvalue [[INT8X16X2_T]] [[TMP3]], <16 x i8> [[TMP4]], 156; CHECK-NEXT:    store [[INT8X16X2_T]] [[TMP5]], ptr [[RES_P:%.*]], align 1657; CHECK-NEXT:    ret void58;59  %res = call %int8x16x2_t @llvm.aarch64.neon.ld1x2.v16i8.p0(ptr %a)60  store %int8x16x2_t %res, ptr %res.p61  ret void62}63 64declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...)65declare ptr @llvm.ptr.annotation.p0(ptr, ptr, ptr, i32, ptr)66declare %int8x16x2_t @llvm.aarch64.neon.ld1x2.v16i8.p0(ptr)67