aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/CallingConvEmitter.cpp
AgeCommit message (Collapse)AuthorFilesLines
2014-11-01[tablegen] Add CustomCallingConv and use it to tablegen-erate the outermost ↵Daniel Sanders1-14/+17
parts of the Mips O32 implementation Summary: CustomCallingConv is simply a CallingConv that tablegen should not generate the implementation for. It allows regular CallingConv's to delegate to these custom functions. This is (currently) necessary for Mips and we cannot use CCCustom without having to adapt to the different API that CCCustom uses. This brings us a bit closer to being able to remove MipsCC::analyzeCallOperands and MipsCC::analyzeFormalArguments in favour of the common implementation. No functional change to the targets. Depends on D3341 Reviewers: vmedic Reviewed By: vmedic Subscribers: vmedic, llvm-commits Differential Revision: http://reviews.llvm.org/D5965 llvm-svn: 221052
2014-09-25[mips] Add CCValAssign::[ASZ]ExtUpper and CCPromoteToUpperBitsInType and ↵Daniel Sanders1-0/+15
handle struct's correctly on big-endian N32/N64 return values. Summary: The N32/N64 ABI's require that structs passed in registers are laid out such that spilling the register with 'sd' places the struct at the lowest address. For little endian this is trivial but for big-endian it requires that structs are shifted into the upper bits of the register. We also require that structs passed in registers have the 'inreg' attribute for big-endian N32/N64 to work correctly. This is because the tablegen-erated calling convention implementation only has access to the lowered form of struct arguments (one or more integers of up to 64-bits each) and is unable to determine the original type. Reviewers: vmedic Reviewed By: vmedic Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5286 llvm-svn: 218451
2014-08-06Remove the target machine from CCState. Previously it was only usedEric Christopher1-2/+2
to get the subtarget and that's accessible from the MachineFunction now. This helps clear the way for smaller changes where we getting a subtarget will require passing in a MachineFunction/Function as well. llvm-svn: 214988
2014-08-04Remove the TargetMachine forwards for TargetSubtargetInfo basedEric Christopher1-4/+8
information and update all callers. No functional change. llvm-svn: 214781
2014-04-04Make consistent use of MCPhysReg instead of uint16_t throughout the tree.Craig Topper1-4/+4
llvm-svn: 205610
2014-02-07LLVM-1163: AAPCS-VFP violation when CPRC allocated to stackOliver Stannard1-2/+24
According to the AAPCS, when a CPRC is allocated to the stack, all other VFP registers should be marked as unavailable. I have also modified the rules for allocating non-CPRCs to the stack, to make it more explicit that all GPRs must be made unavailable. I cannot think of a case where the old version would produce incorrect answers, so there is no test for this. llvm-svn: 200970
2014-01-14Add FPExt option to CCValAssign::LocInfo. When generating calling-conventionLang Hames1-7/+12
promotion code, Tablegen will now select FPExt for floating point promotions (previously it had returned AExt, which is not valid for floating point types). Any out-of-tree targets that were relying on AExt being returned for FP promotions will need to update their code check for FPExt instead. llvm-svn: 199252
2012-10-25Remove exception handling usage from tblgen.Joerg Sonnenberger1-3/+4
Most places can use PrintFatalError as the unwinding mechanism was not used for anything other than printing the error. The single exception was CodeGenDAGPatterns.cpp, where intermediate errors during type resolution were ignored to simplify incremental platform development. This use is replaced by an error flag in TreePattern and bailout earlier in various places if it is set. llvm-svn: 166712
2012-10-08Move TargetData to DataLayout.Micah Villmow1-2/+2
llvm-svn: 165403
2012-06-11Write llvm-tblgen backends as functions instead of sub-classes.Jakob Stoklund Olesen1-2/+26
The TableGenBackend base class doesn't do much, and will be removed completely soon. Patch by Sean Silva! llvm-svn: 158311
2012-03-11Convert more static tables of registers used by calling convention to ↵Craig Topper1-3/+3
uint16_t to reduce space. llvm-svn: 152538
2011-10-01Move TableGen's parser and entry point into a libraryPeter Collingbourne1-1/+1
This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951
2011-07-29Unconstify InitsDavid Greene1-5/+5
Remove const qualifiers from Init references, per Chris' request. llvm-svn: 136531
2011-07-29[AVX] Constify InitsDavid Greene1-5/+5
Make references to Inits const everywhere. This is the final step before making them unique. llvm-svn: 136485
2011-07-11Revert r134921, 134917, 134908 and 134907. They're causing failuresEric Christopher1-5/+5
in multiple buildbots. llvm-svn: 134936
2011-07-11[AVX] Make Inits FoldableDavid Greene1-5/+5
Manage Inits in a FoldingSet. This provides several benefits: - Memory for Inits is properly managed - Duplicate Inits are folded into Flyweights, saving memory - It enforces const-correctness, protecting against certain classes of bugs The above benefits allow Inits to be used in more contexts, which in turn provides more dynamism to TableGen. This enhanced capability will be used by the AVX code generator to a fold common patterns together. llvm-svn: 134907
2010-11-04In the calling convention logic, ValVT is always a legal type,Duncan Sands1-2/+2
and as such can be represented by an MVT - the more complicated EVT is not needed. Use MVT for ValVT everywhere. llvm-svn: 118245
2010-11-03Inside the calling convention logic LocVT is always a simpleDuncan Sands1-4/+4
value type, so there is no point in passing it around using an EVT. Use the simpler MVT everywhere. Rather than trying to propagate this information maximally in all the code that using the calling convention stuff, I chose to do a mainly low impact change instead. llvm-svn: 118167
2010-08-06Fix eabi calling convention when a 64 bit value shadows r3.Rafael Espindola1-0/+2
Without this what was happening was: * R3 is not marked as "used" * ARM backend thinks it has to save it to the stack because of vaarg * Offset computation correctly ignores it * Offsets are wrong llvm-svn: 110446
2009-08-12Add contexts to some of the MVT APIs. No functionality change yet, just the ↵Owen Anderson1-2/+2
infrastructure work needed to get the contexts to where they need to be first. llvm-svn: 78759
2009-08-10Rename MVT to EVT, in preparation for splitting SimpleValueType out into its ↵Owen Anderson1-6/+6
own struct type. llvm-svn: 78610
2009-08-03Add 'Indirect' LocInfo class and use to pass __m128 on win64. Also minore ↵Anton Korobeynikov1-0/+4
fixes here and there (mostly __m64). llvm-svn: 77964
2009-07-29Move types back to the 2.5 API.Owen Anderson1-2/+2
llvm-svn: 77516
2009-07-22Get rid of the Pass+Context magic.Owen Anderson1-2/+2
llvm-svn: 76702
2009-07-09Thread LLVMContext through MVT and related parts of SDISel.Owen Anderson1-2/+2
llvm-svn: 75153
2009-07-03Replace std::iostreams with raw_ostream in TableGen.Daniel Dunbar1-3/+3
- Sorry, I can't help myself. - No intended functionality change. llvm-svn: 74742
2009-05-09Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands1-1/+1
will make it more obvious what it represents, and stop it being confused with the StoreSize. llvm-svn: 71349
2009-04-17Use CallConvLower.h and TableGen descriptions of the calling conventionsBob Wilson1-0/+9
for ARM. Patch by Sandeep Patel. llvm-svn: 69371
2009-01-12Rename getABITypeSize to getTypePaddedSize, asDuncan Sands1-1/+1
suggested by Chris. llvm-svn: 62099
2008-06-06Wrap MVT::ValueType in a struct to get type safetyDuncan Sands1-6/+6
and better control the abstraction. Rename the type to MVT. To update out-of-tree patches, the main thing to do is to rename MVT::ValueType to MVT, and rewrite expressions like MVT::getSizeInBits(VT) in the form VT.getSizeInBits(). Use VT.getSimpleVT() to extract a MVT::SimpleValueType for use in switch statements (you will get an assert failure if VT is an extended value type - these shouldn't exist after type legalization). This results in a small speedup of codegen and no new testsuite failures (x86-64 linux). llvm-svn: 52044
2008-04-02Add new CC lowering rule: provide a list of registers, which can be 'shadowed',Anton Korobeynikov1-0/+42
when some another register is used for argument passing. Currently is used on Win64. llvm-svn: 49079
2008-03-21Introduce a new node for holding call argumentDuncan Sands1-4/+4
flags. This is needed by the new legalize types infrastructure which wants to expand the 64 bit constants previously used to hold the flags on 32 bit machines. There are two functional changes: (1) in LowerArguments, if a parameter has the zext attribute set then that is marked in the flags; before it was being ignored; (2) PPC had some bogus code for handling two word arguments when using the ELF 32 ABI, which was hard to convert because of the bogusness. As suggested by the original author (Nicolas Geoffray), I've disabled it for the moment. Tested with "make check" and the Ada ACATS testsuite. llvm-svn: 48640
2008-03-10Increase ISD::ParamFlags to 64 bits. Increase the ByValSizeDale Johannesen1-2/+2
field to 32 bits, thus enabling correct handling of ByVal structs bigger than 0x1ffff. Abstract interface a bit. Fixes gcc.c-torture/execute/pr23135.c and gcc.c-torture/execute/pr28982b.c in gcc testsuite (were ICE'ing on ppc32, quietly producing wrong code on x86-32.) llvm-svn: 48122
2008-01-15Rename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove ↵Evan Cheng1-3/+6
unused parameters of CCStructAssign and add size and alignment requirement info. llvm-svn: 45997
2008-01-15Revert my last commit. Not needed.Evan Cheng1-20/+7
llvm-svn: 45994
2008-01-12ByVal arguments are passed on stack. Make sure to allocate a slot using size ↵Evan Cheng1-7/+20
and alignment information on the parameter attribute. llvm-svn: 45897
2007-12-29remove attributions from utils.Chris Lattner1-2/+2
llvm-svn: 45419
2007-11-14Eliminate the recently introduced CCAssignToStackABISizeAlignDuncan Sands1-12/+14
in favour of teaching CCAssignToStack that size 0 and/or align 0 means to use the ABI values. This seems a neater solution. It is safe since no legal value type has size 0. llvm-svn: 44107
2007-11-10Add CCAssignToStackABISizeAlign for convenience inDale Johannesen1-0/+9
dealing with types whose size & alignment are different on different subtargets. Use it for x86 f80. llvm-svn: 43988
2007-08-10propagate struct size and alignment of byval arguments to the DAGRafael Espindola1-1/+3
llvm-svn: 40986
2007-07-06Add the byval attributeRafael Espindola1-1/+2
llvm-svn: 37940
2007-03-07Refactoring of formal parameter flags. Enable properly use ofAnton Korobeynikov1-2/+6
zext/sext/aext stuff. llvm-svn: 35008
2007-03-06Use new SDIselParamAttr enumeration. This removes "magick" constantsAnton Korobeynikov1-2/+2
from formal attributes' flags processing. llvm-svn: 34963
2007-02-28rename some CCActionsChris Lattner1-2/+2
llvm-svn: 34724
2007-02-28implement CCPromoteToTypeChris Lattner1-8/+13
llvm-svn: 34720
2007-02-27reapplyChris Lattner1-1/+2
llvm-svn: 34697
2007-02-27*** empty log message ***Chris Lattner1-0/+128
llvm-svn: 34696