diff options
| author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2025-01-29 23:14:36 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-29 23:14:36 +0800 |
| commit | f226cabbb1b9737676536bc4417336bef4808992 (patch) | |
| tree | ae5e6e0cb0cd5d8d33bf1061e694e77b5f4855df /llvm/test/Transforms/InstSimplify | |
| parent | 39a72be5e59c9a80570c1085a769593e2f26f054 (diff) | |
[ValueTracking] Handle nonnull attributes at callsite (#124908)
Alive2: https://alive2.llvm.org/ce/z/yJfskv
Closes https://github.com/llvm/llvm-project/issues/124540.
Diffstat (limited to 'llvm/test/Transforms/InstSimplify')
| -rw-r--r-- | llvm/test/Transforms/InstSimplify/known-non-zero-opaque-ptrs.ll | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/llvm/test/Transforms/InstSimplify/known-non-zero-opaque-ptrs.ll b/llvm/test/Transforms/InstSimplify/known-non-zero-opaque-ptrs.ll index 92084196d955..941b31fd1198 100644 --- a/llvm/test/Transforms/InstSimplify/known-non-zero-opaque-ptrs.ll +++ b/llvm/test/Transforms/InstSimplify/known-non-zero-opaque-ptrs.ll @@ -4,12 +4,10 @@ declare void @zero_args() declare void @two_args(ptr, ptr) -; TODO: Could be non-null based on call-site attributes. define i1 @test_zero_args_nonnull(ptr %p) { ; CHECK-LABEL: @test_zero_args_nonnull( ; CHECK-NEXT: call void @zero_args(ptr noundef nonnull [[P:%.*]]) -; CHECK-NEXT: [[C:%.*]] = icmp ne ptr [[P]], null -; CHECK-NEXT: ret i1 [[C]] +; CHECK-NEXT: ret i1 true ; call void @zero_args(ptr nonnull noundef %p) %c = icmp ne ptr %p, null @@ -27,12 +25,10 @@ define i1 @test_zero_args_maybe_null(ptr %p) { ret i1 %c } -; TODO: Could be non-null based on call-site attributes. define i1 @test_two_args_nonnull(ptr %p) { ; CHECK-LABEL: @test_two_args_nonnull( ; CHECK-NEXT: call void @two_args(ptr noundef nonnull [[P:%.*]]) -; CHECK-NEXT: [[C:%.*]] = icmp ne ptr [[P]], null -; CHECK-NEXT: ret i1 [[C]] +; CHECK-NEXT: ret i1 true ; call void @two_args(ptr nonnull noundef %p) %c = icmp ne ptr %p, null |
