This is an archive of the discontinued LLVM Phabricator instance.

Add ArgMemOnly attribute to strlen and wcslen, i.e. they only read memory (string) passed to them.
ClosedPublic

Authored by trentxintong on Jun 17 2017, 6:40 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

trentxintong created this revision.Jun 17 2017, 6:40 PM
trentxintong retitled this revision from Add argmononly attribute to strlen and wcslen, i.e. they only read memory (string) passed to them. to Add ArgMemOnly attribute to strlen and wcslen, i.e. they only read memory (string) passed to them..Jun 17 2017, 6:50 PM
sanjoy requested changes to this revision.Jun 17 2017, 7:09 PM

Generally looks good, but the test isn't testing anything.

test/Transforms/LICM/strlen.ll
3 ↗(On Diff #102951)

You're not running this through FileCheck at all. Look at the other LICM tests.

This revision now requires changes to proceed.Jun 17 2017, 7:09 PM
trentxintong edited edge metadata.

Address Comments

sanjoy accepted this revision.Jun 17 2017, 8:00 PM

lgtm

test/Transforms/LICM/strlen.ll
15 ↗(On Diff #102952)

Also check that #0 does, in fact, correspond to strlen.

This revision is now accepted and ready to land.Jun 17 2017, 8:00 PM
davide accepted this revision.Jun 17 2017, 8:00 PM

Fair enough.

Address comments

This revision was automatically updated to reflect the committed changes.