[PATCH] D130912: [InstCombine] Correct strtol folding with nonnull endptr

Martin Sebor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 1 09:00:39 PDT 2022


msebor created this revision.
msebor added reviewers: efriedma, nikic.
Herald added a subscriber: hiraditya.
Herald added a project: All.
msebor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The part of the change submitted in D129224 <https://reviews.llvm.org/D129224> that enables the folding of `strtol` calls with a nonnull `endptr` fails to reflect in the pointer's offset the length of the leading part of the consumed string preceding the first converted digit.  The tests for this part of the change were inadvertently disabled so the bug has gone unnoticed both during testing and in review.  This change fixes the problem and adjusts the existing tests to let them exercise it.

Since this bug is apparently causing problems downstream I'll plan on committing the fix today and address any subsequent review comments afterwards.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130912

Files:
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/test/Transforms/InstCombine/str-int-4.ll
  llvm/test/Transforms/InstCombine/str-int-5.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130912.449032.patch
Type: text/x-patch
Size: 47533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220801/2cf87a60/attachment-0001.bin>


More information about the llvm-commits mailing list