This is an archive of the discontinued LLVM Phabricator instance.

[MachineLoop] Add new helper isLoopInvariant()
ClosedPublic

Authored by SjoerdMeijer on Jan 5 2021, 5:38 AM.

Details

Summary

This factors out code from MachineLICM that determines whether an instruction is loop-invariant, which is a generally useful function. Thus this allows to use that helper elsewhere too.

Diff Detail

Event Timeline

SjoerdMeijer created this revision.Jan 5 2021, 5:38 AM
SjoerdMeijer requested review of this revision.Jan 5 2021, 5:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 5 2021, 5:38 AM
fhahn added inline comments.Jan 5 2021, 6:27 AM
llvm/include/llvm/CodeGen/MachineLoopInfo.h
74

can this be const?

Yep, thanks, that should have been const.

fhahn accepted this revision.Jan 5 2021, 8:16 AM

LGTM, having this re-usable seems useful.

This revision is now accepted and ready to land.Jan 5 2021, 8:16 AM
This revision was automatically updated to reflect the committed changes.