Original file line number Diff line number Diff line change
Expand Up @@ -469,14 +469,14 @@ attributes #5 = { argmemonly nounwind }
; TUNIT: attributes #[[ATTR2]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" }
; TUNIT: attributes #[[ATTR3]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" }
; TUNIT: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
; TUNIT: attributes #[[ATTR5]] = { memory(write) }
; TUNIT: attributes #[[ATTR5]] = { nofree willreturn memory(write) }
; TUNIT: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn }
;.
; CGSCC: attributes #[[ATTR0]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="512" "target-features"="+avx512vl" }
; CGSCC: attributes #[[ATTR1]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx512vl" }
; CGSCC: attributes #[[ATTR2]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="256" "prefer-vector-width"="256" "target-features"="+avx512vl" }
; CGSCC: attributes #[[ATTR3]] = { inlinehint mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable "min-legal-vector-width"="512" "prefer-vector-width"="256" "target-features"="+avx2" }
; CGSCC: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: write) }
; CGSCC: attributes #[[ATTR5]] = { memory(write) }
; CGSCC: attributes #[[ATTR6]] = { nounwind }
; CGSCC: attributes #[[ATTR5]] = { nofree willreturn memory(write) }
; CGSCC: attributes #[[ATTR6]] = { nofree nounwind willreturn }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ entry:
define void @exportedfun(ptr %a) {
; TUNIT-LABEL: define {{[^@]+}}@exportedfun
; TUNIT-SAME: (ptr nocapture nofree readnone [[A:%.*]]) {
; TUNIT-NEXT: [[INALLOCA_SAVE:%.*]] = tail call ptr @llvm.stacksave()
; TUNIT-NEXT: [[INALLOCA_SAVE:%.*]] = tail call ptr @llvm.stacksave() #[[ATTR1:[0-9]+]]
; TUNIT-NEXT: [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A:%.*]] }>, align 4
; TUNIT-NEXT: call x86_thiscallcc void @internalfun(ptr noalias nocapture nofree readnone undef, ptr noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
; TUNIT-NEXT: call void @llvm.stackrestore(ptr nofree [[INALLOCA_SAVE]])
; TUNIT-NEXT: ret void
;
; CGSCC-LABEL: define {{[^@]+}}@exportedfun
; CGSCC-SAME: (ptr nocapture nofree readnone [[A:%.*]]) {
; CGSCC-NEXT: [[INALLOCA_SAVE:%.*]] = tail call ptr @llvm.stacksave()
; CGSCC-NEXT: [[INALLOCA_SAVE:%.*]] = tail call ptr @llvm.stacksave() #[[ATTR1:[0-9]+]]
; CGSCC-NEXT: [[ARGMEM:%.*]] = alloca inalloca <{ [[STRUCT_A:%.*]] }>, align 4
; CGSCC-NEXT: call x86_thiscallcc void @internalfun(ptr noalias nocapture nofree readnone [[A]], ptr noundef nonnull inalloca(<{ [[STRUCT_A]] }>) align 4 dereferenceable(1) [[ARGMEM]])
; CGSCC-NEXT: call void @llvm.stackrestore(ptr nofree [[INALLOCA_SAVE]])
Expand All @@ -59,4 +59,5 @@ declare ptr @llvm.stacksave()
declare void @llvm.stackrestore(ptr)
;.
; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
; CHECK: attributes #[[ATTR1:[0-9]+]] = { nofree willreturn }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ define i32 @caller() {
; CGSCC-LABEL: define {{[^@]+}}@caller
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test()
; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test() #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i32 [[V]]
;
entry:
Expand All @@ -48,6 +48,7 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ define i32 @callercaller() {
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR3]] = { memory(read) }
; CGSCC: attributes #[[ATTR4]] = { nounwind }
; CGSCC: attributes #[[ATTR3]] = { nofree willreturn memory(read) }
; CGSCC: attributes #[[ATTR4]] = { nofree nounwind willreturn }
;.
2 changes: 1 addition & 1 deletion llvm/test/Transforms/Attributor/ArgumentPromotion/attrs.ll
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR2]] = { nounwind }
; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ define i32 @callercaller() {
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR3]] = { memory(read) }
; CGSCC: attributes #[[ATTR4]] = { nounwind }
; CGSCC: attributes #[[ATTR3]] = { nofree willreturn memory(read) }
; CGSCC: attributes #[[ATTR4]] = { nofree nounwind willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,5 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR2]] = { nounwind }
; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn }
;.
2 changes: 1 addition & 1 deletion llvm/test/Transforms/Attributor/ArgumentPromotion/byval.ll
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nounwind }
; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn }
;.
3 changes: 2 additions & 1 deletion llvm/test/Transforms/Attributor/ArgumentPromotion/chained.ll
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ define i32 @caller() {
; CGSCC-LABEL: define {{[^@]+}}@caller
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[X:%.*]] = call i32 @test()
; CGSCC-NEXT: [[X:%.*]] = call i32 @test() #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i32 [[X]]
;
entry:
Expand All @@ -50,4 +50,5 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) }
; CGSCC: attributes #[[ATTR2]] = { memory(read) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn memory(read) }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ define i32 @foo() {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { memory(read) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn memory(read) }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,5 @@ entry:
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR3]] = { memory(read) }
; CGSCC: attributes #[[ATTR3]] = { nofree willreturn memory(read) }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ define i32 @callercaller() {
; CGSCC-LABEL: define {{[^@]+}}@callercaller
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4
; CGSCC-NEXT: [[X:%.*]] = call noundef i32 @caller()
; CGSCC-NEXT: [[X:%.*]] = call noundef i32 @caller() #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i32 [[X]]
;
%B = alloca i32
Expand All @@ -70,6 +70,7 @@ define i32 @callercaller() {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ define i32 @callercaller() {
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind willreturn memory(write) }
; CGSCC: attributes #[[ATTR3]] = { nounwind memory(write) }
; CGSCC: attributes #[[ATTR3]] = { nofree nounwind willreturn memory(write) }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
13 changes: 7 additions & 6 deletions llvm/test/Transforms/Attributor/ArgumentPromotion/musttail.ll
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ define internal i32 @test2(ptr %p, i32 %p2) {
; CGSCC-NEXT: [[A:%.*]] = load i32, ptr [[A_GEP]], align 4
; CGSCC-NEXT: [[B:%.*]] = load i32, ptr [[B_GEP]], align 4
; CGSCC-NEXT: [[V:%.*]] = add i32 [[A]], [[B]]
; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @foo(ptr undef, i32 [[V]])
; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @foo(ptr undef, i32 [[V]]) #[[ATTR6:[0-9]+]]
; CGSCC-NEXT: ret i32 [[CA]]
;
%a.gep = getelementptr %T, %T* %p, i64 0, i32 3
Expand Down Expand Up @@ -138,7 +138,7 @@ define internal i32 @test2b(ptr %p, i32 %p2) {
; CGSCC-NEXT: [[A:%.*]] = load i32, ptr [[A_GEP]], align 4
; CGSCC-NEXT: [[B:%.*]] = load i32, ptr [[B_GEP]], align 4
; CGSCC-NEXT: [[V:%.*]] = add i32 [[A]], [[B]]
; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @bar(ptr undef, i32 [[V]]) #[[ATTR6:[0-9]+]]
; CGSCC-NEXT: [[CA:%.*]] = musttail call noundef i32 @bar(ptr undef, i32 [[V]]) #[[ATTR7:[0-9]+]]
; CGSCC-NEXT: ret i32 [[CA]]
;
%a.gep = getelementptr %T, %T* %p, i64 0, i32 3
Expand All @@ -160,7 +160,7 @@ define i32 @caller2b(ptr %g) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@caller2b
; CGSCC-SAME: (ptr nocapture nofree readonly align 4 [[G:%.*]]) #[[ATTR4]] {
; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test2b(ptr nocapture nofree readonly [[G]], i32 noundef 0) #[[ATTR7:[0-9]+]]
; CGSCC-NEXT: [[V:%.*]] = call noundef i32 @test2b(ptr nocapture nofree readonly [[G]], i32 noundef 0) #[[ATTR8:[0-9]+]]
; CGSCC-NEXT: ret i32 [[V]]
;
%v = call i32 @test2b(%T* %g, i32 0)
Expand All @@ -180,7 +180,8 @@ define i32 @caller2b(ptr %g) {
; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR5]] = { memory(read) }
; CGSCC: attributes #[[ATTR6]] = { nounwind memory(write) }
; CGSCC: attributes #[[ATTR7]] = { nounwind }
; CGSCC: attributes #[[ATTR5]] = { nofree willreturn memory(read) }
; CGSCC: attributes #[[ATTR6]] = { nofree willreturn }
; CGSCC: attributes #[[ATTR7]] = { nofree nounwind willreturn memory(write) }
; CGSCC: attributes #[[ATTR8]] = { nofree nounwind willreturn }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ define internal fastcc void @fn1(ptr nocapture readonly) unnamed_addr {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn }
; CGSCC: attributes #[[ATTR2]] = { nounwind }
; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ define internal void @bar(%p_t %p) {
; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@bar
; CGSCC-SAME: (ptr nocapture nofree readnone [[P:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: call void @llvm.dbg.value(metadata ptr [[P]], metadata [[META3:![0-9]+]], metadata !DIExpression()), !dbg [[DBG5:![0-9]+]]
; CGSCC-NEXT: call void @llvm.dbg.value(metadata ptr [[P]], metadata [[META3:![0-9]+]], metadata !DIExpression()) #[[ATTR2:[0-9]+]], !dbg [[DBG5:![0-9]+]]
; CGSCC-NEXT: ret void
;
call void @llvm.dbg.value(metadata %p_t %p, metadata !4, metadata !5), !dbg !6
Expand All @@ -47,8 +47,12 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
!5 = !DIExpression()
!6 = !DILocation(line: 1, column: 1, scope: !3)
;.
; CHECK: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CHECK: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
; TUNIT: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; TUNIT: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
; TUNIT: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: !1, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
; TUNIT: [[META1:![0-9]+]] = !DIFile(filename: "test.c", directory: "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn }
; CGSCC: attributes #[[ATTR2]] = { nounwind }
; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn }
;.
; CHECK: [[TBAA0]] = !{!1, !1, i64 0}
; CHECK: [[META1:![0-9]+]] = !{!"int", !2, i64 0}
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/Attributor/ArgumentPromotion/sret.ll
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ define void @f() {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nounwind }
; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
7 changes: 4 additions & 3 deletions llvm/test/Transforms/Attributor/IPConstantProp/PR16052.ll
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ define i64 @fn2() {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[CONV:%.*]] = sext i32 undef to i64
; CGSCC-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]]
; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]])
; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i64 [[CALL2]]
;
entry:
Expand All @@ -45,7 +45,7 @@ define i64 @fn2b(i32 %arg) {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; CGSCC-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]]
; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]])
; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]]) #[[ATTR2]]
; CGSCC-NEXT: ret i64 [[CALL2]]
;
entry:
Expand All @@ -68,7 +68,7 @@ define i64 @fn2c() {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[CONV:%.*]] = sext i32 undef to i64
; CGSCC-NEXT: [[ADD:%.*]] = add i64 42, [[CONV]]
; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[ADD]])
; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[ADD]]) #[[ATTR2]]
; CGSCC-NEXT: ret i64 [[CALL2]]
;
entry:
Expand All @@ -95,6 +95,7 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
5 changes: 3 additions & 2 deletions llvm/test/Transforms/Attributor/IPConstantProp/PR26044.ll
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ define void @fn2(ptr %P, i1 %C) {
; CGSCC: if.end:
; CGSCC-NEXT: [[E_2:%.*]] = phi ptr [ [[P]], [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ]
; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[E_2]], align 4
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @fn1(i32 [[TMP0]])
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @fn1(i32 [[TMP0]]) #[[ATTR3:[0-9]+]]
; CGSCC-NEXT: store i32 [[CALL]], ptr [[P]], align 4
; CGSCC-NEXT: br label [[FOR_COND1]]
; CGSCC: exit:
Expand Down Expand Up @@ -95,7 +95,7 @@ define void @fn_no_null_opt(ptr %P, i1 %C) null_pointer_is_valid {
; CGSCC: if.end:
; CGSCC-NEXT: [[E_2:%.*]] = phi ptr [ undef, [[ENTRY:%.*]] ], [ null, [[FOR_COND1:%.*]] ]
; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr null, align 4294967296
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @fn0(i32 [[TMP0]])
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @fn0(i32 [[TMP0]]) #[[ATTR3]]
; CGSCC-NEXT: store i32 [[CALL]], ptr [[P]], align 4
; CGSCC-NEXT: br label [[FOR_COND1]]
; CGSCC: exit:
Expand Down Expand Up @@ -138,4 +138,5 @@ entry:
; CGSCC: attributes #[[ATTR0]] = { nofree nosync nounwind memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree nosync nounwind null_pointer_is_valid }
; CGSCC: attributes #[[ATTR3]] = { nofree }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ define dso_local i16 @foo(i16 %a) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@foo
; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
; CGSCC-NEXT: [[CALL:%.*]] = call noundef i16 @bar(i16 [[A]])
; CGSCC-NEXT: [[CALL:%.*]] = call noundef i16 @bar(i16 [[A]]) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i16 [[CALL]]
;
%call = call i16 @bar(i16 %a)
Expand All @@ -68,7 +68,7 @@ define dso_local i16 @foo2(i16 %a) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@foo2
; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: [[CALL:%.*]] = call i16 @bar2(i16 [[A]])
; CGSCC-NEXT: [[CALL:%.*]] = call i16 @bar2(i16 [[A]]) #[[ATTR2]]
; CGSCC-NEXT: ret i16 [[CALL]]
;
%call = call i16 @bar2(i16 %a)
Expand Down Expand Up @@ -107,8 +107,8 @@ define dso_local i16 @vararg_tests(i16 %a) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@vararg_tests
; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: [[CALL1:%.*]] = call i16 (i16, ...) @vararg_prop(i16 noundef 7, i16 noundef 8, i16 [[A]])
; CGSCC-NEXT: [[CALL2:%.*]] = call i16 @vararg_no_prop(i16 noundef 7)
; CGSCC-NEXT: [[CALL1:%.*]] = call i16 (i16, ...) @vararg_prop(i16 noundef 7, i16 noundef 8, i16 [[A]]) #[[ATTR2]]
; CGSCC-NEXT: [[CALL2:%.*]] = call i16 @vararg_no_prop(i16 noundef 7) #[[ATTR2]]
; CGSCC-NEXT: [[ADD:%.*]] = add i16 [[CALL1]], [[CALL2]]
; CGSCC-NEXT: ret i16 [[ADD]]
;
Expand Down Expand Up @@ -142,6 +142,7 @@ define internal i16 @vararg_no_prop(i16 %p1, i16 %p2, ...) {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define dso_local i16 @foo(i16 %a) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@foo
; CGSCC-SAME: (i16 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
; CGSCC-NEXT: [[CALL:%.*]] = call i16 @bar(i16 [[A]], i32 noundef 7)
; CGSCC-NEXT: [[CALL:%.*]] = call i16 @bar(i16 [[A]], i32 noundef 7) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i16 [[CALL]]
;
%call = call i16 @bar(i16 %a, i32 7)
Expand All @@ -36,6 +36,7 @@ define internal i16 @bar(i16 %p1, i16 %p2) {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ define ptr @start(i8 %v) {
; CGSCC-NEXT: [[C2:%.*]] = icmp eq i8 [[V]], 1
; CGSCC-NEXT: br i1 [[C2]], label [[C2_TRUE:%.*]], label [[C2_FALSE:%.*]]
; CGSCC: c2_true:
; CGSCC-NEXT: [[CA1:%.*]] = musttail call noundef align 4294967296 ptr @no_side_effects(i8 [[V]])
; CGSCC-NEXT: [[CA1:%.*]] = musttail call noalias noundef align 4294967296 ptr @no_side_effects(i8 [[V]])
; CGSCC-NEXT: ret ptr [[CA1]]
; CGSCC: c2_false:
; CGSCC-NEXT: [[CA2:%.*]] = musttail call noundef align 4294967296 ptr @dont_zap_me(i8 [[V]])
; CGSCC-NEXT: [[CA2:%.*]] = musttail call noalias noundef align 4294967296 ptr @dont_zap_me(i8 [[V]])
; CGSCC-NEXT: ret ptr [[CA2]]
;
%c1 = icmp eq i8 %v, 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ return:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noreturn nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nounwind }
; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ define void @caller(i1 %C) personality ptr @__gxx_personality_v0 {
; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR2:[0-9]+]] personality ptr @__gxx_personality_v0 {
; CGSCC-NEXT: [[Q:%.*]] = alloca i32, align 4
; CGSCC-NEXT: [[W:%.*]] = call align 4 ptr @incdec(i1 noundef [[C]], ptr nofree noundef nonnull align 4 dereferenceable(4) [[Q]]) #[[ATTR3:[0-9]+]]
; CGSCC-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2)
; CGSCC-NEXT: [[S1:%.*]] = call { i32, i32 } @foo(i32 noundef 1, i32 noundef 2) #[[ATTR4:[0-9]+]]
; CGSCC-NEXT: [[X1:%.*]] = extractvalue { i32, i32 } [[S1]], 0
; CGSCC-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR4:[0-9]+]]
; CGSCC-NEXT: [[S2:%.*]] = call { i32, i32 } @foo(i32 noundef 3, i32 noundef 4) #[[ATTR5:[0-9]+]]
; CGSCC-NEXT: br label [[OK:%.*]]
; CGSCC: OK:
; CGSCC-NEXT: [[X2:%.*]] = extractvalue { i32, i32 } [[S2]], 0
Expand Down Expand Up @@ -125,8 +125,9 @@ declare i32 @__gxx_personality_v0(...)
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn }
; CGSCC: attributes #[[ATTR3]] = { nounwind }
; CGSCC: attributes #[[ATTR4]] = { nounwind memory(none) }
; CGSCC: attributes #[[ATTR3]] = { nofree nounwind willreturn }
; CGSCC: attributes #[[ATTR4]] = { nofree willreturn }
; CGSCC: attributes #[[ATTR5]] = { nofree nounwind willreturn memory(none) }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ define i1 @caller(i1 %C) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@caller
; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: [[X:%.*]] = call i32 @foo(i1 noundef [[C]])
; CGSCC-NEXT: [[X:%.*]] = call i32 @foo(i1 noundef [[C]]) #[[ATTR3:[0-9]+]]
; CGSCC-NEXT: [[Y:%.*]] = icmp ne i32 [[X]], 0
; CGSCC-NEXT: ret i1 [[Y]]
;
Expand All @@ -89,7 +89,8 @@ declare i32 @__gxx_personality_v0(...)
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nounwind memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR3]] = { nofree willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ define %0 @caller(i1 %Q) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@caller
; CGSCC-SAME: (i1 noundef [[Q:%.*]]) #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 noundef [[Q]])
; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 noundef [[Q]]) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret [[TMP0]] [[X]]
;
%X = call %0 @foo(i1 %Q)
Expand Down Expand Up @@ -101,10 +101,10 @@ define i32 @caller2(i1 %Q) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@caller2
; CGSCC-SAME: (i1 noundef [[Q:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 noundef [[Q]])
; CGSCC-NEXT: [[X:%.*]] = call [[TMP0:%.*]] @foo(i1 noundef [[Q]]) #[[ATTR2]]
; CGSCC-NEXT: [[A:%.*]] = extractvalue [[TMP0]] [[X]], 0
; CGSCC-NEXT: [[B:%.*]] = extractvalue [[TMP0]] [[X]], 1
; CGSCC-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 noundef [[Q]])
; CGSCC-NEXT: [[Y:%.*]] = call [[TMP0]] @bar(i1 noundef [[Q]]) #[[ATTR2]]
; CGSCC-NEXT: [[C:%.*]] = extractvalue [[TMP0]] [[Y]], 0
; CGSCC-NEXT: [[D:%.*]] = extractvalue [[TMP0]] [[Y]], 1
; CGSCC-NEXT: [[M:%.*]] = add i32 [[A]], [[C]]
Expand All @@ -130,4 +130,5 @@ define i32 @caller2(i1 %Q) {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ define internal i32 @test1(i1 %c) {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: br label [[IF_THEN:%.*]]
; CGSCC: if.then:
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @testf(i1 noundef [[C]])
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @testf(i1 noundef [[C]]) #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: [[RES:%.*]] = icmp eq i32 [[CALL]], 10
; CGSCC-NEXT: br i1 [[RES]], label [[RET1:%.*]], label [[RET2:%.*]]
; CGSCC: ret1:
Expand Down Expand Up @@ -67,7 +67,7 @@ define i32 @main(i1 %c) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@main
; CGSCC-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: [[RES:%.*]] = call noundef i32 @test1(i1 [[C]])
; CGSCC-NEXT: [[RES:%.*]] = call noundef i32 @test1(i1 [[C]]) #[[ATTR2]]
; CGSCC-NEXT: ret i32 [[RES]]
;
%res = call i32 @test1(i1 %c)
Expand All @@ -78,6 +78,7 @@ define i32 @main(i1 %c) {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
21 changes: 11 additions & 10 deletions llvm/test/Transforms/Attributor/align.ll
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ define align 4 ptr @test7() #0 {
; CGSCC: Function Attrs: mustprogress nofree noinline nosync nounwind willreturn memory(none) uwtable
; CGSCC-LABEL: define {{[^@]+}}@test7
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: [[C:%.*]] = tail call noundef nonnull align 8 dereferenceable(1) ptr @f1()
; CGSCC-NEXT: [[C:%.*]] = tail call noundef nonnull align 8 dereferenceable(1) ptr @f1() #[[ATTR14:[0-9]+]]
; CGSCC-NEXT: ret ptr [[C]]
;
%c = tail call i8* @f1(i8* align 8 dereferenceable(1) @a1)
Expand Down Expand Up @@ -636,15 +636,15 @@ define void @test12-5(ptr align 4 %p) {
; TUNIT-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] {
; TUNIT-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, ptr [[P]], i64 1
; TUNIT-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, ptr [[ARRAYIDX0]], i64 3
; TUNIT-NEXT: tail call void @use(ptr align 16 [[ARRAYIDX1]]) #[[ATTR2]]
; TUNIT-NEXT: tail call void @use(ptr align 16 [[ARRAYIDX1]]) #[[ATTR6:[0-9]+]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: mustprogress nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@test12-5
; CGSCC-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR8:[0-9]+]] {
; CGSCC-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, ptr [[P]], i64 1
; CGSCC-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, ptr [[ARRAYIDX0]], i64 3
; CGSCC-NEXT: tail call void @use(ptr align 16 [[ARRAYIDX1]]) #[[ATTR3]]
; CGSCC-NEXT: tail call void @use(ptr align 16 [[ARRAYIDX1]]) #[[ATTR7:[0-9]+]]
; CGSCC-NEXT: ret void
;
%p-cast = bitcast i32* %p to i64*
Expand All @@ -658,13 +658,13 @@ define void @test12-6(ptr align 4 %p) {
; TUNIT: Function Attrs: mustprogress nounwind willreturn
; TUNIT-LABEL: define {{[^@]+}}@test12-6
; TUNIT-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR7]] {
; TUNIT-NEXT: tail call void @use(ptr align 16 [[P]]) #[[ATTR2]]
; TUNIT-NEXT: tail call void @use(ptr align 16 [[P]]) #[[ATTR6]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: mustprogress nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@test12-6
; CGSCC-SAME: (ptr align 16 [[P:%.*]]) #[[ATTR8]] {
; CGSCC-NEXT: tail call void @use(ptr align 16 [[P]]) #[[ATTR3]]
; CGSCC-NEXT: tail call void @use(ptr align 16 [[P]]) #[[ATTR7]]
; CGSCC-NEXT: ret void
;
%p-cast = bitcast i32* %p to i64*
Expand Down Expand Up @@ -944,7 +944,7 @@ define i32 @musttail_caller_1(ptr %p) {
; CGSCC-NEXT: [[C:%.*]] = load i1, ptr @cnd, align 1
; CGSCC-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]]
; CGSCC: mt:
; CGSCC-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(ptr nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR14:[0-9]+]]
; CGSCC-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(ptr nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR15:[0-9]+]]
; CGSCC-NEXT: ret i32 [[V]]
; CGSCC: exit:
; CGSCC-NEXT: ret i32 0
Expand Down Expand Up @@ -1082,7 +1082,7 @@ define ptr @aligned_8_return_caller(ptr align(16) %a, i1 %c1, i1 %c2) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@aligned_8_return_caller
; CGSCC-SAME: (ptr nofree readnone align 16 [[A:%.*]], i1 noundef [[C1:%.*]], i1 [[C2:%.*]]) #[[ATTR13:[0-9]+]] {
; CGSCC-NEXT: [[R:%.*]] = call align 8 ptr @aligned_8_return(ptr noalias nofree readnone align 16 [[A]], i1 noundef [[C1]], i1 [[C2]])
; CGSCC-NEXT: [[R:%.*]] = call align 8 ptr @aligned_8_return(ptr noalias nofree readnone align 16 [[A]], i1 noundef [[C1]], i1 [[C2]]) #[[ATTR14]]
; CGSCC-NEXT: ret ptr [[R]]
;
%r = call i8* @aligned_8_return(i8* %a, i1 %c1, i1 %c2)
Expand Down Expand Up @@ -1113,7 +1113,7 @@ attributes #2 = { null_pointer_is_valid }
; TUNIT: attributes #[[ATTR3]] = { nofree nosync nounwind }
; TUNIT: attributes #[[ATTR4]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
; TUNIT: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
; TUNIT: attributes #[[ATTR6:[0-9]+]] = { nounwind willreturn }
; TUNIT: attributes #[[ATTR6]] = { nounwind willreturn }
; TUNIT: attributes #[[ATTR7]] = { mustprogress nounwind willreturn }
; TUNIT: attributes #[[ATTR8]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable }
; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) }
Expand All @@ -1129,12 +1129,13 @@ attributes #2 = { null_pointer_is_valid }
; CGSCC: attributes #[[ATTR4]] = { nofree nosync nounwind }
; CGSCC: attributes #[[ATTR5]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) }
; CGSCC: attributes #[[ATTR6]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
; CGSCC: attributes #[[ATTR7:[0-9]+]] = { nounwind willreturn }
; CGSCC: attributes #[[ATTR7]] = { nounwind willreturn }
; CGSCC: attributes #[[ATTR8]] = { mustprogress nounwind willreturn }
; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable }
; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) }
; CGSCC: attributes #[[ATTR11]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR12]] = { mustprogress nofree nosync nounwind willreturn memory(read) }
; CGSCC: attributes #[[ATTR13]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR14]] = { memory(read) }
; CGSCC: attributes #[[ATTR14]] = { nofree willreturn }
; CGSCC: attributes #[[ATTR15]] = { nofree willreturn memory(read) }
;.
Original file line number Diff line number Diff line change
Expand Up @@ -292,5 +292,5 @@ entry:
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree nosync nounwind willreturn memory(argmem: read) }
; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn }
; CGSCC: attributes #[[ATTR4]] = { memory(read) }
; CGSCC: attributes #[[ATTR4]] = { nofree willreturn memory(read) }
;.
1 change: 1 addition & 0 deletions llvm/test/Transforms/Attributor/cb_liveness_disabled.ll
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,5 @@ attributes #0 = { noinline nounwind sspstrong uwtable}
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind sspstrong willreturn memory(none) uwtable }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree noinline nosync nounwind sspstrong willreturn memory(none) uwtable }
; CGSCC: attributes #[[ATTR2:[0-9]+]] = { nofree willreturn }
;.
1 change: 1 addition & 0 deletions llvm/test/Transforms/Attributor/cb_liveness_enabled.ll
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,5 @@ attributes #0 = { noinline nounwind sspstrong uwtable}
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noinline norecurse nosync nounwind sspstrong willreturn memory(none) uwtable }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree noinline nosync nounwind sspstrong willreturn memory(none) uwtable }
; CGSCC: attributes #[[ATTR2:[0-9]+]] = { nofree willreturn }
;.
1 change: 1 addition & 0 deletions llvm/test/Transforms/Attributor/cb_range_disabled.ll
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,5 @@ define i32 @test2_ncheck(i32 %unknown) {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2:[0-9]+]] = { nofree willreturn }
;.
1 change: 1 addition & 0 deletions llvm/test/Transforms/Attributor/cb_range_enabled.ll
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ define i32 @test2_ncheck(i32 %unknown) {
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2:[0-9]+]] = { nofree willreturn }
;.
8 changes: 5 additions & 3 deletions llvm/test/Transforms/Attributor/convergent.ll
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ define i32 @calls_defined() convergent {
; CGSCC: Function Attrs: convergent mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@calls_defined
; CGSCC-SAME: () #[[ATTR1:[0-9]+]] {
; CGSCC-NEXT: [[A:%.*]] = call noundef i32 @defined()
; CGSCC-NEXT: [[A:%.*]] = call noundef i32 @defined() #[[ATTR5:[0-9]+]]
; CGSCC-NEXT: ret i32 [[A]]
;
%a = call i32 @defined()
Expand Down Expand Up @@ -94,13 +94,13 @@ define void @calls_intrinsic(i8* %dest, i8* %src, i64 %size) convergent {
; TUNIT: Function Attrs: convergent mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@calls_intrinsic
; TUNIT-SAME: (ptr nocapture nofree writeonly [[DEST:%.*]], ptr nocapture nofree readonly [[SRC:%.*]], i64 [[SIZE:%.*]]) #[[ATTR2:[0-9]+]] {
; TUNIT-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture nofree writeonly [[DEST]], ptr noalias nocapture nofree readonly [[SRC]], i64 [[SIZE]], i1 noundef false)
; TUNIT-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture nofree writeonly [[DEST]], ptr noalias nocapture nofree readonly [[SRC]], i64 [[SIZE]], i1 noundef false) #[[ATTR4:[0-9]+]]
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: convergent mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@calls_intrinsic
; CGSCC-SAME: (ptr nocapture nofree writeonly [[DEST:%.*]], ptr nocapture nofree readonly [[SRC:%.*]], i64 [[SIZE:%.*]]) #[[ATTR3:[0-9]+]] {
; CGSCC-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture nofree writeonly [[DEST]], ptr noalias nocapture nofree readonly [[SRC]], i64 [[SIZE]], i1 noundef false)
; CGSCC-NEXT: call void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture nofree writeonly [[DEST]], ptr noalias nocapture nofree readonly [[SRC]], i64 [[SIZE]], i1 noundef false) #[[ATTR5]]
; CGSCC-NEXT: ret void
;
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dest, i8* %src, i64 %size, i1 false)
Expand All @@ -111,10 +111,12 @@ define void @calls_intrinsic(i8* %dest, i8* %src, i64 %size) convergent {
; TUNIT: attributes #[[ATTR1]] = { convergent }
; TUNIT: attributes #[[ATTR2]] = { convergent mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
; TUNIT: attributes #[[ATTR3:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
; TUNIT: attributes #[[ATTR4]] = { nofree willreturn }
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { convergent mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { convergent }
; CGSCC: attributes #[[ATTR3]] = { convergent mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR4:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
; CGSCC: attributes #[[ATTR5]] = { nofree willreturn }
;.
92 changes: 47 additions & 45 deletions llvm/test/Transforms/Attributor/dereferenceable-1.ll

Large diffs are not rendered by default.

17 changes: 10 additions & 7 deletions llvm/test/Transforms/Attributor/internal-noalias.ll
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ define private i32 @noalias_args(ptr %A, ptr %B) #0 {
; CGSCC-NEXT: [[TMP0:%.*]] = load i32, ptr [[A]], align 4
; CGSCC-NEXT: [[TMP1:%.*]] = load i32, ptr [[B]], align 4
; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[TMP0]], [[TMP1]]
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5]]
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR6:[0-9]+]]
; CGSCC-NEXT: [[ADD2:%.*]] = add nsw i32 [[ADD]], [[CALL]]
; CGSCC-NEXT: ret i32 [[ADD2]]
;
Expand Down Expand Up @@ -106,7 +106,7 @@ define dso_local i32 @visible_local(ptr %A) #0 {
; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4
; CGSCC-NEXT: store i32 5, ptr [[B]], align 4
; CGSCC-NEXT: [[CALL1:%.*]] = call i32 @noalias_args(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR5]]
; CGSCC-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]])
; CGSCC-NEXT: [[CALL2:%.*]] = call i32 @noalias_args_argmem(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[A]], ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[B]]) #[[ATTR7:[0-9]+]]
; CGSCC-NEXT: [[ADD:%.*]] = add nsw i32 [[CALL1]], [[CALL2]]
; CGSCC-NEXT: ret i32 [[ADD]]
;
Expand Down Expand Up @@ -148,7 +148,7 @@ define i32 @visible_local_2() {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@visible_local_2
; CGSCC-SAME: () #[[ATTR3:[0-9]+]] {
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 noundef 5, i32 noundef 5) #[[ATTR5]]
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_ro(i32 noundef 5, i32 noundef 5) #[[ATTR8:[0-9]+]]
; CGSCC-NEXT: ret i32 [[CALL]]
;
%B = alloca i32, align 4
Expand Down Expand Up @@ -188,7 +188,7 @@ define i32 @visible_local_3() {
; CGSCC-SAME: () #[[ATTR3]] {
; CGSCC-NEXT: [[B:%.*]] = alloca i32, align 4
; CGSCC-NEXT: store i32 5, ptr [[B]], align 4
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR6:[0-9]+]]
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @noalias_args_argmem_rn(ptr noalias nocapture nofree noundef nonnull align 4 dereferenceable(4) [[B]]) #[[ATTR9:[0-9]+]]
; CGSCC-NEXT: ret i32 [[CALL]]
;
%B = alloca i32, align 4
Expand All @@ -205,15 +205,18 @@ attributes #1 = { argmemonly noinline nounwind uwtable willreturn}
; TUNIT: attributes #[[ATTR2]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; TUNIT: attributes #[[ATTR3]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: write) uwtable }
; TUNIT: attributes #[[ATTR4]] = { nofree nosync nounwind memory(read) }
; TUNIT: attributes #[[ATTR5]] = { nofree nosync nounwind memory(write) }
; TUNIT: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn memory(write) }
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree noinline nosync nounwind willreturn memory(argmem: read) uwtable }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: read) uwtable }
; CGSCC: attributes #[[ATTR2]] = { mustprogress nofree noinline nosync nounwind willreturn memory(argmem: readwrite) uwtable }
; CGSCC: attributes #[[ATTR3]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR4]] = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable }
; CGSCC: attributes #[[ATTR5]] = { memory(read) }
; CGSCC: attributes #[[ATTR6]] = { nounwind }
; CGSCC: attributes #[[ATTR5]] = { nofree memory(read) }
; CGSCC: attributes #[[ATTR6]] = { nofree nounwind memory(read) }
; CGSCC: attributes #[[ATTR7]] = { nofree }
; CGSCC: attributes #[[ATTR8]] = { nofree willreturn memory(read) }
; CGSCC: attributes #[[ATTR9]] = { nofree nounwind willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
475 changes: 268 additions & 207 deletions llvm/test/Transforms/Attributor/liveness.ll

Large diffs are not rendered by default.

163 changes: 57 additions & 106 deletions llvm/test/Transforms/Attributor/memory_locations.ll
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ define dso_local ptr @internal_only(i32 %arg) {
; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR0:[0-9]+]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; CHECK-NEXT: [[CALL:%.*]] = call ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: ret ptr [[CALL]]
;
entry:
Expand All @@ -39,7 +39,7 @@ define dso_local ptr @internal_only_rec(i32 %arg) {
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.end:
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; CHECK-NEXT: [[CALL1:%.*]] = call ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: [[CALL1:%.*]] = call noalias ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
; CHECK-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL]], [[IF_THEN]] ], [ [[CALL1]], [[IF_END]] ]
Expand All @@ -66,63 +66,37 @@ return: ; preds = %if.end, %if.then
}

define dso_local ptr @internal_only_rec_static_helper(i32 %arg) {
; TUNIT: Function Attrs: memory(inaccessiblemem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@internal_only_rec_static_helper
; TUNIT-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec_static(i32 [[ARG]])
; TUNIT-NEXT: ret ptr [[CALL]]
;
; CGSCC: Function Attrs: memory(inaccessiblemem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@internal_only_rec_static_helper
; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_only_rec_static(i32 [[ARG]])
; CGSCC-NEXT: ret ptr [[CALL]]
; CHECK: Function Attrs: memory(inaccessiblemem: readwrite)
; CHECK-LABEL: define {{[^@]+}}@internal_only_rec_static_helper
; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec_static(i32 [[ARG]])
; CHECK-NEXT: ret ptr [[CALL]]
;
entry:
%call = call ptr @internal_only_rec_static(i32 %arg)
ret ptr %call
}

define internal ptr @internal_only_rec_static(i32 %arg) {
; TUNIT: Function Attrs: memory(inaccessiblemem: readwrite)
; TUNIT-LABEL: define {{[^@]+}}@internal_only_rec_static
; TUNIT-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2
; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1
; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; TUNIT: if.then:
; TUNIT-NEXT: [[DIV:%.*]] = sdiv i32 [[ARG]], 2
; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec(i32 [[DIV]])
; TUNIT-NEXT: br label [[RETURN:%.*]]
; TUNIT: if.end:
; TUNIT-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; TUNIT-NEXT: [[CALL1:%.*]] = call ptr @malloc(i64 [[CONV]])
; TUNIT-NEXT: br label [[RETURN]]
; TUNIT: return:
; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL]], [[IF_THEN]] ], [ [[CALL1]], [[IF_END]] ]
; TUNIT-NEXT: ret ptr [[RETVAL_0]]
;
; CGSCC: Function Attrs: memory(inaccessiblemem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@internal_only_rec_static
; CGSCC-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2
; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1
; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CGSCC: if.then:
; CGSCC-NEXT: [[DIV:%.*]] = sdiv i32 [[ARG]], 2
; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_only_rec(i32 [[DIV]])
; CGSCC-NEXT: br label [[RETURN:%.*]]
; CGSCC: if.end:
; CGSCC-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; CGSCC-NEXT: [[CALL1:%.*]] = call ptr @malloc(i64 [[CONV]])
; CGSCC-NEXT: br label [[RETURN]]
; CGSCC: return:
; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL]], [[IF_THEN]] ], [ [[CALL1]], [[IF_END]] ]
; CGSCC-NEXT: ret ptr [[RETVAL_0]]
; CHECK: Function Attrs: memory(inaccessiblemem: readwrite)
; CHECK-LABEL: define {{[^@]+}}@internal_only_rec_static
; CHECK-SAME: (i32 [[ARG:%.*]]) #[[ATTR0]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[ARG]], 2
; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec(i32 [[DIV]])
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.end:
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; CHECK-NEXT: [[CALL1:%.*]] = call noalias ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
; CHECK-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL]], [[IF_THEN]] ], [ [[CALL1]], [[IF_END]] ]
; CHECK-NEXT: ret ptr [[RETVAL_0]]
;
entry:
%rem = srem i32 %arg, 2
Expand All @@ -146,17 +120,11 @@ return: ; preds = %if.end, %if.then

define dso_local ptr @internal_only_rec_static_helper_malloc_noescape(i32 %arg) {
; FIXME: This is actually inaccessiblememonly because the malloced memory does not escape
; TUNIT-LABEL: define {{[^@]+}}@internal_only_rec_static_helper_malloc_noescape
; TUNIT-SAME: (i32 [[ARG:%.*]]) {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec_static_malloc_noescape(i32 [[ARG]])
; TUNIT-NEXT: ret ptr [[CALL]]
;
; CGSCC-LABEL: define {{[^@]+}}@internal_only_rec_static_helper_malloc_noescape
; CGSCC-SAME: (i32 [[ARG:%.*]]) {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_only_rec_static_malloc_noescape(i32 [[ARG]])
; CGSCC-NEXT: ret ptr [[CALL]]
; CHECK-LABEL: define {{[^@]+}}@internal_only_rec_static_helper_malloc_noescape
; CHECK-SAME: (i32 [[ARG:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec_static_malloc_noescape(i32 [[ARG]])
; CHECK-NEXT: ret ptr [[CALL]]
;
entry:
%call = call ptr @internal_only_rec_static_malloc_noescape(i32 %arg)
Expand All @@ -165,41 +133,23 @@ entry:

define internal ptr @internal_only_rec_static_malloc_noescape(i32 %arg) {
; FIXME: This is actually inaccessiblememonly because the malloced memory does not escape
; TUNIT-LABEL: define {{[^@]+}}@internal_only_rec_static_malloc_noescape
; TUNIT-SAME: (i32 [[ARG:%.*]]) {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2
; TUNIT-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1
; TUNIT-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; TUNIT: if.then:
; TUNIT-NEXT: [[DIV:%.*]] = sdiv i32 [[ARG]], 2
; TUNIT-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec(i32 [[DIV]])
; TUNIT-NEXT: br label [[RETURN:%.*]]
; TUNIT: if.end:
; TUNIT-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; TUNIT-NEXT: [[CALL1:%.*]] = call noalias ptr @malloc(i64 [[CONV]])
; TUNIT-NEXT: br label [[RETURN]]
; TUNIT: return:
; TUNIT-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL]], [[IF_THEN]] ], [ null, [[IF_END]] ]
; TUNIT-NEXT: ret ptr [[RETVAL_0]]
;
; CGSCC-LABEL: define {{[^@]+}}@internal_only_rec_static_malloc_noescape
; CGSCC-SAME: (i32 [[ARG:%.*]]) {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2
; CGSCC-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1
; CGSCC-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CGSCC: if.then:
; CGSCC-NEXT: [[DIV:%.*]] = sdiv i32 [[ARG]], 2
; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_only_rec(i32 [[DIV]])
; CGSCC-NEXT: br label [[RETURN:%.*]]
; CGSCC: if.end:
; CGSCC-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; CGSCC-NEXT: [[CALL1:%.*]] = call noalias ptr @malloc(i64 [[CONV]])
; CGSCC-NEXT: br label [[RETURN]]
; CGSCC: return:
; CGSCC-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL]], [[IF_THEN]] ], [ null, [[IF_END]] ]
; CGSCC-NEXT: ret ptr [[RETVAL_0]]
; CHECK-LABEL: define {{[^@]+}}@internal_only_rec_static_malloc_noescape
; CHECK-SAME: (i32 [[ARG:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[REM:%.*]] = srem i32 [[ARG]], 2
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[REM]], 1
; CHECK-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[DIV:%.*]] = sdiv i32 [[ARG]], 2
; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @internal_only_rec(i32 [[DIV]])
; CHECK-NEXT: br label [[RETURN:%.*]]
; CHECK: if.end:
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[ARG]] to i64
; CHECK-NEXT: [[CALL1:%.*]] = call noalias ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
; CHECK-NEXT: [[RETVAL_0:%.*]] = phi ptr [ [[CALL]], [[IF_THEN]] ], [ null, [[IF_END]] ]
; CHECK-NEXT: ret ptr [[RETVAL_0]]
;
entry:
%rem = srem i32 %arg, 2
Expand Down Expand Up @@ -229,7 +179,7 @@ define dso_local ptr @internal_argmem_only_read(ptr %arg) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP:%.*]] = load i32, ptr [[ARG]], align 4
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP]] to i64
; CHECK-NEXT: [[CALL:%.*]] = call ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: [[CALL:%.*]] = call noalias ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: ret ptr [[CALL]]
;
entry:
Expand All @@ -245,7 +195,7 @@ define dso_local ptr @internal_argmem_only_write(ptr %arg) {
; CHECK-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: store i32 10, ptr [[ARG]], align 4
; CHECK-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @malloc(i64 noundef 10)
; CHECK-NEXT: [[CALL:%.*]] = call noalias dereferenceable_or_null(10) ptr @malloc(i64 noundef 10)
; CHECK-NEXT: ret ptr [[CALL]]
;
entry:
Expand All @@ -266,7 +216,7 @@ define dso_local ptr @internal_argmem_only_rec(ptr %arg) {
; CGSCC-LABEL: define {{[^@]+}}@internal_argmem_only_rec
; CGSCC-SAME: (ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG:%.*]]) #[[ATTR1]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[CALL:%.*]] = call ptr @internal_argmem_only_rec_1(ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG]])
; CGSCC-NEXT: [[CALL:%.*]] = call noalias ptr @internal_argmem_only_rec_1(ptr nocapture nofree noundef nonnull align 4 dereferenceable(4) [[ARG]])
; CGSCC-NEXT: ret ptr [[CALL]]
;
entry:
Expand Down Expand Up @@ -295,7 +245,7 @@ define internal ptr @internal_argmem_only_rec_1(ptr %arg) {
; CHECK: if.end3:
; CHECK-NEXT: [[TMP2:%.*]] = load i32, ptr [[ARG]], align 4
; CHECK-NEXT: [[CONV:%.*]] = sext i32 [[TMP2]] to i64
; CHECK-NEXT: [[CALL4:%.*]] = call ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: [[CALL4:%.*]] = call noalias ptr @malloc(i64 [[CONV]])
; CHECK-NEXT: br label [[RETURN]]
; CHECK: return:
; CHECK-NEXT: [[RETVAL_0:%.*]] = phi ptr [ null, [[IF_THEN]] ], [ [[CALL]], [[IF_THEN2]] ], [ [[CALL4]], [[IF_END3]] ]
Expand Down Expand Up @@ -614,7 +564,7 @@ define i8 @readnone_caller(i1 %c) {
; CGSCC-LABEL: define {{[^@]+}}@readnone_caller
; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10:[0-9]+]] {
; CGSCC-NEXT: [[A:%.*]] = alloca i8, align 1
; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 noundef [[C]]) #[[ATTR12]]
; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[A]], i1 noundef [[C]]) #[[ATTR14:[0-9]+]]
; CGSCC-NEXT: ret i8 [[R]]
;
%a = alloca i8
Expand Down Expand Up @@ -668,7 +618,7 @@ define i8 @readnone_caller2(i1 %c) {
; CGSCC: Function Attrs: nofree nosync nounwind memory(none)
; CGSCC-LABEL: define {{[^@]+}}@readnone_caller2
; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10]] {
; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(ptr undef, i1 noundef [[C]]) #[[ATTR12]]
; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_readnone_internal2(ptr undef, i1 noundef [[C]]) #[[ATTR14]]
; CGSCC-NEXT: ret i8 [[R]]
;
%r = call i8 @recursive_readnone_internal2(ptr undef, i1 %c)
Expand Down Expand Up @@ -723,7 +673,7 @@ define i8 @readnone_caller3(i1 %c) {
; CGSCC-LABEL: define {{[^@]+}}@readnone_caller3
; CGSCC-SAME: (i1 noundef [[C:%.*]]) #[[ATTR10]] {
; CGSCC-NEXT: [[ALLOC:%.*]] = alloca i8, align 1
; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef [[C]]) #[[ATTR12]]
; CGSCC-NEXT: [[R:%.*]] = call i8 @recursive_not_readnone_internal3(ptr noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[ALLOC]], i1 noundef [[C]]) #[[ATTR14]]
; CGSCC-NEXT: ret i8 [[R]]
;
%alloc = alloca i8
Expand Down Expand Up @@ -819,6 +769,7 @@ f:
; CGSCC: attributes #[[ATTR9]] = { nofree nosync nounwind memory(argmem: write) }
; CGSCC: attributes #[[ATTR10]] = { nofree nosync nounwind memory(none) }
; CGSCC: attributes #[[ATTR11]] = { nosync memory(argmem: write) }
; CGSCC: attributes #[[ATTR12]] = { nounwind memory(write) }
; CGSCC: attributes #[[ATTR12]] = { nofree nounwind willreturn memory(write) }
; CGSCC: attributes #[[ATTR13]] = { nofree nosync nounwind memory(write) }
; CGSCC: attributes #[[ATTR14]] = { nofree nounwind memory(write) }
;.
2 changes: 1 addition & 1 deletion llvm/test/Transforms/Attributor/misc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ declare void @callback2(ptr)
; TUNIT: attributes #[[ATTR1]] = { nofree nosync nounwind willreturn memory(write) }
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
; CGSCC: attributes #[[ATTR1]] = { nounwind memory(write) }
; CGSCC: attributes #[[ATTR1]] = { nofree nounwind willreturn memory(write) }
;.
66 changes: 39 additions & 27 deletions llvm/test/Transforms/Attributor/noalias.ll
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ define ptr @calle1(){
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
; CGSCC-LABEL: define {{[^@]+}}@calle1
; CGSCC-SAME: () #[[ATTR2:[0-9]+]] {
; CGSCC-NEXT: [[TMP1:%.*]] = call noundef nonnull align 8 dereferenceable(8) ptr @getter()
; CGSCC-NEXT: [[TMP1:%.*]] = call noundef nonnull align 8 dereferenceable(8) ptr @getter() #[[ATTR11:[0-9]+]]
; CGSCC-NEXT: ret ptr [[TMP1]]
;
%1 = call ptr @getter()
Expand Down Expand Up @@ -528,9 +528,9 @@ define i32 @i2p(ptr %arg) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read)
; CGSCC-LABEL: define {{[^@]+}}@i2p
; CGSCC-SAME: (ptr nofree readonly [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
; CGSCC-NEXT: [[C:%.*]] = call i32 @p2i(ptr noalias nofree readnone [[ARG]])
; CGSCC-NEXT: [[C:%.*]] = call i32 @p2i(ptr noalias nofree readnone [[ARG]]) #[[ATTR11]]
; CGSCC-NEXT: [[I2P:%.*]] = inttoptr i32 [[C]] to ptr
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[I2P]]) #[[ATTR11:[0-9]+]]
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @ret(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[I2P]]) #[[ATTR12:[0-9]+]]
; CGSCC-NEXT: ret i32 [[CALL]]
;
%c = call i32 @p2i(ptr %arg)
Expand Down Expand Up @@ -565,16 +565,27 @@ define internal i32 @ret(ptr %arg) {

; Function Attrs: nounwind optsize
define internal fastcc double @strtox(ptr %s, ptr %p, i32 %prec) unnamed_addr {
; CHECK-LABEL: define {{[^@]+}}@strtox
; CHECK-SAME: (ptr [[S:%.*]]) unnamed_addr {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR12:[0-9]+]]
; CHECK-NEXT: [[CALL:%.*]] = call i32 @sh_fromstring(ptr noundef nonnull align 8 dereferenceable(240) [[F]], ptr [[S]])
; CHECK-NEXT: call void @__shlim(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0)
; CHECK-NEXT: [[CALL1:%.*]] = call double @__floatscan(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1)
; CHECK-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]])
; CHECK-NEXT: ret double [[CALL1]]
; TUNIT-LABEL: define {{[^@]+}}@strtox
; TUNIT-SAME: (ptr [[S:%.*]]) unnamed_addr {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8
; TUNIT-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR12:[0-9]+]]
; TUNIT-NEXT: [[CALL:%.*]] = call i32 @sh_fromstring(ptr noundef nonnull align 8 dereferenceable(240) [[F]], ptr [[S]])
; TUNIT-NEXT: call void @__shlim(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0)
; TUNIT-NEXT: [[CALL1:%.*]] = call double @__floatscan(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1)
; TUNIT-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]])
; TUNIT-NEXT: ret double [[CALL1]]
;
; CGSCC-LABEL: define {{[^@]+}}@strtox
; CGSCC-SAME: (ptr [[S:%.*]]) unnamed_addr {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[F:%.*]] = alloca [[STRUCT__IO_FILE:%.*]], align 8
; CGSCC-NEXT: call void @llvm.lifetime.start.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]]) #[[ATTR13:[0-9]+]]
; CGSCC-NEXT: [[CALL:%.*]] = call i32 @sh_fromstring(ptr noundef nonnull align 8 dereferenceable(240) [[F]], ptr [[S]])
; CGSCC-NEXT: call void @__shlim(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i64 noundef 0)
; CGSCC-NEXT: [[CALL1:%.*]] = call double @__floatscan(ptr noundef nonnull align 8 dereferenceable(240) [[F]], i32 noundef 1, i32 noundef 1)
; CGSCC-NEXT: call void @llvm.lifetime.end.p0(i64 noundef 144, ptr nocapture nofree noundef nonnull align 8 dereferenceable(240) [[F]])
; CGSCC-NEXT: ret double [[CALL1]]
;
entry:
%f = alloca %struct._IO_FILE, align 8
Expand Down Expand Up @@ -673,10 +684,10 @@ define void @test15_caller(ptr noalias %p, i32 %c) {
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CGSCC: if.then:
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]]
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14:[0-9]+]]
; CGSCC-NEXT: br label [[IF_END]]
; CGSCC: if.end:
; CGSCC-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR14]]
; CGSCC-NEXT: ret void
;
%tobool = icmp eq i32 %c, 0
Expand Down Expand Up @@ -736,14 +747,14 @@ define internal void @test16_sub(ptr noalias %p, i32 %c1, i32 %c2) {
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C1]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_END:%.*]], label [[IF_THEN:%.*]]
; CGSCC: if.then:
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @make_alias(ptr nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]]
; CGSCC-NEXT: tail call void @make_alias(ptr nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]]
; CGSCC-NEXT: br label [[IF_END]]
; CGSCC: if.end:
; CGSCC-NEXT: [[TOBOOL1:%.*]] = icmp eq i32 [[C2]], 0
; CGSCC-NEXT: br i1 [[TOBOOL1]], label [[IF_THEN2:%.*]], label [[IF_END3:%.*]]
; CGSCC: if.then2:
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]]
; CGSCC-NEXT: br label [[IF_END3]]
; CGSCC: if.end3:
; CGSCC-NEXT: ret void
Expand Down Expand Up @@ -778,7 +789,7 @@ define void @test16_caller(ptr %p, i32 %c) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(write)
; CGSCC-LABEL: define {{[^@]+}}@test16_caller
; CGSCC-SAME: (ptr nofree writeonly [[P:%.*]], i32 [[C:%.*]]) #[[ATTR10]] {
; CGSCC-NEXT: tail call void @test16_sub(ptr noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @test16_sub(ptr noalias nofree writeonly [[P]], i32 [[C]], i32 [[C]]) #[[ATTR14]]
; CGSCC-NEXT: ret void
;
tail call void @test16_sub(ptr %p, i32 %c, i32 %c)
Expand Down Expand Up @@ -827,10 +838,10 @@ define void @test17_caller(ptr noalias %p, i32 %c) {
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]]
; CGSCC: l1:
; CGSCC-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @make_alias(ptr nofree writeonly [[P]]) #[[ATTR14]]
; CGSCC-NEXT: br label [[L3:%.*]]
; CGSCC: l2:
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]]
; CGSCC-NEXT: br label [[L3]]
; CGSCC: l3:
; CGSCC-NEXT: ret void
Expand Down Expand Up @@ -898,10 +909,10 @@ define void @test18_caller(ptr noalias %p, i32 %c) {
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[C]], 0
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[L1:%.*]], label [[L2:%.*]]
; CGSCC: l1:
; CGSCC-NEXT: tail call void @make_alias(ptr nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @make_alias(ptr nofree nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]]
; CGSCC-NEXT: br label [[L2]]
; CGSCC: l2:
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR13]]
; CGSCC-NEXT: tail call void @only_store(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[P]]) #[[ATTR14]]
; CGSCC-NEXT: ret void
;
entry:
Expand Down Expand Up @@ -930,7 +941,7 @@ l2:
; TUNIT: attributes #[[ATTR9]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; TUNIT: attributes #[[ATTR10]] = { nofree nosync nounwind willreturn memory(none) }
; TUNIT: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn memory(read) }
; TUNIT: attributes #[[ATTR12]] = { memory(readwrite) }
; TUNIT: attributes #[[ATTR12]] = { nofree willreturn memory(readwrite) }
; TUNIT: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn memory(write) }
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
Expand All @@ -944,7 +955,8 @@ l2:
; CGSCC: attributes #[[ATTR8]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) }
; CGSCC: attributes #[[ATTR9]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) }
; CGSCC: attributes #[[ATTR10]] = { mustprogress nofree nosync nounwind willreturn memory(write) }
; CGSCC: attributes #[[ATTR11]] = { memory(read) }
; CGSCC: attributes #[[ATTR12]] = { memory(readwrite) }
; CGSCC: attributes #[[ATTR13]] = { nounwind memory(write) }
; CGSCC: attributes #[[ATTR11]] = { nofree willreturn }
; CGSCC: attributes #[[ATTR12]] = { nofree willreturn memory(read) }
; CGSCC: attributes #[[ATTR13]] = { nofree willreturn memory(readwrite) }
; CGSCC: attributes #[[ATTR14]] = { nofree nounwind willreturn memory(write) }
;.
25 changes: 14 additions & 11 deletions llvm/test/Transforms/Attributor/nocapture-1.ll
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ define i1 @c7(ptr %q, i32 %bitno) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn memory(read)
; CGSCC-LABEL: define {{[^@]+}}@c7
; CGSCC-SAME: (ptr nofree readonly [[Q:%.*]], i32 [[BITNO:%.*]]) #[[ATTR5:[0-9]+]] {
; CGSCC-NEXT: [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]])
; CGSCC-NEXT: [[PTR:%.*]] = call ptr @lookup_bit(ptr noalias nofree readnone [[Q]], i32 [[BITNO]]) #[[ATTR18:[0-9]+]]
; CGSCC-NEXT: [[VAL:%.*]] = load i1, ptr [[PTR]], align 1
; CGSCC-NEXT: ret i1 [[VAL]]
;
Expand Down Expand Up @@ -299,7 +299,7 @@ define void @nc2(ptr %p, ptr %q) {
; CGSCC: Function Attrs: mustprogress nofree nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@nc2
; CGSCC-SAME: (ptr nocapture nofree align 4 [[P:%.*]], ptr nofree [[Q:%.*]]) #[[ATTR7:[0-9]+]] {
; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nocapture nofree align 4 [[P]], i1 noundef false) #[[ATTR18:[0-9]+]]
; CGSCC-NEXT: [[TMP1:%.*]] = call i32 @nc1(ptr nofree [[Q]], ptr nocapture nofree align 4 [[P]], i1 noundef false) #[[ATTR19:[0-9]+]]
; CGSCC-NEXT: ret void
;
%1 = call i32 @nc1(ptr %q, ptr %p, i1 0) ; <i32> [#uses=0]
Expand Down Expand Up @@ -330,7 +330,7 @@ define void @nc4(ptr %p) {
; CGSCC: Function Attrs: nounwind memory(argmem: readwrite)
; CGSCC-LABEL: define {{[^@]+}}@nc4
; CGSCC-SAME: (ptr [[P:%.*]]) #[[ATTR8:[0-9]+]] {
; CGSCC-NEXT: call void @external(ptr readonly [[P]]) #[[ATTR18]]
; CGSCC-NEXT: call void @external(ptr readonly [[P]]) #[[ATTR20:[0-9]+]]
; CGSCC-NEXT: ret void
;
call void @external(ptr %p)
Expand Down Expand Up @@ -600,15 +600,15 @@ define void @nocaptureLaunder(ptr %p) {
; TUNIT-LABEL: define {{[^@]+}}@nocaptureLaunder
; TUNIT-SAME: (ptr nocapture nofree [[P:%.*]]) #[[ATTR4]] {
; TUNIT-NEXT: entry:
; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]])
; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR18:[0-9]+]]
; TUNIT-NEXT: store i8 42, ptr [[B]], align 1
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@nocaptureLaunder
; CGSCC-SAME: (ptr nocapture nofree [[P:%.*]]) #[[ATTR6]] {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]])
; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR18]]
; CGSCC-NEXT: store i8 42, ptr [[B]], align 1
; CGSCC-NEXT: ret void
;
Expand All @@ -623,14 +623,14 @@ define void @captureLaunder(ptr %p) {
; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
; TUNIT-LABEL: define {{[^@]+}}@captureLaunder
; TUNIT-SAME: (ptr nofree [[P:%.*]]) #[[ATTR4]] {
; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]])
; TUNIT-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR18]]
; TUNIT-NEXT: store ptr [[B]], ptr @g2, align 8
; TUNIT-NEXT: ret void
;
; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn
; CGSCC-LABEL: define {{[^@]+}}@captureLaunder
; CGSCC-SAME: (ptr nofree [[P:%.*]]) #[[ATTR6]] {
; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]])
; CGSCC-NEXT: [[B:%.*]] = call ptr @llvm.launder.invariant.group.p0(ptr nofree [[P]]) #[[ATTR18]]
; CGSCC-NEXT: store ptr [[B]], ptr @g2, align 8
; CGSCC-NEXT: ret void
;
Expand All @@ -644,7 +644,7 @@ define void @nocaptureStrip(ptr %p) {
; CHECK-LABEL: define {{[^@]+}}@nocaptureStrip
; CHECK-SAME: (ptr nocapture nofree writeonly [[P:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]])
; CHECK-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR18:[0-9]+]]
; CHECK-NEXT: store i8 42, ptr [[B]], align 1
; CHECK-NEXT: ret void
;
Expand All @@ -659,7 +659,7 @@ define void @captureStrip(ptr %p) {
; CHECK: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
; CHECK-LABEL: define {{[^@]+}}@captureStrip
; CHECK-SAME: (ptr nofree writeonly [[P:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]])
; CHECK-NEXT: [[B:%.*]] = call ptr @llvm.strip.invariant.group.p0(ptr noalias nofree readnone [[P]]) #[[ATTR18]]
; CHECK-NEXT: store ptr [[B]], ptr @g3, align 8
; CHECK-NEXT: ret void
;
Expand Down Expand Up @@ -840,6 +840,7 @@ declare ptr @llvm.strip.invariant.group.p0(ptr)
; TUNIT: attributes #[[ATTR15]] = { nofree nounwind willreturn memory(none) }
; TUNIT: attributes #[[ATTR16]] = { nofree nosync nounwind willreturn }
; TUNIT: attributes #[[ATTR17]] = { nounwind }
; TUNIT: attributes #[[ATTR18]] = { nofree willreturn }
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(write) }
Expand All @@ -858,6 +859,8 @@ declare ptr @llvm.strip.invariant.group.p0(ptr)
; CGSCC: attributes #[[ATTR14]] = { mustprogress nounwind willreturn }
; CGSCC: attributes #[[ATTR15:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(inaccessiblemem: readwrite) }
; CGSCC: attributes #[[ATTR16:[0-9]+]] = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
; CGSCC: attributes #[[ATTR17]] = { nounwind memory(write) }
; CGSCC: attributes #[[ATTR18]] = { nounwind }
; CGSCC: attributes #[[ATTR17]] = { nofree nounwind willreturn memory(write) }
; CGSCC: attributes #[[ATTR18]] = { nofree willreturn }
; CGSCC: attributes #[[ATTR19]] = { nofree nounwind willreturn }
; CGSCC: attributes #[[ATTR20]] = { nounwind }
;.
2 changes: 1 addition & 1 deletion llvm/test/Transforms/Attributor/nocapture-2.ll
Original file line number Diff line number Diff line change
Expand Up @@ -786,5 +786,5 @@ attributes #0 = { noinline nounwind uwtable }
; CGSCC: attributes #[[ATTR7]] = { memory(read) }
; CGSCC: attributes #[[ATTR8]] = { noinline nounwind memory(read) uwtable }
; CGSCC: attributes #[[ATTR9]] = { nounwind memory(read) }
; CGSCC: attributes #[[ATTR10]] = { nounwind memory(write) }
; CGSCC: attributes #[[ATTR10]] = { nofree nounwind willreturn memory(write) }
;.
3 changes: 2 additions & 1 deletion llvm/test/Transforms/Attributor/nodelete.ll
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ define hidden i64 @f1() align 2 {
; CGSCC-SAME: () #[[ATTR0:[0-9]+]] align 2 {
; CGSCC-NEXT: entry:
; CGSCC-NEXT: [[REF_TMP:%.*]] = alloca [[A:%.*]], align 8
; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @f2()
; CGSCC-NEXT: [[CALL2:%.*]] = call i64 @f2() #[[ATTR2:[0-9]+]]
; CGSCC-NEXT: ret i64 [[CALL2]]
;
entry:
Expand Down Expand Up @@ -89,6 +89,7 @@ entry:
;.
; CGSCC: attributes #[[ATTR0]] = { mustprogress nofree nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR1]] = { mustprogress nofree norecurse nosync nounwind willreturn memory(none) }
; CGSCC: attributes #[[ATTR2]] = { nofree willreturn }
;.
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; CHECK: {{.*}}
22 changes: 11 additions & 11 deletions llvm/test/Transforms/Attributor/nofpclass-arithmetic-fence.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare float @llvm.arithmetic.fence.f32(float)
define float @ret_arithmetic.fence(float %arg0) {
; CHECK-LABEL: define float @ret_arithmetic.fence
; CHECK-SAME: (float [[ARG0:%.*]]) #[[ATTR1:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2:[0-9]+]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -16,7 +16,7 @@ define float @ret_arithmetic.fence(float %arg0) {
define float @ret_arithmetic.fence_noinf(float nofpclass(inf) %arg0) {
; CHECK-LABEL: define nofpclass(inf) float @ret_arithmetic.fence_noinf
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(inf) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(inf) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -26,7 +26,7 @@ define float @ret_arithmetic.fence_noinf(float nofpclass(inf) %arg0) {
define float @ret_arithmetic.fence_nopinf(float nofpclass(pinf) %arg0) {
; CHECK-LABEL: define nofpclass(pinf) float @ret_arithmetic.fence_nopinf
; CHECK-SAME: (float nofpclass(pinf) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(pinf) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(pinf) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -36,7 +36,7 @@ define float @ret_arithmetic.fence_nopinf(float nofpclass(pinf) %arg0) {
define float @ret_arithmetic.fence_noninf(float nofpclass(ninf) %arg0) {
; CHECK-LABEL: define nofpclass(ninf) float @ret_arithmetic.fence_noninf
; CHECK-SAME: (float nofpclass(ninf) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -46,7 +46,7 @@ define float @ret_arithmetic.fence_noninf(float nofpclass(ninf) %arg0) {
define float @ret_arithmetic.fence_nonan(float nofpclass(nan) %arg0) {
; CHECK-LABEL: define nofpclass(nan) float @ret_arithmetic.fence_nonan
; CHECK-SAME: (float nofpclass(nan) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -56,7 +56,7 @@ define float @ret_arithmetic.fence_nonan(float nofpclass(nan) %arg0) {
define float @ret_arithmetic.fence_noqnan(float nofpclass(qnan) %arg0) {
; CHECK-LABEL: define nofpclass(qnan) float @ret_arithmetic.fence_noqnan
; CHECK-SAME: (float nofpclass(qnan) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(qnan) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(qnan) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -66,7 +66,7 @@ define float @ret_arithmetic.fence_noqnan(float nofpclass(qnan) %arg0) {
define float @ret_arithmetic.fence_nosnan(float nofpclass(snan) %arg0) {
; CHECK-LABEL: define nofpclass(snan) float @ret_arithmetic.fence_nosnan
; CHECK-SAME: (float nofpclass(snan) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -76,7 +76,7 @@ define float @ret_arithmetic.fence_nosnan(float nofpclass(snan) %arg0) {
define float @ret_arithmetic.fence_nozero(float nofpclass(zero) %arg0) {
; CHECK-LABEL: define nofpclass(zero) float @ret_arithmetic.fence_nozero
; CHECK-SAME: (float nofpclass(zero) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(zero) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(zero) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -86,7 +86,7 @@ define float @ret_arithmetic.fence_nozero(float nofpclass(zero) %arg0) {
define float @ret_arithmetic.fence_nopzero(float nofpclass(pzero) %arg0) {
; CHECK-LABEL: define nofpclass(pzero) float @ret_arithmetic.fence_nopzero
; CHECK-SAME: (float nofpclass(pzero) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(pzero) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(pzero) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -96,7 +96,7 @@ define float @ret_arithmetic.fence_nopzero(float nofpclass(pzero) %arg0) {
define float @ret_arithmetic.fence_nonzero(float nofpclass(nzero) %arg0) {
; CHECK-LABEL: define nofpclass(nzero) float @ret_arithmetic.fence_nonzero
; CHECK-SAME: (float nofpclass(nzero) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nzero) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nzero) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand All @@ -106,7 +106,7 @@ define float @ret_arithmetic.fence_nonzero(float nofpclass(nzero) %arg0) {
define float @ret_arithmetic.fence_nonorm(float nofpclass(norm) %arg0) {
; CHECK-LABEL: define nofpclass(norm) float @ret_arithmetic.fence_nonorm
; CHECK-SAME: (float nofpclass(norm) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(norm) float @llvm.arithmetic.fence.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(norm) float @llvm.arithmetic.fence.f32(float [[ARG0]]) #[[ATTR2]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.arithmetic.fence.f32(float %arg0)
Expand Down
20 changes: 10 additions & 10 deletions llvm/test/Transforms/Attributor/nofpclass-canonicalize.ll
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare float @llvm.canonicalize.f32(float)
define float @ret_canonicalize(float %arg0) {
; CHECK-LABEL: define nofpclass(snan) float @ret_canonicalize
; CHECK-SAME: (float [[ARG0:%.*]]) #[[ATTR1:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10:[0-9]+]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -16,7 +16,7 @@ define float @ret_canonicalize(float %arg0) {
define float @ret_canonicalize_noinf(float nofpclass(inf) %arg0) {
; CHECK-LABEL: define nofpclass(snan inf) float @ret_canonicalize_noinf
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR1]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -26,7 +26,7 @@ define float @ret_canonicalize_noinf(float nofpclass(inf) %arg0) {
define float @ret_canonicalize_dynamic_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="dynamic,dynamic" {
; CHECK-LABEL: define nofpclass(snan inf) float @ret_canonicalize_dynamic_denormal
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR2:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -36,7 +36,7 @@ define float @ret_canonicalize_dynamic_denormal(float nofpclass(inf) %arg0) "den
define float @ret_canonicalize_daz_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="dynamic,preserve-sign" {
; CHECK-LABEL: define nofpclass(snan inf sub) float @ret_canonicalize_daz_denormal
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR3:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf sub) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf sub) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -46,7 +46,7 @@ define float @ret_canonicalize_daz_denormal(float nofpclass(inf) %arg0) "denorma
define float @ret_canonicalize_dapz_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="dynamic,positive-zero" {
; CHECK-LABEL: define nofpclass(snan inf nzero sub) float @ret_canonicalize_dapz_denormal
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR4:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf nzero sub) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf nzero sub) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -56,7 +56,7 @@ define float @ret_canonicalize_dapz_denormal(float nofpclass(inf) %arg0) "denorm
define float @ret_canonicalize_ftpz_dapz_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="positive-zero,preserve-sign" {
; CHECK-LABEL: define nofpclass(snan inf sub) float @ret_canonicalize_ftpz_dapz_denormal
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR5:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf sub) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf sub) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -66,7 +66,7 @@ define float @ret_canonicalize_ftpz_dapz_denormal(float nofpclass(inf) %arg0) "d
define float @ret_canonicalize_ftpz_ieee_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="positive-zero,ieee" {
; CHECK-LABEL: define nofpclass(snan inf nzero sub) float @ret_canonicalize_ftpz_ieee_denormal
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR6:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf nzero sub) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf nzero sub) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -76,7 +76,7 @@ define float @ret_canonicalize_ftpz_ieee_denormal(float nofpclass(inf) %arg0) "d
define float @ret_canonicalize_ftpz_dynamic_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="positive-zero,dynamic" {
; CHECK-LABEL: define nofpclass(snan inf sub) float @ret_canonicalize_ftpz_dynamic_denormal
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR7:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf sub) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf sub) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -86,7 +86,7 @@ define float @ret_canonicalize_ftpz_dynamic_denormal(float nofpclass(inf) %arg0)
define float @ret_canonicalize_ftz_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="preserve-sign,dynamic" {
; CHECK-LABEL: define nofpclass(snan inf sub) float @ret_canonicalize_ftz_denormal
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR8:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf sub) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf sub) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand All @@ -96,7 +96,7 @@ define float @ret_canonicalize_ftz_denormal(float nofpclass(inf) %arg0) "denorma
define float @ret_canonicalize_ieee_denormal(float nofpclass(inf) %arg0) "denormal-fp-math"="ieee,ieee" {
; CHECK-LABEL: define nofpclass(snan inf) float @ret_canonicalize_ieee_denormal
; CHECK-SAME: (float nofpclass(inf) [[ARG0:%.*]]) #[[ATTR9:[0-9]+]] {
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf) float @llvm.canonicalize.f32(float [[ARG0]])
; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(snan inf) float @llvm.canonicalize.f32(float [[ARG0]]) #[[ATTR10]]
; CHECK-NEXT: ret float [[CALL]]
;
%call = call float @llvm.canonicalize.f32(float %arg0)
Expand Down
Loading