History log of /external/llvm/lib/CodeGen/RegAllocBasic.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cddc3e03e4ec99c0268c03a126195173e519ed58 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master LLVM for rebase to r256229

http://b/26987366

(cherry picked from commit f3ef5332fa3f4d5ec72c178a2b19dac363a19383)

Change-Id: Ic75dcb63191d65df1b69724576392c0aaeb47728
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
37ed9c199ca639565f6ce88105f9e39e898d82d0 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master LLVM for rebase to r222494.

Change-Id: Ic787f5e0124df789bd26f3f24680f45e678eef2d
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
095f994ba63994e8eb4b77127f9b872429496dba 11-Nov-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> CalcSpillWeights: give a better describing name to calculateSpillWeights

Besides, this relates it more obviously to the VirtRegAuxInfo::calculateSpillWeightAndHint.

No functionnal change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194404 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
a77da0579bc141eba62760e21a216e5d3eafd792 10-Nov-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> CalculateSpillWeights does not need to be a pass

Based on discussions with Lang Hames and Jakob Stoklund Olesen at the hacker's lab, and in the light of upcoming work on the PBQP register allocator, it was though that CalcSpillWeights does not need to be a pass. This change will enable to customize / tune the spill weight computation depending on the allocator.

Update the documentation style while there.

No functionnal change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194356 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
d241fa7a61682a15b753c52afee07dfbf1b3bd1f 08-Nov-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> Revert "CalculateSpillWeights does not need to be a pass"

Temporarily revert my previous commit until I understand why it breaks 3 target tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
663fcde3d33e44a9b543a692ad29873bd1ddc403 08-Nov-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> CalculateSpillWeights does not need to be a pass

Based on discussions with Lang Hames and Jakob Stoklund Olesen at the hacker's lab, and in the light of upcoming work on the PBQP register allocator, it was though that CalcSpillWeights does not need to be a pass. This change will enable to customize / tune the spill weight computation depending on the allocator.

Update the documentation style while there.

No functionnal change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
1feb5854aeeda897e9318c8193d187673c8576b8 15-Aug-2013 Mark Lacey <mark.lacey@apple.com> Track new virtual registers by register number.

Track new virtual registers by register number, rather than by the live
interval created for them. This is the first step in separating the
creation of new virtual registers and new live intervals. Eventually
live intervals will be created and populated on demand after the virtual
registers have been created and used in instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
4eed756153b84c211114a3e9186bf0cb55d4b394 17-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Switch spill weights from a basic loop depth estimation to BlockFrequencyInfo.

The main advantages here are way better heuristics, taking into account not
just loop depth but also __builtin_expect and other static heuristics and will
eventually learn how to use profile info. Most of the work in this patch is
pushing the MachineBlockFrequencyInfo analysis into the right places.

This is good for a 5% speedup on zlib's deflate (x86_64), there were some very
unfortunate spilling decisions in its hottest loop in longest_match(). Other
benchmarks I tried were mostly neutral.

This changes register allocation in subtle ways, update the tests for it.
2012-02-20-MachineCPBug.ll was deleted as it's very fragile and the instruction
it looked for was gone already (but the FileCheck pattern picked up unrelated
stuff).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
200241e4de11981523b3d14f3acab6129efed701 12-Apr-2013 Andy Gibbs <andyg1001@hotmail.co.uk> Replace uses of the deprecated std::auto_ptr with OwningPtr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
69d37fa6351d5fe2a97ea24a2d0d667a92f14a9c 05-Mar-2013 Bill Wendling <isanbard@gmail.com> Remove unused #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

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
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
1ead68d769f27f6d68d4aaeffe4199fa2cacbc95 28-Nov-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Make the LiveRegMatrix analysis available to targets.

No functional change, just moved header files.

Targets can inject custom passes between register allocation and
rewriting. This makes it possible to tweak the register allocation
before rewriting, using the full global interference checking available
from LiveRegMatrix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
986d76d7b3844b9a2f3d01a48975952749267a93 22-Aug-2012 David Blaikie <dblaikie@gmail.com> Tidy up a few more uses of MF.getFunction()->getName().

Based on CR feedback from r162301 and Craig Topper's refactoring in r162347
here are a few other places that could use the same API (& in one instance drop
a Function.h dependency).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
312244747c329f1d98c05afe78e3c90593e2fcb2 21-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove the RenderMachineFunction HTML output pass.

I don't think anyone has been using this functionality for a while, and
it is getting in the way of refactoring now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
d4348a2dc24c4fb012c1b9b20e71908f52049283 21-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove LiveIntervalUnions from RegAllocBase.

They are living in LiveRegMatrix now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158868 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
812cda9a5cc26b1f8dda6f909bf5062c215b65d7 21-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Convert RABasic to using LiveRegMatrix interference checking.

Stop using the LiveIntervalUnions provided by RegAllocBase, they will be
removed soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
a9783663398baf1289683fc7326430b89963f38e 16-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Guard private fields that are unused in Release builds with #ifndef NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
af06825460e1905a7739386c28253c13e3653394 16-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove final verification in RABasic.

We now have a proper machine code verifier pass between register
allocation and rewriting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
fe17bdbb50efe2f7f68d0b99e55ae52bd9477978 09-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Also compute MBB live-in lists in the new rewriter pass.

This deduplicates some code from the optimizing register allocators, and
it means that it is now possible to change the register allocators'
solutions simply by editing the VirtRegMap between the register
allocator pass and the rewriter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158249 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
05ec712e7f75635abbdd84dced69f4a45fe0f541 09-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Reintroduce VirtRegRewriter.

OK, not really. We don't want to reintroduce the old rewriter hacks.

This patch extracts virtual register rewriting as a separate pass that
runs after the register allocator. This is possible now that
CodeGen/Passes.cpp can configure the full optimizing register allocator
pipeline.

The rewriter pass uses register assignments in VirtRegMap to rewrite
virtual registers to physical registers, and it inserts kill flags based
on live intervals.

These finalization steps are the same for the optimizing register
allocators: RABasic, RAGreedy, and PBQP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
a7542d5f870c5d98960d1676e23ac1d1d975d7e5 06-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused private fields found by clang's new -Wunused-private-field.

There are some that I didn't remove this round because they looked like
obvious stubs. There are dead variables in gtest too, they should be
fixed upstream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
396618b43a85e12d290a90b181c6af5d7c0c5f11 02-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Switch all register list clients to the new MC*Iterator interface.

No functional change intended.

Sorry for the churn. The iterator classes are supposed to help avoid
giant commits like this one in the future. The TableGen-produced
register lists are getting quite large, and it may be necessary to
change the table representation.

This makes it possible to do so without changing all clients (again).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157854 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
20942dcd8634ad75091fe89669868cfebf74e869 19-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow LiveRangeEdit to be created with a NULL parent.

The dead code elimination with callbacks is still useful.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
789d5d85ba6e9259a8e0f0bcfbd06a59ad164512 03-Apr-2012 Pete Cooper <peter_cooper@apple.com> Moved LiveRangeEdit.h so that it can be called from other parts of the backend, not just libCodeGen

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
8a06af96698537377275dd7848db69915638dd26 03-Apr-2012 Pete Cooper <peter_cooper@apple.com> Refactored the LiveRangeEdit interface so that MachineFunction, TargetInstrInfo, MachineRegisterInfo, LiveIntervals, and VirtRegMap are all passed into the constructor and stored as members instead of passed in to each method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
e4fd907e72a599eddfa7a81eac4366b5b82523e3 04-Mar-2012 Craig Topper <craig.topper@gmail.com> Use uint16_t to store register overlaps to reduce static data.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152001 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
1485455be0310c6b24f096823029e08867531016 28-Feb-2012 Lang Hames <lhames@gmail.com> Kill off LiveRangeEdit::getNewVRegs and LiveRangeEdit::getUselessVRegs. These
methods are no longer needed now that LinearScan has gone away.

(Contains tweaks trivialSpillEverywhere to enable the removal of getNewVRegs).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
19273aec441411b4d571fdb87c6daa0fbe7a33a0 21-Feb-2012 Andrew Trick <atrick@apple.com> Clear virtual registers after they are no longer referenced.

Passes after RegAlloc should be able to rely on MRI->getNumVirtRegs() == 0.
This makes sharing code for pre/postRA passes more robust.
Now, to check if a pass is running before the RA pipeline begins, use MRI->isSSA().
To check if a pass is running after the RA pipeline ends, use !MRI->getNumVirtRegs().

PEI resets virtual regs when it's done scavenging.

PTX will either have to provide its own PEI pass or assign physregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
8dd26253f54247e77e5accfdd70e7b4bf27b39c2 10-Feb-2012 Andrew Trick <atrick@apple.com> RegAlloc superpass: includes phi elimination, coalescing, and scheduling.

Creates a configurable regalloc pipeline.

Ensure specific llc options do what they say and nothing more: -reglloc=... has no effect other than selecting the allocator pass itself. This patch introduces a new umbrella flag, "-optimize-regalloc", to enable/disable the optimizing regalloc "superpass". This allows for example testing coalscing and scheduling under -O0 or vice-versa.

When a CodeGen pass requires the MachineFunction to have a particular property, we need to explicitly define that property so it can be directly queried rather than naming a specific Pass. For example, to check for SSA, use MRI->isSSA, not addRequired<PHIElimination>.

CodeGen transformation passes are never "required" as an analysis

ProcessImplicitDefs does not require LiveVariables.

We have a plan to massively simplify some of the early passes within the regalloc superpass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
a94e635cec8dff2c9b39343643fe204dfab390dc 08-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add Register mask support to RABasic.

When a virtual register is live across a call, limit the search space to
call-preserved registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
42b7a71dc7381d1f38bf7b7201fc26dd80453364 17-Jan-2012 Andrew Trick <atrick@apple.com> Renamed MachineScheduler to ScheduleTopDownLive.

Responding to code review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
c1b1c7b205589c9a081e1cbd33fb56506fc287b3 17-Jan-2012 Andrew Trick <atrick@apple.com> Moving options declarations around.

More short term hackery until we have a way to configure passes that work on LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
96f678f2d78ae9a2a8c99ca612bf59c056b36797 13-Jan-2012 Andrew Trick <atrick@apple.com> Added the MachineSchedulerPass skeleton.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
9384111e90cb840e7eb867098f19910cf4c4a11d 12-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Make data structures private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
a8bd9a68f7c00fe1d895bb5e27ff804aa33abd64 11-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Sink spillInterferences into RABasic.

This helper method is too simplistic for RAGreedy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
ccc9581e8b79b4216cb1143344bdae9342722d5d 11-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Move RegAllocBase into its own cpp file separate from RABasic.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147972 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
d9e5c764bfea339fc5082bf17e558db959fd6d28 05-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Freeze reserved registers before starting register allocation.

The register allocators don't currently support adding reserved
registers while they are running. Extend the MRI API to keep track of
the set of reserved registers when register allocation started.

Target hooks like hasFP() and needsStackRealignment() can look at this
set to avoid reserving more registers during register allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147577 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
98985f959c57f2b8c0b6e4b5ee519252e71e9cd9 11-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Privatize an unused part of the LiveIntervalUnion::Query interface.

No clients are iterating over interference overlaps.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
27215676c7114132a0374f7b5c9ea73d9354d329 09-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Refer to the RegisterCoalescer pass by ID.

A public interface is no longer needed since RegisterCoalescer is not an
analysis any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
3b92527885c905e2d14f10eabbe45d1efda04bbf 27-Jul-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Print out the MBB live-in registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136178 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
9d812a2805161665d56a78734da98b58f39ce0fc 02-Jul-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Better diagnostics when inline asm fails to allocate.

asm.c:2:7: error: ran out of registers during register allocation
asm(""::"r"(0), "r"(1), "r"(2), "r"(3), "r"(4), "r"(5), "r"(6), "r"(7), "r"(8), "r"(9));
^

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134310 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
5b220213bfe9c37c2bb41a7ae0804e06a14f1007 27-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> There is only one register coalescer. Merge it into the base class and
remove the analysis group.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
fdf16ca44f130afe80c57481d0c08130aa08cc09 26-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> Move RegisterCoalescer.h to lib/CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
5f2316a3b55f88dab2190212210770180a32aa95 03-Jun-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Switch AllocationOrder to using RegisterClassInfo instead of a BitVector
of reserved registers.

Use RegisterClassInfo in RABasic as well. This slightly changes som
allocation orders because RegisterClassInfo puts CSR aliases last.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132581 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
bdda37d7fbafe6876f248341837423a4100f95a5 10-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix PR9883. Make sure all caches are invalidated when a live range is repaired.

The previous invalidation missed the alias interference caches.

Also add a stats counter for the number of repaired ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
bf4e10f2f69db24c107cb61d6fe10ed5b2047374 06-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Emit a proper error message when register allocators run out of registers.

This can't be just an assertion, users can always write impossible inline
assembly. Such an assembly statement should be included in the error message.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
6bfba2e5af163442a1c6b11fe14aa9df9101cfd7 20-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Prefer cheap registers for busy live ranges.

On the x86-64 and thumb2 targets, some registers are more expensive to encode
than others in the same register class.

Add a CostPerUse field to the TableGen register description, and make it
available from TRI->getCostPerUse. This represents the cost of a REX prefix or a
32-bit instruction encoding required by choosing a high register.

Teach the greedy register allocator to prefer cheap registers for busy live
ranges (as indicated by spill weight).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
dfaf0e2c0ef01a6f6fd31f2e099ab63c5a7f7cc0 12-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix a bug in RegAllocBase::addMBBLiveIns() where a basic block could accidentally be skipped.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129373 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
560ab9ebf78532df11188770c916c4eb6dcce1b2 12-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Reuse live interval union between functions. This saves a bit of compile time
when compiling many small functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
6d73c7dad165bde864769ae1a351bce27b261565 11-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use a faster algorithm for computing MBB live-in registers after register allocation.

LiveIntervals::findLiveInMBBs has to do a full binary search for each segment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129292 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
bd1926dfd4fbc8ca09941e00ac507eb5637e9c25 11-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Time the initial seeding of live registers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129276 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
cfafc54040cc9722995558124f253d05a038176b 05-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Run LiveDebugVariables in RegAllocBasic and RegAllocGreedy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
842759662ba3eae35d6078643983a07266be9aa5 01-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> The basic register allocator must also use the inline spiller.

It is using a trivial rewriter that doesn't know how to insert spill code
requested by the standard spiller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
0b5015188e834afa7fb2fe3694a9c190f59fd19c 23-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow the allocation of empty live ranges that have uses.

Empty ranges may represent undef values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
2926733240d0766fbd45df6eb609ad2328f0307d 16-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Tag cached interference with a user-provided tag instead of the virtual register number.

The live range of a virtual register may change which invalidates the cached
interference information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
10a433238fe4679c8da17f3eb19611466332e312 12-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Spill multiple registers at once.

Live range splitting can create a number of small live ranges containing only a
single real use. Spill these small live ranges along with the large range they
are connected to with copies. This enables memory operand folding and maximizes
the spill to fill distance.

Work in progress with known bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
47dbf6cef761c25cfeb0aa7d624a6f98288bb96a 10-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Change the Spiller interface to take a LiveRangeEdit reference.

This makes it possible to register delegates and get callbacks when the spiller
edits live ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
38f6bd0fc8095ef79a89b3db15ff6dc734ac90e7 10-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Make SpillIs an optional pointer. Avoid creating a bunch of temporary SmallVectors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
98d9648de7d571b2e6d139b65961a70d1833b0d7 23-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Change the RAGreedy register assignment order so large live ranges are allocated first.

This is based on the observation that long live ranges are more difficult to
allocate, so there is a better chance of solving the puzzle by handling the big
pieces first. The allocator will evict and split long alive ranges when they get
in the way.

RABasic is still using spill weights for its priority queue, so the interface to
the queue has been virtualized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
ba05c01dabc40373760a20c874103fc58d4377f0 18-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add VirtRegMap::rewrite() and use it in the new register allocators.

The rewriter works almost identically to -rewriter=trivial, except it also
eliminates any identity copies.

This makes the new register allocators independent of VirtRegRewriter.cpp which
will be going away at the same time as RegAllocLinearScan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125967 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
febb0bd0b9b75923dea4c34f22be7e4c7b6b501e 18-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Trim debugging output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
0db841f9c2b9a25fb5ecb36e350d3a802c35654c 17-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add basic register allocator statistics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
2710638db2eb84cd7eefb8bb9a1b7e5c49413d45 09-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Evict a lighter single interference before attempting to split a live range.

Registers are not allocated strictly in spill weight order when live range
splitting and spilling has created new shorter intervals with higher spill
weights.

When one of the new heavy intervals conflicts with a single lighter interval,
simply evict the old interval instead of trying to split the heavy one.

The lighter interval is a better candidate for splitting, it has a smaller use
density.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
89cab93fe999f6d81b4b99a71ac797b7ecfec277 18-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Pass a Banner argument to the machine code verifier both from
createMachineVerifierPass and MachineFunction::verify.

The banner is printed before the machine code dump, just like the printer pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
af24964251e27c2dd863239ba66ffd967b593be5 18-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Make the -verify-regalloc command line option available to base classes as
RegAllocBase::VerifyEnabled.

Run the machine code verifier in a few interesting places during RegAllocGreedy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
16999da951677a94a2f30d98c8126ff175f457e1 15-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplyfy RegAllocBasic by using getOverlaps instead of getAliasSet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
4a84cce3ed0008baf72ccc6831a046215addd2d7 14-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Use TRI::printReg instead of AbstractRegisterDescription when printing
LiveIntervalUnions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
533f58ecdd8a4732c2f0e149387c4d8d8d4142de 11-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Add named timer groups for the different stages of register allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
4680dec5fb3a1b624f13ca9b2a555ca90a07973e 11-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Move MRI into RegAllocBase. Clean up debug output a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
b853e6c3702149cdbbd6fa404334e3ba0055641a 09-Dec-2010 Andrew Trick <atrick@apple.com> Added register reassignment prototype to RAGreedy. It's a simple
heuristic to reshuffle register assignments when we can't find an
available reg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121388 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
d0bec3e62c98b1f0ef3a41db8f95599b2014c131 08-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Store (priority,regnum) pairs in the priority queue instead of providing an
abstract priority queue interface in subclasses that want to override the
priority calculations.

Subclasses must provide a getPriority() implementation instead.

This approach requires less code as long as priorities are expressable as simple
floats, and it avoids the dangers of defining potentially expensive priority
comparison functions.

It also should speed up priority_queue operations since they no longer have to
chase pointers when comparing registers. This is not measurable, though.

Preferably, we shouldn't use floats to guide code generation. The use of floats
here is derived from the use of floats for spill weights. Spill weights have a
dynamic range that doesn't lend itself easily to a fixpoint implementation.

When someone invents a stable spill weight representation, it can be reused for
allocation priorities.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
1b19dc1d8b7594434ea9a157bfe2ae68eabf9f05 08-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Move RABasic::addMBBLiveIns to the base class, it is generally useful.

Minor optimization to the use of IntervalMap iterators. They are fairly
heavyweight, so prefer SI.valid() over SI != end().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
953af2c3c560a13bd5eeb676c128b7e362dca684 08-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Switch LiveIntervalUnion from std::set to IntervalMap.

This speeds up RegAllocBasic by 20%, not counting releaseMemory which becomes
way faster.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121201 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
2b38c51f0ece16ef00068da56bee4623fb9ae485 07-Dec-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify assertion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
18c57a8a09a7c79fbcf4348b0ad8135246ab984f 01-Dec-2010 Andrew Trick <atrick@apple.com> Coding style. No significant functionality. Abandon linear scan style
in favor of the widespread llvm style. Capitalize variables and add
newlines for visual parsing. Rename variables for readability.
And other cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
c62feda741f9d5811b625967c40f1847fb2040e7 25-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Namespacify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
316df4bfe3db625a4394ff018c51d61f223aad86 20-Nov-2010 Andrew Trick <atrick@apple.com> RABasic fix. Regalloc is responsible for updating block live ins.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
13bdbb0544900643b4520f67cc48c6046c515c65 20-Nov-2010 Andrew Trick <atrick@apple.com> Whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119895 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
8a83d54528c197675ba0f21ebe95ac30fa3d8841 11-Nov-2010 Andrew Trick <atrick@apple.com> Check TRI->getReservedRegs because other allocators do it. Even though
it makes no sense for allocation_order iterators to visit reserved regs.
The inline spiller depends on AliasAnalysis.
Manage the Query state to avoid uninitialized or stale results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
f4baeaf8485f01beda46d29fd55753199dc68070 10-Nov-2010 Andrew Trick <atrick@apple.com> RABasic is nearly functionally complete. There are a few remaining
benchmarks hitting an assertion.
Adds LiveIntervalUnion::collectInterferingVRegs.
Fixes "late spilling" by checking for any unspillable live vregs among
all physReg aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
071d1c063f1080c70a7141d947a96cf511a1ba45 09-Nov-2010 Andrew Trick <atrick@apple.com> Adds RABasic verification and tracing.
(retry now that the windows build is green)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
32d9aeb1df982638766757704c4e23f58ffb40d1 09-Nov-2010 Andrew Trick <atrick@apple.com> Reverting r118604. Windows build broke.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
39a5ce46a51c8e855a2f52c9f733d9d5dd8a65c4 09-Nov-2010 Andrew Trick <atrick@apple.com> Adds RABasic verification and tracing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
e141a4960f702bef957b28abde3801ec64e32d87 08-Nov-2010 Andrew Trick <atrick@apple.com> Adds support for spilling previously allocated live intervals to
handle cases in which a register is unavailable for spill code.
Adds LiveIntervalUnion::extract. While processing interferences on a
live virtual register, reuses the same Query object for each
physcial reg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
964bc25e5a03be208427ce2ebadb22a42681ef9c 03-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Let RegAllocBasic require MachineDominators - they are already available and
splitting needs them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
e16eecc323879744dcff4f359ba9ccdb25bd6909 26-Oct-2010 Andrew Trick <atrick@apple.com> Jakob's review of the basic register allocator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp
14e8d71cc945034d4ee6e76be00e00f14efac62f 23-Oct-2010 Andrew Trick <atrick@apple.com> This is a prototype of an experimental register allocation
framework. It's purpose is not to improve register allocation per se,
but to make it easier to develop powerful live range splitting. I call
it the basic allocator because it is as simple as a global allocator
can be but provides the building blocks for sophisticated register
allocation with live range splitting.

A minimal implementation is provided that trivially spills whenever it
runs out of registers. I'm checking in now to get high-level design
and style feedback. I've only done minimal testing. The next step is
implementing a "greedy" allocation algorithm that does some register
reassignment and makes better splitting decisions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/RegAllocBasic.cpp