summaryrefslogtreecommitdiff
path: root/lib/CodeGen
Commit message (Collapse)AuthorAge
* Prevent LiveRangeEdit from deleting bundled instructions.Andrew Trick2013-06-22
| | | | | | | | | We have no targets on trunk that bundle before regalloc. However, we have been advertising regalloc as bundle safe for use with out-of-tree targets. We need to at least contain the parts of the code that are still unsafe. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184620 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Don't lose unreferenced non-trivial by-value parametersDavid Blaikie2013-06-21
| | | | | | | | | | | | A FastISel optimization was causing us to emit no information for such parameters & when they go missing we end up emitting a different function type. By avoiding that shortcut we not only get types correct (very important) but also location information (handy) - even if it's only live at the start of a function & may be clobbered later. Reviewed/discussion by Evan Cheng & Dan Gohman. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184604 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR16360Michael Liao2013-06-21
| | | | | | | | | When (srl (anyextend x), c) is folded into (anyextend (srl x, c)), the high bits are not cleared. Add 'and' to clear off them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184575 91177308-0d34-0410-b5e6-96231b3b80d8
* Update physreg live intervals during remat.Andrew Trick2013-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184574 91177308-0d34-0410-b5e6-96231b3b80d8
* Added -precompute-phys-liveness for testing LiveIntervals updates.Andrew Trick2013-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184573 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle more cases in LiveRangeEdit::eliminateDeadDefs.Andrew Trick2013-06-21
| | | | | | | | | | Live intervals for dead physregs may be created during coalescing. We need to update these in the event that their instruction goes away. crash.ll is the unit test that catches it when MI sched is enabled on X86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184572 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor LiveRangeEdit::eliminateDeadDefs.Andrew Trick2013-06-21
| | | | | | I want to add logic to handle more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184571 91177308-0d34-0410-b5e6-96231b3b80d8
* whitespaceAndrew Trick2013-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184570 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a -join-globalcopies bug; handle undef operands.Andrew Trick2013-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184569 91177308-0d34-0410-b5e6-96231b3b80d8
* Modify the -join-globalcopies option (off by default).Andrew Trick2013-06-21
| | | | | | | Always coalesce in forward order to propagate rematerialization. I'm fixing this option so I can enable it by default soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184568 91177308-0d34-0410-b5e6-96231b3b80d8
* Make rematerialization in the coalescer less sensitive to LRG order.Andrew Trick2013-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184567 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: cleanup DEBUG output.Andrew Trick2013-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184565 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: Adjust regpressure limits for reserved regs.Andrew Trick2013-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184564 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: don't use location lists when the location covers the whole ↵David Blaikie2013-06-20
| | | | | | | | | | | | | function anyway Fix up three tests - one that was relying on abbreviation number, another relying on a location list in this case (& testing raw asm, changed that to use dwarfdump on the debug_info now that that's where the location is), and another which was added in r184368 - exposing a bug in that fix that is exposed when we emit the location inline rather than through a location list. Fix that bug while I'm here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184387 91177308-0d34-0410-b5e6-96231b3b80d8
* This is now a duplicate.Bill Wendling2013-06-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184376 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the comparison operators non-member functions.Bill Wendling2013-06-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184373 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: PR14763/r183329 correct the location of indirect parametersDavid Blaikie2013-06-19
| | | | | | | | | | | | | | | | We had been papering over a problem with location info for non-trivial types passed by value by emitting their type as references (this caused the debugger to interpret the location information correctly, but broke the type of the function). r183329 corrected the type information but lead to the debugger interpreting the pointer parameter as the value - the debug info describing the location needed an extra dereference. Use a new flag in DIVariable to add the extra indirection (either by promoting an existing DW_OP_reg (parameter passed in a register) to DW_OP_breg + 0 or by adding DW_OP_deref to an existing DW_OP_breg + n (parameter passed on the stack). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184368 91177308-0d34-0410-b5e6-96231b3b80d8
* Access the TargetLoweringInfo from the TargetMachine object instead of ↵Bill Wendling2013-06-19
| | | | | | caching it. The TLI may change between functions. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184360 91177308-0d34-0410-b5e6-96231b3b80d8
* Access the TargetLoweringInfo from the TargetMachine object instead of ↵Bill Wendling2013-06-19
| | | | | | caching it. The TLI may change between functions. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184352 91177308-0d34-0410-b5e6-96231b3b80d8
* Access the TargetLoweringInfo from the TargetMachine object instead of ↵Bill Wendling2013-06-19
| | | | | | caching it. The TLI may change between functions. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184349 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't cache the TLI object since we have access to it through TargetMachine ↵Bill Wendling2013-06-19
| | | | | | already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184346 91177308-0d34-0410-b5e6-96231b3b80d8
* During SelectionDAG building explicitly set a node to constant zero when theQuentin Colombet2013-06-18
| | | | | | | | | | | | | value is zero. This allows optmizations to kick in more easily. Fix some test cases so that they remain meaningful (i.e., not completely dead coded) when optimizations apply. <rdar://problem/14096009> superfluous multiply by high part of zero-extended value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184222 91177308-0d34-0410-b5e6-96231b3b80d8
* Hopefully fix the MSVS build after r184105Timur Iskhodzhanov2013-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184178 91177308-0d34-0410-b5e6-96231b3b80d8
* Use pointers to the MCAsmInfo and MCRegInfo.Bill Wendling2013-06-18
| | | | | | | | | | Someone may want to do something crazy, like replace these objects if they change or something. No functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184175 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify some of the code. No functionality change.Bill Wendling2013-06-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184172 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: handle ReadAdvance latencies as used by Swift.Andrew Trick2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184135 91177308-0d34-0410-b5e6-96231b3b80d8
* Give RegMax higher priority.Andrew Trick2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184133 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove compareRPDelta.Andrew Trick2013-06-17
| | | | | | A complex, expensive heuristic with little value in the current design. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184132 91177308-0d34-0410-b5e6-96231b3b80d8
* MI Sched: fix a typo in RegPressure heuristics.Andrew Trick2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184131 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: Remove another heuristic that is sensitive to queue order.Andrew Trick2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184130 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: Track multiple candidates with the same priority level.Andrew Trick2013-06-17
| | | | | | | | This eliminates the MultiPressure scheduling "reason". It was sensitive to queue order. We don't like being sensitive to queue order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184129 91177308-0d34-0410-b5e6-96231b3b80d8
* Directly access objects which may change during compilation.Bill Wendling2013-06-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184121 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch spill weights from a basic loop depth estimation to BlockFrequencyInfo.Benjamin Kramer2013-06-17
| | | | | | | | | | | | | | | | | | The main advantages here are way better heuristics, taking into account not just loop depth but also __builtin_expect and other static heuristics and will eventually learn how to use profile info. Most of the work in this patch is pushing the MachineBlockFrequencyInfo analysis into the right places. This is good for a 5% speedup on zlib's deflate (x86_64), there were some very unfortunate spilling decisions in its hottest loop in longest_match(). Other benchmarks I tried were mostly neutral. This changes register allocation in subtle ways, update the tests for it. 2012-02-20-MachineCPBug.ll was deleted as it's very fragile and the instruction it looked for was gone already (but the FileCheck pattern picked up unrelated stuff). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184105 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: remove target-specific Frame Index handling for DBG_VALUE ↵David Blaikie2013-06-16
| | | | | | | | | | MachineInstrs Frame index handling is now target-agnostic, so delete the target hooks for creation & asm printing of target-specific addressing in DBG_VALUEs and any related functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184067 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Simplify Frame Index handling in DBG_VALUE Machine InstructionsDavid Blaikie2013-06-16
| | | | | | | | | | | | | | | | | | | | Rather than using the full power of target-specific addressing modes in DBG_VALUEs with Frame Indicies, simply use Frame Index + Offset. This reduces the complexity of debug info handling down to two representations of values (reg+offset and frame index+offset) rather than three or four. Ideally we could ensure that frame indicies had been eliminated by the time we reached an assembly or dwarf generation, but I haven't spent the time to figure out where the FIs are leaking through into that & whether there's a good place to convert them. Some FI+offset=>reg+offset conversion is done (see PrologEpilogInserter, for example) which is necessary for some SelectionDAG assumptions about registers, I believe, but it might be possible to make this a more thorough conversion & ensure there are no remaining FIs no matter how instruction selection is performed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184066 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: print DBG_VALUE MachineInstrs with [] for deref and drop the ↵David Blaikie2013-06-15
| | | | | | offset when it's zero git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184045 91177308-0d34-0410-b5e6-96231b3b80d8
* Missing NDEBUGs.Andrew Trick2013-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184039 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: heuristics using the new latency and machine model.Andrew Trick2013-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184038 91177308-0d34-0410-b5e6-96231b3b80d8
* Machine Model: Add MicroOpBufferSize and resource BufferSize.Andrew Trick2013-06-15
| | | | | | | | | | | | | Replace the ill-defined MinLatency and ILPWindow properties with with straightforward buffer sizes: MCSchedMode::MicroOpBufferSize MCProcResourceDesc::BufferSize These can be used to more precisely model instruction execution if desired. Disabled some misched tests temporarily. They'll be reenabled in a few commits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184032 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: Rename IssueCount to CurrMOps.Andrew Trick2013-06-15
| | | | | | | "Counts" refer to scaled resource counts within a region. CurrMOps is simply the number of micro-ops to be issue in the current cycle. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184031 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: Remove the temporary EnableCopyConstrain flag.Andrew Trick2013-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184030 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: added tracking of dependent latency for better heuristics.Andrew Trick2013-06-15
| | | | | | | | | | | | | | Heuristics compare the critical path in the scheduled code, called ExpectedLatency, with the latency of instructions remaining to be scheduled. There are two ways to look at remaining latency: (1) Dependent latency includes the latency between unscheduled and scheduled instructions. (2) Independent latency is simply the height (bottom-up) or depth (top-down) of instructions currently in the ready Q. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184029 91177308-0d34-0410-b5e6-96231b3b80d8
* MI-Sched: DEBUG: print critical resource.Andrew Trick2013-06-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184028 91177308-0d34-0410-b5e6-96231b3b80d8
* SelectionDAG: slightly refactor DAGCombiner::visitSELECT_CC to avoid ↵Stephen Lin2013-06-15
| | | | | | | | | redudant checks... This doesn't really effect performance due to all the relevant calls being transparent but is clearer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184027 91177308-0d34-0410-b5e6-96231b3b80d8
* Debug Info: Don't print the display name and colon prefix for DEBUG_VALUE ↵David Blaikie2013-06-15
| | | | | | comments if the display name is empty git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184026 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce getSelect usage and use more getSelectCCMatt Arsenault2013-06-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184012 91177308-0d34-0410-b5e6-96231b3b80d8
* SelectionDAG: minor fix to order of operands in comments to match the code Stephen Lin2013-06-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184008 91177308-0d34-0410-b5e6-96231b3b80d8
* Mark rematerialized super/sub registers as dead.Tim Northover2013-06-14
| | | | | | | | | | | | | When we're rematerializing into a not-quite-right register we already add the real definition as an imp-def, but we should also be marking the "official" register as dead, since nothing else is going to use it as a result of this remat. Not doing this can affect pressure tracking. rdar://problem/14158833 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184002 91177308-0d34-0410-b5e6-96231b3b80d8
* SelectionDAG: Fix incorrect condition checks in some cases of folding ↵Stephen Lin2013-06-14
| | | | | | FADD/FMUL combinations; also improve accuracy of comments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183993 91177308-0d34-0410-b5e6-96231b3b80d8
* Make PrologEpilogInserter save/restore all callee saved registersDerek Schuff2013-06-14
| | | | | | | | | | | in functions which call __builtin_unwind_init() __builtin_unwind_init() is an undocumented gcc intrinsic which has this effect, and is used in libgcc_eh. Goes part of the way toward fixing PR8541. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183984 91177308-0d34-0410-b5e6-96231b3b80d8