aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/RegAllocLinearScan.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-06-27Remove the experimental (and unused) pre-ra splitting pass. Greedy regalloc ↵Evan Cheng1-9/+0
can split live ranges. llvm-svn: 133962
2011-06-26There is only one register coalescer. Merge it into the base class andRafael Espindola1-2/+2
remove the analysis group. llvm-svn: 133899
2011-06-26Move RegisterCoalescer.h to lib/CodeGen.Rafael Espindola1-1/+1
llvm-svn: 133895
2011-06-17Only call TRI::getRawAllocationOrder to resolve a target-dependent hint.Jakob Stoklund Olesen1-2/+6
llvm-svn: 133313
2011-06-16Rename TRI::getAllocationOrder() to getRawAllocationOrder().Jakob Stoklund Olesen1-7/+7
Also switch the return type to ArrayRef<unsigned> which works out nicely for ARM's implementation of this function because of the clever ArrayRef constructors. The name change indicates that the returned allocation order may contain reserved registers as has been the case for a while. llvm-svn: 133216
2011-06-16Switch linear scan to using RegisterClassInfo.Jakob Stoklund Olesen1-18/+12
This avoids the manual filtering of reserved registers and removes the dependency on allocation_order_begin(). Palliative care... llvm-svn: 133177
2011-04-23Remove unused STL header includes.Jay Foad1-1/+0
llvm-svn: 130068
2011-04-19Avoid write-after-write issue hazards for Cortex-A9.Bob Wilson1-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
2011-04-15Fix a ton of comment typos found by codespell. Patch byChris Lattner1-1/+1
Luis Felipe Strano Moraes! llvm-svn: 129558
2011-04-04Allow coalescing with reserved physregs in certain cases:Jakob Stoklund Olesen1-1/+1
When a virtual register has a single value that is defined as a copy of a reserved register, permit that copy to be joined. These virtual register are usually copies of the stack pointer: %vreg75<def> = COPY %ESP; GR32:%vreg75 MOV32mr %vreg75, 1, %noreg, 0, %noreg, %vreg74<kill> MOV32mi %vreg75, 1, %noreg, 8, %noreg, 0 MOV32mi %vreg75<kill>, 1, %noreg, 4, %noreg, 0 CALLpcrel32 ... Coalescing these virtual registers early decreases register pressure. Previously, they were coalesced by RALinScan::attemptTrivialCoalescing after register allocation was completed. The lower register pressure causes the mcinst-lowering-cmp0.ll test case to fail because it depends on linear scan spilling a particular register. I am deleting 2008-08-05-SpillerBug.ll because it is counting the number of instructions emitted, and its revision history shows the 'correct' count being edited many times. llvm-svn: 128845
2011-03-25No functionality change. Fix up some whitespace and switch out "" for '' whenNick Lewycky1-3/+3
printing a single character. llvm-svn: 128256
2011-03-25Ignore special ARM allocation hints for unexpected register classes.Jakob Stoklund Olesen1-0/+1
Add an assertion to linear scan to prevent it from allocating registers outside the register class. <rdar://problem/9183021> llvm-svn: 128254
2011-03-10Change the Spiller interface to take a LiveRangeEdit reference.Jakob Stoklund Olesen1-2/+5
This makes it possible to register delegates and get callbacks when the spiller edits live ranges. llvm-svn: 127389
2011-03-10Make SpillIs an optional pointer. Avoid creating a bunch of temporary ↵Jakob Stoklund Olesen1-3/+3
SmallVectors. llvm-svn: 127388
2011-03-03Avoid comparing invalid slot indexes, and assert that it doesn't happen.Jakob Stoklund Olesen1-2/+2
The SlotIndex created by the default construction does not represent a position in the function, and it doesn't make sense to compare it to other indexes. llvm-svn: 126924
2011-01-27Avoid modifying the OneClassForEachPhysReg map while iterating over it.Bob Wilson1-2/+6
Linear scan regalloc is currently assuming that any register aliased with a member of a regclass must also be in at least one regclass. That is not always true. For example, for X86, RIP is in a regclass but IP is not. If you're unlucky, this can cause a crash by invalidating the iterator. llvm-svn: 124365
2011-01-10Simplify a bunch of isVirtualRegister() and isPhysicalRegister() logic.Jakob Stoklund Olesen1-2/+1
These functions not longer assert when passed 0, but simply return false instead. No functional change intended. llvm-svn: 123155
2011-01-06Zap the last two -Wself-assign warnings in llvm.Jakob Stoklund Olesen1-7/+3
Simplify RALinScan::DowngradeRegister with TRI::getOverlaps while we are there. llvm-svn: 122940
2010-12-23Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin1-1/+1
new gcc warning that complains on self-assignments and self-initializations. llvm-svn: 122458
2010-12-03Emit DBG_VALUE instructions from LiveDebugVariables.Jakob Stoklund Olesen1-0/+7
llvm-svn: 120842
2010-11-19Don't attempt trivial coalescing for sub-register copies.Jakob Stoklund Olesen1-0/+4
Patch by Krister Wombell! llvm-svn: 119791
2010-11-16Print out the register class of the current interval.Jakob Stoklund Olesen1-2/+3
llvm-svn: 119374
2010-11-10Hook up AliasAnalysis in InlineSpiller. This is used for rematerializingJakob Stoklund Olesen1-0/+4
constant loads. llvm-svn: 118741
2010-10-28Make MachineDominators available for SplitEditor. We are going to need it forJakob Stoklund Olesen1-0/+2
proper SSA updating. This doesn't cause MachineDominators to be recomputed since we are already requiring MachineLoopInfo which uses dominators as well. llvm-svn: 117598
2010-10-26Make the spiller responsible for updating the LiveStacks analysis.Jakob Stoklund Olesen1-33/+2
llvm-svn: 117337
2010-10-19Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson1-0/+11
exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
2010-10-12Begin adding static dependence information to passes, which will allow us toOwen Anderson1-1/+11
perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
2010-10-07Now with fewer extraneous semicolons!Owen Anderson1-1/+1
llvm-svn: 115996
2010-09-25Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing ↵Lang Hames1-5/+3
whether LiveIntervals::getInstructionFromIndex(def) returns NULL. llvm-svn: 114791
2010-09-01Tweak to ignoring reserved regs. The allocator was occasionally still lookingJim Grosbach1-2/+4
at them since they'd end up in the register weights list. Tell it to stop doing that. llvm-svn: 112756
2010-09-01tidy up trailing whitespace and an 80 column violation.Jim Grosbach1-24/+25
llvm-svn: 112746
2010-09-01cleanup per feedback. use a helper function for getting the first non-reservedJim Grosbach1-17/+14
physical register in a register class. Make sure to assert if the register class is empty. llvm-svn: 112743
2010-09-01The register allocator shouldn't consider allocating reserved registers.Jim Grosbach1-5/+30
r112728 did this for fast regalloc. llvm-svn: 112741
2010-08-13Clean up the Spiller.h interface.Jakob Stoklund Olesen1-6/+11
The earliestStart argument is entirely specific to linear scan allocation, and can be easily calculated by RegAllocLinearScan. Replace std::vector with SmallVector. llvm-svn: 111055
2010-08-06Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson1-1/+1
llvm-svn: 110460
2010-08-06Revert r110396 to fix buildbots.Owen Anderson1-1/+1
llvm-svn: 110410
2010-08-05Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson1-1/+1
address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
2010-07-27GrammarJim Grosbach1-3/+3
llvm-svn: 109525
2010-07-21Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson1-2/+2
llvm-svn: 109045
2010-07-20Change the createSpiller interface to take a MachineFunctionPass argument.Jakob Stoklund Olesen1-1/+1
The spillers can pluck the analyses they need from the pass reference. Switch some never-null pointers to references. llvm-svn: 108969
2010-07-19Spillers may alter MachineLoopInfo when breaking critical edges, so make itJakob Stoklund Olesen1-2/+2
non-const. llvm-svn: 108734
2010-07-16Remove many calls to TII::isMoveInstr. Targets should be producing COPY anyway.Jakob Stoklund Olesen1-31/+9
TII::isMoveInstr is going tobe completely removed. llvm-svn: 108507
2010-07-08Convert EXTRACT_SUBREG to COPY when emitting machine instrs.Jakob Stoklund Olesen1-2/+21
EXTRACT_SUBREG no longer appears as a machine instruction. Use COPY instead. Add isCopy() checks in many places using isMoveInstr() and isExtractSubreg(). The isMoveInstr hook will be removed later. llvm-svn: 107879
2010-07-0280-col fixup.Eric Christopher1-1/+2
llvm-svn: 107537
2010-06-24Don't return a std::vector in the Spiller interface, but take a reference to aJakob Stoklund Olesen1-5/+2
vector instead. This avoids needless copying and allocation. Add documentation. llvm-svn: 106788
2010-05-15improve portability to systems that don't have powf/modf (e.g. solaris 9)Chris Lattner1-1/+1
patch by Evzen Muller! llvm-svn: 103876
2010-04-07rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner1-1/+1
llvm-svn: 100709
2010-02-26Remove dead codeJakob Stoklund Olesen1-4/+0
llvm-svn: 97261
2010-01-05Change errs() to dbgs().David Greene1-32/+32
llvm-svn: 92583
2009-12-19Fix a bunch of little errors that Clang complains about when its being pedanticDouglas Gregor1-1/+1
llvm-svn: 91764