[PATCH] D114905: [MemoryLocation] Support memset_pattern{4,8} in getForArgument.
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 8 11:40:09 PST 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG3c55acc4a620: [MemoryLocation] Support memset_pattern{4,8} in getForArgument. (authored by fhahn).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114905/new/
https://reviews.llvm.org/D114905
Files:
llvm/lib/Analysis/MemoryLocation.cpp
llvm/test/Analysis/BasicAA/libfuncs-darwin.ll
Index: llvm/test/Analysis/BasicAA/libfuncs-darwin.ll
===================================================================
--- llvm/test/Analysis/BasicAA/libfuncs-darwin.ll
+++ llvm/test/Analysis/BasicAA/libfuncs-darwin.ll
@@ -9,9 +9,9 @@
; CHECK: Just Mod: Ptr: i8* %a <-> call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
; CHECK-NEXT: Just Ref: Ptr: i8* %pattern <-> call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
-; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.17 <-> call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
+; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.17 <-> call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
; CHECK-NEXT: Just Ref: Ptr: i8* %pattern.gep.3 <-> call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
-; CHECK-NEXT: Just Ref: Ptr: i8* %pattern.gep.4 <-> call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
+; CHECK-NEXT: NoModRef: Ptr: i8* %pattern.gep.4 <-> call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
;
entry:
call void @memset_pattern4(i8* %a, i8* %pattern, i64 17)
@@ -48,9 +48,9 @@
; CHECK: Just Mod: Ptr: i8* %a <-> call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
; CHECK-NEXT: Just Ref: Ptr: i8* %pattern <-> call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.1 <-> call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
-; CHECK-NEXT: Just Mod: Ptr: i8* %a.gep.17 <-> call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
+; CHECK-NEXT: NoModRef: Ptr: i8* %a.gep.17 <-> call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
; CHECK-NEXT: Just Ref: Ptr: i8* %pattern.gep.7 <-> call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
-; CHECK-NEXT: Just Ref: Ptr: i8* %pattern.gep.8 <-> call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
+; CHECK-NEXT: NoModRef: Ptr: i8* %pattern.gep.8 <-> call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
;
entry:
call void @memset_pattern8(i8* %a, i8* %pattern, i64 17)
Index: llvm/lib/Analysis/MemoryLocation.cpp
===================================================================
--- llvm/lib/Analysis/MemoryLocation.cpp
+++ llvm/lib/Analysis/MemoryLocation.cpp
@@ -271,10 +271,18 @@
return MemoryLocation(Arg, Size, AATags);
}
case LibFunc_memset_pattern16:
+ case LibFunc_memset_pattern4:
+ case LibFunc_memset_pattern8:
assert((ArgIdx == 0 || ArgIdx == 1) &&
"Invalid argument index for memset_pattern16");
- if (ArgIdx == 1)
- return MemoryLocation(Arg, LocationSize::precise(16), AATags);
+ if (ArgIdx == 1) {
+ unsigned Size = 16;
+ if (F == LibFunc_memset_pattern4)
+ Size = 4;
+ else if (F == LibFunc_memset_pattern8)
+ Size = 8;
+ return MemoryLocation(Arg, LocationSize::precise(Size), AATags);
+ }
if (const ConstantInt *LenCI =
dyn_cast<ConstantInt>(Call->getArgOperand(2)))
return MemoryLocation(Arg, LocationSize::precise(LenCI->getZExtValue()),
@@ -309,7 +317,6 @@
break;
};
}
- // FIXME: Handle memset_pattern4 and memset_pattern8 also.
return MemoryLocation::getBeforeOrAfter(Call->getArgOperand(ArgIdx), AATags);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114905.392852.patch
Type: text/x-patch
Size: 3367 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211208/9ea89c32/attachment.bin>
More information about the llvm-commits
mailing list