1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/lib/Target/NVPTX
Serge Pavlov b8ce9ec478 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
..
InstPrinter [NVPTX] Added support for .f16x2 instructions. 2017-02-23 22:38:24 +00:00
MCTargetDesc Distinguish between code pointer size and DataLayout::getPointerSize() in DWARF info generation 2017-04-17 17:41:25 +00:00
TargetInfo Move the global variables representing each Target behind accessor function 2016-10-09 23:00:34 +00:00
cl_common_defines.h
CMakeLists.txt NVPTX: Move InferAddressSpaces to generic code 2017-01-31 01:10:58 +00:00
LLVMBuild.txt NVPTXCodeGen: Add IPO to libdeps, since r293189. 2017-01-27 02:11:10 +00:00
ManagedStringPool.h [NVPTX] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-09 22:16:51 +00:00
NVPTX.h NVPTX: Move InferAddressSpaces to generic code 2017-01-31 01:10:58 +00:00
NVPTX.td [NVPTX] Added intrinsics for atom.gen.{sys|cta}.* instructions. 2016-09-28 17:25:38 +00:00
NVPTXAllocaHoisting.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
NVPTXAllocaHoisting.h
NVPTXAsmPrinter.cpp Make getParamAlignment use argument numbers 2017-04-28 20:34:27 +00:00
NVPTXAsmPrinter.h [NVPTX] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-09 22:16:51 +00:00
NVPTXAssignValidGlobalNames.cpp
NVPTXFrameLowering.cpp MachineFunction: Return reference for getFrameInfo(); NFC 2016-07-28 18:40:00 +00:00
NVPTXFrameLowering.h
NVPTXGenericToNVVM.cpp CodeGen: Remove MachineFunctionAnalysis => Enable (Machine)ModulePasses 2016-08-24 01:52:46 +00:00
NVPTXImageOptimizer.cpp [NVPTX] Remove unnecessary isImageReadoOnly(), isImageWriteOnly(), & isImageReadWrite calls 2017-03-08 01:14:15 +00:00
NVPTXInstrFormats.td
NVPTXInstrInfo.cpp Move size and alignment information of regclass to TargetRegisterInfo 2017-04-24 18:55:33 +00:00
NVPTXInstrInfo.h [NVPTX] Remove dead code. 2016-12-14 23:20:40 +00:00
NVPTXInstrInfo.td Add extra operand to CALLSEQ_START to keep frame part set up previously 2017-05-09 13:35:13 +00:00
NVPTXIntrinsics.td [NVPTX] Added missing LDU/LDG intrinsics for f16. 2017-03-02 19:14:10 +00:00
NVPTXISelDAGToDAG.cpp [NVPTX] Reduce amount of boilerplate code used to select load instruction opcode. 2017-03-02 19:14:14 +00:00
NVPTXISelDAGToDAG.h [NVPTX] Added support for .f16x2 instructions. 2017-02-23 22:38:24 +00:00
NVPTXISelLowering.cpp Add extra operand to CALLSEQ_START to keep frame part set up previously 2017-05-09 13:35:13 +00:00
NVPTXISelLowering.h [NVPTX] Added support for .f16x2 instructions. 2017-02-23 22:38:24 +00:00
NVPTXLowerAggrCopies.cpp NVPTX: Extract mem intrinsic expansions into utilities 2017-02-08 17:49:52 +00:00
NVPTXLowerAggrCopies.h
NVPTXLowerAlloca.cpp [NVPTX] Remove NVPTXFavorNonGenericAddrSpaces pass. 2016-10-31 21:51:42 +00:00
NVPTXLowerArgs.cpp Make getParamAlignment use argument numbers 2017-04-28 20:34:27 +00:00
NVPTXMachineFunctionInfo.h
NVPTXMCExpr.cpp [NVPTX] Added support for half-precision floating point. 2017-01-13 20:56:17 +00:00
NVPTXMCExpr.h [NVPTX] Added support for half-precision floating point. 2017-01-13 20:56:17 +00:00
NVPTXPeephole.cpp [CodeGen] Rename MachineInstrBuilder::addOperand. NFC 2017-01-13 09:58:52 +00:00
NVPTXPrologEpilogPass.cpp MachineFunction: Return reference for getFrameInfo(); NFC 2016-07-28 18:40:00 +00:00
NVPTXRegisterInfo.cpp [NVPTX] Added support for .f16x2 instructions. 2017-02-23 22:38:24 +00:00
NVPTXRegisterInfo.h
NVPTXRegisterInfo.td [NVPTX] Added support for .f16x2 instructions. 2017-02-23 22:38:24 +00:00
NVPTXReplaceImageHandles.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
NVPTXSection.h Only print architecture dependent flags for that architecture. 2017-01-30 15:38:43 +00:00
NVPTXSubtarget.cpp [NVPTX] Added support for half-precision floating point. 2017-01-13 20:56:17 +00:00
NVPTXSubtarget.h [NVPTX] Added support for half-precision floating point. 2017-01-13 20:56:17 +00:00
NVPTXTargetMachine.cpp NVPTX: Move InferAddressSpaces to generic code 2017-01-31 01:10:58 +00:00
NVPTXTargetMachine.h Replace addEarlyAsPossiblePasses callback with adjustPassManager 2017-01-26 16:49:08 +00:00
NVPTXTargetObjectFile.h [NVPTX] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-01-09 22:16:51 +00:00
NVPTXTargetTransformInfo.cpp [X86] updating TTI costs for arithmetic instructions on X86\SLM arch. 2017-01-11 08:23:37 +00:00
NVPTXTargetTransformInfo.h NVPTX: Refactor NVPTXInferAddressSpaces to check TTI 2017-01-30 23:02:12 +00:00
NVPTXUtilities.cpp [NVPTX] Remove dead code. 2016-12-14 23:20:40 +00:00
NVPTXUtilities.h [NVPTX] Remove dead #defines from NVPTXUtilities.h. 2016-12-15 00:45:06 +00:00
NVPTXVector.td
NVVMIntrRange.cpp [NVVMIntrRange] Only set range metadata if none is already present 2016-12-22 00:51:59 +00:00
NVVMReflect.cpp [NVPTX] Let there be One True Way to set NVVMReflect params. 2017-01-15 16:54:35 +00:00