summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
Commit message (Collapse)AuthorAgeFilesLines
...
* Add report() functions that take a LiveInterval argument.Jakob Stoklund Olesen2012-08-021-60/+67
| | | | llvm-svn: 161178
* X86 Peephole: fold loads to the source register operand if possible.Manman Ren2012-08-021-0/+57
| | | | | | | | | | | | Machine CSE and other optimizations can remove instructions so folding is possible at peephole while not possible at ISel. This patch is a rework of r160919 and was tested on clang self-host on my local machine. rdar://10554090 and rdar://11873276 llvm-svn: 161152
* Extract some methods from verifyLiveIntervals.Jakob Stoklund Olesen2012-08-021-245/+259
| | | | | | No functional change. llvm-svn: 161149
* Also verify RegUnit intervals at uses.Jakob Stoklund Olesen2012-08-011-15/+36
| | | | llvm-svn: 161147
* Compute instruction heights through a trace.Jakob Stoklund Olesen2012-08-012-11/+268
| | | | | | | | | | | | | | | | | | | The height on an instruction is the minimum number of cycles from the instruction is issued to the end of the trace. Heights are computed for all instructions in and below the trace center block. The method for computing heights is different from the depth computation. As we visit instructions in the trace bottom-up, heights of used instructions are pushed upwards. This way, we avoid scanning long use lists, looking for uses in the current trace. At each basic block boundary, a list of live-in registers and their minimum heights is saved in the trace block info. These live-in lists are used when restarting depth computations on a trace that converges with an already computed trace. They will also be used to accurately compute the critical path length. llvm-svn: 161138
* Temporarily revert c23b933d5f8be9b51a1d22e717c0311f65f87dcd. It's causingEric Christopher2012-08-012-24/+6
| | | | | | failures in the debug testsuite and possibly PR13486. llvm-svn: 161121
* Add DataDep constructors. Explicitly check SSA form.Jakob Stoklund Olesen2012-08-011-20/+18
| | | | llvm-svn: 161115
* Added FMA functionality to X86 target.Elena Demikhovsky2012-08-011-8/+20
| | | | llvm-svn: 161110
* MachineSink: Sort the successors before trying to find SuccToSinkTo.Manman Ren2012-07-311-1/+1
| | | | | | | | Use stable_sort instead of sort. Follow-up to r161062. rdar://11980766 llvm-svn: 161075
* Compute instruction depths through the current trace.Jakob Stoklund Olesen2012-07-312-7/+272
| | | | | | | | | | | Assuming infinite issue width, compute the earliest each instruction in the trace can issue, when considering the latency of data dependencies. The issue cycle is record as a 'depth' from the beginning of the trace. This is half the computation required to find the length of the critical path through the trace. Heights are next. llvm-svn: 161074
* Rename CT -> MTM. MachineTraceMetrics is abbreviated MTM.Jakob Stoklund Olesen2012-07-312-13/+13
| | | | llvm-svn: 161072
* MachineSink: Sort the successors before trying to find SuccToSinkTo.Manman Ren2012-07-311-2/+15
| | | | | | | | | | One motivating example is to sink an instruction from a basic block which has two successors: one outside the loop, the other inside the loop. We should try to sink the instruction outside the loop. rdar://11980766 llvm-svn: 161062
* Conform to LLVM coding style.Micah Villmow2012-07-311-2/+2
| | | | llvm-svn: 161061
* Don't generate ordered or unordered comparison operations if it is not legal ↵Micah Villmow2012-07-311-1/+2
| | | | | | to do so. llvm-svn: 161053
* Clear kill flags in removeCopyByCommutingDef().Jakob Stoklund Olesen2012-07-311-0/+2
| | | | | | | | | We are extending live ranges, so kill flags are not accurate. They aren't needed until they are recomputed after RA anyway. <rdar://problem/11950722> llvm-svn: 161023
* Reverse order of the two branches at end of a basic block if it is profitable.Manman Ren2012-07-311-1/+15
| | | | | | | | | | | | | | | We branch to the successor with higher edge weight first. Convert from je LBB4_8 --> to outer loop jmp LBB4_14 --> to inner loop to jne LBB4_14 jmp LBB4_8 PR12750 rdar: 11393714 llvm-svn: 161018
* Use the latest MachineRegisterInfo APIs. No functionality.Andrew Trick2012-07-301-1/+1
| | | | llvm-svn: 161010
* Inline MachineRegisterInfo::hasOneUseAndrew Trick2012-07-301-7/+0
| | | | llvm-svn: 161007
* Avoid looking at stale data in verifyAnalysis().Jakob Stoklund Olesen2012-07-301-1/+4
| | | | llvm-svn: 161004
* Allow traces to enter nested loops.Jakob Stoklund Olesen2012-07-301-14/+29
| | | | | | | | | | | This lets traces include the final iteration of a nested loop above the center block, and the first iteration of a nested loop below the center block. We still don't allow traces to contain backedges, and traces are truncated where they would leave a loop, as seen from the center block. llvm-svn: 161003
* Clarify invalidation strategy in comment.Jakob Stoklund Olesen2012-07-301-0/+6
| | | | llvm-svn: 160997
* Assert that all trace candidate blocks have been visited by the PO.Jakob Stoklund Olesen2012-07-301-11/+6
| | | | | | | | | | When computing a trace, all the candidates for pred/succ must have been visited. Filter out back-edges first, though. The PO traversal ignores them. Thanks to Andy for spotting this in review. llvm-svn: 160995
* Hook into PassManager's analysis verification.Jakob Stoklund Olesen2012-07-303-7/+4
| | | | | | | By overriding Pass::verifyAnalysis(), the pass contents will be verified by the pass manager. llvm-svn: 160994
* Consider address spaces for hashing and CSEing DAG nodes. Otherwise two ↵Pete Cooper2012-07-301-0/+22
| | | | | | loads from different x86 segments but the same address would get CSEd llvm-svn: 160987
* Add MachineInstr::isTransient().Jakob Stoklund Olesen2012-07-301-23/+1
| | | | | | | | | | | This is a cleaned up version of the isFree() function in MachineTraceMetrics.cpp. Transient instructions are very unlikely to produce any code in the final output. Either because they get eliminated by RegisterCoalescing, or because they are pseudo-instructions like labels and debug values. llvm-svn: 160977
* Add MachineTraceMetrics::verify().Jakob Stoklund Olesen2012-07-303-11/+55
| | | | | | | This function verifies the consistency of cached data in the MachineTraceMetrics analysis. llvm-svn: 160976
* Verify that the CFG hasn't changed during invalidate().Jakob Stoklund Olesen2012-07-301-2/+12
| | | | | | | The MachineTraceMetrics analysis must be invalidated before modifying the CFG. This will catch some of the violations of that rule. llvm-svn: 160969
* Add MachineBasicBlock::isPredecessor().Jakob Stoklund Olesen2012-07-301-2/+5
| | | | | | | | A->isPredecessor(B) is the same as B->isSuccessor(A), but it can tolerate a B that is null or dangling. This shouldn't happen normally, but it it useful for verification code. llvm-svn: 160968
* Revert r160920 and r160919 due to dragonegg and clang selfhost failureManman Ren2012-07-291-22/+0
| | | | llvm-svn: 160927
* X86 Peephole: fold loads to the source register operand if possible.Manman Ren2012-07-281-0/+22
| | | | | | | | | Machine CSE and other optimizations can remove instructions so folding is possible at peephole while not possible at ISel. rdar://10554090 and rdar://11873276 llvm-svn: 160919
* Reenable a basic SSA DAG builder optimization.Andrew Trick2012-07-281-5/+4
| | | | | | Jakob fixed ProcessImplicifDefs in r159149. llvm-svn: 160910
* Add more debug output to MachineTraceMetrics.Jakob Stoklund Olesen2012-07-273-3/+48
| | | | llvm-svn: 160905
* Keep track of the head and tail of the trace through each block.Jakob Stoklund Olesen2012-07-272-4/+18
| | | | | | | This makes it possible to quickly detect blocks that are outside the trace. llvm-svn: 160904
* Add a DW_AT_high_pc for CUs that are a single address range. UpdateEric Christopher2012-07-272-6/+24
| | | | | | | | | | all tests accordingly. Fixes PR13351. Patch by shinichiro hamaji! llvm-svn: 160899
* Also compute register mask lists under -new-live-intervals.Jakob Stoklund Olesen2012-07-271-8/+34
| | | | llvm-svn: 160898
* Eliminate the IS_PHI_DEF flag and VNInfo::setIsPHIDef().Jakob Stoklund Olesen2012-07-274-8/+2
| | | | | | | | A value number is a PHI def if and only if it begins at a block boundary. This can be derived from the def slot, a separate flag is not necessary. llvm-svn: 160893
* Add a -new-live-intervals experimental option.Jakob Stoklund Olesen2012-07-271-1/+36
| | | | | | | | | This option replaces the existing live interval computation with one based on LiveRangeCalc.cpp. The new algorithm does not depend on LiveVariables, and it can be run at any time, before or after leaving SSA form. llvm-svn: 160892
* Add <imp-def> of super-register when lowering SUBREG_TO_REG.Jakob Stoklund Olesen2012-07-271-4/+7
| | | | | | Patch by Tyler Nowicki! llvm-svn: 160888
* Use an otherwise unused variable.Jakob Stoklund Olesen2012-07-261-1/+1
| | | | llvm-svn: 160798
* Start scaffolding for a MachineTraceMetrics analysis pass.Jakob Stoklund Olesen2012-07-264-1/+726
| | | | | | | | | | | | | | | | | | | | | | | | This is still a work in progress. Out-of-order CPUs usually execute instructions from multiple basic blocks simultaneously, so it is necessary to look at longer traces when estimating the performance effects of code transformations. The MachineTraceMetrics analysis will pick a typical trace through a given basic block and provide performance metrics for the trace. Metrics will include: - Instruction count through the trace. - Issue count per functional unit. - Critical path length, and per-instruction 'slack'. These metrics can be used to determine the performance limiting factor when executing the trace, and how it will be affected by a code transformation. Initially, this will be used by the early if-conversion pass. llvm-svn: 160796
* Add a floor intrinsic.Dan Gohman2012-07-261-0/+5
| | | | llvm-svn: 160791
* Disable rematerialization in TwoAddressInstructionPass.Manman Ren2012-07-251-78/+6
| | | | | | | | | | | 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. llvm-svn: 160749
* Preserve 2-addr constraints in ConnectedVNInfoEqClasses.Jakob Stoklund Olesen2012-07-251-7/+4
| | | | | | | | | | | | | | | | | | | | When a live range splits into multiple connected components, we would arbitrarily assign <undef> uses to component 0. This is wrong when the use is tied to a def that gets assigned to a different component: %vreg69<def> = ADD8ri %vreg68<undef>, 1 The use and def must get the same virtual register. Fix this by assigning <undef> uses to the same component as the value defined by the instruction, if any: %vreg69<def> = ADD8ri %vreg69<undef>, 1 This fixes PR13402. The PR has a test case which I am not including because it is unlikely to keep exposing this behavior in the future. llvm-svn: 160739
* Verify two-address constraints more carefully.Jakob Stoklund Olesen2012-07-251-14/+7
| | | | | | Include <undef> operands and virtual registers after leaving SSA form. llvm-svn: 160734
* Change llvm_unreachable in SplitVectorOperand to report_fatal_error. Keeps ↵Craig Topper2012-07-241-1/+3
| | | | | | release builds from crashing if code uses an intrinsic with an illegal type. llvm-svn: 160661
* Fix a typo (the the => the)Sylvestre Ledru2012-07-232-2/+2
| | | | llvm-svn: 160621
* Fixed DAGCombine optimizations which generate select_cc for targetsNadav Rotem2012-07-231-33/+47
| | | | | | | | | | that do not support it (X86 does not lower select_cc). PR: 13428 Together with Michael Kuperstein <michael.m.kuperstein@intel.com> llvm-svn: 160619
* Tidy up. Fix indentation and remove trailing whitespace.Craig Topper2012-07-231-16/+14
| | | | llvm-svn: 160617
* Change llvm_unreachable in SplitVectorResult to report_fatal_error. Keeps ↵Craig Topper2012-07-231-1/+2
| | | | | | release builds from crashing if code uses an intrinsic with an illegal type. For instance 256-bit AVX intrinsics without having AVX enabled. llvm-svn: 160616
* Remove unused private member variables uncovered by the recent changes to ↵Benjamin Kramer2012-07-203-16/+2
| | | | | | clang's -Wunused-private-field. llvm-svn: 160583
OpenPOWER on IntegriCloud