[PATCH] D46752: [InstCombine] Validate the assumption about return type in optimizeSnPrintFString

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 11 06:51:48 PDT 2018


mstorsjo added a comment.

In https://reviews.llvm.org/D46752#1095878, @spatel wrote:

> I haven't looked in detail at the failure or discussion in https://reviews.llvm.org/D46285 or https://bugs.llvm.org/show_bug.cgi?id=37408 , so I might be missing something.
>  Why are we getting this far in the 1st place? Shouldn't we have avoided this problem in TargetLibraryInfoImpl::isValidProtoForLibFunc() by checking that the return type is wrong?


Indeed, that's also doable - I'm not familiar with this layer at all so I didn't know about that check. The existing checks for sprintf/snprintf don't check the return type, but by adding a return type check there, it also works fine.


Repository:
  rL LLVM

https://reviews.llvm.org/D46752





More information about the llvm-commits mailing list