diff options
author | 2020-12-01 18:19:40 +0100 | |
---|---|---|
committer | 2020-12-01 18:20:34 +0100 | |
commit | 54eab293f523956bdc4b1a98b6cf5abc0bd1ef3f (patch) | |
tree | a7da5bb7d1964d37b1a017a226f2664a97922f5f | |
parent | [NFC][clang-tidy] Port rename_check.py to Python3 (diff) | |
download | llvm-project-54eab293f523956bdc4b1a98b6cf5abc0bd1ef3f.tar.gz llvm-project-54eab293f523956bdc4b1a98b6cf5abc0bd1ef3f.tar.bz2 llvm-project-54eab293f523956bdc4b1a98b6cf5abc0bd1ef3f.zip |
[BasicAA] Add test for suboptimal result with unknown sizes (NFC)
-rw-r--r-- | llvm/test/Analysis/BasicAA/phi-aa.ll | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/Analysis/BasicAA/phi-aa.ll b/llvm/test/Analysis/BasicAA/phi-aa.ll index aa2e078000a7..f5492e6fb00f 100644 --- a/llvm/test/Analysis/BasicAA/phi-aa.ll +++ b/llvm/test/Analysis/BasicAA/phi-aa.ll @@ -150,3 +150,26 @@ loop: store i32 0, i32* %p2 br label %loop } + +; CHECK-LABEL: phi_and_gep_unknown_size +; CHECK: Just Mod: call void @llvm.memset.p0i8.i32(i8* %g, i8 0, i32 %size, i1 false) <-> call void @llvm.memset.p0i8.i32(i8* %z, i8 0, i32 %size, i1 false) +; TODO: This should be NoModRef. +define void @phi_and_gep_unknown_size(i1 %c, i8* %x, i8* %y, i8* noalias %z, i32 %size) { +entry: + br i1 %c, label %true, label %false + +true: + br label %exit + +false: + br label %exit + +exit: + %p = phi i8* [ %x, %true ], [ %y, %false ] + %g = getelementptr inbounds i8, i8* %p, i64 1 + call void @llvm.memset.p0i8.i32(i8* %g, i8 0, i32 %size, i1 false) + call void @llvm.memset.p0i8.i32(i8* %z, i8 0, i32 %size, i1 false) + ret void +} + +declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i1) |