diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-02-01-ReturnAttrs.ll @@ -68,3 +68,9 @@ %tmp1 = call i32 @deref( i32* %x_addr ) nounwind ret i32 %tmp1 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nounwind readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-07-02-array-indexing.ll @@ -67,3 +67,7 @@ ret i32 %X } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-07-CGUpdate.ll @@ -31,3 +31,5 @@ %0 = call fastcc i32 @hash( i32* %ts, i32 0 ) nounwind ; [#uses=0] unreachable } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/2008-09-08-CGUpdateSelfEdge.ll @@ -67,3 +67,6 @@ bb14: ; preds = %entry ret i32 0 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nounwind } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/attributes.ll @@ -191,3 +191,10 @@ attributes #0 = { inlinehint norecurse nounwind uwtable "target-features"="+avx2" } attributes #1 = { nounwind uwtable } attributes #2 = { argmemonly nounwind } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { argmemonly nosync nounwind uwtable willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { argmemonly inlinehint norecurse nosync nounwind uwtable willreturn "target-features"="+avx2" } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { argmemonly nounwind willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR5:#.*]] = { nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR5:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/min-legal-vector-width.ll @@ -755,3 +755,17 @@ attributes #3 = { inlinehint norecurse nounwind uwtable "target-features"="+avx2" "min-legal-vector-width"="512" "prefer-vector-width"="256" } attributes #4 = { inlinehint norecurse nounwind uwtable "target-features"="+avx2" "min-legal-vector-width"="256" "prefer-vector-width"="256" } attributes #5 = { argmemonly nounwind } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { argmemonly inlinehint norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { argmemonly inlinehint norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { argmemonly inlinehint norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { argmemonly inlinehint norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { argmemonly inlinehint nofree norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { argmemonly inlinehint norecurse nosync nounwind uwtable willreturn "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { argmemonly nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR12:#.*]] = { nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes [[ATTR12:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/X86/thiscall.ll @@ -3,7 +3,6 @@ ; calling convention is passed in a register. This test verifies that ; we don't do that anymore. It also verifies that the combination of ; globalopt and argpromotion is able to optimize the call safely. -; ; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM @@ -73,3 +72,4 @@ declare void @ext(<{ %struct.a }>* inalloca) declare i8* @llvm.stacksave() declare void @llvm.stackrestore(i8*) +; CHECK: attributes [[ATTR0:#.*]] = { nounwind } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/aggregate-promote.ll @@ -54,3 +54,6 @@ %v = call i32 @test(%T* @G) ret i32 %v } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/alignment.ll @@ -176,3 +176,13 @@ %X = call i32 @caller(i32* %B) ret i32 %X } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { readonly willreturn } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll @@ -160,3 +160,8 @@ ret i32 %c } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { willreturn } +; IS__CGSCC_NPM: attributes [[ATTR1:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes [[ATTR2:#.*]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/basictest.ll @@ -104,3 +104,13 @@ ret i32 %X } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { readonly willreturn } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval-2.ll @@ -90,3 +90,6 @@ call void @f( %struct.ss* byval %S, i32* byval %X) ret i32 0 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll @@ -210,3 +210,6 @@ } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll @@ -47,3 +47,6 @@ ret i32 %x } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow.ll @@ -59,3 +59,7 @@ ret i32 %X } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/control-flow2.ll @@ -78,3 +78,9 @@ ret i32 %X } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/crash.ll @@ -127,3 +127,8 @@ } declare i32 @wibble(...) +; IS__TUNIT____: attributes [[ATTR0]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { noreturn nounwind readnone } +; IS__CGSCC____: attributes [[ATTR0]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { noreturn nounwind readnone } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/fp80.ll @@ -110,3 +110,7 @@ %gep = getelementptr %struct.Foo, %struct.Foo* %a, i64 0 br label %loop } +; NOT_CGSCC_NPM: attributes [[ATTR0:#.*]] = { nofree noreturn nosync nounwind readnone } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse noreturn nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree norecurse noreturn nosync nounwind readnone } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/inalloca.ll @@ -103,3 +103,9 @@ %c = call i1 @g(%struct.ss* %S, %struct.ss* inalloca %S) ret i32 0 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/invalidation.ll @@ -6,7 +6,6 @@ ; detect the instruction-level changes that will fail here. With improper ; invalidation this will crash in the second printer as it tries to reuse ; now-invalid demanded bits. -; ; RUN: opt < %s -passes='function(print),attributor,function(print)' -S | FileCheck %s @G = constant i32 0 @@ -50,3 +49,4 @@ %result = add i32 %v1, %v2 ret i32 %result } +; CHECK: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead.ll @@ -81,3 +81,11 @@ ret i32 %X } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR2:#.*]] = { nofree nosync nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/live_called_from_dead_2.ll @@ -103,3 +103,9 @@ ret i32 %X } +; NOT_CGSCC_NPM: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; NOT_CGSCC_NPM: attributes [[ATTR2:#.*]] = { nofree nosync nounwind willreturn writeonly } +; NOT_CGSCC_NPM: attributes [[ATTR3:#.*]] = { nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll @@ -180,3 +180,18 @@ %v = call i32 @test2b(%T* %g, i32 0) ret i32 %v } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR5:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR6:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { readonly willreturn } +; IS__CGSCC____: attributes [[ATTR5:#.*]] = { willreturn } +; IS__CGSCC____: attributes [[ATTR6:#.*]] = { nounwind willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR7:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/naked_functions.ll @@ -36,3 +36,4 @@ attributes #0 = { naked } +; CHECK: attributes [[ATTR0:#.*]] = { naked } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/nonzero-address-spaces.ll @@ -38,3 +38,4 @@ unreachable } +; CHECK: attributes [[ATTR0:#.*]] = { noreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr32917.ll @@ -54,3 +54,6 @@ store i32 %3, i32* @a, align 4 ret void } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/pr33641_remove_arg_dbgvalue.ll @@ -54,3 +54,8 @@ !4 = !DILocalVariable(name: "p", scope: !3) !5 = !DIExpression() !6 = !DILocation(line: 1, column: 1, scope: !3) +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nounwind readnone speculatable willreturn } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/reserve-tbaa.ll @@ -84,3 +84,6 @@ !8 = !{!9, !9, i64 0} !9 = !{!"any pointer", !3, i64 0} +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll b/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll --- a/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll +++ b/llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll @@ -86,3 +86,9 @@ call void @add({i32, i32}* %pair, i32* sret %r) ret void } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll b/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/2008-06-09-WeakProp.ll @@ -29,3 +29,4 @@ ret i32 %r } +; CHECK: attributes [[ATTR0:#.*]] = { nounwind } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/2009-09-24-byval-ptr.ll @@ -246,3 +246,10 @@ %result = call i32 @vfu2_v2(%struct.MYstr* byval align 4 @mystr) nounwind ret i32 %result } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll @@ -94,3 +94,6 @@ %cond = select i1 %tobool, i64 %p1, i64 %p1 ret i64 %cond } +; IS__TUNIT____: attributes [[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll @@ -167,3 +167,10 @@ %cond = select i1 %tobool, i32 %p1, i32 %p1 ret i32 %cond } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind null_pointer_is_valid } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { nofree nosync nounwind readnone } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind null_pointer_is_valid } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll b/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/PR43857.ll @@ -45,3 +45,5 @@ %tmp1 = extractvalue %struct.zot %tmp, 0, 0 ret void } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll @@ -5,16 +5,13 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM ; The original C source looked like this: -; ; long long a101, b101, e101; ; volatile long c101; ; int d101; -; ; static inline int bar(p1, p2) ; { ; return 0; ; } -; ; void foo(unsigned p1) ; { ; long long *f = &b101, *g = &e101; @@ -22,12 +19,9 @@ ; (void)((*f |= a101) - (*g = bar(d101))); ; c101 = (*f |= a101 &= p1) == d101; ; } -; ; When compiled with Clang it gives a warning ; warning: too few arguments in call to 'bar' -; ; This ll reproducer has been reduced to only include tha call. -; ; Note that -lint will report this as UB, but it passes -verify. ; This test is just to verify that we do not crash/assert due to mismatch in @@ -139,3 +133,6 @@ ret i16 %p1 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll b/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/arg-type-mismatch.ll @@ -32,3 +32,5 @@ } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll b/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/comdat-ipo.ll @@ -39,3 +39,5 @@ %val = call i32 @foo() ret i32 %val } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll b/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/dangling-block-address.ll @@ -81,3 +81,8 @@ entry: ret i32 0 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nounwind readnone } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nounwind readonly } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/fp-bc-icmp-const-fold.ll @@ -108,3 +108,5 @@ unreachable } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree noreturn nosync nounwind readnone } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse noreturn nosync nounwind readnone } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/global.ll b/llvm/test/Transforms/Attributor/IPConstantProp/global.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/global.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/global.ll @@ -61,3 +61,7 @@ %tmp = load i32, i32* @_ZL6test1g, align 4 ret i32 %tmp } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll b/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/multiple_callbacks.ll @@ -3,14 +3,11 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; -; ; /---------------------------------------| ; | /----------------------|----| ; | | /-----| | ; V V V | | ; void broker(int (*cb0)(int), int (*cb1)(int), int (*cb2)(int), int, int); -; ; static int cb0(int zero) { ; return zero; ; } @@ -27,7 +24,6 @@ ; static int cb4(int unknown) { ; return unknown; ; } -; ; void foo() { ; cb0(0); ; cb3(1); @@ -36,7 +32,6 @@ ; broker(cb3, cb2, cb3, 0, 1); ; broker(cb4, cb4, cb4, 0, 1); ; } -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define internal i32 @cb0(i32 %zero) { @@ -150,3 +145,5 @@ !1 = !{i64 1, i64 4, i1 false} !2 = !{i64 2, i64 3, i1 false} !3 = !{!0, !2, !1} +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/musttail-call.ll @@ -108,3 +108,4 @@ %i1 = call i32 @external() ret i8* null } +; CHECK: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll b/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/naked-return.ll @@ -50,3 +50,5 @@ attributes #0 = { naked } attributes #1 = { "frame-pointer"="all" } +; CHECK: attributes [[ATTR0:#.*]] = { naked } +; CHECK: attributes [[ATTR1:#.*]] = { "frame-pointer"="all" } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll b/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/openmp_parallel_for.ll @@ -3,22 +3,17 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; void bar(int, float, double); -; ; void foo(int N) { ; float p = 3; ; double q = 5; ; N = 7; -; ; #pragma omp parallel for firstprivate(q) ; for (int i = 2; i < N; i++) { ; bar(i, p, q); ; } ; } -; ; Verify the constant value of q is propagated into the outlined function. -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" %struct.ident_t = type { i32, i32, i32, i32, i8* } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll b/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/pthreads.ll @@ -3,24 +3,18 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=7 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; #include -; ; void *GlobalVPtr; -; ; static void *foo(void *arg) { return arg; } ; static void *bar(void *arg) { return arg; } -; ; int main() { ; pthread_t thread; ; pthread_create(&thread, NULL, foo, NULL); ; pthread_create(&thread, NULL, bar, &GlobalVPtr); ; return 0; ; } -; ; Verify the constant values NULL and &GlobalVPtr are propagated into foo and ; bar, respectively. -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" %union.pthread_attr_t = type { i64, [48 x i8] } @@ -136,3 +130,5 @@ !1 = !{i64 2, i64 3, i1 false} !0 = !{!1} +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll b/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/recursion.ll @@ -29,3 +29,5 @@ ret void } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll b/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/remove-call-inst.ll @@ -51,3 +51,6 @@ return: ret i32 0 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-argument.ll @@ -139,3 +139,11 @@ } declare i32 @__gxx_personality_v0(...) +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { willreturn } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constant.ll @@ -82,3 +82,6 @@ } declare i32 @__gxx_personality_v0(...) +; IS__TUNIT____: attributes [[ATTR0]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nounwind readnone } +; IS__CGSCC____: attributes [[ATTR0]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/return-constants.ll @@ -151,3 +151,6 @@ %R = add i32 %N, %M ret i32 %R } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/solve-after-each-resolving-undefs-for-function.ll @@ -72,3 +72,5 @@ %res = call i32 @test1(i1 %c) ret i32 %res } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll b/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll --- a/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll +++ b/llvm/test/Transforms/Attributor/IPConstantProp/thread_local_acs.ll @@ -3,21 +3,16 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; #include ; thread_local int gtl = 0; ; int gsh = 0; -; ; static int callee(int *thread_local_ptr, int *shared_ptr) { ; return *thread_local_ptr + *shared_ptr; ; } -; ; void broker(int *, int (*callee)(int *, int *), int *); -; ; void caller() { ; broker(>l, callee, &gsh); ; } -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" @gtl = dso_local thread_local global i32 0, align 4 @@ -69,3 +64,5 @@ !1 = !{i64 1, i64 0, i64 2, i1 false} !0 = !{!1} +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/align.ll b/llvm/test/Transforms/Attributor/align.ll --- a/llvm/test/Transforms/Attributor/align.ll +++ b/llvm/test/Transforms/Attributor/align.ll @@ -130,14 +130,12 @@ ; char a1 __attribute__((aligned(8))); ; char a2 __attribute__((aligned(16))); -; ; char* f1(char* a ){ ; return a?a:f2(&a1); ; } ; char* f2(char* a){ ; return a?f1(a):f3(&a2); ; } -; ; char* f3(char* a){ ; return a?&a1: f1(&a2); ; } @@ -918,3 +916,36 @@ attributes #0 = { nounwind uwtable noinline } attributes #1 = { uwtable noinline } attributes #2 = { null_pointer_is_valid } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nounwind } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { nofree nosync nounwind } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { nounwind } +; IS__CGSCC_OPM: attributes [[ATTR4:#.*]] = { nofree nosync nounwind } +; IS__CGSCC_OPM: attributes [[ATTR5:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes [[ATTR6:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR7:#.*]] = { nounwind willreturn } +; IS__CGSCC_OPM: attributes [[ATTR8:#.*]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR9:#.*]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR10:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR11:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes [[ATTR12:#.*]] = { willreturn } +; IS__CGSCC_OPM: attributes [[ATTR13:#.*]] = { readonly willreturn } +; IS__CGSCC_NPM: attributes [[ATTR1:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_NPM: attributes [[ATTR4:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes [[ATTR5:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR7:#.*]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR8:#.*]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR9:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR10:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes [[ATTR11:#.*]] = { willreturn } +; IS__CGSCC_NPM: attributes [[ATTR12:#.*]] = { readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/allow_list.ll b/llvm/test/Transforms/Attributor/allow_list.ll --- a/llvm/test/Transforms/Attributor/allow_list.ll +++ b/llvm/test/Transforms/Attributor/allow_list.ll @@ -87,3 +87,7 @@ } attributes #0 = { nounwind uwtable noinline } +; CHECK_DISABLED: attributes [[ATTR0:#.*]] = { noinline nounwind uwtable } +; CHECK_ENABLED_FUNCTION: attributes [[ATTR0:#.*]] = { noinline nounwind readnone uwtable } +; CHECK_ENABLED_FUNCTION: attributes [[ATTR1:#.*]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; CHECK_ENABLED_FUNCTION: attributes [[ATTR2:#.*]] = { noinline nounwind uwtable } diff --git a/llvm/test/Transforms/Attributor/alwaysinline.ll b/llvm/test/Transforms/Attributor/alwaysinline.ll --- a/llvm/test/Transforms/Attributor/alwaysinline.ll +++ b/llvm/test/Transforms/Attributor/alwaysinline.ll @@ -3,7 +3,6 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; When a function is marked `alwaysinline` and is able to be inlined, ; we can IPO its boundaries @@ -100,3 +99,8 @@ %call = call i32 @inner3(i8* %addr) ret i32 %call } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { alwaysinline nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { alwaysinline } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { alwaysinline nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/callbacks.ll b/llvm/test/Transforms/Attributor/callbacks.ll --- a/llvm/test/Transforms/Attributor/callbacks.ll +++ b/llvm/test/Transforms/Attributor/callbacks.ll @@ -7,7 +7,6 @@ target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" ; Test 0 -; ; Make sure we propagate information from the caller to the callback callee but ; only for arguments that are mapped through the callback metadata. Here, the ; first two arguments of the call and the callback callee do not correspond to @@ -110,7 +109,6 @@ declare !callback !0 void @t0_callback_broker(i32*, i32*, void (i32*, i32*, ...)*, ...) ; Test 1 -; ; Similar to test 0 but with some additional annotations (noalias/nocapute) to make sure ; we deduce and propagate noalias and others properly. @@ -211,7 +209,6 @@ declare !callback !0 void @t1_callback_broker(i32* nocapture , i32* nocapture , void (i32*, i32*, ...)* nocapture, ...) ; Test 2 -; ; Similar to test 1 but checking that the noalias is only placed if potential synchronization through @t2_check is preserved. define void @t2_caller(i32* noalias %a) { @@ -276,7 +273,6 @@ ; Note that the first two arguments are provided by the callback_broker according to the callback in !1 below! ; The others are annotated with alignment information, amongst others, or even replaced by the constants passed to the call. -; ; FIXME: We should derive noalias for %a and add a "fake use" of %a in all potentially synchronizing calls. define internal void @t2_callback_callee(i32* %is_not_null, i32* %ptr, i32* %a, i64 %b, i32** %c) { ; @@ -311,7 +307,6 @@ declare !callback !0 void @t2_callback_broker(i32* nocapture , i32* nocapture , void (i32*, i32*, ...)* nocapture, ...) ; Test 3 -; ; Basically test 2 with the casted callback callee used twice. define void @t3_caller(i32* noalias %a) { @@ -381,7 +376,6 @@ ; Note that the first two arguments are provided by the callback_broker according to the callback in !1 below! ; The others are annotated with alignment information, amongst others, or even replaced by the constants passed to the call. -; ; FIXME: We should derive noalias for %a and add a "fake use" of %a in all potentially synchronizing calls. define internal void @t3_callback_callee(i32* %is_not_null, i32* %ptr, i32* %a, i64 %b, i32** %c) { ; @@ -417,3 +411,4 @@ !0 = !{!1} !1 = !{i64 2, i64 -1, i64 -1, i1 true} +; CHECK: attributes [[ATTR0:#.*]] = { nosync } diff --git a/llvm/test/Transforms/Attributor/dereferenceable-1.ll b/llvm/test/Transforms/Attributor/dereferenceable-1.ll --- a/llvm/test/Transforms/Attributor/dereferenceable-1.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-1.ll @@ -9,7 +9,6 @@ ; TEST 1 ; take mininimum of return values -; define i32* @test1(i32* dereferenceable(4) %0, double* dereferenceable(8) %1, i1 zeroext %2) local_unnamed_addr { ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@test1 @@ -788,7 +787,6 @@ ; *ptr = 4; ; } ; } -; ; FIXME: %ptr should be dereferenceable(4) define dso_local void @rec-branch-1(i32 %a, i32 %b, i32 %c, i32* %ptr) { ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly @@ -1057,3 +1055,28 @@ !0 = !{i64 10, i64 100} +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { argmemonly nofree nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { argmemonly nofree nosync nounwind } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { nofree nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes [[ATTR6]] = { willreturn } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { nounwind } +; IS__TUNIT_NPM: attributes [[ATTR3:#.*]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT_NPM: attributes [[ATTR4:#.*]] = { argmemonly nofree nosync nounwind writeonly } +; IS__TUNIT_NPM: attributes [[ATTR5:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes [[ATTR6:#.*]] = { nofree nosync nounwind writeonly } +; IS__TUNIT_NPM: attributes [[ATTR7:#.*]] = { willreturn } +; IS__TUNIT_NPM: attributes [[ATTR8:#.*]] = { nounwind } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { argmemonly nofree norecurse nosync nounwind writeonly } +; IS__CGSCC_OPM: attributes [[ATTR4:#.*]] = { argmemonly nofree norecurse nosync nounwind } +; IS__CGSCC_OPM: attributes [[ATTR5:#.*]] = { argmemonly nofree nosync nounwind writeonly } +; IS__CGSCC_OPM: attributes [[ATTR6:#.*]] = { nounwind writeonly } +; IS__CGSCC_OPM: attributes [[ATTR7:#.*]] = { nofree nosync nounwind writeonly } +; IS__CGSCC_OPM: attributes [[ATTR8]] = { willreturn } +; IS__CGSCC_OPM: attributes [[ATTR9:#.*]] = { nounwind } +; IS__CGSCC_NPM: attributes [[ATTR3:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes [[ATTR5:#.*]] = { nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/dereferenceable-2.ll b/llvm/test/Transforms/Attributor/dereferenceable-2.ll --- a/llvm/test/Transforms/Attributor/dereferenceable-2.ll +++ b/llvm/test/Transforms/Attributor/dereferenceable-2.ll @@ -697,7 +697,6 @@ } ; Make use of MustBeExecuted Explorer -; ; [CFG] ; entry ; / \ @@ -712,7 +711,6 @@ ; end ; According to the above CFG, we can see that instructions in l5 Block must be executed. ; Therefore, %p must be dereferenced. -; ; ATTRIBUTOR_CGSCC_NPM-LABEL: define i32 @require_cfg_analysis(i32 %c, i32* {{.*}} dereferenceable(4) %p) define i32 @require_cfg_analysis(i32 %c, i32* %p) { ; IS__TUNIT_OPM: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly @@ -845,3 +843,13 @@ end: ret i32 1 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { argmemonly nofree nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { argmemonly nofree norecurse nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/heap_to_stack.ll b/llvm/test/Transforms/Attributor/heap_to_stack.ll --- a/llvm/test/Transforms/Attributor/heap_to_stack.ll +++ b/llvm/test/Transforms/Attributor/heap_to_stack.ll @@ -738,3 +738,11 @@ store i8* %1, i8** %P ret void } +; IS________OPM: attributes [[ATTR0:#.*]] = { nounwind willreturn } +; IS________OPM: attributes [[ATTR1:#.*]] = { nofree nosync willreturn } +; IS________OPM: attributes [[ATTR2:#.*]] = { nofree nounwind } +; IS________OPM: attributes [[ATTR3:#.*]] = { noreturn } +; IS________OPM: attributes [[ATTR4:#.*]] = { argmemonly nounwind willreturn } +; IS________OPM: attributes [[ATTR5:#.*]] = { nounwind } +; IS________NPM: attributes [[ATTR5:#.*]] = { argmemonly nounwind willreturn writeonly } +; IS________NPM: attributes [[ATTR6:#.*]] = { nounwind } diff --git a/llvm/test/Transforms/Attributor/internal-noalias.ll b/llvm/test/Transforms/Attributor/internal-noalias.ll --- a/llvm/test/Transforms/Attributor/internal-noalias.ll +++ b/llvm/test/Transforms/Attributor/internal-noalias.ll @@ -229,3 +229,15 @@ attributes #0 = { noinline nounwind uwtable willreturn } attributes #1 = { argmemonly noinline nounwind uwtable willreturn} +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { nofree nosync nounwind readonly } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT____: attributes [[ATTR5:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { readonly } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { readonly willreturn } +; IS__CGSCC____: attributes [[ATTR5:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/liveness.ll b/llvm/test/Transforms/Attributor/liveness.ll --- a/llvm/test/Transforms/Attributor/liveness.ll +++ b/llvm/test/Transforms/Attributor/liveness.ll @@ -680,17 +680,14 @@ } ; SCC test -; ; char a1 __attribute__((aligned(8))); ; char a2 __attribute__((aligned(16))); -; ; char* f1(char* a ){ ; return a?a:f2(&a1); ; } ; char* f2(char* a){ ; return a?f1(a):f3(&a2); ; } -; ; char* f3(char* a){ ; return a?&a1: f1(&a2); ; } @@ -2039,3 +2036,32 @@ declare void @llvm.lifetime.start.p0i8(i64 %0, i8* %1) declare void @llvm.lifetime.end.p0i8(i64 %0, i8* %1) +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree noreturn nosync nounwind } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { readnone } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nounwind } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { noreturn nounwind } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { noreturn } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { nosync readnone } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { nosync } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { nofree noreturn nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { nofree nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR12:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR13:#.*]] = { nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR14:#.*]] = { argmemonly nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR15:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR16:#.*]] = { willreturn } +; IS__CGSCC_NPM: attributes [[ATTR6:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR7:#.*]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; IS__CGSCC_NPM: attributes [[ATTR8:#.*]] = { nofree norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_NPM: attributes [[ATTR9:#.*]] = { nosync } +; IS__CGSCC_NPM: attributes [[ATTR10:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR11:#.*]] = { nofree norecurse noreturn nosync nounwind readnone } +; IS__CGSCC_NPM: attributes [[ATTR12:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR13:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes [[ATTR14:#.*]] = { nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR15:#.*]] = { argmemonly nounwind willreturn } +; IS__CGSCC_NPM: attributes [[ATTR16:#.*]] = { nounwind willreturn } +; IS__CGSCC_NPM: attributes [[ATTR17:#.*]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/liveness_chains.ll b/llvm/test/Transforms/Attributor/liveness_chains.ll --- a/llvm/test/Transforms/Attributor/liveness_chains.ll +++ b/llvm/test/Transforms/Attributor/liveness_chains.ll @@ -63,3 +63,7 @@ %v9 = add i32 %v7, %v8 ret i32 %v9 } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nounwind readonly } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { readonly } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll b/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll --- a/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll +++ b/llvm/test/Transforms/Attributor/lvi-after-jumpthreading.ll @@ -318,3 +318,9 @@ declare void @llvm.assume(i1) nounwind declare void @dummy(i1) nounwind declare void @llvm.experimental.guard(i1, ...) +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nounwind } +; IS__TUNIT_NPM: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_NPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/lvi-for-ashr.ll b/llvm/test/Transforms/Attributor/lvi-for-ashr.ll --- a/llvm/test/Transforms/Attributor/lvi-for-ashr.ll +++ b/llvm/test/Transforms/Attributor/lvi-for-ashr.ll @@ -71,3 +71,5 @@ %retval = phi i32 [0, %chk65], [1, %chk0], [%., %bb_then], [4, %bb_if] ret i32 %retval } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/memory_locations.ll b/llvm/test/Transforms/Attributor/memory_locations.ll --- a/llvm/test/Transforms/Attributor/memory_locations.ll +++ b/llvm/test/Transforms/Attributor/memory_locations.ll @@ -646,3 +646,20 @@ call void @argmemonly_before_ipconstprop(i32* @G) ret void } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { inaccessiblememonly } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { inaccessiblemem_or_argmemonly } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { readnone } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { argmemonly } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { argmemonly nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { argmemonly nofree nosync nounwind } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { nofree nosync nounwind } +; IS__CGSCC_OPM: attributes [[ATTR5:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR6:#.*]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR7:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR10:#.*]] = { nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR11:#.*]] = { nofree nosync nounwind } +; IS__CGSCC_OPM: attributes [[ATTR12:#.*]] = { nounwind } diff --git a/llvm/test/Transforms/Attributor/misc.ll b/llvm/test/Transforms/Attributor/misc.ll --- a/llvm/test/Transforms/Attributor/misc.ll +++ b/llvm/test/Transforms/Attributor/misc.ll @@ -3,7 +3,6 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; Mostly check we do not crash on these uses define internal void @internal(void (i8*)* %fp) { @@ -89,3 +88,7 @@ declare void @callback1(void (i32*)*) declare void @callback2(void (i8*)*) +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/misc_crash.ll b/llvm/test/Transforms/Attributor/misc_crash.ll --- a/llvm/test/Transforms/Attributor/misc_crash.ll +++ b/llvm/test/Transforms/Attributor/misc_crash.ll @@ -111,3 +111,5 @@ ; CHECK-LABEL: declare {{[^@]+}}@func6 ; CHECK-SAME: (i8*) declare void @func6(i8*) +; CHECK: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; CHECK: attributes [[ATTR1:#.*]] = { nofree nosync nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/new_attributes.ll b/llvm/test/Transforms/Attributor/new_attributes.ll --- a/llvm/test/Transforms/Attributor/new_attributes.ll +++ b/llvm/test/Transforms/Attributor/new_attributes.ll @@ -37,4 +37,3 @@ } ; We should never derive anything here -; CHECK-NOT: attributes diff --git a/llvm/test/Transforms/Attributor/noalias.ll b/llvm/test/Transforms/Attributor/noalias.ll --- a/llvm/test/Transforms/Attributor/noalias.ll +++ b/llvm/test/Transforms/Attributor/noalias.ll @@ -91,12 +91,10 @@ ; TEST 4 ; void *baz(); ; void *foo(int a); -; ; void *bar() { ; foo(0); ; return baz(); ; } -; ; void *foo(int a) { ; if (a) ; bar(); @@ -695,7 +693,6 @@ } ; Test 16 -; ; __attribute__((noinline)) static void test16_sub(int * restrict p, int c1, int c2) { ; if (c1) { ; only_store(p); @@ -708,7 +705,6 @@ ; void test16_caller(int * restrict p, int c) { ; test16_sub(p, c, c); ; } -; ; FIXME: this should be tail @only_store(i32* noalias %p) ; when test16_caller is called, c1 always equals to c2. (Note that linkage is internal) ; Therefore, only one of the two conditions of if statementes will be fulfilled. @@ -788,9 +784,7 @@ } ; test 17 -; ; only_store is not called after make_alias is called. -; ; void test17_caller(int* p, int c) { ; if(c) { ; make_alias(p); @@ -917,3 +911,22 @@ tail call void @only_store(i32* %p) ret void } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nounwind uwtable } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nounwind } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { nounwind ssp uwtable } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { argmemonly nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { willreturn } +; IS__CGSCC_NPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR4:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes [[ATTR5:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_NPM: attributes [[ATTR7:#.*]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR8:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_NPM: attributes [[ATTR9:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR11:#.*]] = { readonly willreturn } +; IS__CGSCC_NPM: attributes [[ATTR12:#.*]] = { nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/nocapture-1.ll b/llvm/test/Transforms/Attributor/nocapture-1.ll --- a/llvm/test/Transforms/Attributor/nocapture-1.ll +++ b/llvm/test/Transforms/Attributor/nocapture-1.ll @@ -803,3 +803,29 @@ declare i8* @llvm.launder.invariant.group.p0i8(i8*) declare i8* @llvm.strip.invariant.group.p0i8(i8*) +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { readonly } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { nounwind readonly } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { nofree nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { argmemonly nounwind } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { nofree nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { argmemonly nofree nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR12:#.*]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR13:#.*]] = { nounwind } +; IS__TUNIT_OPM: attributes [[ATTR14:#.*]] = { inaccessiblememonly nounwind speculatable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR15:#.*]] = { nounwind readnone speculatable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR16:#.*]] = { nofree willreturn } +; IS__TUNIT_OPM: attributes [[ATTR17:#.*]] = { willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes [[ATTR5:#.*]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes [[ATTR8:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR9:#.*]] = { argmemonly nofree norecurse nounwind willreturn } +; IS__CGSCC_OPM: attributes [[ATTR12:#.*]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR16:#.*]] = { nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/nocapture-2.ll b/llvm/test/Transforms/Attributor/nocapture-2.ll --- a/llvm/test/Transforms/Attributor/nocapture-2.ll +++ b/llvm/test/Transforms/Attributor/nocapture-2.ll @@ -3,19 +3,15 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=10 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; Test cases specifically designed for the "no-capture" argument attribute. ; We use FIXME's to indicate problems and missing attributes. -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" declare i32* @unknown() ; TEST comparison against NULL -; ; int is_null_return(int *p) { ; return p == 0; ; } -; ; no-capture is missing on %p because it is not dereferenceable define i32 @is_null_return(i32* %p) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn @@ -41,7 +37,6 @@ } ; TEST comparison against NULL in control flow -; ; int is_null_control(int *p) { ; if (p == 0) ; return 1; @@ -49,7 +44,6 @@ ; return 1; ; return 0; ; } -; ; no-capture is missing on %p because it is not dereferenceable define i32 @is_null_control(i32* %p) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn @@ -125,12 +119,10 @@ } ; TEST singleton SCC -; ; double *srec0(double *a) { ; srec0(a); ; return 0; ; } -; define double* @srec0(double* %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@srec0 @@ -150,7 +142,6 @@ } ; TEST singleton SCC with lots of nested recursive calls -; ; int* srec16(int* a) { ; return srec16(srec16(srec16(srec16( ; srec16(srec16(srec16(srec16( @@ -159,9 +150,7 @@ ; a ; )))))))))))))))); ; } -; ; Other arguments are possible here due to the no-return behavior. -; define i32* @srec16(i32* %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@srec16 @@ -196,15 +185,12 @@ } ; TEST SCC with various calls, casts, and comparisons agains NULL -; ; float *scc_A(int *a) { ; return (float*)(a ? (int*)scc_A((int*)scc_B((double*)scc_C((short*)a))) : a); ; } -; ; long *scc_B(double *a) { ; return (long*)(a ? scc_C((short*)scc_B((double*)scc_A((int*)a))) : a); ; } -; ; void *scc_C(short *a) { ; return scc_A((int*)(scc_A(a) ? scc_B((double*)a) : scc_C(a))); ; } @@ -352,12 +338,10 @@ ; TEST call to external function, marked no-capture -; ; void external_no_capture(int /* no-capture */ *p); ; void test_external_no_capture(int *p) { ; external_no_capture(p); ; } -; declare void @external_no_capture(i32* nocapture) define void @test_external_no_capture(i32* %p) #0 { @@ -374,11 +358,9 @@ } ; TEST call to external var-args function, marked no-capture -; ; void test_var_arg_call(char *p, int a) { ; printf(p, a); ; } -; define void @test_var_arg_call(i8* %p, i32 %a) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@test_var_arg_call @@ -396,12 +378,10 @@ ; TEST "captured" only through return -; ; long *not_captured_but_returned_0(long *a) { ; *a1 = 0; ; return a; ; } -; ; There should *not* be a no-capture attribute on %a define i64* @not_captured_but_returned_0(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly @@ -424,12 +404,10 @@ } ; TEST "captured" only through return -; ; long *not_captured_but_returned_1(long *a) { ; *(a+1) = 1; ; return a + 1; ; } -; ; There should *not* be a no-capture attribute on %a define i64* @not_captured_but_returned_1(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly @@ -455,12 +433,10 @@ } ; TEST calls to "captured" only through return functions -; ; void test_not_captured_but_returned_calls(long *a) { ; not_captured_but_returned_0(a); ; not_captured_but_returned_1(a); ; } -; define void @test_not_captured_but_returned_calls(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly ; IS__TUNIT____-LABEL: define {{[^@]+}}@test_not_captured_but_returned_calls @@ -485,11 +461,9 @@ } ; TEST "captured" only through transitive return -; ; long* negative_test_not_captured_but_returned_call_0a(long *a) { ; return not_captured_but_returned_0(a); ; } -; ; There should *not* be a no-capture attribute on %a define i64* @negative_test_not_captured_but_returned_call_0a(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly @@ -512,11 +486,9 @@ } ; TEST captured through write -; ; void negative_test_not_captured_but_returned_call_0b(long *a) { ; *a = (long)not_captured_but_returned_0(a); ; } -; ; There should *not* be a no-capture attribute on %a define void @negative_test_not_captured_but_returned_call_0b(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly @@ -545,11 +517,9 @@ } ; TEST "captured" only through transitive return -; ; long* negative_test_not_captured_but_returned_call_1a(long *a) { ; return not_captured_but_returned_1(a); ; } -; ; There should *not* be a no-capture attribute on %a define i64* @negative_test_not_captured_but_returned_call_1a(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly @@ -572,11 +542,9 @@ } ; TEST captured through write -; ; void negative_test_not_captured_but_returned_call_1b(long *a) { ; *a = (long)not_captured_but_returned_1(a); ; } -; ; There should *not* be a no-capture attribute on %a define void @negative_test_not_captured_but_returned_call_1b(i64* %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind uwtable willreturn writeonly @@ -605,15 +573,12 @@ } ; TEST return argument or unknown call result -; ; int* ret_arg_or_unknown(int* b) { ; if (b == 0) ; return b; ; return unknown(); ; } -; ; Verify we do *not* assume b is returned or not captured. -; define i32* @ret_arg_or_unknown(i32* %b) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable @@ -674,7 +639,6 @@ ; TEST not captured by readonly external function -; declare i32* @readonly_unknown(i32*, i32*) readonly define void @not_captured_by_readonly_call(i32* %b) #0 { @@ -692,9 +656,7 @@ ; TEST not captured by readonly external function if return chain is known -; ; Make sure the returned flag on %r is strong enough to justify nocapture on %b but **not** on %r. -; define i32* @not_captured_by_readonly_call_not_returned_either1(i32* %b, i32* returned %r) { ; CHECK: Function Attrs: nounwind readonly ; CHECK-LABEL: define {{[^@]+}}@not_captured_by_readonly_call_not_returned_either1 @@ -781,3 +743,18 @@ } attributes #0 = { noinline nounwind uwtable } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { noinline nounwind uwtable } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR5:#.*]] = { nofree noinline nosync nounwind uwtable willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR6:#.*]] = { readonly } +; IS__TUNIT____: attributes [[ATTR7:#.*]] = { noinline nounwind readonly uwtable } +; IS__TUNIT____: attributes [[ATTR8:#.*]] = { nounwind readonly } +; IS__TUNIT____: attributes [[ATTR9:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR5:#.*]] = { nofree noinline norecurse nosync nounwind uwtable willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR9:#.*]] = { nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/nofree.ll b/llvm/test/Transforms/Attributor/nofree.ll --- a/llvm/test/Transforms/Attributor/nofree.ll +++ b/llvm/test/Transforms/Attributor/nofree.ll @@ -435,3 +435,17 @@ attributes #0 = { nounwind uwtable noinline } attributes #1 = { nounwind } attributes #2 = { nobuiltin nounwind } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nounwind } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { noinline nounwind uwtable } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nobuiltin nounwind } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { nofree noinline nounwind readnone uwtable } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { nounwind readnone speculatable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { nofree nounwind } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { nobuiltin nofree nounwind } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { willreturn } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_NPM: attributes [[ATTR4:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } diff --git a/llvm/test/Transforms/Attributor/nonnull.ll b/llvm/test/Transforms/Attributor/nonnull.ll --- a/llvm/test/Transforms/Attributor/nonnull.ll +++ b/llvm/test/Transforms/Attributor/nonnull.ll @@ -1396,3 +1396,32 @@ attributes #0 = { null_pointer_is_valid } attributes #1 = { nounwind willreturn} +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nofree noreturn nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { noreturn } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { nounwind } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { argmemonly nofree nosync nounwind readonly } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { nounwind readonly } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { naked } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { noinline optnone } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { nofree nounwind readonly } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { willreturn } +; IS__TUNIT_OPM: attributes [[ATTR12:#.*]] = { nofree nosync nounwind readonly } +; IS__TUNIT_OPM: attributes [[ATTR13:#.*]] = { readonly } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR4:#.*]] = { noreturn } +; IS__CGSCC_OPM: attributes [[ATTR5:#.*]] = { nounwind } +; IS__CGSCC_OPM: attributes [[ATTR6:#.*]] = { argmemonly nofree nosync nounwind readonly } +; IS__CGSCC_OPM: attributes [[ATTR7:#.*]] = { nounwind readonly } +; IS__CGSCC_OPM: attributes [[ATTR8:#.*]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR9:#.*]] = { naked } +; IS__CGSCC_OPM: attributes [[ATTR10:#.*]] = { noinline optnone } +; IS__CGSCC_OPM: attributes [[ATTR11:#.*]] = { nofree nounwind readonly } +; IS__CGSCC_OPM: attributes [[ATTR12]] = { willreturn } +; IS__CGSCC_OPM: attributes [[ATTR13:#.*]] = { nofree nosync nounwind readonly } +; IS__CGSCC_OPM: attributes [[ATTR14:#.*]] = { readonly } +; IS__CGSCC_NPM: attributes [[ATTR2:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR7:#.*]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/norecurse.ll b/llvm/test/Transforms/Attributor/norecurse.ll --- a/llvm/test/Transforms/Attributor/norecurse.ll +++ b/llvm/test/Transforms/Attributor/norecurse.ll @@ -271,3 +271,24 @@ ret i32 1 } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nofree noreturn nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { nosync readnone } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { readnone } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { argmemonly nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { argmemonly nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { norecurse nosync readnone } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { nofree norecurse nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { null_pointer_is_valid } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR2:#.*]] = { nosync readnone } +; IS__CGSCC_NPM: attributes [[ATTR3:#.*]] = { readnone } +; IS__CGSCC_NPM: attributes [[ATTR4:#.*]] = { argmemonly nosync nounwind willreturn } +; IS__CGSCC_NPM: attributes [[ATTR5:#.*]] = { argmemonly nounwind willreturn } +; IS__CGSCC_NPM: attributes [[ATTR6:#.*]] = { norecurse nosync readnone } +; IS__CGSCC_NPM: attributes [[ATTR7:#.*]] = { null_pointer_is_valid } +; IS__CGSCC_NPM: attributes [[ATTR8:#.*]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/noreturn.ll b/llvm/test/Transforms/Attributor/noreturn.ll --- a/llvm/test/Transforms/Attributor/noreturn.ll +++ b/llvm/test/Transforms/Attributor/noreturn.ll @@ -3,7 +3,6 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; Test cases specifically designed for the "no-return" function attribute. ; We use FIXME's to indicate problems and missing attributes. @@ -11,11 +10,9 @@ ; TEST 1, singleton SCC void return type -; ; void srec0() { ; return srec0(); ; } -; define void @srec0() #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@srec0() @@ -34,11 +31,9 @@ ; TEST 2: singleton SCC int return type with a lot of recursive calls -; ; int srec16(int a) { ; return srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(srec16(a)))))))))))))))); ; } -; define i32 @srec16(i32 %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@srec16 @@ -81,11 +76,9 @@ ; TEST 3: endless loop, no return instruction -; ; int endless_loop(int a) { ; while (1); ; } -; define i32 @endless_loop(i32 %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable ; IS__TUNIT____-LABEL: define {{[^@]+}}@endless_loop @@ -112,12 +105,10 @@ ; TEST 4: endless loop, dead return instruction -; ; int endless_loop(int a) { ; while (1); ; return a; ; } -; ; FIXME: no-return missing (D65243 should fix this) define i32 @dead_return(i32 %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable @@ -152,11 +143,9 @@ ; TEST 5: all paths contain a no-return function call -; ; int multiple_noreturn_calls(int a) { ; return a == 0 ? endless_loop(a) : srec16(a); ; } -; define i32 @multiple_noreturn_calls(i32 %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@multiple_noreturn_calls @@ -244,3 +233,9 @@ } attributes #0 = { noinline nounwind uwtable } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/noreturn_async.ll b/llvm/test/Transforms/Attributor/noreturn_async.ll --- a/llvm/test/Transforms/Attributor/noreturn_async.ll +++ b/llvm/test/Transforms/Attributor/noreturn_async.ll @@ -1,17 +1,12 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes ; RUN: opt -attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=1 -S < %s | FileCheck %s -; ; This file is the same as noreturn_sync.ll but with a personality which ; indicates that the exception handler *can* catch asynchronous exceptions. As ; a consequence, invokes to noreturn and nounwind functions are not translated ; to calls followed by an unreachable but the unwind edge is considered live. -; ; https://reviews.llvm.org/D59978#inline-586873 -; ; Make sure we handle invoke of a noreturn function correctly. -; ; This test is also a reminder of how we handle (=ignore) stackoverflow exception handling. -; target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-windows-msvc19.16.27032" @@ -47,7 +42,7 @@ ; CHECK: invoke void @"?overflow@@YAXXZ"() ; CHECK: to label %invoke.cont unwind label %catch.dispatch invoke void @"?overflow@@YAXXZ"() - to label %invoke.cont unwind label %catch.dispatch + to label %invoke.cont unwind label %catch.dispatch invoke.cont: ; preds = %entry ; CHECK: invoke.cont: @@ -106,7 +101,7 @@ ; CHECK: invoke void @"?overflow@@YAXXZ_may_throw"() ; CHECK: to label %invoke.cont unwind label %catch.dispatch invoke void @"?overflow@@YAXXZ_may_throw"() - to label %invoke.cont unwind label %catch.dispatch + to label %invoke.cont unwind label %catch.dispatch invoke.cont: ; preds = %entry ; CHECK: invoke.cont: @@ -143,3 +138,8 @@ declare dso_local i32 @printf(i8* %_Format, ...) declare i32 @llvm.eh.exceptioncode(token) +; CHECK: attributes [[ATTR0:#.*]] = { nofree noreturn nosync nounwind } +; CHECK: attributes [[ATTR1:#.*]] = { nofree nosync } +; CHECK: attributes [[ATTR2:#.*]] = { noreturn } +; CHECK: attributes [[ATTR3:#.*]] = { nounwind readnone } +; CHECK: attributes [[ATTR4:#.*]] = { nofree nosync nounwind } diff --git a/llvm/test/Transforms/Attributor/noreturn_sync.ll b/llvm/test/Transforms/Attributor/noreturn_sync.ll --- a/llvm/test/Transforms/Attributor/noreturn_sync.ll +++ b/llvm/test/Transforms/Attributor/noreturn_sync.ll @@ -1,17 +1,12 @@ ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes ; RUN: opt -attributor -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s -; ; This file is the same as noreturn_async.ll but with a personality which ; indicates that the exception handler *cannot* catch asynchronous exceptions. ; As a consequence, invokes to noreturn and nounwind functions are translated ; to calls followed by an unreachable. -; ; https://reviews.llvm.org/D59978#inline-586873 -; ; Make sure we handle invoke of a noreturn function correctly. -; ; This test is also a reminder of how we handle (=ignore) stackoverflow exception handling. -; target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-pc-linux-gnu" @@ -43,7 +38,7 @@ %retval = alloca i32, align 4 %__exception_code = alloca i32, align 4 invoke void @"?overflow@@YAXXZ"() - to label %invoke.cont unwind label %catch.dispatch + to label %invoke.cont unwind label %catch.dispatch ; CHECK: call void @"?overflow@@YAXXZ"() ; CHECK-NEXT: unreachable @@ -102,7 +97,7 @@ ; CHECK: invoke void @"?overflow@@YAXXZ_may_throw"() ; CHECK: to label %invoke.cont unwind label %catch.dispatch invoke void @"?overflow@@YAXXZ_may_throw"() - to label %invoke.cont unwind label %catch.dispatch + to label %invoke.cont unwind label %catch.dispatch invoke.cont: ; preds = %entry ; CHECK: invoke.cont: @@ -139,3 +134,7 @@ declare dso_local i32 @printf(i8* %_Format, ...) declare i32 @llvm.eh.exceptioncode(token) +; CHECK: attributes [[ATTR0:#.*]] = { nofree noreturn nosync nounwind } +; CHECK: attributes [[ATTR1:#.*]] = { noreturn } +; CHECK: attributes [[ATTR2:#.*]] = { nounwind readnone } +; CHECK: attributes [[ATTR3:#.*]] = { nofree nosync nounwind } diff --git a/llvm/test/Transforms/Attributor/nosync.ll b/llvm/test/Transforms/Attributor/nosync.ll --- a/llvm/test/Transforms/Attributor/nosync.ll +++ b/llvm/test/Transforms/Attributor/nosync.ll @@ -18,7 +18,6 @@ ; double Y; ; struct RT Z; ; }; -; ; int *foo(struct ST *s) { ; return &s[1].Z.B[5][13]; ; } @@ -234,17 +233,14 @@ } ; TEST 12 - fences, negative -; ; void foo1(int *a, std::atomic flag){ ; *a = 100; ; atomic_thread_fence(std::memory_order_release); ; flag.store(true, std::memory_order_relaxed); ; } -; ; void bar(int *a, std::atomic flag){ ; while(!flag.load(std::memory_order_relaxed)) ; ; -; ; atomic_thread_fence(std::memory_order_acquire); ; int b = *a; ; } @@ -397,7 +393,6 @@ ; TEST 14 - negative, checking volatile intrinsics. ; It is odd to add nocapture but a result of the llvm.memcpy nocapture. -; define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) { ; CHECK: Function Attrs: argmemonly nounwind willreturn ; CHECK-LABEL: define {{[^@]+}}@memcpy_volatile @@ -412,7 +407,6 @@ ; TEST 15 - positive, non-volatile intrinsic. ; It is odd to add nocapture but a result of the llvm.memset nocapture. -; define i32 @memset_non_volatile(i8* %ptr1, i8 %val) { ; CHECK: Function Attrs: argmemonly nosync nounwind willreturn writeonly ; CHECK-LABEL: define {{[^@]+}}@memset_non_volatile @@ -495,3 +489,31 @@ %c = call float @llvm.cos(float %x) ret float %c } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree nosync nounwind optsize readnone ssp uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { argmemonly nofree norecurse nosync nounwind uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { argmemonly nofree norecurse nounwind uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { noinline nosync nounwind uwtable } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { noinline nounwind uwtable } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { nofree nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { nofree nounwind } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { nofree nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { nofree nosync nounwind } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { argmemonly nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { argmemonly nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR12:#.*]] = { convergent readnone } +; IS__TUNIT_OPM: attributes [[ATTR13:#.*]] = { readnone } +; IS__TUNIT_OPM: attributes [[ATTR14:#.*]] = { nounwind } +; IS__TUNIT_OPM: attributes [[ATTR15:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR16:#.*]] = { nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR17:#.*]] = { argmemonly nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR18:#.*]] = { nounwind readnone speculatable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR19:#.*]] = { willreturn } +; IS__TUNIT_OPM: attributes [[ATTR20:#.*]] = { willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind optsize readnone ssp uwtable willreturn } +; IS__CGSCC_OPM: attributes [[ATTR6:#.*]] = { nofree norecurse nounwind willreturn } +; IS__CGSCC_OPM: attributes [[ATTR7:#.*]] = { nofree norecurse nounwind } +; IS__CGSCC_OPM: attributes [[ATTR8:#.*]] = { nofree norecurse nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes [[ATTR9:#.*]] = { nofree norecurse nosync nounwind } +; IS__CGSCC_OPM: attributes [[ATTR15:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR5:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } diff --git a/llvm/test/Transforms/Attributor/noundef.ll b/llvm/test/Transforms/Attributor/noundef.ll --- a/llvm/test/Transforms/Attributor/noundef.ll +++ b/llvm/test/Transforms/Attributor/noundef.ll @@ -1,4 +1,4 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes --check-attributes ; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=3 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM @@ -9,7 +9,7 @@ declare void @bar(i32*) define void @foo() { -; CHECK-LABEL: @foo( +; CHECK-LABEL: define {{[^@]+}}@foo() ; CHECK-NEXT: [[X:%.*]] = alloca i32, align 4 ; CHECK-NEXT: call void @unknown() ; CHECK-NEXT: call void @bar(i32* noundef nonnull align 4 dereferenceable(4) [[X]]) diff --git a/llvm/test/Transforms/Attributor/nounwind.ll b/llvm/test/Transforms/Attributor/nounwind.ll --- a/llvm/test/Transforms/Attributor/nounwind.ll +++ b/llvm/test/Transforms/Attributor/nounwind.ll @@ -141,3 +141,7 @@ declare i8* @__cxa_begin_catch(i8*) declare void @__cxa_end_catch() +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR1:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } diff --git a/llvm/test/Transforms/Attributor/potential.ll b/llvm/test/Transforms/Attributor/potential.ll --- a/llvm/test/Transforms/Attributor/potential.ll +++ b/llvm/test/Transforms/Attributor/potential.ll @@ -3,9 +3,7 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=20 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; Test for multiple potential values -; ; potential-test 1 ; bool iszero(int c) { return c == 0; } ; bool potential_test1(bool c) { return iszero(c ? 1 : -1); } @@ -41,10 +39,8 @@ ; potential-test 2 -; ; potential values of argument of iszero are {1,-1} ; potential value of returned value of iszero is 0 -; ; int call_with_two_values(int x) { return iszero(x) + iszero(-x); } ; int potential_test2(int x) { return call_with_two_values(1) + call_with_two_values(-1); } @@ -100,12 +96,10 @@ ; potential-test 3 -; ; potential values of returned value of f are {0,1} ; potential values of argument of g are {0,1} ; potential value of returned value of g is 1 ; then returned value of g can be simplified -; ; int zero_or_one(int c) { return c < 2; } ; int potential_test3() { return zero_or_one(iszero(0))+zero_or_one(iszero(1)); } @@ -187,11 +181,9 @@ ; potential-test 4,5 -; ; simplified ; int potential_test4(int c) { return return1or3(c) == 2; } ; int potential_test5(int c) { return return1or3(c) == return2or4(c); } -; ; not simplified ; int potential_test6(int c) { return return1or3(c) == 3; } ; int potential_test7(int c) { return return1or3(c) == return3or4(c); } @@ -350,7 +342,6 @@ } ; potential-test 8 -; ; propagate argument to callsite argument define internal i1 @cmp_with_four(i32 %c) { @@ -570,3 +561,9 @@ ; IS__TUNIT_OPM-NOT: !3 ; IS__CGSCC____-NOT: !0 +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { willreturn } +; IS__CGSCC_NPM: attributes [[ATTR1:#.*]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/range.ll b/llvm/test/Transforms/Attributor/range.ll --- a/llvm/test/Transforms/Attributor/range.ll +++ b/llvm/test/Transforms/Attributor/range.ll @@ -803,9 +803,7 @@ ; Examples taken from https://llvm.discourse.group/t/impossible-condition-optimization/461/1 -; ; The important part is that we return a constant (false) -; ; { ; FIXME: All but the return is not needed anymore @@ -1801,3 +1799,17 @@ ; IS__TUNIT_NPM: !6 = !{i32 0, i32 65536} ; IS__TUNIT_NPM: !7 = !{i32 0, i32 100} ; IS__TUNIT_NPM-NOT: !8 +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR2]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR3]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_NPM: attributes [[ATTR1]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes [[ATTR2]] = { nofree nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { readonly willreturn } +; IS__CGSCC_OPM: attributes [[ATTR4:#.*]] = { willreturn } +; IS__CGSCC_NPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR2:#.*]] = { readonly willreturn } +; IS__CGSCC_NPM: attributes [[ATTR3:#.*]] = { willreturn } diff --git a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll --- a/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll +++ b/llvm/test/Transforms/Attributor/read_write_returned_arguments_scc.ll @@ -4,24 +4,20 @@ ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; This is an evolved example to stress test SCC parameter attribute propagation. ; The SCC in this test is made up of the following six function, three of which ; are internal and three externally visible: -; ; static int *internal_ret0_nw(int *n0, int *w0); ; static int *internal_ret1_rw(int *r0, int *w0); ; static int *internal_ret1_rrw(int *r0, int *r1, int *w0); ; int *external_ret2_nrw(int *n0, int *r0, int *w0); ; int *external_sink_ret2_nrw(int *n0, int *r0, int *w0); ; int *external_source_ret2_nrw(int *n0, int *r0, int *w0); -; ; The top four functions call each other while the "sink" function will not ; call anything and the "source" function will not be called in this module. ; The names of the functions define the returned parameter (X for "_retX_"), ; as well as how the parameters are (transitively) used (n = readnone, ; r = readonly, w = writeonly). -; ; What we should see is something along the lines of: ; 1 - Number of functions marked as norecurse ; 6 - Number of functions marked argmemonly @@ -31,7 +27,6 @@ ; 6 - Number of arguments marked writeonly ; 6 - Number of arguments marked readonly ; 6 - Number of arguments marked returned -; target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define i32* @external_ret2_nrw(i32* %n0, i32* %r0, i32* %w0) { @@ -366,18 +361,11 @@ ; Verify that we see only expected attribute sets, the above lines only check ; for a subset relation. -; -; IS__CGSCC____-NOT: attributes # -; IS__CGSCC____: attributes #{{.*}} = { argmemonly nofree nosync nounwind } -; IS__CGSCC____: attributes #{{.*}} = { argmemonly nofree norecurse nosync nounwind willreturn } -; IS__CGSCC____: attributes #{{.*}} = { nofree nosync nounwind } -; IS__CGSCC____: attributes #{{.*}} = { nounwind } -; IS__CGSCC____: attributes #{{.*}} = { nounwind willreturn } -; IS__CGSCC____-NOT: attributes # -; IS__TUNIT____-NOT: attributes # -; IS__TUNIT____: attributes #{{.*}} = { argmemonly nofree nosync nounwind } -; IS__TUNIT____: attributes #{{.*}} = { argmemonly nofree nosync nounwind willreturn } -; IS__TUNIT____: attributes #{{.*}} = { nofree nosync nounwind } -; IS__TUNIT____: attributes #{{.*}} = { nofree nosync nounwind willreturn } -; IS__TUNIT____-NOT: attributes # +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { argmemonly nofree nosync nounwind } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { argmemonly nofree nosync nounwind willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { nounwind } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/readattrs.ll b/llvm/test/Transforms/Attributor/readattrs.ll --- a/llvm/test/Transforms/Attributor/readattrs.ll +++ b/llvm/test/Transforms/Attributor/readattrs.ll @@ -10,7 +10,6 @@ declare void @test1_1(i8* %x1_1, i8* readonly %y1_1, ...) ; NOTE: readonly for %y1_2 would be OK here but not for the similar situation in test13. -; define void @test1_2(i8* %x1_2, i8* %y1_2, i8* %z1_2) { ; CHECK-LABEL: define {{[^@]+}}@test1_2 ; CHECK-SAME: (i8* [[X1_2:%.*]], i8* [[Y1_2:%.*]], i8* [[Z1_2:%.*]]) @@ -236,7 +235,6 @@ ; though the only direct use, in @escape_readnone_ptr/@escape_readonly_ptr, ; is marked as readnone/only. However, the functions can write the pointer into ; %addr, causing the store to write to %escaped_then_written. -; define void @unsound_readnone(i8* %ignored, i8* %escaped_then_written) { ; CHECK-LABEL: define {{[^@]+}}@unsound_readnone ; CHECK-SAME: (i8* nocapture nofree readnone [[IGNORED:%.*]], i8* [[ESCAPED_THEN_WRITTEN:%.*]]) @@ -270,7 +268,6 @@ } ; Byval but not readonly/none tests -; ;{ declare void @escape_i8(i8* %ptr) @@ -385,3 +382,21 @@ call void @val_use(i8 %call_val) ret void } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { readonly } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { argmemonly nounwind readonly } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { argmemonly nounwind } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { argmemonly nofree nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { readnone } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { nounwind readonly } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { willreturn } +; IS__TUNIT_OPM: attributes [[ATTR12:#.*]] = { readonly willreturn } +; IS__TUNIT_OPM: attributes [[ATTR13:#.*]] = { nounwind } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR8:#.*]] = { argmemonly nofree norecurse nounwind willreturn } diff --git a/llvm/test/Transforms/Attributor/returned.ll b/llvm/test/Transforms/Attributor/returned.ll --- a/llvm/test/Transforms/Attributor/returned.ll +++ b/llvm/test/Transforms/Attributor/returned.ll @@ -3,24 +3,18 @@ ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=14 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM ; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM ; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM -; ; Test cases specifically designed for the "returned" argument attribute. ; We use FIXME's to indicate problems and missing attributes. -; ; TEST SCC test returning an integer value argument -; ; int scc_r1(int a, int b, int r); ; int scc_r2(int a, int b, int r); -; ; __attribute__((noinline)) int sink_r0(int r) { ; return r; ; } -; ; __attribute__((noinline)) int scc_r1(int a, int r, int b) { ; return scc_r2(r, a, sink_r0(r)); ; } -; ; __attribute__((noinline)) int scc_r2(int a, int b, int r) { ; if (a > b) ; return scc_r2(b, a, sink_r0(r)); @@ -273,18 +267,14 @@ ; TEST SCC test returning a pointer value argument -; ; double* ptr_scc_r1(double* a, double* b, double* r); ; double* ptr_scc_r2(double* a, double* b, double* r); -; ; __attribute__((noinline)) double* ptr_sink_r0(double* r) { ; return r; ; } -; ; __attribute__((noinline)) double* ptr_scc_r1(double* a, double* r, double* b) { ; return ptr_scc_r2(r, a, ptr_sink_r0(r)); ; } -; ; __attribute__((noinline)) double* ptr_scc_r2(double* a, double* b, double* r) { ; if (a > b) ; return ptr_scc_r2(b, a, ptr_sink_r0(r)); @@ -453,11 +443,9 @@ ; TEST a no-return singleton SCC -; ; int* rt0(int *a) { ; return *a ? a : rt0(a); ; } -; define i32* @rt0(i32* %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@rt0 @@ -480,11 +468,9 @@ } ; TEST a no-return singleton SCC -; ; int* rt1(int *a) { ; return *a ? undef : rt1(a); ; } -; define i32* @rt1(i32* %a) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@rt1 @@ -507,7 +493,6 @@ } ; TEST another SCC test -; define i32* @rt2_helper(i32* %a) #0 { ; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable ; CHECK-LABEL: define {{[^@]+}}@rt2_helper @@ -549,7 +534,6 @@ } ; TEST another SCC test -; define i32* @rt3_helper(i32* %a, i32* %b) #0 { ; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable ; CHECK-LABEL: define {{[^@]+}}@rt3_helper @@ -591,14 +575,11 @@ } ; TEST address taken function with call to an external functions -; ; void unknown_fn(void *); -; ; int* calls_unknown_fn(int *r) { ; unknown_fn(&calls_unknown_fn); ; return r; ; } -; declare void @unknown_fn(i32* (i32*)*) #0 define i32* @calls_unknown_fn(i32* %r) #0 { @@ -614,18 +595,14 @@ ; TEST call to a function that might be redifined at link time -; ; int *maybe_redefined_fn(int *r) { ; return r; ; } -; ; int *calls_maybe_redefined_fn(int *r) { ; maybe_redefined_fn(r); ; return r; ; } -; ; Verify the maybe-redefined function is not annotated: -; define linkonce_odr i32* @maybe_redefined_fn(i32* %r) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@maybe_redefined_fn @@ -651,17 +628,13 @@ } ; TEST return call to a function that might be redifined at link time -; ; int *maybe_redefined_fn2(int *r) { ; return r; ; } -; ; int *calls_maybe_redefined_fn2(int *r) { ; return maybe_redefined_fn2(r); ; } -; ; Verify the maybe-redefined function is not annotated: -; define linkonce_odr i32* @maybe_redefined_fn2(i32* %r) #0 { ; CHECK: Function Attrs: noinline nounwind uwtable ; CHECK-LABEL: define {{[^@]+}}@maybe_redefined_fn2 @@ -688,14 +661,12 @@ ; TEST returned argument goes through select and phi -; ; double select_and_phi(double b) { ; double x = b; ; if (b > 0) ; x = b; ; return b == 0? b : x; ; } -; define double @select_and_phi(double %b) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@select_and_phi @@ -741,14 +712,12 @@ ; TEST returned argument goes through recursion, select, and phi -; ; double recursion_select_and_phi(int a, double b) { ; double x = b; ; if (a-- > 0) ; x = recursion_select_and_phi(a, b); ; return b == 0? b : x; ; } -; define double @recursion_select_and_phi(i32 %a, double %b) #0 { ; CHECK: Function Attrs: nofree noinline nosync nounwind readnone uwtable ; CHECK-LABEL: define {{[^@]+}}@recursion_select_and_phi @@ -784,11 +753,9 @@ ; TEST returned argument goes through bitcasts -; ; double* bitcast(int* b) { ; return (double*)b; ; } -; define double* @bitcast(i32* %b) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcast @@ -811,14 +778,12 @@ ; TEST returned argument goes through select and phi interleaved with bitcasts -; ; double* bitcasts_select_and_phi(int* b) { ; double* x = b; ; if (b == 0) ; x = b; ; return b != 0 ? b : x; ; } -; define double* @bitcasts_select_and_phi(i32* %b) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@bitcasts_select_and_phi @@ -879,7 +844,6 @@ ; TEST return argument or argument or undef -; ; double* ret_arg_arg_undef(int* b) { ; if (b == 0) ; return (double*)b; @@ -887,7 +851,6 @@ ; return (double*)b; ; /* return undef */ ; } -; define double* @ret_arg_arg_undef(i32* %b) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_arg_arg_undef @@ -944,7 +907,6 @@ ; TEST return undef or argument or argument -; ; double* ret_undef_arg_arg(int* b) { ; if (b == 0) ; return (double*)b; @@ -952,7 +914,6 @@ ; return (double*)b; ; /* return undef */ ; } -; define double* @ret_undef_arg_arg(i32* %b) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef_arg_arg @@ -1009,7 +970,6 @@ ; TEST return undef or argument or undef -; ; double* ret_undef_arg_undef(int* b) { ; if (b == 0) ; /* return undef */ @@ -1017,7 +977,6 @@ ; return (double*)b; ; /* return undef */ ; } -; define double* @ret_undef_arg_undef(i32* %b) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@ret_undef_arg_undef @@ -1070,15 +1029,12 @@ } ; TEST return argument or unknown call result -; ; int* ret_arg_or_unknown(int* b) { ; if (b == 0) ; return b; ; return unknown(); ; } -; ; Verify we do not assume b is returned -; declare i32* @unknown(i32*) define i32* @ret_arg_or_unknown(i32* %b) #0 { @@ -1139,7 +1095,6 @@ } ; TEST inconsistent IR in dead code. -; define i32 @deadblockcall1(i32 %A) #0 { ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn ; IS__TUNIT____-LABEL: define {{[^@]+}}@deadblockcall1 @@ -1484,3 +1439,18 @@ ; UTC_ARGS: --enable attributes #0 = { noinline nounwind uwtable } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree noinline nosync nounwind readnone uwtable } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { noinline nounwind uwtable } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { noreturn } +; IS__TUNIT____: attributes [[ATTR5:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR6:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT____: attributes [[ATTR7:#.*]] = { nounwind } +; IS__TUNIT____: attributes [[ATTR8:#.*]] = { nounwind readnone } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn } +; IS__CGSCC____: attributes [[ATTR5:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR6:#.*]] = { willreturn } +; IS__CGSCC____: attributes [[ATTR7:#.*]] = { nofree nosync nounwind readnone } +; IS__CGSCC____: attributes [[ATTR8:#.*]] = { nounwind } diff --git a/llvm/test/Transforms/Attributor/undefined_behavior.ll b/llvm/test/Transforms/Attributor/undefined_behavior.ll --- a/llvm/test/Transforms/Attributor/undefined_behavior.ll +++ b/llvm/test/Transforms/Attributor/undefined_behavior.ll @@ -581,7 +581,6 @@ } ; Tests for nonnull noundef attribute violation. -; ; Tests for argument position define void @arg_nonnull_1(i32* nonnull %a) { @@ -1037,3 +1036,19 @@ call void @callee_ptr_arg(i32* noundef undef) ret void } +; IS__TUNIT____: attributes [[ATTR0:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR1:#.*]] = { nofree nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__TUNIT____: attributes [[ATTR2:#.*]] = { nofree nosync nounwind null_pointer_is_valid willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR3:#.*]] = { nofree nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR4:#.*]] = { nofree nounwind null_pointer_is_valid willreturn } +; IS__TUNIT____: attributes [[ATTR5:#.*]] = { nofree noreturn nosync nounwind readnone willreturn } +; IS__TUNIT____: attributes [[ATTR6:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT____: attributes [[ATTR7:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR0:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind null_pointer_is_valid readnone willreturn } +; IS__CGSCC____: attributes [[ATTR2:#.*]] = { nofree norecurse nosync nounwind null_pointer_is_valid willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR3:#.*]] = { nofree norecurse nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR4:#.*]] = { nofree norecurse nounwind null_pointer_is_valid willreturn } +; IS__CGSCC____: attributes [[ATTR5:#.*]] = { nofree norecurse noreturn nosync nounwind readnone willreturn } +; IS__CGSCC____: attributes [[ATTR6:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC____: attributes [[ATTR7:#.*]] = { nounwind willreturn writeonly } diff --git a/llvm/test/Transforms/Attributor/value-simplify.ll b/llvm/test/Transforms/Attributor/value-simplify.ll --- a/llvm/test/Transforms/Attributor/value-simplify.ll +++ b/llvm/test/Transforms/Attributor/value-simplify.ll @@ -744,3 +744,21 @@ ret i8 %c } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nounwind } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { argmemonly nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { nofree nosync nounwind readonly willreturn } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { argmemonly nofree nosync nounwind writeonly } +; IS__TUNIT_OPM: attributes [[ATTR5]] = { nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__TUNIT_NPM: attributes [[ATTR4]] = { nounwind readnone } +; IS__TUNIT_NPM: attributes [[ATTR5:#.*]] = { nofree nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR1:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { nofree norecurse nosync nounwind readonly willreturn } +; IS__CGSCC_OPM: attributes [[ATTR4:#.*]] = { argmemonly nofree norecurse nosync nounwind writeonly } +; IS__CGSCC_OPM: attributes [[ATTR5:#.*]] = { willreturn } +; IS__CGSCC_OPM: attributes [[ATTR6]] = { nounwind readnone } +; IS__CGSCC_OPM: attributes [[ATTR7:#.*]] = { readonly willreturn } +; IS__CGSCC_NPM: attributes [[ATTR4:#.*]] = { willreturn } +; IS__CGSCC_NPM: attributes [[ATTR6:#.*]] = { readonly willreturn } diff --git a/llvm/test/Transforms/Attributor/willreturn.ll b/llvm/test/Transforms/Attributor/willreturn.ll --- a/llvm/test/Transforms/Attributor/willreturn.ll +++ b/llvm/test/Transforms/Attributor/willreturn.ll @@ -1459,7 +1459,6 @@ ; goto entry1; ; else ; goto entry2; -; ; entry1: ; if (fact_loop(n)>5) ; goto exit; @@ -1574,3 +1573,64 @@ attributes #0 = { nounwind uwtable noinline } attributes #1 = { uwtable noinline } +; IS__TUNIT_OPM: attributes [[ATTR0:#.*]] = { nofree noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR1:#.*]] = { nofree noinline nosync nounwind readnone uwtable } +; IS__TUNIT_OPM: attributes [[ATTR2:#.*]] = { nofree nosync nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR3:#.*]] = { nofree noinline nosync nounwind uwtable } +; IS__TUNIT_OPM: attributes [[ATTR4:#.*]] = { noreturn } +; IS__TUNIT_OPM: attributes [[ATTR5:#.*]] = { noinline noreturn nounwind uwtable } +; IS__TUNIT_OPM: attributes [[ATTR6:#.*]] = { noinline nounwind uwtable } +; IS__TUNIT_OPM: attributes [[ATTR7:#.*]] = { nounwind readnone speculatable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR8:#.*]] = { noinline nosync nounwind readnone uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR9:#.*]] = { norecurse willreturn } +; IS__TUNIT_OPM: attributes [[ATTR10:#.*]] = { noinline nounwind uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR11:#.*]] = { noinline uwtable willreturn } +; IS__TUNIT_OPM: attributes [[ATTR12:#.*]] = { nounwind willreturn } +; IS__TUNIT_OPM: attributes [[ATTR13:#.*]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } +; IS__TUNIT_OPM: attributes [[ATTR14:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; IS__TUNIT_OPM: attributes [[ATTR15:#.*]] = { noreturn nounwind } +; IS__TUNIT_OPM: attributes [[ATTR16:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT_OPM: attributes [[ATTR17:#.*]] = { nofree nosync nounwind } +; IS__TUNIT_OPM: attributes [[ATTR18:#.*]] = { willreturn } +; IS__TUNIT_OPM: attributes [[ATTR19:#.*]] = { nounwind } +; IS__TUNIT_NPM: attributes [[ATTR13:#.*]] = { argmemonly nofree noinline nosync nounwind readonly uwtable willreturn } +; IS__TUNIT_NPM: attributes [[ATTR14:#.*]] = { argmemonly nofree noinline nosync nounwind readonly uwtable } +; IS__TUNIT_NPM: attributes [[ATTR15:#.*]] = { nofree noinline noreturn nosync nounwind readnone uwtable } +; IS__TUNIT_NPM: attributes [[ATTR16:#.*]] = { noreturn nounwind } +; IS__TUNIT_NPM: attributes [[ATTR17:#.*]] = { nofree nosync nounwind readnone } +; IS__TUNIT_NPM: attributes [[ATTR18:#.*]] = { nofree nosync nounwind readnone willreturn } +; IS__TUNIT_NPM: attributes [[ATTR19:#.*]] = { nofree nosync nounwind } +; IS__TUNIT_NPM: attributes [[ATTR20:#.*]] = { willreturn } +; IS__TUNIT_NPM: attributes [[ATTR21:#.*]] = { nounwind } +; IS__CGSCC_OPM: attributes [[ATTR0:#.*]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_OPM: attributes [[ATTR2:#.*]] = { nofree noinline norecurse nosync nounwind readnone uwtable } +; IS__CGSCC_OPM: attributes [[ATTR3:#.*]] = { nofree nosync nounwind willreturn } +; IS__CGSCC_OPM: attributes [[ATTR4:#.*]] = { nofree noinline nosync nounwind uwtable } +; IS__CGSCC_OPM: attributes [[ATTR5:#.*]] = { noreturn } +; IS__CGSCC_OPM: attributes [[ATTR6:#.*]] = { noinline noreturn nounwind uwtable } +; IS__CGSCC_OPM: attributes [[ATTR7:#.*]] = { noinline nounwind uwtable } +; IS__CGSCC_OPM: attributes [[ATTR8:#.*]] = { nounwind readnone speculatable willreturn } +; IS__CGSCC_OPM: attributes [[ATTR9:#.*]] = { noinline nosync nounwind readnone uwtable willreturn } +; IS__CGSCC_OPM: attributes [[ATTR10:#.*]] = { norecurse willreturn } +; IS__CGSCC_OPM: attributes [[ATTR11:#.*]] = { noinline norecurse nounwind uwtable willreturn } +; IS__CGSCC_OPM: attributes [[ATTR12:#.*]] = { noinline norecurse noreturn nounwind uwtable } +; IS__CGSCC_OPM: attributes [[ATTR13:#.*]] = { noinline uwtable willreturn } +; IS__CGSCC_OPM: attributes [[ATTR14:#.*]] = { nounwind willreturn } +; IS__CGSCC_OPM: attributes [[ATTR15:#.*]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } +; IS__CGSCC_OPM: attributes [[ATTR16:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; IS__CGSCC_OPM: attributes [[ATTR17:#.*]] = { noreturn nounwind } +; IS__CGSCC_OPM: attributes [[ATTR18:#.*]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_OPM: attributes [[ATTR19:#.*]] = { nofree nosync nounwind readnone } +; IS__CGSCC_OPM: attributes [[ATTR20:#.*]] = { nofree nosync nounwind } +; IS__CGSCC_OPM: attributes [[ATTR21:#.*]] = { willreturn } +; IS__CGSCC_OPM: attributes [[ATTR22:#.*]] = { nounwind } +; IS__CGSCC_NPM: attributes [[ATTR15:#.*]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable willreturn } +; IS__CGSCC_NPM: attributes [[ATTR16:#.*]] = { argmemonly nofree noinline norecurse nosync nounwind readonly uwtable } +; IS__CGSCC_NPM: attributes [[ATTR17:#.*]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable } +; IS__CGSCC_NPM: attributes [[ATTR18:#.*]] = { noreturn nounwind } +; IS__CGSCC_NPM: attributes [[ATTR19:#.*]] = { nofree norecurse nosync nounwind readnone } +; IS__CGSCC_NPM: attributes [[ATTR20:#.*]] = { nofree norecurse nosync nounwind readnone willreturn } +; IS__CGSCC_NPM: attributes [[ATTR21:#.*]] = { nofree nosync nounwind readnone } +; IS__CGSCC_NPM: attributes [[ATTR22:#.*]] = { nofree nosync nounwind } +; IS__CGSCC_NPM: attributes [[ATTR23:#.*]] = { willreturn } +; IS__CGSCC_NPM: attributes [[ATTR24:#.*]] = { nounwind }