This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Implement isAsmClobberable
ClosedPublic

Authored by arsenm on Feb 2 2022, 10:22 AM.

Details

Reviewers
rampitec
Group Reviewers
Restricted Project
Summary

Warn on inline assembly clobbering reserved registers. It should also
warn on at least some reserved register defs, but that isn't happening
right now. If you have a def and re-use of a register we reserve, the
register coalescer will eliminate the intermediate virtual
register. When the reserved reg def is introduced later by the
backend, it will end up clobbering the value the register coalescer
assumed was live through the range.

There is also isInlineAsmReadOnlyReg, although I don't understand what
the distinction really is. It's called in SelectionDAGBuilder, long
before the set of reserved registers is frozen so I'm not sure how
that can possibly work reliably.

Unfortunately this is also using the ugly tablegenerated names for the
registers.

Diff Detail

Event Timeline

arsenm created this revision.Feb 2 2022, 10:22 AM
arsenm requested review of this revision.Feb 2 2022, 10:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2022, 10:22 AM
Herald added a subscriber: wdng. · View Herald Transcript
rampitec accepted this revision.Feb 2 2022, 10:39 AM
This revision is now accepted and ready to land.Feb 2 2022, 10:39 AM