This is an archive of the discontinued LLVM Phabricator instance.

Correctly handle range metadata when hoisting instructions out of then/else into if blocks
ClosedPublic

Authored by dotdash on Jul 18 2014, 5:10 PM.

Details

Reviewers
rafael
Summary

When there are loads in the then and else blocks, we can still hoist
them up into the if block, but we have to take caret to adjust the range
metadata.

Diff Detail

Event Timeline

dotdash updated this revision to Diff 11677.Jul 18 2014, 5:10 PM
dotdash retitled this revision from to Correctly handle range metadata when hoisting instructions out of then/else into if blocks.
dotdash updated this object.
dotdash edited the test plan for this revision. (Show Details)
dotdash added a subscriber: Unknown Object (MLST).

Could somebody please review this patch? Thanks!

rafael accepted this revision.Aug 11 2014, 7:53 AM
rafael added a reviewer: rafael.
rafael added a subscriber: rafael.

LGTM.

This patch is correct and can be committed, but there are other related bugs:

  • We also need to merge TBAA for example.
  • We need to delete unknown metadata.

GVN has code in patchReplacementInstruction that should probably be refactored to an utility function that is also used here. Do you want to try to implement that? If not, please at least open a bug to track it.

Thanks

This revision is now accepted and ready to land.Aug 11 2014, 7:53 AM
dotdash updated this revision to Diff 12558.Aug 15 2014, 8:10 AM
dotdash edited edge metadata.

Updated the patch to introduce a helper to combine instruction metadata and
handle all metadata for the hoisted instructions.

Do you have commit access?

No, I don't have commit access.

rafael closed this revision.Aug 15 2014, 8:56 AM

r215723.

luqmana added a subscriber: luqmana.Sep 8 2014, 7:56 PM

It seems like the test didn't get committed?

I have commit access by now, can I just commit the test or was there a reason it was left out?

Committed as r217453