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

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
a0ec3f9b7b826b9b40b80199923b664bad808cce 14-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d4201b6e76bad9cb3fb8a20e3c04555d97deb0fd 02-May-2013 Evan Cheng <evan.cheng@apple.com> TiedTo flag can now be placed on implicit operands. isTwoAddrUse() should look
at all of the operands. Previously it was skipping over implicit operands which
cause infinite looping when the two-address pass try to reschedule a
two-address instruction below the kill of tied operand.

I'm unable to come up with a reasonably sized test case.
rdar://13747577


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180906 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
e2326ad2c00fe3e8e21dbf312f1987ba92308733 24-Apr-2013 Andrew Trick <atrick@apple.com> Register Coalescing: add a flag to disable rescheduling.

When MachineScheduler is enabled, this functionality can be
removed. Until then, provide a way to disable it for test cases and
designing MachineScheduler heuristics.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
cc6137e30b40ddf3cdbbb6ebbe01e5b5c76da2e2 24-Feb-2013 Cameron Zwarich <zwarich@apple.com> Add a use of an otherwise unused variable to remove a warning in non-Asserts
builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175981 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
eb1b7254cf1ce480c423c2ae0ff1b68c6ada6180 24-Feb-2013 Cameron Zwarich <zwarich@apple.com> TwoAddressInstructionPass::tryInstructionTransform() only potentially returns
true when shouldOnlyCommute is false, so we can remove code that checks
otherwise.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175980 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
c5a6349ae84309534e0ade8c7c7ddada808e7729 24-Feb-2013 Cameron Zwarich <zwarich@apple.com> TwoAddrInstructionPass::tryInstructionTransform() has a case where it calls
itself recursively with a new instruction that has not been finalized, in order
to determine whether to keep the instruction. On 'make check' and test-suite the
only cases where the recursive invocation made any transformations were simple
instruction commutations, so I am restricting the recursive invocation to do
only this.

The other cases wouldn't work correctly when updating LiveIntervals, since the
new instructions don't have slot indices and LiveIntervals hasn't yet been
updated. If the other transformations were actually triggering in any test case
it would be possible to support it with a lot of effort, but since they don't
it's not worth it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
1ea93c79bc8b044935f867b334668623c587f5a8 24-Feb-2013 Cameron Zwarich <zwarich@apple.com> TargetInstrInfo::commuteInstruction() doesn't actually return a new instruction
unless it was requested to with an optional parameter that defaults to false, so
we don't need to handle that case in TwoAddressInstructionPass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175974 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
b4bd022731b28a80f59818870cc7df5d4771d793 23-Feb-2013 Cameron Zwarich <zwarich@apple.com> Fix a bug with the LiveIntervals updating in the two-address pass found by
running ASCI_Purple/SMG2000 in the test-suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175957 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
4c57942608094a74543920b7c809e442fa90dd72 23-Feb-2013 Cameron Zwarich <zwarich@apple.com> Make TwoAddressInstructionPass::sink3AddrInstruction() LiveIntervals-aware.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175956 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
80885e524ffceaba5ed237338a10f807895e9f8e 23-Feb-2013 Cameron Zwarich <zwarich@apple.com> Make rescheduleMIBelowKill() and rescheduleKillAboveMI() LiveIntervals-aware in
TwoAddressInstructionPass. The code in rescheduleMIBelowKill() is a bit tricky,
since multiple instructions need to be moved down, one-at-a-time, in reverse
order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
a931a12e04b856421977c86d94789cd8b47d6ad3 21-Feb-2013 Cameron Zwarich <zwarich@apple.com> Stop relying on physical register kill flags in isKilled() in the two-address
pass. One of the callers of isKilled() can cope with overapproximation of kills
and the other can't, so I added a flag to indicate this.

In theory this could pessimize code slightly, but in practice most physical
register uses are kills, and most important kills of physical registers are the
only uses of that register prior to register allocation, so we can recognize
them as kills even without kill flags.

This is relevant because LiveIntervals gets rid of all kill flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
17cec5a68523fe346fb752b1661cc8e640dd520b 21-Feb-2013 Cameron Zwarich <zwarich@apple.com> Make another kill check LiveIntervals-aware.

This brings the number of remaining failures in 'make check' without
LiveVariables down to 39, with 1 unexpectedly passing test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
3a9805f26ead8746cb56645cb909a7b64d165b83 21-Feb-2013 Cameron Zwarich <zwarich@apple.com> Split part of isKilled() into a separate function for use elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
214df4285a974c61450477cbcf5c4a196d574a6a 21-Feb-2013 Cameron Zwarich <zwarich@apple.com> Update isKilledAt in TwoAddressInstructionPass.cpp to use LiveIntervals when
available.

With this commit there are no longer any assertion or verifier failures when
running 'make check' without LiveVariables. There are still 56 failing tests
with codegen differences and 1 unexpectedly passing test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6189288766d9cf2e1cf82c1b41655e33754da83b 20-Feb-2013 Cameron Zwarich <zwarich@apple.com> Only use LiveIntervals in TwoAddressInstructionPass, not a mix of Liveintervals
and SlotIndexes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
c5b6135fb55362f5c052625043ebf3286f799f86 20-Feb-2013 Cameron Zwarich <zwarich@apple.com> Find anchoring end points for repairIntervalsInRange and repairIndexesInRange
automatically.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
fdf45175a8444c421c03627c139777d1de48e516 20-Feb-2013 David Blaikie <dblaikie@gmail.com> Fully qualify llvm::next to avoid ambiguity when building as C++11.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
9030fc22dd73684901ecb749c9688e289bd1a777 20-Feb-2013 Cameron Zwarich <zwarich@apple.com> Add support to the two-address pass for updating LiveIntervals in many of the
common transformations. This includes updating repairIntervalsInRange() to
handle more cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6cf93d740a600024f2de924614a4d4d0dc1cb852 20-Feb-2013 Cameron Zwarich <zwarich@apple.com> Move the computation of the IsEarlyClobber flag into its own loop, since the
correct value is needed in every iteration of the loop for updating
LiveIntervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
8c3dccde92e50f5be7d14cef2a6db34ea6ae2bc0 01-Dec-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Simplify REG_SEQUENCE lowering.

The TwoAddressInstructionPass takes the machine code out of SSA form by
expanding REG_SEQUENCE instructions into copies. It is no longer
necessary to rewrite the registers used by a REG_SEQUENCE instruction
because the new coalescer algorithm can do it now.

REG_SEQUENCE is just converted to a sequence of sub-register copies now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
96e6da4841368bbb3ae73736dc523c5b1d48b1c4 27-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Reduce indentation with early exit.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
0de4fd23a7da25b2cf902ed488d8c58e3e9c13e0 27-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Also make the current basic block a class member.

Don't pass it around everywhere as a function argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
002ef57e843c9ae204f37209d8378bf95f67fd95 27-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Make the Processed set a class member.

Don't pass it everywhere as an argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6db893660ff92d4433350b5c084d123a50f4f122 26-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix whitespace and function names to be coding standardy.

No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166814 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f4a5a613faa1a0eca6b884a6dfe83e8b1eb957b2 26-Oct-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove the canCombineSubRegIndices() target hook.

The new coalescer can already do all of this, so there is no need to
duplicate the efforts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
98279e8d65fe5c86d0370b3e2a62f244985bec33 18-Sep-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Stop adding <imp-def> operands when expanding REG_SEQUENCE.

These extra operands are not needed by register allocators using
VirtRegRewriter, and RAFast don't need them any longer.

By omitting the <imp-def> operands, it becomes possible for the new
register coalescer to track which lanes are valid and which are undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f363ebdb037d9071abae5ca8af7f3b3cd84327e3 05-Sep-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Search the whole instruction for tied operands.

Implicit uses can be dynamically tied to defs. This will soon be used
for predicated instructions on ARM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163177 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
43600e95ec3690b37d458a6d3d56941ad84cddcb 13-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove the TII::scheduleTwoAddrSource() hook.

It never does anything when running 'make check', and it get's in the
way of updating live intervals in 2-addr.

The hook was originally added to help form IT blocks in Thumb2 code
before register allocation, but the pass ordering has changed since
then, and we run if-conversion after register allocation now.

When the MI scheduler is enabled, there will be no less than two
schedulers between 2-addr and Thumb2ITBlockPass, so this hook is
unlikely to help anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
988069e2291f62dced081dd54da38b9683bdbdca 10-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix a future TwoAddressInstructionPass crash.

No test case, the crash only happens when the default use list order is
changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
8c5c0733cde7c941de6c9386a07a8378c5c482c5 08-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Skip tied operand pairs that already have the same register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161454 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
cf1823dc25b9687af9277b824eb7cac3931bdb5e 04-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete a dead variable.

TwoAddressInstructionPass doesn't remat any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
ae52faddebe5b780cd74d4cd66765f8ae509b656 04-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> TwoAddressInstructionPass refactoring: Extract another method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161284 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6ac8066ae49a5e9910f24e08af0b168210270946 04-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> TwoAddressInstructionPass refactoring: Extract a method.

No functional change intended, except replacing a DenseMap with a
SmallDenseMap which should behave identically.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161281 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
5bfdedf6ab4e85bc4e27fd937a74e15071cb949b 04-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Begin adding support for updating LiveIntervals in TwoAddressInstructionPass.

This is far from complete, and only changes behavior when the
-early-live-intervals flag is passed to llc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161273 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
3cd9f572eddac8aca63ee867dc225f719ff63eb2 03-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Delete dead function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161242 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
bc8d827b2b2f063f1305754bc0b629e03e00c9ce 03-Aug-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Don't delete dead code in TwoAddressInstructionPass.

This functionality was added before we started running
DeadMachineInstructionElim on all targets. It serves no purpose now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161241 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d68e8cda245269c032a692873dc8eb163fa6ef00 25-Jul-2012 Manman Ren <mren@apple.com> Disable rematerialization in TwoAddressInstructionPass.

It is redundant; RegisterCoalescer will do the remat if it can't eliminate
the copy. Collected instruction counts before and after this. A few extra
instructions are generated due to spilling but it is normal to see these kinds
of changes with almost any small codegen change, according to Jakob.

This also fixed rdar://11830760 where xor is expected instead of movi0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
32d75bec4bbbd97b70d887ed3c106951b1d18182 18-Jul-2012 Chandler Carruth <chandlerc@gmail.com> Fix a somewhat nasty crasher in PR13378. This crashes inside of
LiveIntervals due to the two-addr pass generating bogus MI code.

The crux of the issue was a loop nesting problem. The intent of the code
which attempts to transform instructions before converting them to
two-addr form is to defer and reprocess any transformed instructions as
the second processing is likely to have more opportunities to coalesce
copies, etc. Unfortunately, there was one section of processing that was
not deferred -- the INSERT_SUBREG rewriting. Due to quirks of how this
rewriting proceeded, not only did it occur early, it removed the bits of
information needed for the deferred processing to correctly generate the
necessary two address form (specifically inserting a copy), but didn't
trigger any immediate assertions and produced what appeared to be
already valid two-address from code. Thus, the assertion only fired much
later in the pipeline.

The fix is to hoist the transformation logic up layer to where it can
more firmly defer all further processing, and to teach the normal
processing to handle an edge case previously handled as part of the
transformation logic. This edge case (already matched tied register
operands) needs to *not* defer any steps.

As has been brought up repeatedly in the process: wow does this code
need refactoring. I *may* squeeze in some time to at least bring sanity
to this loop... but wow... =]

Thanks to Jakob for helpful hints on the way here, and the review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
a532bcec2f8b766ec2b623c715fab662e2d2e31d 17-Jul-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add some trace output to TwoAddressInstructionPass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
7d532c8d0742ebd107e5fd58ae23ecea5c55d19e 15-Jul-2012 Chandler Carruth <chandlerc@gmail.com> Reapply r160194, switching to use LV information for finding local kills.

The notable fix is to look at any dependencies attached to the kill
instruction (or other instructions between MI nad the kill) where the
dependencies are specific to the register in question.

The old code implicitly handled this by rejecting the transform if *any*
other uses were found within the block, but after the start point. The
new code directly finds the kill, and has to re-use the existing
dependency scan to check for non-kill uses.

This was caught by self-host, but I found the bug via inspection and use
of absurd assert scaffolding to compute the kills in two ways and
compare them. So I have no useful testcase for this other than
"bootstrap". I'd work harder to reduce a test case if this particular
code were likely to live for a long time.

Thanks to Benjamin Kramer for reviewing the fix itself.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
cb41e5f6f28da51e37eb072e4bf69143fe29dacc 14-Jul-2012 Chandler Carruth <chandlerc@gmail.com> Revert r160194, which switched to use LV information for finding local
kills.

This is causing miscompiles that I'm working on tracking down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
558341590938dec2bf0eb1679b7a990afa61d676 13-Jul-2012 Chandler Carruth <chandlerc@gmail.com> Use the LiveVariables information to efficiently get local kills. This
removes the largest scaling problem in the test cases from PR13225 when
ASan is switched to insert basic blocks in the natural CFG order.

It may also solve some scaling problems for more normal code with large
numbers of basic blocks and variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
5f917cd3fada4507c0f4b718dd6af24b5e7086f1 02-Jul-2012 Manman Ren <mren@apple.com> Added assertion in getVRegDef of MachineRegisterInfo to make sure the virtual
register does not have multiple definitions. Modified TwoAddressInstructionPass
to use getUniqueVRegDef instead of getVRegDef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159545 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
351c8818f2ff89d567094f46c3e220d6501ec3fa 25-Jun-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Handle <undef> operands in TwoAddressInstructionPass.

When the source register to a 2-addr instruction is undefined, there is
no need to attempt any transformations - simply replace the source
register with the destination register.

This also comes up when lowering IMPLICIT_DEF instructions - make sure
the <undef> flag is moved to the new partial register def operand:

%vreg8<def> = INSERT_SUBREG %vreg9<undef>, %vreg0<kill>, sub_16bit
rewrite undef:
%vreg8<def> = INSERT_SUBREG %vreg8<undef>, %vreg0<kill>, sub_16bit
convert to:
%vreg8:sub_16bit<def,read-undef> = COPY %vreg0<kill>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159120 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
b7e0289fb320c8440ba5eed121a8b932dbd806a2 05-Jun-2012 Andrew Trick <atrick@apple.com> misched: API for minimum vs. expected latency.

Minimum latency determines per-cycle scheduling groups.
Expected latency determines critical path and cost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
8e86929e3ce3fe56295d2704b93bf14c709b311a 20-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Properly constrain register classes in 2-addr.

X86 has 2-addr instructions with different constraints on the tied def
and use operands. One is GR32, one is GR32_NOSP.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
ad753648155590f1c70bd168e8cf11a414957387 18-May-2012 Evan Cheng <evan.cheng@apple.com> Teach two-address pass to update the "source" map so it doesn't perform a
non-profitable commute using outdated info. The test case would still fail
because of poor pre-RA schedule. That will be fixed by MI scheduler.

rdar://11472010


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157038 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
397fc4874efe9c17e737d4c5c50bd19dc3bf27f5 08-May-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Add an MF argument to TRI::getPointerRegClass() and TII::getRegClass().

The getPointerRegClass() hook can return register classes that depend on
the calling convention of the current function (ptr_rc_tailcall).

So far, we have been able to infer the calling convention from the
subtarget alone, but as we add support for multiple calling conventions
per target, that no longer works.

Patch by Yiannis Tsiouris!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156328 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d99d68bcee8ce91a18c397756c702363e030fd83 03-May-2012 Evan Cheng <evan.cheng@apple.com> Fix two-address pass's aggressive instruction commuting heuristics. It's meant
to catch cases like:
%reg1024<def> = MOV r1
%reg1025<def> = MOV r0
%reg1026<def> = ADD %reg1024, %reg1025
r0 = MOV %reg1026

By commuting ADD, it let coalescer eliminate all of the copies. However, there
was a bug in the heuristics where it ended up commuting the ADD in:

%reg1024<def> = MOV r0
%reg1025<def> = MOV 0
%reg1026<def> = ADD %reg1024, %reg1025
r0 = MOV %reg1026

That did no benefit but rather ensure the last MOV would not be coalesced.

rdar://11355268


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156048 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f12f6dff9784805e8f89309787231c1ec53a8c6e 03-May-2012 Andrew Trick <atrick@apple.com> Added TargetRegisterInfo::getAllocatableClass.

The ensures that virtual registers always belong to an allocatable class.
If your target attempts to create a vreg for an operand that has no
allocatable register subclass, you will crash quickly.

This ensures that targets define register classes as intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156046 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f31ceaf8b7b1c5092fe35e20732711f5e1074118 09-Apr-2012 Lang Hames <lhames@gmail.com> Patch r153892 for PR11861 apparently broke an external project (see PR12493).

This patch restores TwoAddressInstructionPass's pre-r153892 behaviour when
rescheduling instructions in TryInstructionTransform. Hopefully this will fix
PR12493. To refix PR11861, lowering of INSERT_SUBREGS is deferred until after
the copy that unties the operands is emitted (this seems to be a more
appropriate fix for that issue anyway).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154338 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
ef74ca6a41c899273c5df5af1ba1ad6c9bb7da97 04-Apr-2012 Pete Cooper <peter_cooper@apple.com> REG_SEQUENCE expansion to COPY instructions wasn't taking account of sub register indices on the source registers. No simple test case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
1487cb3a5a0535b343e602e976af538fd87d0df2 04-Apr-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Remove spurious debug output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
be9fe49b179a89a659fe786d64b176d2b360bb4a 02-Apr-2012 Lang Hames <lhames@gmail.com> During two-address lowering, rescheduling an instruction does not untie
operands. Make TryInstructionTransform return false to reflect this.
Fixes PR11861.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
8247e0dca6759d9a22ac4c5cf305fac052b285ac 03-Feb-2012 Andrew Trick <atrick@apple.com> whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d36f5af224594719a10d8b190daf4b56cdb7377f 25-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Set correct <def,undef> flags when lowering REG_SEQUENCE.

A REG_SEQUENCE instruction is lowered into a sequence of partial defs:

%vreg7:ssub_0<def,undef> = COPY %vreg20:ssub_0
%vreg7:ssub_1<def> = COPY %vreg2
%vreg7:ssub_2<def> = COPY %vreg2
%vreg7:ssub_3<def> = COPY %vreg2

The first def needs an <undef> flag to indicate it is the beginning of
the live range, while the other defs are read-modify-write. Previously,
we depended on LiveIntervalAnalysis to notice and fix the missing
<def,undef>, but that solution was never robust, it was causing problems
with ProcessImplicitDefs and the lowering of chained REG_SEQUENCE
instructions.

This fixes PR11841.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
defe12df51249200214b7781ebe23345df474655 24-Jan-2012 Jakob Stoklund Olesen <stoklund@2pi.dk> Preserve <def,undef> flags in CoalesceExtSubRegs.

This won't have an effect until EliminateRegSequences() starts setting
the undef flags.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
cd7f02bb43ec07e0a2bd6d90177b353c94408586 18-Jan-2012 Pete Cooper <peter_cooper@apple.com> Fix ISD::REG_SEQUENCE to accept physical registers and change TwoAddressInstructionPass to insert copies for any physical reg operands of the REG_SEQUENCE

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
5a96b3dad2f634c9081c8b2b6c2575441dc5a2bd 07-Dec-2011 Evan Cheng <evan.cheng@apple.com> Add bundle aware API for querying instruction properties and switch the code
generator to it. For non-bundle instructions, these behave exactly the same
as the MC layer API.

For properties like mayLoad / mayStore, look into the bundle and if any of the
bundled instructions has the property it would return true.
For properties like isPredicable, only return true if *all* of the bundled
instructions have the property.
For properties like canFoldAsLoad, isCompare, conservatively return false for
bundles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146026 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
a86bfc1071f7e05631e0af81e2c6249f552c9ec5 03-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com> Simplify code. No functionality change.

-3% on ARMDissasembler.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145773 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
c3aa7c5c5aa1e06aa8a728149c6696401bd08faa 16-Nov-2011 Evan Cheng <evan.cheng@apple.com> Disable expensive two-address optimizations at -O0. rdar://10453055

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
14117c44770c32b56de143a0eff8c2d0fd694e0d 16-Nov-2011 Evan Cheng <evan.cheng@apple.com> Disable the assertion again. Looks like fastisel is still generating bad kill markers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144804 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
0a405ae78a244ba55dfafdcac16585c262269e21 16-Nov-2011 Evan Cheng <evan.cheng@apple.com> Revert r144568 now that r144730 has fixed the fast-isel kill marker bug.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144776 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
9bad88a9def4abaa87e7e5e7178bd680354043f8 16-Nov-2011 Evan Cheng <evan.cheng@apple.com> If the 2addr instruction has other kills, don't move it below any other uses since we don't want to extend other live ranges.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
2bee6a8bb74724263eadd550ee76417d6e6465a9 16-Nov-2011 Evan Cheng <evan.cheng@apple.com> RescheduleKillAboveMI() must backtrack to before the rescheduled DBG_VALUE instructions. rdar://10451185

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
ae7db7af44c9155092d4b80cb4d5d333469f4320 16-Nov-2011 Evan Cheng <evan.cheng@apple.com> Process all uses first before defs to accurately capture register liveness. rdar://10449480

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f178418729d91e2f15a8eb27c0e4787b8ec7a3ce 15-Nov-2011 Evan Cheng <evan.cheng@apple.com> Set SeenStore to true to prevent loads from being moved; also eliminates a non-deterministic behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
8aee7d8f9eab71a29f8f3a5a541144bef4fb5ac4 14-Nov-2011 Evan Cheng <evan.cheng@apple.com> Avoid dereferencing off the beginning of lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144569 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
41e00172c51a1666cbcda5df2c6f45d685068fbb 14-Nov-2011 Evan Cheng <evan.cheng@apple.com> At -O0, multiple uses of a virtual registers in the same BB are being marked
"kill". This looks like a bug upstream. Since that's going to take some time
to understand, loosen the assertion and disable the optimization when
multiple kills are seen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
2a4410df44cd710e20b3f12873c35405830d66fb 14-Nov-2011 Evan Cheng <evan.cheng@apple.com> Teach two-address pass to re-schedule two-address instructions (or the kill
instructions of the two-address operands) in order to avoid inserting copies.
This fixes the few regressions introduced when the two-address hack was
disabled (without regressing the improvements).
rdar://10422688


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
bde81d5be9bdc3837c77f8f3c63c013b6e4bbc8d 24-Sep-2011 Eli Friedman <eli.friedman@gmail.com> PR10998: It is not legal to sink an instruction past the terminator of a block; make sure we don't do that.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
e837dead3c8dc3445ef6a0e2322179c57e264a13 28-Jun-2011 Evan Cheng <evan.cheng@apple.com> - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo and
sink them into MC layer.
- Added MCInstrInfo, which captures the tablegen generated static data. Chang
TargetInstrInfo so it's based off MCInstrInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
4e39f8facb710ee204ecbda2a936a388449a434d 18-Jun-2011 Benjamin Kramer <benny.kra@googlemail.com> Simplify code. No change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133350 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
aaa5f14d7c8cf0757e062046e8a3780ef80ebb10 08-Jun-2011 Cameron Zwarich <zwarich@apple.com> Fix an issue where the two-address conversion pass incorrectly rewrites untied
operands to an early clobber register. This fixes <rdar://problem/9566076>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f06e6c2ba717429936908254d53fa579bc941388 02-Mar-2011 Evan Cheng <evan.cheng@apple.com> Catch more cases where 2-address pass should 3-addressify instructions. rdar://9002648.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126811 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
4d96c638af0458f4de637998da942a5e166d6ea5 10-Feb-2011 Evan Cheng <evan.cheng@apple.com> After 3-addressifying a two-address instruction, update the register maps; add a missing check when considering whether it's profitable to commute. rdar://8977508.

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

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

No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123155 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
00f93fc0467e89d5e63b8ebd9a18909a3b031ccc 09-Jan-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> Shrink a BitVector that didn't mean to store bits for all physical registers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
c36b7069b42bece963b7e6adf020353ce990ef76 08-Jan-2011 Evan Cheng <evan.cheng@apple.com> Do not model all INLINEASM instructions as having unmodelled side effects.
Instead encode llvm IR level property "HasSideEffects" in an operand (shared
with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check
the operand when the instruction is an INLINEASM.

This allows memory instructions to be moved around INLINEASM instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
c44270dd6f53e6db36a2614a57a23c9c6fe3137b 19-Dec-2010 Cameron Zwarich <zwarich@apple.com> StrongPHIElimination will never run before TwoAddressInstructionPass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d959da92a5a479c7f8f4ccbf7a7e3fb87f9fda0c 19-Dec-2010 Cameron Zwarich <zwarich@apple.com> Remove some checks for StrongPHIElim. These checks make it impossible to use an
alternative register allocator that does not require LiveIntervals by specifying
it on the command-line for a target that has StrongPHIElimination enabled by
default.

These checks are pretty meaningless anyways, since StrongPHIElimination and
PHIElimination are never used at the same time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
495de3b783c239b4b3244a1e739b2a5b82561b1b 17-Dec-2010 Bob Wilson <bob.wilson@apple.com> Fix crash compiling a QQQQ REG_SEQUENCE for a Neon vld3_lane operation.
Radar 8776599

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122018 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
bbc726d6240f1d8480b312832eba5f7dd914fa4d 14-Dec-2010 Evan Cheng <evan.cheng@apple.com> Fix a minor bug in two-address pass. It was missing a commute opportunity.
regB = move RCX
regA = op regB, regC
RAX = move regA
where both regB and regC are killed. If regB is constrainted to non-compatible
physical registers but regC is not constrainted at all, then it's better to
commute the instruction.
movl %edi, %eax
shlq $32, %rcx
leaq (%rcx,%rax), %rax
=>
movl %edi, %eax
shlq $32, %rcx
orq %rcx, %rax
rdar://8762995


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6abfa46987e4cb47e2d88ea02574c2c082b0625d 21-Oct-2010 Duncan Sands <baldrick@free.fr> Remove some variables that are never really used
(gcc-4.6 warns about these).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
081c34b725980f995be9080eaec24cd3dfaaf065 19-Oct-2010 Owen Anderson <resistor@mac.com> Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
e4b9c4f1871c5f17681fdf143104c6834055b25b 09-Aug-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> A REG_SEQUENCE instruction may use the same register twice.

If we are emitting COPY instructions for the REG_SEQUENCE, make sure the kill
flag goes on the last COPY. Otherwise we may be using a killed register.

<rdar://problem/8287792>

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

TII::isMoveInstr is going tobe completely removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108507 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
1e1098c6f39590e1e74e5cb3c2a1652d8f3cb16a 11-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Replace copyRegToReg with COPY everywhere in lib/CodeGen except for FastISel.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
c0075cce7cf6682af8a09126709106866b2f5971 11-Jul-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Only collect subreg extracting copies for later coalescing.
This also avoids fatal copies from physregs.

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

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

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

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

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

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

Buildbot breakage.

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

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

INSERT_SUBREG will now only appear in SSA machine instructions.

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

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107547 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
98ec91ea80e042907aac8d3cbd9614d29f6cba45 02-Jul-2010 Evan Cheng <evan.cheng@apple.com> - Two-address pass should not assume unfolding is always successful.
- X86 unfolding should check if the instructions being unfolded has memoperands.
If there is no memoperands, then it must assume conservative alignment. If this
would introduce an expensive sse unaligned load / store, then unfoldMemoryOperand
etc. should not unfold the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107509 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
cc1ca987f35581357f88d6071330e89fc8de2aa1 22-Jun-2010 Dan Gohman <gohman@apple.com> When unfolding a load, avoid assuming which instruction that
kill and dead flags will end up on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
7aa7bc735dfca40a20e74ad63a2c27f744699e01 22-Jun-2010 Dan Gohman <gohman@apple.com> Fix the new load-unfolding code to update LiveVariable's dead flags,
in addition to the kill flags.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
584fedf188e863604f7b946a931c0f40cf9c944e 22-Jun-2010 Dan Gohman <gohman@apple.com> Teach two-address lowering how to unfold a load to open up commuting
opportunities. For example, this lets it emit this:

movq (%rax), %rcx
addq %rdx, %rcx

instead of this:

movq %rdx, %rcx
addq (%rax), %rcx

in the case where %rdx has subsequent uses. It's the same number
of instructions, and usually the same encoding size on x86, but
it appears faster, and in general, it may allow better scheduling
for the load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106493 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
fe181f4848a8c774155b8d853c2f53f7e7679872 19-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Only run CoalesceExtSubRegs when we can expect LiveIntervalAnalysis to clean up
the inserted INSERT_SUBREGs after us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106345 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
4ffd22d8103aa374dc9573012993139948165577 15-Jun-2010 Bob Wilson <bob.wilson@apple.com> Add some missing checks for the case where the extract_subregs are
combined to an insert_subreg, i.e., where the destination register is larger
than the source. We need to check that the subregs can be composed for that
case in a symmetrical way to the case when the destination is smaller.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106004 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
852a7e362e3c539f1fe23307e946eae9ca18ae14 15-Jun-2010 Bob Wilson <bob.wilson@apple.com> Generalize the pre-coalescing of extract_subregs feeding reg_sequences,
replacing the overly conservative checks that I had introduced recently to
deal with correctness issues. This makes a pretty noticable difference
in our testcases where reg_sequences are used. I've updated one test to
check that we no longer emit the unnecessary subreg moves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105991 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
68fc2daf8fa446be04d2ed2b3cbb1b00c382458f 09-Jun-2010 Evan Cheng <evan.cheng@apple.com> Allow target to place 2-address pass inserted copies in better spots. Thumb2 will use this to try to avoid breaking up IT blocks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
66dc4e2acdc96990e73cfc1b8d0c2d5fa9619ae5 08-Jun-2010 Bob Wilson <bob.wilson@apple.com> Fix a mistake in my previous change r105437: don't access operand 2 and assume
that it is an immediate before checking that the instruction is an
EXTRACT_SUBREG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105585 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
26bf8f9a1b6b7f9ce198c319dc650ad3073b05f8 04-Jun-2010 Bob Wilson <bob.wilson@apple.com> Add some missing checks in TwoAddressInstructionPass::CoalesceExtSubRegs.
Check that all the instructions are in the same basic block, that the
EXTRACT_SUBREGs write to the same subregs that are being extracted, and that
the source and destination registers are in the same regclass. Some of
these constraints can be relaxed with a bit more work. Jakob suggested
that the loop that checks for subregs when NewSubIdx != 0 should use the
"nodbg" iterator, so I made that change here, too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105437 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
9edf7deb37f0f97664f279040fa15d89f32e23d9 03-Jun-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Slightly change the meaning of the reMaterialize target hook when the original
instruction defines subregisters.

Any existing subreg indices on the original instruction are preserved or
composed with the new subreg index.

Also substitute multiple operands mentioning the original register by using the
new MachineInstr::substituteRegister() function. This is necessary because there
will soon be <imp-def> operands added to non read-modify-write partial
definitions. This instruction:

%reg1234:foo = FLAP %reg1234<imp-def>

will reMaterialize(%reg3333, bar) like this:

%reg3333:bar-foo = FLAP %reg333:bar<imp-def>

Finally, replace the TargetRegisterInfo pointer argument with a reference to
indicate that it cannot be NULL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105358 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
91a74da036d3a9442953ae1de3e797a50da4ccf0 02-Jun-2010 Bob Wilson <bob.wilson@apple.com> Rename canCombinedSubRegIndex method to something more grammatically correct
and tidy up the comment describing it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105339 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
b2c2a972b075542ab5a02c554ec4a5cc0bcb95a0 02-Jun-2010 Bob Wilson <bob.wilson@apple.com> Fix an obvious mistake: don't change the operands until all of them have been
checked and it is safe to proceed with the changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
5a0d4fcb8d0e624cf9452659f83e20f7e9e3444d 29-May-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Handle composed subreg indices when processing REQ_SEQUENCE instructions.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104377 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
343735288798bbd1cd2ed2750fa6cd323f12c26c 19-May-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> TwoAddressInstructionPass doesn't really know how to merge live intervals when
lowering REG_SEQUENCE instructions.

Insert copies for REG_SEQUENCE sources not killed to avoid breaking later passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
c6dcce3ba5bd22325ecf1dbdfddf8136b50d4838 18-May-2010 Evan Cheng <evan.cheng@apple.com> Fix PR7175. Insert copies of a REG_SEQUENCE source if it is used by other REG_SEQUENCE instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103994 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
44bfdd3d78d32bb8fcd5ad123199246e554306d8 18-May-2010 Evan Cheng <evan.cheng@apple.com> Fix PR7156. If the sources of a REG_SEQUENCE are all IMPLICIT_DEF's. Replace it with an IMPLICIT_DEF rather than deleting it or else it would be left without a def.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
53c779bb3a5712b67cf6bae785cb83a90841d17e 17-May-2010 Evan Cheng <evan.cheng@apple.com> Careful with reg_sequence coalescing to not to overwrite sub-register indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103971 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
b990a2f249196ad3e0cc451d40a45fc2f9278eaf 15-May-2010 Evan Cheng <evan.cheng@apple.com> Teach two-address pass to do some coalescing while eliminating REG_SEQUENCE
instructions.

e.g.
%reg1026<def> = VLDMQ %reg1025<kill>, 260, pred:14, pred:%reg0
%reg1027<def> = EXTRACT_SUBREG %reg1026, 6
%reg1028<def> = EXTRACT_SUBREG %reg1026<kill>, 5
...
%reg1029<def> = REG_SEQUENCE %reg1028<kill>, 5, %reg1027<kill>, 6, %reg1028, 7, %reg1027, 8, %reg1028, 9, %reg1027, 10, %reg1030<kill>, 11, %reg1032<kill>, 12

After REG_SEQUENCE is eliminated, we are left with:

%reg1026<def> = VLDMQ %reg1025<kill>, 260, pred:14, pred:%reg0
%reg1029:6<def> = EXTRACT_SUBREG %reg1026, 6
%reg1029:5<def> = EXTRACT_SUBREG %reg1026<kill>, 5

The regular coalescer will not be able to coalesce reg1026 and reg1029 because it doesn't
know how to combine sub-register indices 5 and 6. Now 2-address pass will consult the
target whether sub-registers 5 and 6 of reg1026 can be combined to into a larger
sub-register (or combined to be reg1026 itself as is the case here). If it is possible,
it will be able to replace references of reg1026 with reg1029 + the larger sub-register
index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
054dbb8e8230ae1a7f1f386b6bf307a36af7dd20 13-May-2010 Evan Cheng <evan.cheng@apple.com> If REG_SEQUENCE source is livein, copy it first. Also, update livevariables information when a copy is introduced.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
3ae56bcd8ab0b9cba006f772a623b81d4c7bfd7f 12-May-2010 Evan Cheng <evan.cheng@apple.com> Code clean up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
0bcccac50481921ab86dfdbaadec79f1db35c662 11-May-2010 Evan Cheng <evan.cheng@apple.com> Ensure REG_SEQUENCE source operands are unique.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103449 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
fc6e6a9b3b2b2de7bee47d9dcbdfdc72ca7f5238 10-May-2010 Evan Cheng <evan.cheng@apple.com> Clear RegSequences vector after eliminating REG_SEQUENCE instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
f1250eeadf39ed34c852d43de6c6780d5d5176dc 23-Mar-2010 Evan Cheng <evan.cheng@apple.com> Ignore dbg_value's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
1423c70b8f1b1a757c640fac9a17cb015012e8e9 03-Mar-2010 Evan Cheng <evan.cheng@apple.com> Add MachineRegisterInfo::hasOneUse and hasOneNonDBGUse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
ac1abde05b7e6956c01deb6557539bee8fea30f4 02-Mar-2010 Evan Cheng <evan.cheng@apple.com> Swap parameters of isSafeToMove and isSafeToReMat for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
3bfef03eb6eb6b1b8fe85ba1029ef709aaafe8af 11-Feb-2010 Dale Johannesen <dalej@apple.com> Don't allow DBG_VALUE to affect codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
b8ff934e94637462901ebd1c849aeaf71350dacc 10-Feb-2010 Dale Johannesen <dalej@apple.com> Skip debug info in a couple of places.



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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92565 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
0b25ae1afb9444f91f728c853c70dd27df43776a 18-Nov-2009 Jakob Stoklund Olesen <stoklund@2pi.dk> Fix PR5300.

When TwoAddressInstructionPass deletes a dead instruction, make sure that all
register kills are accounted for. The 2-addr register does not get special
treatment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89246 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d57cdd5683ea926e489067364fb7ffe5fd5d35ee 14-Nov-2009 Evan Cheng <evan.cheng@apple.com> - Change TargetInstrInfo::reMaterialize to pass in TargetRegisterInfo.
- If destination is a physical register and it has a subreg index, use the
sub-register instead.
This fixes PR5423.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f5a86f45e75ec744c203270ffa03659eb0a220c1 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6726b6d75a8b679068a58cb954ba97cf9d1690ba 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
cc80df92c18c125ab31a273f1490ab99eb25f0d1 03-Sep-2009 Bob Wilson <bob.wilson@apple.com> Overhaul the TwoAddressInstructionPass to simplify the logic, especially
for the complicated case where one register is tied to multiple destinations.
This avoids the extra scan of instruction operands that was introduced by
my recent change. I also pulled some code out into a separate
TryInstructionTransform method, added more comments, and renamed some
variables.

Besides all those changes, this takes care of a FIXME in the code regarding
an assumption about there being a single tied use of a register when
converting to a 3-address form. I'm not aware of cases where that assumption
is violated, but the code now only attempts to transform an instruction,
either by commuting its operands or by converting to a 3-address form,
for the simple case where there is a single pair of tied operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d163917fd834376aee17d5c37f6d47cafed09087 02-Sep-2009 Bob Wilson <bob.wilson@apple.com> Rearrange code to eliminate redundancy and avoid gotos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
86f7cd786eecc74e0480c0f8ab6a4234bb72bfbb 02-Sep-2009 Bob Wilson <bob.wilson@apple.com> Avoid calling removeVirtualRegisterKilled which iterates over the operands
to find the kill, since we already have the operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80736 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
326f43812ca28b2b4bb5eb8e5191deab6ba621f3 02-Sep-2009 Bob Wilson <bob.wilson@apple.com> Refactor some code into separate functions. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
c08f5fe882d6d2f2f94606b4f4ea8a1209cb1e24 02-Sep-2009 Bob Wilson <bob.wilson@apple.com> Move use of LV inside condition that guards for null LV.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
71124f698befddb89309758f4aa171e11b9beff3 01-Sep-2009 Bob Wilson <bob.wilson@apple.com> Fix pr4843: When an instruction has multiple destination registers that are
tied to different source registers, the TwoAddressInstructionPass needs to
be smarter. Change it to check before replacing a source register whether
that source register is tied to a different destination register, and if so,
defer handling it until a subsequent iteration.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
4344979ba9de3564d5f59f7947a6aec421d79288 31-Aug-2009 Bob Wilson <bob.wilson@apple.com> Use early exit and reduce indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d4034b2825a2a030893593327d67ca12b4e8a249 31-Aug-2009 Bob Wilson <bob.wilson@apple.com> If the tied registers are already the same, there is no need to change
them. Move the code to make that change inside the conditional.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80630 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6456d3868d63a093b70ad522951f94b138389690 23-Aug-2009 Chris Lattner <sabre@nondot.org> remove some DOUTs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
3a3cce59c428619513b5209d62f9398b84743cdb 07-Aug-2009 Evan Cheng <evan.cheng@apple.com> Code clean up.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
33d0474bf5d5783cf9690bcab3eabd513d918fc5 20-Jul-2009 Evan Cheng <evan.cheng@apple.com> Use TII->findCommutedOpIndices to find the commute operands (rather than guessing).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75900 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
ebfc177b59c0bda0c2cb54f3f64dce7ee0fa4df2 11-Jul-2009 Evan Cheng <evan.cheng@apple.com> Two-address pass should use findCommutedOpIndices to determine what registers are commuted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
a7c9deaa2b1df30808db376bdfcba7f2e54e59d1 14-May-2009 Lang Hames <lhames@gmail.com> Fix for PR4124. Make TwoAddressFormPass::FindLastUseInMBB return the real last use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71769 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
60dc7345eb1543546064a35c7c2c4ea08b40f9c0 13-May-2009 Lang Hames <lhames@gmail.com> Fix for PR4121. If TwoAddressInstructionPass removes a dead def, and the regB
operand was killed, the kill needs to be removed from regB's VarInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
1e8f072f1948de43a0c1c71e00e83e7bb192d7cb 09-May-2009 Mike Stump <mrs@apple.com> Avoid warning in release-asserts build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71275 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
e9ccb3a7d43009de0b40b445db71d53177d88ff2 28-Apr-2009 Evan Cheng <evan.cheng@apple.com> Fix for PR4051. When 2address pass delete an instruction, update kill info when necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
87d696a4d2f0b43a0e927bffb13ceb4c67cc0f3b 14-Apr-2009 Evan Cheng <evan.cheng@apple.com> Fix PR3934 part 2. findOnlyInterestingUse() was not setting IsCopy and IsDstPhys which are returned by value and used by callee. This happened to work on the earlier test cases because of a logic error in the caller side.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
3005ed604835834534b61ea4a8f8be29f6868627 13-Apr-2009 Evan Cheng <evan.cheng@apple.com> PR3934: Fix a bogus two-address pass assertion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6ed0e20eb2dee4b08d33917ba569ad448aa0f047 13-Apr-2009 Dan Gohman <gohman@apple.com> Add an assertion to verify that a copy was actually emitted.


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

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

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

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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
e6f350d7558f2db6c39c0a9fc8beafb796d9919a 30-Mar-2009 Evan Cheng <evan.cheng@apple.com> Turn a 2-address instruction into a 3-address one when it's profitable even if the two-address operand is killed.
e.g.
%reg1024<def> = MOV r1
%reg1025<def> = ADD %reg1024, %reg1026
r0 = MOV %reg1025

If it's not possible / profitable to commute ADD, then turning ADD into a LEA saves a copy.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67335 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
870b80722f7ce3232dd45e95cff663d177e0acc0 01-Mar-2009 Evan Cheng <evan.cheng@apple.com> Minor optimization:

Look for situations like this:
%reg1024<def> = MOV r1
%reg1025<def> = MOV r0
%reg1026<def> = ADD %reg1024, %reg1025
r0 = MOV %reg1026
Commute the ADD to hopefully eliminate an otherwise unavoidable copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65752 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
28c7ce3fd44143b595f05436edbaebea9e5d47c3 21-Feb-2009 Evan Cheng <evan.cheng@apple.com> If two-address def is dead and the instruction does not define other registers, and it doesn't produce side effects, just delete the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65218 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
d498c8f2c8eb5598bf2e0c3ab30016734e490c6b 25-Jan-2009 Evan Cheng <evan.cheng@apple.com> Teach 2addr pass to be do more commuting. If both uses of a two-address instruction are killed, but the first operand has a use before and after the def, commute if the second operand does not suffer from the same issue.
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1
%reg1029<def> = MOV8rr %reg1028
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>
insert => %reg1030<def> = MOV8rr %reg1028
%reg1030<def> = ADD8rr %reg1028<kill>, %reg1029<kill>, %EFLAGS<imp-def,dead>

In this case, it might not be possible to coalesce the second MOV8rr
instruction if the first one is coalesced. So it would be profitable to
commute it:
%reg1028<def> = EXTRACT_SUBREG %reg1027<kill>, 1
%reg1029<def> = MOV8rr %reg1028
%reg1029<def> = SHR8ri %reg1029, 7, %EFLAGS<imp-def,dead>
insert => %reg1030<def> = MOV8rr %reg1029
%reg1030<def> = ADD8rr %reg1029<kill>, %reg1028<kill>, %EFLAGS<imp-def,dead>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62954 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
8191371f87495dea2abd733bf63224b6209fdb12 24-Jan-2009 Evan Cheng <evan.cheng@apple.com> Refactor code. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
d68a07650cdb2e18f18f362ba533459aa10e01b6 05-Jan-2009 Dan Gohman <gohman@apple.com> Tidy up #includes, deleting a bunch of unnecessary #includes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
2d9716f7bfb701d4606a993765ea233116fe3a68 12-Nov-2008 Dan Gohman <gohman@apple.com> Do the LiveVariables update before printing the instruction in
the debug output, so that the updated liveness flags are
reflected in the debug output.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
8763c1c54413c9cd0b56e2860edb5856151a69fc 27-Aug-2008 Evan Cheng <evan.cheng@apple.com> Move the check whether it's worth remating to caller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
df3b99381f1c211071cc1daf0cc297666877bbcb 27-Aug-2008 Evan Cheng <evan.cheng@apple.com> Refactor isSafeToReMat out of 2addr pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55430 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
be04dc1413bdab0c8687a8086792af6cfd7540c0 03-Jul-2008 Evan Cheng <evan.cheng@apple.com> - Add LiveVariables::replaceKillInstruction. This does a subset of instructionChanged. That is, it only update the VarInfo.kills if the new instruction is known to have the correct dead and kill markers.
- CommuteInstruction copies kill / dead markers over to new instruction. So use replaceKillInstruction instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53061 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f660c171c838793b87b7e58e91609cecf256378d 03-Jul-2008 Owen Anderson <resistor@mac.com> Make LiveVariables even more optional, by making it optional in the call to TargetInstrInfo::convertToThreeAddressInstruction
Also, if LV isn't around, then TwoAddr doesn't need to be updating flags, since they won't have been set in the first place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
802af11460f090fe53710c44c061a70e5bd7aa2d 02-Jul-2008 Owen Anderson <resistor@mac.com> TwoAddressInstructionPass doesn't really require LiveVariables, it just needs to update it if it's already around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
fdb99838a30eba6ee4e7ae8c8077b4f8d62cf560 30-Jun-2008 Evan Cheng <evan.cheng@apple.com> Remove unneeded include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
601ca4b434f5c67503a30575cc36b688b0d959e6 25-Jun-2008 Evan Cheng <evan.cheng@apple.com> Enable two-address remat by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
32a3ac79116ce93471cd18ede24452c6af5b290b 19-Jun-2008 Evan Cheng <evan.cheng@apple.com> Missed a check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
7543e58a779b1bafc730cec0a9a26b896bd1f71a 18-Jun-2008 Evan Cheng <evan.cheng@apple.com> Complete support for two-address pass rematerialization. Now *almost* always a win.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52452 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
bd0879d7d9790e4bfa4bdcefd3abda0301e37bae 29-May-2008 Bill Wendling <isanbard@gmail.com> Implement "AsCheapAsAMove" for some obviously cheap instructions: xor and the
like.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
a8db14796b22ba7798ef94fc831d56c8a11d4e2a 29-May-2008 Bill Wendling <isanbard@gmail.com> Check the "isSafeToMove" predicate, which has a series of tests to make sure
that it's safe to remat an instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51659 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
b0f65e1348cda5b03c5def307c1dc657c6080233 27-May-2008 Bill Wendling <isanbard@gmail.com> Incorporated feedback: Check that the implicitly defined operands aren't used
before deleting the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
a16157a41098795d5045b197691ef997535ae169 26-May-2008 Bill Wendling <isanbard@gmail.com> The enabling of remat in 2-address conversion breaks this test:

Running /Users/void/llvm/llvm.src/test/CodeGen/X86/dg.exp ...
FAIL: /Users/void/llvm/llvm.src/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll
Failed with exit(1) at line 1
while running: llvm-as < /Users/void/llvm/llvm.src/test/CodeGen/X86/2007-11-30-LoadFolding-Bug.ll | llc -march=x86 -mattr=+sse2 -stats |& grep {1 .*folded into instructions}
child process exited abnormally

Make this conditional for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51563 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
48f7f237ea5224c44e9c2782836fb7b60d8b5db1 26-May-2008 Bill Wendling <isanbard@gmail.com> A problem that's exposed when machine LICM is enabled. Consider this code:

LBB1_3: # bb
...
xorl %ebp, %ebp
subl (%ebx), %ebp
...
incl %ecx
cmpl %edi, %ecx
jl LBB1_3 # bb

Whe using machine LICM, LLVM converts it into:

xorl %esi, %esi
LBB1_3: # bb
...
movl %esi, %ebp
subl (%ebx), %ebp
...
incl %ecx
cmpl %edi, %ecx
jl LBB1_3 # bb

Two address conversion inserts the copy instruction. However, it's cheaper to
rematerialize it, and remat helps reduce register pressure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51562 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
637980edcee4826143100182afe87e273247f013 10-May-2008 Bill Wendling <isanbard@gmail.com> Cosmetic changes:
- Comment fixes.
- Moar whitespace.
- Made ivars "private" by default.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
7a963fa8ee2ad90ef456e36c116c046bf2ba8199 27-Mar-2008 Evan Cheng <evan.cheng@apple.com> Fix a memory bug: increment an iterator of a deleted machine instr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
a2248682ae7d18444188d54f01ea3bb9e434db6c 13-Mar-2008 Evan Cheng <evan.cheng@apple.com> Typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
0099ae2468c6c7c1e73f4df539d6e3e1ccdfafaa 13-Mar-2008 Evan Cheng <evan.cheng@apple.com> Don't try to sink 3-address instruction if convertToThreeAddress created more than one instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48336 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f3ff6992a3750293c056255b4b8a6f429f6e168e 13-Mar-2008 Evan Cheng <evan.cheng@apple.com> Remove an unused command line option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
875357d213ab1830efa1e3e9de0fcde95df7eefc 13-Mar-2008 Evan Cheng <evan.cheng@apple.com> TwoAddressInstructionPass enhancement. After it converts a two address instruction into a 3-address one, sink it past the instruction that kills the read-mod-write register if its definition is used past the kill. This reduces the number of live register by one.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
0ff23966feb90618bec4d085095ffbc28426e691 07-Jan-2008 Chris Lattner <sabre@nondot.org> Rename all the M_* flags to be namespace qualified enums, and switch
all clients over to using predicates instead of these flags directly.
These are now private values which are only to be used to statically
initialize the tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
e32d765f99f7ee0b8f50e419a2e1beb41003c99f 07-Jan-2008 Chris Lattner <sabre@nondot.org> add more and significantly better comments to the rest of the machineinstr
flags that can be set. Add predicates for the ones lacking it, and switch
some clients over to using the predicates instead of Flags directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
349c4952009525b27383e2120a6b3c998f39bd09 07-Jan-2008 Chris Lattner <sabre@nondot.org> Move a bunch more accessors from TargetInstrInfo to TargetInstrDescriptor


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

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

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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
fe0c882e5a6ddf4e3c9f771485fdaa4672759539 12-Nov-2007 Owen Anderson <resistor@mac.com> As Chris and Evan pointed out, BreakCriticalMachineEdges doesn't really need
to be a pass of its own. Instead, move it out into a helper method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
0823cea34a5e02513c513b7ba00db4fc6266c4a1 08-Nov-2007 Owen Anderson <resistor@mac.com> This preserves critical edge breaking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43911 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
7bb175b4d12e3a22a66a26f0e9ba2ebd4406acc7 23-Oct-2007 Evan Cheng <evan.cheng@apple.com> It's possible to commute instrctions with more than 3 operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43256 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
b9d5e7cdc9ce587f27e0ea9ced35db60f2601d2e 20-Oct-2007 Evan Cheng <evan.cheng@apple.com> Added missing curly braces which renders the if clause useless in debug build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
bcd2498f4f1682dbdc41452add5b9bc72cbd6b3f 07-Dec-2006 Bill Wendling <isanbard@gmail.com> Removed more <iostream> includes


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
a09362eb975730ac624c0bd210a95655ee105296 28-Nov-2006 Bill Wendling <isanbard@gmail.com> Use llvm streams instead of <iostream>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
a1fd6504aaf62b87530e8230517957bad3facc96 09-Nov-2006 Evan Cheng <evan.cheng@apple.com> Remove M_2_ADDR_FLAG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
360c2dd25a0dc7eaed3d57af47a47ac7d12a6886 02-Nov-2006 Evan Cheng <evan.cheng@apple.com> Two-address instructions no longer have to be A := A op C. Now any pair of dest / src operands can be tied together.


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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
f8c68f694c25b1ae8c0e5adb2a19432cb405d232 29-Jun-2006 Chris Lattner <sabre@nondot.org> Shave another 27K off libllvmgcc.dylib with visibility hidden


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


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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
c71d6949b91e19610f0f85f57b402b4df43019a5 19-Jan-2005 Chris Lattner <sabre@nondot.org> Use the TargetInstrInfo::commuteInstruction method to commute instructions
instead of doing it manually.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
cfa0f2edd31a32d58ffa6e5224c6f476932d82b5 02-Jan-2005 Chris Lattner <sabre@nondot.org> Make the 2-address instruction lowering pass smarter in two ways:

1. If we are two-addressing a commutable instruction and the LHS is not the
last use of the variable, see if the instruction is the last use of the
RHS. If so, commute the instruction, allowing us to avoid a
register-register copy in many cases for common instructions like ADD, OR,
AND, etc on X86.
2. If #1 doesn't hold, and if this is an instruction that also existing in
3-address form, promote the instruction to a 3-address instruction to
avoid the register-register copy. We can do this for several common
instructions in X86, including ADDrr, INC, DEC, etc.

This patch implements test/Regression/CodeGen/X86/commute-two-addr.ll,
overlap-add.ll, and overlap-shift.ll when I check in the X86 support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19245 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
078fee3f2e62d50f6c38fdb4e0f6aefaf385963d 16-Aug-2004 Chris Lattner <sabre@nondot.org> The insertion method returns void now


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
75fa4e4f99bd9c89be190e65155b0b78ad7f0106 22-Jul-2004 Misha Brukman <brukman+llvm@gmail.com> Fix indentation and wrap code at 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15107 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
199edde70774ecb69922230fcde65acc51c21d89 22-Jul-2004 Chris Lattner <sabre@nondot.org> Remove extraneous punctuation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
1e31363a9ee6b4e83703da7501fba19ca31395d7 22-Jul-2004 Chris Lattner <sabre@nondot.org> Minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
7848e68c1635ccba5a08d55314d4e5aed5ab54b9 21-Jul-2004 Brian Gaeke <gaeke@uiuc.edu> These files don't need to include <iostream> since they include "Support/Debug.h".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
b140762a45d21aaed054f15adaff0fc2274d939d 25-Jun-2004 Tanya Lattner <tonic@nondot.org> Made a fix so that you can print out MachineInstrs that belong to a MachineBasicBlock that is not yet attached to a MachineFunction. This change includes changing the third operand (TargetMachine) to a pointer for the MachineInstr::print function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14389 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
3a9986f5d8432d2c8228311cabd9768ffaa23487 18-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Beautify debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11573 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
f11800b718909a334a1130997523419ae3e0f06e 15-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> This pass should not require phi elimination or live variable
analysis. It should only preserve them and update LiveVariables if it
already ran.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.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/TwoAddressInstructionPass.cpp
5a5960978a0d64f65a54aa2d6b23f4c8a22fef62 05-Feb-2004 Tanya Lattner <tonic@nondot.org> Added missing include.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
14be64018fb38d1fa535b9cd12d11371f4eba3b5 04-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Modify the two address instruction pass to remove the duplicate
operand of the instruction and thus simplify the register allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
9fe7602862328c0081106709e0a8f03316dc845b 03-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Revert changes. Will implement this using a different set of primitives


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
eea81bafd624c36d396a08bea87bafd996e6bf43 02-Feb-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Correctly update def/use information for modified machine operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
6b5076790579476f4e4325e25332dacd8fc3d088 31-Jan-2004 Chris Lattner <sabre@nondot.org> Fix, correctly this time, the computation of the return value
Fix a spello
Tighten up the assertion checking

No functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
163c1e7a69d721e321b1d00a57f3565e30f08ec9 31-Jan-2004 Chris Lattner <sabre@nondot.org> * Fix incorrect computation of the runOnMachineFunction return value
* Turn a bunch of instance variables into automatic variables


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
bd91c1c37641fef20a467d5c85f89a99a1969979 31-Jan-2004 Chris Lattner <sabre@nondot.org> Remove unneeded #includes
Move Passes.h (which defines the interface to this file) to the top.
Move statistics to the top of the file.
Add a comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
b08bdc4a161313bb09a73e6c61f0cb0669e291c7 11-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Make LiveVariables::HandlePhysRegUse and
LiveVariables::HandlePhysRegDef private they use information that is
not in memory when LiveVariables finishes the analysis.

Also update the TwoAddressInstructionPass to not use this interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
8c2403631b9c83b6bb80ef61a7f6d5a34975e6a9 05-Jan-2004 Chris Lattner <sabre@nondot.org> fix warning


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
271bd2d7f1c8dca9906a9b9b9d3081b9040e2f48 05-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Currently we cannot handle two-address instructions of the form:
A = B op C where A == C, but this cannot really occur in practice
because of SSA form. Add an assert to check that just to be safe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
50c047d159a7f6d9a22e17178576c7ac5178356a 05-Jan-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Update description.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
4c080863de86448d905beab27686da823b6d44c1 18-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Remove TwoAddressInstruction from the public headers and add an ID
instead, since this pass doesn't expose any state to its users.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10520 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
71499ded4d76233f3b605638b539548bea8bb2f1 18-Dec-2003 Alkis Evlogimenos <alkis@evlogimenos.com> Add TwoAddressInstructionPass to handle instructions that have two or
more operands and the two first operands are constrained to be the
same. The pass takes an instruction of the form:

a = b op c

and transforms it into:

a = b
a = a op c

and also preserves live variables.


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