[PATCH] D27855: [InstCombine] try to extend nonnull-ness of arguments from a callsite back to its parent function
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 10:00:41 PST 2016
spatel created this revision.
spatel added reviewers: hfinkel, mkuper, majnemer.
spatel added a subscriber: llvm-commits.
Herald added a subscriber: mcrosier.
As discussed here:
http://lists.llvm.org/pipermail/llvm-dev/2016-December/108182.html
...we should be able to propagate 'nonnull' info from a callsite back to its parent.
The original motivation for this patch is our botched optimization of "dyn_cast" (PR28430), but this won't solve that problem alone.
I think this is the strongest nonnull transform of this type because tagging the argument can enable transforms for all other instructions in the function. Possible follow-ups would handle cases where we can use nonnull to directly eliminate an icmp (InstSimplify+ValueTracking), or add llvm.assume to trigger existing transforms.
https://reviews.llvm.org/D27855
Files:
lib/Transforms/InstCombine/InstCombineCalls.cpp
test/Transforms/InstCombine/call_nonnull_arg.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27855.81766.patch
Type: text/x-patch
Size: 4779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161216/848bf108/attachment.bin>
More information about the llvm-commits
mailing list