summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Mips/MipsMachineFunction.cpp
AgeCommit message (Collapse)Author
2023-12-04[CodeGen] Split off PseudoSourceValueManager into separate header (NFC) (#73327)Nikita Popov
Most users of PseudoSourceValue.h only need PseudoSourceValue, not the PseudoSourceValueManager. However, this header pulls in some very expensive dependencies like ValueMap.h, which is only used for the manager. Split off the manager into a separate header and include it only where used.
2022-06-07llvm-reduce: Add cloning of target MachineFunctionInfoMatt Arsenault
MIR support is totally unusable for AMDGPU without this, since the set of reserved registers is set from fields here. Add a clone method to MachineFunctionInfo. This is a subtle variant of the copy constructor that is required if there are any MIR constructs that use pointers. Specifically, at minimum fields that reference MachineBasicBlocks or the MachineFunction need to be adjusted to the values in the new function.
2022-05-26[Target] use getSubtarget<> instead of static_cast<>(getSubtarget())Zongwei Lan
Differential Revision: https://reviews.llvm.org/D125391
2022-01-07[Target] use range-based for loops (NFC)Kazu Hirata
2020-07-01[Alignment][NFC] Migrate MachineFrameInfo::CreateStackObject to AlignGuillaume Chatelet
This patch is part of a series to introduce an Alignment type. See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html See this patch for the introduction of the type: https://reviews.llvm.org/D64790 Differential Revision: https://reviews.llvm.org/D82894
2020-06-30Mips: Don't store MachineFunction in MipsFunctionInfoMatt Arsenault
It will soon be disallowed to depend on MachineFunction state on construction.
2020-05-19CodeGen: Use RegisterMatt Arsenault
2019-06-24GlobalISel: Remove unsigned variant of SrcOpMatt Arsenault
Force using Register. One downside is the generated register enums require explicit conversion. llvm-svn: 364194
2019-05-31[MIPS GlobalISel] Handle position independent code Petar Avramovic
Handle position independent code for MIPS32. When callee is global address, lower call will emit callee as G_GLOBAL_VALUE and add target flag if needed. Support $gp in getRegBankFromRegClass(). Select G_GLOBAL_VALUE, specially handle case when there are target flags attached by lowerCall. Differential Revision: https://reviews.llvm.org/D62589 llvm-svn: 362210
2019-05-31[mips] Move initGlobalBaseReg to MipsFunctionInfo. NFCPetar Avramovic
Move initGlobalBaseReg from MipsSEDAGToDAGISel to MipsFunctionInfo. This way functions used for handling position independent code during instruction selection, getGlobalBaseReg and initGlobalBaseReg, end up in same class. Differential Revision: https://reviews.llvm.org/D62586 llvm-svn: 362206
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-07-21[mips] Factor out register class selection for global base register. NFCSimon Atanasyan
Factor out register class selection for global base register into a separate function to escape long chain of ternary operators. llvm-svn: 337647
2017-12-11[mips] Removal of microMIPS64R6Aleksandar Beserminji
All files and parts of files related to microMIPS4R6 are removed. When target is microMIPS4R6, errors are printed. This is LLVM part of patch. Differential Revision: https://reviews.llvm.org/D35625 llvm-svn: 320350
2017-11-17Fix a bunch more layering of CodeGen headers that are in TargetDavid Blaikie
All these headers already depend on CodeGen headers so moving them into CodeGen fixes the layering (since CodeGen depends on Target, not the other way around). llvm-svn: 318490
2017-06-07evert "[mips] Fix test mips64fpldst.ll with machine verifier enabled"Simon Dardis
This reverts commit r301394. It broke some internal buildbots, reverting while the issue is being investigated. llvm-svn: 304896
2017-06-06Sort the remaining #include lines in include/... and lib/....Chandler Carruth
I did this a long time ago with a janky python script, but now clang-format has built-in support for this. I fed clang-format every line with a #include and let it re-sort things according to the precise LLVM rules for include ordering baked into clang-format these days. I've reverted a number of files where the results of sorting includes isn't healthy. Either places where we have legacy code relying on particular include ordering (where possible, I'll fix these separately) or where we have particular formatting around #include lines that I didn't want to disturb in this patch. This patch is *entirely* mechanical. If you get merge conflicts or anything, just ignore the changes in this patch and run clang-format over your #include lines in the files. Sorry for any noise here, but it is important to keep these things stable. I was seeing an increasing number of patches with irrelevant re-ordering of #include lines because clang-format was used. This patch at least isolates that churn, makes it easy to skip when resolving conflicts, and gets us to a clean baseline (again). llvm-svn: 304787
2017-04-26[mips] Fix test mips64fpldst.ll with machine verifier enabledSagar Thakur
Removed micro mips register classes for gp initialization because gp initialization uses pure mips64 instruction. Even when compiling for micro mips, gp initialization can be done with pure mips64 instructions. Reviewed by Simon Dardis Differential: D32286 llvm-svn: 301394
2017-04-24Move size and alignment information of regclass to TargetRegisterInfoKrzysztof Parzyszek
1. RegisterClass::getSize() is split into two functions: - TargetRegisterInfo::getRegSizeInBits(const TargetRegisterClass &RC) const; - TargetRegisterInfo::getSpillSize(const TargetRegisterClass &RC) const; 2. RegisterClass::getAlignment() is replaced by: - TargetRegisterInfo::getSpillAlignment(const TargetRegisterClass &RC) const; This will allow making those values depend on subtarget features in the future. Differential Revision: https://reviews.llvm.org/D31783 llvm-svn: 301221
2017-01-30[Mips] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko
other minor fixes (NFC). llvm-svn: 293565
2016-11-18Fix spelling mistakes in MIPS target comments. NFC.Simon Pilgrim
Identified by Pedro Giffuni in PR27636. llvm-svn: 287338
2016-07-28MachineFunction: Return reference for getFrameInfo(); NFCMatthias Braun
getFrameInfo() never returns nullptr so we should use a reference instead of a pointer. llvm-svn: 277017
2016-06-16[mips][mips16] Fix machine verifier errors about incorrect register classes ↵Daniel Sanders
on load/stores. Summary: [ls][bh] and [ls][bh]u cannot use sp-relative addresses and must therefore lower frameindex nodes such that there is a copy to a CPU16Regs register. This is now done consistently using a separate addressing mode that does not permit frameindex nodes. As part of this I've had to remove an optimization that reduced the number of instructions needed to work around the lack of sp-relative addresses on [ls][bh] and [ls][bh]u. This optimization used one of the eight CPU16Regs registers as a copy of the stack pointer and it's implementation was the root cause of many of the register vs register class mismatches. lw/sw can use sp-relative addresses but we ought to ensure that we use the correct version of lw/sw internally for things like IAS. This is not currently the case and this change does not fix this. However, this change does clean it up sufficiently well to fix the machine verifier failures. Also removed irrelevant functions from stchar.ll. Reviewers: sdardis Subscribers: dsanders, sdardis, llvm-commits Differential Revision: http://reviews.llvm.org/D21062 llvm-svn: 272882
2016-04-13[mips][microMIPS] Fix for "Cannot copy registers" assertionHrvoje Varga
Differential Revision: http://reviews.llvm.org/D17068 This changes contains fix for failing test-suite. So, this patch should hopefully work now. llvm-svn: 266171
2016-04-02[mips][microMIPS] Revert commits r264245 and r264248.Zoran Jovanovic
Commit r264245 was the reason for failing tests in LLVM test suite. Commit r264248 depends on the first one. llvm-svn: 265249
2016-03-24[mips][microMIPS] Fix for "Cannot copy registers" assertionHrvoje Varga
Differential Revision: http://reviews.llvm.org/D17068 llvm-svn: 264245
2015-10-26[mips] Interrupt attribute support for mips32r2+.Vasileios Kalintiris
Summary: This patch adds support for using the "interrupt" attribute on Mips for interrupt handling functions. At this time only mips32r2+ with the o32 ABI with the static relocation model is supported. Unsupported configurations will be rejected Patch by Simon Dardis (+ clang-format & some trivial changes to follow the LLVM coding standards by me). Reviewers: mpf, dsanders Subscribers: dsanders, vkalintiris, llvm-commits Differential Revision: http://reviews.llvm.org/D10768 llvm-svn: 251286
2015-08-11PseudoSourceValue: Transform the mips subclass to target independent subclassesAlex Lorenz
This commit transforms the mips-specific 'MipsCallEntry' subclass of the 'PseudoSourceValue' class into two, target-independent subclasses named 'GlobalValuePseudoSourceValue' and 'ExternalSymbolPseudoSourceValue'. This change makes it easier to serialize the pseudo source values by removing target-specific pseudo source values. Reviewers: Akira Hatanaka llvm-svn: 244698
2015-08-11PseudoSourceValue: Introduce a 'PSVKind' enumerator.Alex Lorenz
This commit introduces a new enumerator named 'PSVKind' in the 'PseudoSourceValue' class. This enumerator is now used to distinguish between the various kinds of pseudo source values. This change is done in preparation for the changes to the pseudo source value object management and to the PseudoSourceValue's class hierarchy - the next two PseudoSourceValue commits will get rid of the global variable that manages the pseudo source values and the mips specific MipsCallEntry subclass. Reviewers: Akira Hatanaka llvm-svn: 244687
2015-04-16[Mips] Use unique_ptr to manage ownership.Benjamin Kramer
Required some tweaking of ValueMap to accommodate a move-only value type. No functional change intended. llvm-svn: 235091
2015-02-27[mips][microMIPS] Change register class for GP registerZoran Jovanovic
Differential Revision: http://reviews.llvm.org/D7934 llvm-svn: 230760
2015-02-13Re-sort #include lines using my handy dandy ./utils/sort_includes.pyChandler Carruth
script. This is in preparation for changes to lots of include lines. llvm-svn: 229088
2015-01-29Remove most of the TargetMachine::getSubtarget/getSubtargetImplEric Christopher
calls that don't take a Function argument from Mips. Notable exceptions: the AsmPrinter and MipsTargetObjectFile. The latter needs to be fixed, and the former will be fixed when the general AsmPrinter changes happen. llvm-svn: 227512
2014-11-21Remove a bunch of unnecessary typecasts to 'const TargetRegisterClass *'Craig Topper
llvm-svn: 222509
2014-08-30Fix some cases where StringRef was being passed by const reference. Remove ↵Craig Topper
const from some other StringRefs since its implicitly const already. llvm-svn: 216820
2014-07-14[mips] For the FP64A ABI, odd-numbered double-precision moves must not use ↵Daniel Sanders
mtc1/mfc1. Summary: This is because the FP64A the hardware will redirect 32-bit reads/writes from/to odd-numbered registers to the upper 32-bits of the corresponding even register. In effect, simulating FR=0 mode when FR=0 mode is not available. Unfortunately, we have to make the decision to avoid mfc1/mtc1 before register allocation so we currently do this for even registers too. FPXX has a similar requirement on 32-bit architectures that lack mfhc1/mthc1 so this patch also handles the affected moves from the FPU for FPXX too. Moves to the FPU were supported by an earlier commit. Differential Revision: http://reviews.llvm.org/D4484 llvm-svn: 212938
2014-07-14[mips] Expand BuildPairF64 to a spill and reload when the O32 FPXX ABI isSasa Stankovic
enabled and mthc1 and dmtc1 are not available (e.g. on MIPS32r1) This prevents the upper 32-bits of a double precision value from being moved to the FPU with mtc1 to an odd-numbered FPU register. This is necessary to ensure that the code generated executes correctly regardless of the current FPU mode. MIPS32r2 and above continues to use mtc1/mthc1, while MIPS-IV and above continue to use dmtc1. Differential Revision: http://reviews.llvm.org/D4465 llvm-svn: 212930
2014-05-07Use range loop.Rafael Espindola
llvm-svn: 208218
2014-04-28[C++] Use 'nullptr'.Craig Topper
llvm-svn: 207394
2013-10-08[mips] Simplify and optimize code.Akira Hatanaka
No intended functionality change. llvm-svn: 192213
2013-09-28MipsMachineFunction.cpp: Add missing #include <raw_ostream.h>NAKAMURA Takumi
llvm-svn: 191597
2013-09-27[mips] Define a derived class of PseudoSourceValue that represents a GOT entryAkira Hatanaka
resolved by lazy-binding. llvm-svn: 191578
2013-08-06[mips] Rename register classes CPURegs and CPU64Regs.Akira Hatanaka
llvm-svn: 187832
2013-01-30[mips] Lower EH_RETURN.Akira Hatanaka
Patch by Sasa Stankovic. llvm-svn: 173862
2013-01-02Move all of the header files which are involved in modelling the LLVM IRChandler Carruth
into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth
Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
2012-10-28This patch is for the implementation of mips16 complex pattern addr16.Reed Kotler
Previously mips16 was sharing the pattern addr which is used for mips32 and mips64. This had a number of problems: 1) Storing and loading byte and halfword quantities for mips16 has particular problems due to the primarily non mips16 nature of SP. When we must load/store byte/halfword stack objects in a function, we must create a mips16 alias register for SP. This functionality is tested in stchar.ll. 2) We need to have an FP register under certain conditions (such as dynamically sized alloca). We use mips16 register S0 for this purpose. In this case, we also use this register when accessing frame objects so this issue also affects the complex pattern addr16. This functionality is tested in alloca16.ll. The Mips16InstrInfo.td has been updated to use addr16 instead of addr. The complex pattern C++ function for addr has been copied to addr16 and updated to reflect the above issues. llvm-svn: 166897
2012-07-23Add basic ability to setup call frame, and make procedure calls.Akira Hatanaka
Hello world will compile and execute with this patch. Patch by Reed Kotler. llvm-svn: 160651
2012-07-21Revert accidental commit.Akira Hatanaka
llvm-svn: 160598
2012-07-21Add VK_Mips_HIGHER and VK_Mips_HIGHEST to MCSymbolRefExpr::VariantKind.Akira Hatanaka
Test case will be added later when long branch patch is checked in. llvm-svn: 160597
2012-05-12Delete all functions that are no longer needed in MipsFunctionInfo, includingAkira Hatanaka
the ones that get or set the frame index for the $gp save slot. Remove the piece of code in MipsFunctionInfo::getGlobalBaseReg() which returns GP. This function should always return a virtual register. llvm-svn: 156695