aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveIntervals.cpp
AgeCommit message (Collapse)AuthorFilesLines
2019-08-15Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVMDaniel Sanders1-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
2019-08-01Finish moving TargetRegisterInfo::isVirtualRegister() and friends to ↵Daniel Sanders1-16/+15
llvm::Register as started by r367614. NFC llvm-svn: 367633
2019-07-19LiveIntervals: Fix handleMove asserting on BUNDLEMatt Arsenault1-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
2019-06-21Simplify std::lower_bound with llvm::{bsearch,lower_bound}. NFCFangrui Song1-4/+2
llvm-svn: 364006
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-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
2018-06-26Silence "unused variable" warning in LiveIntervals.cpp after r335607Krzysztof Parzyszek1-0/+1
llvm-svn: 335610
2018-06-26Account for undef values from predecessors in extendSegmentsToUsesKrzysztof Parzyszek1-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
2018-05-14Rename DEBUG macro to LLVM_DEBUG.Nicola Zaghen1-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
2018-05-09[DebugInfo] Examine all uses of isDebugValue() for debug instructions.Shiva Chen1-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
2018-04-30IWYU for llvm-config.h in llvm, additions.Nico Weber1-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
2018-04-12[NFC] fix trivial typos in documents and commentsHiroshi Inoue1-1/+1
"is is" -> "is", "if if" -> "if", "or or" -> "or" llvm-svn: 329878
2018-02-26[LiveIntervals] Handle moving up dead partial writeTim Renouf1-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
2017-12-13Rename LiveIntervalAnalysis.h to LiveIntervals.hMatthias Braun1-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
2004-07-23Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)Chris Lattner1-674/+0
llvm-svn: 15135
2004-07-23Pull the LiveRange and LiveInterval classes out of LiveIntervals.h (whichChris Lattner1-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
2004-07-23Improve comments a bitChris Lattner1-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
2004-07-23Force coallescing of live ranges that have a single definition, even if theyChris Lattner1-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
2004-07-22Fix broken -debug printingChris Lattner1-0/+1
llvm-svn: 15115
2004-07-22Sorting is now handled by both linearscan and iterative scan so liveAlkis Evlogimenos1-10/+0
intervals need not be sorted anymore. Removing this redundant step improves LiveIntervals running time by 5% on 176.gcc. llvm-svn: 15106
2004-07-22That funny 2-address lowering pass can also cause multiple definitions,Chris Lattner1-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
2004-07-21These files don't need to include <iostream> since they include ↵Brian Gaeke1-1/+0
"Support/Debug.h". llvm-svn: 15089
2004-07-20Remove unneeded functor. LiveInterval has a < operator.Alkis Evlogimenos1-11/+1
llvm-svn: 15031
2004-07-19Fix a bug that occurs when the last instruction in a range is deadChris Lattner1-3/+6
llvm-svn: 15005
2004-07-19When joining intervals, join intervals in deeply nested loops first. ThisChris Lattner1-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
2004-07-19Split joinIntervals into two methodsChris Lattner1-84/+85
llvm-svn: 15003
2004-07-19There is no need to store the MBB along with the MI any more, we can nowChris Lattner1-6/+6
ask instructions for their parent. llvm-svn: 14998
2004-07-19Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)Chris Lattner1-1/+1
llvm-svn: 14997
2004-07-19Two changes, both very significant:Chris Lattner1-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
2004-07-19See comments. The live intervals were not coming out of the spiller in sortedChris Lattner1-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
2004-07-19remove the mbbi2mbbMap_, which was just keeping track of mbb order anyway.Chris Lattner1-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
2004-07-17It looks like physref->virtreg joining is working fine. Enable it by defaultChris Lattner1-10/+19
but make virtreg->virtreg joining stay off by default llvm-svn: 14916
2004-07-09Fix typo.Alkis Evlogimenos1-1/+1
llvm-svn: 14720
2004-07-09Improve code comments.Alkis Evlogimenos1-5/+11
llvm-svn: 14719
2004-07-07Disable coalescing.Alkis Evlogimenos1-1/+1
llvm-svn: 14655
2004-07-06Do not crash when joining two intervals of registers of differentAlkis Evlogimenos1-1/+10
classes: just ignore that move. Thanks to Vladimir Prus who found the bug! llvm-svn: 14644
2004-07-02Revert patches 1.79 and 1.80 which had to do with dead MBB's. Now that theyChris Lattner1-6/+4
don't exist, we don't have to pretend to handle them. llvm-svn: 14567
2004-07-01Now that MachineFunction/MachineBasicBlock keep a mapping of blocks to ID #'sChris Lattner1-1/+1
use them instead of a local LiveVariables numbering llvm-svn: 14523
2004-07-01Start using MBB numbers directly instead of going through the live variablesChris Lattner1-1/+1
map. llvm-svn: 14518
2004-06-29In line with the previous patch, do not assert out if analyzing a dead basic ↵Chris Lattner1-1/+4
block. llvm-svn: 14475
2004-06-29Do not dereference end iterators. It hurts when you do that.Chris Lattner1-3/+2
llvm-svn: 14474
2004-06-25Made a fix so that you can print out MachineInstrs that belong to a ↵Tanya Lattner1-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
2004-06-21Rename Interval class to LiveInterval to avoid conflicting with the alreadyChris Lattner1-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
2004-06-02Adjust to new TargetMachine interfaceChris Lattner1-5/+4
llvm-svn: 13956
2004-05-30Pull Interval class out of LiveIntervals.Alkis Evlogimenos1-19/+15
llvm-svn: 13910
2004-05-30When spilling an register, introduce a new temporary for each of itsAlkis Evlogimenos1-13/+32
spills. This allows for more flexibility when allocating registers for spill code. llvm-svn: 13907
2004-05-29Remove defs vector from live intervals.Alkis Evlogimenos1-18/+0
llvm-svn: 13892
2004-05-08Remove unneeded headerAlkis Evlogimenos1-1/+0
llvm-svn: 13416
2004-05-06numeric_limits::infinity() apparently does not work on all systems. As aChris Lattner1-6/+4
workaround, use the C HUGE_VAL macro instead. llvm-svn: 13377
2004-05-01Operate on the Machine CFG instead of on the LLVM CFGChris Lattner1-9/+8
llvm-svn: 13302
2004-04-12Fix bug introduced in previous commit.Alkis Evlogimenos1-1/+1
llvm-svn: 12872