llvm-6502/lib/Target/Hexagon
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
..
Disassembler Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
MCTargetDesc MC: Remove MCSubtargetInfo() default constructor 2015-07-10 22:43:42 +00:00
TargetInfo
BitTracker.cpp [Hexagon] Use composition instead of inheritance from STL types 2015-07-18 17:43:23 +00:00
BitTracker.h [Hexagon] Use composition instead of inheritance from STL types 2015-07-18 17:43:23 +00:00
CMakeLists.txt [Hexagon] Generate MUX from conditional transfers when dot-new not possible 2015-07-20 21:23:25 +00:00
Hexagon.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
Hexagon.td
HexagonAsmPrinter.cpp MC: Add target hook to control symbol quoting 2015-06-09 00:31:39 +00:00
HexagonAsmPrinter.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonBitTracker.cpp [Hexagon] Use composition instead of inheritance from STL types 2015-07-18 17:43:23 +00:00
HexagonBitTracker.h [Hexagon] Move BitTracker into the llvm namespace and remove redundant qualifications 2015-07-13 20:38:16 +00:00
HexagonCallingConv.td
HexagonCFGOptimizer.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonCommonGEP.cpp [Hexagon] Use composition instead of inheritance from STL types 2015-07-18 17:43:23 +00:00
HexagonCopyToCombine.cpp [Hexagon] Moving pass declarations out of header and in to implementation files. Removing unused function getSubtargetInfo from HexagonMCCodeEmitter.cpp Removing deletion of copy construction and assignment operator since parent already deletes it. 2015-06-15 19:05:35 +00:00
HexagonExpandCondsets.cpp [Hexagon] Add missing preamble to a source file 2015-07-09 15:40:25 +00:00
HexagonExpandPredSpillCode.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonFixupHwLoops.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonFrameLowering.cpp MachineRegisterInfo: Remove UsedPhysReg infrastructure 2015-07-14 17:52:07 +00:00
HexagonFrameLowering.h PrologEpilogInserter: Rewrite API to determine callee save regsiters. 2015-07-14 17:17:13 +00:00
HexagonGenExtract.cpp [Hexagon] Generate "extract" instructions more aggressively 2015-07-14 17:07:24 +00:00
HexagonGenInsert.cpp [Hexagon] Generate "insert" instructions more aggressively 2015-07-08 14:47:34 +00:00
HexagonGenMux.cpp [Hexagon] Generate MUX from conditional transfers when dot-new not possible 2015-07-20 21:23:25 +00:00
HexagonGenPredicate.cpp Fix NDEBUG build warning 2015-07-14 21:03:24 +00:00
HexagonHardwareLoops.cpp [Hexagon] Moving pass declarations out of header and in to implementation files. Removing unused function getSubtargetInfo from HexagonMCCodeEmitter.cpp Removing deletion of copy construction and assignment operator since parent already deletes it. 2015-06-15 19:05:35 +00:00
HexagonInstrFormats.td
HexagonInstrFormatsV4.td [Hexagon] Reapply r239097 with tests corrected for shuffling and duplexing. 2015-06-05 16:00:11 +00:00
HexagonInstrInfo.cpp [CodeGen] ArrayRef'ize cond/pred in various TII APIs. NFC. 2015-06-11 19:30:37 +00:00
HexagonInstrInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonInstrInfo.td
HexagonInstrInfoV3.td
HexagonInstrInfoV4.td [Hexagon] Reapply r239097 with tests corrected for shuffling and duplexing. 2015-06-05 16:00:11 +00:00
HexagonInstrInfoV5.td
HexagonInstrInfoVector.td
HexagonIntrinsics.td [Hexagon] Making intrinsic tests agnostic to register allocation. Narrowing intrinsic parameters to appropriate width. 2015-06-12 19:57:32 +00:00
HexagonIntrinsicsDerived.td
HexagonIntrinsicsV3.td
HexagonIntrinsicsV4.td
HexagonIntrinsicsV5.td
HexagonISelDAGToDAG.cpp Use more foreach loops in SelectionDAG. NFC 2015-07-14 23:43:29 +00:00
HexagonISelLowering.cpp [Hexagon] Add support for atomic RMW operations 2015-07-09 14:51:21 +00:00
HexagonISelLowering.h [Hexagon] Add support for atomic RMW operations 2015-07-09 14:51:21 +00:00
HexagonIsetDx.td [Hexagon] Reapply r239097 with tests corrected for shuffling and duplexing. 2015-06-05 16:00:11 +00:00
HexagonMachineFunctionInfo.cpp
HexagonMachineFunctionInfo.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonMachineScheduler.cpp
HexagonMachineScheduler.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonMCInstLower.cpp
HexagonNewValueJump.cpp [Hexagon] Moving pass declarations out of header and in to implementation files. Removing unused function getSubtargetInfo from HexagonMCCodeEmitter.cpp Removing deletion of copy construction and assignment operator since parent already deletes it. 2015-06-15 19:05:35 +00:00
HexagonOperands.td [Hexagon] Making intrinsic tests agnostic to register allocation. Narrowing intrinsic parameters to appropriate width. 2015-06-12 19:57:32 +00:00
HexagonPeephole.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonRegisterInfo.cpp Targets: commonize some stack realignment code 2015-07-20 22:51:32 +00:00
HexagonRegisterInfo.h Targets: commonize some stack realignment code 2015-07-20 22:51:32 +00:00
HexagonRegisterInfo.td
HexagonRemoveSZExtArgs.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonSchedule.td
HexagonScheduleV4.td
HexagonSelectCCInfo.td
HexagonSelectionDAGInfo.cpp Remove getDataLayout() from TargetSelectionDAGInfo (had no users) 2015-07-09 02:10:08 +00:00
HexagonSelectionDAGInfo.h Remove getDataLayout() from TargetSelectionDAGInfo (had no users) 2015-07-09 02:10:08 +00:00
HexagonSplitConst32AndConst64.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonSubtarget.cpp Remove getDataLayout() from TargetSelectionDAGInfo (had no users) 2015-07-09 02:10:08 +00:00
HexagonSubtarget.h Replace string GNU Triples with llvm::Triple in MCSubtargetInfo and create*MCSubtargetInfo(). NFC. 2015-06-10 12:11:26 +00:00
HexagonTargetMachine.cpp [Hexagon] Generate MUX from conditional transfers when dot-new not possible 2015-07-20 21:23:25 +00:00
HexagonTargetMachine.h Replace string GNU Triples with llvm::Triple in TargetMachine. NFC. 2015-06-11 19:41:26 +00:00
HexagonTargetObjectFile.cpp Move most user of TargetMachine::getDataLayout to the Module one 2015-07-16 06:11:10 +00:00
HexagonTargetObjectFile.h
HexagonTargetStreamer.h Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
HexagonVLIWPacketizer.cpp [Hexagon] Use MF reference from parent class in HexagonPacketizerList 2015-06-23 13:50:23 +00:00
LLVMBuild.txt Add missing dependency to Hexagon target. 2015-07-08 21:13:37 +00:00
Makefile