[PATCH] D91482: [BasicAA] Remove unnecessary known size requirement
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 28 01:17:58 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1dea8ed8b7dd: [BasicAA] Remove unnecessary known size requirement (authored by nikic).
Changed prior to commit:
https://reviews.llvm.org/D91482?vs=306722&id=308144#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91482/new/
https://reviews.llvm.org/D91482
Files:
llvm/lib/Analysis/BasicAliasAnalysis.cpp
llvm/test/Analysis/BasicAA/negoffset.ll
Index: llvm/test/Analysis/BasicAA/negoffset.ll
===================================================================
--- llvm/test/Analysis/BasicAA/negoffset.ll
+++ llvm/test/Analysis/BasicAA/negoffset.ll
@@ -117,3 +117,13 @@
%2 = load i32, i32* %1
ret i32 %2
}
+
+; CHECK-LABEL: Function: one_size_unknown:
+; CHECK: NoModRef: Ptr: i8* %p.minus1 <-> call void @llvm.memset.p0i8.i32(i8* %p, i8 0, i32 %size, i1 false)
+define void @one_size_unknown(i8* %p, i32 %size) {
+ %p.minus1 = getelementptr inbounds i8, i8* %p, i32 -1
+ call void @llvm.memset.p0i8.i32(i8* %p, i8 0, i32 %size, i1 false)
+ ret void
+}
+
+declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i1)
Index: llvm/lib/Analysis/BasicAliasAnalysis.cpp
===================================================================
--- llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -1336,9 +1336,7 @@
// ---------------->|
// |-->V1Size |-------> V2Size
// GEP1 V2
- // We need to know that V2Size is not unknown, otherwise we might have
- // stripped a gep with negative index ('gep <ptr>, -1, ...).
- if (V1Size.hasValue() && V2Size.hasValue()) {
+ if (V1Size.hasValue()) {
if ((-DecompGEP1.Offset).ult(V1Size.getValue()))
return PartialAlias;
return NoAlias;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91482.308144.patch
Type: text/x-patch
Size: 1352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201128/0ea51dfe/attachment.bin>
More information about the llvm-commits
mailing list