diff options
Diffstat (limited to 'llvm/test/Transforms')
| -rw-r--r-- | llvm/test/Transforms/Inline/arg-attr-propagation.ll | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/test/Transforms/Inline/arg-attr-propagation.ll b/llvm/test/Transforms/Inline/arg-attr-propagation.ll index 3d18e8047e5..7c3a97cf3d2 100644 --- a/llvm/test/Transforms/Inline/arg-attr-propagation.ll +++ b/llvm/test/Transforms/Inline/arg-attr-propagation.ll @@ -12,11 +12,13 @@ define i32 @callee(i32* dereferenceable(32) %t1) { ret i32 %t2 } -; FIXME: All dereferenceability information is lost. +; Add a nonnull assumption. ; The caller argument could be known nonnull and dereferenceable(32). define i32 @caller1(i32* %t1) { ; CHECK-LABEL: @caller1(i32* %t1) +; CHECK-NEXT: [[TMP1:%.*]] = icmp ne i32* %t1, null +; CHECK-NEXT: call void @llvm.assume(i1 [[TMP1]]) ; CHECK-NEXT: [[T2_I:%.*]] = load i32, i32* %t1 ; CHECK-NEXT: ret i32 [[T2_I]] ; @@ -24,6 +26,7 @@ define i32 @caller1(i32* %t1) { ret i32 %t2 } +; Don't add a nonnull assumption if it's redundant. ; The caller argument is nonnull, but that can be explicit. ; The dereferenceable amount could be increased. @@ -36,6 +39,7 @@ define i32 @caller2(i32* dereferenceable(31) %t1) { ret i32 %t2 } +; Don't add a nonnull assumption if it's redundant. ; The caller argument is nonnull, but that can be explicit. ; Make sure that we don't propagate a smaller dereferenceable amount. |

