This is an archive of the discontinued LLVM Phabricator instance.

[M68k] Allow user to preserve certain registers
ClosedPublic

Authored by myhsu on May 19 2021, 1:51 PM.

Details

Summary

Add -ffixed-a[0-6] and -ffixed-d[0-7] driver flags and the corresponding subtarget features to prevent certain register from being allocated.

Diff Detail

Event Timeline

myhsu created this revision.May 19 2021, 1:51 PM
myhsu requested review of this revision.May 19 2021, 1:51 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 19 2021, 1:51 PM

Please fix up the linter warnings; LGTM.

llvm/lib/Target/M68k/M68kRegisterInfo.cpp
137

a more common convention in LLVM for for loops is:

for (size_t Reg = 0, Total = getNumRegs(); Reg != Total; ++Reg) {

The coding standards aren't very explicit about this though, the case https://llvm.org/docs/CodingStandards.html#don-t-evaluate-end-every-time-through-a-loop has more to do with iterators.

myhsu updated this revision to Diff 346627.May 19 2021, 9:40 PM
myhsu marked an inline comment as done.

Fix formatting

nickdesaulniers accepted this revision.May 20 2021, 10:51 AM
This revision is now accepted and ready to land.May 20 2021, 10:51 AM
This revision was landed with ongoing or failed builds.May 20 2021, 1:58 PM
This revision was automatically updated to reflect the committed changes.