This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Remove regalloc workaround for LDDWRdPtrQ
ClosedPublic

Authored by aykevl on Jan 20 2022, 12:59 PM.

Details

Summary

Background: https://github.com/avr-rust/rust-legacy-fork/issues/126

In short, this workaround was introduced to fix a "ran out of registers
during regalloc" issue. The root cause has since been fixed in
https://reviews.llvm.org/D54218 so this workaround can be removed.

There is one test that changes a little bit, removing a single
instruction. I also compiled compiler-rt before and after this patch but
didn't see a difference. So presumably the impact is very low. Still,
it's nice to be able to remove such a workaround.

Diff Detail

Event Timeline

aykevl created this revision.Jan 20 2022, 12:59 PM
aykevl requested review of this revision.Jan 20 2022, 12:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2022, 12:59 PM
benshi001 accepted this revision.Jan 23 2022, 6:05 AM
This revision is now accepted and ready to land.Jan 23 2022, 6:05 AM
This revision was landed with ongoing or failed builds.Jan 23 2022, 8:08 AM
This revision was automatically updated to reflect the committed changes.

Hi Folks,

I hate to say this, but I fear rolling this back may have been premature :-/. I am not even in the same universe as a MRE at the moment, just trying to work out why "stuff that used to work stopped working" recently, and I am getting errors like this:

*** Bad machine code: Using an undefined physical register ***
- function:    _ZN93_$LT$avr_oxide..devices..button..Button$LT$S$GT$$u20$as$u20$avr_oxide..event..EventSource$GT$13process_event17hb980a9f4dd8ffea1E
- basic block: %bb.2  (0x106888698)
- instruction: early-clobber $r31r30 = LDDWRdPtrQ killed $r31r30, 2, debug-location !10410 :: (load (s16) from %ir.26, align 1, !alias.scope !10396); /Users/timwa/Development/rust-avr-nightly-builder/build/rust/build/aarch64-apple-darwin/stage2/lib/rustlib/src/rust/library/alloc/src/boxed.rs:1861:38 @[ /Users/timwa/Development/avr-oxide/src/devices/button.rs:214:9 ]
- operand 1:   killed $r31r30
LLVM ERROR: Found 1 machine code errors.

(And of course the faithful ran out of registers... error.)

Re-applying this workaround patch makes the error go away :/. I will endeavour to reduce to a smaller example of course, right now it's buried in the middle of a codebase, but just to flag it up early - :-(.

Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 4:27 AM