llvm-project/llvm/lib/Target/AVR
Serge Pavlov d526b13e61 Add extra operand to CALLSEQ_START to keep frame part set up previously
Using arguments with attribute inalloca creates problems for verification
of machine representation. This attribute instructs the backend that the
argument is prepared in stack prior to  CALLSEQ_START..CALLSEQ_END
sequence (see http://llvm.org/docs/InAlloca.htm for details). Frame size
stored in CALLSEQ_START in this case does not count the size of this
argument. However CALLSEQ_END still keeps total frame size, as caller can
be responsible for cleanup of entire frame. So CALLSEQ_START and
CALLSEQ_END keep different frame size and the difference is treated by
MachineVerifier as stack error. Currently there is no way to distinguish
this case from actual errors.

This patch adds additional argument to CALLSEQ_START and its
target-specific counterparts to keep size of stack that is set up prior to
the call frame sequence. This argument allows MachineVerifier to calculate
actual frame size associated with frame setup instruction and correctly
process the case of inalloca arguments.

The changes made by the patch are:
- Frame setup instructions get the second mandatory argument. It
  affects all targets that use frame pseudo instructions and touched many
  files although the changes are uniform.
- Access to frame properties are implemented using special instructions
  rather than calls getOperand(N).getImm(). For X86 and ARM such
  replacement was made previously.
- Changes that reflect appearance of additional argument of frame setup
  instruction. These involve proper instruction initialization and
  methods that access instruction arguments.
- MachineVerifier retrieves frame size using method, which reports sum of
  frame parts initialized inside frame instruction pair and outside it.

The patch implements approach proposed by Quentin Colombet in
https://bugs.llvm.org/show_bug.cgi?id=27481#c1.
It fixes 9 tests failed with machine verifier enabled and listed
in PR27481.

Differential Revision: https://reviews.llvm.org/D32394

llvm-svn: 302527
2017-05-09 13:35:13 +00:00
..
AsmParser [TableGen] Move OperandMatchResultTy enum to MCTargetAsmParser.h 2016-11-01 16:32:05 +00:00
Disassembler [AVR] Compile the disassembler 2016-10-27 08:09:15 +00:00
InstPrinter [AVR] Remove a variable which was unused in release mode 2016-11-19 01:14:44 +00:00
MCTargetDesc [AVR] Fix a bug so that we now emit R_AVR_16 fixups with the correct offset 2017-04-30 23:33:52 +00:00
TargetInfo Move the global variables representing each Target behind accessor function 2016-10-09 23:00:34 +00:00
AVR.h [AVR] Add a function instrumentation pass 2016-12-14 10:15:00 +00:00
AVR.td [AVR] Split all of the AVR device definitions into a separate file 2016-10-05 10:28:45 +00:00
AVRAsmPrinter.cpp Move size and alignment information of regclass to TargetRegisterInfo 2017-04-24 18:55:33 +00:00
AVRCallingConv.td [AVR] Remove a bunch of unused variables 2016-11-19 01:33:42 +00:00
AVRDevices.td [AVR] Split all of the AVR device definitions into a separate file 2016-10-05 10:28:45 +00:00
AVRExpandPseudoInsts.cpp [AVR] Remove an unused local variable 2017-04-26 14:47:27 +00:00
AVRFrameLowering.cpp Add extra operand to CALLSEQ_START to keep frame part set up previously 2017-05-09 13:35:13 +00:00
AVRFrameLowering.h [AVR] Remove the 'AVRConfig.h' header 2016-05-18 11:20:48 +00:00
AVRISelDAGToDAG.cpp [AVR] Parenthesize a boolean expression 2017-01-07 00:55:28 +00:00
AVRISelLowering.cpp Add extra operand to CALLSEQ_START to keep frame part set up previously 2017-05-09 13:35:13 +00:00
AVRISelLowering.h [AVR] Implement non-constant bit rotations 2017-05-01 09:48:55 +00:00
AVRInstrFormats.td [AVR] Add the 'SoftFail' field to all instruction formats 2016-10-08 00:55:46 +00:00
AVRInstrInfo.cpp Move value type list from TargetRegisterClass to TargetRegisterInfo 2017-04-24 19:51:12 +00:00
AVRInstrInfo.h Finish renaming remaining analyzeBranch functions 2016-09-14 20:43:16 +00:00
AVRInstrInfo.td Add extra operand to CALLSEQ_START to keep frame part set up previously 2017-05-09 13:35:13 +00:00
AVRInstrumentFunctions.cpp Remove getArgumentList() in favor of arg_begin(), args(), etc 2017-03-16 22:59:15 +00:00
AVRMCInstLower.cpp [AVR] Use 'print' instead of 'dump' 2017-02-06 08:43:30 +00:00
AVRMCInstLower.h [AVR] Add the AVRMCInstLower class 2016-10-07 06:13:09 +00:00
AVRMachineFunctionInfo.h [AVR] Remove the 'AVRConfig.h' header 2016-05-18 11:20:48 +00:00
AVRRegisterInfo.cpp [AVR] Reserve the Y register in all functions 2017-05-03 11:56:01 +00:00
AVRRegisterInfo.h [AVR] Add AVRRegisterInfo::splitReg function 2016-10-05 13:27:30 +00:00
AVRRegisterInfo.td
AVRRelaxMemOperations.cpp [AVR] Add an 'relax memory operation' pass 2016-12-13 05:53:14 +00:00
AVRSelectionDAGInfo.h [AVR] Convert C style comments to C++ 2016-05-18 09:43:01 +00:00
AVRSubtarget.cpp
AVRSubtarget.h [AVR] Remove the 'AVRConfig.h' header 2016-05-18 11:20:48 +00:00
AVRTargetMachine.cpp [AVR] Add a function instrumentation pass 2016-12-14 10:15:00 +00:00
AVRTargetMachine.h [AVR] Fix signuature of AVRTargetMachine constructor 2016-05-20 23:39:04 +00:00
AVRTargetObjectFile.cpp Target: Change various section classifiers in TargetLoweringObjectFile to take a GlobalObject. 2016-10-24 19:23:39 +00:00
AVRTargetObjectFile.h Target: Change various section classifiers in TargetLoweringObjectFile to take a GlobalObject. 2016-10-24 19:23:39 +00:00
CMakeLists.txt [AVR] Add a function instrumentation pass 2016-12-14 10:15:00 +00:00
LLVMBuild.txt [AVR] Add the machine code disassembler 2016-10-22 23:57:59 +00:00
README.md [AVR] Add a stub README file 2016-12-10 12:08:19 +00:00
TODO.md

README.md

AVR backend

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