This is an archive of the discontinued LLVM Phabricator instance.

Preserving 'nonnull' metadata in SimplifyCFG
ClosedPublic

Authored by reames on Oct 22 2014, 9:12 AM.

Details

Summary

The actual change in this review are trivial (1 line), but I'd like a second opinion on their legality from someone familiar with the context. I *believe* that this is legal, but a confirmation would help. The semantics we're going for are: 'nonnull' is preserved when two instructions are merged iff both have it.

Also, anyone know a reason we're not merging metadata when sinking instructions but are merging when hoisting?

Diff Detail

Repository
rL LLVM

Event Timeline

reames updated this revision to Diff 15246.Oct 22 2014, 9:12 AM
reames retitled this revision from to Preserving 'nonnull' metadata in SimplifyCFG.
reames updated this object.
reames edited the test plan for this revision. (Show Details)
reames added a reviewer: hfinkel.
reames added a subscriber: Unknown Object (MLST).
hfinkel accepted this revision.Oct 22 2014, 9:25 AM
hfinkel edited edge metadata.

Full context patch please ;)

Generally speaking, I think it must be legal to preserve nonnull anywhere that preserving range metadata is preserved. Since we're hoisting common code to both sides of the branch, there can't be any control-dependency issues here, and I think that the preservation is correct.

LGTM.

lib/Transforms/Utils/SimplifyCFG.cpp
1315 ↗(On Diff #15246)

Yes, it looks like we should be doing this. Since this is common-code combining, I think there are no control dependency issues here (feel free to do so).

This revision is now accepted and ready to land.Oct 22 2014, 9:25 AM
reames closed this revision.Oct 22 2014, 9:47 AM
reames updated this revision to Diff 15251.

Closed by commit rL220392 (authored by @reames).