llvm-6502/lib/Target/Mips
JF Bastien 9994b911f4 Targets: commonize some stack realignment code
This patch does the following:
* Fix FIXME on `needsStackRealignment`: it is now shared between multiple targets, implemented in `TargetRegisterInfo`, and isn't `virtual` anymore. This will break out-of-tree targets, silently if they used `virtual` and with a build error if they used `override`.
* Factor out `canRealignStack` as a `virtual` function on `TargetRegisterInfo`, by default only looks for the `no-realign-stack` function attribute.

Multiple targets duplicated the same `needsStackRealignment` code:
 - Aarch64.
 - ARM.
 - Mips almost: had extra `DEBUG` diagnostic, which the default implementation now has.
 - PowerPC.
 - WebAssembly.
 - x86 almost: has an extra `-force-align-stack` option, which the default implementation now has.

The default implementation of `needsStackRealignment` used to just return `false`. My current patch changes the behavior by simply using the above shared behavior. This affects:
 - AMDGPU
 - BPF
 - CppBackend
 - MSP430
 - NVPTX
 - Sparc
 - SystemZ
 - XCore
 - Out-of-tree targets
This is a breaking change! `make check` passes.

The only implementation of the `virtual` function (besides the slight different in x86) was Hexagon (which did `MF.getFrameInfo()->getMaxAlignment() > 8`), and potentially some out-of-tree targets. Hexagon now uses the default implementation.

`needsStackRealignment` was being overwritten in `<Target>GenRegisterInfo.inc`, to return `false` as the default also did. That was odd and is now gone.

Reviewers: sunfish

Subscribers: aemerson, llvm-commits, jfb

Differential Revision: http://reviews.llvm.org/D11160

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242727 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 22:51:32 +00:00
..
AsmParser Silencing two MSVC warnings; 'argument' : truncation from 'unsigned int' to 'int16_t' and truncation of constant value. NFC intended. 2015-07-14 14:14:00 +00:00
Disassembler [mips] Add COP0 register class and use it in M[FT]C0/DM[FT]C0. 2015-06-27 15:39:19 +00:00
InstPrinter MC: Add target hook to control symbol quoting 2015-06-09 00:31:39 +00:00
MCTargetDesc MC: Remove MCSubtargetInfo() default constructor 2015-07-10 22:43:42 +00:00
TargetInfo [Mips64] Add support for MCJIT for MIPS64r2 and MIPS64r6 2015-05-28 13:48:41 +00:00
CMakeLists.txt Remove getDataLayout() from TargetSelectionDAGInfo (had no users) 2015-07-09 02:10:08 +00:00
LLVMBuild.txt Wrap some long lines in LLVMBuild files. NFC 2015-06-12 18:44:57 +00:00
Makefile
MicroMips32r6InstrFormats.td [mips][microMIPS] Implement SLL and NOP instructions 2015-07-01 09:54:51 +00:00
MicroMips32r6InstrInfo.td [mips][microMIPS] Implement SLL and NOP instructions 2015-07-01 09:54:51 +00:00
MicroMipsInstrFormats.td
MicroMipsInstrFPU.td [mips] Only use FGR_{32,64} in TableGen descriptions. NFC. 2015-05-08 12:15:04 +00:00
MicroMipsInstrInfo.td [mips][microMIPS] Implement BREAK, EHB and EI instructions 2015-06-24 10:32:16 +00:00
Mips16FrameLowering.cpp PrologEpilogInserter: Rewrite API to determine callee save regsiters. 2015-07-14 17:17:13 +00:00
Mips16FrameLowering.h PrologEpilogInserter: Rewrite API to determine callee save regsiters. 2015-07-14 17:17:13 +00:00
Mips16HardFloat.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Mips16HardFloatInfo.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Mips16HardFloatInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Mips16InstrFormats.td
Mips16InstrInfo.cpp
Mips16InstrInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Mips16InstrInfo.td
Mips16ISelDAGToDAG.cpp Make TargetLowering::getPointerTy() taking DataLayout as an argument 2015-07-09 02:09:04 +00:00
Mips16ISelDAGToDAG.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Mips16ISelLowering.cpp Make TargetLowering::getPointerTy() taking DataLayout as an argument 2015-07-09 02:09:04 +00:00
Mips16ISelLowering.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Mips16RegisterInfo.cpp
Mips16RegisterInfo.h
Mips32r6InstrFormats.td [mips][microMIPSr6] Implement initial mapping support 2015-04-20 12:42:08 +00:00
Mips32r6InstrInfo.td [mips][microMIPSr6] Implement BEQZALC, BGEZALC, BGTZALC, BLEZALC, BLTZALC and BNEZALC instructions 2015-05-27 14:19:22 +00:00
Mips64InstrInfo.td [mips] Add COP0 register class and use it in M[FT]C0/DM[FT]C0. 2015-06-27 15:39:19 +00:00
Mips64r6InstrInfo.td
Mips.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Mips.td [mips] Add the SoftFloat MipsSubtarget feature. 2015-05-07 10:29:52 +00:00
MipsAnalyzeImmediate.cpp
MipsAnalyzeImmediate.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsAsmPrinter.cpp Move most user of TargetMachine::getDataLayout to the Module one 2015-07-16 06:11:10 +00:00
MipsAsmPrinter.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsCallingConv.td Rename the MIPS routine abiUsesSoftFloat -> useSoftFloat to match 2015-05-07 23:10:21 +00:00
MipsCCState.cpp
MipsCCState.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsCondMov.td [mips] Add the SoftFloat MipsSubtarget feature. 2015-05-07 10:29:52 +00:00
MipsConstantIslandPass.cpp Move most user of TargetMachine::getDataLayout to the Module one 2015-07-16 06:11:10 +00:00
MipsDelaySlotFiller.cpp Move most user of TargetMachine::getDataLayout to the Module one 2015-07-16 06:11:10 +00:00
MipsDSPInstrFormats.td
MipsDSPInstrInfo.td
MipsFastISel.cpp Make TargetLowering::getPointerTy() taking DataLayout as an argument 2015-07-09 02:09:04 +00:00
MipsFrameLowering.cpp [mips] Add support for dynamic stack realignment. 2015-06-02 13:14:46 +00:00
MipsFrameLowering.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsInstrFormats.td [mips] Added support for the ERETNC instruction. 2015-07-20 12:28:56 +00:00
MipsInstrFPU.td [mips] Only use FGR_{32,64} in TableGen descriptions. NFC. 2015-05-08 12:15:04 +00:00
MipsInstrInfo.cpp [CodeGen] ArrayRef'ize cond/pred in various TII APIs. NFC. 2015-06-11 19:30:37 +00:00
MipsInstrInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsInstrInfo.td [mips] Added support for the ERETNC instruction. 2015-07-20 12:28:56 +00:00
MipsISelDAGToDAG.cpp Make TargetLowering::getPointerTy() taking DataLayout as an argument 2015-07-09 02:09:04 +00:00
MipsISelDAGToDAG.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsISelLowering.cpp Move most user of TargetMachine::getDataLayout to the Module one 2015-07-16 06:11:10 +00:00
MipsISelLowering.h Allow {e,r}bp as the target of {read,write}_register. 2015-07-09 17:40:29 +00:00
MipsLongBranch.cpp
MipsMachineFunction.cpp [Mips] Use unique_ptr to manage ownership. 2015-04-16 12:43:33 +00:00
MipsMachineFunction.h [Mips] Use unique_ptr to manage ownership. 2015-04-16 12:43:33 +00:00
MipsMCInstLower.cpp Use MCSymbols for FastISel. 2015-06-23 12:21:54 +00:00
MipsMCInstLower.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsModuleISelDAGToDAG.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsMSAInstrFormats.td
MipsMSAInstrInfo.td [mips] Correct and improve special-case shuffle instructions. 2015-05-19 12:24:52 +00:00
MipsOptimizePICCall.cpp
MipsOptionRecord.h [mips] Add COP0 register class and use it in M[FT]C0/DM[FT]C0. 2015-06-27 15:39:19 +00:00
MipsOs16.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsRegisterInfo.cpp Targets: commonize some stack realignment code 2015-07-20 22:51:32 +00:00
MipsRegisterInfo.h Targets: commonize some stack realignment code 2015-07-20 22:51:32 +00:00
MipsRegisterInfo.td [mips] Add COP0 register class and use it in M[FT]C0/DM[FT]C0. 2015-06-27 15:39:19 +00:00
MipsSchedule.td
MipsSEFrameLowering.cpp [Mips] Make helper function static, NFC. 2015-07-16 11:12:05 +00:00
MipsSEFrameLowering.h PrologEpilogInserter: Rewrite API to determine callee save regsiters. 2015-07-14 17:17:13 +00:00
MipsSEInstrInfo.cpp [mips] Move ABI-dependent register selections to MipsABIInfo. NFC. 2015-04-17 09:50:21 +00:00
MipsSEInstrInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsSEISelDAGToDAG.cpp Make TargetLowering::getPointerTy() taking DataLayout as an argument 2015-07-09 02:09:04 +00:00
MipsSEISelDAGToDAG.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsSEISelLowering.cpp Re-instate the EVT parameter to getScalarShiftAmountTy() for OOT user 2015-07-09 15:12:23 +00:00
MipsSEISelLowering.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsSERegisterInfo.cpp [mips] Add support for dynamic stack realignment. 2015-06-02 13:14:46 +00:00
MipsSERegisterInfo.h
MipsSubtarget.cpp Remove getDataLayout() from TargetSelectionDAGInfo (had no users) 2015-07-09 02:10:08 +00:00
MipsSubtarget.h [mips] Added support for the ERETNC instruction. 2015-07-20 12:28:56 +00:00
MipsTargetMachine.cpp Make TargetTransformInfo keeping a reference to the Module DataLayout 2015-07-09 02:08:42 +00:00
MipsTargetMachine.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MipsTargetObjectFile.cpp Move most user of TargetMachine::getDataLayout to the Module one 2015-07-16 06:11:10 +00:00
MipsTargetObjectFile.h Move most user of TargetMachine::getDataLayout to the Module one 2015-07-16 06:11:10 +00:00
MipsTargetStreamer.h [mips] [IAS] Add support for the .module softfloat/hardfloat directives. 2015-06-30 13:46:03 +00:00
MSA.txt