summaryrefslogtreecommitdiff
path: root/lib/Target/Mips/MipsDelaySlotFiller.cpp
Commit message (Collapse)AuthorAge
* [mips] Coding style clean up.Akira Hatanaka2013-10-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192125 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Make sure loads from lazy-binding entries do not get CSE'd or hoisted outAkira Hatanaka2013-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | of loops. Previously, two consecutive calls to function "func" would result in the following sequence of instructions: 1. load $16, %got(func)($gp) // load address of lazy-binding stub. 2. move $25, $16 3. jalr $25 // jump to lazy-binding stub. 4. nop 5. move $25, $16 6. jalr $25 // jump to lazy-binding stub again. With this patch, the second call directly jumps to func's address, bypassing the lazy-binding resolution routine: 1. load $25, %got(func)($gp) // load address of lazy-binding stub. 2. jalr $25 // jump to lazy-binding stub. 3. nop 4. load $25, %got(func)($gp) // load resolved address of func. 5. jalr $25 // directly jump to func. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191591 91177308-0d34-0410-b5e6-96231b3b80d8
* Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid ↵Craig Topper2013-07-03
| | | | | | specifying the vector size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185540 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't cache the instruction and register info from the TargetMachine, becauseBill Wendling2013-06-07
| | | | | | | the internals of TargetMachine could change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183493 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment.Akira Hatanaka2013-03-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177899 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Remove unused option. Fix 80-column violations.Akira Hatanaka2013-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176330 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Add the capability to search delay slot filling instructions inAkira Hatanaka2013-03-01
| | | | | | | | | successor basic blocks. Currently this is off by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176329 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Add options to disable searching backward and in successor blocks.Akira Hatanaka2013-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176321 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Add capability to search in the forward direction for instructions thatAkira Hatanaka2013-03-01
| | | | | | | | | can fill the delay slot. Currently, this is off by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176320 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Define helper function searchRangeAkira Hatanaka2013-03-01
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176318 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Rename function findDelayInstr to searchBackward.Akira Hatanaka2013-03-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176317 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Define class MemDefsUses.Akira Hatanaka2013-03-01
| | | | | | | | | This class tracks dependence between memory instructions using underlying objects of memory operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176313 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Use class RegDefsUses to track register defs and uses.Akira Hatanaka2013-02-26
| | | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176070 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Disallow moving load/store instructions past volatile instructions.Akira Hatanaka2013-02-14
| | | | | | | | Unfortunately, I wasn't able to create a test case that demonstrates the problem I was trying to fix with this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175226 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Replace usage of SmallSet with BitVector, which is used to keep track ofAkira Hatanaka2013-02-14
| | | | | | | | | defined and used registers. Also add a few helper functions to simplify the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175224 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Fix comments and coding style violations. Declare functions to be const.Akira Hatanaka2013-02-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175222 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Simplify code in function Filler::findDelayInstr.Akira Hatanaka2013-02-14
| | | | | | | | | | 1. Define and use function terminateSearch. 2. Use MachineBasicBlock::iterator instead of MachineBasicBlock::instr_iterator. 3. Delete the line which checks whether an instruction is a pseudo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175219 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Make Filler a class and reduce indentation.Akira Hatanaka2013-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174666 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new MIBundleBuilder class in the Mips target.Jakob Stoklund Olesen2012-12-07
| | | | | | This is the preferred way of creating bundled machine instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169585 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | 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. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* [mips] Fix delay slot filler so that instructions with register operand $1 areAkira Hatanaka2012-11-16
| | | | | | | allowed in branch delay slot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168131 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable Mips' delay slot filler when optimization level is O0.Akira Hatanaka2012-08-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162589 91177308-0d34-0410-b5e6-96231b3b80d8
* Add option disable-mips-delay-filler. Turn on mips' delay slot filler byAkira Hatanaka2012-08-22
| | | | | | | | | default. Patch by Carl Norum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162339 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix coding style violations. Remove white spaces and tabs.Akira Hatanaka2012-06-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158471 91177308-0d34-0410-b5e6-96231b3b80d8
* Bundle jump/branch instructions with the instructions in the delay slot inAkira Hatanaka2012-06-13
| | | | | | | | | | | delay slot filler pass of MIPS, per suggestion of Jakob Stoklund Olesen. This change, along with the fix in r158154, enables machine verification to be run after delay slot filling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158426 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch some getAliasSet clients to MCRegAliasIterator.Jakob Stoklund Olesen2012-06-01
| | | | | | | MCRegAliasIterator can optionally visit the register itself, allowing for simpler code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157837 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a command line option to skip the delay slot filler pass entirely for Mips.Akira Hatanaka2012-05-14
| | | | | | | | | | | The purpose of this option is to silence error messages issued by machine verifier passes and enable them to run to the end. If this option is not provided, -verify-machineinstrs complains when it discovers there is a non-terminator instruction (an instruction that is in a delay slot) after the first terminator in a basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156790 91177308-0d34-0410-b5e6-96231b3b80d8
* Use uint16_t to store register overlaps to reduce static data.Craig Topper2012-03-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152001 91177308-0d34-0410-b5e6-96231b3b80d8
* remove blanks, and some code formatJia Liu2012-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151625 91177308-0d34-0410-b5e6-96231b3b80d8
* remove Emacs-tag form .cpp files in Mips Backend, and fix some typo.Jia Liu2012-02-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150805 91177308-0d34-0410-b5e6-96231b3b80d8
* add Emacs tag and fix some comment error in file headersJia Liu2012-02-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150775 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up. Simplify logic. No functional change intended.Akira Hatanaka2011-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146896 91177308-0d34-0410-b5e6-96231b3b80d8
* Add bundle aware API for querying instruction properties and switch the codeEvan Cheng2011-12-07
| | | | | | | | | | | | | | | generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146026 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix assertion string.Akira Hatanaka2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141197 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure candidate for delay slot filler is not a return instruction.Akira Hatanaka2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141196 91177308-0d34-0410-b5e6-96231b3b80d8
* Add RA to the set of registers that are defined if instruction is a call.Akira Hatanaka2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141194 91177308-0d34-0410-b5e6-96231b3b80d8
* MipsDelaySlotFiller.cpp: Appease msvc to specify llvm::next() explicitly.NAKAMURA Takumi2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141174 91177308-0d34-0410-b5e6-96231b3b80d8
* Insert space.Akira Hatanaka2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141158 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not examine variadic or implicit operands if instruction is a return (jr).Akira Hatanaka2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141157 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up function Filler::delayHasHazard. Akira Hatanaka2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141156 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove function Filler::insertCallUses.Akira Hatanaka2011-10-05
| | | | | | | | Record the registers used and defined by a call in Filler::insertDefsUses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141154 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up Filler::findDelayInstr.Akira Hatanaka2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141152 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove function Filler::isDelayFiller. Check if I is the same instruction thatAkira Hatanaka2011-10-05
| | | | | | | | filled the last delay slot visited. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141151 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up Filler::runOnMachineBasicBlock. Change interface ofAkira Hatanaka2011-10-05
| | | | | | | | Filler::findDelayInstr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141150 91177308-0d34-0410-b5e6-96231b3b80d8
* Define a statistic for the number of slots that were filled with useful Akira Hatanaka2011-10-05
| | | | | | | | instructions (instructions that are not NOP). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141149 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary check. isDelayFiller(MBB, I) will evaluate to true beforeAkira Hatanaka2011-10-05
| | | | | | | | I->getDesc().hasDelaySlot() does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141148 91177308-0d34-0410-b5e6-96231b3b80d8
* Add comments and move assignment statement. If sawStore is true, sawLoad doesAkira Hatanaka2011-10-05
| | | | | | | | not have to be set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141147 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct description string of enable-mips-delay-filler.Akira Hatanaka2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141146 91177308-0d34-0410-b5e6-96231b3b80d8
* Fill delay slot with useful instructions. Modified from Sparc's version of delayAkira Hatanaka2011-09-29
| | | | | | | | | slot filler. Patch by Reed Kotler at Mips Technologies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140825 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop support for Mips1 and Mips2.Akira Hatanaka2011-09-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139405 91177308-0d34-0410-b5e6-96231b3b80d8