This is a simple enum attribute.
Test changes are because enum attributes are sorted before type
attributes.
def ZExt : EnumAttr<"zeroext">;
/// Function is required to make Forward Progress.
-def MustProgress : TypeAttr<"mustprogress">;
+def MustProgress : EnumAttr<"mustprogress">;
/// Target-independent string attributes.
def LessPreciseFPMAD : StrBoolAttr<"less-precise-fpmad">;
declare void @callee(i32* %p) nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8*, i8*, i64, i1) nounwind
-; CHECK: attributes #0 = { nofree norecurse nosync nounwind readnone willreturn mustprogress }
-; CHECK: attributes #1 = { nofree norecurse nosync nounwind willreturn writeonly mustprogress }
+; CHECK: attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone willreturn }
+; CHECK: attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn writeonly }
; CHECK: attributes #2 = { nofree nounwind readonly }
; CHECK: attributes #3 = { nounwind }
-; CHECK: attributes #4 = { nofree nosync nounwind readnone willreturn mustprogress }
-; CHECK: attributes #5 = { nofree nosync nounwind willreturn mustprogress }
-; CHECK: attributes #6 = { nofree norecurse nosync nounwind willreturn mustprogress }
+; CHECK: attributes #4 = { mustprogress nofree nosync nounwind readnone willreturn }
+; CHECK: attributes #5 = { mustprogress nofree nosync nounwind willreturn }
+; CHECK: attributes #6 = { mustprogress nofree norecurse nosync nounwind willreturn }
; CHECK: attributes #7 = { argmemonly nofree nounwind willreturn }
; Root note.
; GCN: define amdgpu_kernel void @caller(float addrspace(1)* nocapture %p) local_unnamed_addr #1 {
; GCN: %mul.i = fmul float %load, 1.500000e+01
-; UNSAFE: attributes #0 = { nofree norecurse nosync nounwind readnone willreturn mustprogress "unsafe-fp-math"="true" }
-; UNSAFE: attributes #1 = { nofree norecurse nosync nounwind willreturn mustprogress "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="true" }
+; UNSAFE: attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone willreturn "unsafe-fp-math"="true" }
+; UNSAFE: attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="true" }
-; NOINFS: attributes #0 = { nofree norecurse nosync nounwind readnone willreturn mustprogress "no-infs-fp-math"="true" }
-; NOINFS: attributes #1 = { nofree norecurse nosync nounwind willreturn mustprogress "less-precise-fpmad"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="false" "unsafe-fp-math"="false" }
+; NOINFS: attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone willreturn "no-infs-fp-math"="true" }
+; NOINFS: attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn "less-precise-fpmad"="false" "no-infs-fp-math"="true" "no-nans-fp-math"="false" "unsafe-fp-math"="false" }
-; NONANS: attributes #0 = { nofree norecurse nosync nounwind readnone willreturn mustprogress "no-nans-fp-math"="true" }
-; NONANS: attributes #1 = { nofree norecurse nosync nounwind willreturn mustprogress "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="true" "unsafe-fp-math"="false" }
+; NONANS: attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone willreturn "no-nans-fp-math"="true" }
+; NONANS: attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="true" "unsafe-fp-math"="false" }
define float @foo(float %x) #0 {
entry:
ret void
}
define void @willreturn_mustprogress_caller_2() mustprogress {
-; IS__TUNIT_OPM: Function Attrs: readonly willreturn mustprogress
+; IS__TUNIT_OPM: Function Attrs: mustprogress readonly willreturn
; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2
; IS__TUNIT_OPM-SAME: () #[[ATTR20:[0-9]+]] {
; IS__TUNIT_OPM-NEXT: call void @readonly() #[[ATTR16:[0-9]+]]
; IS__TUNIT_OPM-NEXT: ret void
;
-; IS__TUNIT_NPM: Function Attrs: readonly willreturn mustprogress
+; IS__TUNIT_NPM: Function Attrs: mustprogress readonly willreturn
; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2
; IS__TUNIT_NPM-SAME: () #[[ATTR22:[0-9]+]] {
; IS__TUNIT_NPM-NEXT: call void @readonly() #[[ATTR18:[0-9]+]]
; IS__TUNIT_NPM-NEXT: ret void
;
-; IS__CGSCC_OPM: Function Attrs: readonly willreturn mustprogress
+; IS__CGSCC_OPM: Function Attrs: mustprogress readonly willreturn
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2
; IS__CGSCC_OPM-SAME: () #[[ATTR23:[0-9]+]] {
; IS__CGSCC_OPM-NEXT: call void @readonly() #[[ATTR19:[0-9]+]]
; IS__CGSCC_OPM-NEXT: ret void
;
-; IS__CGSCC_NPM: Function Attrs: readonly willreturn mustprogress
+; IS__CGSCC_NPM: Function Attrs: mustprogress readonly willreturn
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_2
; IS__CGSCC_NPM-SAME: () #[[ATTR25:[0-9]+]] {
; IS__CGSCC_NPM-NEXT: call void @readonly() #[[ATTR21:[0-9]+]]
ret void
}
define void @willreturn_mustprogress_caller_3() mustprogress {
-; IS__TUNIT_OPM: Function Attrs: nosync readnone willreturn mustprogress
+; IS__TUNIT_OPM: Function Attrs: mustprogress nosync readnone willreturn
; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3
; IS__TUNIT_OPM-SAME: () #[[ATTR21:[0-9]+]] {
; IS__TUNIT_OPM-NEXT: call void @readnone()
; IS__TUNIT_OPM-NEXT: ret void
;
-; IS__TUNIT_NPM: Function Attrs: nosync readnone willreturn mustprogress
+; IS__TUNIT_NPM: Function Attrs: mustprogress nosync readnone willreturn
; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3
; IS__TUNIT_NPM-SAME: () #[[ATTR23:[0-9]+]] {
; IS__TUNIT_NPM-NEXT: call void @readnone()
; IS__TUNIT_NPM-NEXT: ret void
;
-; IS__CGSCC_OPM: Function Attrs: nosync readnone willreturn mustprogress
+; IS__CGSCC_OPM: Function Attrs: mustprogress nosync readnone willreturn
; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3
; IS__CGSCC_OPM-SAME: () #[[ATTR24:[0-9]+]] {
; IS__CGSCC_OPM-NEXT: call void @readnone()
; IS__CGSCC_OPM-NEXT: ret void
;
-; IS__CGSCC_NPM: Function Attrs: nosync readnone willreturn mustprogress
+; IS__CGSCC_NPM: Function Attrs: mustprogress nosync readnone willreturn
; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@willreturn_mustprogress_caller_3
; IS__CGSCC_NPM-SAME: () #[[ATTR26:[0-9]+]] {
; IS__CGSCC_NPM-NEXT: call void @readnone()
; IS__TUNIT_OPM: attributes #[[ATTR16]] = { readonly }
; IS__TUNIT_OPM: attributes #[[ATTR17:[0-9]+]] = { readnone }
; IS__TUNIT_OPM: attributes #[[ATTR18]] = { mustprogress }
-; IS__TUNIT_OPM: attributes #[[ATTR19:[0-9]+]] = { readonly mustprogress }
-; IS__TUNIT_OPM: attributes #[[ATTR20]] = { readonly willreturn mustprogress }
-; IS__TUNIT_OPM: attributes #[[ATTR21]] = { nosync readnone willreturn mustprogress }
+; IS__TUNIT_OPM: attributes #[[ATTR19:[0-9]+]] = { mustprogress readonly }
+; IS__TUNIT_OPM: attributes #[[ATTR20]] = { mustprogress readonly willreturn }
+; IS__TUNIT_OPM: attributes #[[ATTR21]] = { mustprogress nosync readnone willreturn }
; IS__TUNIT_OPM: attributes #[[ATTR22]] = { readonly willreturn }
; IS__TUNIT_OPM: attributes #[[ATTR23]] = { nofree nosync nounwind }
; IS__TUNIT_OPM: attributes #[[ATTR24]] = { readnone willreturn }
; IS__TUNIT_NPM: attributes #[[ATTR18]] = { readonly }
; IS__TUNIT_NPM: attributes #[[ATTR19:[0-9]+]] = { readnone }
; IS__TUNIT_NPM: attributes #[[ATTR20]] = { mustprogress }
-; IS__TUNIT_NPM: attributes #[[ATTR21:[0-9]+]] = { readonly mustprogress }
-; IS__TUNIT_NPM: attributes #[[ATTR22]] = { readonly willreturn mustprogress }
-; IS__TUNIT_NPM: attributes #[[ATTR23]] = { nosync readnone willreturn mustprogress }
+; IS__TUNIT_NPM: attributes #[[ATTR21:[0-9]+]] = { mustprogress readonly }
+; IS__TUNIT_NPM: attributes #[[ATTR22]] = { mustprogress readonly willreturn }
+; IS__TUNIT_NPM: attributes #[[ATTR23]] = { mustprogress nosync readnone willreturn }
; IS__TUNIT_NPM: attributes #[[ATTR24]] = { readonly willreturn }
; IS__TUNIT_NPM: attributes #[[ATTR25]] = { nofree nosync nounwind }
; IS__TUNIT_NPM: attributes #[[ATTR26]] = { readnone willreturn }
; IS__CGSCC_OPM: attributes #[[ATTR19]] = { readonly }
; IS__CGSCC_OPM: attributes #[[ATTR20:[0-9]+]] = { readnone }
; IS__CGSCC_OPM: attributes #[[ATTR21]] = { mustprogress }
-; IS__CGSCC_OPM: attributes #[[ATTR22:[0-9]+]] = { readonly mustprogress }
-; IS__CGSCC_OPM: attributes #[[ATTR23]] = { readonly willreturn mustprogress }
-; IS__CGSCC_OPM: attributes #[[ATTR24]] = { nosync readnone willreturn mustprogress }
+; IS__CGSCC_OPM: attributes #[[ATTR22:[0-9]+]] = { mustprogress readonly }
+; IS__CGSCC_OPM: attributes #[[ATTR23]] = { mustprogress readonly willreturn }
+; IS__CGSCC_OPM: attributes #[[ATTR24]] = { mustprogress nosync readnone willreturn }
; IS__CGSCC_OPM: attributes #[[ATTR25]] = { readonly willreturn }
; IS__CGSCC_OPM: attributes #[[ATTR26]] = { nofree nosync nounwind readnone }
; IS__CGSCC_OPM: attributes #[[ATTR27]] = { nofree nosync nounwind }
; IS__CGSCC_NPM: attributes #[[ATTR21]] = { readonly }
; IS__CGSCC_NPM: attributes #[[ATTR22:[0-9]+]] = { readnone }
; IS__CGSCC_NPM: attributes #[[ATTR23]] = { mustprogress }
-; IS__CGSCC_NPM: attributes #[[ATTR24:[0-9]+]] = { readonly mustprogress }
-; IS__CGSCC_NPM: attributes #[[ATTR25]] = { readonly willreturn mustprogress }
-; IS__CGSCC_NPM: attributes #[[ATTR26]] = { nosync readnone willreturn mustprogress }
+; IS__CGSCC_NPM: attributes #[[ATTR24:[0-9]+]] = { mustprogress readonly }
+; IS__CGSCC_NPM: attributes #[[ATTR25]] = { mustprogress readonly willreturn }
+; IS__CGSCC_NPM: attributes #[[ATTR26]] = { mustprogress nosync readnone willreturn }
; IS__CGSCC_NPM: attributes #[[ATTR27]] = { readonly willreturn }
; IS__CGSCC_NPM: attributes #[[ATTR28]] = { nofree nosync nounwind readnone }
; IS__CGSCC_NPM: attributes #[[ATTR29]] = { nofree nosync nounwind }
ret i32 %r
}
-; CHECK: attributes #0 = { nofree norecurse nosync nounwind readnone ssp uwtable willreturn mustprogress }
-; CHECK: attributes #1 = { nofree norecurse nounwind ssp uwtable willreturn mustprogress }
+; CHECK: attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone ssp uwtable willreturn }
+; CHECK: attributes #1 = { mustprogress nofree norecurse nounwind ssp uwtable willreturn }
attributes #0 = { argmemonly }
attributes #1 = { inaccessiblememonly }
attributes #2 = { inaccessiblemem_or_argmemonly }
-; CHECK: attributes #0 = { nofree norecurse nosync nounwind readnone willreturn mustprogress }
+; CHECK: attributes #0 = { mustprogress nofree norecurse nosync nounwind readnone willreturn }
; CHECK-NOT: attributes
; TEST 1 (positive case)
-; FNATTR: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable
+; FNATTR: Function Attrs: mustprogress nofree noinline norecurse nosync nounwind readnone uwtable
; FNATTR-NEXT: define void @only_return()
define void @only_return() #0 {
ret void
declare void @free(i8* nocapture) local_unnamed_addr #2
define i32 @_Z4foo3Pi(i32* nocapture readonly %a) local_unnamed_addr #3 {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind readonly uwtable willreturn
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readonly uwtable willreturn
; CHECK-LABEL: @_Z4foo3Pi(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = load i32, i32* [[A:%.*]], align 4
; Base case, empty function
define void @test1() {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn
; CHECK-LABEL: @test1(
; CHECK-NEXT: ret void
;
; Show the bottom up walk
define void @test2() {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn
; CHECK-LABEL: @test2(
; CHECK-NEXT: call void @test1()
; CHECK-NEXT: ret void
}
define i32 @test4(i32 %a, i32 %b) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readnone willreturn
; CHECK-LABEL: @test4(
; CHECK-NEXT: [[ADD:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: ret i32 [[A]]
; negative case - explicit sync
define void @test5(i8* %p) {
-; CHECK: Function Attrs: nofree norecurse nounwind willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn
; CHECK-LABEL: @test5(
; CHECK-NEXT: store atomic i8 0, i8* [[P:%.*]] seq_cst, align 1
; CHECK-NEXT: ret void
; negative case - explicit sync
define i8 @test6(i8* %p) {
-; CHECK: Function Attrs: nofree norecurse nounwind willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn
; CHECK-LABEL: @test6(
; CHECK-NEXT: [[V:%.*]] = load atomic i8, i8* [[P:%.*]] seq_cst, align 1
; CHECK-NEXT: ret i8 [[V]]
; negative case - explicit sync
define void @test7(i8* %p) {
-; CHECK: Function Attrs: nofree norecurse nounwind willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn
; CHECK-LABEL: @test7(
; CHECK-NEXT: [[TMP1:%.*]] = atomicrmw add i8* [[P:%.*]], i8 0 seq_cst, align 1
; CHECK-NEXT: ret void
; negative case - explicit sync
define void @test8(i8* %p) {
-; CHECK: Function Attrs: nofree norecurse nounwind willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind willreturn
; CHECK-LABEL: @test8(
; CHECK-NEXT: fence seq_cst
; CHECK-NEXT: ret void
; singlethread fences are okay
define void @test9(i8* %p) {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
; CHECK-LABEL: @test9(
; CHECK-NEXT: fence syncscope("singlethread") seq_cst
; CHECK-NEXT: ret void
; atomic load with monotonic ordering
define i32 @load_monotonic(i32* nocapture readonly %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nounwind uwtable willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn
; CHECK-LABEL: @load_monotonic(
; CHECK-NEXT: [[TMP2:%.*]] = load atomic i32, i32* [[TMP0:%.*]] monotonic, align 4
; CHECK-NEXT: ret i32 [[TMP2]]
; atomic store with monotonic ordering.
define void @store_monotonic(i32* nocapture %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nounwind uwtable willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn
; CHECK-LABEL: @store_monotonic(
; CHECK-NEXT: store atomic i32 10, i32* [[TMP0:%.*]] monotonic, align 4
; CHECK-NEXT: ret void
; negative, should not deduce nosync
; atomic load with acquire ordering.
define i32 @load_acquire(i32* nocapture readonly %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nounwind uwtable willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn
; CHECK-LABEL: @load_acquire(
; CHECK-NEXT: [[TMP2:%.*]] = load atomic i32, i32* [[TMP0:%.*]] acquire, align 4
; CHECK-NEXT: ret i32 [[TMP2]]
}
define i32 @load_unordered(i32* nocapture readonly %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind readonly uwtable willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readonly uwtable willreturn
; CHECK-LABEL: @load_unordered(
; CHECK-NEXT: [[TMP2:%.*]] = load atomic i32, i32* [[TMP0:%.*]] unordered, align 4
; CHECK-NEXT: ret i32 [[TMP2]]
; atomic store with unordered ordering.
define void @store_unordered(i32* nocapture %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind uwtable willreturn writeonly mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind uwtable willreturn writeonly
; CHECK-LABEL: @store_unordered(
; CHECK-NEXT: store atomic i32 10, i32* [[TMP0:%.*]] unordered, align 4
; CHECK-NEXT: ret void
; negative, should not deduce nosync
; atomic load with release ordering
define void @load_release(i32* nocapture %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nounwind uwtable willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn
; CHECK-LABEL: @load_release(
; CHECK-NEXT: store atomic volatile i32 10, i32* [[TMP0:%.*]] release, align 4
; CHECK-NEXT: ret void
; negative volatile, relaxed atomic
define void @load_volatile_release(i32* nocapture %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nounwind uwtable willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn
; CHECK-LABEL: @load_volatile_release(
; CHECK-NEXT: store atomic volatile i32 10, i32* [[TMP0:%.*]] release, align 4
; CHECK-NEXT: ret void
; volatile store.
define void @volatile_store(i32* %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nounwind uwtable willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn
; CHECK-LABEL: @volatile_store(
; CHECK-NEXT: store volatile i32 14, i32* [[TMP0:%.*]], align 4
; CHECK-NEXT: ret void
; negative, should not deduce nosync
; volatile load.
define i32 @volatile_load(i32* %0) norecurse nounwind uwtable {
-; CHECK: Function Attrs: nofree norecurse nounwind uwtable willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree norecurse nounwind uwtable willreturn
; CHECK-LABEL: @volatile_load(
; CHECK-NEXT: [[TMP2:%.*]] = load volatile i32, i32* [[TMP0:%.*]], align 4
; CHECK-NEXT: ret i32 [[TMP2]]
; negative, checking volatile intrinsics.
define i32 @memcpy_volatile(i8* %ptr1, i8* %ptr2) {
-; CHECK: Function Attrs: nofree nounwind willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree nounwind willreturn
; CHECK-LABEL: @memcpy_volatile(
; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* [[PTR1:%.*]], i8* [[PTR2:%.*]], i32 8, i1 true)
; CHECK-NEXT: ret i32 4
; positive, non-volatile intrinsic.
define i32 @memset_non_volatile(i8* %ptr1, i8 %val) {
-; CHECK: Function Attrs: nofree nosync nounwind willreturn writeonly mustprogress
+; CHECK: Function Attrs: mustprogress nofree nosync nounwind willreturn writeonly
; CHECK-LABEL: @memset_non_volatile(
; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* [[PTR1:%.*]], i8 [[VAL:%.*]], i32 8, i1 false)
; CHECK-NEXT: ret i32 4
declare float @llvm.cos(float %val) readnone
define float @cos_test(float %x) {
-; CHECK: Function Attrs: nofree nosync nounwind readnone willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
; CHECK-LABEL: @cos_test(
; CHECK-NEXT: [[C:%.*]] = call float @llvm.cos.f32(float [[X:%.*]])
; CHECK-NEXT: ret float [[C]]
; RUN: opt < %s -function-attrs -S | FileCheck %s
; TEST 1
-; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone
+; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind readnone
; CHECK-NEXT: define i32 @foo1()
define i32 @foo1() {
ret i32 1
; CHECK: (i8*) #1
; CHECK-LABEL: attributes #0
-; CHECK: = { nofree norecurse nosync nounwind readnone willreturn mustprogress }
+; CHECK: = { mustprogress nofree norecurse nosync nounwind readnone willreturn }
; CHECK-LABEL: attributes #1
; CHECK: = { noinline optnone }
}
define void @test_fn_willreturn(i32* %ptr) willreturn {
-; CHECK: Function Attrs: willreturn
+; CHECK: Function Attrs: mustprogress willreturn
; CHECK-LABEL: @test_fn_willreturn(
; CHECK-NOT: call void @decl_readonly() #
; CHECK-NOT : call void @decl_readnone() #
}
define void @test_fn_mustprogress_readonly_calls(i32* %ptr) mustprogress {
-; CHECK: Function Attrs: nofree readonly willreturn mustprogress
+; CHECK: Function Attrs: mustprogress nofree readonly willreturn
; CHECK-LABEL: @test_fn_mustprogress_readonly_calls(
; CHECK-NOT: call void @decl_readonly() #
; CHECK-NOT: call void @decl_readnone() #
}
define void @test_fn_mustprogress_readonly_calls_but_stores(i32* %ptr) mustprogress {
-; CHECK: Function Attrs: nofree mustprogress
+; CHECK: Function Attrs: mustprogress nofree
; CHECK-LABEL: @test_fn_mustprogress_readonly_calls_but_stores(
; CHECK-NOT: call void @decl_readonly() #
; CHECK-NOT: call void @decl_readnone() #
; Function without loops or non-willreturn calls will return.
define void @willreturn_no_loop(i1 %c, i32* %p) {
-; CHECK: Function Attrs: willreturn
+; CHECK: Function Attrs: mustprogress willreturn
; CHECK-NEXT: define void @willreturn_no_loop(
;
br i1 %c, label %if, label %else
ret void
}
-; CHECK: attributes #0 = { {{.*}} readnone {{.*}} }
-; CHECK: attributes #1 = { {{.*}} readonly {{.*}} }
-; CHECK: attributes #2 = { {{.*}} writeonly {{.*}} }
+; CHECK: attributes #0 = { {{.*}}readnone{{.*}} }
+; CHECK: attributes #1 = { {{.*}}readonly{{.*}} }
+; CHECK: attributes #2 = { {{.*}}writeonly{{.*}} }
declare void @memset_pattern16(i8*, i8*, i64)
-; CHECK-DAG: attributes [[NOFREE_NOUNWIND_WILLRETURN]] = { nofree nounwind willreturn mustprogress }
+; CHECK-DAG: attributes [[NOFREE_NOUNWIND_WILLRETURN]] = { mustprogress nofree nounwind willreturn }
; CHECK-DAG: attributes [[NOFREE_NOUNWIND]] = { nofree nounwind }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { inaccessiblememonly nofree nounwind willreturn mustprogress }
-; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { nofree nounwind readonly willreturn mustprogress }
-; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { argmemonly nofree nounwind willreturn mustprogress }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { inaccessiblememonly mustprogress nofree nounwind willreturn }
+; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { mustprogress nofree nounwind readonly willreturn }
+; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_WILLRETURN]] = { argmemonly mustprogress nofree nounwind willreturn }
; CHECK-DAG: attributes [[NOFREE_NOUNWIND_READONLY]] = { nofree nounwind readonly }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN]] = { inaccessiblemem_or_argmemonly nounwind willreturn mustprogress }
-; CHECK-DAG: attributes [[NOFREE_WILLRETURN]] = { nofree willreturn mustprogress }
-; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { argmemonly nofree nounwind readonly willreturn mustprogress }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGMEMONLY_NOUNWIND_WILLRETURN]] = { inaccessiblemem_or_argmemonly mustprogress nounwind willreturn }
+; CHECK-DAG: attributes [[NOFREE_WILLRETURN]] = { mustprogress nofree willreturn }
+; CHECK-DAG: attributes [[ARGMEMONLY_NOFREE_NOUNWIND_READONLY_WILLRETURN]] = { argmemonly mustprogress nofree nounwind readonly willreturn }
; CHECK-DAG: attributes [[NOFREE]] = { nofree }
-; CHECK-DAG: attributes [[WILLRETURN]] = { willreturn mustprogress }
-; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGONLY_NOFREE_NOUNWIND_WILLRETURN]] = { inaccessiblemem_or_argmemonly nofree nounwind willreturn mustprogress }
+; CHECK-DAG: attributes [[WILLRETURN]] = { mustprogress willreturn }
+; CHECK-DAG: attributes [[INACCESSIBLEMEMORARGONLY_NOFREE_NOUNWIND_WILLRETURN]] = { inaccessiblemem_or_argmemonly mustprogress nofree nounwind willreturn }
; CHECK-DARWIN-DAG: attributes [[ARGMEMONLY_NOFREE]] = { argmemonly nofree }
; CHECK-NVPTX-DAG: attributes [[NOFREE_NOUNWIND_READNONE]] = { nofree nosync nounwind readnone }
!28 = !DILocation(line: 9, column: 18, scope: !2)
!29 = !DILocation(line: 10, column: 1, scope: !2)
-; CHECK: attributes #0 = { nofree norecurse nosync nounwind willreturn mustprogress }
+; CHECK: attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn }
; CHECK-NOT: foo.coefficient1
; After AlwaysInline the callee's attributes should be merged into caller's attibutes.
; CHECK: define dso_local <2 x i64> @foo(<8 x i64>* byval(<8 x i64>) align 64 %0) #0
-; CHECK: attributes #0 = { uwtable mustprogress "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="512"
+; CHECK: attributes #0 = { mustprogress uwtable "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="512"
; Function Attrs: uwtable mustprogress
define dso_local <2 x i64> @foo(<8 x i64>* byval(<8 x i64>) align 64 %0) #0 {
}
; CHECK: declare i64 @strlen(i8* nocapture) #0
-; CHECK: attributes #0 = { argmemonly nofree nounwind readonly willreturn mustprogress }
+; CHECK: attributes #0 = { argmemonly mustprogress nofree nounwind readonly willreturn }
declare i64 @strlen(i8*)