This is an archive of the discontinued LLVM Phabricator instance.

[Local] Zap blockaddress without users in ConstantFoldTerminator.
ClosedPublic

Authored by fhahn on Jul 18 2019, 10:11 AM.

Details

Summary

If the blockaddress is not destoryed, the destination block will still
be marked as having its address taken, limiting further transformations.

I think there are other places where the dead blockaddress constants are kept
around, I'll look into that as follow up.

Diff Detail

Repository
rL LLVM

Event Timeline

fhahn created this revision.Jul 18 2019, 10:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2019, 10:11 AM
Herald added a subscriber: hiraditya. · View Herald Transcript

Just a comment from a bystander:

Isn't there some kind of verifier pass that clang runs (perhaps under some expensive-checks flag) after every pass?

If such a thing exists, checking that BlockAddress nodes are properly cleaned seems like something it should do.

fhahn added a comment.Jul 19 2019, 2:52 AM

Just a comment from a bystander:

Isn't there some kind of verifier pass that clang runs (perhaps under some expensive-checks flag) after every pass?

If such a thing exists, checking that BlockAddress nodes are properly cleaned seems like something it should do.

Excellent suggestion: I've added a check to the verifier (D64984) and it highlighted 2 other places where we need additional cleanups.

brzycki accepted this revision.EditedJul 19 2019, 11:45 AM

LGTM. I am assuming this passed test-suite and ninja check runs?

This revision is now accepted and ready to land.Jul 19 2019, 11:45 AM
davide accepted this revision.Jul 19 2019, 3:50 PM
This revision was automatically updated to reflect the committed changes.
fhahn added a comment.Jul 20 2019, 5:30 AM

LGTM. I am assuming this passed test-suite and ninja check runs?

Yep, thanks!