[PATCH] D93015: Fold comparison of __builtin_object_size expression with -1 for non-const size
Siddhesh Poyarekar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 18 21:32:47 PST 2020
siddhesh updated this revision to Diff 312918.
siddhesh edited the summary of this revision.
siddhesh set the repository for this revision to rG LLVM Github Monorepo.
siddhesh added a comment.
I ended up putting the assumption before the ObjectSize. Here's an update that puts the assumption on the expression we built since that's what the comment says anyway. @serge-sans-paille your method of shadowing Builder and inserting after ObjectSize would work too (I should have looked carefully the first time, sorry) but I thought this way flows better with the rest of the code in that block. I'll be happy to use your approach if you think that's better.
I have also added another test to make sure that computed expressions get built correctly. Finally, I've dropped the limit-max-iterations.ll test as Nikita suggested.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93015/new/
https://reviews.llvm.org/D93015
Files:
llvm/lib/Analysis/MemoryBuiltins.cpp
llvm/test/Transforms/InstCombine/builtin-dynamic-object-size.ll
llvm/test/Transforms/InstCombine/limit-max-iterations.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93015.312918.patch
Type: text/x-patch
Size: 5505 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201219/926e0417/attachment.bin>
More information about the llvm-commits
mailing list