llvm-project/llvm/lib/Target/Hexagon
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 [Hexagon] Change iconst to emit 27bit relocation 2017-05-02 18:19:11 +00:00
Disassembler [Hexagon] Remove C6 and C7 as separate registers 2017-05-05 22:12:12 +00:00
MCTargetDesc [Hexagon] Remove C6 and C7 as separate registers 2017-05-05 22:12:12 +00:00
TargetInfo Move the global variables representing each Target behind accessor function 2016-10-09 23:00:34 +00:00
BitTracker.cpp Move size and alignment information of regclass to TargetRegisterInfo 2017-04-24 18:55:33 +00:00
BitTracker.h [Hexagon] Cache reached blocks in bit tracker instead of scanning list 2017-04-19 15:08:31 +00:00
CMakeLists.txt [Hexagon] Remove unused .td files 2017-02-10 19:54:00 +00:00
Hexagon.h
Hexagon.td [Hexagon] Introduce Hexagon V62 2017-02-10 23:46:45 +00:00
HexagonAsmPrinter.cpp [Hexagon] Change iconst to emit 27bit relocation 2017-05-02 18:19:11 +00:00
HexagonAsmPrinter.h Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
HexagonBitSimplify.cpp [Hexagon] Only increment debug counters if debug option is present 2017-04-25 18:56:14 +00:00
HexagonBitTracker.cpp Use Argument::hasAttribute and AttributeList::ReturnIndex more 2017-04-28 18:37:16 +00:00
HexagonBitTracker.h [Hexagon, TableGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-04 02:02:05 +00:00
HexagonBlockRanges.cpp [Hexagon] Fix a latent problem with interpreting live-in lane masks 2017-04-14 16:21:55 +00:00
HexagonBlockRanges.h [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-13 22:13:50 +00:00
HexagonBranchRelaxation.cpp [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-13 22:13:50 +00:00
HexagonCFGOptimizer.cpp [Hexagon] Do not move a block if it is on a fall-through path 2017-04-28 21:54:11 +00:00
HexagonCommonGEP.cpp Drop graph_ prefix 2017-02-09 20:37:46 +00:00
HexagonConstPropagation.cpp [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-14 22:50:46 +00:00
HexagonCopyToCombine.cpp [Hexagon] Make a couple of passes compliant with -opt-bisect-limit 2017-04-14 15:26:34 +00:00
HexagonDepArch.h [Hexagon] Introduce Hexagon V62 2017-02-10 23:46:45 +00:00
HexagonDepArch.td [Hexagon] Introduce Hexagon V62 2017-02-10 23:46:45 +00:00
HexagonDepDecoders.h [Hexagon] Change the vector scaling for vector offsets 2017-04-06 17:28:21 +00:00
HexagonDepIICHVX.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonDepIICScalar.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonDepITypes.h [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonDepITypes.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonDepInstrFormats.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonDepInstrInfo.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonDepMappings.td [Hexagon] Replace instruction definitions with auto-generated ones 2017-02-10 15:33:13 +00:00
HexagonDepOperands.td [Hexagon] Change the vector scaling for vector offsets 2017-04-06 17:28:21 +00:00
HexagonDepTimingClasses.h [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonEarlyIfConv.cpp [Hexagon] Factor out some common code in HexagonEarlyIfConv.cpp, NFC 2017-04-03 17:26:40 +00:00
HexagonExpandCondsets.cpp Move size and alignment information of regclass to TargetRegisterInfo 2017-04-24 18:55:33 +00:00
HexagonFixupHwLoops.cpp [CodeGen] Rename MachineInstrBuilder::addOperand. NFC 2017-01-13 09:58:52 +00:00
HexagonFrameLowering.cpp Move size and alignment information of regclass to TargetRegisterInfo 2017-04-24 18:55:33 +00:00
HexagonFrameLowering.h [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-16 01:00:40 +00:00
HexagonGenExtract.cpp [APInt] Move isMask and isShiftedMask out of APIntOps and into the APInt class. Implement them without memory allocation for multiword 2017-04-03 16:34:59 +00:00
HexagonGenInsert.cpp Drop graph_ prefix 2017-02-09 20:37:46 +00:00
HexagonGenMux.cpp [CodeGen] Rename MachineInstrBuilder::addOperand. NFC 2017-01-13 09:58:52 +00:00
HexagonGenPredicate.cpp [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-16 01:00:40 +00:00
HexagonHardwareLoops.cpp [Hexagon] Start using regmasks on calls 2017-02-17 22:14:51 +00:00
HexagonHazardRecognizer.cpp [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-17 01:09:05 +00:00
HexagonHazardRecognizer.h [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-17 01:09:05 +00:00
HexagonIICHVX.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonIICScalar.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonISelDAGToDAG.cpp [Hexagon] Refactor the DAG preprocessing code, NFC 2017-03-09 19:14:23 +00:00
HexagonISelLowering.cpp Add extra operand to CALLSEQ_START to keep frame part set up previously 2017-05-09 13:35:13 +00:00
HexagonISelLowering.h DAG: Make mayBeEmittedAsTailCall parameter const 2017-04-18 21:16:46 +00:00
HexagonInstrFormats.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonInstrFormatsV4.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonInstrFormatsV60.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonInstrInfo.cpp [Hexagon] Disable predicated calls by default 2017-05-05 22:13:57 +00:00
HexagonInstrInfo.h [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonIntrinsics.td [Hexagon] Add intrinsics for masked vector stores 2017-02-22 21:23:09 +00:00
HexagonIntrinsicsDerived.td [Hexagon] Separate Hexagon subreg indices for different register classes 2016-11-09 16:19:08 +00:00
HexagonIntrinsicsV3.td
HexagonIntrinsicsV4.td [Hexagon] Rename operand/predicate names for unshifted integers 2016-11-01 19:02:10 +00:00
HexagonIntrinsicsV5.td
HexagonIntrinsicsV60.td [Hexagon] Replace instruction definitions with auto-generated ones 2017-02-10 15:33:13 +00:00
HexagonLoopIdiomRecognition.cpp Kill off the old SimplifyInstruction API by converting remaining users. 2017-04-28 19:55:38 +00:00
HexagonMCInstLower.cpp [Hexagon] Add extenders for GD_PLT_B22_PCREL and LD_PLT_B22_PCREL 2017-05-02 18:15:33 +00:00
HexagonMachineFunctionInfo.cpp
HexagonMachineFunctionInfo.h [Hexagon, TableGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-04 02:02:05 +00:00
HexagonMachineScheduler.cpp [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonMachineScheduler.h Fix typo and place comment close to its target 2017-04-27 14:38:21 +00:00
HexagonMapAsm2IntrinV62.gen.td [Hexagon] Introduce Hexagon V62 2017-02-10 23:46:45 +00:00
HexagonNewValueJump.cpp [Hexagon] Avoid IMPLICIT_DEFs as new-value producers 2017-02-23 17:47:34 +00:00
HexagonOperands.td [Hexagon] Change iconst to emit 27bit relocation 2017-05-02 18:19:11 +00:00
HexagonOptAddrMode.cpp [Hexagon] Generate proper offset in opt-addr-mode 2017-04-19 15:15:51 +00:00
HexagonOptimizeSZextends.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
HexagonPatterns.td Add extra operand to CALLSEQ_START to keep frame part set up previously 2017-05-09 13:35:13 +00:00
HexagonPeephole.cpp [Hexagon] Separate Hexagon subreg indices for different register classes 2016-11-09 16:19:08 +00:00
HexagonPseudo.td Add extra operand to CALLSEQ_START to keep frame part set up previously 2017-05-09 13:35:13 +00:00
HexagonRDFOpt.cpp Remove unused lambda captures. NFC 2017-01-13 17:12:16 +00:00
HexagonRegisterInfo.cpp [Hexagon] Implement @llvm.readcyclecounter() 2017-02-22 22:28:47 +00:00
HexagonRegisterInfo.h [Hexagon] Start using regmasks on calls 2017-02-17 22:14:51 +00:00
HexagonRegisterInfo.td [Hexagon] Remove C6 and C7 as separate registers 2017-05-05 22:12:12 +00:00
HexagonSchedule.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonScheduleV4.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonScheduleV55.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonScheduleV60.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonScheduleV62.td [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonSelectionDAGInfo.cpp Make library calls sensitive to regparm module flag (Fixes PR3997). 2017-03-18 00:44:07 +00:00
HexagonSelectionDAGInfo.h [Hexagon] Add explicit default constructor for HexagonSelectionDAGInfo 2016-08-19 15:13:54 +00:00
HexagonSplitConst32AndConst64.cpp [Hexagon] Separate Hexagon subreg indices for different register classes 2016-11-09 16:19:08 +00:00
HexagonSplitDouble.cpp [Hexagon] Remove unused variables 2017-03-31 21:03:59 +00:00
HexagonStoreWidening.cpp [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-17 01:09:05 +00:00
HexagonSubtarget.cpp [Hexagon] Disable predicated calls by default 2017-05-05 22:13:57 +00:00
HexagonSubtarget.h [Hexagon] Disable predicated calls by default 2017-05-05 22:13:57 +00:00
HexagonTargetMachine.cpp [Hexagon] Generate proper offset in opt-addr-mode 2017-04-19 15:15:51 +00:00
HexagonTargetMachine.h [Hexagon] Add Hexagon-specific loop idiom recognition pass 2017-01-26 21:41:10 +00:00
HexagonTargetObjectFile.cpp [Hexagon, TableGen] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-04 02:02:05 +00:00
HexagonTargetObjectFile.h Target: Change various section classifiers in TargetLoweringObjectFile to take a GlobalObject. 2016-10-24 19:23:39 +00:00
HexagonTargetStreamer.h
HexagonTargetTransformInfo.cpp [Hexagon] Consider zext/sext of a load to i32 to be free 2016-08-19 14:22:07 +00:00
HexagonTargetTransformInfo.h Do a sweep over move ctors and remove those that are identical to the default. 2016-10-20 12:20:28 +00:00
HexagonVLIWPacketizer.cpp [Hexagon] Use automatically-generated scheduling information for HVX 2017-05-03 20:10:36 +00:00
HexagonVLIWPacketizer.h [Hexagon] Fix uninitialized value caught with valgrind 2017-05-02 18:29:49 +00:00
HexagonVectorPrint.cpp [Hexagon] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2016-12-17 01:09:05 +00:00
LLVMBuild.txt [Hexagon] Require IPO library in Hexagon build 2017-01-26 23:03:22 +00:00
RDFCopy.cpp [RDF] Use faster version of findBlock 2017-04-19 15:11:23 +00:00
RDFCopy.h [RDF] Remove the map of reaching defs from copy propagation 2017-03-10 22:44:24 +00:00
RDFDeadCode.cpp [Hexagon] Start using regmasks on calls 2017-02-17 22:14:51 +00:00
RDFDeadCode.h
RDFGraph.cpp [RDF] No longer ignore implicit defs or uses on any instructions 2017-04-14 21:19:17 +00:00
RDFGraph.h [RDF] Switch NodeList to SmallVector from std::vector 2017-04-19 15:12:44 +00:00
RDFLiveness.cpp [RDF] Remove covered parts of reached uses for phi and use in same block 2017-05-05 22:10:32 +00:00
RDFLiveness.h [RDF] Implement Liveness::getNearestAliasedRef(Reg, Inst) 2017-03-10 22:42:17 +00:00
RDFRegisters.cpp [RDF] Remove covered parts of reached uses for phi and use in same block 2017-05-05 22:10:32 +00:00
RDFRegisters.h [RDF] Remove covered parts of reached uses for phi and use in same block 2017-05-05 22:10:32 +00:00