summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
* Print all the moves at a given label instead of just the first one.Rafael Espindola2011-04-262-6/+6
| | | | | | Remove previous DwarfCFI hack. llvm-svn: 130187
* Let dwarf writer allocate extra space in the debug location expression. This ↵Devang Patel2011-04-261-3/+4
| | | | | | space, if requested, will be used for complex addresses of the Blocks' variables. llvm-svn: 130178
* Rename a local variable.Devang Patel2011-04-251-17/+21
| | | | llvm-svn: 130171
* Rename a method to match what it really does.Devang Patel2011-04-253-8/+10
| | | | | | s/addVariableAddress/addFrameVariableAddress/g llvm-svn: 130170
* Do not drop a variable's complex address if it is not based on frame base.Devang Patel2011-04-251-1/+5
| | | | | | Observed this while reading code, so I do not have a test case handy here. llvm-svn: 130167
* A dbg.declare may not be in entry block, even if it is referring to an ↵Devang Patel2011-04-251-4/+0
| | | | | | incoming argument. However, It is appropriate to emit DBG_VALUE referring to this incoming argument in entry block in MachineFunction. llvm-svn: 130129
* Simplify the logic. Noticed by aKor.Rafael Espindola2011-04-241-2/+1
| | | | llvm-svn: 130116
* Synchronize the conditions for producing a .cfi_startproc and a .cfi_endproc.Rafael Espindola2011-04-241-1/+1
| | | | | | Fixes PR9787. llvm-svn: 130115
* Give SplitKit.h a header guard.Sebastian Redl2011-04-241-0/+5
| | | | llvm-svn: 130095
* Remove unused STL header includes.Jay Foad2011-04-234-4/+0
| | | | llvm-svn: 130068
* Teach FastISel to deal with instructions that have two immediate operands.Owen Anderson2011-04-221-10/+27
| | | | llvm-svn: 130033
* Let front-end tie subprogram declaration with subprogram definition directly.Devang Patel2011-04-221-38/+50
| | | | llvm-svn: 130028
* Always compare the cost of region splitting with the cost of per-block ↵Jakob Stoklund Olesen2011-04-221-6/+45
| | | | | | | | splitting. Sometimes it is better to split per block, and we missed those cases. llvm-svn: 130025
* Recommit the fix for rdar://9289512 with a couple tweaks toChris Lattner2011-04-221-17/+54
| | | | | | | | | | | fix bugs exposed by the gcc dejagnu testsuite: 1. The load may actually be used by a dead instruction, which would cause an assert. 2. The load may not be used by the current chain of instructions, and we could move it past a side-effecting instruction. Change how we process uses to define the problem away. llvm-svn: 130018
* DAGCombine: fold "(zext x) == C" into "x == (trunc C)" if the trunc is lossless.Benjamin Kramer2011-04-221-0/+36
| | | | | | | | | | | | On x86 this allows to fold a load into the cmp, greatly reducing register pressure. movzbl (%rdi), %eax cmpl $47, %eax -> cmpb $47, (%rdi) This shaves 8k off gcc.o on i386. I'll leave applying the patch in README.txt to Chris :) llvm-svn: 130005
* Do not leak argument's DbgVariables.Devang Patel2011-04-221-1/+1
| | | | llvm-svn: 130004
* TypoEvan Cheng2011-04-221-1/+1
| | | | llvm-svn: 129970
* Branch folding is folding a landing pad into a regular BB.Bill Wendling2011-04-221-1/+1
| | | | | | | | | | | | | | | An exception is thrown via a call to _cxa_throw, which we don't expect to return. Therefore, the "true" part of the invoke goes to a BB that has 'unreachable' as its only instruction. This is lowered into an empty MachineBB. The landing pad for this invoke, however, is directly after the "true" MBB. When the empty MBB is removed, the landing pad is directly below the BB with the invoke call. The unconditional branch is removed and then the two blocks are merged together. The testcase is too big for a regression test. <rdar://problem/9305728> llvm-svn: 129965
* Refactor.Devang Patel2011-04-212-30/+35
| | | | llvm-svn: 129938
* Don't recycle loop variables.Matt Beaumont-Gay2011-04-211-1/+1
| | | | llvm-svn: 129928
* Allow allocatable ranges from global live range splitting to be split again.Jakob Stoklund Olesen2011-04-213-7/+45
| | | | | | | | | | | | | | | | | | | | | These intervals are allocatable immediately after splitting, but they may be evicted because of later splitting. This is rare, but when it happens they should be split again. The remainder intervals that cannot be allocated after splitting still move directly to spilling. SplitEditor::finish can optionally provide a mapping from new live intervals back to the original interval indexes returned by openIntv(). Each original interval index can map to multiple new intervals after connected components have been separated. Dead code elimination may also add existing intervals to the list. The reverse mapping allows the SplitEditor client to treat the new intervals differently depending on the split region they came from. llvm-svn: 129925
* Add comment in output stream.Devang Patel2011-04-211-0/+3
| | | | llvm-svn: 129921
* Revert r1296656, "Fix rdar://9289512 - not folding load into compare at -O0...",Daniel Dunbar2011-04-211-41/+15
| | | | | | which broke a couple GCC test suite tests at -O0. llvm-svn: 129914
* Add debug output for rematerializable instructions.Jakob Stoklund Olesen2011-04-203-6/+10
| | | | llvm-svn: 129883
* Permit remat when a virtual register has multiple defs.Jakob Stoklund Olesen2011-04-201-5/+0
| | | | | | | | TII::isTriviallyReMaterializable() shouldn't depend on any properties of the register being defined by the instruction. Rematerialization is going to create a new virtual register anyway. llvm-svn: 129882
* Prefer cheap registers for busy live ranges.Jakob Stoklund Olesen2011-04-202-6/+45
| | | | | | | | | | | | | | On the x86-64 and thumb2 targets, some registers are more expensive to encode than others in the same register class. Add a CostPerUse field to the TableGen register description, and make it available from TRI->getCostPerUse. This represents the cost of a REX prefix or a 32-bit instruction encoding required by choosing a high register. Teach the greedy register allocator to prefer cheap registers for busy live ranges (as indicated by spill weight). llvm-svn: 129864
* ARM byval support. Will be enabled by another patch to the FE. ↵Stuart Hastings2011-04-201-3/+4
| | | | | | <rdar://problem/7662569> llvm-svn: 129858
* Remove unused arguments.Rafael Espindola2011-04-202-5/+3
| | | | llvm-svn: 129844
* Rewrite the expander for umulo/smulo to remember to sign extend the inputEric Christopher2011-04-201-10/+58
| | | | | | | | | manually and pass all (now) 4 arguments to the mul libcall. Add a new ExpandLibCall for just this (copied gratuitously from type legalization). Fixes rdar://9292577 llvm-svn: 129842
* ADT/Triple: Renambe isOSX... methods to isMacOSX for consistency with the OSDaniel Dunbar2011-04-201-1/+1
| | | | | | triple component. llvm-svn: 129838
* CodeGen: Eliminate a use of getDarwinMajorNumber().Daniel Dunbar2011-04-191-11/+3
| | | | | | | | | - There is a minor semantic change here (evidenced by the test change) for Darwin triples that have no version component. I debated changing the default behavior of isOSVersionLT, but decided it made more sense for triples to be explicit. llvm-svn: 129802
* Delete unnecessary variable. <rdar://problem/7662569>Stuart Hastings2011-04-191-11/+4
| | | | llvm-svn: 129796
* Avoid write-after-write issue hazards for Cortex-A9.Bob Wilson2011-04-191-10/+24
| | | | | | | | | | | Add a avoidWriteAfterWrite() target hook to identify register classes that suffer from write-after-write hazards. For those register classes, try to avoid writing the same register in two consecutive instructions. This is currently disabled by default. We should not spill to avoid hazards! The command line flag -avoid-waw-hazard can be used to enable waw avoidance. llvm-svn: 129772
* Force the greedy register allocator to be linked alongside linear scan.Jakob Stoklund Olesen2011-04-191-0/+5
| | | | | | This means that the new register allocator can be used with 'clang -mllvm -regalloc=greedy'. llvm-svn: 129764
* SelectBasicBlock is rather slow even when it doesn't do anything; skip theEli Friedman2011-04-191-5/+7
| | | | | | unnecessary work where possible. llvm-svn: 129763
* Support nested CALLSEQ_BEGIN/END; necessary for ARM byval support. ↵Stuart Hastings2011-04-191-42/+56
| | | | | | <rdar://problem/7662569> llvm-svn: 129761
* Implement support for x86 fastisel of small fixed-sized memcpys, which are ↵Chris Lattner2011-04-191-52/+44
| | | | | | | | | generated en-mass for C++ PODs. On my c++ test file, this cuts the fast isel rejects by 10x and shrinks the generated .s file by 5% llvm-svn: 129755
* Simplify declarations slightly by using typedefs.Eli Friedman2011-04-181-4/+2
| | | | llvm-svn: 129720
* Reduce clutter in asm output. Do not emit source location as comment for ↵Devang Patel2011-04-182-30/+1
| | | | | | each instruction. llvm-svn: 129715
* Handle spilling around an instruction that has an early-clobber re-definition ofJakob Stoklund Olesen2011-04-181-14/+15
| | | | | | | | the spilled register. This is quite common on ARM now that some stores have early-clobber defines. llvm-svn: 129714
* Fix a bug where we were counting the alias sets as completely usedEric Christopher2011-04-181-5/+0
| | | | | | | | | registers for fast allocation a different way. This has us updating used registers only when we're using that exact register. Fixes rdar://9207598 llvm-svn: 129711
* while we're at it, handle 'sdiv exact' of a power of 2 also,Chris Lattner2011-04-181-0/+8
| | | | | | this fixes a few rejects on c++ iterator loops. llvm-svn: 129694
* fix rdar://9297011 - udiv by power of two causing fast-isel rejectsChris Lattner2011-04-181-0/+4
| | | | llvm-svn: 129693
* 1. merge fast-isel-shift-imm.ll into fast-isel-x86-64.llChris Lattner2011-04-171-18/+30
| | | | | | | | | | 2. implement rdar://9289501 - fast isel should fold trivial multiplies to shifts 3. teach tblgen to handle shift immediates that are different sizes than the shifted operands, eliminating some code from the X86 fast isel backend. 4. Have FastISel::SelectBinaryOp use (the poorly named) FastEmit_ri_ function instead of FastEmit_ri to simplify code. llvm-svn: 129666
* fix an oversight which caused us to compile the testcase (and otherChris Lattner2011-04-171-5/+3
| | | | | | | | | | | | | | | | | | | less trivial things) into a dummy lea. Before we generated: _test: ## @test movq _G@GOTPCREL(%rip), %rax leaq (%rax), %rax ret now we produce: _test: ## @test movq _G@GOTPCREL(%rip), %rax ret This is part of rdar://9289558 llvm-svn: 129662
* Fix rdar://9289512 - not folding load into compare at -O0Chris Lattner2011-04-171-15/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | The basic issue here is that bottom-up isel is matching the branch and compare, and was failing to fold the load into the branch/compare combo. Fixing this (by allowing folding into any instruction of a sequence that is selected) allows us to produce things like: cmpb $0, 52(%rax) je LBB4_2 instead of: movb 52(%rax), %cl cmpb $0, %cl je LBB4_2 This makes the generated -O0 code run a bit faster, but also speeds up compile time by putting less pressure on the register allocator and generating less code. This was one of the biggest classes of missing load folding. Implementing this shrinks 176.gcc's c-decl.s (as a random example) by about 4% in (verbose-asm) line count. llvm-svn: 129656
* split a complex predicate out to a helper function. Simplify two for loops,Chris Lattner2011-04-171-10/+16
| | | | | | | which don't need to check for falling off the end of a block *and* end of phi nodes, since terminators are never phis. llvm-svn: 129655
* fix rdar://9289583 - fast isel should handle non-canonical commutative binopsChris Lattner2011-04-171-4/+23
| | | | | | | | | | allowing us to fold the immediate into the 'and' in this case: int test1(int i) { return 8&i; } llvm-svn: 129653
* PR9055: extend the fix to PR4050 (r70179) to apply to zext and anyext.Eli Friedman2011-04-161-2/+2
| | | | | | | Returning a new node makes the code try to replace the old node, which in the included testcase is killed by CSE. llvm-svn: 129650
* Unbreak the MSVC 2010 build.Francois Pichet2011-04-161-1/+2
| | | | | | For further information on this particular issue see: http://connect.microsoft.com/VisualStudio/feedback/details/520043/error-converting-from-null-to-a-pointer-type-in-std-pair llvm-svn: 129642
OpenPOWER on IntegriCloud