aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen
AgeCommit message (Collapse)AuthorFilesLines
2011-04-01Add comments.Evan Cheng1-2/+4
llvm-svn: 128730
2011-04-01Assign node order numbers to results of call instruction lowering. This ↵Evan Cheng1-4/+8
should improve src line debug info when sdisel is used. rdar://9199118 llvm-svn: 128728
2011-04-01Issue libcalls __udivmod*i4 / __divmod*i4 for div / rem pairs.Evan Cheng2-19/+154
rdar://8911343 llvm-svn: 128696
2011-03-31The basic register allocator must also use the inline spiller.Jakob Stoklund Olesen1-1/+1
It is using a trivial rewriter that doesn't know how to insert spill code requested by the standard spiller. llvm-svn: 128688
2011-03-31Don't completely eliminate identity copies that also modify super register ↵Jakob Stoklund Olesen1-6/+12
liveness. Turn them into noop KILL instructions instead. This lets the scavenger know when super-registers are killed and defined. llvm-svn: 128645
2011-03-31Allow kill flags on two-address instructions. They are harmless.Jakob Stoklund Olesen1-6/+2
llvm-svn: 128643
2011-03-31Mark all uses as <undef> when joining a copy.Jakob Stoklund Olesen3-8/+20
This way, shrinkToUses() will ignore the instruction that is about to be deleted, and we avoid leaving invalid live ranges that SplitKit doesn't like. Fix a misunderstanding in MachineVerifier about <def,undef> operands. The <undef> flag is valid on def operands where it has the same meaning as <undef> on a use operand. It only applies to sub-register defines which also read the full register. llvm-svn: 128642
2011-03-31Remove dead code.Devang Patel1-5/+1
llvm-svn: 128639
2011-03-31Fix bug found by valgrind.Jakob Stoklund Olesen1-1/+1
llvm-svn: 128634
2011-03-31lib/CodeGen/LiveIntervalAnalysis.cpp: [PR9590] Don't use ↵NAKAMURA Takumi1-1/+3
std::pow(float,float) here. We don't expect the real "powf()" on some hosts (and powf() would be available on other hosts). For consistency, std::pow(double,double) may be called instead. Or, precision issue might attack us, to see unstable regalloc and stack coloring. llvm-svn: 128629
2011-03-31Pick a conservative register class when creating a small live range for remat.Jakob Stoklund Olesen1-1/+1
The rematerialized instruction may require a more constrained register class than the register being spilled. In the test case, the spilled register has been inflated to the DPR register class, but we are rematerializing a load of the ssub_0 sub-register which only exists for DPR_VFP2 registers. The register class is reinflated after spilling, so the conservative choice is only temporary. llvm-svn: 128610
2011-03-30Fix evil VirtRegRewriter bug.Jakob Stoklund Olesen1-0/+28
The rewriter can keep track of multiple stack slots in the same register if they happen to have the same value. When an instruction modifies a stack slot by defining a register that is mapped to a stack slot, other stack slots in that register are no longer valid. This is a very rare problem, and I don't have a simple test case. I get the impression that VirtRegRewriter knows it is about to be deleted, inventing a last opaque problem. <rdar://problem/9204040> llvm-svn: 128562
2011-03-30Teach VirtRegRewriter about the new virtual register numbers. No functional ↵Jakob Stoklund Olesen1-10/+11
change. llvm-svn: 128561
2011-03-30Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad1-3/+3
PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
2011-03-30(Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad1-0/+1
llvm-svn: 128535
2011-03-30Treat clones the same as their origin.Jakob Stoklund Olesen3-6/+29
When DCE clones a live range because it separates into connected components, make sure that the clones enter the same register allocator stage as the register they were cloned from. For instance, clones may be split even when they where created during spilling. Other registers created during spilling are not candidates for splitting or even (re-)spilling. llvm-svn: 128524
2011-03-29Tidy up. 80 columns and trailing whitespace.Jim Grosbach1-145/+146
llvm-svn: 128504
2011-03-29Recompute register class and hint for registers created during spilling.Jakob Stoklund Olesen6-60/+87
The spill weight is not recomputed for an unspillable register - it stays infinite. llvm-svn: 128490
2011-03-29Remember to use the correct register when rematerializing for snippets.Jakob Stoklund Olesen2-6/+7
llvm-svn: 128469
2011-03-29Run dead code elimination immediately after rematerialization.Jakob Stoklund Olesen1-9/+24
This may eliminate some uses of the spilled registers, and we don't want to insert reloads for that. llvm-svn: 128468
2011-03-29Inline check that's used only once.Bill Wendling1-2/+1
llvm-svn: 128465
2011-03-29Rework the logic (and removing the bad check for an unreachable block) so thatBill Wendling1-8/+5
the FailBB dominator is correctly calculated. Believe it or not, there isn't a functionality change here. llvm-svn: 128455
2011-03-29Don't try to add stack protector logic to a dead basic block. It messes upBill Wendling1-1/+2
dominator information. llvm-svn: 128452
2011-03-29Handle the special case when all uses follow the last split point.Jakob Stoklund Olesen1-1/+2
llvm-svn: 128450
2011-03-29Properly enable rematerialization when spilling after live range splitting.Jakob Stoklund Olesen3-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
2011-03-28In some cases, the "fail BB dominator" may be null after the BB was split (andBill Wendling1-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
2011-03-28Integrated-As: Add support for setting the AllowTemporaryLabels flag viaDaniel Dunbar1-0/+6
integrated-as. llvm-svn: 128431
2011-03-27Amend debug output.Jakob Stoklund Olesen1-2/+3
llvm-svn: 128398
2011-03-27Drop interference reassignment in favor of eviction.Jakob Stoklund Olesen1-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
2011-03-26Use individual register classes when spilling snippets.Jakob Stoklund Olesen2-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
2011-03-26Turn SelectionDAGBuilder::GetRegistersForValue into a local function.Benjamin Kramer2-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
2011-03-26Collect and coalesce DBG_VALUE instructions before emitting the function.Jakob Stoklund Olesen2-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
2011-03-25Emit less labels for debug info and stop emitting .loc directives for ↵Jakob Stoklund Olesen2-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
2011-03-25Fix for -pre-RA-sched=source.Andrew Trick1-0/+2
Yet another case of unchecked NULL node (for physreg copy). May fix PR9509. llvm-svn: 128266
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-24Keep track of directory namd and fIx regression caused by Rafael's patch ↵Devang Patel2-12/+29
r119613. A better approach would be to move source id handling inside MC. llvm-svn: 128233
2011-03-23PR9535: add support for splitting and scalarizing vector ISD::FP_ROUND.Eli Friedman2-60/+30
Also cleaning up some duplicated code while I'm here. llvm-svn: 128176
2011-03-23Ensure that def-side physreg copies are scheduled above any other usesAndrew Trick1-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
2011-03-23whitespaceAndrew Trick1-2/+2
llvm-svn: 128163
2011-03-23Don't coalesce identical DBG_VALUE instructions prematurely.Jakob Stoklund Olesen1-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
2011-03-23Notify the delegate before removing dead values from a live interval.Jakob Stoklund Olesen1-0/+2
The register allocator needs to know when the range shrinks. llvm-svn: 128145
2011-03-23Allow the allocation of empty live ranges that have uses.Jakob Stoklund Olesen1-1/+8
Empty ranges may represent undef values. llvm-svn: 128144
2011-03-23Dump the register map before rewriting.Jakob Stoklund Olesen1-1/+1
llvm-svn: 128143
2011-03-23Added block number and name to isel debug output.Andrew Trick1-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
2011-03-22Reapply r128045 and r128051 with fixes.Jakob Stoklund Olesen3-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
2011-03-22Revert r128045 and r128051, debug info enhancements.Andrew Trick3-77/+49
Temporarily reverting these to see if we can get llvm-objdump to link. Hopefully this is not the problem. llvm-svn: 128097
2011-03-22Clear map after use.Jakob Stoklund Olesen1-0/+1
This is likely to fix the segfault in llvm-gcc-x86_64-darwin10-cross-mingw32. llvm-svn: 128051
2011-03-22Dont emit 'DBG_VALUE %noreg, ...' to terminate user variable ranges.Jakob Stoklund Olesen3-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
2011-03-21Grammar-o.Eric Christopher1-1/+1
llvm-svn: 128004