[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
|
2020-04-18 04:09:16 +02:00
|
|
|
; RUN: opt -attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
|
|
|
|
; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=2 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
|
|
|
|
; RUN: opt -attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
|
|
|
|
; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
|
|
|
|
declare noalias i8* @malloc(i64)
|
|
|
|
|
|
|
|
declare void @nocapture_func_frees_pointer(i8* nocapture)
|
|
|
|
|
|
|
|
declare void @func_throws(...)
|
|
|
|
|
|
|
|
declare void @sync_func(i8* %p)
|
|
|
|
|
2019-10-15 00:29:05 +02:00
|
|
|
declare void @sync_will_return(i8* %p) willreturn nounwind
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
|
|
|
|
declare void @no_sync_func(i8* nocapture %p) nofree nosync willreturn
|
|
|
|
|
|
|
|
declare void @nofree_func(i8* nocapture %p) nofree nosync willreturn
|
|
|
|
|
|
|
|
declare void @foo(i32* %p)
|
|
|
|
|
|
|
|
declare void @foo_nounw(i32* %p) nounwind nofree
|
|
|
|
|
|
|
|
declare i32 @no_return_call() noreturn
|
|
|
|
|
|
|
|
declare void @free(i8* nocapture)
|
|
|
|
|
|
|
|
declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture) nounwind
|
|
|
|
|
2019-11-17 21:35:04 +01:00
|
|
|
define void @nofree_arg_only(i8* %p1, i8* %p2) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@nofree_arg_only
|
|
|
|
; CHECK-SAME: (i8* nocapture nofree [[P1:%.*]], i8* nocapture [[P2:%.*]])
|
|
|
|
; CHECK-NEXT: tail call void @free(i8* nocapture [[P2]])
|
|
|
|
; CHECK-NEXT: tail call void @nofree_func(i8* nocapture nofree [[P1]])
|
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
2019-11-17 21:35:04 +01:00
|
|
|
tail call void @free(i8* %p2)
|
|
|
|
tail call void @nofree_func(i8* %p1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
; TEST 1 - negative, pointer freed in another function.
|
|
|
|
|
|
|
|
define void @test1() {
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test1()
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; CHECK-NEXT: tail call void @nocapture_func_frees_pointer(i8* noalias nocapture [[TMP1]])
|
|
|
|
; CHECK-NEXT: tail call void (...) @func_throws()
|
|
|
|
; CHECK-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]])
|
|
|
|
; CHECK-NEXT: ret void
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @nocapture_func_frees_pointer(i8* %1)
|
|
|
|
tail call void (...) @func_throws()
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 2 - negative, call to a sync function.
|
|
|
|
|
|
|
|
define void @test2() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test2()
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; CHECK-NEXT: tail call void @sync_func(i8* [[TMP1]])
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @free(i8* nocapture [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @sync_func(i8* %1)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 3 - 1 malloc, 1 free
|
|
|
|
|
|
|
|
define void @test3() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test3()
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: ret void
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test3()
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2019-11-17 21:35:04 +01:00
|
|
|
define void @test3a(i8* %p) {
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test3a
|
|
|
|
; IS________OPM-SAME: (i8* nocapture [[P:%.*]])
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP1]], i8* nocapture [[P]])
|
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]])
|
|
|
|
; IS________OPM-NEXT: ret void
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test3a
|
|
|
|
; IS________NPM-SAME: (i8* nocapture [[P:%.*]])
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]])
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
2019-11-17 21:35:04 +01:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @nofree_arg_only(i8* %1, i8* %p)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-03-28 08:15:59 +01:00
|
|
|
declare noalias i8* @aligned_alloc(i64, i64)
|
|
|
|
|
|
|
|
define void @test3b(i8* %p) {
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test3b
|
|
|
|
; IS________OPM-SAME: (i8* nocapture [[P:%.*]])
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @aligned_alloc(i64 32, i64 128)
|
|
|
|
; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP1]], i8* nocapture [[P]])
|
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]])
|
|
|
|
; IS________OPM-NEXT: ret void
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test3b
|
|
|
|
; IS________NPM-SAME: (i8* nocapture [[P:%.*]])
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 128, align 32
|
|
|
|
; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP1]], i8* nocapture [[P]])
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
2020-03-28 08:15:59 +01:00
|
|
|
%1 = tail call noalias i8* @aligned_alloc(i64 32, i64 128)
|
|
|
|
tail call void @nofree_arg_only(i8* %1, i8* %p)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; leave alone non-constant alignments.
|
|
|
|
define void @test3c(i64 %alignment) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test3c
|
|
|
|
; CHECK-SAME: (i64 [[ALIGNMENT:%.*]])
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @aligned_alloc(i64 [[ALIGNMENT]], i64 128)
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
2020-03-28 08:15:59 +01:00
|
|
|
%1 = tail call noalias i8* @aligned_alloc(i64 %alignment, i64 128)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
declare noalias i8* @calloc(i64, i64)
|
|
|
|
|
|
|
|
define void @test0() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test0()
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @calloc(i64 2, i64 4)
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: ret void
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test0()
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 8
|
|
|
|
; IS________NPM-NEXT: [[CALLOC_BC:%.*]] = bitcast i8* [[TMP1]] to i8*
|
|
|
|
; IS________NPM-NEXT: call void @llvm.memset.p0i8.i64(i8* [[CALLOC_BC]], i8 0, i64 8, i1 false)
|
|
|
|
; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @calloc(i64 2, i64 4)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2020-03-28 08:15:59 +01:00
|
|
|
; TEST 4
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
define void @test4() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test4()
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: ret void
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test4()
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @nofree_func(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 5 - not all exit paths have a call to free, but all uses of malloc
|
|
|
|
; are in nofree functions and are not captured
|
|
|
|
|
2019-11-17 21:35:04 +01:00
|
|
|
define void @test5(i32, i8* %p) {
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test5
|
|
|
|
; IS________OPM-SAME: (i32 [[TMP0:%.*]], i8* nocapture [[P:%.*]])
|
|
|
|
; IS________OPM-NEXT: [[TMP2:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
|
|
|
|
; IS________OPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]]
|
|
|
|
; IS________OPM: 4:
|
|
|
|
; IS________OPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]])
|
|
|
|
; IS________OPM-NEXT: br label [[TMP6:%.*]]
|
|
|
|
; IS________OPM: 5:
|
|
|
|
; IS________OPM-NEXT: tail call void @nofree_arg_only(i8* nocapture nofree [[TMP2]], i8* nocapture [[P]])
|
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]])
|
|
|
|
; IS________OPM-NEXT: br label [[TMP6]]
|
|
|
|
; IS________OPM: 6:
|
|
|
|
; IS________OPM-NEXT: ret void
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test5
|
|
|
|
; IS________NPM-SAME: (i32 [[TMP0:%.*]], i8* nocapture [[P:%.*]])
|
|
|
|
; IS________NPM-NEXT: [[TMP2:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
|
|
|
|
; IS________NPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]]
|
|
|
|
; IS________NPM: 4:
|
|
|
|
; IS________NPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]])
|
|
|
|
; IS________NPM-NEXT: br label [[TMP6:%.*]]
|
|
|
|
; IS________NPM: 5:
|
|
|
|
; IS________NPM-NEXT: tail call void @nofree_arg_only(i8* noalias nocapture nofree [[TMP2]], i8* nocapture [[P]])
|
|
|
|
; IS________NPM-NEXT: br label [[TMP6]]
|
|
|
|
; IS________NPM: 6:
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%2 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
%3 = icmp eq i32 %0, 0
|
|
|
|
br i1 %3, label %5, label %4
|
|
|
|
|
|
|
|
4: ; preds = %1
|
|
|
|
tail call void @nofree_func(i8* %2)
|
|
|
|
br label %6
|
|
|
|
|
|
|
|
5: ; preds = %1
|
2019-11-17 21:35:04 +01:00
|
|
|
tail call void @nofree_arg_only(i8* %2, i8* %p)
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
tail call void @free(i8* %2)
|
|
|
|
br label %6
|
|
|
|
|
|
|
|
6: ; preds = %5, %4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 6 - all exit paths have a call to free
|
|
|
|
|
|
|
|
define void @test6(i32) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test6
|
|
|
|
; IS________OPM-SAME: (i32 [[TMP0:%.*]])
|
|
|
|
; IS________OPM-NEXT: [[TMP2:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
|
|
|
|
; IS________OPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]]
|
|
|
|
; IS________OPM: 4:
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]])
|
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: br label [[TMP6:%.*]]
|
|
|
|
; IS________OPM: 5:
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture [[TMP2]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: br label [[TMP6]]
|
|
|
|
; IS________OPM: 6:
|
|
|
|
; IS________OPM-NEXT: ret void
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test6
|
|
|
|
; IS________NPM-SAME: (i32 [[TMP0:%.*]])
|
|
|
|
; IS________NPM-NEXT: [[TMP2:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: [[TMP3:%.*]] = icmp eq i32 [[TMP0]], 0
|
|
|
|
; IS________NPM-NEXT: br i1 [[TMP3]], label [[TMP5:%.*]], label [[TMP4:%.*]]
|
|
|
|
; IS________NPM: 4:
|
|
|
|
; IS________NPM-NEXT: tail call void @nofree_func(i8* noalias nocapture nofree [[TMP2]])
|
|
|
|
; IS________NPM-NEXT: br label [[TMP6:%.*]]
|
|
|
|
; IS________NPM: 5:
|
|
|
|
; IS________NPM-NEXT: br label [[TMP6]]
|
|
|
|
; IS________NPM: 6:
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%2 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
%3 = icmp eq i32 %0, 0
|
|
|
|
br i1 %3, label %5, label %4
|
|
|
|
|
|
|
|
4: ; preds = %1
|
|
|
|
tail call void @nofree_func(i8* %2)
|
|
|
|
tail call void @free(i8* %2)
|
|
|
|
br label %6
|
|
|
|
|
|
|
|
5: ; preds = %1
|
|
|
|
tail call void @free(i8* %2)
|
|
|
|
br label %6
|
|
|
|
|
|
|
|
6: ; preds = %5, %4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 7 - free is dead.
|
|
|
|
|
|
|
|
define void @test7() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test7()
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: [[TMP2:%.*]] = tail call i32 @no_return_call()
|
|
|
|
; IS________OPM-NEXT: unreachable
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test7()
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: [[TMP2:%.*]] = tail call i32 @no_return_call()
|
|
|
|
; IS________NPM-NEXT: unreachable
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call i32 @no_return_call()
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 8 - Negative: bitcast pointer used in capture function
|
|
|
|
|
|
|
|
define void @test8() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test8()
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; CHECK-NEXT: tail call void @foo(i32* align 4 [[TMP2]])
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @free(i8* nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
%2 = bitcast i8* %1 to i32*
|
|
|
|
store i32 10, i32* %2
|
|
|
|
%3 = load i32, i32* %2
|
|
|
|
tail call void @foo(i32* %2)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 9 - FIXME: malloc should be converted.
|
|
|
|
define void @test9() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test9()
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; CHECK-NEXT: tail call void @foo_nounw(i32* nofree align 4 [[TMP2]])
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @free(i8* nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
%2 = bitcast i8* %1 to i32*
|
|
|
|
store i32 10, i32* %2
|
|
|
|
%3 = load i32, i32* %2
|
|
|
|
tail call void @foo_nounw(i32* %2)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 10 - 1 malloc, 1 free
|
|
|
|
|
|
|
|
define i32 @test10() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test10()
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; IS________OPM-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; IS________OPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: ret i32 [[TMP3]]
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test10()
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; IS________NPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; IS________NPM-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; IS________NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
|
|
|
|
; IS________NPM-NEXT: ret i32 [[TMP3]]
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
%2 = bitcast i8* %1 to i32*
|
|
|
|
store i32 10, i32* %2
|
|
|
|
%3 = load i32, i32* %2
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret i32 %3
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @test_lifetime() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test_lifetime()
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; IS________OPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 4, i8* noalias nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; IS________OPM-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; IS________OPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: ret i32 [[TMP3]]
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test_lifetime()
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________NPM-NEXT: call void @llvm.lifetime.start.p0i8(i64 4, i8* noalias nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________NPM-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; IS________NPM-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; IS________NPM-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
|
|
|
|
; IS________NPM-NEXT: ret i32 [[TMP3]]
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
call void @llvm.lifetime.start.p0i8(i64 4, i8* %1)
|
|
|
|
%2 = bitcast i8* %1 to i32*
|
|
|
|
store i32 10, i32* %2
|
|
|
|
%3 = load i32, i32* %2
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret i32 %3
|
|
|
|
}
|
|
|
|
|
2020-03-28 08:15:59 +01:00
|
|
|
; TEST 11
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
|
|
|
|
define void @test11() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test11()
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: tail call void @sync_will_return(i8* [[TMP1]])
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* nocapture [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: ret void
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test11()
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: tail call void @sync_will_return(i8* [[TMP1]])
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
tail call void @sync_will_return(i8* %1)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; TEST 12
|
|
|
|
define i32 @irreducible_cfg(i32 %0) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@irreducible_cfg
|
|
|
|
; IS________OPM-SAME: (i32 [[TMP0:%.*]])
|
|
|
|
; IS________OPM-NEXT: [[TMP2:%.*]] = call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32*
|
|
|
|
; IS________OPM-NEXT: store i32 10, i32* [[TMP3]], align 4
|
|
|
|
; IS________OPM-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP0]], 1
|
|
|
|
; IS________OPM-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP7:%.*]]
|
|
|
|
; IS________OPM: 5:
|
|
|
|
; IS________OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], 5
|
|
|
|
; IS________OPM-NEXT: br label [[TMP13:%.*]]
|
|
|
|
; IS________OPM: 7:
|
|
|
|
; IS________OPM-NEXT: br label [[TMP8:%.*]]
|
|
|
|
; IS________OPM: 8:
|
|
|
|
; IS________OPM-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP14:%.*]], [[TMP13]] ], [ 1, [[TMP7]] ]
|
|
|
|
; IS________OPM-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP3]], align 4
|
|
|
|
; IS________OPM-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP9]], -1
|
|
|
|
; IS________OPM-NEXT: store i32 [[TMP10]], i32* [[TMP3]], align 4
|
|
|
|
; IS________OPM-NEXT: [[TMP11:%.*]] = icmp ne i32 [[TMP9]], 0
|
|
|
|
; IS________OPM-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP15:%.*]]
|
|
|
|
; IS________OPM: 12:
|
|
|
|
; IS________OPM-NEXT: br label [[TMP13]]
|
|
|
|
; IS________OPM: 13:
|
|
|
|
; IS________OPM-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP6]], [[TMP5]] ], [ [[DOT0]], [[TMP12]] ]
|
|
|
|
; IS________OPM-NEXT: [[TMP14]] = add nsw i32 [[DOT1]], 1
|
|
|
|
; IS________OPM-NEXT: br label [[TMP8]]
|
|
|
|
; IS________OPM: 15:
|
|
|
|
; IS________OPM-NEXT: [[TMP16:%.*]] = bitcast i32* [[TMP3]] to i8*
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: call void @free(i8* nocapture [[TMP16]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP3]], align 4
|
|
|
|
; IS________OPM-NEXT: ret i32 [[TMP17]]
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@irreducible_cfg
|
|
|
|
; IS________NPM-SAME: (i32 [[TMP0:%.*]])
|
|
|
|
; IS________NPM-NEXT: [[TMP2:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: [[TMP3:%.*]] = bitcast i8* [[TMP2]] to i32*
|
|
|
|
; IS________NPM-NEXT: store i32 10, i32* [[TMP3]], align 4
|
|
|
|
; IS________NPM-NEXT: [[TMP4:%.*]] = icmp eq i32 [[TMP0]], 1
|
|
|
|
; IS________NPM-NEXT: br i1 [[TMP4]], label [[TMP5:%.*]], label [[TMP7:%.*]]
|
|
|
|
; IS________NPM: 5:
|
|
|
|
; IS________NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP0]], 5
|
|
|
|
; IS________NPM-NEXT: br label [[TMP13:%.*]]
|
|
|
|
; IS________NPM: 7:
|
|
|
|
; IS________NPM-NEXT: br label [[TMP8:%.*]]
|
|
|
|
; IS________NPM: 8:
|
|
|
|
; IS________NPM-NEXT: [[DOT0:%.*]] = phi i32 [ [[TMP14:%.*]], [[TMP13]] ], [ 1, [[TMP7]] ]
|
|
|
|
; IS________NPM-NEXT: [[TMP9:%.*]] = load i32, i32* [[TMP3]], align 4
|
|
|
|
; IS________NPM-NEXT: [[TMP10:%.*]] = add nsw i32 [[TMP9]], -1
|
|
|
|
; IS________NPM-NEXT: store i32 [[TMP10]], i32* [[TMP3]], align 4
|
|
|
|
; IS________NPM-NEXT: [[TMP11:%.*]] = icmp ne i32 [[TMP9]], 0
|
|
|
|
; IS________NPM-NEXT: br i1 [[TMP11]], label [[TMP12:%.*]], label [[TMP15:%.*]]
|
|
|
|
; IS________NPM: 12:
|
|
|
|
; IS________NPM-NEXT: br label [[TMP13]]
|
|
|
|
; IS________NPM: 13:
|
|
|
|
; IS________NPM-NEXT: [[DOT1:%.*]] = phi i32 [ [[TMP6]], [[TMP5]] ], [ [[DOT0]], [[TMP12]] ]
|
|
|
|
; IS________NPM-NEXT: [[TMP14]] = add nsw i32 [[DOT1]], 1
|
|
|
|
; IS________NPM-NEXT: br label [[TMP8]]
|
|
|
|
; IS________NPM: 15:
|
|
|
|
; IS________NPM-NEXT: [[TMP16:%.*]] = bitcast i32* [[TMP3]] to i8*
|
|
|
|
; IS________NPM-NEXT: [[TMP17:%.*]] = load i32, i32* [[TMP3]], align 4
|
|
|
|
; IS________NPM-NEXT: ret i32 [[TMP17]]
|
|
|
|
;
|
2019-10-13 06:14:15 +02:00
|
|
|
%2 = call noalias i8* @malloc(i64 4)
|
|
|
|
%3 = bitcast i8* %2 to i32*
|
|
|
|
store i32 10, i32* %3, align 4
|
|
|
|
%4 = icmp eq i32 %0, 1
|
|
|
|
br i1 %4, label %5, label %7
|
|
|
|
|
|
|
|
5: ; preds = %1
|
|
|
|
%6 = add nsw i32 %0, 5
|
|
|
|
br label %13
|
|
|
|
|
|
|
|
7: ; preds = %1
|
|
|
|
br label %8
|
|
|
|
|
|
|
|
8: ; preds = %13, %7
|
|
|
|
%.0 = phi i32 [ %14, %13 ], [ 1, %7 ]
|
|
|
|
%9 = load i32, i32* %3, align 4
|
|
|
|
%10 = add nsw i32 %9, -1
|
|
|
|
store i32 %10, i32* %3, align 4
|
|
|
|
%11 = icmp ne i32 %9, 0
|
|
|
|
br i1 %11, label %12, label %15
|
|
|
|
|
|
|
|
12: ; preds = %8
|
|
|
|
br label %13
|
|
|
|
|
|
|
|
13: ; preds = %12, %5
|
|
|
|
%.1 = phi i32 [ %6, %5 ], [ %.0, %12 ]
|
|
|
|
%14 = add nsw i32 %.1, 1
|
|
|
|
br label %8
|
|
|
|
|
|
|
|
15: ; preds = %8
|
|
|
|
%16 = load i32, i32* %3, align 4
|
|
|
|
%17 = bitcast i32* %3 to i8*
|
|
|
|
call void @free(i8* %17)
|
|
|
|
%18 = load i32, i32* %3, align 4
|
|
|
|
ret i32 %18
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
}
|
|
|
|
|
2019-10-13 06:14:15 +02:00
|
|
|
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
define i32 @malloc_in_loop(i32 %0) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@malloc_in_loop
|
|
|
|
; IS________OPM-SAME: (i32 [[TMP0:%.*]])
|
|
|
|
; IS________OPM-NEXT: [[TMP2:%.*]] = alloca i32, align 4
|
|
|
|
; IS________OPM-NEXT: [[TMP3:%.*]] = alloca i32*, align 8
|
|
|
|
; IS________OPM-NEXT: store i32 [[TMP0]], i32* [[TMP2]], align 4
|
|
|
|
; IS________OPM-NEXT: br label [[TMP4:%.*]]
|
|
|
|
; IS________OPM: 4:
|
|
|
|
; IS________OPM-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP2]], align 4
|
|
|
|
; IS________OPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP5]], -1
|
|
|
|
; IS________OPM-NEXT: store i32 [[TMP6]], i32* [[TMP2]], align 4
|
|
|
|
; IS________OPM-NEXT: [[TMP7:%.*]] = icmp sgt i32 [[TMP6]], 0
|
|
|
|
; IS________OPM-NEXT: br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP11:%.*]]
|
|
|
|
; IS________OPM: 8:
|
|
|
|
; IS________OPM-NEXT: [[TMP9:%.*]] = call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32*
|
|
|
|
; IS________OPM-NEXT: store i32 1, i32* [[TMP10]], align 8
|
|
|
|
; IS________OPM-NEXT: br label [[TMP4]]
|
|
|
|
; IS________OPM: 11:
|
|
|
|
; IS________OPM-NEXT: ret i32 5
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@malloc_in_loop
|
|
|
|
; IS________NPM-SAME: (i32 [[TMP0:%.*]])
|
|
|
|
; IS________NPM-NEXT: [[TMP2:%.*]] = alloca i32, align 4
|
|
|
|
; IS________NPM-NEXT: [[TMP3:%.*]] = alloca i32*, align 8
|
|
|
|
; IS________NPM-NEXT: store i32 [[TMP0]], i32* [[TMP2]], align 4
|
|
|
|
; IS________NPM-NEXT: br label [[TMP4:%.*]]
|
|
|
|
; IS________NPM: 4:
|
|
|
|
; IS________NPM-NEXT: [[TMP5:%.*]] = load i32, i32* [[TMP2]], align 4
|
|
|
|
; IS________NPM-NEXT: [[TMP6:%.*]] = add nsw i32 [[TMP5]], -1
|
|
|
|
; IS________NPM-NEXT: store i32 [[TMP6]], i32* [[TMP2]], align 4
|
|
|
|
; IS________NPM-NEXT: [[TMP7:%.*]] = icmp sgt i32 [[TMP6]], 0
|
|
|
|
; IS________NPM-NEXT: br i1 [[TMP7]], label [[TMP8:%.*]], label [[TMP11:%.*]]
|
|
|
|
; IS________NPM: 8:
|
|
|
|
; IS________NPM-NEXT: [[TMP9:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: [[TMP10:%.*]] = bitcast i8* [[TMP9]] to i32*
|
|
|
|
; IS________NPM-NEXT: store i32 1, i32* [[TMP10]], align 8
|
|
|
|
; IS________NPM-NEXT: br label [[TMP4]]
|
|
|
|
; IS________NPM: 11:
|
|
|
|
; IS________NPM-NEXT: ret i32 5
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%2 = alloca i32, align 4
|
|
|
|
%3 = alloca i32*, align 8
|
|
|
|
store i32 %0, i32* %2, align 4
|
|
|
|
br label %4
|
|
|
|
|
|
|
|
4: ; preds = %8, %1
|
|
|
|
%5 = load i32, i32* %2, align 4
|
|
|
|
%6 = add nsw i32 %5, -1
|
|
|
|
store i32 %6, i32* %2, align 4
|
|
|
|
%7 = icmp sgt i32 %6, 0
|
|
|
|
br i1 %7, label %8, label %11
|
|
|
|
|
|
|
|
8: ; preds = %4
|
|
|
|
%9 = call noalias i8* @malloc(i64 4)
|
|
|
|
%10 = bitcast i8* %9 to i32*
|
2019-10-13 06:14:15 +02:00
|
|
|
store i32 1, i32* %10, align 8
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
br label %4
|
|
|
|
|
|
|
|
11: ; preds = %4
|
|
|
|
ret i32 5
|
|
|
|
}
|
|
|
|
|
|
|
|
; Malloc/Calloc too large
|
|
|
|
define i32 @test13() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test13()
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 256)
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @free(i8* noalias nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret i32 [[TMP3]]
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 256)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
%2 = bitcast i8* %1 to i32*
|
|
|
|
store i32 10, i32* %2
|
|
|
|
%3 = load i32, i32* %2
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret i32 %3
|
|
|
|
}
|
|
|
|
|
2019-12-17 20:36:10 +01:00
|
|
|
define i32 @test_sle() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test_sle()
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 -1)
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @free(i8* noalias nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret i32 [[TMP3]]
|
|
|
|
;
|
2019-12-17 20:36:10 +01:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 -1)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
%2 = bitcast i8* %1 to i32*
|
|
|
|
store i32 10, i32* %2
|
|
|
|
%3 = load i32, i32* %2
|
|
|
|
tail call void @free(i8* %1)
|
2019-12-17 20:41:09 +01:00
|
|
|
ret i32 %3
|
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @test_overflow() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test_overflow()
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @calloc(i64 65537, i64 65537)
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: [[TMP2:%.*]] = bitcast i8* [[TMP1]] to i32*
|
|
|
|
; CHECK-NEXT: store i32 10, i32* [[TMP2]], align 4
|
|
|
|
; CHECK-NEXT: [[TMP3:%.*]] = load i32, i32* [[TMP2]], align 4
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @free(i8* noalias nocapture nonnull align 4 dereferenceable(4) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret i32 [[TMP3]]
|
|
|
|
;
|
2019-12-17 20:41:09 +01:00
|
|
|
%1 = tail call noalias i8* @calloc(i64 65537, i64 65537)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
%2 = bitcast i8* %1 to i32*
|
|
|
|
store i32 10, i32* %2
|
|
|
|
%3 = load i32, i32* %2
|
|
|
|
tail call void @free(i8* %1)
|
2019-12-17 20:36:10 +01:00
|
|
|
ret i32 %3
|
|
|
|
}
|
|
|
|
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
define void @test14() {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test14()
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @calloc(i64 64, i64 4)
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; CHECK-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
[Attributor] Heap-To-Stack Conversion
D53362 gives a prototype heap-to-stack conversion pass. With addition of new attributes in the attributor, this can now be revisted and improved. This will place it in the Attributor to make it easier to use new attributes (eg. nofree, nosync, willreturn, etc.) and other attributor features.
Reviewers: jdoerfert, uenoku, hfinkel, efriedma
Subscribers: lebedev.ri, xbolva00, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D65408
llvm-svn: 371942
2019-09-15 23:47:41 +02:00
|
|
|
%1 = tail call noalias i8* @calloc(i64 64, i64 4)
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
2019-10-13 05:54:08 +02:00
|
|
|
|
|
|
|
define void @test15(i64 %S) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test15
|
|
|
|
; CHECK-SAME: (i64 [[S:%.*]])
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 [[S]])
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree [[TMP1]])
|
|
|
|
; CHECK-NEXT: tail call void @free(i8* noalias nocapture [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
2019-10-13 05:54:08 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 %S)
|
2019-10-13 06:14:15 +02:00
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test16a(i8 %v, i8** %P) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test16a
|
|
|
|
; IS________OPM-SAME: (i8 [[V:%.*]], i8** nocapture nofree readnone [[P:%.*]])
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: store i8 [[V]], i8* [[TMP1]]
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree nonnull dereferenceable(1) [[TMP1]])
|
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* noalias nocapture nonnull dereferenceable(1) [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: ret void
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test16a
|
|
|
|
; IS________NPM-SAME: (i8 [[V:%.*]], i8** nocapture nofree readnone [[P:%.*]])
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: store i8 [[V]], i8* [[TMP1]]
|
|
|
|
; IS________NPM-NEXT: tail call void @no_sync_func(i8* noalias nocapture nofree nonnull dereferenceable(1) [[TMP1]])
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
2019-10-13 06:14:15 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
store i8 %v, i8* %1
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
2020-02-20 05:00:43 +01:00
|
|
|
tail call void @free(i8* nonnull dereferenceable(1) %1)
|
2019-10-13 06:14:15 +02:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test16b(i8 %v, i8** %P) {
|
2020-05-04 02:08:30 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test16b
|
|
|
|
; CHECK-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]])
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; CHECK-NEXT: store i8* [[TMP1]], i8** [[P]]
|
|
|
|
; CHECK-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]])
|
|
|
|
; CHECK-NEXT: tail call void @free(i8* nocapture [[TMP1]])
|
|
|
|
; CHECK-NEXT: ret void
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
;
|
2019-10-13 06:14:15 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
store i8* %1, i8** %P
|
|
|
|
tail call void @no_sync_func(i8* %1)
|
|
|
|
tail call void @free(i8* %1)
|
2019-10-13 05:54:08 +02:00
|
|
|
ret void
|
|
|
|
}
|
2019-10-15 00:29:05 +02:00
|
|
|
|
|
|
|
define void @test16c(i8 %v, i8** %P) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-LABEL: define {{[^@]+}}@test16c
|
|
|
|
; IS________OPM-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]])
|
|
|
|
; IS________OPM-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; IS________OPM-NEXT: store i8* [[TMP1]], i8** [[P]]
|
2020-05-04 02:08:30 +02:00
|
|
|
; IS________OPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]])
|
|
|
|
; IS________OPM-NEXT: tail call void @free(i8* nocapture [[TMP1]])
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; IS________OPM-NEXT: ret void
|
|
|
|
;
|
|
|
|
; IS________NPM-LABEL: define {{[^@]+}}@test16c
|
|
|
|
; IS________NPM-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]])
|
|
|
|
; IS________NPM-NEXT: [[TMP1:%.*]] = alloca i8, i64 4
|
|
|
|
; IS________NPM-NEXT: store i8* [[TMP1]], i8** [[P]]
|
|
|
|
; IS________NPM-NEXT: tail call void @no_sync_func(i8* nocapture nofree [[TMP1]])
|
|
|
|
; IS________NPM-NEXT: ret void
|
|
|
|
;
|
2019-10-15 00:29:05 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
store i8* %1, i8** %P
|
|
|
|
tail call void @no_sync_func(i8* %1) nounwind
|
|
|
|
tail call void @free(i8* %1)
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
define void @test16d(i8 %v, i8** %P) {
|
[Attributor] Unify testing (=updates,prefixes,run configurations,...)
When the Attributor was created the test update scripts were not well
suited to deal with the challenges of IR attribute checking. This
partially improved.
Since then we also added three additional configurations that need
testing; in total we now have the following four:
{ TUNIT, CGSCC } x { old pass manager (OPM), new pass manager (NPM) }
Finally, the number of developers and tests grew rapidly (partially due
to the addition of ArgumentPromotion and IPConstantProp tests), which
resulted in tests only being run in some configurations, different
prefixes being used, and different "styles" of checks being used.
Due to the above reasons I believed we needed to take another look at
the test update scripts. While we started to use them, via UTC_ARGS:
--enable/disable, the other problems remained. To improve the testing
situation for *all* configurations, to simplify future updates to the
test, and to help identify subtle effects of future changes, we now use
the test update scripts for (almost) all Attributor tests.
An exhaustive prefix list minimizes the number of check lines and makes
it easy to identify and compare configurations.
Tests have been adjusted in the process but we tried to keep their
intend unchanged.
Reviewed By: sstefan1
Differential Revision: https://reviews.llvm.org/D76588
2020-04-09 02:04:57 +02:00
|
|
|
; CHECK-LABEL: define {{[^@]+}}@test16d
|
|
|
|
; CHECK-SAME: (i8 [[V:%.*]], i8** nocapture writeonly [[P:%.*]])
|
|
|
|
; CHECK-NEXT: [[TMP1:%.*]] = tail call noalias i8* @malloc(i64 4)
|
|
|
|
; CHECK-NEXT: store i8* [[TMP1]], i8** [[P]]
|
|
|
|
; CHECK-NEXT: ret void
|
|
|
|
;
|
2019-10-15 00:29:05 +02:00
|
|
|
%1 = tail call noalias i8* @malloc(i64 4)
|
|
|
|
store i8* %1, i8** %P
|
|
|
|
ret void
|
|
|
|
}
|