llvm-project/llvm/lib/CodeGen
Chris Lattner 9590870a0d 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.

llvm-svn: 19245
2005-01-02 02:34:12 +00:00
..
SelectionDAG Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
AsmPrinter.cpp Fix SingleSource/UnitTests/2004-11-28-GlobalBoolLayout.c, and hopefully 2004-11-28 17:56:47 +00:00
BranchFolding.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
IntrinsicLowering.cpp Fix #includes of i*.h => Instructions.h as per PR403. 2004-07-29 17:30:56 +00:00
LiveInterval.cpp Prevent accessing past the end of the intervals vector, this fixes 2004-12-04 01:22:09 +00:00
LiveInterval.h Fix typeo 2004-11-18 04:31:10 +00:00
LiveIntervalAnalysis.cpp For PR387:\ 2004-12-07 04:03:45 +00:00
LiveIntervalAnalysis.h For PR387:\ 2004-12-07 04:03:45 +00:00
LiveVariables.cpp Do not use variable sized arrays in C++, they are non-portable. Patch 2004-10-25 18:44:14 +00:00
MachineBasicBlock.cpp Move method bodies that depend on <algorithm> from MBB.h to MBB.cpp 2004-10-26 15:43:42 +00:00
MachineCodeEmitter.cpp Fix the FIXME, nuke the JIT specific forceCompilationOf method. 2004-11-22 21:54:35 +00:00
MachineFunction.cpp Indent to 2 spaces and cleanup excess whitespace. 2004-09-05 18:41:35 +00:00
MachineInstr.cpp Allow machine operands to represent global variables with offsets. This is 2004-10-15 04:38:41 +00:00
Makefile Change Library Names Not To Conflict With Others When Installed 2004-10-27 23:18:45 +00:00
PHIElimination.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
Passes.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
PhysRegTracker.h Improved PhysRegTracker interface. RegAlloc lazily allocates the register tracker using a std::auto_ptr 2004-02-23 06:10:13 +00:00
PrologEpilogInserter.cpp Put this change back in after testing from Reid proved its innocence. getSpillSize now returns value in bits 2004-08-29 22:00:24 +00:00
RegAllocIterativeScan.cpp Move virtual method call out of loop 2004-12-15 07:04:32 +00:00
RegAllocLinearScan.cpp Move virtual method call out of loop 2004-12-15 07:04:32 +00:00
RegAllocLocal.cpp Clean up the MachineBasicBlock.h file, percolating #includes into this file. 2004-10-26 15:35:58 +00:00
RegAllocSimple.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
TwoAddressInstructionPass.cpp Make the 2-address instruction lowering pass smarter in two ways: 2005-01-02 02:34:12 +00:00
UnreachableBlockElim.cpp Changes For Bug 352 2004-09-01 22:55:40 +00:00
VirtRegMap.cpp Clean up the MachineBasicBlock.h file, percolating #includes into this file. 2004-10-26 15:35:58 +00:00
VirtRegMap.h When a virtual register is folded into an instruction, keep track of whether 2004-10-01 23:15:36 +00:00