History log of /external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
2de0572caec55e3779857cae0bbcd962af2e495d 10-Sep-2012 Dmitri Gribenko <gribozavr@gmail.com> Remove redundant semicolons which are null statements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
77e300e8f0b8db8eec448cae9c87d7c5bfad9757 06-Sep-2012 Manman Ren <mren@apple.com> Release build: guard dump functions with "ifndef NDEBUG"

No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e617ccb80da76821379bbff4a2fdcd09e8401e8b 06-Sep-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Handle overlapping regunit intervals in LiveIntervals::addKillFlags().

We will soon allow virtual register live ranges to overlap regunit live
ranges when the physreg is defined as a copy of the virtreg:

%EAX = COPY %vreg5
FOO %vreg5
BAR %EAX<kill>

There is no real interference since %vreg5 and %EAX have the same value
where they overlap.

This patch prevents addKillFlags from adding virtreg kill flags to FOO
where the assigned physreg is overlapping the virtual register live
range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7b23d0838551ee16cbd49692df1eb0598b8a48f2 03-Sep-2012 Lang Hames <lhames@gmail.com> When updating live range endpoints, make sure to preserve the early clobber bit.

Fixs PR13719.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.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/LiveIntervalAnalysis.cpp
dcc4436cddc9b5d155040ed3ed38e9070ec4e3b8 04-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add an experimental -early-live-intervals option.

This option runs LiveIntervals before TwoAddressInstructionPass which
will eventually learn to exploit and update the analysis.

Eventually, LiveIntervals will run before PHIElimination, and we can get
rid of LiveVariables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b2beac2b9671f7d9773329d62c2821c8ac449ac5 03-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Completely eliminate VNInfo flags.

The 'unused' state of a value number can be represented as an invalid
def SlotIndex. This also exposed code that shouldn't have been looking
at unused value VNInfos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bf60aa9db5953dd99c561dfa9323b1e3293a5a85 03-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Eliminate the VNInfo::hasPHIKill() flag.

The only real user of the flag was removeCopyByCommutingDef(), and it
has been switched to LiveIntervals::hasPHIKill().

All the code changed by this patch was only concerned with computing and
propagating the flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0ab7103e06ee1da7bde5b196a68be77ab49a005d 03-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Make the hasPHIKills flag a computed property.

The VNInfo::HAS_PHI_KILL is only half supported. We precompute it in
LiveIntervalAnalysis, but it isn't properly updated by live range
splitting and functions like shrinkToUses().

It is only used in one place: RegisterCoalescer::removeCopyByCommutingDef().

This patch changes that function to use a new LiveIntervals::hasPHIKill()
function that computes the flag for a given value number.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c16bf79303ad8c84c5dd3c76e143cd2145539834 27-Jul-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Also compute register mask lists under -new-live-intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b18d779b35909cd5b753871f8bf2ff4f6c17ace1 27-Jul-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Eliminate the IS_PHI_DEF flag and VNInfo::setIsPHIDef().

A value number is a PHI def if and only if it begins at a block
boundary. This can be derived from the def slot, a separate flag is not
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3dfa38a5bf431ec78272bb06c47d7c28616d276a 27-Jul-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a -new-live-intervals experimental option.

This option replaces the existing live interval computation with one
based on LiveRangeCalc.cpp. The new algorithm does not depend on
LiveVariables, and it can be run at any time, before or after leaving
SSA form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bfd752f310078561de07850ce66213c4579a0d7e 22-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete a boring statistic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7fa6784296e6bc1aa4e8ec3664e58247893c21a2 22-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Store live intervals in an IndexedMap.

It is both smaller and faster than DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e024874d22c8f6acc4f54eb6183f70f6681f23ac 22-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify handleMove() a bit.

There is no need to check for physreg live ranges. They don't exist any
more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
27b7669a6058235eec494ea30d0d62b7146e0eb4 22-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Stop computing physreg live ranges.

Everyone is using on-demand regunit ranges now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
241d0209a765c97c684b120527e185f17723f650 22-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove LiveIntervals::trackingRegUnits().

With regunit liveness permanently enabled, this function would always
return true.

Also remove now obsolete code for checking physreg interference.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c4118452bcdae305088e151719abb2a3530caede 21-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove the -live-regunits command line option.

Register allocators depend on it being permanently enabled now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
12a7be9ba4263a283ca14e277a90cb64fe0e6f62 21-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix some more LiveInterval enumerations.

Deterministically enumerate the virtual registers instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
797e9a7737136a5e13d9114fe11543da471f9bdc 21-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Enable register unit liveness by default.

Soon we won't need to compute live intervals for physical registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7824152557cfe3a366963f504b2b956f853ebc3a 20-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Only update regunit live ranges that have been precomputed.

Regunit live ranges are computed on demand, so when mi-sched calls
handleMove, some regunits may not have live ranges yet.

That makes updating them easier: Just skip the non-existing ranges. They
will be computed correctly from the rescheduled machine code when they
are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2769e9338429377f0d06fb78ec884bf69b0c7d41 20-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bf833f07473851c79018a1e32186e1b9c00d03c1 20-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add regunit liveness support to LiveIntervals::handleMove().

When LiveIntervals is tracking fixed interference in regunits, make sure
to update those intervals as well. Currently guarded by -live-regunits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fa8becb6f9e8aa2cbe3bab79e1fc4cdf2ffbb8e5 20-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> 80 col.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
461e7eaa6fc52f96d01f7e1a5c357eae79e52508 06-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove dead debug option -disable-rematerialization.

Remat has been stable for years, and it isn't done by
LiveIntervalAnalysis any longer. (See LiveRangeEdit).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
05b46f05c3c4efd0972bf3e2e570404e7db72509 06-Jun-2012 Matt Beaumont-Gay <matthewbg@google.com> Suppress -Wunused-variable in -Asserts build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158037 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b77ec7d26405125fa5685370af5f17fcc9edbecd 06-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify LiveInterval::print().

Don't print out the register number and spill weight, making the TRI
argument unnecessary.

This allows callers to interpret the reg field. It can currently be a
virtual register, a physical register, a spill slot, or a register unit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
34c6f9803499c11ed2dc8479ec768d47370a2d3a 06-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add experimental support for register unit liveness.

Instead of computing a live interval per physreg, LiveIntervals can
compute live intervals per register unit. This makes impossible the
confusing situation where aliasing registers could have overlapping live
intervals. It should also make fixed interferernce checking cheaper
since registers have fewer register units than aliases.

Live intervals for regunits are computed on demand, using MRI use-def
chains and the new LiveRangeCalc class. Only regunits live in to ABI
blocks are precomputed during LiveIntervals::runOnMachineFunction().

The regunit liveness computations don't depend on LiveVariables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
afb32f7fb482d62532d575ea7b1ee8ab3919575c 05-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove the last remat-related code from LiveIntervalAnalysis.

Rematerialization is handled by LiveRangeEdit now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
84423c8778ed22877c123fe41f5e137cb5a30e90 05-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
15f1d8c557c217b90a82599d5f0f849f8340a1e3 05-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Switch LiveIntervals member variable to LLVM naming standards.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f905f69668e5dd184c0a2b5fae38d9f3721c0d3b 29-May-2012 Lang Hames <lhames@gmail.com> Clear the entering, exiting and internal ranges of a bundle before collecting
ranges for the instruction about to be bundled. This fixes a bug in an external
project where an assertion was triggered due to spurious 'multiple defs' within
the bundle.

Patch by Ivan Llopard. Thanks Ivan!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
97769fcdd1b50972222673a0effc6f793848bf06 20-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> LiveRangeQuery simplifies shrinkToUses().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
722b6f18536a1b23a03bfb55440f098da0a7762d 18-Apr-2012 Pete Cooper <peter_cooper@apple.com> LiveIntervalUpdate validators weren't recorded after the calls to std::for_each. Turns out std::for_each doesn't update the variable passed in for the functor but instead copy constructs a new one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155041 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f70af52a8fc735a84aa8d63b84dd56abd0b9e77c 21-Mar-2012 Andrew Trick <atrick@apple.com> misched: fix LiveInterval update for bottom-up scheduling

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e0b51ab8d3484b5b526a942f26c4db8082fed1e1 21-Mar-2012 Andrew Trick <atrick@apple.com> misched: fix LI update for bottom-up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153158 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
92b7df07afc90ea5ecc1d9c4ede80a3a3468c577 04-Mar-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Stop fixing bad machine code in LiveIntervalAnalysis.

The first def of a virtual register cannot also read the register.
Assert on such bad machine code instead of trying to fix it.
TwoAddressInstructionPass should never create code like that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
741981adf3a2bc0c6652c9c4ec846250950f3e68 01-Mar-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Move getBundleStart() into MachineInstrBundle.h.

This allows the function to be inlined, and makes it suitable for use in
getInstructionIndex().

Also provide a const version. C++ is great for touch typing practice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4586d257abf13b57d115d6bac9fb38ddc811acaf 21-Feb-2012 Lang Hames <lhames@gmail.com> Add API "handleMoveIntoBundl" for updating liveness when moving instructions into
bundles. This method takes a bundle start and an MI being bundled, and makes
the intervals for the MI's operands appear to start/end on the bundle start.

Also fixes some minor cosmetic issues (whitespace, naming convention) in the
HMEditor code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fd6d3217d3b577e704ff4826775b5938c23b9e73 21-Feb-2012 Lang Hames <lhames@gmail.com> Fix some bugs in HMEditor's moveAllOperandsInto logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7db76e7ca39905bbe3cb79158af0a93ca66faff8 19-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Silence operator precedence warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6aceab139205255ac44182f51819b9b8716cf477 19-Feb-2012 Lang Hames <lhames@gmail.com> Add machinery for pushing live ranges onto bundle starts while bundling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4a0b2d658ae9e296598f8c8ac36c7fe571a7eec5 19-Feb-2012 Lang Hames <lhames@gmail.com> Simplify moveEnteringDownFrom rules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150914 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
038d2d5cede26b1ab63a732348b60ffc430dd7b0 19-Feb-2012 Lang Hames <lhames@gmail.com> Skip through instructions rather than operands when looking for last use slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ac027144e8e22563c9bb057598c710aac57c072f 19-Feb-2012 Lang Hames <lhames@gmail.com> Fix TODO and trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
55fed62c9eca0c8ebcaa6cc2fd65a173d37b3951 19-Feb-2012 Lang Hames <lhames@gmail.com> Defer sanity checks on live intervals until after all have been updated. Hold (LiveInterval, LiveRange) pairs to update, rather than vregs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ecb50624d1e99596fdb289200cd1473cec84e097 18-Feb-2012 Lang Hames <lhames@gmail.com> Bring HMEditor into line with LLVM coding standards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150851 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0310038d5a4fe71c62f78470907c61188c613fa3 17-Feb-2012 Matt Beaumont-Gay <matthewbg@google.com> Sink variable into assert

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fbc8dd306aa7699a866db278db08d842762b2dc2 17-Feb-2012 Lang Hames <lhames@gmail.com> Add support for regmask slots to HMEditor. Also fixes a comment error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150840 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3dc7c5138d219048d69952bead22f75efb984fa3 17-Feb-2012 Lang Hames <lhames@gmail.com> Refactor 'handleMove' code in live intervals. Clients of LiveIntervals won't see
any changes.

Internally this adds a private inner class HMEditor, to LiveIntervals. HMEditor provides
an API for updating live intervals when code is moved or bundled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150826 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5d0827582ff5b22d92af7a24d61584c73d0bb8fa 17-Feb-2012 Lang Hames <lhames@gmail.com> Oops - isRegLiveIntoSuccessor is used in non-assert builds now. Remove NDEBUG guards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
af8b34dae90fd6d146a3b4a83b50751ed21f07c8 17-Feb-2012 Lang Hames <lhames@gmail.com> Turn off assertion, conservatively compute liveness for live-in un-allocatable registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cc2037be2cf0159e9f7a917a4db434258fe6eb6b 16-Feb-2012 Lang Hames <lhames@gmail.com> Make LiveIntervals::handleMove() bundle aware.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cc72913268ccf5e0fb2785496a1dee764ecce5ff 15-Feb-2012 Lang Hames <lhames@gmail.com> Fix assertion condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
862fd5f77a1657380242cdcb9b0a7f9225dae426 15-Feb-2012 Lang Hames <lhames@gmail.com> Remove overly conservative assert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f58e37f957191a3e41f605628c6169fbb1d4f922 15-Feb-2012 Lang Hames <lhames@gmail.com> Don't emit live ranges for physregs live-ins that are dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
da7984fbbac967ddbe5de4e789f8f37c673a7d75 15-Feb-2012 Lang Hames <lhames@gmail.com> Disentangle moving a machine instr from updating LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150552 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6b7913893bcd47f52eff71e39e50c42511c4ed36 15-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Use the proper clobber check in handleLiveInRegister().

When a physreg is live in to a basic block, look for any instruction in
the block that clobbers the physreg.

The instruction doesn't have to properly redefine the register, any
overlapping clobber is OK.

This slightly changes live ranges when compiling with register masks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f658af5484855b37c6c651e9e5e671982d39af26 15-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Dump live intervals in numerical order.

The old DenseMap hashed order was very confusing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
94b6e1418202e9f6cf54856d5ec2891c9012777a 15-Feb-2012 Lang Hames <lhames@gmail.com> Don't create a new copy of reserved regs - we already have one handy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150525 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
342c64c90418a97ec26303c27d1829edd994d9a9 14-Feb-2012 Lang Hames <lhames@gmail.com> Tighten physical register invariants: Allocatable physical registers can
only be live in to a block if it is the function entry point or a landing pad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cd339b71ff23327f2ef6a4c964ff3ceea20733bf 14-Feb-2012 Lang Hames <lhames@gmail.com> Use convenience function for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d35576b3c026cb323c4c240f0b20cf56089a1e5b 13-Feb-2012 Andrew Trick <atrick@apple.com> LiveIntervalAnalysis does not depend on MachineLoopInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.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/LiveIntervalAnalysis.cpp
4465b6f6b2ebd061f4f321e666b47d540651f686 10-Feb-2012 Lang Hames <lhames@gmail.com> Remove unused 'isAlias' parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9f10ac63a3a2a74ac381a05d8ba0f7b1b455a6b6 10-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Constrain the regmask search space for local live ranges.

When checking a local live range for interference, restrict the binary
search to the single block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
34e85d0307e3c17e5061622dccf8a20e5457b099 10-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Cache basic block boundaries for faster RegMaskSlots access.

Provide API to get a list of register mask slots and bits in a basic
block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150219 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ebf2750a70df4261d3e66144ea6bcb49d41f6efb 10-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Optimize LiveIntervals::intervalIsInOneMBB().

No looping and binary searches necessary.

Return a pointer to the containing block instead of just a bool.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fb08b90bf402bcd08a3474772d505294d9d7aa79 09-Feb-2012 Lang Hames <lhames@gmail.com> Fix kill flags when moving instructions using LiveIntervals::moveInstr(...).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
394d71271164b9268291a2f8be1190fd4138bb77 09-Feb-2012 Lang Hames <lhames@gmail.com> Remove assertion. Not all use operands are reads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3fd3a840c50fe4ede1b200be18990bc955c536fd 08-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Keep track of register masks in LiveIntervalAnalysis.

Build an ordered vector of register mask operands (i.e., calls) when
computing live intervals. Provide a checkRegMaskInterference() function
that computes a bit mask of usable registers for a live range.

This is a quick way of determining of a live range crosses any calls,
and restricting it to the callee saved registers if it does.
Previously, we had to discover call clobbers for each candidate register
independently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
99a7a13f4aa5bf8f272c95f7b09ba997d2b30a35 08-Feb-2012 Andrew Trick <atrick@apple.com> Added MachineInstr::isBundled() to check if an instruction is part of a bundle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0aad7d274d6dfb0de1ebc00600cecf5e229b7c43 04-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Drop the REDEF_BY_EC VNInfo flag.

A live range that has an early clobber tied redef now looks like a
normal tied redef, except the early clobber def uses the early clobber
slot.

This is enough to handle any strange interference problems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7e899cbb9127c02c58f6e774186a533b0d00681d 04-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Correctly terminate a physreg redefined by an early clobber.

I don't have a test that fails because of this, but a test case like
CodeGen/X86/2009-12-01-EarlyClobberBug.ll exposes the problem. EAX is
redefined by a tied early clobber operand on inline asm, and the live
range should look like this:

%EAX,inf = [48r,64e:0)[64e,80r:1) 0@48r 1@64e

Previously, the two values got merged:

%EAX,inf = [48r,80r:0) 0@48r

With this bug fixed, the REDEF_BY_EC VNInfo flag is no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3b1088a2cc15a39c7a7b8dd95a56143f1dda6863 04-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't store COPY pointers in VNInfo.

If a value is defined by a COPY, that instuction can easily and cheaply
be found by getInstructionFromIndex(VNI->def).

This reduces the size of VNInfo from 24 to 16 bytes, and improves
llc compile time by 3%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9119b039d46e95ed95d9a20f9f7ee52e414ca16d 04-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Trim headers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d491da3f93a51d811b42f59f375e0b1883b06832 03-Feb-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete some dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149717 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
baffe7a6f3c3f9588048db37a59b9b2f52ffe248 30-Jan-2012 Matt Beaumont-Gay <matthewbg@google.com> Here's a new one: GCC was complaining about an only-used-in-asserts
*function*. Wrap the function in #ifndef NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3f8d3c7d72367244e56efd9ce2c64ef5905cb377 28-Jan-2012 Lang Hames <lhames@gmail.com> Silence warning about parens for && within ||

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
907cc8f38df212a87a6028682d91df01ba923f4f 27-Jan-2012 Lang Hames <lhames@gmail.com> Add a "moveInstr" method to LiveIntervals. This can be used to move instructions
around within a basic block while maintaining live-intervals.

Updated ScheduleTopDownLive in MachineScheduler.cpp to use the moveInstr API
when reordering MIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
58a3685916e2badd7fdec557641b056c1540c0c3 25-Jan-2012 Lang Hames <lhames@gmail.com> Don't add live ranges for aliases of physregs that are live in to the
function. They don't appear to be used, and are inconsistent with handling of
other physreg intervals (i.e. intervals that are not live-in) where ranges are
not inserted for aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6c76e80753cfc83dc6804fcd5d949c517dfe3434 25-Jan-2012 Lang Hames <lhames@gmail.com> Always break upon finding a vreg operand (in Release as well as +Asserts). Remove assertion which can no longer trigger.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bfab85e9b187f8e59c7638c15347319799097ae1 18-Jan-2012 Lang Hames <lhames@gmail.com> Fixed macro condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
74c4f97a466513e45e66e04469973fdcd5865300 11-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Exclusively use SplitAnalysis::getLastSplitPoint().

Delete the alternative implementation in LiveIntervalAnalysis.

These functions computed the same thing, but SplitAnalysis caches the
result.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4281e20aab7f1fe1b35b31c9237ad89c20937e02 07-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Use the 'regalloc' debug tag for most register allocator tracing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
567cdbab28077ea1801ebff3d4291d4006d88ca3 03-Jan-2012 Lang Hames <lhames@gmail.com> Clarified assert text.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5a96b3dad2f634c9081c8b2b6c2575441dc5a2bd 07-Dec-2011 Evan Cheng <evan.cheng@apple.com> Add bundle aware API for querying instruction properties and switch the code
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
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f054e198197122011fc80b673f35333bc3e58c98 14-Nov-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix early-clobber handling in shrinkToUses.

I broke this in r144515, it affected most ARM testers.

<rdar://problem/10441389>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6c9cc21d85cdef79b971f710ace287f3a2f847a3 14-Nov-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use kill slots instead of the previous slot in shrinkToUses.

It's more natural to use the actual end points.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1f81e316b042c02c841801a71e7439e166ffa2a0 13-Nov-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Terminate all dead defs at the dead slot instead of the 'next' slot.

This makes no difference for normal defs, but early clobber dead defs
now look like:

[Slot_EarlyClobber; Slot_Dead)

instead of:

[Slot_EarlyClobber; Slot_Register).

Live ranges for normal dead defs look like:

[Slot_Register; Slot_Dead)

as before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d14614e6777771f8fec3062bcaf2986c189ac84d 13-Nov-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify early clobber slots a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2debd48ca790ac01be6e12e094fdf4fdcadc8364 13-Nov-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Rename SlotIndexes to match how they are used.

The old naming scheme (load/use/def/store) can be traced back to an old
linear scan article, but the names don't match how slots are actually
used.

The load and store slots are not needed after the deferred spill code
insertion framework was deleted.

The use and def slots don't make any sense because we are using
half-open intervals as is customary in C code, but the names suggest
closed intervals. In reality, these slots were used to distinguish
early-clobber defs from normal defs.

The new naming scheme also has 4 slots, but the names match how the
slots are really used. This is a purely mechanical renaming, but some
of the code makes a lot more sense now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f5eeaf221c0b8acdc1ffbd5cefe01b61474cb7e8 13-Nov-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete the old spilling framework from LiveIntervalAnalysis.

This is dead code, all register allocators use InlineSpiller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b0e1bc7b99809e2b45726affd73f72c60c506ea0 05-Oct-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add a FIXME.

TwoAddressInstructionPass should annotate instructions with <undef>
flags when it lower REG_SEQUENCE instructions. LiveIntervals should not
be in the business of modifying code (except for kill flags, perhaps).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7016cf66ee21ddf3f7823d4e332b2cb84953bebd 04-Oct-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow <undef> flags on def operands as well as uses.

The <undef> flag says that a MachineOperand doesn't read its register,
or doesn't depend on the previous value of its register.

A full register def never depends on the previous register value. A
partial register def may depend on the previous value if it is intended
to update part of a register.

For example:

%vreg10:dsub_0<def,undef> = COPY %vreg1
%vreg10:dsub_1<def> = COPY %vreg2

The first copy instruction defines the full %vreg10 register with the
bits not covered by dsub_0 defined as <undef>. It is not considered a
read of %vreg10.

The second copy modifies part of %vreg10 while preserving the rest. It
has an implicit read of %vreg10.

This patch adds a MachineOperand::readsReg() method to determine if an
operand reads its register.

Previously, this was modelled by adding a full-register <imp-def>
operand to the instruction. This approach makes it possible to
determine directly from a MachineOperand if it reads its register. No
scanning of MI operands is required.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
031432f9ad24963282b7f71bd0592080f6229d20 15-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Speed up LiveIntervals::shrinkToUse with some caching.

Blocks with multiple PHI successors only need to go on the worklist
once. Use a SmallPtrSet to track the live-out blocks that have already
been handled. This is a lot faster than the two live range check we
would otherwise do.

Also stop recomputing hasPHIKill flags. Like RenumberValues(), it is
conservatively correct to leave them in, and they are not used for
anything important.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ee5655dca467d3812145a2f965c31edf4875c93e 13-Sep-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Switch extendInBlock() to take a kill slot instead of the last use slot.

Three out of four clients prefer this interface which is consistent with
extendIntervalEndTo() and LiveRangeCalc::extend().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ec7e4fff960f166be8a8a39b7ba8cc7baac6b02c 30-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> When a physreg is live-in and live through a basic block, make sure its live
range covers the entire block.

The live range can't be terminated at a random instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130619 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7a2bdde0a0eebcd2125055e0eacaca040f0b766c 15-Apr-2011 Chris Lattner <sabre@nondot.org> Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0fb215a154a5f9f54eea1ce8b006ba9bce5defa1 11-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't add live ranges for sub-registers when clobbering a physical register.

Both coalescing and register allocation already check aliases for interference,
so these extra segments are only slowing us down.

This speeds up both linear scan and the greedy register allocator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e815dab69f57da3f0ff365709491c7409cbb71bd 07-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Recompute hasPHIKill flags when shrinking live intervals.

PHI values may be deleted, causing the flags to be wrong. This fixes PR9616.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4662a9f270fe2c916c35545718720ed181384c30 04-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow coalescing with reserved physregs in certain cases:

When a virtual register has a single value that is defined as a copy of a
reserved register, permit that copy to be joined. These virtual register are
usually copies of the stack pointer:

%vreg75<def> = COPY %ESP; GR32:%vreg75
MOV32mr %vreg75, 1, %noreg, 0, %noreg, %vreg74<kill>
MOV32mi %vreg75, 1, %noreg, 8, %noreg, 0
MOV32mi %vreg75<kill>, 1, %noreg, 4, %noreg, 0
CALLpcrel32 ...

Coalescing these virtual registers early decreases register pressure.
Previously, they were coalesced by RALinScan::attemptTrivialCoalescing after
register allocation was completed.

The lower register pressure causes the mcinst-lowering-cmp0.ll test case to fail
because it depends on linear scan spilling a particular register.

I am deleting 2008-08-05-SpillerBug.ll because it is counting the number of
instructions emitted, and its revision history shows the 'correct' count being
edited many times.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128845 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dc5198bac7e3f9b61617c8c46a1c28a84daa9325 31-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/CodeGen/LiveIntervalAnalysis.cpp: [PR9590] Don't use std::pow(float,float) here.

We don't expect the real "powf()" on some hosts (and powf() would be available on other hosts).
For consistency, std::pow(double,double) may be called instead.
Or, precision issue might attack us, to see unstable regalloc and stack coloring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9ef931e71c06a0390d6387859843be1d6d4daad6 18-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Accept instructions that read undefined values.

This is not supposed to happen, but I have seen the x86 rematter getting
confused when rematerializing partial redefs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127857 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6a3dbd3b25bbc99bd1a233d6a74ddea3493ba6ac 17-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Dead code elimination may separate the live interval into multiple connected components.

I have convinced myself that it can only happen when a phi value dies. When it
happens, allocate new virtual registers for the components.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127827 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c46570dc05851395829bef904bb6ddb1260400d1 16-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Clarify debugging output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.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/LiveIntervalAnalysis.cpp
0d8ccaa5c8db820b5b93f37e51563148c57ba6b8 08-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Let shrinkToUses optionally return a list of now dead machine instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a9d5c2715b5e8e0be613d8d31e76c35a5bfff07d 07-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Handle the special case of registers begin redefined by early-clobber defs.

In this case, the value need to be available at the load index instead of the
normal use index.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c29d9b3495a2d87af524ad5c4b62f46c4265d828 03-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix PHI handling in LiveIntervals::shrinkToUses().

We need to wait until we meet a PHIDef in its defining block before resurrecting
PHIKills in the predecessors.

This should unbreak the llvm-gcc-build-x86_64-darwin10-x-mingw32-x-armeabi bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4b11a70f7a63dc4c051a96a90ed6687eb0595cda 02-Mar-2011 Nick Lewycky <nicholas@mxc.ca> Quiet a compiler warning about unused variable 'ExtVNI'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e0ab24532cc11f082d722ab169080322b39afece 02-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify LiveIntervals::shrinkToUses() a bit by using the new extendInBlock().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a4d347357ce04d9101130dca0df33cb62ea35a2f 02-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
eb9f040f0d07e2fa9b3b5ef46d5ee32511d28811 15-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move more fragments of spill weight calculation into CalcSpillWeights.h

Simplify the spill weight calculation a bit by bypassing
getApproximateInstructionCount() and using LiveInterval::getSize() directly.
This changes the computed spill weights, but only by a constant factor in each
function. It should not affect how spill weights compare against each other, and
so it shouldn't affect code generation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f0ac26c51173a9a1d6e5b5794107dccc4c5b5792 09-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move calcLiveBlockInfo() and the BlockInfo struct into SplitAnalysis.

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8a61da8a689ee95874c833af4c7aa965fab5c0a9 08-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add LiveIntervals::addKillFlags() to recompute kill flags after register allocation.

This is a lot easier than trying to get kill flags right during live range
splitting and rematerialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
11513e5d1e1b40e6113668e4b4357596f33fa6c6 08-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add LiveIntervals::shrinkToUses().

After uses of a live range are removed, recompute the live range to only cover
the remaining uses. This is necessary after rematerializing the value before
some (but not all) uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
45e53975f81164d6e5e6322e83dd19030b7d3c88 05-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Apparently, it is possible for a block with a landing pad successor to have no calls.

In that case we simply ignore the landing pad and split live ranges before the
first terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cb6404711b7fe6f583480adce8d7e9d5e4b99ae6 04-Feb-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add LiveIntervals::getLastSplitPoint().

A live range cannot be split everywhere in a basic block. A split must go before
the first terminator, and if the variable is live into a landing pad, the split
must happen before the call that can throw.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124894 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c9df025e33ac435adb3b3318d237c36ca7cec659 10-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify a bunch of isVirtualRegister() and isPhysicalRegister() logic.

These functions not longer assert when passed 0, but simply return false instead.

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4314268128be6d54c9a7f0709680e5a5b40f3ab3 09-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Replace TargetRegisterInfo::printReg with a PrintReg class that also works without a TRI instance.

Print virtual registers numbered from 0 instead of the arbitrary
FirstVirtualRegister. The first virtual register is printed as %vreg0.
TRI::NoRegister is printed as %noreg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f4840c07f84d018c4de5dbdad4166b9e162f8f89 16-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix emergency spilling in LiveIntervals::spillPhysRegAroundRegDefsUses.

Always spill the full representative register at any point where any subregister
is live.

This fixes PR8620 which caused the old logic to get confused and not spill
anything at all.

The fundamental problem here is that the coalescer is too aggressive about
physical register coalescing. It sometimes makes it impossible to allocate
registers without these emergency spills.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7c2e4a8715836a44e82ac6c7370826519ccdfddb 16-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix PR8612 in the standard spiller, take two.

The live range of a register defined by an early clobber starts at the use slot,
not the def slot.

Except when it is an early clobber tied to a use operand. Then it starts at the
def slot like a standard def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bea0b6a0495c8c80ad7d52d4bc28acdee926020b 15-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert "Fix PR8612 in the standard spiller as well."

This reverts r119183 which borke the buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a284aa1657d08390209b87f57782936e45d562ba 15-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix PR8612 in the standard spiller as well.

The live range of a register defined by an early clobber starts at the use slot,
not the def slot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.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/LiveIntervalAnalysis.cpp
f4a1e1a69f0727762a73ef0d551e3bbd16b7c04e 26-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Teach MachineBasicBlock::print() to annotate instructions and blocks with
SlotIndexes when available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2ab36d350293c77fc8941ce1023e4899df7e3a82 12-Oct-2010 Owen Anderson <resistor@mac.com> Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
31cc3ec3308c8fafd9865388214ae11662a71af4 11-Oct-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Replace FindLiveRangeContaining() with getVNInfoAt() in LiveIntervalAnalysis.

This helps hiding the LiveRange class which really should be private.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ce665bd2e2b581ab0858d1afe359192bac96b868 08-Oct-2010 Owen Anderson <resistor@mac.com> Now with fewer extraneous semicolons!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6e2968c85c1e162ee5bc813769eab223e3df0f15 25-Sep-2010 Lang Hames <lhames@gmail.com> Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
011e5910719265ba5d41e8af2290e55c5eb50526 25-Sep-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove SlotIndex::PHI_BIT. It is no longer used by anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
148341cc9b60d7d88be9c07a2b32b436e0cd301d 17-Aug-2010 Evan Cheng <evan.cheng@apple.com> PHI elimination shouldn't require machineloopinfo since it's used at -O0. Move the requirement to LiveIntervalAnalysis instead. Note this does not change the number of times machineloopinfo is computed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1b2932024f098a6968645ac78d5848951d877c19 12-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bae696956b74680a7fedafb7fea70628d1ef14df 03-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Oops. Don't normalize spill weights twice.

When the normalizeSpillWeights function was introduced, I forgot to remove this
normalization.

This change could affect register allocation. Hopefully for the better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d13db2c59cc94162d6cf0a04187d408bfef6d4a7 22-Jul-2010 Owen Anderson <resistor@mac.com> Fix batch of converting RegisterPass<> to INTIALIZE_PASS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
04c528a0c86ddf3d6a70681f72e1b2ec07b0b53a 16-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.

TII::isMoveInstr is going tobe completely removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8ea324093cd512acc37f7b5a60e511e64103699e 09-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix small bug in isMoveInstr -> COPY translation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e05442d50806e2850eae1571958816028093df85 09-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Change TII::foldMemoryOperand API to require the machine instruction to be
inserted in a MBB, and return an already inserted MI.

This target API change is necessary to allow foldMemoryOperand to call
storeToStackSlot and loadFromStackSlot when folding a COPY to a stack slot
reference in a target independent way.

The foldMemoryOperandImpl hook is going to change in the same way, but I'll wait
until COPY folding is actually implemented. Most targets only fold copies and
won't need to specialize this hook at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0bc25f40402f48ba42fc45403f635b20d90fabb3 08-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Convert EXTRACT_SUBREG to COPY when emitting machine instrs.

EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead.

Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg().
The isMoveInstr hook will be removed later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5c00e077952d14899c3fc26709c7b2dfd36d0209 08-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove references to INSERT_SUBREG after de-SSA.

Fix X86InstrInfo::convertToThreeAddressWithLEA to generate COPY instead of
INSERT_SUBREG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4b76ffc1ffca2ed016467e916d5223515b485592 07-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert "Remove references to INSERT_SUBREG after de-SSA" r107725.

Buildbot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107744 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d3b376b4483d816367dd28a41bcbccede1cdcbf0 07-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove references to INSERT_SUBREG after de-SSA

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ed2185e171a86b8c0e166803fd4066383a6cff08 07-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Convert INSERT_SUBREG to COPY in TwoAddressInstructionPass.

INSERT_SUBREG will now only appear in SSA machine instructions.

Fix the handling of partial redefs in ProcessImplicitDefs. This is now relevant
since partial redef COPY instructions appear.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
273f7e42994a5bce0614d04d96dbfdf05fd652e5 03-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Detect and handle COPY in many places.

This code is transitional, it will soon be possible to eliminate
isExtractSubreg, isInsertSubreg, and isMoveInstr in most places.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ce9a20b808ba48adf72e0c0615f903a65e9f9eb8 26-Jun-2010 Benjamin Kramer <benny.kra@googlemail.com> VNInfos don't need to be destructed anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106943 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
15a571436da812c7cecbc3f3423ead2edff50358 26-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't track kills in VNInfo. Use interval ends instead.

The VNInfo.kills vector was almost unused except for all the code keeping it
updated. The few places using it were easily rewritten to check for interval
ends instead.

The two new methods LiveInterval::killedAt and killedInRange are replacements.

This brings us down to 3 independent data structures tracking kills.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3c7b3fecacee40df7b9a99d290638398b5a62173 24-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove the now unused LiveIntervals::getVNInfoSourceReg().

This method was always a bit too simplistic for the real world. It didn't really
deal with subregisters and such.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
54edf4f7da971cbb0c1546039db488a259480398 24-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove the -fast-spill option.

This code path has never really been used, and we are going to be handling
spilling through the Spiller interface in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106777 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a24986d8bfd941252f7d080943e02bbe6a0c2944 24-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Replace a big gob of old coalescer logic with the new CoalescerPair class.

CoalescerPair can determine if a copy can be coalesced, and which register gets
merged away. The old logic in SimpleRegisterCoalescing had evolved into
something a bit too convoluted.

This second attempt fixes some crashes that only occurred Linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
af5c60b40d50af635e1d02c0c3db508cfb9f2d1f 24-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Verify that VNI kills are pointing to existing instructions.

In this case it is essential that the kill is real because the spiller will
decide to omit a spill if it thinks there is a later kill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b8ac3b035ba14663ebe57fde17f6a9f25134e005 24-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert "Replace a big gob of old coalescer logic with the new CoalescerPair class."

Whiny buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106710 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e9c59711d3d1e8b133763393bea92af6e36b0031 24-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Replace a big gob of old coalescer logic with the new CoalescerPair class.

CoalescerPair can determine if a copy can be coalesced, and which register gets
merged away. The old logic in SimpleRegisterCoalescing had evolved into
something a bit too convoluted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0465bcffbbffb5ff5f420787b4350cb8abb196f7 19-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> TwoAddressInstructionPass::CoalesceExtSubRegs can insert INSERT_SUBREG
instructions, but it doesn't really understand live ranges, so the first
INSERT_SUBREG uses an implicitly defined register.

Fix it in LiveVariableAnalysis by adding the <undef> flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106333 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c66d0f2a9386cc7cb3237b8e3cace2b62a9c7dc8 16-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow a register to be redefined multiple times in a basic block.

LiveVariableAnalysis was a bit picky about a register only being redefined once,
but that really isn't necessary.

Here is an example of chained INSERT_SUBREGs that we can handle now:

68 %reg1040<def> = INSERT_SUBREG %reg1040, %reg1028<kill>, 14
register: %reg1040 +[70,134:0)
76 %reg1040<def> = INSERT_SUBREG %reg1040, %reg1029<kill>, 13
register: %reg1040 replace range with [70,78:1) RESULT: %reg1040,0.000000e+00 = [70,78:1)[78,134:0) 0@78-(134) 1@70-(78)
84 %reg1040<def> = INSERT_SUBREG %reg1040, %reg1030<kill>, 12
register: %reg1040 replace range with [78,86:2) RESULT: %reg1040,0.000000e+00 = [70,78:1)[78,86:2)[86,134:0) 0@86-(134) 1@70-(78) 2@78-(86)
92 %reg1040<def> = INSERT_SUBREG %reg1040, %reg1031<kill>, 11
register: %reg1040 replace range with [86,94:3) RESULT: %reg1040,0.000000e+00 = [70,78:1)[78,86:2)[86,94:3)[94,134:0) 0@94-(134) 1@70-(78) 2@78-(86) 3@86-(94)

rdar://problem/8096390

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ead06be02fe6b9a2bf6fbe04237c1276ed0cdb5c 03-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Use readsWritesVirtualRegister instead of counting uses and defs when inserting
spills and reloads.

This means that a partial define of a register causes a reload so the other
parts of the register are preserved.

The reload can be prevented by adding an <imp-def> operand for the full
register. This is already done by the coalescer and live interval analysis where
relevant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1015ba7018c87f48cc7bb45a564eb4a27241e76a 21-May-2010 Evan Cheng <evan.cheng@apple.com> - Change MachineInstr::findRegisterDefOperandIdx so it can also look for defs
that are aliases of the specified register.
- Rename modifiesRegister to definesRegister since it's looking a def of the
specific register or one of its super-registers. It's not looking for def of a
sub-register or alias that could change the specified register.
- Added modifiesRegister to look for defs of aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
19f5f71bba08e690611fa213647ac6bae814756b 21-May-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert "Use MachineInstr::readsWritesVirtualRegister to determine if a register is read."

This reverts r104322. I think it was causing miscompilations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
00c53caa339f954cb3590a05e8653b864b4355cf 21-May-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Use MachineInstr::readsWritesVirtualRegister to determine if a register is read.
This correctly handles partial redefines and undef uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104322 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
63e6a488cb6c29983415221719d05fbf99e00193 21-May-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> If the first definition of a virtual register is a partial redef, add an
<imp-def> operand for the full register. This ensures that the full physical
register is marked live after register allocation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
761fd4c1d97977c16de9f0cf921056a37b906304 20-May-2010 Nick Lewycky <nicholas@mxc.ca> Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ad6c5a20ba87e7aba91ef7e8b270715a25379770 17-May-2010 Evan Cheng <evan.cheng@apple.com> Yes, if the redef is a copy, update the old val# with the copy. But make sure to clear the copy field if the redef is not a copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
87565c1d779a1903d10ddd11d886c0f79ee430b5 15-May-2010 Chris Lattner <sabre@nondot.org> improve portability to systems that don't have powf/modf (e.g. solaris 9)
patch by Evzen Muller!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
61d531066d540a1a05fa44048ebef4bb1614acea 15-May-2010 Evan Cheng <evan.cheng@apple.com> A partial re-def instruction may be a copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
623d3c10e12a4227926e5b69947f7f0fa7e1908a 10-May-2010 Evan Cheng <evan.cheng@apple.com> Re-defined valno is always valno even for partial re-def's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3749943648772743c9c0e852553e50e6700a0c1b 05-May-2010 Evan Cheng <evan.cheng@apple.com> Teach liveintervalanalysis about virtual registers which are defined by reg_sequence instructions that are formed by registers defined by distinct instructions. e.g.
80 %reg1041:6<def> = VSHRNv4i16 %reg1034<kill>, 12, pred:14, pred:%reg0
. . .
120 %reg1041:5<def> = VSHRNv4i16 %reg1039<kill>, 12, pred:14, pred:%reg0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
afff40a62da19be15295c0f8ed5d4d450ccb45a5 04-May-2010 Evan Cheng <evan.cheng@apple.com> Teach PHI elimination to remove REG_SEQUENCE instructions and update references of the source operands with references of the destination with subreg indices. e.g.
%reg1029<def>, %reg1030<def> = VLD1q16 %reg1024<kill>, ...
%reg1031<def> = REG_SEQUENCE %reg1029<kill>, 5, %reg1030<kill>, 6
=>
%reg1031:5<def>, %reg1031:6<def> = VLD1q16 %reg1024<kill>, ...

PHI elimination now does more than phi elimination. It is really a de-SSA pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ad98f795d0dba3db721139a8a74a98acdce0ff60 03-May-2010 Bob Wilson <bob.wilson@apple.com> Print basic block numbers in live interval debug output. Since the rest of the
debug output is showing machine instructions, the IR-level basic block names
aren't very meaningful, and because multiple machine basic blocks may be
derived from one IR-level BB, they're also not unique.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6691a8935c9f2e049ff5eed45ba2894f60108909 29-Apr-2010 Evan Cheng <evan.cheng@apple.com> - Really preserve dbg_value instructions when the register is spilled.
- Also, update dbg_value is the value is being re-matted from a frame slot, e.g. fixed slots for arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6fa7636e614cbf0a19d374e169791a774281e8d3 26-Apr-2010 Evan Cheng <evan.cheng@apple.com> Re-enable 102323 with fix: do not update dbg_value's with incorrect frame indices when the live interval are being re-materialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6cd4b342617f9729101c987739507e8e2527bf0f 26-Apr-2010 Evan Cheng <evan.cheng@apple.com> Temporary disable spiller modifying dbg_value. It's breaking build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
962021bc7f6721c20c7dfe8ca809e2d98b1c554a 26-Apr-2010 Evan Cheng <evan.cheng@apple.com> - Move TargetLowering::EmitTargetCodeForFrameDebugValue to TargetInstrInfo and rename it to emitFrameIndexDebugValue.
- Teach spiller to modify DBG_VALUE instructions to reference spill slots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
81bf03eb5cd68243eabb52505105aa5f4a831bf3 13-Apr-2010 Dan Gohman <gohman@apple.com> Eliminate MachineBasicBlock::const_livein_iterator and make
MachineBasicBlock::livein_iterator a const_iterator, because
clients shouldn't ever be using the iterator interface to
mutate the livein set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101147 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
75361b69f3f327842b9dad69fa7f28ae3b688412 08-Apr-2010 Chris Lattner <sabre@nondot.org> rename llvm::llvm_report_error -> llvm::report_fatal_error



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100709 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
991de14dd62dcbab4b31357ae22dc5b053ba50a0 30-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Introduce SpecificBumpPtrAllocator, a wrapper for BumpPtrAllocator which allows
only a single type of object to be allocated. Use it to make VNInfo destruction
typesafe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
01cb1b665da03e2b74c0724f71751e912ec8c2be 30-Mar-2010 Torok Edwin <edwintorok@gmail.com> Reapply r99881 with some fixes: only call destructor in releaseMemory!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
226dd2ba992b1f00491c10c59ca1889825bf92b6 30-Mar-2010 Torok Edwin <edwintorok@gmail.com> Revert 99881, it brooke smooshlab's llvm-gcc-i386-darwin9.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2a22004f6857c57dc483ea6180f0e1f86854bd13 30-Mar-2010 Torok Edwin <edwintorok@gmail.com> Introduce another Reset() method in BumpPtrAllocator that calls a destructor
on all objects it has allocated, if they are all of the same size and alignment.
Use this to destruct all VNInfos allocated in LiveIntervalAnalysis (PR6653).

valnos is not reliable for this purpose, as seen in r99400
(which still leaked, and sometimes caused double frees).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
28a1e486907104b85c5787345914917d74f0cf77 30-Mar-2010 Evan Cheng <evan.cheng@apple.com> Avoid being influenced by the presence of dbg_value instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d6a6b3b7563a3f54ba48d465fc03ee10bbccb7a8 24-Mar-2010 Bob Wilson <bob.wilson@apple.com> Revert Edwin's change that is breaking MultiSource/Applications/ClamAV/clamscan.
--- Reverse-merging r99400 into '.':
D test/CodeGen/Generic/2010-03-24-liveintervalleak.ll
U lib/CodeGen/LiveIntervalAnalysis.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
15417383b96f9035a00bab5c13746f59e91e35e0 24-Mar-2010 Torok Edwin <edwintorok@gmail.com> Fix memory leak in liveintervals: the destructor for VNInfos must be called,
otherwise the SmallVector it contains doesn't free its memory.
In most cases LiveIntervalAnalysis could get away by not calling the destructor,
because VNInfos are bumpptr-allocated, and smallvectors usually don't grow.
However when the SmallVector does grow it always leaks.

This is the valgrind shown leak from the original testcase:
==8206== 18,304 bytes in 151 blocks are definitely lost in loss record 164 of 164
==8206== at 0x4A079C7: operator new(unsigned long) (vg_replace_malloc.c:220)
==8206== by 0x4DB7A7E: llvm::SmallVectorBase::grow_pod(unsigned long, unsigned long) (in /home/edwin/clam/git/builds/defaul
t/libclamav/.libs/libclamav.so.6.1.0)
==8206== by 0x4F90382: llvm::VNInfo::addKill(llvm::SlotIndex) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libcl
amav.so.6.1.0)
==8206== by 0x5126B5C: llvm::LiveIntervals::handleVirtualRegisterDef(llvm::MachineBasicBlock*, llvm::ilist_iterator<llvm::M
achineInstr>, llvm::SlotIndex, llvm::MachineOperand&, unsigned int, llvm::LiveInterval&) (in /home/edwin/clam/git/builds/defau
lt/libclamav/.libs/libclamav.so.6.1.0)
==8206== by 0x512725E: llvm::LiveIntervals::handleRegisterDef(llvm::MachineBasicBlock*, llvm::ilist_iterator<llvm::MachineI
nstr>, llvm::SlotIndex, llvm::MachineOperand&, unsigned int) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav
.so.6.1.0)
==8206== by 0x51278A8: llvm::LiveIntervals::computeIntervals() (in /home/edwin/clam/git/builds/default/libclamav/.libs/libc
lamav.so.6.1.0)
==8206== by 0x5127CB4: llvm::LiveIntervals::runOnMachineFunction(llvm::MachineFunction&) (in /home/edwin/clam/git/builds/de
fault/libclamav/.libs/libclamav.so.6.1.0)
==8206== by 0x4DAE935: llvm::FPPassManager::runOnFunction(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclama
v/.libs/libclamav.so.6.1.0)
==8206== by 0x4DAEB10: llvm::FunctionPassManagerImpl::run(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclama
v/.libs/libclamav.so.6.1.0)
==8206== by 0x4DAED3D: llvm::FunctionPassManager::run(llvm::Function&) (in /home/edwin/clam/git/builds/default/libclamav/.l
ibs/libclamav.so.6.1.0)
==8206== by 0x4D8BE8E: llvm::JIT::runJITOnFunctionUnlocked(llvm::Function*, llvm::MutexGuard const&) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav.so.6.1.0)
==8206== by 0x4D8CA72: llvm::JIT::getPointerToFunction(llvm::Function*) (in /home/edwin/clam/git/builds/default/libclamav/.libs/libclamav.so.6.1.0)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4507f089d48c5adb454cd12b68333d5590ce05dd 16-Mar-2010 Evan Cheng <evan.cheng@apple.com> Fix liveintervals handling of dbg_value instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
826cbac2a0cef418fd8949813761c2ed975f3df1 11-Mar-2010 Evan Cheng <evan.cheng@apple.com> The check for coalescing a virtual register to a physical register, e.g.
cl = EXTRACT_SUBREG reg1024, 1, is overly conservative. It should check
for overlaps of vr's live interval with the super registers of the
physical register (ECX in this case) and let JoinIntervals() handle checking
the coalescing feasibility against the physical register (cl in this case).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a2f767b1a7ed6aa4edd6dcf65b68bf3a4ed3901e 10-Mar-2010 Dale Johannesen <dalej@apple.com> Fix a bug in DEBUG_VALUE handling Devang ran into.
I'll get this loop right yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e5d90416ee1a4f45eba80789a7a3cbc3d497a4cd 01-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Use methods to determine if a LiveInterval is spillable.

Don't accidentally produce unspillable intervals for deeply nested loops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dcfe5f30b5e262971f601a65bebcc0367fef56c5 23-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Keep track of phi join registers explicitly in LiveVariables.

Previously, LiveIntervalAnalysis would infer phi joins by looking for multiply
defined registers. That doesn't work if the phi join is implicitly defined in
all but one of the predecessors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
352d352c023ed411d9e4357ea01f3ec468ff87dc 18-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Always normalize spill weights, also for intervals created by spilling.

Moderate the weight given to very small intervals.

The spill weight given to new intervals created when spilling was not
normalized in the same way as the original spill weights calculated by
CalcSpillWeights. That meant that restored registers would tend to hang around
because they had a much higher spill weight that unspilled registers.

This improves the runtime of a few tests by up to 10%, and there are no
significant regressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e21765d1c86dedbb5537ba6cf5e0cf156d7283ea 10-Feb-2010 Dale Johannesen <dalej@apple.com> When I rewrote this loop per Chris' preference I
changed its behavior. Oops.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1d0aeabe3fce2ce6610e988b36582b47a7684f74 10-Feb-2010 Dale Johannesen <dalej@apple.com> Rewrite loop to suit Chris' preference.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bd63520161629385ff5a0b037eccc770d8d15289 10-Feb-2010 Dale Johannesen <dalej@apple.com> Skip DBG_VALUE many places in live intervals and
register coalescing. This fixes many crashes and
places where debug info affects codegen (when
dbg.value is lowered to machine instructions, which
it isn't yet in TOT).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
518bb53485df640d7b7e3f6b0544099020c42aa7 09-Feb-2010 Chris Lattner <sabre@nondot.org> move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h. #include the new TargetOpcodes.h
into MachineInstr. Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the
codebase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
00a99a35840451a291eb61a192a750908a4073ae 06-Feb-2010 Evan Cheng <evan.cheng@apple.com> Run codegen dce pass for all targets at all optimization levels. Previously it's
only run for x86 with fastisel. I've found it being very effective in
eliminating some obvious dead code as result of formal parameter lowering
especially when tail call optimization eliminated the need for some of the loads
from fixed frame objects. It also shrinks a number of the tests. A couple of
tests no longer make sense and are now eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1caedd056dbc3eda1537ad8251323bd985819b80 22-Jan-2010 Dale Johannesen <dalej@apple.com> Ignore DEBUG_VALUE when building live intervals;
this makes the code work transparently the same
whether they're there or not.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8a34229dcf484739119857988772572ef0cad9f2 04-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
74ab5eeffbd70f2387338e3ee8195be9f73e6dd8 22-Dec-2009 Lang Hames <lhames@gmail.com> Changed slot index ranges for MachineBasicBlocks to be exclusive of endpoint.
This fixes an in-place update bug where code inserted at the end of basic blocks may not be covered by existing intervals which were live across the entire block. It is also consistent with the way ranges are specified for live intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
74215fc29fa748e006c0309671555d5873bac56a 16-Dec-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Reuse lowered phi nodes.

Tail duplication produces lots of identical phi nodes in different basic
blocks. Teach PHIElimination to reuse the join registers when lowering a phi
node that is identical to an already lowered node. This saves virtual
registers, and more importantly it avoids creating copies the the coalescer
doesn't know how to eliminate.

Teach LiveIntervalAnalysis about the phi joins with multiple uses.

This patch significantly reduces code size produced by -pre-regalloc-taildup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91549 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ac94863a1c090f2221ff2e21b7ee5480bd1db594 11-Dec-2009 Evan Cheng <evan.cheng@apple.com> Coalesce insert_subreg undef, x first to avoid phase ordering issue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cf97036675340bc889cfe04295cda63afe9496e2 10-Dec-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Also attempt trivial coalescing for live intervals that end in a copy.

The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch is more conservative than r90502, and does not break
483.xalancbmk/i686. It still breaks the PowerPC bootstrap, so it is disabled
by default, and can be enabled with the -trivial-coalesce-ends option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6194569d22003fddaf1a33acdbb84d5efe76e7d7 09-Dec-2009 Lang Hames <lhames@gmail.com> Added a new "splitting" spiller.

When a call is placed to spill an interval this spiller will first try to
break the interval up into its component values. Single value intervals and
intervals which have already been split (or are the result of previous splits)
are spilled by the default spiller.

Splitting intervals as described above may improve the performance of generated
code in some circumstances. This work is experimental however, and it still
miscompiles many benchmarks. It's not recommended for general use yet.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dc492e037034e7671e3fb9ab3e041186cdc97508 05-Dec-2009 Bill Wendling <isanbard@gmail.com> Temporarily revert r90502. It was causing the llvm-gcc bootstrap on PPC to fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90653 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6b74e505be1016223e090a6c806f7caa3165a146 04-Dec-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Also attempt trivial coalescing for live intervals that end in a copy.

The coalescer is supposed to clean these up, but when setting up parameters
for a function call, there may be copies to physregs. If the defining
instruction has been LICM'ed far away, the coalescer won't touch it.

The register allocation hint does not always work - when the register
allocator is backtracking, it clears the hints.

This patch takes care of a few more cases that r90163 missed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f4811a96941433fc3828869d76dfeba5ec5decd3 03-Dec-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Clean up some loop logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9836a26da3acc15deec878cd6ba21a6b5f2e753b 01-Dec-2009 Evan Cheng <evan.cheng@apple.com> Fix PR5391: support early clobber physical register def tied with a use (ewwww)
- A valno should be set HasRedefByEC if there is an early clobber def in the middle of its live ranges. It should not be set if the def of the valno is defined by an early clobber.
- If a physical register def is tied to an use and it's an early clobber, it just means the HasRedefByEC is set since it's still one continuous live range.
- Add a couple of missing checks for HasRedefByEC in the coalescer. In general, it should not coalesce a vr with a physical register if the physical register has a early clobber def somewhere. This is overly conservative but that's the price for using such a nasty inline asm "feature".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ce7a663140e6e67cf5ef7091e076e8541300c15a 30-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> New virtual registers created for spill intervals should inherit allocation hints from the original register.

This helps us avoid silly copies when rematting values that are copied to a physical register:

leaq _.str44(%rip), %rcx
movq %rcx, %rsi
call _strcmp

becomes:

leaq _.str44(%rip), %rsi
call _strcmp

The coalescer will not touch the movq because that would tie down the physical register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90163 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6cd8103bea5c0bc92f30b8021e9469131a2a408f 20-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> More consistent labelling of basic blocks in debug output

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
324da7647cfc3025e0c987176f0a300f9f780e6f 20-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Add MachineBasicBlock::getName, and use it in place of getBasicBlock()->getName.

Fix debug code that assumes getBasicBlock never returns NULL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1e78aa445c5b5b466cea4478f3f9034d4be7278e 18-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove the -early-coalescing option

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
df8ed024735b651d6e0082262d4e7a00b2fa4d32 09-Nov-2009 Evan Cheng <evan.cheng@apple.com> Hide a couple of options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86522 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3de23e6f6cf337451a0934159da494d645b93133 07-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix inverted conflict test in -early-coalesce.

A non-identity copy cannot be coalesced when the phi join destination register
is live at the copy site.

Also verify the condition that the PHI join source register is only used in
the PHI join. Otherwise the coalescing is invalid.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86322 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
233a60ec40b41027ff429e2f2c27fa2be762f2e9 04-Nov-2009 Lang Hames <lhames@gmail.com> The Indexes Patch.

This introduces a new pass, SlotIndexes, which is responsible for numbering
instructions for register allocation (and other clients). SlotIndexes numbering
is designed to match the existing scheme, so this patch should not cause any
changes in the generated code.

For consistency, and to avoid naming confusion, LiveIndex has been renamed
SlotIndex.

The processImplicitDefs method of the LiveIntervals analysis has been moved
into its own pass so that it can be run prior to SlotIndexes. This was
necessary to match the existing numbering scheme.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5f4fb86d5853a433815501739584624d296b57a3 20-Oct-2009 Evan Cheng <evan.cheng@apple.com> Trim unnecessary includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0222a8cfb8f8f3f67e4a07164eb1ecf9c44e6f64 20-Oct-2009 Evan Cheng <evan.cheng@apple.com> If the physical register being spilled does not have an interval, spill its sub-registers instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a70dca156fa76d452f54829b5c5f962ddfd94ef2 10-Oct-2009 Dan Gohman <gohman@apple.com> Factor out LiveIntervalAnalysis' code to determine whether an instruction
is trivially rematerializable and integrate it into
TargetInstrInfo::isTriviallyReMaterializable. This way, all places that
need to know whether an instruction is rematerializable will get the
same answer.

This enables the useful parts of the aggressive-remat option by
default -- using AliasAnalysis to determine whether a memory location
is invariant, and removes the questionable parts -- rematting operations
with virtual register inputs that may not be live everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
599a87aca0194edb46f0bee141c3de8281bf22b9 09-Oct-2009 Dan Gohman <gohman@apple.com> isTriviallyReMaterializable checks the
TargetInstrDesc::isRematerializable flag, so it isn't necessary to do
this check in its callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2627e08e05d8e7521f7c03496ede45868144d426 07-Oct-2009 Dan Gohman <gohman@apple.com> Replace some code for aggressive-remat with MachineInstr::isInvariantLoad, and
teach it how to recognize invariant physical registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6cc91e39c04c0c00756e7667f623f787c4851439 03-Oct-2009 Lang Hames <lhames@gmail.com> Oops. Renamed remaining MachineInstrIndex references.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cc3b0650f1feec45d1a2890b20c05c4b325f1788 03-Oct-2009 Lang Hames <lhames@gmail.com> Renamed MachineInstrIndex to LiveIndex.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83254 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
295a8089cd76079d3e2798c6a44ee249852cab12 26-Sep-2009 Daniel Dunbar <daniel@zuster.org> Remove unused variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2bf0649e053d1589689d2e4cf32c7bf1e5e6ae12 26-Sep-2009 Dan Gohman <gohman@apple.com> Simplify a few more uses of reg_iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c76909abfec876c6b751d693ebd3df07df686aa0 25-Sep-2009 Dan Gohman <gohman@apple.com> Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
This eliminates MachineInstr's std::list member and allows the data to be
created by isel and live for the remainder of codegen, avoiding a lot of
copying and unnecessary translation. This also shrinks MemSDNode.
- Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
fields for MachineMemOperands.
- Change MemSDNode to have a MachineMemOperand member instead of its own
fields with the same information. This introduces some redundancy, but
it's more consistent with what MachineInstr will eventually want.
- Ignore alignment when searching for redundant loads for CSE, but remember
the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
296925dc169b45e7535abdccc8dc143a8bec7f0a 23-Sep-2009 Evan Cheng <evan.cheng@apple.com> Fix PR5024. LiveVariables physical register defs should *commit* only after all
of the defs are processed.
Also fix a implicit_def propagation bug: a implicit_def of a physical register
should be applied to uses of the sub-registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b0f5973bee566269f41d1cc21b7a1d3bede1d837 21-Sep-2009 Evan Cheng <evan.cheng@apple.com> Fix PR4986. "r1024 = insert_subreg r1024, undef, 2" cannot be turned in an implicit_def. Instead, it's an identity copy so it should be eliminated. Also make sure to update livevariable kill information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
39faac2531268b8555475796c6071556670dc290 20-Sep-2009 Dale Johannesen <dalej@apple.com> When computing live intervals for earlyclobber operands,
we pushed the beginning of the interval back 1, so the
interval would overlap with inputs that die. We were
also pushing the end of the interval back 1, though,
which means the earlyclobber didn't overlap with other
output operands. Don't do this. PR 4964.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82342 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
504f9a61e61ee274fe50d8300825bdc2e5adb9b0 15-Sep-2009 Daniel Dunbar <daniel@zuster.org> Fix -Asserts warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81909 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3f85549f4dab19f9dde2c766151bf01e688f83b7 15-Sep-2009 Evan Cheng <evan.cheng@apple.com> Another try at early partial coalescing. Identity phi source copies (their sources are defined by phi join def) are coalesced. And the phi join copy is backward copy propagated into the other copies.

Still miscompiling some tests. :-(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
752195e3c662c6b5db042cf897c984624720f3b8 14-Sep-2009 Evan Cheng <evan.cheng@apple.com> Add early coalescing to liveintervals. This is work in progress and is known to miscompute some tests. Read it at your own rish, I have aged 10 year while writing this.

The gist of this is if source of some of the copies that feed into a phi join is defined by the phi join, we'd like to eliminate them. However, if any of the non-identity source overlaps the live interval of the phi join then the coalescer won't be able to coalesce them. The early coalescer's job is to eliminate the identity copies by partially-coalescing the two live intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81796 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
35f291d2c5f80e8e713704190230064311bbbbbe 12-Sep-2009 Lang Hames <lhames@gmail.com> Moved some more index operations over to LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
217311130d83f04c05d4248c557cef4bc8994e50 12-Sep-2009 Evan Cheng <evan.cheng@apple.com> 80 col violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8651125d2885f74546b6e2a556082111d5b75da3 04-Sep-2009 Lang Hames <lhames@gmail.com> Replaces uses of unsigned for indexes in LiveInterval and VNInfo with
a new class, MachineInstrIndex, which hides arithmetic details from
most clients. This is a step towards allowing the register allocator
to update/insert code during allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
45cfe545ec8177262dabc70580ce05feaa1c3880 23-Aug-2009 Chris Lattner <sabre@nondot.org> Change Pass::print to take a raw ostream instead of std::ostream,
update all code that this affects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
705e07f578e2b3af47ddab610feb4e7f2d3063a5 23-Aug-2009 Chris Lattner <sabre@nondot.org> remove various std::ostream version of printing methods from
MachineInstr and MachineOperand. This required eliminating a
bunch of stuff that was using DOUT, I hope that bill doesn't
mind me stealing his fun. ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
77942d4ee47e76626d574b027e4b9c5c90e2bbf4 23-Aug-2009 Chris Lattner <sabre@nondot.org> remove a dead class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79795 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8e6179fb134af929ee7c937c82d9dc1c9a104c5f 22-Aug-2009 Bill Wendling <isanbard@gmail.com> Convert DOUT to DEBUG(errs()...).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
52c1afcaea61440950a11a4ccadac4354420d727 11-Aug-2009 Lang Hames <lhames@gmail.com> Modified VNInfo. The "copy" member is now a union which holds the copy for a register interval, or the defining register for a stack interval. Access is via getCopy/setCopy and getReg/setReg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6ade93bbdceac28f441cfdc2571929a866eb7d24 05-Aug-2009 Evan Cheng <evan.cheng@apple.com> Turn some insert_subreg, extract_subreg, subreg_to_reg into implicit_defs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78151 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b5257664795d49ada0d4669fe8ed1cd49c04fbf3 03-Aug-2009 David Greene <greened@obbligato.org> Re-apply LiveInterval index dumping patch, with fixes suggested by Bill
and others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
845012e6d31799c7fbd1193fa1af8ee2d12e9231 01-Aug-2009 Dan Gohman <gohman@apple.com> Use setPreservesAll and setPreservesCFG in CodeGen passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ce63ffb52f249b62cdf2d250c128007b13f27e71 25-Jul-2009 Daniel Dunbar <daniel@zuster.org> More migration to raw_ostream, the water has dried up around the iostream hole.
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
"magic" DOUT behavior which avoided calling printing functions when the
statement was disabled. In addition to being unnecessary magic, it had the
downside of leaving code in -Asserts builds, and of hiding potentially
unnecessary computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3f0e83067d7938f742d21e14fc87c006d2fc3161 24-Jul-2009 Daniel Dunbar <daniel@zuster.org> Move to raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76963 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
340482dcc0060b10976b5ff13c44b6d4c8446b9b 22-Jul-2009 David Greene <greened@obbligato.org> Constify the key in Mi2IndexMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3380d5c4aaafc3d78d32f583d685d64a67ae5224 21-Jul-2009 Chris Lattner <sabre@nondot.org> revert r76602, 76603, and r76615, pending design discussions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a358c1db5c744f7c524b18f2860c2d48613adbd1 21-Jul-2009 David Greene <greened@obbligato.org> Prefix IR dumps with LiveInterval indices when possible. This turns
this:

%ESI<def> = MOV32rr %EDI<kill>
ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
%reg1027<def> = MOVZX64rr32 %ESI
%reg1027<def> = ADD64ri8 %reg1027, 15, %EFLAGS<imp-def,dead>
%reg1027<def> = AND64ri8 %reg1027, -16, %EFLAGS<imp-def,dead>
%RDI<def> = MOV64rr %RSP
%RDI<def> = SUB64rr %RDI, %reg1027<kill>, %EFLAGS<imp-def,dead>
%RSP<def> = MOV64rr %RDI

into this:

4 %reg1024<def> = MOV32rr %EDI<kill>
12 ADJCALLSTACKDOWN64 0, %RSP<imp-def>, %EFLAGS<imp-def,dead>, %RSP<imp-use>
20 %reg1025<def> = MOVZX64rr32 %reg1024
28 %reg1026<def> = MOV64rr %reg1025<kill>
36 %reg1026<def> = ADD64ri8 %reg1026, 15, %EFLAGS<imp-def,dead>
44 %reg1027<def> = MOV64rr %reg1026<kill>
52 %reg1027<def> = AND64ri8 %reg1027, -16, %EFLAGS<imp-def,dead>
60 %reg1028<def> = MOV64rr %RSP
68 %reg1029<def> = MOV64rr %reg1028<kill>
76 %reg1029<def> = SUB64rr %reg1029, %reg1027<kill>, %EFLAGS<imp-def,dead>
84 %RSP<def> = MOV64rr %reg1029

This helps greatly when debugging register allocation and coalescing
problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d129d73b725e32d2fc0c87f392c239db8801e922 17-Jul-2009 Evan Cheng <evan.cheng@apple.com> Simplify the coalescer (finally!) by making LiveIntervals::processImplicitDefs a little more aggressive and teaching liveintervals to make use of isUndef marker on MachineOperands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5f15992b77f178f633e414603a732279997ae1e2 16-Jul-2009 Evan Cheng <evan.cheng@apple.com> Changed my mind. We now allow remat of instructions whose defs have subreg indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
378445303b10b092a898a75131141a8259cff50b 16-Jul-2009 Evan Cheng <evan.cheng@apple.com> Let callers decide the sub-register index on the def operand of rematerialized instructions.
Avoid remat'ing instructions whose def have sub-register indices for now. It's just really really hard to get all the cases right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c23197a26f34f559ea9797de51e187087c039c42 14-Jul-2009 Torok Edwin <edwintorok@gmail.com> llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c25e7581b9b8088910da31702d4ca21c4734c6d7 11-Jul-2009 Torok Edwin <edwintorok@gmail.com> assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7d696d80409aad20bb5da0fc4eccab941dd371d4 11-Jul-2009 Torok Edwin <edwintorok@gmail.com> Convert more assert(0)+abort() -> LLVM_UNREACHABLE,
and abort()/exit() -> llvm_report_error().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
413a15ef0e5e727afeedf57e8b2f416acf3662c0 10-Jul-2009 Duncan Sands <baldrick@free.fr> Avoid compiler warnings if assertions turned off.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ffd1326ff8dfc652a8026c3faebf55bbba7c32c7 09-Jul-2009 Lang Hames <lhames@gmail.com> Improved tracking of value number kills. VN kills are now represented
as an (index,bool) pair. The bool flag records whether the kill is a
PHI kill or not. This code will be used to enable splitting of live
intervals containing PHI-kills.

A slight change to live interval weights introduced an extra spill
into lsr-code-insertion (outside the critical sections). The test
condition has been updated to reflect this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
459a7c6b6ad9c4fcb9f119aa6eaaf2769b00d9b1 01-Jul-2009 Evan Cheng <evan.cheng@apple.com> Remove special handling of implicit_def. Fix a couple more bugs in liveintervalanalysis and coalescer handling of implicit_def.

Note, isUndef marker must be placed even on implicit_def def operand or else the scavenger will not ignore it. This is necessary because -O0 path does not use liveintervalanalysis, it treats implicit_def just like any other def.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2578ba26e72e36dde64be0f52a2788480aad3378 01-Jul-2009 Evan Cheng <evan.cheng@apple.com> Handle IMPLICIT_DEF with isUndef operand marker, part 2. This patch moves the code to annotate machineoperands to LiveIntervalAnalysis. It also add markers for implicit_def that define physical registers. The rest, is just a lot of details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4784f1fc73abf6005b7b7262d395af71b57b1255 30-Jun-2009 Evan Cheng <evan.cheng@apple.com> Add a bit IsUndef to MachineOperand. This indicates the def / use register operand is defined by an implicit_def. That means it can def / use any register and passes (e.g. register scavenger) can feel free to ignore them.

The register allocator, when it allocates a register to a virtual register defined by an implicit_def, can allocate any physical register without worrying about overlapping live ranges. It should mark all of operands of the said virtual register so later passes will do the right thing.

This is not the best solution. But it should be a lot less fragile to having the scavenger try to track what is defined by implicit_def.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1873d0c2257b18451c5bb35577f929d0723433a0 27-Jun-2009 Chris Lattner <sabre@nondot.org> When doing remat, don't consider uses of non-allocatable physregs. Patch
by Evan.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
10382fb71d8306f320ecbeb7049d25354c0e5457 19-Jun-2009 Lang Hames <lhames@gmail.com> More VNInfo tweaking, plus a little progress on intra-block splitting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73750 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d21c31610c4a10e9e638f4221b5df89ea932e258 19-Jun-2009 Lang Hames <lhames@gmail.com> Improved PHI def marking, replaced some gotos with breaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
857c4e01f85601cf2084adb860616256ee47c177 17-Jun-2009 Lang Hames <lhames@gmail.com> VNInfo cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
90f95f88c6ce09c6744777dc9d140c3c77203b92 14-Jun-2009 Evan Cheng <evan.cheng@apple.com> Move register allocation preference (or hint) from LiveInterval to MachineRegisterInfo. This allows more passes to set them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f41538d1b54f55e8900394929b50f7ce3e61125f 02-Jun-2009 Lang Hames <lhames@gmail.com> Update to in-place spilling framework. Includes live interval scaling and trivial rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
493a3d015cbb2bcc18d9293a4dec3b35c7493818 26-May-2009 Jeffrey Yasskin <jyasskin@google.com> LiveVariables::VarInfo contains an AliveBlocks BitVector, which has as many
entries as there are basic blocks in the function. LiveVariables::getVarInfo
creates a VarInfo struct for every register in the function, leading to
quadratic space use. This patch changes the BitVector to a SparseBitVector,
which doesn't help the worst-case memory use but does reduce the actual use in
very long functions with short-lived variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72426 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c781a243a3d17e7e763515794168d8fa6043f565 03-May-2009 Evan Cheng <evan.cheng@apple.com> In some rare cases, the register allocator can spill registers but end up not utilizing registers at all. The fundamental problem is linearscan's backtracking can end up freeing more than one allocated registers. However, reloads and restores might be folded into uses / defs and freed registers might not be used at all.

VirtRegMap keeps track of allocations so it knows what's not used. As a horrible hack, the stack coloring can color spill slots with *free* registers. That is, it replace reload and spills with copies from and to the free register. It unfold instructions that load and store the spill slot and replace them with register using variants.

Not yet enabled. This is part 1. More coming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c45288e06bfe7d0b0e74eff350d280fa6c944373 27-Apr-2009 Evan Cheng <evan.cheng@apple.com> Fix PR4076. Correctly create live interval of physical register with two-address update.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d521bc983b32da71b85d42dd30da87079afa5728 27-Apr-2009 Evan Cheng <evan.cheng@apple.com> Fix PR4056. It's possible a physical register def is dead if its implicit use is deleted by two-address pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5b69ebac857104770b1a751bf7a463fda4330a62 22-Apr-2009 Evan Cheng <evan.cheng@apple.com> It has finally happened. Spiller is now using live interval info.

This fixes a very subtle bug. vr defined by an implicit_def is allowed overlap with any register since it doesn't actually modify anything. However, if it's used as a two-address use, its live range can be extended and it can be spilled. The spiller must take care not to emit a reload for the vn number that's defined by the implicit_def. This is both a correctness and performance issue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
206d1856ad80e58a3a9e01b7c0d3fef66b3cacc2 20-Apr-2009 Evan Cheng <evan.cheng@apple.com> Added a linearscan register allocation optimization. When the register allocator spill an interval with multiple uses in the same basic block, it creates a different virtual register for each of the reloads. e.g.

%reg1498<def> = MOV32rm %reg1024, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
%reg1506<def> = MOV32rm %reg1024, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
%reg1486<def> = MOV32rr %reg1506
%reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
%reg1510<def> = MOV32rm %reg1024, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]

=>

%reg1498<def> = MOV32rm %reg2036, 1, %reg0, 12, %reg0, Mem:LD(4,4) [sunkaddr39 + 0]
%reg1506<def> = MOV32rm %reg2037, 1, %reg0, 8, %reg0, Mem:LD(4,4) [sunkaddr42 + 0]
%reg1486<def> = MOV32rr %reg1506
%reg1486<def> = XOR32rr %reg1486, %reg1498, %EFLAGS<imp-def,dead>
%reg1510<def> = MOV32rm %reg2038, 1, %reg0, 4, %reg0, Mem:LD(4,4) [sunkaddr45 + 0]

From linearscan's point of view, each of reg2036, 2037, and 2038 are separate registers, each is "killed" after a single use. The reloaded register is available and it's often clobbered right away. e.g. In thise case reg1498 is allocated EAX while reg2036 is allocated RAX. This means we end up with multiple reloads from the same stack slot in the same basic block.

Now linearscan recognize there are other reloads from same SS in the same BB. So it'll "downgrade" RAX (and its aliases) after reg2036 is allocated until the next reload (reg2037) is done. This greatly increase the likihood reloads from SS are reused.

This speeds up sha1 from OpenSSL by 5.8%. It is also an across the board win for SPEC2000 and 2006.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
70f2f65aacdbc96fe158b2860b5f0bad075ee548 13-Apr-2009 Dan Gohman <gohman@apple.com> Don't abort on an aliasing physical register that does not have
a live interval. This is needed for some upcoming subreg changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d9df5017040489303acb57bdd8697ef0f8bafc08 09-Apr-2009 Bob Wilson <bob.wilson@apple.com> Fix pr3954. The register scavenger asserts for inline assembly with
register destinations that are tied to source operands. The
TargetInstrDescr::findTiedToSrcOperand method silently fails for inline
assembly. The existing MachineInstr::isRegReDefinedByTwoAddr was very
close to doing what is needed, so this revision makes a few changes to
that method and also renames it to isRegTiedToUseOperand (for consistency
with the very similar isRegTiedToDefOperand and because it handles both
two-address instructions and inline assembly with tied registers).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
97121ba2afb8d566ff1bf5c4e8fc5d4077940a7f 08-Apr-2009 Dan Gohman <gohman@apple.com> Implement support for using modeling implicit-zero-extension on x86-64
with SUBREG_TO_REG, teach SimpleRegisterCoalescing to coalesce
SUBREG_TO_REG instructions (which are similar to INSERT_SUBREG
instructions), and teach the DAGCombiner to take advantage of this on
targets which support it. This eliminates many redundant
zero-extension operations on x86-64.

This adds a new TargetLowering hook, isZExtFree. It's similar to
isTruncateFree, except it only applies to actual definitions, and not
no-op truncates which may not zero the high bits.

Also, this adds a new optimization to SimplifyDemandedBits: transform
operations like x+y into (zext (add (trunc x), (trunc y))) on targets
where all the casts are no-ops. In contexts where the high part of the
add is explicitly masked off, this allows the mask operation to be
eliminated. Fix the DAGCombiner to avoid undoing these transformations
to eliminate casts on targets where the casts are no-ops.

Also, this adds a new two-address lowering heuristic. Since
two-address lowering runs before coalescing, it helps to be able to
look through copies when deciding whether commuting and/or
three-address conversion are profitable.

Also, fix a bug in LiveInterval::MergeInClobberRanges. It didn't handle
the case that a clobber range extended both before and beyond an
existing live range. In that case, multiple live ranges need to be
added. This was exposed by the new subreg coalescing code.

Remove 2008-05-06-SpillerBug.ll. It was bugpoint-reduced, and the
spiller behavior it was looking for no longer occurrs with the new
instruction selection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b98bbb7597495fb401b020679a94389298175506 26-Mar-2009 Owen Anderson <resistor@mac.com> Don't assign a new stack slot if the pre-alloc splitter already assigned one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2824a655509577127d221eecd1425de196f80320 23-Mar-2009 Evan Cheng <evan.cheng@apple.com> Fix PR3391 and PR3864. Reg allocator infinite looping.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67544 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fb11288109329cb736d9f49769581a0d0c23fe19 23-Mar-2009 Evan Cheng <evan.cheng@apple.com> Model inline asm constraint which ties an input to an output register as machine operand TIED_TO constraint. This eliminated the need to pre-allocate registers for these. This also allows register allocator can eliminate the unneeded copies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
48fe63526e35ddaee7e98879596a569911f41319 20-Mar-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Fix the Win32 VS2008 build:
- Make type declarations match the struct/class keyword of the definition.
- Move AddSignalHandler into the namespace where it belongs.
- Correctly call functions from template base.
- Some other small changes.
With this patch, LLVM and Clang should build properly and with far less noise under VS2008.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a24752ff43dc1ad8c18c5d9e78549c45f62b980e 19-Mar-2009 Evan Cheng <evan.cheng@apple.com> Added MachineInstr::isRegTiedToDefOperand to check for two-addressness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0076c616e8abc2ecf36600a7ac20ec784420cdc4 05-Mar-2009 Evan Cheng <evan.cheng@apple.com> Fix how livein live intervals are handled. Previously it could end at MBB start. Sorry, no small test case possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0a1fcce09230e9b4bd30a8f07447aa075dce7470 08-Feb-2009 Evan Cheng <evan.cheng@apple.com> Fix PR3486. Fix a bug in code that manually patch physical register live interval after its sub-register is coalesced with a virtual register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5a3c6a87b0173b9d367f7b55e7c99e5110ede057 29-Jan-2009 Evan Cheng <evan.cheng@apple.com> Exit with nice warnings when register allocator run out of registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
04ee5a1d9267e5e6fab8f088095fcb83c3c5cbd1 20-Jan-2009 Evan Cheng <evan.cheng@apple.com> Change TargetInstrInfo::isMoveInstr to return source and destination sub-register indices as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8f90b6eb2fd0125f5b779de80954944f9071fb87 07-Jan-2009 Evan Cheng <evan.cheng@apple.com> The coalescer does not coalesce a virtual register to a physical register if any of the physical register's sub-register live intervals overlaps with the virtual register. This is overly conservative. It prevents a extract_subreg from being coalesced away:

v1024 = EDI // not killed
=
= EDI

One possible solution is for the coalescer to examine the sub-register live intervals in the same manner as the physical register. Another possibility is to examine defs and uses (when needed) of sub-registers. Both solutions are too expensive. For now, look for "short virtual intervals" and scan instructions to look for conflict instead.

This is a small win on x86-64. e.g. It shaves 403.gcc by ~80 instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5379f412bc6ac6171f3bd73930197bfce88c2faa 19-Dec-2008 Evan Cheng <evan.cheng@apple.com> Fix PR3149. If an early clobber def is a physical register and it is tied to an input operand, it effectively extends the live range of the physical register. Currently we do not have a good way to represent this.

172 %ECX<def> = MOV32rr %reg1039<kill>
180 INLINEASM <es:subl $5,$1
sbbl $3,$0>, 10, %EAX<def>, 14, %ECX<earlyclobber,def>, 9, %EAX<kill>,
36, <fi#0>, 1, %reg0, 0, 9, %ECX<kill>, 36, <fi#1>, 1, %reg0, 0
188 %EAX<def> = MOV32rr %EAX<kill>
196 %ECX<def> = MOV32rr %ECX<kill>
204 %ECX<def> = MOV32rr %ECX<kill>
212 %EAX<def> = MOV32rr %EAX<kill>
220 %EAX<def> = MOV32rr %EAX
228 %reg1039<def> = MOV32rr %ECX<kill>

The early clobber operand ties ECX input to the ECX def.

The live interval of ECX is represented as this:
%reg20,inf = [46,47:1)[174,230:0) 0@174-(230) 1@46-(47)

The right way to represent this is something like
%reg20,inf = [46,47:2)[174,182:1)[181:230:0) 0@174-(182) 1@181-230 @2@46-(47)

Of course that won't work since that means overlapping live ranges defined by two val#.

The workaround for now is to add a bit to val# which says the val# is redefined by a early clobber def somewhere. This prevents the move at 228 from being optimized away by SimpleRegisterCoalescing::AdjustCopiesBackFrom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c93ced5b34b50a622ee8e49d90592f03ac7ff992 08-Dec-2008 Dan Gohman <gohman@apple.com> Clarify some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
650d7f3ff4d22646def71b842f7f163c539e0aaf 05-Dec-2008 Evan Cheng <evan.cheng@apple.com> Reason #3 from 60595 doesn't hold true. If we can fold a PIC load from constpool into a use, the rewrite happens at time of spill (not in VirtRegMap). Later on, if the GlobalBaseReg is spilled, the spiller can see the use uses GlobalBaseReg and do the right thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
72eeb94fe1d69cd05bdbbe86b2bc9fa25c963c22 05-Dec-2008 Evan Cheng <evan.cheng@apple.com> Fix comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2ce7f2068f13566f5a70ee779e3bb83a6cb8d942 05-Dec-2008 Dan Gohman <gohman@apple.com> Drop the reg argument to isRegReDefinedByTwoAddr, which was redundant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
15511cf1660cfd6bb8b8e8fca2db9450f50430ee 03-Dec-2008 Dan Gohman <gohman@apple.com> Rename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2ad8245566a3c92d4559727a877d57ecf5d078c8 26-Nov-2008 Dan Gohman <gohman@apple.com> LiveRanges are represented as half-open ranges. Fix the findLiveInMBBs code
and the LiveInterval.h top-level comment and accordingly. This fixes blocks
having spurious live-in registers in boundary cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
59500c8f9a76b3386329b6f837255c16f4e8b61b 21-Nov-2008 Devang Patel <dpatel@apple.com> Silence unused variable warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4a829ecc54cdcb0192550639556a18728af5119c 13-Nov-2008 Dan Gohman <gohman@apple.com> Use find_first/find_next to iterate through all the set bits in a
BitVector, instead of manually testing each bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4cbb3ca67d8b1ca5fee7793633de052a3b8f87b2 12-Nov-2008 Dan Gohman <gohman@apple.com> Remove some debugging code made redundant by the change to do
coalescing as a separate pass rather than inside of
LiveIntervalAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d0e32c5d5c1bb03bc0cc8aeef52728724cab1c51 29-Oct-2008 Evan Cheng <evan.cheng@apple.com> - Rewrite code that update register live interval that's split.
- Create and update spill slot live intervals.
- Lots of bug fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
26b86a0b5676253040dc206b437536a24306fb76 27-Oct-2008 David Greene <greened@obbligato.org> Fix PR2634. Create new virtual registers from spills early so that we
can give it the same stack slot as the spilled interval if it is folded.
This prevents the fold/unfold code from pointing to the wrong register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58255 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
06587497dc1c39516f24784a2ac1d9323faae0a5 24-Oct-2008 Evan Cheng <evan.cheng@apple.com> Avoid splitting an interval multiple times; avoid splitting re-materializable val# (for now).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4ed4329c37f5a64c16ad4dc1960cbcb66b7118d4 18-Oct-2008 Evan Cheng <evan.cheng@apple.com> By min, I mean max.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
99fe34b9b2bb8786da6c7f6134ae17d4c2cd8bf7 18-Oct-2008 Evan Cheng <evan.cheng@apple.com> When creating intervals, leave min(1, numdefs) holes after each instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
95dad830bbf975cb4cea4e1ac685781a18676a7a 07-Oct-2008 Owen Anderson <resistor@mac.com> Add an option to enable StrongPHIElimination, for ease of testing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d735b8019b0f297d7c14b55adcd887af24d8e602 03-Oct-2008 Dan Gohman <gohman@apple.com> Switch the MachineOperand accessors back to the short names like
isReg, etc., from isRegister, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
309c6162c62ba35ded8650a0ea4d2036de7480fd 01-Oct-2008 Owen Anderson <resistor@mac.com> Fix a simple error in renumbering kill markaers, that took an inordinant amount of time to track down.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dc37786595beedd0a68d8e2cbd91ae53ad58d133 30-Sep-2008 Evan Cheng <evan.cheng@apple.com> Re-apply 56835 along with header file changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56848 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
46292be362c1b0bb0aecf737cd4dbb81fdd38586 30-Sep-2008 Duncan Sands <baldrick@free.fr> Revert commit 56835 since it breaks the build.
"If a re-materializable instruction has a register
operand, the spiller will change the register operand's
spill weight to HUGE_VAL to avoid it being spilled.
However, if the operand is already in the queue ready
to be spilled, avoid re-materializing it".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d41474d2c09a9fd0d1251554b920a783839b2787 30-Sep-2008 Evan Cheng <evan.cheng@apple.com> If a re-materializable instruction has a register operand, the spiller will change the register operand's spill weight to HUGE_VAL to avoid it being spilled. However, if the operand is already in the queue ready to be spilled, avoid re-materializing it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
86b49f8e2de796cb46c7c8b6a4c4900533fd53f4 24-Sep-2008 Dale Johannesen <dalej@apple.com> Next round of earlyclobber handling. Approach the
RA problem by expanding the live interval of an
earlyclobber def back one slot. Remove
overlap-earlyclobber throughout. Remove
earlyclobber bits and their handling from
live internals.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
134eb73fc35e6ead3cfd3ed5024d0d7efa507441 21-Sep-2008 Owen Anderson <resistor@mac.com> Fetch the starting index of the block when assigning intervals. This gets live-in indices
correct in the presence of things like EH labels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fa48f941304f29f967e0a7fc6807d7026ba99b7b 19-Sep-2008 Dale Johannesen <dalej@apple.com> Remove AsmThatEarlyClobber etc. from LiveIntervalAnalysis
and redo as linked list walk. Logic moved into RA.
Per review feedback.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
91aac1015e6714d959801dd8d60f55a72827dc4d 17-Sep-2008 Dale Johannesen <dalej@apple.com> Add a bit to mark operands of asm's that conflict
with an earlyclobber operand elsewhere. Propagate
this bit and the earlyclobber bit through SDISel.
Change linear-scan RA not to allocate regs in a way
that conflicts with an earlyclobber. See also comments.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
99500aeb7c9a05db57e228544a3f81de2faf24ef 16-Sep-2008 Owen Anderson <resistor@mac.com> Live intervals for live-in registers should begin at the beginning of a basic block, not at the first
instruction. Also, their valno's should have an unknown def. This has no effect currently, but was
causing issues when StrongPHIElimination was enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
014278e6a11fa0767853b831e5bf51b95bf541c5 13-Sep-2008 Dan Gohman <gohman@apple.com> Remove isImm(), isReg(), and friends, in favor of
isImmediate(), isRegister(), and friends, to avoid confusion
about having two different names with the same meaning. I'm
not attached to the longer names, and would be ok with
changing to the shorter names if others prefer it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a41e47afc19d2beb741edae16e3918aadade325d 20-Aug-2008 Owen Anderson <resistor@mac.com> Allow the fast-path spilling code to attempt folding, but still leaving out remat and splitting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
712c9f069048e18c1b3782046487f5e1f74b2483 19-Aug-2008 Owen Anderson <resistor@mac.com> The fast-path still needs to set kill markers and spill/restore points as appropriate.
With this patch, all of MultiSource/Applications and all of SPEC2000/2006 pass with
the SimpleSpiller and this fast-path enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ae339babb2a2445e7bb009912a39994718f10d54 19-Aug-2008 Owen Anderson <resistor@mac.com> Add a flag to enable the fast spilling path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1719731d3d8ab6a986d67912f35daaad4f6910db 19-Aug-2008 Owen Anderson <resistor@mac.com> Fix a few more bugs:
1) Assign stack slots to new temporaries.
2) Don't insert an interval into the return vector more than once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9a032931453209505f6765a35be108ae5ea39b3b 18-Aug-2008 Owen Anderson <resistor@mac.com> Fix several bugs in the new fast-path:
1) Remove an incorrect assertion.
2) Set the stack slot weight properly.
3) Resize the VirtRegMap when needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
133f10f9bddc857d86fab89cfe5573f2515ae7cf 18-Aug-2008 Owen Anderson <resistor@mac.com> Clients of addIntervalForSpills expect the added intervals to be returned sorted by starting index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8dc2cbe793ff577f69c17426d6dfaef94ad69191 18-Aug-2008 Owen Anderson <resistor@mac.com> Simplify the fast-patch interval spilling by using MachineRegisterInfo::reg_iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d6664311acbd05a8a710ccea8f9f5fdbfa35f834 18-Aug-2008 Owen Anderson <resistor@mac.com> Resurrect some ancient code to add spill ranges without attempting folding, remat, or splitting. This code has been updated to current APIs
in so far as it compiles and, in theory, works, but does not take advantage of recent advancements. For instance, it could be improved by using
MachineRegisterInfo::use_iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
289983123ba4170c8a27e9638935818f8142bc89 14-Aug-2008 Owen Anderson <resistor@mac.com> Expunge the last uses of std::map from LiveIntervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
20e2839cb975a2d4ee931e1ea4c4660a36ef0177 14-Aug-2008 Owen Anderson <resistor@mac.com> Move r2iMap_ over to DenseMap from std::map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54765 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
03857b29d8271a23943254579e6cf7b7df4b1bd3 13-Aug-2008 Owen Anderson <resistor@mac.com> Make the allocation of LiveIntervals explicit, rather than holding them in the r2iMap_ by value. This will prevent references to them from being invalidated
if the map is changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
aa111080dfb161054255c9c367779f1ea2581849 06-Aug-2008 Owen Anderson <resistor@mac.com> Oops, didn't mean to commit this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54425 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
788d04152a132121dfc04e63382c1e87e7b9607f 06-Aug-2008 Owen Anderson <resistor@mac.com> Only remap each VNInfo once when doing renumbering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
912923925f790427a77781b8a0469fa832c7740d 30-Jul-2008 Owen Anderson <resistor@mac.com> Value numbers whose def index is a special sentinel value should not be remapped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9382b9310f008a3347e565d76aadda6a97351de9 30-Jul-2008 Owen Anderson <resistor@mac.com> More fixes for corner cases when remapping live range indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a0c032f9b2eeae3a436850eaca54de4c6a5f23b6 29-Jul-2008 Owen Anderson <resistor@mac.com> Don't decrement the BB remap when we don't need to.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fed90b6d097d50881afb45e4d79f430db66dd741 28-Jul-2008 Dan Gohman <gohman@apple.com> Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0471a79f2000eb1eb4458e7b3dcd254172fae739 28-Jul-2008 Dan Gohman <gohman@apple.com> Fix a typo in a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0a7615af25542d5e7d824b520f94094cdc8a2179 26-Jul-2008 Owen Anderson <resistor@mac.com> Revert my previous patch. In retrospect, this is completely the wrong way to fix this problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54072 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0c525ca72f9cbebf92fc7eabc0f0d9d95cf59c2d 26-Jul-2008 Owen Anderson <resistor@mac.com> Special cases are needed in renumbering when dealing with renumbering after a PHI has been removed. The interval previously defined
by the PHI needs to be extended to the beginning of its basic block, and the intervals that were inputs need to be trimmed to the end
of their basic blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54070 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8d0cc0af5a4b4c08eb74b6e36761651b63816d06 25-Jul-2008 Owen Anderson <resistor@mac.com> Properly remap live ranges whose end indices are the end of the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d7dcbecdbcf5d7a1efc5ed65ddcc26bb8c20c1e6 25-Jul-2008 Owen Anderson <resistor@mac.com> Make the remapping of interval indices (particularly ending indices) more robust.
This is tricky business, and will probably take a few more iterations to get
the last kinks out of it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4c8f87038ddc0fbcce751f0e2e7c0e564abca096 25-Jul-2008 Dan Gohman <gohman@apple.com> Disable the new aggressive remat logic introduced in 54000; it causes some
regressions, such as PR2595. Also, there is a significant code-quality
issue in SPEC 464.h264ref and a few others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6d69ba8a6901c69d78488cbc41f8dbf080618fde 25-Jul-2008 Dan Gohman <gohman@apple.com> Enable rematerialization of constants using AliasAnalysis::pointsToConstantMemory,
and knowledge of PseudoSourceValues. This unfortunately isn't sufficient to allow
constants to be rematerialized in PIC mode -- the extra indirection is a
complication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7fbad27cfb7298c707e50af10609d463900d7211 23-Jul-2008 Owen Anderson <resistor@mac.com> Enable the insertion of empty indices into LiveInterals, thereby making renumbering possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53961 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
496bac5b084474ac33109bad24c1ef94c843e16f 23-Jul-2008 Owen Anderson <resistor@mac.com> Fix a compile-time regression introduced by my heuristic-changing patch. I forgot
to multiply the instruction count by a constant factor in a few places, which
caused the register allocator to require many more iterations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a1566f2e12ce87a5bca30bc0189a0cdbb40136a4 23-Jul-2008 Owen Anderson <resistor@mac.com> Change the heuristics used in the coalescer, register allocator, and within
live intervals itself to use an instruction count approximation that is
not affected by inserting empty indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1ed9922794cda9dbe295e74674b909287e544632 19-Jul-2008 Evan Cheng <evan.cheng@apple.com> Fix a memory leak in LiveIntervalAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2c3f7ae3843bdc9dcfe85393e178211976c1f9bd 18-Jul-2008 Dan Gohman <gohman@apple.com> Re-introduce LeakDetector support for MachineInstrs and MachineBasicBlocks.
Fix a leak that this turned up in LowerSubregs.cpp.
And, comment a leak in LiveIntervalAnalysis.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b9890ae3c35ad7d8e49261650d5b98f49f97a705 12-Jul-2008 Evan Cheng <evan.cheng@apple.com> Typos.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
79a796c2b17c7ebd4dd489b5de1078fc2148adba 12-Jul-2008 Evan Cheng <evan.cheng@apple.com> Fix PR2536: a nasty spiller bug. If a two-address instruction uses a register but the use portion of its live range is not part of its liveinterval, it must be defined by an implicit_def. In that case, do not spill the use. e.g.
8 %reg1024<def> = IMPLICIT_DEF
12 %reg1024<def> = INSERT_SUBREG %reg1024<kill>, %reg1025, 2

The live range [12, 14) are not part of the r1024 live interval since it's defined by an implicit def. It will not conflicts with live interval of r1025. Now suppose both registers are spilled, you can easily see a situation where both registers are reloaded before the INSERT_SUBREG and both target registers that would overlap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ef0732d25a9882c947984ae3f2afbef5463ba00f 10-Jul-2008 Evan Cheng <evan.cheng@apple.com> - Change the horrible N^2 isRegReDefinedByTwoAddr. Now callers must supply the operand index of def machineoperand and at most one full scan of non-implicit operands is needed.
- Change local register allocator to use the new isRegReDefinedByTwoAddr instead of reinventing the wheel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8e5f2c6f65841542e2a7092553fe42a00048e4c7 08-Jul-2008 Dan Gohman <gohman@apple.com> Pool-allocation for MachineInstrs, MachineBasicBlocks, and
MachineMemOperands. The pools are owned by MachineFunctions.

This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9f1c8317a4676945b4961ddb9827ef2412551620 03-Jul-2008 Evan Cheng <evan.cheng@apple.com> - Remove calls to copyKillDeadInfo which is an N^2 function. Instead, propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc.
- Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6b098dee286cc6fe5a5a476464d92dec5602e406 26-Jun-2008 Owen Anderson <resistor@mac.com> Remember which MachineOperand we were processing, so we don't have to scan the list to find it again later.
This speeds up live intervals from 0.37s to 0.30s on instcombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c3417609ae6e744a29be6962d4fb7811c0102d17 21-Jun-2008 Evan Cheng <evan.cheng@apple.com> Undo spill weight tweak. Need to investigate the performance regressions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52572 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
29b039976fd682716c6b8ed1cb7084226b2ad84b 19-Jun-2008 Owen Anderson <resistor@mac.com> Revert my last patch, which was causing regression test failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bdf34bc12bfc39de02c19fa250e83edb5924a6cf 19-Jun-2008 Evan Cheng <evan.cheng@apple.com> Minor spiller tweak to unfavor reload into load/store instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6c5e5616687e99329ffa790d2b40ab0f9c2e09f7 19-Jun-2008 Owen Anderson <resistor@mac.com> Insert empty slots into the instruction numbering in live intervals, so that we can more easily
add new instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f26e8557deccd5fb28b56548ca5f7ea25aee31c6 17-Jun-2008 Evan Cheng <evan.cheng@apple.com> Live-through live interval is [mbb start, mbb end+1].


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
31ec841be1f51a60f5b655aa2a008eb68e48c07a 16-Jun-2008 Owen Anderson <resistor@mac.com> Remove special case handling of empty MBBs now that we assign indices to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1fbb4545d41e65191ae66a7302276fa5424518c5 16-Jun-2008 Owen Anderson <resistor@mac.com> Re-enable empty block indexing by default, since it doesn't seem to have any
impact on code quality or compile time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52329 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
355780128986e375c7ac2a75025ac129bb8280bf 16-Jun-2008 Owen Anderson <resistor@mac.com> Make indexing empty basic blocks an option for the moment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8892b6f30792bbc56f40d01a4ae9834a55cf8b1a 16-Jun-2008 Owen Anderson <resistor@mac.com> Assign indices to empty basic blocks. This will be necessary for StrongPHIElimination in the near future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9c3c2213647e3f1b71722d61875ebac01b65cb91 06-Jun-2008 Evan Cheng <evan.cheng@apple.com> Refine stack slot interval weight computation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c4dc132c8a787fc41b6a162121251234aa618965 05-Jun-2008 Owen Anderson <resistor@mac.com> Add a helper for constructing new live ranges that ended from an instruction to the end of its MBB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3f32d65912b4da23793dab618d981be2ce11c331 04-Jun-2008 Evan Cheng <evan.cheng@apple.com> Add a stack slot coloring pass. Not yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51934 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e3abb0a858ceaea4a4ffa7c1874be8426d2724bc 02-Jun-2008 Owen Anderson <resistor@mac.com> Correctly handle removed instructions at the beginning of MBBs when renumbering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7eec0c243320fb2629554681547d7384ea9d0c53 30-May-2008 Owen Anderson <resistor@mac.com> Make the renumbering correct in the face of deleted instructions that have been removed from the LiveIntervals maps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51714 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ec58498dc911065c122a2a54fa9d1338f7fb187f 29-May-2008 Bill Wendling <isanbard@gmail.com> Remove <iostream>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fcc6350ac9b99d6590f5256d26bfa489b4531fb3 29-May-2008 Owen Anderson <resistor@mac.com> Revert part of my last patch that I didn't intend to commit yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51694 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4b5b209679f866d3ac6372f963aa7e9906f9a08b 29-May-2008 Owen Anderson <resistor@mac.com> Renumbering needs to account for instruction slot offsets when performing lookups in the index maps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51691 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
745825f431920662e97bdab5c1bcfac62e48c52f 29-May-2008 Owen Anderson <resistor@mac.com> Remap VNInfo data as well when doing renumbering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
80b3ce65e294a28b88c882d44a5e749a2924c9e3 28-May-2008 Owen Anderson <resistor@mac.com> Factor the numbering computation into a separate method, and add the slightest attempt at some renumbering logic, which is currently unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0a891ed7d5875a9ccdb93b4472b0f43947d8289b 24-May-2008 Evan Cheng <evan.cheng@apple.com> Revert 51440 as it breaks a bunch of PIC tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
abe93d95e8cc721a5b24b8225dc1a92569276c8a 22-May-2008 David Greene <greened@obbligato.org> When rewriting defs and uses after spilling, don't set the weight of a
live interval to infinity if the instruction being rewritten is an
original remat def instruction. We were only checking against the clone
of the remat def which doesn't actually appear in the IR at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b0a6f62c9b2e75fc509d84310a9795ffacbc6796 20-May-2008 Evan Cheng <evan.cheng@apple.com> Don't spill dead def.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51305 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
844731a7f1909f55935e3514c9e713a62d67662e 13-May-2008 Dan Gohman <gohman@apple.com> Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4a3f6c88820a204f80ca0fa3f1f2fe09ca10b02f 06-May-2008 Dan Gohman <gohman@apple.com> Make several variable declarations static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
76249966eec8d318534b416f33f878c6bd01d1ee 16-Apr-2008 Evan Cheng <evan.cheng@apple.com> Empty basic block should have an empty range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4cce6b4c7882ef0cc993d931b90bf33985c96110 11-Apr-2008 Evan Cheng <evan.cheng@apple.com> Use of implicit_def is not part of live interval. Create empty intervals for the uses when the live interval is being spilled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7e073baedb8232b9519dbe15ea141ff98ccfe6ae 09-Apr-2008 Evan Cheng <evan.cheng@apple.com> - More aggressively coalescing away copies whose source is defined by an implicit_def.
- Added insert_subreg coalescing support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49448 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
419852ca8a01aecde4c0e20af6b7bd6450e70f87 03-Apr-2008 Evan Cheng <evan.cheng@apple.com> - Treat a live range defined by an implicit_def as a zero-sized one.
- Eliminate an implicit_def when it's being spilled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3c75ba858b4e2070993cc1241ba74ead17f647d6 01-Apr-2008 Evan Cheng <evan.cheng@apple.com> Re-materialization is for uses only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
427f4c106ac14dcf323dc1bbaf1b8040da03c3c7 01-Apr-2008 Evan Cheng <evan.cheng@apple.com> It's not safe to fold a load from GV stub or constantpool into a two-address use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
24d2f8a212f08bf21360122cc00acf2657af91f9 31-Mar-2008 Evan Cheng <evan.cheng@apple.com> The support for remat of instructions with a register operand is hackish, to say the least. Since the register operand guaranteed to be PIC base and that it is already live at all uses, we are making sure it will not be spilled after its uses are rematerialized for both performance and correctness reasons.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
20ccded7dec5b90e58f649f4fb95b166a642b8cb 15-Mar-2008 Evan Cheng <evan.cheng@apple.com> Remove isImplicitDef TargetInstrDesc flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c1f53c742620dd4f2460685477303002bba8a8d8 11-Mar-2008 Evan Cheng <evan.cheng@apple.com> Transfer physical register spill info when load / store folding happens.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
676dd7c80b6f91178452535ac45ca58feb23cc42 11-Mar-2008 Evan Cheng <evan.cheng@apple.com> When the register allocator runs out of registers, spill a physical register around the def's and use's of the interval being allocated to make it possible for the interval to target a register and spill it right away and restore a register for uses. This likely generates terrible code but is before than aborting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6130f66eaae89f8878590796977678afa8448926 05-Mar-2008 Evan Cheng <evan.cheng@apple.com> Refactor code. Remove duplicated functions that basically do the same thing as
findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d36531249a9a9500e516148e7e72d4c0a7a4d0ee 27-Feb-2008 Evan Cheng <evan.cheng@apple.com> Spiller now remove unused spill slots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47657 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e6d088acc90e422451e098555d383d4d65b6ce6b 26-Feb-2008 Bill Wendling <isanbard@gmail.com> Rename PrintableName to Name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
74ab84c31ef64538a1b56e1f282e49303412ad17 26-Feb-2008 Bill Wendling <isanbard@gmail.com> Change "Name" to "AsmName" in the target register info. Gee, a refactoring tool
would have been a Godsend here!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e83a27516cf5b6cc92ead99c17bbd77bca7ae06b 25-Feb-2008 Evan Cheng <evan.cheng@apple.com> All remat'ed loads cannot be folded into two-address code. Not just argument loads. This change doesn't really have any impact on codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47557 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
79a0c1e46c4f7d8a2a06f4ef3e2c54d883c7fe25 25-Feb-2008 Evan Cheng <evan.cheng@apple.com> Correctly determine whether a argument load can be folded into its uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47545 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
249ded3fa8884f91fded869fb6e251b8aebb0376 23-Feb-2008 Evan Cheng <evan.cheng@apple.com> Rematerialization logic was overly conservative when it comes to loads from fixed stack slots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
298bbe82cb390235f7b8ab4bd550feff909e0c3d 23-Feb-2008 Evan Cheng <evan.cheng@apple.com> If remating a machine instr with virtual register operand, make sure the vr is avaliable at all uses regardless of whether it would be folded.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47526 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dd3465eed17cdf226bdb465e604dfa851d36029d 23-Feb-2008 Evan Cheng <evan.cheng@apple.com> Recognize loads of arguments as re-materializable first. Therefore if isReallyTriviallyReMaterializable() returns true it doesn't confuse it as a "normal" re-materializable instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
313d4b809326f3e04814f94e5b8ae05649d8e0f6 23-Feb-2008 Evan Cheng <evan.cheng@apple.com> Fix spill weight updating bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d70dbb5d627a0408eccf88033143efa62ee0e6c0 22-Feb-2008 Evan Cheng <evan.cheng@apple.com> Enable re-materialization of instructions which have virtual register operands if
the definition of the operand also reaches its uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
063284c001666c0a3906acbe0a26dc7cae5f081c 21-Feb-2008 Evan Cheng <evan.cheng@apple.com> Clean up some spilling code using MachineRegisterInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8dd25288f9c79596e531b32c1b0bdfadcee7ffb9 18-Feb-2008 Roman Levenstein <romix.llvm@googlemail.com> New helper function getMBBFromIndex() that given an index in any instruction of an MBB returns a pointer the MBB. Reviewed by Evan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c8d044e4f779fdcfc5e7d592927740fd8f672a70 15-Feb-2008 Evan Cheng <evan.cheng@apple.com> - Removing the infamous r2rMap_ and rep() method. Now the coalescer will update
register defs and uses after each successful coalescing.
- Also removed a number of hacks and fixed some subtle kill information bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e984e504b5f3090ab270cbdab02638ac3a2afb21 13-Feb-2008 Evan Cheng <evan.cheng@apple.com> Fix a potential serious problem where kills belonging to the val# defined by a two-address instruction is also on the val# that defines the input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6f0d024a534af18d9e60b3ea757376cd8a3a980e 10-Feb-2008 Dan Gohman <gohman@apple.com> Rename MRegisterInfo to TargetRegisterInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46930 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f2f8c2ae07b7d9bdbf1b89781c573c7af2bd5e1b 08-Feb-2008 Evan Cheng <evan.cheng@apple.com> Forgot these files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b487e7215c4f70f3d98f8fbc0a11eb119afc1f37 24-Jan-2008 Owen Anderson <resistor@mac.com> Move some functionality for adding flags to MachineInstr's into methods on MachineInstr rather than LiveVariables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8480293f41c11c22762164449e41cd3adb0dd7d8 10-Jan-2008 Evan Cheng <evan.cheng@apple.com> Only remat loads from immutable stack slots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a07cec9e24a286157541d2337cd66b24cd116586 10-Jan-2008 Evan Cheng <evan.cheng@apple.com> Simplify some code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c95f075c43488234e44b1213dfd762ae0a7509ea 10-Jan-2008 Owen Anderson <resistor@mac.com> Don't use LiveVariables::VarInfo::DefInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
749c6f6b5ed301c84aac562e414486549d7b98eb 07-Jan-2008 Chris Lattner <sabre@nondot.org> rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f86e1df8770faa76bb277d7c3c27a407869c6f0c 07-Jan-2008 Chris Lattner <sabre@nondot.org> simplify some code using new predicates



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
69244300b8a0112efb44b6273ecea4ca6264b8cf 07-Jan-2008 Chris Lattner <sabre@nondot.org> Rename MachineInstr::getInstrDescriptor -> getDesc(), which reflects
that it is cheap and efficient to get.

Move a variety of predicates from TargetInstrInfo into
TargetInstrDescriptor, which makes it much easier to query a predicate
when you don't have TII around. Now you can use MI->getDesc()->isBranch()
instead of going through TII, and this is much more efficient anyway. Not
all of the predicates have been moved over yet.

Update old code that used MI->getInstrDescriptor()->Flags to use the
new predicates in many places.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6425f8be7263e625c2d7484eb2fb8f6643824f49 07-Jan-2008 Owen Anderson <resistor@mac.com> Update CodeGen for MRegisterInfo --> TargetInstrInfo changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
834f1ce0312e3d00d836f9560cb63182c2c4570f 07-Jan-2008 Chris Lattner <sabre@nondot.org> rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
67d65bb69d5cad957cbb6d672dc0b4a19c211a42 04-Jan-2008 Bill Wendling <isanbard@gmail.com> Don't recalculate the loop info and loop dominators analyses if they're
preserved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
84bc5427d6883f73cfeae3da640acd011d35c006 31-Dec-2007 Chris Lattner <sabre@nondot.org> Rename SSARegMap -> MachineRegisterInfo in keeping with the idea
that "machine" classes are used to represent the current state of
the code being compiled. Given this expanded name, we can start
moving other stuff into it. For now, move the UsedPhysRegs and
LiveIn/LoveOuts vectors from MachineFunction into it.

Update all the clients to match.

This also reduces some needless #includes, such as MachineModuleInfo
from MachineFunction.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f73823000e2d5d6e1cf65bdf5a107297e18d35fb 30-Dec-2007 Chris Lattner <sabre@nondot.org> More cleanups for MachineOperand:
- Eliminate the static "print" method for operands, moving it
into MachineOperand::print.
- Change various set* methods for register flags to take a bool
for the value to set it to. Remove unset* methods.
- Group methods more logically by operand flavor in MachineOperand.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4ee451de366474b9c228b4e5fa573795a715216d 29-Dec-2007 Chris Lattner <sabre@nondot.org> Remove attribution from file headers, per discussion on llvmdev.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6e141fd04897e5eb4925bb6351297170ebd8a756 13-Dec-2007 Evan Cheng <evan.cheng@apple.com> Implicit def instructions, e.g. X86::IMPLICIT_DEF_GR32, are always re-materializable and they should not be spilled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
22f07ffd27d1d721634d502c37267721d2e025cf 11-Dec-2007 Evan Cheng <evan.cheng@apple.com> Switch over to MachineLoopInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44838 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
041b3f835682588cb63df7e609d726369dd6b7d3 09-Dec-2007 Bill Wendling <isanbard@gmail.com> Reverting 44702. It wasn't correct to rename them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
320c630c1b55e17fa00249d499f974cb1a4238f8 08-Dec-2007 Bill Wendling <isanbard@gmail.com> Renaming:

isTriviallyReMaterializable -> hasNoSideEffects
isReallyTriviallyReMaterializable -> isTriviallyReMaterializable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
33faddc35d5da8451f03edf27f90b901ba529c58 06-Dec-2007 Evan Cheng <evan.cheng@apple.com> Turning simple splitting on. Start testing new coalescer heuristics as new llcbeta.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5ef3a04b542c4e585276768fa9ca2af698ef5c87 06-Dec-2007 Evan Cheng <evan.cheng@apple.com> Fix for PR1831: if all defs of an interval are re-materializable, then it's a preferred spill candiate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d120ffd26f2715c600b028d4eac9a3c41a9f4653 05-Dec-2007 Evan Cheng <evan.cheng@apple.com> MachineInstr can change. Store indexes instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
adf85906906ebf85c57c333e8209f37ef11a6c99 05-Dec-2007 Evan Cheng <evan.cheng@apple.com> If a split live interval is spilled again, remove the kill marker on its last use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f38d14f03e495ea98ae16bda6febbde276513294 05-Dec-2007 Evan Cheng <evan.cheng@apple.com> Clobber more bugs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44610 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b50bb8cf197709b3f49044740044c06d8f314564 05-Dec-2007 Evan Cheng <evan.cheng@apple.com> Fix kill info for split intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
018f9b020bb12b731b0a7081578e5f82fb35092d 05-Dec-2007 Evan Cheng <evan.cheng@apple.com> - Mark last use of a split interval as kill instead of letting spiller track it.
This allows an important optimization to be re-enabled.
- If all uses / defs of a split interval can be folded, give the interval a
low spill weight so it would not be picked in case spilling is needed (avoid
pushing other intervals in the same BB to be spilled).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44601 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
597d10d84fb6b34f7776121404d5ed802b21b2b6 04-Dec-2007 Evan Cheng <evan.cheng@apple.com> Discard split intervals made empty due to folding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
31d43183a40fb721cfe0bb903f147d0d5235c1b9 03-Dec-2007 Evan Cheng <evan.cheng@apple.com> Typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
70306f8348f27c61cfed5a60e2fceac0f29746a2 03-Dec-2007 Evan Cheng <evan.cheng@apple.com> Update kill info for uses of split intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44531 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
aee4af68ae2016afc5b4ec0c430e539c5810a766 02-Dec-2007 Evan Cheng <evan.cheng@apple.com> Remove redundant foldMemoryOperand variants and other code clean up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e3110d0825e6316fd2dd21d6a4e593295cd413f1 01-Dec-2007 Evan Cheng <evan.cheng@apple.com> Fix a bug where splitting cause some unnecessary spilling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e62f97c094dba44e4c259d20135167fa91912eea 01-Dec-2007 Evan Cheng <evan.cheng@apple.com> Allow some reloads to be folded in multi-use cases. Specifically testl r, r -> cmpl [mem], 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cddbb83ea82e98658d9f530c50a7b9d23249afc2 30-Nov-2007 Evan Cheng <evan.cheng@apple.com> Do not fold reload into an instruction with multiple uses. It issues one extra load.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cb3c330d39442130d0587208d673ce9c33c7008f 30-Nov-2007 Evan Cheng <evan.cheng@apple.com> Do not lose rematerialization info when spilling already split live intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1953d0cb7d6d27da3ad067468a7ad6dd7c4fa46e 29-Nov-2007 Evan Cheng <evan.cheng@apple.com> Fix a major performance issue with splitting. If there is a def (not def/use)
in the middle of a split basic block, create a new live interval starting at
the def. This avoid artifically extending the live interval over a number of
cycles where it is dead. e.g.

bb1:
= vr1204 (use / kill) <= new interval starts and ends here.
...
...
vr1204 = (new def) <= start a new interval here.
= vr1204 (use)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c3fc7d9ec9b495c8a88cd854247105c296d3aabd 29-Nov-2007 Evan Cheng <evan.cheng@apple.com> Replace the odd kill# hack with something less fragile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0cbb1164b3227f25f5e5d3681800a8e50e6b9865 29-Nov-2007 Evan Cheng <evan.cheng@apple.com> Fixed various live interval splitting bugs / compile time issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cada245d06959831b90f8c29f92e77beda4b71cb 28-Nov-2007 Evan Cheng <evan.cheng@apple.com> Recover compile time regression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
81a038218171860ee4c382849c647d3dc841fe8b 17-Nov-2007 Evan Cheng <evan.cheng@apple.com> Live interval splitting:

When a live interval is being spilled, rather than creating short, non-spillable
intervals for every def / use, split the interval at BB boundaries. That is, for
every BB where the live interval is defined or used, create a new interval that
covers all the defs and uses in the BB.

This is designed to eliminate one common problem: multiple reloads of the same
value in a single basic block. Note, it does *not* decrease the number of spills
since no copies are inserted so the split intervals are *connected* through
spill and reloads (or rematerialization). The newly created intervals can be
spilled again, in that case, since it does not span multiple basic blocks, it's
spilled in the usual manner. However, it can reuse the same stack slot as the
previously split interval.

This is currently controlled by -split-intervals-at-bb.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5d446265c740c17ed12e693423f0363296670d60 15-Nov-2007 Evan Cheng <evan.cheng@apple.com> Fix a thinko in post-allocation coalescer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c498b0281fa81bc213ad1a1228664d480936c0e6 14-Nov-2007 Evan Cheng <evan.cheng@apple.com> Clean up sub-register implementation by moving subReg information back to
MachineOperand auxInfo. Previous clunky implementation uses an external map
to track sub-register uses. That works because register allocator uses
a new virtual register for each spilled use. With interval splitting (coming
soon), we may have multiple uses of the same register some of which are
of using different sub-registers from others. It's too fragile to constantly
update the information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f2fbca68f868122d6df0bfc9952b4e4c3dfb60b7 12-Nov-2007 Evan Cheng <evan.cheng@apple.com> Refactor some code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
29121848b912b1e062760e5d14c6fbec63b16d9b 07-Nov-2007 Evan Cheng <evan.cheng@apple.com> Simplify my (il)logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
be6781b5d00107f4b60797c3ebdc0aab110487ff 06-Nov-2007 Evan Cheng <evan.cheng@apple.com> When the allocator rewrite a spill register with new virtual register, it replaces other operands of the same register. Watch out for situations where
only some of the operands are sub-register uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ab847242976b8e7c495308f8b771ae5d0db8b340 06-Nov-2007 Evan Cheng <evan.cheng@apple.com> Fix a bug where a def use operand isn't being detected as a sub-register use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5f5f3b6333ed5ecaf40699e8cd0b1aba524cbf0f 05-Nov-2007 Evan Cheng <evan.cheng@apple.com> Fix PR1187.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c92da3882ee4e18153bb36fcdf33af393aba8259 03-Nov-2007 Evan Cheng <evan.cheng@apple.com> There are times when the coalescer would not coalesce away a copy but the copy
can be eliminated by the allocator is the destination and source targets the
same register. The most common case is when the source and destination registers
are in different class. For example, on x86 mov32to32_ targets GR32_ which
contains a subset of the registers in GR32.

The allocator can do 2 things:
1. Set the preferred allocation for the destination of a copy to that of its source.
2. After allocation is done, change the allocation of a copy destination (if
legal) so the copy can be eliminated.

This eliminates 443 extra moves from 403.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a5bfc97da713ec9e185226d44e6adb4d3087b304 17-Oct-2007 Evan Cheng <evan.cheng@apple.com> Apply Chris' suggestions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4ca980e7f9ce7b78955307c2d07001a24d3b6bef 17-Oct-2007 Evan Cheng <evan.cheng@apple.com> Clean up code that calculate MBB live-in's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
48ff282dd49197d2b42285b769126ba7991aa93a 12-Oct-2007 Evan Cheng <evan.cheng@apple.com> Did mean to leave this in. INSERT_SUBREG isn't being coalesced yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
32dfbeada7292167bb488f36a71a5a6a519ddaff 12-Oct-2007 Evan Cheng <evan.cheng@apple.com> EXTRACT_SUBREG coalescing support. The coalescer now treats EXTRACT_SUBREG like
(almost) a register copy. However, it always coalesced to the register of the
RHS (the super-register). All uses of the result of a EXTRACT_SUBREG are sub-
register uses which adds subtle complications to load folding, spiller rewrite,
etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42899 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
537d5c27ff64b021ba14e2dc9589bf321dd2327a 08-Oct-2007 Evan Cheng <evan.cheng@apple.com> Kill cycle of an live range is always the last use index + 1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42742 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cb406c25973b4e88a6c10ad839ef1beeb3664715 03-Oct-2007 Dan Gohman <gohman@apple.com> Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
92dfe2001e96f6e2b6d327e8816f38033f88b295 14-Sep-2007 Dan Gohman <gohman@apple.com> Remove isReg, isImm, and isMBB, and change all their users to use
isRegister, isImmediate, and isMachineBasicBlock, which are equivalent,
and more popular.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41958 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dd199d29b781bc713462f1255b63d3f153bfd9e9 06-Sep-2007 Evan Cheng <evan.cheng@apple.com> Fix a memory leak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f3bb2e65d12857f83b273f4ecab013680310bbbc 05-Sep-2007 Evan Cheng <evan.cheng@apple.com> Use pool allocator for all the VNInfo's to improve memory access locality. This reduces coalescing time on siod Mac OS X PPC by 35%. Also remove the back ptr from VNInfo to LiveInterval and other tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41729 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
34c2a9f57ccf57f341ad27cef59e4c5eb2253e1d 30-Aug-2007 Evan Cheng <evan.cheng@apple.com> Try fold re-materialized load instructions into its uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7ecb38be0a533e7b9c7d3b8e9b5c8a6fa5f6b349 29-Aug-2007 Evan Cheng <evan.cheng@apple.com> Change LiveRange so it keeps a pointer to the VNInfo rather than an index.
Changes related modules so VNInfo's are not copied. This decrease
copy coalescing time by 45% and overall compilation time by 10% on siod.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bc165e436beb02443abea9736c1b77e2dd7828b6 16-Aug-2007 Evan Cheng <evan.cheng@apple.com> Fix some kill info update bugs; add hidden option -disable-rematerialization to turn off remat for debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
549f27d3070195d6647b796841a5291b4549e8e0 14-Aug-2007 Evan Cheng <evan.cheng@apple.com> Re-implement trivial rematerialization. This allows def MIs whose live intervals that are coalesced to be rematerialized.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4f8ff168de12eabdeb4b9437bf9402489ecf85cb 11-Aug-2007 Evan Cheng <evan.cheng@apple.com> Code to maintain kill information during register coalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
24c2e5cf7e926452ea5875d027ec0d24d9c19e39 08-Aug-2007 Evan Cheng <evan.cheng@apple.com> Adding kill info to val#.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8df786012dc6b875f31ba4152e09c6e0098082ee 08-Aug-2007 Evan Cheng <evan.cheng@apple.com> - Each val# can have multiple kills.
- Fix some minor bugs related to special markers on val# def. ~0U means
undefined, ~1U means dead val#.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a8d94f1315f722de056af03763664b77a5baac26 08-Aug-2007 Evan Cheng <evan.cheng@apple.com> - LiveInterval value#'s now have 3 components: def instruction #,
kill instruction #, and source register number (iff the value# is defined by a
copy).
- Now def instruction # is set for every value#, not just for copy defined ones.
- Update some outdated code related inactive live ranges.
- Kill info not yet set. That's next patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40913 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
292da949f6c87d6499425d64d37d7c5870ec57ad 27-Jun-2007 Evan Cheng <evan.cheng@apple.com> If a livein is not used in the block. It's live through.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37764 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
75611fb4e6ab253be30ac29a2b15e9bf8c1d146e 27-Jun-2007 Evan Cheng <evan.cheng@apple.com> Fix an obvious bug. Old code only worked for the entry block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37743 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
82a87a01723c095176c6940bcc63d3a7c8007b4b 19-Jun-2007 Dan Gohman <gohman@apple.com> Replace M_REMATERIALIZIBLE and the newly-added isOtherReMaterializableLoad
with a general target hook to identify rematerializable instructions. Some
instructions are only rematerializable with specific operands, such as loads
from constant pools, while others are always rematerializable. This hook
allows both to be identified as being rematerializable with the same
mechanism.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c101e95cb6aae1fd6a0727ba4b518a7894ae3089 14-Jun-2007 Dan Gohman <gohman@apple.com> Add a target hook to allow loads from constant pools to be rematerialized, and an
implementation for x86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2513330de8f8020d15d5bc96640a0957b7c733b9 08-Jun-2007 David Greene <greened@obbligato.org> Factor live variable analysis so it does not do register coalescing
simultaneously. Move that pass to SimpleRegisterCoalescing.

This makes it easier to implement alternative register allocation and
coalescing strategies while maintaining reuse of the existing live
interval analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8dfffd5a079c35e317b843f9f249d2fa36bcd944 14-May-2007 Evan Cheng <evan.cheng@apple.com> Only worry about intervening kill if there are more than one live ranges in the interval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2f6cb2b14c5811b154b06163355b3c8bc8b73231 14-May-2007 Evan Cheng <evan.cheng@apple.com> Fix for PR1406:

v1 =
r2 = move v1
= op r2<kill>
...
r2 = move v1
= op r2<kill>

Clear the first r2 kill if v1 and r2 are joined.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1997473cf72957d0e70322e2fe6fe2ab141c58a6 03-May-2007 Devang Patel <dpatel@apple.com> Drop 'const'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3e15bf33e024b9df9e89351a165acfdb1dde51ed 02-May-2007 Devang Patel <dpatel@apple.com> Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c718288f4939258a51ec5ae0c5be7b1a05eb6898 02-May-2007 Lauro Ramos Venancio <lauro.venancio@gmail.com> Fix build error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
794fd75c67a2cdc128d67342c6d88a504d186896 01-May-2007 Devang Patel <dpatel@apple.com> Do not use typeinfo to identify pass in pass manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
faa510726f4b40aa4495e60e4d341c6467e3fb01 26-Apr-2007 Evan Cheng <evan.cheng@apple.com> Rename findRegisterUseOperand to findRegisterUseOperandIdx to avoid confusion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36483 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
24a3cc4c83e5edb25fadf7b8979a26b4451795c6 25-Apr-2007 Evan Cheng <evan.cheng@apple.com> Fix for PR1306.
- A register def / use now implicitly affects sub-register liveness but does
not affect liveness information of super-registers.
- Def of a larger register (if followed by a use later) is treated as
read/mod/write of a smaller register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f44c72817e3a7f517ad796705effb8d59e6a6dfa 18-Apr-2007 Evan Cheng <evan.cheng@apple.com> VarInfo::UsedBlocks is no longer used. Remove.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
faf05bbaea5893488dac4eee58700912ddfe28cc 18-Apr-2007 Evan Cheng <evan.cheng@apple.com> Don't populate TryAgainList when coalescing only physical registers with virtual registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
20b0abc24fb3fa15098b7cb12c7762fb0770e133 17-Apr-2007 Evan Cheng <evan.cheng@apple.com> Copy coalescing change to prevent a physical register from being pin to a
long live interval that has low usage density.
1. Change order of coalescing to join physical registers with virtual
registers first before virtual register intervals become too long.
2. Check size and usage density to determine if it's worthwhile to join.
3. If joining is aborted, assign virtual register live interval allocation
preference field to the physical register.
4. Register allocator should try to allocate to the preferred register
first (if available) to create identify moves that can be eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9193514e2e3e599e241220b72bc9add25a80a8fd 04-Apr-2007 Evan Cheng <evan.cheng@apple.com> Re-materialize all loads from fixed stack slots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
710216275b93b332bc69f41a1d4553197b64edf8 04-Apr-2007 Evan Cheng <evan.cheng@apple.com> Trivially re-materializable instructions have spill weights that are half of what it would be otherwise.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bcfd4665b5597ed1ba679584a69080396d68bcf9 02-Apr-2007 Evan Cheng <evan.cheng@apple.com> Ugh. Copy coalescer does not update register numbers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35600 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2f524575396b740b8bdae076b5711e602e82f834 30-Mar-2007 Evan Cheng <evan.cheng@apple.com> Bug fix for PR1279. When isDead is propagate by copy coalescing, we keep length
of dead def live interval at 1 to avoid multiple def's targeting the same
register. The previous patch missed a case where the source operand is live-in.
In that case, remove the whole interval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2005a02f321c315c1d6dcbe482024999b48b1c10 28-Mar-2007 Evan Cheng <evan.cheng@apple.com> Move rematerialization out of beta.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d592a28ca1506f2ccd6384679d87cce4b4fd874a 28-Mar-2007 Evan Cheng <evan.cheng@apple.com> Fix for PR1279. Dead def has a live interval of length 1. Copy coalescing should
not violate that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ad7ccf34b5de14bd2b9ddc8072d14582a2ce29d9 27-Mar-2007 Evan Cheng <evan.cheng@apple.com> Fix for PR1266. Don't mark a two address operand IsKill.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2c3535d2a6738d154914a59f272fac45e50b706b 22-Mar-2007 Evan Cheng <evan.cheng@apple.com> Fix for PR1257. Bug in live range shortening as a result of copy coalescing
where the destination is dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2638e1a6b9e3c0e22b398987e1db99bee81db4fb 20-Mar-2007 Evan Cheng <evan.cheng@apple.com> First cut trivial re-materialization support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
757072d954937514585b5c213f01f851d31826a1 19-Mar-2007 Evan Cheng <evan.cheng@apple.com> Remove -reduce-joining-phys-regs options. Make it on by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
79b098445b93e551dba79aeb9584ee24be0d3dae 19-Mar-2007 Evan Cheng <evan.cheng@apple.com> Minor bug fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cf596c54d4089ef23ce00be04bbb674d3ae2e0a6 18-Mar-2007 Evan Cheng <evan.cheng@apple.com> - Merge UsedBlocks info after two virtual registers are coalesced.
- Use distance to closest use to determine whether to abort coalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ba1a3df608a14ca37ca944f4c942c202e919ea80 17-Mar-2007 Evan Cheng <evan.cheng@apple.com> Joining a live interval of a physical register with a virtual one can turn out
to be really bad. Once they are joined they are not broken apart. Also, physical
intervals cannot be spilled!

Added a heuristic as a workaround for this. Be careful coalescing with a
physical register if the virtual register uses are "far". Check if there are
uses in the same loop as the source (copy instruction). Check if it is in the
loop preheader, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
56fdd7af884a35673fb6dd3e01333960922c3ac2 15-Mar-2007 Evan Cheng <evan.cheng@apple.com> Debugging output stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a16d4429e49b5406c0af905953b5eae13b9cf47c 03-Mar-2007 Evan Cheng <evan.cheng@apple.com> Watch out for cases like this:

entry (0x8b056f0, LLVM BB @0x8b01b30, ID#0):
Live Ins: %r0 %r1 %r2 %r3
%reg1032 = tMOVrr %r3<kill>
%reg1033 = tMOVri8 1
%reg1034 = tMOVri8 0
tCMPi8 %reg1029<kill>, 0
tBcc mbb<entry,0x8b06a10>, 0
Successors according to CFG: 0x8b06980 0x8b06a10

entry (0x8b06980, LLVM BB @0x8b01b30, ID#12):
Predecessors according to CFG: 0x8b056f0
%reg1036 = tMOVrr %reg1034<kill>
Successors according to CFG: 0x8b06a10

entry (0x8b06a10, LLVM BB @0x8b01b30, ID#13):
Predecessors according to CFG: 0x8b056f0 0x8b06980
%reg1024<dead> = tMOVrr %reg1030<kill>
...

reg1030 and r1 have already been joined. When reg1024 and reg1030 are joined,
r1 live range from function entry to the tMOVrr instruction are dead. Eliminate
r1 from the livein set of the entry BB, not the BB where the copy is.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7b466d048110ec149446bfb9856f79b7b17cf5d3 02-Mar-2007 Evan Cheng <evan.cheng@apple.com> Dead live-in detection bug.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34843 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8e92b4bae298d079e28f4166d335cc662a50d6cc 01-Mar-2007 Evan Cheng <evan.cheng@apple.com> Oops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
88d1f587d2205b4275dc4c0319a5f2d4d1e6fd42 01-Mar-2007 Evan Cheng <evan.cheng@apple.com> Track all joined registers and eliminate unneeded kills after all joining are done.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34767 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
edeffb37dc41591b3d3943a5c02c04e55d348524 26-Feb-2007 Evan Cheng <evan.cheng@apple.com> Joining an interval with a dead copy instruction. Shorten the live range to the last use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
48ef398ebd2f2b992c81bebd5159de119ce62c80 25-Feb-2007 Evan Cheng <evan.cheng@apple.com> Fix a couple of bugs related IsDead back propagation during coalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34595 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
16191f03337645dc1638b7489d71d685e6c07cdd 25-Feb-2007 Evan Cheng <evan.cheng@apple.com> If the liveinterval of the source instruction has been extended, remove the IsKill marker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
da2295e631ae07788f7db53efa3bea6367e7656c 23-Feb-2007 Evan Cheng <evan.cheng@apple.com> Handle cases when joining live intervals of two virtual registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
30cac02a925c9d56613711b0e77099cb7252bc9b 23-Feb-2007 Evan Cheng <evan.cheng@apple.com> Remove unnecessary isKill properties if a live range has been lengthened due to coalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9b25b8ca24d6df2e097741dcc15016772ee4eda7 21-Feb-2007 Jim Laskey <jlaskey@mac.com> Allow for live in registers for eh landing pads.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
788fb1c103f1d1b8ec7e7f96df01fbfc1a5005d9 21-Feb-2007 Evan Cheng <evan.cheng@apple.com> Out of bound reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b371f457b0ea4a652a9f526ba4375c80ae542252 19-Feb-2007 Evan Cheng <evan.cheng@apple.com> Re-apply my liveintervalanalysis changes. Now with PR1207 fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a284cbf667e11660840dc7bae3ee9eeaa3c7cbd2 19-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR1207:
Revert patches that caused the problem. Evan, please investigate and reapply
when you've discovered the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34399 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
aa7976199c0dfe45f52f327b74fc547ad2c5fffd 17-Feb-2007 Evan Cheng <evan.cheng@apple.com> - Changes how function livein's are handled, they now have a start index of 0.
- When coalescing a copy MI, if its destination is "dead", propagate the
property to the source MI's destination if there are no intervening uses.
- Detect dead function live-in's and remove them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
61de82d8853a02fe39c47302432abb70a586704f 15-Feb-2007 Evan Cheng <evan.cheng@apple.com> Use BitVector instead of vector<bool> which can be extremely slow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0c9f92e1ff64ee56724eae444a0442b02f83d0a8 13-Feb-2007 Evan Cheng <evan.cheng@apple.com> Allow any MachineBasicBlock (not just the entry block) to have live-in physical
registers. Make sure liveinterval analysis is correctly creating live ranges
for them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34217 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cd3245ac45c595da96bb768a55cddc356dff55fe 19-Dec-2006 Chris Lattner <sabre@nondot.org> Eliminate static ctors from Statistics


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e81561909d128c6e2d8033cb5465a49b2596b26a 07-Dec-2006 Bill Wendling <isanbard@gmail.com> Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
51cdcd197268a7abf19b2698fc824e0da3d98049 07-Dec-2006 Evan Cheng <evan.cheng@apple.com> MI keeps a ptr of TargetInstrDescriptor, use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32296 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ac0b6ae358944ae8b2b5a11dc08f52c3ed89f2da 06-Dec-2006 Chris Lattner <sabre@nondot.org> Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
97af751deb9b26fd42fbcee082da9ccc4ded5b45 02-Dec-2006 Jeff Cohen <jeffc@jolt-lang.org> Unbreak VC++ build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ba59a1e453e110f7b84233f07613f9c5d9a39b87 01-Dec-2006 Evan Cheng <evan.cheng@apple.com> Match TargetInstrInfo changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bdc679d564e67a81792e463f6614b0088f975025 29-Nov-2006 Bill Wendling <isanbard@gmail.com> Converted to using llvm streams instead of <iostream>s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
beeb77f3ae9e784f45ede2e38f51b9b25eb65913 16-Nov-2006 Bill Wendling <isanbard@gmail.com> Don't recompute getNumOperands for each iteration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
01352aa1875ee08ae847cce398322042830d92ed 16-Nov-2006 Bill Wendling <isanbard@gmail.com> Added a new method "CreateNewLiveInterval" which, given a list of
LiveRanges, creates a new LiveInterval from them. The LiveRanges should
have existed already in another LiveInterval, but removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31780 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9a1956ae6ad2d4892afbc9f1b97d645d220b6d4a 15-Nov-2006 Evan Cheng <evan.cheng@apple.com> A register def can be partially dead when the whole register has use(s) but a subreg does not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31760 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
438f7bc67cf235ccee7e6f7ac7f4ae2186eb8020 10-Nov-2006 Evan Cheng <evan.cheng@apple.com> Add implicit def / use operands to MachineInstr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d6c3422e3126927840683574a658a0deada903f0 08-Nov-2006 Jim Laskey <jlaskey@mac.com> Remove redundant <cmath>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
393ebae0ef7fa72d133bf901a02fcce3b5554ab7 07-Nov-2006 Chris Lattner <sabre@nondot.org> Enable improved spilling costs by default. This speeds up viterbi on x86
by 40%, FreeBench/fourinarow by 20%, and many other programs 10-25%.

On PPC, this speeds up fourinarow by 18%, and probably other things as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31504 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7902c75331fa8f38fc8380f5573d935c0d149ef5 07-Nov-2006 Jim Laskey <jlaskey@mac.com> Use correct value for float HUGH_VAL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31500 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b75a663707e40a6b72bf404e7fbf08f7d9e1eb90 07-Nov-2006 Chris Lattner <sabre@nondot.org> Add a new llcbeta option. This speeds up viterbi from 12.34 to 8.76s on
X86. If happy, I'll enable this by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bf105c842450d3308d024be203ddd533f37051ec 03-Nov-2006 Evan Cheng <evan.cheng@apple.com> Proper check for two-addressness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31408 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3ed469ccd7b028a030b550d84b7336d146f5d8fa 02-Nov-2006 Reid Spencer <rspencer@reidspencer.com> For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
428b92eb83b457b71d29d1d4b7900d36a0ce9a53 15-Sep-2006 Chris Lattner <sabre@nondot.org> Keep track of the start of MBB's in a separate map from instructions. This
is faster and is needed for future improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2926869b4a083fc951484de03a9867eabf81e880 05-Sep-2006 Chris Lattner <sabre@nondot.org> Fix a long-standing wart in the code generator: two-address instruction lowering
actually *removes* one of the operands, instead of just assigning both operands
the same register. This make reasoning about instructions unnecessarily complex,
because you need to know if you are before or after register allocation to match
up operand #'s with the target description file.

Changing this also gets rid of a bunch of hacky code in various places.

This patch also includes changes to fold loads into cmp/test instructions in
the X86 backend, along with a significant simplification to the X86 spill
folding code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dffb2e83ed2546226d09c40aa43524e2392322da 04-Sep-2006 Chris Lattner <sabre@nondot.org> Correct fix for a crasher on functions with live in values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5277e4304e9559c13aa42b1d056e828f8f75ff08 04-Sep-2006 Chris Lattner <sabre@nondot.org> Hack around a regression I introduced yesterday


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6b128bdc58a496e9f08e4d09416330320761baff 03-Sep-2006 Chris Lattner <sabre@nondot.org> Avoid beating on the mi2i map when we know the answer already.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fbecc5a593da0a5b4d9ff6be63c5558060e31e43 03-Sep-2006 Chris Lattner <sabre@nondot.org> minor speedup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1acb17cb8392dce33079fe45f383944ec6616757 02-Sep-2006 Chris Lattner <sabre@nondot.org> Iteration is required for some cases, even if they don't occur in crafty.
Restore it, which re-fixes X86/2006-08-21-ExtraMovInst.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f21f0205b5dec61f165518887f54e01ab5aab13c 02-Sep-2006 Chris Lattner <sabre@nondot.org> When joining two intervals where the RHS is really simple, use a light-weight
method for joining the live ranges instead of the fully-general one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8a67f6e848244b00dd706a7e01079d1b39c07731 01-Sep-2006 Chris Lattner <sabre@nondot.org> Pull some code out of a hot recursive function because the common case doesn't
need recursion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30015 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
238416c99b2a2baea06ac05a5964bbbbf660f3dd 01-Sep-2006 Chris Lattner <sabre@nondot.org> Reserve space in the ValueNumberInfo vector. This speeds up live interval
analysis 16% on crafty.

Wrap long lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30012 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a2a8f0919d6d000e894f31b8cb416b4fbe17bb07 01-Sep-2006 Chris Lattner <sabre@nondot.org> Iterative coallescing doesn't buy us anything (we get identical results on
crafty with and without it). Removing it speeds up live intervals 6%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2ebfa0c61823c5d7528b1b3235106c30cb8d53f1 31-Aug-2006 Chris Lattner <sabre@nondot.org> Add a special case that speeds up coallescing a bit, but not enough.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bfe180af9eef1cf767f61f501ca325fcce2ae7ce 31-Aug-2006 Chris Lattner <sabre@nondot.org> Delete copies as they are coallesced instead of waiting until the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29995 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
91725b75852443923b419fd23215194cfc65dd88 31-Aug-2006 Chris Lattner <sabre@nondot.org> avoid calling the virtual isMoveInstr method endlessly by caching its results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ba256037ced5606d5cea8a1676b21eaf91d924de 31-Aug-2006 Chris Lattner <sabre@nondot.org> Fix a compiler crash bootstrapping llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6d8fbef015ff836bcb8f64f52c49805e43f8ea9f 30-Aug-2006 Chris Lattner <sabre@nondot.org> Teach the coallescer to coallesce live intervals joined by an arbitrary
number of copies, potentially defining live ranges that appear to have
differing value numbers that become identical when coallsced. Among other
things, this fixes CodeGen/X86/shift-coalesce.ll and PR687.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29968 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5d8925c7c506a54ebdfb0bc93437ec9f602eaaa0 28-Aug-2006 Chris Lattner <sabre@nondot.org> Eliminate RegisterAnalysis. RegisterPass now does all that is necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c9d94d12900bd0d2bd482ef31f8f1deb3ffafa23 27-Aug-2006 Chris Lattner <sabre@nondot.org> typo fix


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e7f729b42b54fa751ba3524e1c597aad6d3ec3d7 26-Aug-2006 Chris Lattner <sabre@nondot.org> Simplifications to liveinterval analysis, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29896 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c114b2cad7293d98686d380273085f5c32966b52 26-Aug-2006 Chris Lattner <sabre@nondot.org> Completely change the way that joining with physregs is implemented. This
paves the way for future changes, increases coallescing opportunities (in
theory, not witnessed in practice), and eliminates the really expensive
LiveIntervals::overlapsAliases method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f7da2c7b0c6293c268881628fc351bed7763f1f4 25-Aug-2006 Chris Lattner <sabre@nondot.org> Take advantage of the recent improvements to the liveintervals set (tracking
instructions which define each value#) to simplify and improve the coallescer.
In particular, this patch:

1. Implements iterative coallescing.
2. Reverts an unsafe hack from handlePhysRegDef, superceeding it with a
better solution.
3. Implements PR865, "coallescing" away the second copy in code like:

A = B
...
B = A

This also includes changes to symbolically print registers in intervals
when possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29862 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
be4f88a8b8bb3311e0dc4cde8533763d7923c3ea 22-Aug-2006 Chris Lattner <sabre@nondot.org> Improve the LiveInterval class to keep track of which machine instruction
defines each value# tracked by the interval. This will be used to improve
coallescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8222b2de224647e4ca8ac36adff87b2c93daf7cc 22-Aug-2006 Chris Lattner <sabre@nondot.org> Print physreg names symbolically in dumps


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29805 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7c10b0d2c9b4d637edf27548c104b7199b0e3578 22-Aug-2006 Chris Lattner <sabre@nondot.org> Print debug info as:

*** Register mapping ***
reg 1024 -> %reg1028
reg 1026 -> EAX
reg 1027 -> %reg1028

instead of:

*** Register mapping ***
reg 1024 -> reg 1028
reg 1026 -> reg 15
reg 1027 -> reg 1028


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29803 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cd4317efcf334be10d9a98008a1445d6e12a7712 21-Jul-2006 Jim Laskey <jlaskey@mac.com> Eliminate data relocations by using NULL instead of global empty list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ed41f1bb1981a98eea63f00c5988cf62bbdd7c59 20-Jul-2006 Andrew Lenharth <andrewl@lenharth.org> Reduce number of exported symbols


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d74ea2bbd8bb630331f35ead42d385249bd42af8 24-May-2006 Chris Lattner <sabre@nondot.org> Patches to make the LLVM sources more -pedantic clean. Patch provided
by Anton Korobeynikov! This is a step towards closing PR786.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28447 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
647c15e58ed4c3fda81041d401ca7547639958dc 12-May-2006 Evan Cheng <evan.cheng@apple.com> Backing out fix for PR770. Need to re-apply it after live range splitting is possible


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28236 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
993141402f57b4d4cbb7f8a3113f19c61688f9b7 11-May-2006 Evan Cheng <evan.cheng@apple.com> Set weight of zero length intervals to infinite to prevent them from being
spilled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e73701df947d23c65e96abc71a3be40ad77058ee 09-May-2006 Evan Cheng <evan.cheng@apple.com> PR 770 - permit coallescing of registers in subset register classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e53f4a055f74bded20d6129b4724ddd17fd199f6 04-May-2006 Chris Lattner <sabre@nondot.org> Move some methods out of MachineInstr into MachineOperand


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
35f2705e3de4600c3621b883eed9b22e4607ddf4 01-May-2006 Chris Lattner <sabre@nondot.org> Remove previous patch, which wasn't quite right.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
200370fb5617a1719f0054804b412469ce486ebd 30-Apr-2006 Evan Cheng <evan.cheng@apple.com> Local spiller kills a store if the folded restore is turned into a copy.
But this is incorrect if the spilled value live range extends beyond the
current BB.
It is currently controlled by a temporary option -spiller-check-liveout.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2c2c6c61f100bc7c3df873b11203fcea1b5e18fe 23-Jan-2006 Chris Lattner <sabre@nondot.org> Add explicit #includes of <iostream>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
60d97d4f55b6bd51179eba3388c95d5ec6942ec8 10-Jan-2006 Chris Lattner <sabre@nondot.org> Minor cleanup, no functionality change for current targets


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3b9db830f7f0ed33af13459be3fd60ebe01a13ca 03-Jan-2006 Chris Lattner <sabre@nondot.org> Change a variable from being an iterator to a raw MachineInstr*, to make
GDB use tolerable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c60e6020c0dd1260b0d60835e2ab823f97a4b810 26-Oct-2005 Chris Lattner <sabre@nondot.org> Fix some spello's pointed out by Gabor Greif


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
aa51a484e188ecb8d3e4b6ac852c553a4aacc89a 21-Oct-2005 Chris Lattner <sabre@nondot.org> Make the coallescer a bit smarter, allowing it to join more live ranges.
For example, we can now join things like [0-30:0)[31-40:1)[52-59:2)
with [40:60:0) if the 52-59 range is defined by a copy from the 40-60 range.
The resultant range ends up being [0-30:0)[31-60:1).

This fires a lot through-out the test suite (e.g. shrinking bc from
19492 -> 18509 machineinstrs) though most gains are smaller (e.g. about
50 copies eliminated from crafty).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3c3fe462f7978b429ecdd71750c26be25c3d1335 21-Sep-2005 Chris Lattner <sabre@nondot.org> Expose the LiveInterval interfaces as public headers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23400 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ceb0a5223180c01c6ea6e26ae9556b3797b47f02 09-Sep-2005 Chris Lattner <sabre@nondot.org> remove debugging code *slaps head*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23294 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b11443dc8458b0ba72d484dacf99dffa2e8d3b51 09-Sep-2005 Chris Lattner <sabre@nondot.org> When spilling a live range that is used multiple times by one instruction,
only add a reload live range once for the instruction. This is one step
towards fixing a regalloc pessimization that Nate notice, but is later undone
by the spiller (so no code is changed).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dc6e2e0a5f3ee81d85922790aaedc80740820a8b 07-Sep-2005 Chris Lattner <sabre@nondot.org> Fix a bug that Tzu-Chien Chiu noticed: live interval analysis does NOT
preserve livevar


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5ab6f5fe666d0e3403d9b777324d1a1999118153 02-Sep-2005 Chris Lattner <sabre@nondot.org> Teach live intervals to not crash on dead livein regs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ab4b66d4c279e8cd9e448687020fc838e7881dbc 24-Aug-2005 Chris Lattner <sabre@nondot.org> Simplify this code by using higher-level LiveVariables methods


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cef21c354408980eab7922c35af7523b08b5bec9 28-Jul-2005 Chris Lattner <sabre@nondot.org> Fix debug info to not print out recently freed memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8e7a70976deee78a84099b916591d40f7a1cdc34 28-Jul-2005 Chris Lattner <sabre@nondot.org> Print symbolic register names in debug dumps


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22528 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
38135af219c48a8626d6af34a92e7e8bb957c81f 14-May-2005 Chris Lattner <sabre@nondot.org> Print the symbolic register name in a register allocator debug dump.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
712ad0c36dcfacb30620c793a6ffe4e80bd5d569 13-May-2005 Chris Lattner <sabre@nondot.org> allow a virtual register to be associated with live-in values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
edf128a7fa90f2b0b7ee24741a04a7ae1ecd6f7e 22-Apr-2005 Misha Brukman <brukman+llvm@gmail.com> Remove trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21420 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8e7d87b22867cc5add0c2e9fda4fddb340128403 09-Apr-2005 Chris Lattner <sabre@nondot.org> there is no need to remove this instruction, linscan does it already as it
removes noop moves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21183 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
799a919dbc03d8451434a1f3afc6fe571212d19c 09-Apr-2005 Chris Lattner <sabre@nondot.org> Adjust live intervals to support a livein set


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e97568c3c41e6de2b726d2cd99724659650e9614 10-Mar-2005 Chris Lattner <sabre@nondot.org> I didn't mean to check this in. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f768bba43f5c036039851d2fcca8212edca18467 10-Mar-2005 Chris Lattner <sabre@nondot.org> Allow the live interval analysis pass to be a bit more aggressive about
numbering values in live ranges for physical registers.

The alpha backend currently generates code that looks like this:

vreg = preg
...
preg = vreg
use preg
...
preg = vreg
use preg

etc. Because vreg contains the value of preg coming in, each of the
copies back into preg contain that initial value as well.

In the case of the Alpha, this allows this testcase:

void "foo"(int %blah) {
store int 5, int *%MyVar
store int 12, int* %MyVar2
ret void
}

to compile to:

foo:
ldgp $29, 0($27)
ldiq $0,5
stl $0,MyVar
ldiq $0,12
stl $0,MyVar2
ret $31,($26),1

instead of:

foo:
ldgp $29, 0($27)
bis $29,$29,$0
ldiq $1,5
bis $0,$0,$29
stl $1,MyVar
ldiq $1,12
bis $0,$0,$29
stl $1,MyVar2
ret $31,($26),1

This does not seem to have any noticable effect on X86 code.

This fixes PR535.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
28696bee024805a6b191cfe12e1a24784dae8aa7 08-Jan-2005 Chris Lattner <sabre@nondot.org> Silence warnings from VS


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ce9653ce449f1409815547e1bf60abcd1332d2c9 07-Dec-2004 Reid Spencer <rspencer@reidspencer.com> For PR387:\
Make only one print method to avoid overloaded virtual warnings when \
compiled with -Woverloaded-virtual


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ad3c74fc9b52b652859807580c8e40b67394d689 26-Oct-2004 Chris Lattner <sabre@nondot.org> Reduce usage of MRegisterInfo::getRegClass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17238 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7a36ae8b0103088328e3a4992ac08b3dce312248 25-Oct-2004 Chris Lattner <sabre@nondot.org> Patch to support MSVC better, contributed by Morten Ofstad


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
bec6a9ea1281a0b3b37aece91ab0df21e086af61 02-Oct-2004 Chris Lattner <sabre@nondot.org> When a virtual register is folded into an instruction, keep track of whether
it was a use, def, or both. This allows us to be less pessimistic in our
analysis of them. In practice, this doesn't make a big difference, but it
doesn't hurt either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ef0543689ff90337af358add9dad74a1e23e9d74 01-Oct-2004 Chris Lattner <sabre@nondot.org> Pretty print a bit nicer :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
477e4555de341c5de780de3720d6f115ec133c4e 30-Sep-2004 Chris Lattner <sabre@nondot.org> There is no need to call MachineInstr::print directly, just send the MI& to an ostream.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16613 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
70ca358b7d540b6061236ddf757085042873c12c 30-Sep-2004 Chris Lattner <sabre@nondot.org> * Wrap some comments to 80 cols
* Add const_iterator stuff
* Add a print method, which means that I can now call dump() from the
debugger.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
2c4f7b5faaeedd97058ec4cfa44177124c42b9e1 09-Sep-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Grow the map on entry so that we don't crash if joinIntervals never
runs (if coalescing is disabled for example).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16259 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5d0d1e350a30772fd70798b5733bb060febd7b0d 08-Sep-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Use a DenseMap for mapping reg->reg. This improves the LiveInterval
analysis running time from 2.7869secs to 2.5226secs on 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16244 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
08a6c7614be9793754b17930ba619e875aef9585 03-Sep-2004 Misha Brukman <brukman+llvm@gmail.com> Order #includes alphabetically, local .h files first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16153 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
20aa474f8fbebde588edc101b90e834df28ce4ce 03-Sep-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fixes to make LLVM compile with vc7.1.

Patch contributed by Paolo Invernizzi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
551ccae044b0ff658fe629dd67edd5ffe75d10e8 02-Sep-2004 Reid Spencer <rspencer@reidspencer.com> Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d19e2901c1b79d287d01079659684f3a4951a69e 31-Aug-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Minor code clarity changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d8d26b3268acf7f157028f0cb60a545b185e8905 27-Aug-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Only update LiveVariables if it is available. addIntervalsForSpills
runs after the initial run of the live interval analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16075 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5327801fb87e3eda52a33f82e6211181030ecb93 27-Aug-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Use newly added API in MRegisterInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d0d0a1a08f9e27f4c950e846e0a21c3c3f11e40c 24-Aug-2004 Chris Lattner <sabre@nondot.org> Fix a bug in a previous checkin of mine, correcting
Regression.CodeGen.Generic.2004-04-09-SameValueCoalescing.llx and the
code size problem.

This bug prevented us from doing most register coallesces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3bba026994f01b2b5bdcdf4b628fa93a8ae9d6ef 16-Aug-2004 Chris Lattner <sabre@nondot.org> Reduce usage of MRegisterInfo::getRegClass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15784 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
706515727c6d024015fffded2b3109a4f0ac5299 04-Aug-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Clean up whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1a8ea01f01b30e28e4e3ac0e3a344c4a4d579270 04-Aug-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Convert indentation to 2 spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c25b55a5b237772bbd7cc55988d3ca0ec569aede 25-Jul-2004 Chris Lattner <sabre@nondot.org> Fix the sense of joinable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
62d4e16a059b5bbcd49b1bcab0d4854e784821f9 25-Jul-2004 Chris Lattner <sabre@nondot.org> Fix a bug where we incorrectly value numbered the first PHI definition the
same as the PHI use. This is not correct as the PHI use value is different
depending on which branch is taken. This fixes espresso with aggressive
coallescing, and perhaps others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c83e40d1b6582155286f1044623d544dea20202e 25-Jul-2004 Chris Lattner <sabre@nondot.org> Add debugging output for joining assignments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15187 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a1613db62fec94845aa8306232fb665273615bad 24-Jul-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,
LiveInterval>. This saves some space and removes the pointer
indirection caused by following the pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
060913cce42d8b746194c7ebd8b19c9789a03909 24-Jul-2004 Chris Lattner <sabre@nondot.org> whoops, didn't mean to remove this


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4df98e546dd0cca214df661ae1072e1a3f6eff98 24-Jul-2004 Chris Lattner <sabre@nondot.org> Completely eliminate the intervals_ list. instead, the r2iMap_ maintains
ownership of the intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7ac2d3146a196fa0120c579ecd2ddd69652ad230 24-Jul-2004 Chris Lattner <sabre@nondot.org> Big change to compute logical value numbers for each LiveRange added to an
Interval. This generalizes the isDefinedOnce mechanism that we used before
to help us coallesce ranges that overlap. As part of this, every logical
range with a different value is assigned a different number in the interval.
For example, for code that looks like this:

0 X = ...
4 X += ...
...
N = X

We now generate a live interval that contains two ranges: [2,6:0),[6,?:1)
reflecting the fact that there are two different values in the range at
different positions in the code.

Currently we are not using this information at all, so this just slows down
liveintervals. In the future, this will change.

Note that this change also substantially refactors the joinIntervalsInMachineBB
method to merge the cases for virt-virt and phys-virt joining into a single
case, adds comments, and makes the code a bit easier to follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f35fef7060c465dd7b578bf6339a18e8a8911888 23-Jul-2004 Chris Lattner <sabre@nondot.org> More minor changes:
* Inline some functions
* Eliminate some comparisons from the release build

This is good for another .3 on gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a3b8b5c0e0a1d0942288568b2012592184ca67c5 23-Jul-2004 Chris Lattner <sabre@nondot.org> Rename LiveIntervals.(cpp|h) -> LiveIntervalAnalysis.(cpp|h)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fb449b9ea5a37fb411aee7d42f6a76119602288d 23-Jul-2004 Chris Lattner <sabre@nondot.org> Pull the LiveRange and LiveInterval classes out of LiveIntervals.h (which
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ec2bc645053e9051ada01fac6a555df17a85c91d 23-Jul-2004 Chris Lattner <sabre@nondot.org> Improve comments a bit

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);


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15130 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
fe1630b43ef3e9506fde9780108c2af0431393e9 23-Jul-2004 Chris Lattner <sabre@nondot.org> Force coallescing of live ranges that have a single definition, even if they
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e8850f476eba1b839b24bd926bab2dfd8b452307 22-Jul-2004 Chris Lattner <sabre@nondot.org> Fix broken -debug printing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15115 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d3014edc51af0751e7f05180e9f48162433fb4ba 22-Jul-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Sorting is now handled by both linearscan and iterative scan so live
intervals need not be sorted anymore. Removing this redundant step
improves LiveIntervals running time by 5% on 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6beef3e1a085a0f3693fa6eff1b0b702e2c246e7 22-Jul-2004 Chris Lattner <sabre@nondot.org> That funny 2-address lowering pass can also cause multiple definitions,
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7848e68c1635ccba5a08d55314d4e5aed5ab54b9 21-Jul-2004 Brian Gaeke <gaeke@uiuc.edu> These files don't need to include <iostream> since they include "Support/Debug.h".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6bd23c083290ab0f68388397f213323f386fc36e 20-Jul-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Remove unneeded functor. LiveInterval has a < operator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15031 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8640f4e666086cc6e7447dc164105e428e6cb81a 19-Jul-2004 Chris Lattner <sabre@nondot.org> Fix a bug that occurs when the last instruction in a range is dead


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cc0d156f7bca0811aade0a95b0e7419176383c90 19-Jul-2004 Chris Lattner <sabre@nondot.org> When joining intervals, join intervals in deeply nested loops first. This
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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1c5c0444f1326b58cf05015651f36f2b04ca322d 19-Jul-2004 Chris Lattner <sabre@nondot.org> Split joinIntervals into two methods


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
74de8b1b26b12fda3364382946e519a2e37b6709 19-Jul-2004 Chris Lattner <sabre@nondot.org> There is no need to store the MBB along with the MI any more, we can now
ask instructions for their parent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14998 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
472405e0dc05f6fb8c09af00713ff893fff25b94 19-Jul-2004 Chris Lattner <sabre@nondot.org> Simplify the interface to LiveVariables::addVirtualRegister(Killed|Dead)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8ea13c6233d7dded98d933b435f2727a38149a70 19-Jul-2004 Chris Lattner <sabre@nondot.org> Two changes, both very significant:

* 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14993 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
57eb15e316c8f186b988dea7f8962ffa827d4a71 19-Jul-2004 Chris Lattner <sabre@nondot.org> See comments. The live intervals were not coming out of the spiller in sorted
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6097d13b2a624048dbe02e39e2dfb23bfa269b64 19-Jul-2004 Chris Lattner <sabre@nondot.org> remove the mbbi2mbbMap_, which was just keeping track of mbb order anyway.

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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14989 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e1b9536d546b78f8cffc7efbb2ff75d7e15f9749 17-Jul-2004 Chris Lattner <sabre@nondot.org> It looks like physref->virtreg joining is working fine. Enable it by default
but make virtreg->virtreg joining stay off by default


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14916 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
80b27ced2d5e6340bb62d75a8c6f23198e69a1af 09-Jul-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14720 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
607baea7d2f3155a4ca391a1d9fb1f4b0178ebb2 09-Jul-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Improve code comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
3877652e683cc85dd3cd512d6af0accbce84cad5 07-Jul-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Disable coalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14655 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5de868b0b2daf145d7991bc9b3bf25807bcc7ca7 06-Jul-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Do not crash when joining two intervals of registers of different
classes: just ignore that move. Thanks to Vladimir Prus who found the
bug!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
230b4fb8a0d7b2b0e0d533cf37b05a084d140a5c 02-Jul-2004 Chris Lattner <sabre@nondot.org> Revert patches 1.79 and 1.80 which had to do with dead MBB's. Now that they
don't exist, we don't have to pretend to handle them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14567 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8490f9c92e354fd9cd242bae89b24e6c59e5c794 01-Jul-2004 Chris Lattner <sabre@nondot.org> Now that MachineFunction/MachineBasicBlock keep a mapping of blocks to ID #'s
use them instead of a local LiveVariables numbering


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
8ba9771549bcff6109ad45ff3944a1b6c3c54b46 01-Jul-2004 Chris Lattner <sabre@nondot.org> Start using MBB numbers directly instead of going through the live variables
map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14518 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
91a350ddd13de9c972c583b4a1ad3ac114c117e7 29-Jun-2004 Chris Lattner <sabre@nondot.org> In line with the previous patch, do not assert out if analyzing a dead basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14475 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
59850a8f8f94c59e8894edcbf8629a5d88624dc6 29-Jun-2004 Chris Lattner <sabre@nondot.org> Do not dereference end iterators. It hurts when you do that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14474 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b140762a45d21aaed054f15adaff0fc2274d939d 25-Jun-2004 Tanya Lattner <tonic@nondot.org> Made a fix so that you can print out MachineInstrs that belong to a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
418da55c89c9ba355b51dceecb16f4388ef35119 21-Jun-2004 Chris Lattner <sabre@nondot.org> Rename Interval class to LiveInterval to avoid conflicting with the already
existing llvm::Interval class.

Patch contributed by Vladimir Prus!
http://mail.cs.uiuc.edu/pipermail/llvmbugs/2004-June/000710.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9bcdcd17c7219dbc68de2f11ca2de86471c8c390 02-Jun-2004 Chris Lattner <sabre@nondot.org> Adjust to new TargetMachine interface


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6924063bf2fdcc455bcb87807ab452ab7fc69773 30-May-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Pull Interval class out of LiveIntervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13910 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
26f5a69e52b64e035d26c135979a39b39fd6ba3e 30-May-2004 Alkis Evlogimenos <alkis@evlogimenos.com> When spilling an register, introduce a new temporary for each of its
spills. This allows for more flexibility when allocating registers for
spill code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13907 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f717a0569886be297903078bcd779e84254d0010 29-May-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Remove defs vector from live intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
feab248c93eeb1028ac014fa9546a02013dd3396 08-May-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Remove unneeded header


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13416 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a19eedeb7aafc418ef2f017b8215ceafa7f1a76c 06-May-2004 Chris Lattner <sabre@nondot.org> numeric_limits::infinity() apparently does not work on all systems. As a
workaround, use the C HUGE_VAL macro instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
015959ee38e4fd4a920f6b0065c50e524762f580 01-May-2004 Chris Lattner <sabre@nondot.org> Operate on the Machine CFG instead of on the LLVM CFG


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13302 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6e4d0d6546774d21a8f4f55c591df42557ca6c62 12-Apr-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix bug introduced in previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12872 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
43b61f724ef68810c63fc54c99e88f9b278f05c0 12-Apr-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Correctly compute spill weights


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12869 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e633352fd57d54612f8986978b6fe3cb9ba2f620 12-Apr-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Print def lists a bit more compactly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9a8b490735d216435862a3d52e669357f165550f 09-Apr-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Add definition list to each live interval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12791 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
39354c99a158685d8bc91b0836c283e936a29cb2 14-Mar-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Change MRegisterInfo::foldMemoryOperand to return the folded
instruction to make the API more flexible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
5f37502bfbadfa65de087627bd67fd58bb03725c 01-Mar-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Add the long awaited memory operand folding support for linear scan


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
71e353ed3530a5da48c3dd3257c410f6c4ce2e3e 26-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Uncomment assertions that register# != 0 on calls to
MRegisterInfo::is{Physical,Virtual}Register. Apply appropriate fixes
to relevant files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
98e17cf54345a4e9ab0ded690cdb41c0cd219c8e 23-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Move LiveIntervals.h up to be the first included header


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a2f6a408dc6616713b2e63425cf8cf7792c66c80 23-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Move LiveIntervals.h to lib/CodeGen since it shouldn't be exposed to other parts of the compiler


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0f338a1e8cd8167d22e2d011e0bec7eaadc6154a 22-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Print basic block boundaries in machine instruction debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7200c6b82acb8401048a2bc8a423f23b48db6731 22-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Abstract merging of ranges away from number of slots per instruction.

Also make it less aggressive as the current implementation breaks in
some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d6f6d1a80daf89ad0bddc4b8335e1b2ae1ec3410 21-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Make 'fold' statistic's description the same in both allocators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
007726ca6f64ea74c20ddb90093ee8d6801733af 20-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Some more statistics improvements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
df158c7e3f09c05805e129fc2e8e661ccbc21f54 20-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Disambiguate statistic descriptions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
cea44711203cfcb3b18528401ac1ad170677ebfe 20-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Rename statistic and add another one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
39a0d5c1123cfe4ddf826690b6744cc7248e3149 20-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Too many changes in one commit:

1. LiveIntervals now implement a 4 slot per instruction model. Load,
Use, Def and a Store slot. This is required in order to correctly
represent caller saved register clobbering on function calls,
register reuse in the same instruction (def resues last use) and
also spill code added later by the allocator. The previous
representation (2 slots per instruction) was insufficient and as a
result was causing subtle bugs.

2. Fixes in spill code generation. This was the major cause of
failures in the test suite.

3. Linear scan now has core support for folding memory operands. This
is untested and not enabled (the live interval update function does
not attempt to fold loads/stores in instructions).

4. Lots of improvements in the debugging output of both live intervals
and linear scan. Give it a try... it is beautiful :-)

In summary the above fixes all the issues with the recent reserved
register elimination changes and get the allocator very close to the
next big step: folding memory operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
23c114fd3bec342ac1a2a45801b892d6b4517afc 18-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Be more agressive when joining ranges.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
99d9923608bfd0feff288d667c3e4f94c4132c26 18-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix overly conservative spill interval computation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
355a724bd8366b982950ac913b0589d40eaf379b 17-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix spilled interval update. It was too conservative.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
843b160a2040b3ec4d3452678450afa11704c473 15-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Eliminate the use of spill (reserved) registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6ab5c15962cb16402713747f1fbe85e001318e7d 14-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Use std::numeric_limits<float>::infinity() instead of
std::numeric_limits<float>::max() for weighting preallocated
intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
be766c72464116a445a02b542a450c4274bab5d0 13-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Remove getAllocatedRegNum(). Use getReg() instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
c0b9dc5be79f009d260edb5cd5e1d8346587aaa2 12-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Change MachineBasicBlock's vector of MachineInstr pointers into an
ilist of MachineInstr objects. This allows constant time removal and
insertion of MachineInstr instances from anywhere in each
MachineBasicBlock. It also allows for constant time splicing of
MachineInstrs into or out of MachineBasicBlocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1cbe4d0ad0888e50858cca83cf2a0d3083709513 10-Feb-2004 Chris Lattner <sabre@nondot.org> Do not use MachineOperand::isVirtualRegister either!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
0b8cb2bc47a6bee59c8c3f46d4cc047badf7f8ac 05-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Change live interval representation. Machine instructions now have two
slots each. As a concequence they get numbered as 0, 2, 4 and so
on. The first slot is used for operand uses and the second for
defs. Here's an example:

0: A = ...
2: B = ...
4: C = A + B ;; last use of A

The live intervals should look like:

A = [1, 5)
B = [3, x)
C = [5, y)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ad48cd6327df13ad4b8530733bbf115224bf9562 05-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> We don't need to scan the blocks that we are live-in on every
access. Rather we only have to do it on the creation of the interval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b606eaca1b149ef74c578a6a11d65339c125edab 02-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Should be more careful. The previously applied change made all counts
outside of loops = 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b180e3e92ba8783b1f93995c98dfe1634c5f9205 01-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Change string for joined intervals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b0b0ebaac09a930f7cbd302255fa23c5d8107e66 01-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Change xor to ^.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
676cf8cb1d613d626f826a45b44658ae35f58c7c 01-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Missed one silly assert :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
01e74a2aab64c5901a62d9ba9e1c263759929390 01-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Simplify joinIntervals() code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4f67b8664889d9e93b452a9a5f099d41d1bd235a 01-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Use MRegisterInfo::isPhysicalRegister and
MRegisterInfo::isVirtualRegister.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
52220f61bba91ab787d4cc0aee47df4e2ca55c04 01-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Apply final part of Chris' patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
02ba13c9897ae2b19f9201e57460d7ee2b753a0b 01-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Be a little smarter on the way we handle physical register defs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
08cec00588ec1a8fa85b208555f006d7396ae7a4 31-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Merge safe parts from last night's buggy commit. These do not break
any test cases :-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
97017de1872e08ffcdde2fccdfd399647c1ccc4a 31-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Optimize liveAt() and overlaps(). We now use a binary search instead
of a linear search to find the first range for comparisons. This cuts
down the linear scan register allocator running time by a factor of 3
in 254.perlbmk and by a factor of 2.2 in 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4d46e1e521c0df1990ea50f8146d22bd77ea71a6 31-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Revert last night's changes as they broke some tests. Will remerge parts of the patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11029 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
32bdd4ea65f58e3227176b9a5a43013fb13f06a5 31-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Several performance enhancements and cleanups from Chris.

Simplification of LiveIntervals::Interval::overlaps() and addition of
examples to overlaps() and liveAt() to make them clearer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11028 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
79b0c3f0b9d91bbda354a2c6f22b6578655a5143 23-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix failing test cases with joined live intervals. It turns out that
when joining we need to check if we overlap with the second interval
or any of its aliases.

Also make joining intervals the default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e88280a4224730dcf8076e0d9a20973c5761fd06 23-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Add option to join live intervals. Two intervals are joined if there
is a move between two registers, at least one of the registers is
virtual and the two live intervals do not overlap.

This results in about 40% reduction in intervals, 30% decrease in the
register allocators running time and a 20% increase in peephole
optimizations (mainly move eliminations).

The option can be enabled by passing -join-liveintervals where
appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10965 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1075ecd32f53b7bc12e4a8f6917d7d1aebd4672a 22-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Revert previous change. The code was correct...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
e1a210777d4950fa47817e61a81118351c9a2311 22-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix incorrect negatives in LiveIntervals::Interval::liveAt().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1893a05b28bf03e0ded1ed651cc1d71c7854ad93 16-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Add asserts to previous change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f5f1689ed28025cef601034052ef9c214797e8af 16-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Use a list instead of a vector to store intervals. This will be needed
when we join intervals and one of the two will need to be removed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
d6e40a6cbced8265334ee0375f5996098dfdccb2 14-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Properly update #intervals statistic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10847 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9739736b94b1116be2043e05567aa8899593ab29 14-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix bug in LiveIntervals::Interval::overlaps and
LiveIntervals::Interval::liveAt. Both were considering the live ranges
closed in the end, when they are actually open.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
af25473d5e99e0c0968746e12d8827e4b712bd31 13-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix miscomputation of live intervals. The catch is that registers can
be dead at the defining instruction but can only be killed in
subsequent ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
1a119e24106810310825f44c7bfd232d3272e639 13-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Remove allocatable registers vector. It is already provided by
LiveVariables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10830 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a3a6524965416647883bc0b78ff6f18fb3f7b5fc 13-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Cleanup debugging output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10824 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
63841bc85d15ca0ce1b3208084f4262f3d33ef21 13-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fix output of live intervals to show correctly its closed, open
ranges, i.e. [a,b)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10822 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
19b6486d3891c8a02a301aa1b44348a420772fcf 13-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Correctly compute live variable information for physical registers
when an implicitely defined register is later used by an alias. For example:

call foo
%reg1024 = mov %AL

The call implicitely defines EAX but only AL is used. Before this fix
no information was available on AL. Now EAX and all its aliases except
AL get defined and die at the call instruction whereas AL lives to be
killed by the assignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
80b378cf7c3dce77029dc3118e1f63bc6d389da1 07-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Change implementation of LiveIntervals::overlap(). This results in a
30-50% decrease in running time of the linear scan register allocator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
63caedf046bcce1f2981c5305d297c2b1890bfc7 05-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Remove simple coalescing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
26bfc08b80c904c71487ac1ab49a8b3a15a8d3e9 28-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Add coalescing to register allocator. A hint is added to each interval
which denotes the register we would like to be assigned to (virtual or
physical). In register allocation, if this hint exists and we can map
it to a physical register (it is either a physical register or it is a
virtual register that already got assigned to a physical one) we use
that register if it is available instead of a random one in the free
pool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
7a40eaaceec0af76d5b97610f3d4e7a47a19d245 24-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Do a separate pass to compute spill weights because doing it inline
with live intervals was missing registers that were used before they
were defined (in the arbitrary order live intervals numbers
instructions).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
056063e2645d86b11a441abfff4bfd96dc4edf8c 22-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Fix crash when compiling twolf.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
6b4edbaaf9021e0434f0ce0c3724eb43ed41b770 21-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Change weight into a float so that we can take into account the
nesting level when computing it. Right now the allocator uses:

w = sum_over_defs_uses( 10 ^ nesting level );


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
169cfd01964fc03828a7f2cad5d710890fbb08d8 21-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Add support for inactive intervals. This effectively reuses registers
for live ranges that fall into assigned registers' holes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4c080863de86448d905beab27686da823b6d44c1 18-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
a71e05acdd7c6a8e815db46b5fb6dc1d87826aab 18-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Modify linear scan register allocator to use the two-address
instruction pass. This also fixes all remaining bugs for this new
allocator to pass all tests under test/Programs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
43f692f90f6b27304570e1b1807542dff4b8e847 18-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> When a variable is killed and redifined in a basic block only one
killing instruction is tracked. This causes the LiveIntervals to
create bogus intervals. The workaound is to add a range to the
interval from the redefinition to the end of the basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10510 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
dd2cc65f34f9b7bfda1cd0c42becedfc361d46f8 18-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Handle multiple virtual register definitions gracefully.

Move some of the longer LiveIntervals::Interval method out of the
header and add debug information to them. Fix bug and simplify range
merging code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
f6f91bf6680668990ff3804b14cf05beedc56ec4 15-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Change preserve all claim to just preserve live variables and phielimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10469 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4d7af65903cbc858464362e70a6adf499982ec8a 14-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Change interface of MachineOperand as follows:

a) remove opIsUse(), opIsDefOnly(), opIsDefAndUse()
b) add isUse(), isDef()
c) rename opHiBits32() to isHiBits32(),
opLoBits32() to isLoBits32(),
opHiBits64() to isHiBits64(),
opLoBits64() to isLoBits64().

This results to much more readable code, for example compare
"op.opIsDef() || op.opIsDefAndUse()" to "op.isDef()" a pattern used
very often in the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10461 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
4c214d2bf0da92a7973bb7902c0d6d055b1fa991 13-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Ignore non-allocatable physical registers in live interval analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
9435eda6993944e74419d2f586fdd25635293760 13-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Handle explicit physical register defs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
b27ef248f579b354aab434f63c417ab1103e47e2 05-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Move operator<<(std::ostream&, const LiveInterval&) out of the header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10290 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
91ceae6d2060367a5212b15b26faa804ea0448a5 05-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Sort live intervals by increasing start point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
ff0cbe175df40e0d2b36e59c6fb72f211f1cba4c 20-Nov-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Merging the linear scan register allocator in trunk. It currently passes most tests under test/Programs/SingleSource/Benchmarks/Shootout so development will continue on trunk. The allocator is not enabled by default. You will need to pass -regallo=linearscan to lli or llc to use it.


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