This is an archive of the discontinued LLVM Phabricator instance.

[ScheduleDAG] Support REQ_SEQUENCE unscheduling
ClosedPublic

Authored by fzhinkin on Nov 28 2022, 11:02 AM.

Details

Summary

REG_SEQUENCE node requires special treatment during the
unscheduling because the node is untyped and neither its
class, nor cost could be retrieved the same way as for
typed nodes.

Related issue: https://github.com/llvm/llvm-project/issues/58911

Diff Detail

Event Timeline

fzhinkin created this revision.Nov 28 2022, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 28 2022, 11:02 AM
fzhinkin published this revision for review.Nov 29 2022, 9:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2022, 9:21 AM
efriedma accepted this revision.Dec 24 2022, 1:17 PM
efriedma added a subscriber: efriedma.

LGTM.

It's not really clear to me why unscheduling isn't using GetCostForDef(), but I don't really want to make more complex changes to this code; it tends to be fragile.

This revision is now accepted and ready to land.Dec 24 2022, 1:17 PM

Just a note.
I see other targets just override getRepRegClassFor for MVT::Untyped. Might it be better to do the same for ARM?

Just a note.
I see other targets just override getRepRegClassFor for MVT::Untyped. Might it be better to do the same for ARM?

@barannikov88 even if getRepRegClassFor will return some non-null value, getRepRegClassCostFor may return value that differs from 1 returned by GetCostForDef for REG_SEQUENCE, so it wouldn't be sufficient to only override getRepRegClassFor.

I looked at how it works for SystemZ target and getRepRegClassFor returns SystemZ::ADDR128BitRegClass for MVT::Untyped, but corresponding cost returned by getRepRegClassCostFor is 0.

It also seems like the only targets handling MVT::Untyped in getRepRegClassFor are MIPS and SystemZ, so a change should be made not only in the ARM target, but in all other targets too.

This revision was automatically updated to reflect the committed changes.