summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Run dead code elimination immediately after rematerialization.Jakob Stoklund Olesen2011-03-291-9/+24
| | | | | | | This may eliminate some uses of the spilled registers, and we don't want to insert reloads for that. llvm-svn: 128468
* Inline check that's used only once.Bill Wendling2011-03-291-2/+1
| | | | llvm-svn: 128465
* Rework the logic (and removing the bad check for an unreachable block) so thatBill Wendling2011-03-291-8/+5
| | | | | | | the FailBB dominator is correctly calculated. Believe it or not, there isn't a functionality change here. llvm-svn: 128455
* Don't try to add stack protector logic to a dead basic block. It messes upBill Wendling2011-03-291-1/+2
| | | | | | dominator information. llvm-svn: 128452
* Handle the special case when all uses follow the last split point.Jakob Stoklund Olesen2011-03-291-1/+2
| | | | llvm-svn: 128450
* Properly enable rematerialization when spilling after live range splitting.Jakob Stoklund Olesen2011-03-293-71/+129
| | | | | | | | The instruction to be rematerialized may not be the one defining the register that is being spilled. The traceSiblingValue() function sees through sibling copies to find the remat candidate. llvm-svn: 128449
* In some cases, the "fail BB dominator" may be null after the BB was split (andBill Wendling2011-03-281-1/+2
| | | | | | | becomes reachable when before it wasn't). Check to make sure that it's not null before trying to use it. llvm-svn: 128434
* Integrated-As: Add support for setting the AllowTemporaryLabels flag viaDaniel Dunbar2011-03-281-0/+6
| | | | | | integrated-as. llvm-svn: 128431
* Amend debug output.Jakob Stoklund Olesen2011-03-271-2/+3
| | | | llvm-svn: 128398
* Drop interference reassignment in favor of eviction.Jakob Stoklund Olesen2011-03-271-132/+15
| | | | | | | | | The reassignment phase was able to move interference with a higher spill weight, but it didn't happen very often and it was fairly expensive. The existing interference eviction picks up the slack. llvm-svn: 128397
* Use individual register classes when spilling snippets.Jakob Stoklund Olesen2011-03-262-24/+28
| | | | | | | | | The main register class may have been inflated by live range splitting, so that register class is not necessarily valid for the snippet instructions. Use the original register class for the stack slot interval. llvm-svn: 128351
* Turn SelectionDAGBuilder::GetRegistersForValue into a local function.Benjamin Kramer2011-03-262-19/+16
| | | | | | | | It couldn't be used outside of the file because SDISelAsmOperandInfo is local to SelectionDAGBuilder.cpp. Making it a static function avoids a weird linkage dance. llvm-svn: 128342
* Collect and coalesce DBG_VALUE instructions before emitting the function.Jakob Stoklund Olesen2011-03-262-110/+187
| | | | | | | | | | | Correctly terminate the range of register DBG_VALUEs when the register is clobbered or when the basic block ends. The code is now ready to deal with variables that are sometimes in a register and sometimes on the stack. We just need to teach emitDebugLoc to say 'stack slot'. llvm-svn: 128327
* Emit less labels for debug info and stop emitting .loc directives for ↵Jakob Stoklund Olesen2011-03-252-49/+32
| | | | | | | | | | | | DBG_VALUEs. The .dot directives don't need labels, that is a leftover from when we created line number info manually. Instructions following a DBG_VALUE can share its label since the DBG_VALUE doesn't produce any code. llvm-svn: 128284
* Fix for -pre-RA-sched=source.Andrew Trick2011-03-251-0/+2
| | | | | | | Yet another case of unchecked NULL node (for physreg copy). May fix PR9509. llvm-svn: 128266
* No functionality change. Fix up some whitespace and switch out "" for '' whenNick Lewycky2011-03-251-3/+3
| | | | | | printing a single character. llvm-svn: 128256
* Ignore special ARM allocation hints for unexpected register classes.Jakob Stoklund Olesen2011-03-251-0/+1
| | | | | | | | | Add an assertion to linear scan to prevent it from allocating registers outside the register class. <rdar://problem/9183021> llvm-svn: 128254
* Keep track of directory namd and fIx regression caused by Rafael's patch ↵Devang Patel2011-03-242-12/+29
| | | | | | | | r119613. A better approach would be to move source id handling inside MC. llvm-svn: 128233
* PR9535: add support for splitting and scalarizing vector ISD::FP_ROUND.Eli Friedman2011-03-232-60/+30
| | | | | | Also cleaning up some duplicated code while I'm here. llvm-svn: 128176
* Ensure that def-side physreg copies are scheduled above any other usesAndrew Trick2011-03-231-0/+9
| | | | | | | | | so the scheduler can't create new interferences on the copies themselves. Prior to this fix the scheduler could get stuck in a loop creating copies. Fixes PR9509. llvm-svn: 128164
* whitespaceAndrew Trick2011-03-231-2/+2
| | | | llvm-svn: 128163
* Don't coalesce identical DBG_VALUE instructions prematurely.Jakob Stoklund Olesen2011-03-231-3/+1
| | | | | | | | Each of these instructions may have a RegsClobberInsn entry that can't be ignored. Consecutive ranges are coalesced later when DwarfDebug::emitDebugLoc merges entries. llvm-svn: 128155
* Notify the delegate before removing dead values from a live interval.Jakob Stoklund Olesen2011-03-231-0/+2
| | | | | | The register allocator needs to know when the range shrinks. llvm-svn: 128145
* Allow the allocation of empty live ranges that have uses.Jakob Stoklund Olesen2011-03-231-1/+8
| | | | | | Empty ranges may represent undef values. llvm-svn: 128144
* Dump the register map before rewriting.Jakob Stoklund Olesen2011-03-231-1/+1
| | | | llvm-svn: 128143
* Added block number and name to isel debug output.Andrew Trick2011-03-231-12/+25
| | | | | | | | I'm tired of doing this manually for each checkout. If anyone knows a better way debug isel for non-trivial tests feel free to revert and let me know how to do it. llvm-svn: 128132
* Reapply r128045 and r128051 with fixes.Jakob Stoklund Olesen2011-03-223-53/+88
| | | | | | | | | | | | | | | | This will extend the ranges of debug info variables in registers until they are clobbered. Fix 1: Don't mistake DBG_VALUE instructions referring to incoming arguments on the stack with DBG_VALUE instructions referring to variables in the frame pointer. This fixes the gdb test-suite failure. Fix 2: Don't trace through copies to physical registers setting up call arguments. These registers are call clobbered, and the source register is more likely to be a callee-saved register that can be extended through the call instruction. llvm-svn: 128114
* Revert r128045 and r128051, debug info enhancements.Andrew Trick2011-03-223-77/+49
| | | | | | Temporarily reverting these to see if we can get llvm-objdump to link. Hopefully this is not the problem. llvm-svn: 128097
* Clear map after use.Jakob Stoklund Olesen2011-03-221-0/+1
| | | | | | This is likely to fix the segfault in llvm-gcc-x86_64-darwin10-cross-mingw32. llvm-svn: 128051
* Dont emit 'DBG_VALUE %noreg, ...' to terminate user variable ranges.Jakob Stoklund Olesen2011-03-223-49/+76
| | | | | | | | | | These ranges get completely jumbled by the post-ra scheduler, and it is not really reasonable to expect it to make sense of them. Instead, teach DwarfDebug to notice when user variables in registers are clobbered, and terminate the ranges there. llvm-svn: 128045
* Grammar-o.Eric Christopher2011-03-211-1/+1
| | | | llvm-svn: 128004
* We need to pass the TargetMachine object to the InstPrinter if we are printingBill Wendling2011-03-211-1/+1
| | | | | | | | | the alias of an InstAlias instead of the thing being aliased. Because we need to know the features that are valid for an InstAlias. This is part of a work-in-progress. llvm-svn: 127986
* Process all dead defs after rematerializing during splitting.Jakob Stoklund Olesen2011-03-201-22/+15
| | | | llvm-svn: 127973
* Also eliminate redundant spills downstream of inserted reloads.Jakob Stoklund Olesen2011-03-201-9/+17
| | | | | | | This can happen when multiple sibling registers are spilled after live range splitting. llvm-svn: 127965
* Change an argument to a LiveInterval instead of a register number to save ↵Jakob Stoklund Olesen2011-03-201-13/+13
| | | | | | some redundant lookups. llvm-svn: 127964
* Replace a broken LiveInterval::MergeValueInAsValue() with something simpler.Jakob Stoklund Olesen2011-03-191-46/+5
| | | | llvm-svn: 127960
* Add debug output.Jakob Stoklund Olesen2011-03-192-0/+5
| | | | llvm-svn: 127959
* Minor code re-structuring.Evan Cheng2011-03-191-1/+1
| | | | llvm-svn: 127952
* Add support for legalizing UINT_TO_FP of vectors on platforms which doNadav Rotem2011-03-191-1/+48
| | | | | | | | not have native support for this operation (such as X86). The legalized code uses two vector INT_TO_FP operations and is faster than scalarizing. llvm-svn: 127951
* Reapply 127939 since Daniel fixed the breakage. <rdar://problem/9012638>Stuart Hastings2011-03-191-7/+4
| | | | llvm-svn: 127944
* Revert 127939. <rdar://problem/9012638>Stuart Hastings2011-03-191-4/+7
| | | | llvm-svn: 127943
* Revise r126127 to address Daniel's comments. <rdar://problem/9012638>Stuart Hastings2011-03-191-7/+4
| | | | llvm-svn: 127939
* Beginnings of MC-JIT code generation.Jim Grosbach2011-03-181-0/+26
| | | | | | | | | | | Proof-of-concept code that code-gens a module to an in-memory MachO object. This will be hooked up to a run-time dynamic linker library (see: llvm-rtdyld for similarly conceptual work for that part) which will take the compiled object and link it together with the rest of the system, providing back to the JIT a table of available symbols which will be used to respond to the getPointerTo*() queries. llvm-svn: 127916
* Extend live debug values down the dominator tree by following copies.Jakob Stoklund Olesen2011-03-181-24/+136
| | | | | | | | | | | | | | | | | The llvm.dbg.value intrinsic refers to SSA values, not virtual registers, so we should be able to extend the range of a value by tracking that value through register copies. This greatly improves the debug value tracking for function arguments that for some reason are copied to a second virtual register at the end of the entry block. We only extend the debug value range where its register is killed. All original llvm.dbg.value locations are still respected. Copies from physical registers are ignored. That should not be a problem since the entry block already adds DBG_VALUE instructions for the virtual registers holding the function arguments. llvm-svn: 127912
* Hoist spills when the same value is known to be in less loopy sibling registers.Jakob Stoklund Olesen2011-03-181-22/+148
| | | | | | | | | | | | | | Stack slot real estate is virtually free compared to registers, so it is advantageous to spill earlier even though the same value is now kept in both a register and a stack slot. Also eliminate redundant spills by extending the stack slot live range underneath reloaded registers. This can trigger a dead code elimination, removing copies and even reloads that were only feeding spills. llvm-svn: 127868
* Accept instructions that read undefined values.Jakob Stoklund Olesen2011-03-181-1/+9
| | | | | | | This is not supposed to happen, but I have seen the x86 rematter getting confused when rematerializing partial redefs. llvm-svn: 127857
* Be more accurate about the slot index reading a register when dealing with defsJakob Stoklund Olesen2011-03-181-4/+20
| | | | | | | | and early clobbers. Assert when trying to find an undefined value. llvm-svn: 127856
* BuildUDIV: If the divisor is even we can simplify the fixup of the ↵Benjamin Kramer2011-03-171-9/+22
| | | | | | | | | | | | | | | | | | | | | | | multiplied value by introducing an early shift. This allows us to compile "unsigned foo(unsigned x) { return x/28; }" into shrl $2, %edi imulq $613566757, %rdi, %rax shrq $32, %rax ret instead of movl %edi, %eax imulq $613566757, %rax, %rcx shrq $32, %rcx subl %ecx, %eax shrl %eax addl %ecx, %eax shrl $4, %eax on x86_64 llvm-svn: 127829
* Dead code elimination may separate the live interval into multiple connected ↵Jakob Stoklund Olesen2011-03-175-22/+44
| | | | | | | | | components. I have convinced myself that it can only happen when a phi value dies. When it happens, allocate new virtual registers for the components. llvm-svn: 127827
* Move more logic into getTypeForExtArgOrReturn.Cameron Zwarich2011-03-171-6/+2
| | | | llvm-svn: 127809
OpenPOWER on IntegriCloud