[PATCH] D47059: [InstCombine] Calloc-ed strings optimizations

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 18 05:42:35 PDT 2018


xbolva00 added a comment.

A nice improvement would be to also support a case like
memset(s, 0, x); // x > 0
strlen(s); // simplify to zero

The problem I don't know yet how to solve: how to find out that there was memset before strlen called with the same string. Suggestions welcome.

And we would have to check for "s" if is captured between memset and strlen... <---- probably not hard to do

But anyway, this patch should focus on calloc-ed strings only.


Repository:
  rL LLVM

https://reviews.llvm.org/D47059





More information about the llvm-commits mailing list