commit | 569647fbecf7fb29ce61a942a8bdfb6dca612e54 | [log] [tgz] |
---|---|---|
author | Sanjay Patel <spatel@rotateright.com> | Tue Jan 26 16:17:24 2016 +0000 |
committer | Sanjay Patel <spatel@rotateright.com> | Tue Jan 26 16:17:24 2016 +0000 |
tree | ef28791c79ae6b7ff721389659c769f0d7978a18 | |
parent | 9124889505bb0f51e35fae86f8da93b9b0e221bf [diff] |
[LibCallSimplifier] fold memset(malloc(x), 0, x) --> calloc(1, x) This is a step towards solving PR25892: https://llvm.org/bugs/show_bug.cgi?id=25892 It won't handle the reported case. As noted by the 'TODO' comments in the patch, we need to relax the hasOneUse() constraint and also match patterns that include memset_chk() and the llvm.memset() intrinsic in addition to memset(). Differential Revision: http://reviews.llvm.org/D16337 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258816 91177308-0d34-0410-b5e6-96231b3b80d8