History log of /external/llvm/lib/CodeGen/CalcSpillWeights.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

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

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
d736763847cee94c40a7f4d106cad91445834b7c 11-Nov-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> CalcSpillWeights: allow overidding the spill weight normalizing function

This will enable the PBQP register allocator to provide its own normalizing function.

No functionnal change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194417 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
095f994ba63994e8eb4b77127f9b872429496dba 11-Nov-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> CalcSpillWeights: give a better describing name to calculateSpillWeights

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

No functionnal change.

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

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

Update the documentation style while there.

No functionnal change.

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

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

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

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

Update the documentation style while there.

No functionnal change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194269 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
bf1757d5a100ef08e5e9b31b8dce5f5aad320197 08-Nov-2013 Arnaud A. de Grandmaison <arnaud.adegm@gmail.com> CalculateSpillWeights cleanup: remove unneeded includes

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

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
6e01dcbb7306514f11834f1e8d7d642013ea349b 06-Apr-2013 Nadav Rotem <nrotem@apple.com> typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
790047620a8f31cee1841c06c9e5e7688166ad93 16-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove LIS::isAllocatable() and isReserved() helpers.

All callers can simply use the corresponding MRI functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.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/CalcSpillWeights.cpp
96601ca332ab388754ca4673be8973396fea2ddd 22-Aug-2012 Craig Topper <craig.topper@gmail.com> Add a getName function to MachineFunction. Use it in places that previously did getFunction()->getName(). Remove includes of Function.h that are no longer needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
d67582e2767df96610ba8dc1835ad4bf99fc77e8 20-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Avoid iterating with LiveIntervals::iterator.

That is a DenseMap iterator keyed by pointers, so the iteration order is
nondeterministic.

I would like to replace the DenseMap with an IndexedMap which doesn't
allow iteration.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158856 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
3dfd59bdc3ab1135961a3798b4f23e191a7dc953 05-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Stop using LiveIntervals::isReMaterializable().

It is an old function that does a lot more than required by
CalcSpillWeights, which was the only remaining caller.

The isRematerializable() function never actually sets the isLoad
argument, so don't try to compute that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157973 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
6d1fd0b979cb88809ebb77a24f4da69e1d67606b 09-Aug-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Move CalculateRegClass to MRI::recomputeRegClass.

This function doesn't have anything to do with spill weights, and MRI
already has functions for manipulating the register class of a virtual
register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137123 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
5e9ae090d8afd994c8c8e81779dd2c074ecf9369 01-Jul-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't inflate register classes used by inline asm.

The constraints are represented by the register class of the original
virtual register created for the inline asm. If the register class were
included in the operand descriptor, we might be able to do this.

For now, just give up on regclass inflation when inline asm is involved.

No test case, this bug hasn't happened yet.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
15993f83a419950f06d2879d6701530ae6449317 27-Jun-2011 Evan Cheng <evan.cheng@apple.com> More refactoring. Move getRegClass from TargetOperandInfo to TargetInstrInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
f5497fb1b474028709f0a6d8556251dc21e34c26 17-May-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Teach LiveInterval::isZeroLength about null SlotIndexes.

When instructions are deleted, they leave tombstone SlotIndex entries.
The isZeroLength method should ignore these null indexes.

This causes RABasic to sometimes spill a callee-saved register in the
abi-isel.ll test, so don't run that test with -regalloc=basic. Prioritizing
register allocation according to spill weight can cause more registers to be
used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131436 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
1394e6d9252ed188dbd73a59bcb4f15526641363 26-Apr-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Use the new TRI->getLargestLegalSuperClass hook to constrain register class inflation.

This has two effects: 1. We never inflate to a larger register class than what
the sub-target can handle. 2. Completely unconstrained virtual registers get the
largest possible register class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130229 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
6094bd87d845afabba5b99ec4848fa6116bac682 29-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Recompute register class and hint for registers created during spilling.

The spill weight is not recomputed for an unspillable register - it stays infinite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128490 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.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/CalcSpillWeights.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/CalcSpillWeights.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/CalcSpillWeights.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/CalcSpillWeights.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/CalcSpillWeights.cpp
e1f543fbb338ea80cdac021fcb09230ad86896c6 12-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Clean up debug output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
a516e94cf159b9ea02af31872fc59b7ceeef7965 10-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Give up on register class recalculation when the register is used with subreg
operands. We don't currently have a hook to provide "the largest super class of
A where all registers' getSubReg(subidx) is valid and in B".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110730 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
9db3ea46cb7bd6bdf108d314daffd0dfd50a73fe 10-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Implement register class inflation.

When splitting a live range, the new registers have fewer uses and the
permissible register class may be less constrained. Recompute the register class
constraint from the uses of new registers created for a split. This may let them
be allocated from a larger set, possibly avoiding a spill.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110703 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
df30cf9e61e6586b45b74d1312bef1ee758ef94f 10-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Transpose the calculation of spill weights such that we are calculating one
register at a time. This turns out to be slightly faster than iterating over
instructions, but more importantly, it allows us to compute spill weights for
new registers created after the spill weight pass has run.

Also compute the allocation hint at the same time as the spill weight. This
allows us to use the spill weight as a cost metric for copies, and choose the
most profitable hint if there is more than one possibility.

The new hints provide a very small (< 0.1%) but universal code size improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.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/CalcSpillWeights.cpp
af462c4b4f59429d993b10607a0c31deb8a8156f 16-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove remaining calls to TII::isMoveInstr.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
00e840f4698633123ca799493c54f67ae20756df 03-Jul-2010 Eric Christopher <echristo@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.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/CalcSpillWeights.cpp
1e5cc222e85fdfdec34e977977c9ca0dea83aa04 10-Feb-2010 Evan Cheng <evan.cheng@apple.com> Remove duplicated #include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
8112b5322ef60c2dc3cbf0c05671de76df31cf02 10-Feb-2010 Evan Cheng <evan.cheng@apple.com> Emit an error for illegal inline asm constraint (which uses illegal type) rather than asserting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95746 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
3143e90ca89b808e98ad7354a9e7dd6bf42fef00 10-Feb-2010 Chris Lattner <sabre@nondot.org> fix missing #includes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.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/CalcSpillWeights.cpp
d94998f52574eacef148bd856de701af2c594b03 09-Feb-2010 Dale Johannesen <dalej@apple.com> Skip DEBUG_VALUE in some places where it was affecting codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95647 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.cpp
7ed6dd61ac904f6a50318f557ac0f389a4dbf6a9 24-Dec-2009 David Greene <greened@obbligato.org> Change errs() to dbgs().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/CalcSpillWeights.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/CalcSpillWeights.cpp
a937f220e14826266a8f05b58a541aad669c8912 14-Dec-2009 Lang Hames <lhames@gmail.com> Moved spill weight calculation out of SimpleRegisterCoalescing and into its own pass: CalculateSpillWeights.

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