[llvm-branch-commits] [llvm] 54eab29 - [BasicAA] Add test for suboptimal result with unknown sizes (NFC)
Nikita Popov via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Dec 1 12:09:28 PST 2020
Author: Nikita Popov
Date: 2020-12-01T18:20:34+01:00
New Revision: 54eab293f523956bdc4b1a98b6cf5abc0bd1ef3f
URL: https://github.com/llvm/llvm-project/commit/54eab293f523956bdc4b1a98b6cf5abc0bd1ef3f
DIFF: https://github.com/llvm/llvm-project/commit/54eab293f523956bdc4b1a98b6cf5abc0bd1ef3f.diff
LOG: [BasicAA] Add test for suboptimal result with unknown sizes (NFC)
Added:
Modified:
llvm/test/Analysis/BasicAA/phi-aa.ll
Removed:
################################################################################
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)
More information about the llvm-branch-commits
mailing list