diff options
author | Hideto Ueno <uenoku.tokotoko@gmail.com> | 2019-07-23 08:16:17 +0000 |
---|---|---|
committer | Hideto Ueno <uenoku.tokotoko@gmail.com> | 2019-07-23 08:16:17 +0000 |
commit | 19c07afe17fcacd8fd7d1196df16150be69e0dc9 (patch) | |
tree | 69879ce5227ce765687cca18394378c6533791c5 /llvm/test/Transforms/FunctionAttrs/nonnull.ll | |
parent | c7e6d14c6c30c6798b14faf2a28e5be642b78ad8 (diff) | |
download | bcm5719-llvm-19c07afe17fcacd8fd7d1196df16150be69e0dc9.tar.gz bcm5719-llvm-19c07afe17fcacd8fd7d1196df16150be69e0dc9.zip |
[Attributor] Deduce "dereferenceable" attribute
Summary:
Deduce dereferenceable attribute in Attributor.
These will be added in a later patch.
* dereferenceable(_or_null)_globally (D61652)
* Deduction based on load instruction (similar to D64258)
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: hiraditya, jfb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64876
llvm-svn: 366788
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs/nonnull.ll')
-rw-r--r-- | llvm/test/Transforms/FunctionAttrs/nonnull.ll | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/nonnull.ll b/llvm/test/Transforms/FunctionAttrs/nonnull.ll index 1ea14d034c8..cab72acb1a1 100644 --- a/llvm/test/Transforms/FunctionAttrs/nonnull.ll +++ b/llvm/test/Transforms/FunctionAttrs/nonnull.ll @@ -40,14 +40,14 @@ define i8* @test3() { ; just never return period.) define i8* @test4_helper() { ; FNATTR: define noalias nonnull i8* @test4_helper -; ATTRIBUTOR: define noalias nonnull i8* @test4_helper +; ATTRIBUTOR: define noalias nonnull dereferenceable(4294967295) i8* @test4_helper %ret = call i8* @test4() ret i8* %ret } define i8* @test4() { ; FNATTR: define noalias nonnull i8* @test4 -; ATTRIBUTOR: define noalias nonnull i8* @test4 +; ATTRIBUTOR: define noalias nonnull dereferenceable(4294967295) i8* @test4 %ret = call i8* @test4_helper() ret i8* %ret } @@ -219,6 +219,15 @@ bb: %tmp = call i32* @f1(i32* %arg) ret i32* null } + +; TEST 15 +define void @f15(i8* %arg) { +; ATTRIBUTOR: tail call void @use1(i8* nonnull dereferenceable(4) %arg) + + tail call void @use1(i8* dereferenceable(4) %arg) + ret void +} + ; Test propagation of nonnull callsite args back to caller. declare void @use1(i8* %x) |