llvm-project/llvm/lib/Target/AVR
Ayke van Laethem a560e57a7e
[AVR] Only push and clear R1 in interrupts when necessary
R1 is a reserved register, but LLVM gives the APIs to know when it is
used or not. So this patch uses these APIs to only save/clear/restore R1
in interrupts when necessary.

The main issue here was getting inline assembly to work. One could argue
that this is the job of Clang, but for consistency I've made sure that
R1 is always usable in inline assembly even if that means clearing it
when it might not be needed.

Information on inline assembly in AVR can be found here:

https://www.nongnu.org/avr-libc/user-manual/inline_asm.html#asm_code

Essentially, this seems to suggest that r1 can be freely used in avr-gcc
inline assembly, even without specifying it as an input operand.

Differential Revision: https://reviews.llvm.org/D117426
2022-08-15 14:29:38 +02:00
..
AsmParser [llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 11:24:15 -07:00
Disassembler Rename `MCFixedLenDisassembler.h` as `MCDecoderOps.h` 2022-05-15 08:44:58 +08:00
MCTargetDesc [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
TargetInfo
AVR.h [AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts 2022-04-11 02:42:13 +00:00
AVR.td
AVRAsmPrinter.cpp [CodeGen] Move instruction predicate verification to emitInstruction 2022-07-14 09:33:28 +01:00
AVRCallingConv.td [AVR] Reject/Reserve R0~R15 on AVRTiny. 2022-03-24 02:33:51 +00:00
AVRDevices.td [AVR] Add more devices 2022-03-25 01:43:41 +00:00
AVRExpandPseudoInsts.cpp [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
AVRFrameLowering.cpp [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
AVRFrameLowering.h
AVRISelDAGToDAG.cpp [AVR] Generate ELPM for loading byte/word from extended program memory 2022-01-20 02:53:10 +00:00
AVRISelLowering.cpp [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
AVRISelLowering.h [AVR] Fix atomicrmw result value 2022-02-02 09:10:39 +01:00
AVRInstrFormats.td [MC][AVR] Implement decoding STD/LDD 2022-05-05 01:53:49 +00:00
AVRInstrInfo.cpp [AVR] Remove debug location of spill/reload instructions 2022-08-13 20:58:12 +08:00
AVRInstrInfo.h
AVRInstrInfo.td [AVR] Only push and clear R1 in interrupts when necessary 2022-08-15 14:29:38 +02:00
AVRMCInstLower.cpp
AVRMCInstLower.h
AVRMachineFunctionInfo.h llvm-reduce: Add cloning of target MachineFunctionInfo 2022-06-07 10:14:48 -04:00
AVRRegisterInfo.cpp [llvm] LLVM_FALLTHROUGH => [[fallthrough]]. NFC 2022-08-08 11:24:15 -07:00
AVRRegisterInfo.h [llvm] Use nullptr instead of 0 (NFC) 2021-12-28 08:52:25 -08:00
AVRRegisterInfo.td [AVR] Remove regalloc workaround for LDDWRdPtrQ 2022-01-23 17:08:00 +01:00
AVRSelectionDAGInfo.h
AVRShiftExpand.cpp
AVRSubtarget.cpp [Target] Remove redundant member initialization (NFC) 2022-01-06 22:01:44 -08:00
AVRSubtarget.h [AVR] Remove redundant void (NFC) 2022-07-17 18:08:50 -07:00
AVRTargetMachine.cpp [llvm] Use value_or instead of getValueOr (NFC) 2022-06-18 23:07:11 -07:00
AVRTargetMachine.h
AVRTargetObjectFile.cpp [AVR][MC] Generate section '.progmemX.data' for extended flash banks 2022-01-20 02:53:10 +00:00
AVRTargetObjectFile.h [AVR][MC] Generate section '.progmemX.data' for extended flash banks 2022-01-20 02:53:10 +00:00
CMakeLists.txt [AVR] Merge AVRRelaxMemOperations into AVRExpandPseudoInsts 2022-04-11 02:42:13 +00:00
README.md
TODO.md

README.md

AVR backend

This experimental backend is for the 8-bit Atmel AVR microcontroller.