Page MenuHomePhabricator

[IROutliner] Ensure instructions at end of candidate are excluded
Needs ReviewPublic

Authored by AndrewLitteken on Fri, Jun 11, 12:00 PM.

Details

Reviewers
jroelofs
paquette
Summary

Occasionally instructions are between the last instruction in a region, and the following instruction as identified by the Candidate. This adds an extra check right before splitting a candidate that excludes the region from being split/checked for outlining to remove errors.

Tests Changed:
Tranforms/IROuutliner/outlining-extra-bitcasts.ll

Diff Detail

Event Timeline

AndrewLitteken requested review of this revision.Fri, Jun 11, 12:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptFri, Jun 11, 12:00 PM
ormris removed a subscriber: ormris.Fri, Jun 11, 2:49 PM
hiraditya added inline comments.Sun, Jun 13, 12:47 PM
llvm/lib/Transforms/IPO/IROutliner.cpp
1583

Do we need to split when the region is going to be ignored?

AndrewLitteken added inline comments.Sun, Jun 13, 3:01 PM
llvm/lib/Transforms/IPO/IROutliner.cpp
1583

There's a chance that when the region is split, extra instructions are added changing the possibility of outlining, and it is no longer viable to be split. It might be better to have this function return a boolean if it has been split, or has not been, then continue based on that result.

Update splitCandidates to escape early if the region cannot be extracted, and checking the boolean CandidateSplit for the region rather than using IgnoreRegion,