This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine] Fold strnlen of constant strings.
ClosedPublic

Authored by msebor on Apr 14 2022, 1:21 PM.

Details

Summary

This patch in the strnlen series implements folding of calls with constant string arguments.

Depends on D123816.

Diff Detail

Event Timeline

msebor created this revision.Apr 14 2022, 1:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2022, 1:21 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
msebor requested review of this revision.Apr 14 2022, 1:21 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2022, 1:21 PM
msebor edited the summary of this revision. (Show Details)Apr 14 2022, 1:34 PM
nikic accepted this revision.Apr 25 2022, 1:07 PM

LG

llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
655

The Min name doesn't really make sense to me here -- if anything, this is a max. I'd call this LenC or maybe LenWithoutNull to highlight where the -1 comes from.

This revision is now accepted and ready to land.Apr 25 2022, 1:07 PM
This revision was landed with ongoing or failed builds.Apr 26 2022, 3:16 PM
This revision was automatically updated to reflect the committed changes.
msebor marked an inline comment as done.Apr 26 2022, 3:18 PM