This patch adds support for memcmp in MemoryLocation::getForArgument.
memcmp reads from the first 2 arguments up to the number of bytes of the
third argument.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Analysis/MemoryLocation.cpp | ||
---|---|---|
214 | While you're here, can we switch this to use TLI->getLibFunc(*Call, F) |
Change TLI->getLibFunc(*Call->getCalledFunction(), F) to TLI->getLibFunc(*Call, F)` as suggested, thanks!
LGTM
llvm/lib/Analysis/MemoryLocation.cpp | ||
---|---|---|
214–236 | Call->getCalledFunction() is redundant. |
llvm/lib/Analysis/MemoryLocation.cpp | ||
---|---|---|
226 | bcmp too? LLVM transforms memcmp(...) == 0 to bcmp == 0. |
llvm/lib/Analysis/MemoryLocation.cpp | ||
---|---|---|
226 | Yes, there are a lot of cases missing that we could support here. I won't have time to add all those in the near future unfortunately, any help/patches would be very welcome :) |
Okey, so as a starting point, bcmo case: https://reviews.llvm.org/D87964
pi 28. 8. 2020 o 13:08 Florian Hahn via Phabricator
<reviews@reviews.llvm.org> napísal(a):
fhahn added inline comments.
Comment at: llvm/lib/Analysis/MemoryLocation.cpp:225
+ break;
+ case LibFunc_memcmp:+ assert((ArgIdx == 0 || ArgIdx == 1) &&
xbolva00 wrote:
bcmp too?
LLVM transforms memcmp(...) == 0 to bcmp == 0.
Yes, there are a lot of cases missing that we could support here. I won't have time to add all those in the near future unfortunately, any help/patches would be very welcome :)
Repository:
rG LLVM Github MonorepoCHANGES SINCE LAST ACTION
https://reviews.llvm.org/D86725/new/
While you're here, can we switch this to use TLI->getLibFunc(*Call, F)