This is an archive of the discontinued LLVM Phabricator instance.

[CallSiteSplit] Make sure we remove nonnull if the parameter turns out to be a constant.
ClosedPublic

Authored by trentxintong on Apr 12 2018, 10:04 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

trentxintong created this revision.Apr 12 2018, 10:04 PM
trentxintong retitled this revision from [CallSiteSplit] Make sure we remove any non-nullness if the paramater turns out to be a constant, i.e. more constrained than non-null to [CallSiteSplit] Make sure we remove nonnull if the parameter turns out to be a constant..Apr 12 2018, 10:08 PM

Thanks for handling this. Just curious if you see any issue with the non-null attribute in a constant ?

test/Transforms/CallSiteSplitting/callsite-split.ll
44 ↗(On Diff #142330)

Can you move this in callsite-split-or-phi.ll where we run only callsite-splitting pass. Looks like you can also use just like i32* instead of %struct.bitmap*.

Address comments.

Thanks for handling this. Just curious if you see any issue with the non-null attribute in a constant ?

Probably no problem other than it bloats the IR a bit with unnecessary attribute.

Remove empty lines.

fhahn accepted this revision.Apr 23 2018, 2:34 AM

LGTM, with the test simplification. Unfortunately there is no easy way to prevent adding the unnecessary nonnull attribute in first place.

test/Transforms/CallSiteSplitting/callsite-split-or-phi.ll
577 ↗(On Diff #143492)

Do we need inttoptr here?

590 ↗(On Diff #143492)

I don't think we need a complex callee2 function that's called here. Could you just use the existing callee function?

This revision is now accepted and ready to land.Apr 23 2018, 2:34 AM

Simplify test. I could not get rid of the inttoptr though.

This revision was automatically updated to reflect the committed changes.