This is an archive of the discontinued LLVM Phabricator instance.

[TargetSchedule] shrink interface for init(); NFCI
ClosedPublic

Authored by spatel on Mar 22 2018, 9:55 AM.

Details

Summary

AFAICT, the TargetSchedModel is always initialized using the TargetSubtargetInfo's MCSchedModel and TargetInstrInfo, so we don't need to extract those and pass 3 parameters to init().

The relationship of the target classes isn't entirely clear to me yet, so I'm posting this small potential clean-up to make sure I'm not misunderstanding this already.

Diff Detail

Repository
rL LLVM

Event Timeline

spatel created this revision.Mar 22 2018, 9:55 AM

I agree that the MCSchedModel argument can go - not certain about TargetInstrInfo though.

I agree that the MCSchedModel argument can go - not certain about TargetInstrInfo though.

For reference, I was digging around here while looking at:
https://bugs.llvm.org/show_bug.cgi?id=36550
...I'm not sure if we'd want/need to use the TargetSchedule wrapper to solve that one, but this looked a bit ugly. If it's irrelevant or nobody cares otherwise, I can abandon.

RKSimon accepted this revision.Apr 7 2018, 6:44 AM

LGTM - a similar cleanup might be in ScheduleDAG::ScheduleDAG which is keeping the MachineFunction and references to lots of its children which doesn't seem necessary.

This revision is now accepted and ready to land.Apr 7 2018, 6:44 AM
This revision was automatically updated to reflect the committed changes.