Fixes PR39177
Details
Diff Detail
Event Timeline
I just noticed that the same inferLibFuncAttributes(*M->getFunction(...)) pattern also occurs in LoopIdiomRecognize::processLoopStridedStore() in lib/Transforms/Scalar/LoopIdiomRecognize.cpp which is not fixed by this.
Also, there is inferLibFuncAttributes(*CI->getCalledFunction(), *TLI); in isLocallyOpenedFile() of lib/Transforms/Utils/SimplifyLibCalls.cpp which might suffer from a similar problem (although I have not tested that).
Please make sure your patches are reviewed by a qualified reviewer before you merge.
llvm/trunk/include/llvm/Transforms/Utils/BuildLibCalls.h | ||
---|---|---|
31 ↗ | (On Diff #169564) | Instead of making this function take a possibly-null pointer, could you add an overload that takes a StringRef and calls getFunction itself? It's essentially equivalent, but it would make the intent more clear. |
llvm/trunk/test/Transforms/InstCombine/pr39177.ll | ||
1 ↗ | (On Diff #169564) | Please add a CHECK line to make sure the expected transform actually happens. |