summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervals.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [MIBundle] Turn MachineOperandIteratorBase into a forward iterator.Florian Hahn2019-12-051-3/+3
| | | | | | | | | | | | | | | This patch turns MachineOperandIteratorBase into a regular forward iterator, which can be used with iterator_range. It also adds mi_bundle_ops and const_mi_bundle_ops that return iterator ranges over all operands in a bundle and updates a use of the old iterator. Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D70561
* LiveIntervals: Split live intervals on multiple dead defsKrzysztof Parzyszek2019-10-301-3/+14
| | | | | | | | | | This is a follow-up to D67448. Split live intervals with multiple dead defs during the initial execution of the live interval analysis, but do it outside of the function createAndComputeVirtRegInterval. Differential Revision: https://reviews.llvm.org/D68666
* LiveIntervals: Fix handleMoveUp with subreg def moving across a defMatt Arsenault2019-10-181-1/+16
| | | | | | | | | If a subregister def was moved across another subregister def and another use, the main range was not correctly updated. The end point of the moved interval ended too early and missed the use from theh other lanes in the subreg def. llvm-svn: 375300
* Move LiveRangeCalc header to publicily available position. NFCMarcello Maggioni2019-10-171-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D69078 llvm-svn: 375075
* Temporarily revert r371640 "LiveIntervals: Split live intervals on multiple ↵Tim Shen2019-09-131-11/+1
| | | | | | | | dead defs". It reveals a miscompile on Hexagon. See PR43302 for details. llvm-svn: 371802
* LiveIntervals: Split live intervals on multiple dead defsMatt Arsenault2019-09-111-1/+11
| | | | | | | | If there are multiple dead defs of the same virtual register, these are required to be split into multiple virtual registers with separate live intervals to avoid a verifier error. llvm-svn: 371640
* Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVMDaniel Sanders2019-08-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This clang-tidy check is looking for unsigned integer variables whose initializer starts with an implicit cast from llvm::Register and changes the type of the variable to llvm::Register (dropping the llvm:: where possible). Partial reverts in: X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister X86FixupLEAs.cpp - Some functions return unsigned and arguably should be MCRegister X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister HexagonBitSimplify.cpp - Function takes BitTracker::RegisterRef which appears to be unsigned& MachineVerifier.cpp - Ambiguous operator==() given MCRegister and const Register PPCFastISel.cpp - No Register::operator-=() PeepholeOptimizer.cpp - TargetInstrInfo::optimizeLoadInstr() takes an unsigned& MachineTraceMetrics.cpp - MachineTraceMetrics lacks a suitable constructor Manual fixups in: ARMFastISel.cpp - ARMEmitLoad() now takes a Register& instead of unsigned& HexagonSplitDouble.cpp - Ternary operator was ambiguous between unsigned/Register HexagonConstExtenders.cpp - Has a local class named Register, used llvm::Register instead of Register. PPCFastISel.cpp - PPCEmitLoad() now takes a Register& instead of unsigned& Depends on D65919 Reviewers: arsenm, bogner, craig.topper, RKSimon Reviewed By: arsenm Subscribers: RKSimon, craig.topper, lenary, aemerson, wuzish, jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65962 llvm-svn: 369041
* Finish moving TargetRegisterInfo::isVirtualRegister() and friends to ↵Daniel Sanders2019-08-011-16/+15
| | | | | | llvm::Register as started by r367614. NFC llvm-svn: 367633
* LiveIntervals: Fix handleMove asserting on BUNDLEMatt Arsenault2019-07-191-1/+4
| | | | | | | | | The top-level BUNDLE instruction should behave as an ordinary instruction. It is supposed to have all relevant registers as implicit operands. Moving it should work as any other instruction. I believe the assert intended to avoid moving instructions inside bundles. llvm-svn: 366605
* Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFCFangrui Song2019-06-211-4/+2
| | | | llvm-svn: 364006
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* Silence "unused variable" warning in LiveIntervals.cpp after r335607Krzysztof Parzyszek2018-06-261-0/+1
| | | | llvm-svn: 335610
* Account for undef values from predecessors in extendSegmentsToUsesKrzysztof Parzyszek2018-06-261-16/+42
| | | | | | | | It is legal for a PHI node not to have a live value in a predecessor as long as the end of the predecessor is jointly dominated by an undef value. llvm-svn: 335607
* Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-141-21/+24
| | | | | | | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it. In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one. Differential Revision: https://reviews.llvm.org/D43624 llvm-svn: 332240
* [DebugInfo] Examine all uses of isDebugValue() for debug instructions.Shiva Chen2018-05-091-3/+3
| | | | | | | | | | | | | | | | | | Because we create a new kind of debug instruction, DBG_LABEL, we need to check all passes which use isDebugValue() to check MachineInstr is debug instruction or not. When expelling debug instructions, we should expel both DBG_VALUE and DBG_LABEL. So, I create a new function, isDebugInstr(), in MachineInstr to check whether the MachineInstr is debug instruction or not. This patch has no new test case. I have run regression test and there is no difference in regression test. Differential Revision: https://reviews.llvm.org/D45342 Patch by Hsiangkai Wang. llvm-svn: 331844
* IWYU for llvm-config.h in llvm, additions.Nico Weber2018-04-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See r331124 for how I made a list of files missing the include. I then ran this Python script: for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines() found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl)) and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot. No intended behavior change. llvm-svn: 331184
* [NFC] fix trivial typos in documents and commentsHiroshi Inoue2018-04-121-1/+1
| | | | | | "is is" -> "is", "if if" -> "if", "or or" -> "or" llvm-svn: 329878
* [LiveIntervals] Handle moving up dead partial writeTim Renouf2018-02-261-0/+30
| | | | | | | | | | | | | | | | | | | | | | | Summary: In the test case, the machine scheduler moves a dead write to a subreg up into the middle of a segment of the overall reg's live range, where the segment had liveness only for other subregs in the reg. handleMoveUp created an invalid live range, causing an assert a bit later. This commit fixes it to handle that situation. The segment is split in two at the insertion point, and the part after the split, and any subsequent segments up to the old position, are changed to be defined by the moved def. V2: Better test. Subscribers: MatzeB, nhaehnle, llvm-commits Differential Revision: https://reviews.llvm.org/D43478 Change-Id: Ibc42445ddca84e79ad1f616401015d22bc63832e llvm-svn: 326087
* Rename LiveIntervalAnalysis.h to LiveIntervals.hMatthias Braun2017-12-131-0/+1598
| | | | | | | | | | Headers/Implementation files should be named after the class they declare/define. Also eliminated an `#include "llvm/CodeGen/LiveIntervalAnalysis.h"` in favor of `class LiveIntarvals;` llvm-svn: 320546
* Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)Chris Lattner2004-07-231-674/+0
| | | | llvm-svn: 15135
* Pull the LiveRange and LiveInterval classes out of LiveIntervals.h (whichChris Lattner2004-07-231-164/+25
| | | | | | | | | | | | will soon be renamed) into their own file. The new file should not emit DEBUG output or have other side effects. The LiveInterval class also now doesn't know whether its working on registers or some other thing. In the future we will want to use the LiveInterval class and friends to do stack packing. In addition to a code simplification, this will allow us to do it more easily. llvm-svn: 15134
* Improve comments a bitChris Lattner2004-07-231-50/+45
| | | | | | | | | | | | | | | | | | | | | | | | | Use an explicit LiveRange class to represent ranges instead of an std::pair. This is a minor cleanup, but is really intended to make a future patch simpler and less invasive. Alkis, could you please take a look at LiveInterval::liveAt? I suspect that you can add an operator<(unsigned) to LiveRange, allowing us to speed up the upper_bound call by quite a bit (this would also apply to other callers of upper/lower_bound). I would do it myself, but I still don't understand that crazy liveAt function, despite the comment. :) Basically I would like to see this: LiveRange dummy(index, index+1); Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), dummy); Turn into: Ranges::const_iterator r = std::upper_bound(ranges.begin(), ranges.end(), index); llvm-svn: 15130
* Force coallescing of live ranges that have a single definition, even if theyChris Lattner2004-07-231-9/+29
| | | | | | | | | | | | | | | | | | | | | | | | interfere. Because these intervals have a single definition, and one of them is a copy instruction, they are always safe to merge even if their lifetimes interfere. This slightly reduces the amount of spill code, for example on 252.eon, from: 12837 spiller - Number of loads added 7604 spiller - Number of stores added 5842 spiller - Number of register spills 18155 liveintervals - Number of identity moves eliminated after coalescing to: 12754 spiller - Number of loads added 7585 spiller - Number of stores added 5803 spiller - Number of register spills 18262 liveintervals - Number of identity moves eliminated after coalescing The much much bigger win would be to merge intervals with multiple definitions (aka phi nodes) but this is not that day. llvm-svn: 15124
* Fix broken -debug printingChris Lattner2004-07-221-0/+1
| | | | llvm-svn: 15115
* Sorting is now handled by both linearscan and iterative scan so liveAlkis Evlogimenos2004-07-221-10/+0
| | | | | | | intervals need not be sorted anymore. Removing this redundant step improves LiveIntervals running time by 5% on 176.gcc. llvm-svn: 15106
* That funny 2-address lowering pass can also cause multiple definitions,Chris Lattner2004-07-221-8/+18
| | | | | | | fortunately, they are easy to handle if we know about them. This patch fixes some serious pessimization of code produced by the linscan register allocator. llvm-svn: 15092
* These files don't need to include <iostream> since they include ↵Brian Gaeke2004-07-211-1/+0
| | | | | | "Support/Debug.h". llvm-svn: 15089
* Remove unneeded functor. LiveInterval has a < operator.Alkis Evlogimenos2004-07-201-11/+1
| | | | llvm-svn: 15031
* Fix a bug that occurs when the last instruction in a range is deadChris Lattner2004-07-191-3/+6
| | | | llvm-svn: 15005
* When joining intervals, join intervals in deeply nested loops first. ThisChris Lattner2004-07-191-4/+34
| | | | | | | is a simple change, but seems to improve code a little. For example, on 256.bzip2, we went from 75.0s -> 73.33s (2% speedup). llvm-svn: 15004
* Split joinIntervals into two methodsChris Lattner2004-07-191-84/+85
| | | | llvm-svn: 15003
* There is no need to store the MBB along with the MI any more, we can nowChris Lattner2004-07-191-6/+6
| | | | | | ask instructions for their parent. llvm-svn: 14998
* Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)Chris Lattner2004-07-191-1/+1
| | | | llvm-svn: 14997
* Two changes, both very significant:Chris Lattner2004-07-191-11/+2
| | | | | | | | | | * vreg <-> vreg joining now works, enable it unconditionally when joining is enabled (which is the default). * Fix a serious pessimization of spill code where we were saying that a spilled DEF operand was live into the subsequent instruction. This allows for substantially better code when spilling starts to happen. llvm-svn: 14993
* See comments. The live intervals were not coming out of the spiller in sortedChris Lattner2004-07-191-1/+20
| | | | | | | | | order, causing the inactive list in the linearscan list to get unsorted, which basically fuxored everything up severely. These seems to fix the joiner, so with more testing I will enable it by default. llvm-svn: 14992
* remove the mbbi2mbbMap_, which was just keeping track of mbb order anyway.Chris Lattner2004-07-191-54/+73
| | | | | | | | | | Heavily refactor handleVirtualRegisterDef, adding comments and making it more efficient. It is also much easier to follow and convince ones self that it is correct :) Add -debug output to the joine, showing the result of joining the intervals. llvm-svn: 14989
* It looks like physref->virtreg joining is working fine. Enable it by defaultChris Lattner2004-07-171-10/+19
| | | | | | but make virtreg->virtreg joining stay off by default llvm-svn: 14916
* Fix typo.Alkis Evlogimenos2004-07-091-1/+1
| | | | llvm-svn: 14720
* Improve code comments.Alkis Evlogimenos2004-07-091-5/+11
| | | | llvm-svn: 14719
* Disable coalescing.Alkis Evlogimenos2004-07-071-1/+1
| | | | llvm-svn: 14655
* Do not crash when joining two intervals of registers of differentAlkis Evlogimenos2004-07-061-1/+10
| | | | | | | classes: just ignore that move. Thanks to Vladimir Prus who found the bug! llvm-svn: 14644
* Revert patches 1.79 and 1.80 which had to do with dead MBB's. Now that theyChris Lattner2004-07-021-6/+4
| | | | | | don't exist, we don't have to pretend to handle them. llvm-svn: 14567
* Now that MachineFunction/MachineBasicBlock keep a mapping of blocks to ID #'sChris Lattner2004-07-011-1/+1
| | | | | | use them instead of a local LiveVariables numbering llvm-svn: 14523
* Start using MBB numbers directly instead of going through the live variablesChris Lattner2004-07-011-1/+1
| | | | | | map. llvm-svn: 14518
* In line with the previous patch, do not assert out if analyzing a dead basic ↵Chris Lattner2004-06-291-1/+4
| | | | | | block. llvm-svn: 14475
* Do not dereference end iterators. It hurts when you do that.Chris Lattner2004-06-291-3/+2
| | | | llvm-svn: 14474
* Made a fix so that you can print out MachineInstrs that belong to a ↵Tanya Lattner2004-06-251-3/+3
| | | | | | MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function. llvm-svn: 14389
* Rename Interval class to LiveInterval to avoid conflicting with the alreadyChris Lattner2004-06-211-24/+27
| | | | | | | | | existing llvm::Interval class. Patch contributed by Vladimir Prus! http://mail.cs.uiuc.edu/pipermail/llvmbugs/2004-June/000710.html llvm-svn: 14281
* Adjust to new TargetMachine interfaceChris Lattner2004-06-021-5/+4
| | | | llvm-svn: 13956
* Pull Interval class out of LiveIntervals.Alkis Evlogimenos2004-05-301-19/+15
| | | | llvm-svn: 13910
OpenPOWER on IntegriCloud