History log of /external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/CodeGen/PHIElimination.cpp
331de11a0acc6a095b98914b5f05ff242c9d7819 10-Oct-2013 Matthias Braun <matze@braunis.de> Rename LiveRange to LiveInterval::Segment

The Segment struct contains a single interval; multiple instances of this struct
are used to construct a live range, but the struct is not a live range by
itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
e742d687369f79702894b6cf302e1f222c5d7432 15-Aug-2013 Mark Lacey <mark.lacey@apple.com> Auto-compute live intervals on demand.

When new virtual registers are created during splitting/spilling, defer
creation of the live interval until we need to use the live interval.

Along with the recent commits to notify LiveRangeEdit when new virtual
registers are created, this makes it possible for functions like
TargetInstrInfo::loadRegFromStackSlot() and
TargetInstrInfo::storeRegToStackSlot() to create multiple virtual
registers as part of the process of generating loads/stores for
different register classes, and then have the live intervals for those
new registers computed when they are needed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
f807a6ee3a6c7365ffdf07510767b13a5a7df93c 01-Jul-2013 Cameron Zwarich <zwarich@apple.com> Fix the build after r185363. Use llvm::next instead of raw next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
03fae50cfa5631349fbd47f4c232fc78f5b3b8af 01-Jul-2013 Cameron Zwarich <zwarich@apple.com> Fix PR16508.

When phis get lowered, destination copies are inserted using an iterator that is
determined once for all phis in the block, which BuildMI interprets as a request
to insert an instruction directly before the iterator. In the case of a cyclic
phi, source copies may also be inserted directly before this iterator, which can
cause source copies to be inserted before destination copies. The fix is to keep
an iterator to the last phi and then advance it while lowering each phi in order
to insert destination copies directly after the phis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
197a60a66612ab274a734066962a10126a11fb53 21-Feb-2013 Cameron Zwarich <zwarich@apple.com> Don't rely on the isDead() MachineOperand flag when updating LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175732 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
a566d63b61f2a29e89696abba1729ac53b9843e6 21-Feb-2013 Cameron Zwarich <zwarich@apple.com> Use getInterval() instead of getOrCreateInterval().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
767e04307f70cad9e2ba46b3812504ee1d8c1721 20-Feb-2013 Cameron Zwarich <zwarich@apple.com> Remove verification after PHIElimination when using LiveIntervals, and move it
after the two-address pass. The remaining problems in 'make check' are occurring
later.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
2650a82cc4166237f698e3bbc315739e43180431 20-Feb-2013 Cameron Zwarich <zwarich@apple.com> Avoid recomputing an inserted instruction's SlotIndex.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175597 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
4f659eccafe34efea2a4ba6e57ad09977e9157c2 20-Feb-2013 Cameron Zwarich <zwarich@apple.com> Add preservation of SlotIndexes to PHIElimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175596 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
4930e7266b7643410cfbbed5ef6e4d3b19178918 12-Feb-2013 Cameron Zwarich <zwarich@apple.com> Don't consider definitions by other PHIs live-in when trimming a PHI source's
live range after inserting a copy at the end of a block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
8d49134eeaa36953410c2fba65f7237fb3f079e7 12-Feb-2013 Cameron Zwarich <zwarich@apple.com> Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174944 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
5758a711f4e593d1daff3bae0fa9d694e5980719 12-Feb-2013 Cameron Zwarich <zwarich@apple.com> Add a hidden option to PHIElimination to split all critical edges. This is
particularly useful for catching issues with architectures that have exotic
terminators like MIPS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
8597c14e9b32259cc7cfd752d95fd71e7aaba0ec 11-Feb-2013 Cameron Zwarich <zwarich@apple.com> Add support for updating LiveIntervals to MachineBasicBlock::SplitCriticalEdge().
This is currently a bit hairier than it needs to be, since depending on where the
split block resides the end ListEntry of the split block may be the end ListEntry
of the original block or a new entry. Some changes to the SlotIndexes updating
should make it possible to eliminate the two cases here.

This also isn't as optimized as it could be. In the future Liveinterval should
probably get a flag that indicates whether the LiveInterval is within a single
basic block. We could ignore all such intervals when splitting an edge.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
36f54480f83d47404aceea5d41f8f6b95da2d00b 11-Feb-2013 Cameron Zwarich <zwarich@apple.com> Abstract the liveness checking in PHIElimination::SplitPHIEdges() to support
both LiveVariables and LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
b7cfac32f32f17e64a5addfdb833702160650f14 10-Feb-2013 Cameron Zwarich <zwarich@apple.com> Add support for updating LiveIntervals to PHIElimination. If LiveIntervals are
present, it currently verifies them with the MachineVerifier, and this passed
all of the test cases in 'make check' (when accounting for existing verifier
errors). There were some assertion failures in the two-address pass, but they
also happened on code without phis and look like they are caused by different
kill flags from LiveIntervals.

The only part that doesn't work is the critical edge splitting heuristic,
because there isn't currently an efficient way to update LiveIntervals after
splitting an edge. I'll probably start by implementing the slow fallback and
test that it works before tackling the fast path for single-block ranges. The
existing code that updates LiveVariables is fairly slow as it is.

There isn't a command-line option for enabling this; instead, just edit
PHIElimination.cpp to require LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
02513c05c6333e2f7418b1327eded162b2791828 10-Feb-2013 Cameron Zwarich <zwarich@apple.com> Remove ancient references to 'atomic' phis in PHIElimination that don't really
make sense anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
fe0fd35d5339467fedd59f0cf5bdadb163a8d766 10-Feb-2013 Cameron Zwarich <zwarich@apple.com> Make LiveVariables an instance variable of PHIElimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
0b8c9a80f20772c3793201ab5b251d3520b9cea3 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

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

Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
c321a20b2e250a755bd06f36d896d00d9fd396ad 20-Jul-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Split loop exiting edges more aggressively.

PHIElimination splits critical edges when it predicts it can resolve
interference and eliminate copies. It doesn't split the edge if the
interference wouldn't be resolved anyway because the phi-use register is
live in the critical edge anyway.

Teach PHIElimination to split loop exiting edges with interference, even
if it wouldn't resolve the interference. This removes the necessary
copies from the loop, which is still an improvement from injecting the
copies into the loop.

The test case demonstrates the improvement. Before:

LBB0_1:
cmpb $0, (%rdx)
leaq 1(%rdx), %rdx
movl %esi, %eax
je LBB0_1

After:

LBB0_1:
cmpb $0, (%rdx)
leaq 1(%rdx), %rdx
je LBB0_1

movl %esi, %eax

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
9e51b14faa55225a3175c4af9c69f5a45dd9a646 04-Jul-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Allow multiple terminators to read virtual registers.

Find the kill as the last terminator to read SrcReg.

Patch by Philipp Brüschweiler!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
5213750e27c2f9fd7f5a0884c4a15f3b5e3aa843 25-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Teach PHIElimination to handle <undef> operands.

When a PHI use is <undef>, don't emit a copy in the predecessor block,
but insert an IMPLICIT_DEF instruction instead. This ensures that
virtual register uses are always jointly dominated by defs, even if some
of them are IMPLICIT_DEF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159121 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
4888d5e98c7ae1fed28e41d75a65ddf70b25b03d 20-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete an unused member variable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148594 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
7c2a4a30e0e16762c75adacebd05ec9fcbccf16b 06-Dec-2011 Evan Cheng <evan.cheng@apple.com> First chunk of MachineInstr bundle support.
1. Added opcode BUNDLE
2. Taught MachineInstr class to deal with bundled MIs
3. Changed MachineBasicBlock iterator to skip over bundled MIs; added an iterator to walk all the MIs
4. Taught MachineBasicBlock methods about bundled MIs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
73e7dced3892f2abb4344526147d4df0f62aee61 30-Jul-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Add an isSSA() flag to MachineRegisterInfo.

This flag is true from isel to register allocation when the machine
function is required to be in SSA form. The TwoAddressInstructionPass
and PHIElimination passes clear the flag.

The SSA flag wil be used by the machine code verifier to check for SSA
form, and eventually an assertion can enforce it in +Asserts builds.
This will catch the common target error of creating machine code with
multiple defs of a virtual register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
ddcdcc88631c6bd4ad43d9198b98bc9a829be036 23-Apr-2011 Jay Foad <jay.foad@gmail.com> Remove unused STL header includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
6a951ac63fd6a9aa769c6d98b544b886e5b5d307 10-Mar-2011 Cameron Zwarich <zwarich@apple.com> Add an option to disable critical edge splitting in PHIElimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
61a733434d9ee6518b8ddb116594bef7206cb627 17-Feb-2011 Cameron Zwarich <zwarich@apple.com> Adjust indenting of arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
688521ca6f936cb51549b0d505aa89746561263b 17-Feb-2011 Cameron Zwarich <zwarich@apple.com> Return Changed from SplitPHIEdges rather than always returning true.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
117be03cc6cfb91d385938ed94a3cf877bd8c12a 14-Feb-2011 Cameron Zwarich <zwarich@apple.com> Add a statistic to PHIElimination tracking the number of critical edges split.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
04223909b74fd0634ba26d434fa7fdf2f3c7444f 14-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Try for the third time to teach getFirstTerminator() about debug values.

This time let's rephrase to trick gcc-4.3 into not miscompiling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
b6436e5be19937b622fabd87d1547b8fc7553c11 14-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r123419. It still breaks llvm-gcc-i386-linux-selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123423 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
09befe90360effa077b1934c0e85e5b7abe00a9c 14-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Try again to teach getFirstTerminator() about debug values.

Fix some callers to better deal with debug values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123419 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
a851fd8cd8e5c256651b3afeb8ebd539c28dfda7 13-Jan-2011 Devang Patel <dpatel@apple.com> Speculatively revert r123384 to make llvm-gcc-i386-linux-selfhost buildbot happy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
64f865ceca4cdd39fcac3d958071be118cb9c1d3 13-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Teach MachineBasicBlock::getFirstTerminator to ignore debug values.

It will still return an iterator that points to the first terminator or end(),
but there may be DBG_VALUE instructions following the first terminator.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
0a3fdd6e11cd351737b4451c05ec5d794e6855cf 05-Dec-2010 Cameron Zwarich <zwarich@apple.com> Remove the PHIElimination.h header, as it is no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
a474685d069a900ab931ee1540c9a79fdd6607a9 05-Dec-2010 Cameron Zwarich <zwarich@apple.com> Move the FindCopyInsertPoint method of PHIElimination to a new standalone
function so that it can be shared with StrongPHIElimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
2a7942926b753d185cb23ee29a91f2863eda4778 04-Dec-2010 Cameron Zwarich <zwarich@apple.com> Remove PHIElimination's private copy of SkipPHIsAndLabels.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120918 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
02dd53e1c5b941ca5f60fca1b95ebcaf9ccd1dfc 23-Aug-2010 Owen Anderson <resistor@mac.com> Now that PassInfo and Pass::ID have been separated, move the rest of the passes over to the new registration API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
9ac248848faa839cff8e9f915c9b2c44295bc9f6 18-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Preserve subregs on PHI source operands. Patch by Krister Wombell!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
e008384508342a2dec110eafaa87d93614976990 17-Aug-2010 Evan Cheng <evan.cheng@apple.com> Move the decision logic whether it's a good idea to split a critical edge to clients. Also fixed an erroneous check. An edge is only a back edge when the from and to blocks are in the same loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
97b9b97853d7e4fbb5c8460ef28126013c76e9a9 17-Aug-2010 Evan Cheng <evan.cheng@apple.com> PHI elimination should not break back edge. It can cause some significant code placement issues. rdar://8263994

good:
LBB0_2:
mov r2, r0
. . .
mov r1, r2
bne LBB0_2

bad:
LBB0_2:
mov r2, r0
. . .
@ BB#3:
mov r1, r2
b LBB0_2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
90c579de5a383cee278acc3f7e7b9d0a656e6a35 06-Aug-2010 Owen Anderson <resistor@mac.com> Reapply r110396, with fixes to appease the Linux buildbot gods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
1f74590e9d1b9cf0f1f81a156efea73f76546e05 06-Aug-2010 Owen Anderson <resistor@mac.com> Revert r110396 to fix buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
9ccaf53ada99c63737547c0235baeb8454b04e80 06-Aug-2010 Owen Anderson <resistor@mac.com> Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
92c1f72c548e6a5e793ef19a0b04910992115b6c 10-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Emit COPY instructions instead of using copyRegToReg in InstrEmitter,
ScheduleDAGEmit, TwoAddressLowering, and PHIElimination.

This switches the bulk of register copies to using COPY, but many less used
copyRegToReg calls remain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108050 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
853d3fb8d24fab2258e9cd5dce3ec8ff4189eeda 22-Jun-2010 Dan Gohman <gohman@apple.com> Move PHIElimination's SplitCriticalEdge for MachineBasicBlocks out
into a utility routine, teach it how to update MachineLoopInfo, and
make use of it in MachineLICM to split critical edges on demand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106555 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
3bf912593301152b65accb9d9c37a95172f1df5a 18-Jun-2010 Stuart Hastings <stuart@apple.com> Add a DebugLoc parameter to TargetInstrInfo::InsertBranch(). This
addresses a longstanding deficiency noted in many FIXMEs scattered
across all the targets.

This effectively moves the problem up one level, replacing eleven
FIXMEs in the targets with eight FIXMEs in CodeGen, plus one path
through FastISel where we actually supply a DebugLoc, fixing Radar
7421831.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106243 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
34dcc6fadca0a1117cdbd0e9b35c991a55b6e556 06-May-2010 Dan Gohman <gohman@apple.com> Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that it
doesn't have to guess.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
3d720fbc6ad40bc9287a420f824d244965d24631 05-May-2010 Evan Cheng <evan.cheng@apple.com> Move REG_SEQUENCE removal to 2addr pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103109 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
28428cd6f31c1ea3cf4cea03e64189a4c32b84a3 04-May-2010 Evan Cheng <evan.cheng@apple.com> Rename variables for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
48f2cb926e2512a1c4c33ca5a9e757de1c12036c 25-Mar-2010 Evan Cheng <evan.cheng@apple.com> Avoid being influenced by dbg_value instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
a92dced4a186c03f06a1e9156ca00d997ef0a972 04-Mar-2010 Evan Cheng <evan.cheng@apple.com> Remove PHINodeTraits and use MachineInstrExpressionTrait instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
f895dbeb29b63f775e341f53ab92609c8da25392 23-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Dead code elimination

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96837 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
1bf1691ed3bf4cb16ea221f062f1bb978fc8ea9d 17-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Dead code elimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
f78829794284afc7c243d9ad0591ae3a87172340 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92566 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
3de8249078354d25b37b40e0f10b4f88226d3dd4 18-Dec-2009 Bill Wendling <isanbard@gmail.com> Turn off critical edge splitting for landing pads. The introduction of a
non-landing pad basic block as the successor to a block that ends in an
unconditional jump will cause block folding to remove the added block as a
successor. Thus eventually removing it AND the landing pad entirely. Critical
edge splitting is an optimization, so we can safely turn it off when dealing
with landing pads.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
7896c9f436a4eda5ec15e882a7505ba482a2fcd0 03-Dec-2009 Chris Lattner <sabre@nondot.org> improve portability to avoid conflicting with std::next in c++'0x.
Patch by Howard Hinnant!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90365 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
8f72235a77e7ac262471936ea0ad2a3467d18871 01-Dec-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Move PHIElimination::isLiveOut method to LiveVariables.

We want LiveVariables clients to use methods rather than accessing the
getVarInfo data structure directly. That way it will be possible to change the
LiveVariables representation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
323d8c3ed72c9e440c2079e8c1954af69357c7cf 21-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Be more clever about calculating live variables through new basic blocks.

When splitting a critical edge, the registers live through the edge are:

- Used in a PHI instruction, or
- Live out from the predecessor, and
- Live in to the successor.

This allows the coalescer to eliminate even more phi joins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89530 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
160069d15aef1cd756bae112da9149c98308da68 19-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Place new basic blocks immediately after their predecessor when splitting
critical edges in PHIElimination.

This has a huge impact on regalloc performance, and we recover almost all of
the 10% compile time regression that edge splitting introduced.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89381 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
0257dd375d64da978887d0c1e97ab3560d7597ce 18-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't require LiveVariables for PHIElimination. Enable critical edge splitting
when LiveVariables is available.

The -split-phi-edges is now gone, and so is the hack to disable it when using
the local register allocator. The PHIElimination pass no longer has
LiveVariables as a prerequisite - that is what broke the local allocator.
Instead we do critical edge splitting when possible - that is when
LiveVariables is available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
5052c1547ef75f401fd397084831e0bb15311b09 18-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix inverted test and add testcase from failing self-host.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89167 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
202344e1240db60afa393198806e75256cde985c 17-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Disable -split-phi-edges to unbreak the buildbots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
5493acac6fcc06ef6fa8577bf9f720762d78e870 17-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Never call UpdateTerminator() when AnalyzeBranch would fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89139 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
95a2c8f1d0f29ce2a5ec8c41dac8b406aef88c68 17-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Enable -split-phi-edges by default, except when -regalloc=local.

The local register allocator doesn't like it when LiveVariables is run.
We should also disable edge splitting under -O0, but that has to wait a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
9e97f3c2e281b1d5f89da076f37d258e3dec5597 17-Nov-2009 Evan Cheng <evan.cheng@apple.com> Revert 89021. It's miscompiling llvm-gcc driver driver at -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
2cbe71cdf0550b4d27b4d9e7d61a26d97ca6debe 17-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Enable -split-phi-edges by default

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
b126d0530d48890e1689975483b9f923a0fca1da 16-Nov-2009 Lang Hames <lhames@gmail.com> Fix for the original bug in PR5495 - Look at uses as well as defs when determining the PHI-copy insert point.

- Patch by Andrew Canis!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
3b6ced15108909de2fab0766fc693fe66c48ab68 14-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix bug in -split-phi-edges.

When splitting an edge after a machine basic block with fall-through, we
forgot to insert a jump instruction. Fix this by calling updateTerminator() on
the fall-through block when relevant.

Also be more precise in PHIElimination::isLiveIn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88728 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
9aebb61daf4d787aa7dcff9e3caa89bac88e11d1 14-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Update MachineDominator information

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
1222287543a5b5917f8c31aa8c88d740f70222d9 13-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix PHIElimination optimization that uses MBB->getBasicBlock.

The BasicBlock associated with a MachineBasicBlock does not necessarily
correspond to the code in the MBB.

Don't insert a new IR BasicBlock when splitting critical edges. We are not
supposed to modify the IR during codegen, and we should be able to do just
fine with a NULL BB.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
bf4af353edd2da1d7f2ed0b22238a8d2c038f5cf 12-Nov-2009 Daniel Dunbar <daniel@zuster.org> Fix -Asserts warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
3e20475feebca3bfb29375ac7f3e5acbeb2a95c8 11-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix liveness calculation when splitting critical edges during PHI elimination.

- Edges are split before any phis are eliminated, so the code is SSA.

- Create a proper IR BasicBlock for the split edges.

- LiveVariables::addNewBlock now has same syntax as
MachineDominatorTree::addNewBlock. Algorithm calculates predecessor live-out
set rather than successor live-in set.

This feature still causes some miscompilations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
f235f13931835b3335f3f2ff2d3060381b93626c 10-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Teach PHIElimination to split critical edges when -split-phi-edges is enabled.

Critical edges leading to a PHI node are split when the PHI source variable is
live out from the predecessor block. This help the coalescer eliminate more
PHI joins.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
e35e3c33dc5533dd1e8ab7d9f4039cc1429d56aa 10-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Refactoring: Extract method PHIElimination::isLiveOut().
Clean up some whitespace.
No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
20354634ebb64023d322919633f8bd348a63891d 23-Jul-2009 Lang Hames <lhames@gmail.com> For real this time: PHI Def & Kill tracking added to PHIElimination.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
287b8b0301bc6ec7eb70d23d242326a8766bb8eb 23-Jul-2009 Lang Hames <lhames@gmail.com> Added PHI Def & Kill tracking to PHIElimination pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
fae02a2ab19abdf12854356e19aeb1da62a0b8ea 22-Jul-2009 Lang Hames <lhames@gmail.com> Exposed PHIElimination pass within CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76688 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
ddb03d831be02323e10b17328f715c0c5ffe3e02 07-Jul-2009 Evan Cheng <evan.cheng@apple.com> Revert 74898. It broke several tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
1dd35b4c35ef149a48c511283331f49c04351cae 07-Jul-2009 Sanjiv Gupta <sanjiv.gupta@microchip.com> if the terminator is a branch depending upon the side effects of a
previous cmp; a copy can not be inserted here if the copy insn also has
side effects. We don't have access to the attributes of copy insn here;
so just play safe by finding a safe locations for branch terminators.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74898 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
aed4a430f4f6cc0e3ff06d458e68e5d195bbed7c 26-May-2009 Evan Cheng <evan.cheng@apple.com> Eliminate VarInfo::UsedBlocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
a5fec0dba34206274041543b5924d2565fb10f9b 17-Mar-2009 Duncan Sands <baldrick@free.fr> Reapply r67049, with the test adjusted for darwin
(which produces "call L_f$stub" rather than "call f").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67079 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
db14d63ceac6d667dc1669d199c01a8d3246203c 16-Mar-2009 Bill Wendling <isanbard@gmail.com> --- Reverse-merging (from foreign repository) r67049 into '.':
U test/CodeGen/X86/2009-03-13-PHIElimBug.ll
D test/CodeGen/X86/2009-03-16-PHIElimInLPad.ll
U lib/CodeGen/PHIElimination.cpp

r67049 was causing this failure:

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/2009-03-13-PHIElimBug.ll for PR3784
Failed with exit(1) at line 1
while running: llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/test/CodeGen/X86/2009-03-13-PHIElimBug.ll | llc -march=x86 | /usr/bin/grep -A 2 {call f} | /usr/bin/grep movl
child process exited abnormally


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
dfec24c87711bac1564465742012d47bd5984c30 16-Mar-2009 Duncan Sands <baldrick@free.fr> Tweak the fix for PR3784: be less sensitive about just
how invokes are set up. The fix could be disturbed by
register copies coming after the EH_LABEL, and also didn't
behave quite right when it was the invoke result that
was used in a phi node. Also (see new testcase) fix
another phi elimination bug while there: register copies
in the landing pad need to come after the EH_LABEL, because
that's where execution branches to when unwinding. If they
come before the EH_LABEL then they will never be executed...
Also tweak the original testcase so it doesn't use a no-longer
existing counter.
The accumulated phi elimination changes fix two of seven Ada
testsuite failures that turned up after landing pad critical
edge splitting was turned off. So there's probably more to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
fc0b80d9746e5fd4b45057ab814c67371fb0f9ea 13-Mar-2009 Evan Cheng <evan.cheng@apple.com> Fix PR3784: If the source of a phi comes from a bb ended with an invoke, make sure the copy is inserted before the try range (unless it's used as an input to the invoke, then insert it after the last use), not at the end of the bb.

Also re-apply r66140 which was disabled as a workaround.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66976 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
d62e06c53b8b7e555617dc9b24b98c007d63de5d 03-Feb-2009 Bill Wendling <isanbard@gmail.com> Explicitly pass in debug location information to BuildMI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
1465d61bdd36cfd6021036a527895f0dd358e97d 28-Jan-2009 Duncan Sands <baldrick@free.fr> Rename getAnalysisToUpdate to getAnalysisIfAvailable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
ae73dc1448d25b02cabc7c64c86c64371453dda8 04-Sep-2008 Dan Gohman <gohman@apple.com> Tidy up several unbeseeming casts from pointer to intptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.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/PHIElimination.cpp
1b38ec83f07d5801035567160008cd7cb99a5c1a 19-Jun-2008 Evan Cheng <evan.cheng@apple.com> Cosmetic changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
6ddba2b933645d308428201e942abe1274fa5085 13-May-2008 Dan Gohman <gohman@apple.com> Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.

Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
ae94dda61a045cb77681940ecc25aba0d2763f74 13-May-2008 Bill Wendling <isanbard@gmail.com> Constify isSourceDefinedByImplicitDef function. Otherwise, just formatting
changes that don't change functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
b3e0a6d75c60f01df4fcee4b4309f06ce92a96c9 10-May-2008 Evan Cheng <evan.cheng@apple.com> If all sources of a PHI node are defined by an implicit_def, just emit an implicit_def instead of a copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
f870fbc554ac862ad6d45cf97148739802a3ed12 11-Apr-2008 Evan Cheng <evan.cheng@apple.com> If a PHI node has a single implicit_def source, replace it with an implicit_def instead of a copy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
fc5423d561bb7624bf328e3ed554efce6e296cbc 04-Apr-2008 Evan Cheng <evan.cheng@apple.com> Undo PHI elimination copy placement patch. This causes coalescing (performace) issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
576a27043d95d0b9b8a010bccfd38ed9c0afa739 03-Apr-2008 Evan Cheng <evan.cheng@apple.com> - PHI elimination also eliminates implicit_def that fits into a PHI node rather than copying it.
- Be (slightly) smarter about where to place the copies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
1088317675dd34a1823f427e472fb9e43c616cb1 02-Apr-2008 Evan Cheng <evan.cheng@apple.com> Remove #include<map> from LiveVariables.h. Not referenced.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49099 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.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/PHIElimination.cpp
7047dd4d227b5fb2e5ae0cb2e7d5de1d0098ad60 15-Jan-2008 Owen Anderson <resistor@mac.com> Remove DefInst from LiveVariables::VarInfo. Use the facilities on MachineRegisterInfo instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
d10fd9791c20fd8368fa0ce94b626b769c6c8ba0 31-Dec-2007 Owen Anderson <resistor@mac.com> Move copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of the
Machine-level API cleanup instigated by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
8aa797aa51cd4ea1ec6f46f4891a6897944b75b2 31-Dec-2007 Chris Lattner <sabre@nondot.org> Add new shorter predicates for testing machine operands for various types:
e.g. MO.isMBB() instead of MO.isMachineBasicBlock(). I don't plan on
switching everything over, so new clients should just start using the
shorter names.

Remove old long accessors, switching everything over to use the short
accessor: getMachineBasicBlock() -> getMBB(),
getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45464 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
a018540807775703d630e9c92f9d8013d545599e 08-Nov-2007 Owen Anderson <resistor@mac.com> Bring UsedBlocks back. StrongPHIElimination needs this information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
9efce638d307b2c71bd7f0258d47501661434c27 26-Sep-2007 Evan Cheng <evan.cheng@apple.com> Allow copyRegToReg to emit cross register classes copies.
Tested with "make check"!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42346 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
ecd94c804a563f2a86572dcf1d2e81f397e19daa 06-May-2007 Nick Lewycky <nicholas@mxc.ca> Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.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/PHIElimination.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/PHIElimination.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/PHIElimination.cpp
3fefc182a00663bfadbcbe17711b6d08469c9727 18-Apr-2007 Evan Cheng <evan.cheng@apple.com> Increment use count of new virtuals created during PHI elimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36233 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
e951cd1647834c1c6877ca9a699ef6b00a2d0ce9 18-Mar-2007 Evan Cheng <evan.cheng@apple.com> Keep UsedBlocks info accurate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
94c002a190cd2e3a52b1510bc997e53d63af0b3b 01-Feb-2007 Chris Lattner <sabre@nondot.org> rename DenseMap to IndexedMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.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/PHIElimination.cpp
ca756d2cf9bd88f210d61dd5f9776920a6178441 28-Sep-2006 Bill Wendling <isanbard@gmail.com> "Once more into the breach, dear friends, once more, or fill the wall up
with our English dead."

No! Really! Serious this time...It was how the vreg uses were being
adjusted that was causing hte Olden tests to fail. I corrected this and
the Olden and Regression tests all passed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
8af24b86a8dea1696839104c34d6445ee7294d2a 28-Sep-2006 Chris Lattner <sabre@nondot.org> re-re-revert this, back to the right revision. It currently breaks bisort/mst
in olden among others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
31cefb99431a10ced8660b14c61fc2ad6b172f75 28-Sep-2006 Chris Lattner <sabre@nondot.org> re-revert this patch, bisort and mst are still broken in Olden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
4da1abb311b424d581cc1a67cde3aa0233da99b5 28-Sep-2006 Bill Wendling <isanbard@gmail.com> Reapplying this patch. With the newest commits, the error in Olden/bisort
has disappeared.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30633 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
6c88e9b458648c1c0cdecfd03e8b85b3f7db2d25 27-Sep-2006 Chris Lattner <sabre@nondot.org> Temporarily revert this. This breaks Olden/bisort on PPC


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
c36f2a4ceadff85c83f9a2d68b187ec67d547b79 27-Sep-2006 Bill Wendling <isanbard@gmail.com> PR878: Instead of calculating the vreg to PHI use count everytime we get
a function, do it up front in linear time (going through all of the
instructions once). We create a map out of them. Then it's no problem to
use the information in it during elimination...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
a4f0b3a084d120cfc5b5bb06f64b222f5cb72740 27-Aug-2006 Chris Lattner <sabre@nondot.org> s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
103de7785aaf7375460adac32c63335a24fc440d 12-Aug-2006 Chris Lattner <sabre@nondot.org> Fix an obvious bug, noticed by inspection. No current targets trigger this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
9525528a7dc5462b6374d38c81ba5c07b11741fe 29-Jun-2006 Chris Lattner <sabre@nondot.org> Use hidden visibility to make symbols in an anonymous namespace get
dropped. This shrinks libllvmgcc.dylib another 67K


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28975 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
2adfa7e9320e79859beb556367ea607a329866b3 04-Jan-2006 Chris Lattner <sabre@nondot.org> Add support for targets (like Alpha) that have terminator instructions which
use virtual registers. We now allow the first instruction in a block of
terminators to use virtual registers, and update phi elimination to correctly
update livevar when eliminating phi's. This fixes a problem on a testcase
Andrew sent me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
172c362fefe3d6e762ada119d4084ed4ed31595b 04-Jan-2006 Chris Lattner <sabre@nondot.org> Add an assertion, update DefInst even though no one uses it (dangling pointers
don't help anyone)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25081 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
6db0756f021a7b9c84d3bb7ae50498feb080a013 03-Oct-2005 Chris Lattner <sabre@nondot.org> clean up this code a bit, no functionality change


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
53a79aaae988d9dc9d12af8970f8b8fe58cc478d 03-Oct-2005 Chris Lattner <sabre@nondot.org> Break the body of the loop out into a new method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
44b94c2185f4c1b826ec6003d25370cf2efac219 24-Aug-2005 Chris Lattner <sabre@nondot.org> adjust to new live variables interface


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
d7a10c8566c1f2e979f8f3abcaab441297a0c44c 06-May-2005 Misha Brukman <brukman+llvm@gmail.com> * Order #includes alphabetically
* Remove commented-out debug printouts


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21707 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
dedf2bd5a34dac25e4245f58bb902ced6b64edd9 22-Apr-2005 Misha Brukman <brukman+llvm@gmail.com> Convert tabs to spaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21439 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.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/PHIElimination.cpp
94881e8c4522e368df38275d28c8ececdd1e171e 23-Jul-2004 Chris Lattner <sabre@nondot.org> Update live intervals more accurately for PHI elim. This slightly reduces
the live intervals for some registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
a7bfbba856f6fc99803c9a670fd110d7a72f4843 23-Jul-2004 Chris Lattner <sabre@nondot.org> costmetic changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.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/PHIElimination.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/PHIElimination.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/PHIElimination.cpp
bee887211b603a7e19bf72a4c04e120b47ad82e9 12-May-2004 Chris Lattner <sabre@nondot.org> Fix a really nasty bug from my changes on Monday to PHIElim. These changes
broke obsequi and a lot of other things. It all boiled down to MBB being
overloaded in an inner scope and me confusing it with the one in the outer
scope. Ugh!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
8abf69374e9c34068ddc970817738c0eb24ece2b 10-May-2004 Chris Lattner <sabre@nondot.org> Switch this from using an std::map to using a DenseMap. This speeds up
phi-elimination from 0.6 to 0.54s on kc++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
80e20eb487e5e7bc41a7a52d5e985d332c552ef9 10-May-2004 Chris Lattner <sabre@nondot.org> Use a new VRegPHIUseCount to compute uses of PHI values by other phi values
in the basic block being processed. This fixes PhiElimination on kimwitu++
from taking 105s to taking a much more reasonable 0.6s (in a debug build).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
791f896d9f8a38b3806878867d61c114069b6195 10-May-2004 Chris Lattner <sabre@nondot.org> Now that we use an ilist of machine instructions, iterators are more robust
than before. Because this is the case, we can compute the first non-phi
instruction once when de-phi'ing a block. This shaves ~4s off of
phielimination of _Z7yyparsev in kimwitu++ from 109s -> 105s. There are
still much more important gains to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.cpp
4f6410f5cb1c9ad8cbe4f5a96dd706023ff4dbc5 31-Mar-2004 Chris Lattner <sabre@nondot.org> MachineBasicBlock::remove should not modify the iterator passed in


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
0742b59913a7760eb26f08121cd244a37e83e3b3 23-Feb-2004 Chris Lattner <sabre@nondot.org> Finegrainify namespacification


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11757 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
743d0a1f831f1d5a3141a6ca730558f40c35690a 23-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Refactor rewinding code for finding the first terminator of a basic
block into MachineBasicBlock::getFirstTerminator().

This also fixes a bug in the implementation of the above in both
RegAllocLocal and InstrSched, where instructions where added after the
terminator if the basic block's only instruction was a terminator (it
shouldn't matter for RegAllocLocal since this case never occurs in
practice).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11748 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
f81af21caf9c0f62c60b72762d9a927e8c24f679 14-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Use newly added next() and prior() utility functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.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/PHIElimination.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/PHIElimination.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/PHIElimination.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/PHIElimination.cpp
d0fde30ce850b78371fd1386338350591f9ff494 11-Nov-2003 Brian Gaeke <gaeke@uiuc.edu> Put all LLVM code into the llvm namespace, as per bug 109.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
b576c94c15af9a440f69d9d03c2afead7971118c 20-Oct-2003 John Criswell <criswell@uiuc.edu> Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
9e2dd8f8d7c995721584d8c7add309e5d9cb1051 27-Jul-2003 Chris Lattner <sabre@nondot.org> Const correctness fixes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
08d2e4e09adc53aa93c08c8327d2f5f2814acb74 05-Jun-2003 Chris Lattner <sabre@nondot.org> Fix bug: Jello/2003-06-04-bzip2-bug.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
5f2180c53330502eb2f0f5bf3f21a838ad800906 27-May-2003 Vikram S. Adve <vadve@cs.uiuc.edu> (1) Added special register class containing (for now) %fsr.
Fixed spilling of %fcc[0-3] which are part of %fsr.

(2) Moved some machine-independent reg-class code to class TargetRegInfo
from SparcReg{Class,}Info.

(3) Renamed MachienOperand::opIsDef to MachineOperand::opIsDefOnly()
and related functions and flags. Fixed several bugs where only
"isDef" was being checked, not "isDefAndUse".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6341 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
b52e0241c03a257f96bd9c77788eff5b1a7fd437 12-May-2003 Chris Lattner <sabre@nondot.org> Use a kill, not a dead definition, update comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
572c77066808fc0e9ee1d212dab227f28bf5e28a 12-May-2003 Chris Lattner <sabre@nondot.org> * Keep LiveVariable information more up-to-date and consistent
* *** Finally mark values that are inputs to PHIs as killed when appropriate.
This should make the generated code quite a bit better. For example, the
local-ra will not have to spill PHI inputs at the end of predecessor BB's
anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6117 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
a13f0d3f4159b1f54bcfc733ccd94977b020ea56 12-May-2003 Chris Lattner <sabre@nondot.org> Fix bug where we could iterate off the end of a basic block


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
98719d7cdc693c077d179fe3461ce625d6faef34 12-May-2003 Chris Lattner <sabre@nondot.org> Fix N^2 algorithm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
927ce5dfaea00453889080cd1c6daf3eb197ad74 12-May-2003 Chris Lattner <sabre@nondot.org> * Fix several comments
* Update LiveVar info better, fixing bug: Jello/2003-05-11-PHIRegAllocBug.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
0416d2a70aea644c3e0c06301c29f3b81ec1e42d 16-Jan-2003 Chris Lattner <sabre@nondot.org> Fix problems with empty basic blocks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5326 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
3501feab811c86c9659248a4875fc31a3165f84d 14-Jan-2003 Chris Lattner <sabre@nondot.org> Rename MachineInstrInfo -> TargetInstrInfo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5272 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/PHIElimination.cpp
bc40e898e153c9b81f246a7971eaac7b14446c49 13-Jan-2003 Chris Lattner <sabre@nondot.org> New files


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