48 lines · plain
1; RUN: opt < %s -aa-pipeline=basic-aa -passes=aa-eval -print-all-alias-modref-info -disable-output 2>&1 | FileCheck %s2 3declare void @readonly_attr(ptr readonly nocapture)4declare void @writeonly_attr(ptr writeonly nocapture)5declare void @readnone_attr(ptr readnone nocapture)6declare void @byval_attr(ptr byval(i32))7 8declare void @readonly_func(ptr nocapture) readonly9declare void @writeonly_func(ptr nocapture) writeonly10declare void @readnone_func(ptr nocapture) readnone11 12declare void @read_write(ptr writeonly nocapture, ptr readonly nocapture, ptr readnone nocapture)13 14declare void @func()15 16define void @test(ptr noalias %p) {17entry:18 load i8, ptr %p19 call void @readonly_attr(ptr %p)20 call void @readonly_func(ptr %p)21 22 call void @writeonly_attr(ptr %p)23 call void @writeonly_func(ptr %p)24 25 call void @readnone_attr(ptr %p)26 call void @readnone_func(ptr %p)27 28 call void @byval_attr(ptr %p)29 30 call void @read_write(ptr %p, ptr %p, ptr %p)31 32 call void @func() ["deopt" (ptr %p)]33 call void @writeonly_attr(ptr %p) ["deopt" (ptr %p)]34 35 ret void36}37 38; CHECK: Just Ref: Ptr: i8* %p <-> call void @readonly_attr(ptr %p)39; CHECK: Just Ref: Ptr: i8* %p <-> call void @readonly_func(ptr %p)40; CHECK: Just Mod: Ptr: i8* %p <-> call void @writeonly_attr(ptr %p)41; CHECK: Just Mod: Ptr: i8* %p <-> call void @writeonly_func(ptr %p)42; CHECK: NoModRef: Ptr: i8* %p <-> call void @readnone_attr(ptr %p)43; CHECK: NoModRef: Ptr: i8* %p <-> call void @readnone_func(ptr %p)44; CHECK: Just Ref: Ptr: i8* %p <-> call void @byval_attr(ptr %p)45; CHECK: Both ModRef: Ptr: i8* %p <-> call void @read_write(ptr %p, ptr %p, ptr %p)46; CHECK: Just Ref: Ptr: i8* %p <-> call void @func() [ "deopt"(ptr %p) ]47; CHECK: Both ModRef: Ptr: i8* %p <-> call void @writeonly_attr(ptr %p) [ "deopt"(ptr %p) ]48