Commit Graph

8124 Commits

Author SHA1 Message Date
Evan Cheng 5d2245b210 Code clean up.
llvm-svn: 85046
2009-10-25 07:49:57 +00:00
Evan Cheng 19348415c4 Do not delete identity insert_subreg even if dest is virtual. Let later passes delete them. This avoids register scavenger complain.
llvm-svn: 85045
2009-10-25 07:48:51 +00:00
Nick Lewycky 974e12b2d3 Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.

llvm-svn: 85043
2009-10-25 06:57:41 +00:00
Nick Lewycky 02d5f77d26 Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.

llvm-svn: 85042
2009-10-25 06:33:48 +00:00
Jim Grosbach 5027d359e7 When the scavenger is looking for a good candidate location to restore from a
spill, it should avoid doing so inside the live range of a virtual register.

llvm-svn: 85026
2009-10-25 00:45:07 +00:00
Dan Gohman 8f4078ba39 Rename isLoopExit to isLoopExiting, for consistency with the wording
used elsewhere - an exit block is a block outside the loop branched to
from within the loop. An exiting block is a block inside the loop that
branches out.

llvm-svn: 85019
2009-10-24 23:34:26 +00:00
Anton Korobeynikov b4a1347be2 Add some asserts to catch copyRegToReg() fails early
llvm-svn: 84983
2009-10-24 00:27:00 +00:00
Evan Cheng d638bc310a Identity copies should not contribute to spill weight.
llvm-svn: 84978
2009-10-23 23:09:19 +00:00
Dan Gohman 4ef112be62 APInt-ify the gep scaling code, so that it correctly handles the case where
the scale overflows pointer-sized arithmetic. This fixes PR5281.

llvm-svn: 84954
2009-10-23 17:57:43 +00:00
Bill Wendling 6aea1a2a5a Neuter stack protectors by only checking character arrays. This is what GCC
does.

llvm-svn: 84916
2009-10-23 00:01:05 +00:00
David Goodwin 02ad4cb32e Allow the target to select the level of anti-dependence breaking that should be performed by the post-RA scheduler. The default is none.
llvm-svn: 84911
2009-10-22 23:19:17 +00:00
Bill Wendling 4f0b8d7861 Tidying up some code and comments. No functionality change.
llvm-svn: 84894
2009-10-22 20:48:59 +00:00
Anton Korobeynikov 8626367e38 Fix null pointer dereference.
llvm-svn: 84806
2009-10-22 00:15:17 +00:00
Dan Gohman ff97acd8f1 Revert the main portion of r31856. It was causing BranchFolding
to break up CFG diamonds by banishing one of the blocks to the end of
the function, which is bad for code density and branch size.

This does pessimize MultiSource/Benchmarks/Ptrdist/yacr2, the
benchmark cited as the reason for the change, however I've examined
the code and it looks more like a case of gaming a particular
branch than of being generally applicable.

llvm-svn: 84803
2009-10-22 00:03:58 +00:00
Jim Grosbach c16c8c707b The spill restore needs to be resolved to the SP/FP just like the spill
llvm-svn: 84792
2009-10-21 22:59:56 +00:00
Jim Grosbach bc30143451 Cleanup of frame index scavenging. Better code flow and more accurately
handles T2 and ARM use cases.

llvm-svn: 84761
2009-10-21 15:26:21 +00:00
Evan Cheng f781bd8947 Need a comma after imp-use.
llvm-svn: 84749
2009-10-21 07:56:02 +00:00
Dan Gohman 682a2d154a Revert r84658 and r84691. They were causing llvm-gcc bootstrap to fail.
llvm-svn: 84727
2009-10-21 01:44:44 +00:00
David Goodwin 4388beb884 Respect src register allocation requirements when breaking anti-dependencies. Remove some dead code.
llvm-svn: 84691
2009-10-20 22:50:43 +00:00
Anton Korobeynikov a6faf60831 Fix invalid for vector types fneg(bitconvert(x)) => bitconvert(x ^ sign)
transform.

llvm-svn: 84683
2009-10-20 21:37:45 +00:00
Lang Hames 16edcd724a Oops. Backing out 84681 - needs to wait for the indexing patch.
llvm-svn: 84682
2009-10-20 21:28:22 +00:00
Lang Hames d8938d1ca8 Added some debugging output to pre-alloc splitting.
llvm-svn: 84681
2009-10-20 21:25:13 +00:00
David Goodwin baf6dd26ea Checkpoint more aggressive anti-dependency breaking for post-ra scheduler.
llvm-svn: 84658
2009-10-20 19:54:44 +00:00
Jim Grosbach d2ba321930 Better handle instructions that re-def a scratch register
llvm-svn: 84657
2009-10-20 19:52:35 +00:00
Jim Grosbach 5f2581a37a Register re-use for scavenged frame indices must check for re-deginition
of the register in the instruction which kills the scavenged value.

llvm-svn: 84641
2009-10-20 16:33:57 +00:00
Dan Gohman c0964a571b Re-apply r84295, with fixes to how the loop "top" and "bottom" blocks are
tracked. Instead of trying to manually keep track of these locations
while doing complex modifications, just recompute them when they're needed.
This fixes a bug in which the TopMBB and BotMBB were not correctly updated,
leading to invalid transformations.

llvm-svn: 84598
2009-10-20 04:50:37 +00:00
Evan Cheng ccc2e0cbda Trim unnecessary includes.
llvm-svn: 84597
2009-10-20 04:23:20 +00:00
Dan Gohman d383c2f6ba Add getTopBlock and getBottomBlock member functions to MachineLoopInfo.
llvm-svn: 84596
2009-10-20 04:16:37 +00:00
Evan Cheng fa4bcaec7c If the physical register being spilled does not have an interval, spill its sub-registers instead.
llvm-svn: 84586
2009-10-20 01:31:09 +00:00
Jim Grosbach 84f6235b6f Enable post-pass frame index register scavenging for ARM and Thumb2
llvm-svn: 84585
2009-10-20 01:26:58 +00:00
Jim Grosbach 5a5a3bc5d4 Adjust the scavenge register spilling to allow the target to choose an
appropriate restore location for the spill as well as perform the actual
save and restore.

The Thumb1 target uses this to make sure R12 is not clobbered while a spilled
scavenger register is live there.

llvm-svn: 84554
2009-10-19 22:27:30 +00:00
Anton Korobeynikov 8383c3d7f3 Revert r84295, this unbreaks llvm-gcc bootstrap on x86-64/linux
llvm-svn: 84516
2009-10-19 18:21:09 +00:00
Dan Gohman b0db9917af Fix a typo in a comment.
llvm-svn: 84504
2009-10-19 14:56:05 +00:00
Dan Gohman 20a327b31f Change a few instance variables to be local variables.
llvm-svn: 84503
2009-10-19 14:52:05 +00:00
Evan Cheng f0236e011e Spill slots cannot alias.
llvm-svn: 84432
2009-10-18 19:58:47 +00:00
Evan Cheng 0e9d9ca855 -Revert parts of 84326 and 84411. Distinquishing between fixed and non-fixed
stack slots and giving them different PseudoSourceValue's did not fix the
problem of post-alloc scheduling miscompiling llvm itself.
- Apply Dan's conservative workaround by assuming any non fixed stack slots can
alias other memory locations. This means a load from spill slot #1 cannot 
move above a store of spill slot #2. 
- Enable post-alloc scheduling for x86 at optimization leverl Default and above.

llvm-svn: 84424
2009-10-18 18:16:27 +00:00
Evan Cheng 0b8db2dab7 Only fixed stack objects and spill slots should be get FixedStack PseudoSourceValue.
llvm-svn: 84411
2009-10-18 06:27:36 +00:00
Daniel Dunbar 54279632f3 Fix my -Asserts warning fix.
llvm-svn: 84372
2009-10-17 23:15:04 +00:00
Daniel Dunbar 47dfc9ae1b Suppress -Asserts warning.
llvm-svn: 84327
2009-10-17 09:33:00 +00:00
Evan Cheng 4729191bb2 Distinquish stack slots from other stack objects. They (and fixed objects) get FixedStack PseudoSourceValues.
llvm-svn: 84326
2009-10-17 09:20:14 +00:00
Evan Cheng 8759585aba Revert 84315 for now. Re-thinking the patch.
llvm-svn: 84321
2009-10-17 07:53:04 +00:00
Evan Cheng 0818d87ed1 Rename getFixedStack to getStackObject. The stack objects represented are not
necessarily fixed. Only those will negative frame indices are "fixed."

llvm-svn: 84315
2009-10-17 06:22:26 +00:00
Evan Cheng a6e4db8ff7 80 col violation.
llvm-svn: 84311
2009-10-17 06:05:11 +00:00
Dan Gohman 650997fb0b Delete an obsolete comment.
llvm-svn: 84300
2009-10-17 01:37:38 +00:00
Victor Hernandez a3aaf85e23 Remove MallocInst from LLVM Instructions.
llvm-svn: 84299
2009-10-17 01:18:07 +00:00
Dan Gohman 0d3d9ee03e Enhance CodePlacementOpt's unconditional intra-loop branch elimination logic
to be more general and understand more varieties of loops.

Teach CodePlacementOpt to reorganize the basic blocks of a loop so that
they are contiguous. This also includes a fair amount of logic for preserving
fall-through edges while doing so. This fixes a BranchFolding-ism where blocks
which can't be made to use a fall-through edge and don't conveniently fit
anywhere nearby get tossed out to the end of the function.

llvm-svn: 84295
2009-10-17 00:32:43 +00:00
Mon P Wang b1baaf5ab9 Allow widening of extract subvector
llvm-svn: 84279
2009-10-16 22:05:48 +00:00
Devang Patel 12524fd2e5 Do not emit name entry for a pointer type.
llvm-svn: 84276
2009-10-16 21:27:43 +00:00
Evan Cheng 007ceb4603 Change createPostRAScheduler so it can be turned off at llc -O1.
llvm-svn: 84273
2009-10-16 21:06:15 +00:00
Devang Patel d0099a94db If there is not any llvm instruction associated with each lexical scope encoded in debug info then create such scope on demand for variable info.
llvm-svn: 84262
2009-10-16 18:18:03 +00:00
Evan Cheng 8b614768f8 If post-alloc scheduler is not enabled, it should return false, not true.
llvm-svn: 84248
2009-10-16 06:10:34 +00:00
Zhongxing Xu 47062ce503 Indent code.
llvm-svn: 84247
2009-10-16 05:42:28 +00:00
Evan Cheng 9c096840a0 80 column violation.
llvm-svn: 84244
2009-10-16 05:18:39 +00:00
Jakob Stoklund Olesen e4197250cc Report errors correctly for unselected target intrinsics.
llvm-svn: 84193
2009-10-15 18:50:03 +00:00
Dan Gohman c9af381df8 Make CodePlacementOpt align loops, rather than loop headers. The
header is just the entry block to the loop, and it needn't be at
the top of the loop in the code layout.

Remove the code that suppressed loop alignment for outer loops,
so that outer loops are aligned.

llvm-svn: 84158
2009-10-15 00:36:22 +00:00
Evan Cheng 2f61e0946a When LiveVariables is adding implicit-def to model "partial dead", add the earlyclobber marker if the superreg def has it.
llvm-svn: 84153
2009-10-14 23:39:27 +00:00
Evan Cheng 70b1fa5a24 Print earlyclobber for implicit-defs as well.
llvm-svn: 84152
2009-10-14 23:37:31 +00:00
Jim Grosbach b1d6fde13e Make loop not recalc getNumOperands() each time around
llvm-svn: 84138
2009-10-14 21:22:39 +00:00
Devang Patel 6875c5ebe4 Add support to record DbgScope as inlined scope.
llvm-svn: 84134
2009-10-14 21:08:09 +00:00
Jim Grosbach 02f5588f62 quiet compiler warning
llvm-svn: 84133
2009-10-14 21:07:11 +00:00
Duncan Sands 8e6ccb65df I don't see any point in having both eh.selector.i32 and eh.selector.i64,
so get rid of eh.selector.i64 and rename eh.selector.i32 to eh.selector.
Likewise for eh.typeid.for.  This aligns us with gcc, which always uses a
32 bit value for the selector on all platforms.  My understanding is that
the register allocator used to assert if the selector intrinsic size didn't
match the pointer size, and this was the reason for introducing the two
variants.  However my testing shows that this is no longer the case (I
fixed some bugs in selector lowering yesterday, and some more today in the
fastisel path; these might have caused the original problems).

llvm-svn: 84106
2009-10-14 16:11:37 +00:00
Dan Gohman df777edea9 This remat entry is basically done. There are hooks to allow targets
to remat non-load instructions as loads, and the remat code now uses
the UnmodeledSideEffects flags, MachineMemOperands, and similar things
to decide which instructions are valid for rematerialization.

llvm-svn: 84060
2009-10-14 00:02:01 +00:00
Dan Gohman 0aa63c97ce Add a few README.txt items.
llvm-svn: 84059
2009-10-13 23:58:05 +00:00
Devang Patel d7ebfe3963 s/DebugLoc.CompileUnit/DebugLoc.Scope/g
s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g

llvm-svn: 84054
2009-10-13 23:28:53 +00:00
Duncan Sands 18a956cb4a Introduce new convenience methods for sign extending or
truncating an SDValue (depending on whether the target
type is bigger or smaller than the value's type); or zero
extending or truncating it.  Use it in a few places (this
seems to be a popular operation, but I only modified cases
of it in SelectionDAGBuild).  In particular, the eh_selector
lowering was doing this wrong due to a repeated rather than
inverted test, fixed with this change.

llvm-svn: 84027
2009-10-13 21:04:12 +00:00
David Goodwin 4c98efb917 Add debugging output.
llvm-svn: 84011
2009-10-13 19:16:03 +00:00
Daniel Dunbar cdf01b5d82 Fix a -Asserts warning.
llvm-svn: 83950
2009-10-13 06:47:08 +00:00
Devang Patel 0f58bec599 Find enclosing subprogram info.
llvm-svn: 83922
2009-10-12 23:11:24 +00:00
Devang Patel 0af2a420cd Set default location for a function if it is not set.
llvm-svn: 83921
2009-10-12 23:10:55 +00:00
Dale Johannesen 06243d7bf2 Revert the kludge in 76703. I got a clean
bootstrap of FSF-style PPC, so there is some
reason to believe the original bug (which was
never analyzed) has been fixed, probably by
82266.

llvm-svn: 83871
2009-10-12 18:49:00 +00:00
Dan Gohman 32eed95a78 Remove a redundant member variable.
llvm-svn: 83857
2009-10-12 16:44:10 +00:00
Nate Begeman a3ed9edd40 More heuristics for Combiner-AA. Still catches all important cases, but
compile time penalty on gnugo, the worst case in MultiSource, is down to
about 2.5% from 30%

llvm-svn: 83824
2009-10-12 05:53:58 +00:00
Chris Lattner 0840c823e4 Fix PR5087, patch by Jakub Staszak!
llvm-svn: 83822
2009-10-12 04:22:44 +00:00
Dan Gohman b8120770b4 Create a new InstrEmitter class for translating SelectionDAG nodes
into MachineInstrs. This is mostly just moving the code from
ScheduleDAGSDNodesEmit.cpp into a new class. This decouples MachineInstr
emitting from scheduling.

llvm-svn: 83699
2009-10-10 01:32:21 +00:00
Dan Gohman a22f2d8614 Make getMachineNode return a MachineSDNode* instead of a generic SDNode*
since it won't do any folding. This will help avoid some inconvenient
casting.

llvm-svn: 83698
2009-10-10 01:29:16 +00:00
Dan Gohman 26e9b89b7c Fix a missing initialization of PostRAScheduler's AA member.
llvm-svn: 83695
2009-10-10 00:15:38 +00:00
Dan Gohman 918ec53c64 The ScheduleDAG framework now requires an AliasAnalysis argument, though
it isn't needed in the ScheduleDAGSDNodes schedulers.

llvm-svn: 83691
2009-10-09 23:33:48 +00:00
Dan Gohman 87b02d5bbc Factor out LiveIntervalAnalysis' code to determine whether an instruction
is trivially rematerializable and integrate it into
TargetInstrInfo::isTriviallyReMaterializable. This way, all places that
need to know whether an instruction is rematerializable will get the
same answer.

This enables the useful parts of the aggressive-remat option by
default -- using AliasAnalysis to determine whether a memory location
is invariant, and removes the questionable parts -- rematting operations
with virtual register inputs that may not be live everywhere.

llvm-svn: 83687
2009-10-09 23:27:56 +00:00
Devang Patel df45c7f642 Extract scope information from the variable itself, instead of relying on alloca or llvm.dbg.declare location.
While recording beginning of a function, use scope info from the first location entry instead of just relying on first location entry itself.

llvm-svn: 83684
2009-10-09 22:42:28 +00:00
Dan Gohman e19c1810d7 isTriviallyReMaterializable checks the
TargetInstrDesc::isRematerializable flag, so it isn't necessary to do
this check in its callers.

llvm-svn: 83671
2009-10-09 21:02:10 +00:00
Dan Gohman dd76bb23d1 Add basic infrastructure and x86 support for preserving MachineMemOperand
information when unfolding memory references.

llvm-svn: 83656
2009-10-09 18:10:05 +00:00
Devang Patel fafa1fe2ad Check invalid debug info for enums. This may happen when underlyng enum is optimized away. Eventually DwarfChecker will clean this up during llvm verification stage.
llvm-svn: 83655
2009-10-09 17:51:49 +00:00
Jim Grosbach 26070c5cff when previous scratch register is killed, flag the value as no longer tracking
llvm-svn: 83653
2009-10-09 17:33:33 +00:00
Evan Cheng 7ddb844a2d Give Dan and my recent changes, machine LICM is now code size neutral.
llvm-svn: 83624
2009-10-09 06:31:25 +00:00
Evan Cheng ccd4545ecb Fix a logic error that caused non-rematable loop invariants loads to be licm'ed out of loop.
llvm-svn: 83622
2009-10-09 06:21:52 +00:00
Evan Cheng be27d61cbc Reset kill markers after live interval is reconstructed.
llvm-svn: 83608
2009-10-09 01:17:11 +00:00
Evan Cheng e23984fbbe Remove code that makes no sense.
llvm-svn: 83589
2009-10-08 22:42:35 +00:00
Devang Patel e1969dcd11 Clear variable debug info map at the end of the function.
llvm-svn: 83571
2009-10-08 20:41:17 +00:00
Bob Wilson 2a45a65511 Add a SelectionDAG getTargetInsertSubreg convenience function,
similar to getTargetExtractSubreg.

llvm-svn: 83564
2009-10-08 18:49:46 +00:00
Devang Patel 20b2a77765 Do not record line number to implicitly mark start of function if function has arguments. Extra line number entries trip gdb in some cases.
llvm-svn: 83563
2009-10-08 18:48:03 +00:00
Dan Gohman 09984279fd Add a form of addPreserved which takes a string argument, to allow passes
to declare that they preserve other passes without needing to pull in
additional header file or library dependencies. Convert MachineFunctionPass
and CodeGenLICM to make use of this.

llvm-svn: 83555
2009-10-08 17:00:02 +00:00
Jim Grosbach c0615aa17f Re-enable register scavenging in Thumb1 by default.
llvm-svn: 83521
2009-10-08 01:46:59 +00:00
Jim Grosbach 48a805bc6c bugfix. The target may use virtual registers that aren't tracked for re-use but are allocated by the scavenger. The re-use algorithm needs to watch for that.
llvm-svn: 83519
2009-10-08 01:09:45 +00:00
Jim Grosbach 456735c54b reverting thumb1 scavenging default due to test failure while I figure out what's up.
llvm-svn: 83501
2009-10-07 22:49:41 +00:00
Chris Lattner 63fe7ff7d9 second half of lazy liveness removal.
llvm-svn: 83500
2009-10-07 22:49:30 +00:00
Jim Grosbach 267fa622fa Enable thumb1 register scavenging by default.
llvm-svn: 83496
2009-10-07 22:26:31 +00:00
Jim Grosbach 63849cbd32 grammar
llvm-svn: 83483
2009-10-07 19:08:36 +00:00
Jim Grosbach 2af2253e49 add initializers for clarity. Add missing assignment of PrevLastUseOp.
llvm-svn: 83481
2009-10-07 18:44:24 +00:00
Owen Anderson de1cb40eb4 Remove LazyLiveness from the tree. It doesn't work right now, and I'm not going to have the time
to finish it any time soon.  If someone's interested it, they can resurrect it from SVN history.

llvm-svn: 83480
2009-10-07 18:40:17 +00:00
Dan Gohman 9b60992120 Replace some code for aggressive-remat with MachineInstr::isInvariantLoad, and
teach it how to recognize invariant physical registers.

llvm-svn: 83476
2009-10-07 17:47:20 +00:00
Dan Gohman be8137b0b4 Replace TargetInstrInfo::isInvariantLoad and its target-specific
implementations with a new MachineInstr::isInvariantLoad, which uses
MachineMemOperands and is target-independent. This brings MachineLICM
and other functionality to targets which previously lacked an
isInvariantLoad implementation.

llvm-svn: 83475
2009-10-07 17:38:06 +00:00
Dan Gohman db9493ce68 Add a few simple MachineVerifier checks for MachineMemOperands.
llvm-svn: 83474
2009-10-07 17:36:00 +00:00
Jim Grosbach fa14dd430c Add register-reuse to frame-index register scavenging. When a target uses
a virtual register to eliminate a frame index, it can return that register
and the constant stored there to PEI to track. When scavenging to allocate
for those registers, PEI then tracks the last-used register and value, and
if it is still available and matches the value for the next index, reuses
the existing value rather and removes the re-materialization instructions.
Fancier tracking and adjustment of scavenger allocations to keep more
values live for longer is possible, but not yet implemented and would likely
be better done via a different, less special-purpose, approach to the
problem.

eliminateFrameIndex() is modified so the target implementations can return
the registers they wish to be tracked for reuse.

ARM Thumb1 implements and utilizes the new mechanism. All other targets are
simply modified to adjust for the changed eliminateFrameIndex() prototype.

llvm-svn: 83467
2009-10-07 17:12:56 +00:00
Dan Gohman f8e4410994 Fix this comment. The loop header is the loop entry point.
llvm-svn: 83437
2009-10-07 00:33:10 +00:00
Devang Patel 4598eb6214 Add support to handle debug info attached to an instruction.
This is not yet enabled.

llvm-svn: 83400
2009-10-06 18:37:31 +00:00
Dan Gohman 10d3dc569b Instead of printing unnecessary basic block labels as labels in
verbose-asm mode, print comments instead. This eliminates a non-comment
difference between verbose-asm mode and non-verbose-asm mode.

Also, factor out the relevant code out of all the targets and into
target-independent code.

llvm-svn: 83392
2009-10-06 17:38:38 +00:00
Duncan Sands 9ed7b16bf3 Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type.  For example, to get
an i8* use getInt8PtrTy.

llvm-svn: 83379
2009-10-06 15:40:36 +00:00
Jim Grosbach fa21fe7c3d grammar
llvm-svn: 83378
2009-10-06 15:03:44 +00:00
Devang Patel 7d838bb66e Fix cut-n-pasto.
llvm-svn: 83367
2009-10-06 03:15:38 +00:00
Devang Patel 051454a16f Update processDebugLoc() so that it can be used to process debug info before and after printing an instruction.
llvm-svn: 83363
2009-10-06 02:19:11 +00:00
Devang Patel 2980a22028 Remove dead code.
llvm-svn: 83362
2009-10-06 02:01:32 +00:00
Devang Patel 8db360da7b Add utility routine to set begin and end labels for DbgScopes.
This will be used by processDebugLoc().

llvm-svn: 83361
2009-10-06 01:50:42 +00:00
Devang Patel 849e59abb2 Remove unintentional function decl.
llvm-svn: 83356
2009-10-06 01:31:35 +00:00
Devang Patel 475d32a987 Add utility routine to collect variable debug info. This is not yet used.
llvm-svn: 83355
2009-10-06 01:26:37 +00:00
Devang Patel bb802206d2 Set default location for the function if it is not already set.
This code is not  yet enabled.

llvm-svn: 83349
2009-10-06 00:09:08 +00:00
Devang Patel d859d86538 Existence of a compile unit for input source file is a good indicator to check debug info's presence in a module.
llvm-svn: 83348
2009-10-06 00:03:14 +00:00
Devang Patel 1c9eef72b4 If subprogram die is not available then construct new one.
This can happen if debug info is processed lazily.

llvm-svn: 83347
2009-10-05 23:59:00 +00:00
Devang Patel 4c420eca41 Adjust context for the global variables that are not at file scope, e.g.
void foo() { static int bar = 42; }
Here, foo's DIE is parent of bar's DIE.

llvm-svn: 83344
2009-10-05 23:40:42 +00:00
Devang Patel 4144a82154 Set address while constructing DIE.
llvm-svn: 83343
2009-10-05 23:22:08 +00:00
Jim Grosbach 2dfb5da6bb In Thumb1, the register scavenger is not always able to use an emergency
spill slot. When frame references are via the frame pointer, they will be
negative, but Thumb1 load/store instructions only allow positive immediate
offsets. Instead, Thumb1 will spill to R12.

llvm-svn: 83336
2009-10-05 22:30:23 +00:00
Devang Patel 2089d16140 Gracefully handle various scopes while recording source line info.
llvm-svn: 83317
2009-10-05 18:03:19 +00:00
Chris Lattner fdd8790718 strength reduce a ton of type equality tests to check the typeid (Through
the new predicates I added) instead of going through a context and doing a
pointer comparison.  Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.

llvm-svn: 83297
2009-10-05 05:54:46 +00:00
Chris Lattner ff00c3562a stop MachineFunctionPass from claiming that it preserves LoopDependence info,
which causes dependence info to be linked into lli.

llvm-svn: 83289
2009-10-05 02:35:05 +00:00
Jakob Stoklund Olesen 63c733faf9 Whitespace and formatting.
llvm-svn: 83285
2009-10-04 18:18:39 +00:00
Lang Hames a7780905e7 Oops. Renamed remaining MachineInstrIndex references.
llvm-svn: 83255
2009-10-03 04:31:31 +00:00
Lang Hames 920301ecc5 Renamed MachineInstrIndex to LiveIndex.
llvm-svn: 83254
2009-10-03 04:21:37 +00:00
Benjamin Kramer 3b008a3a65 Fix a use-after-free in post-ra-scheduling.
MI->addOperand invalidates references to it's operands, avoid touching
the operand after a new one was added.

llvm-svn: 83249
2009-10-02 15:59:52 +00:00
David Goodwin d725159d9d All callee-saved registers are live-out of a return block.
llvm-svn: 83223
2009-10-01 23:28:47 +00:00
David Goodwin 1cc6dd97da Remove neonfp attribute and instead set default based on CPU string. Add -arm-use-neon-fp to override the default.
llvm-svn: 83218
2009-10-01 22:19:57 +00:00
David Goodwin 9a051a5922 Restore the -post-RA-scheduler flag as an override for the target specification. Remove -mattr for setting PostRAScheduler enable and instead use CPU string.
llvm-svn: 83215
2009-10-01 21:46:35 +00:00
Devang Patel 75cc16c0f2 Add support to extract lexical scope information from DebugLoc attached with an machine instruction.
This is not yet enabled.

llvm-svn: 83210
2009-10-01 20:31:14 +00:00
David Goodwin be3039e776 Use MachineFrameInfo.getPristineRegs() to determine which callee-saved registers are available for anti-dependency breaking. Some cleanup.
llvm-svn: 83208
2009-10-01 19:45:32 +00:00
Devang Patel 787f94c28d Record first and last instruction of a scope in DbgScope.
llvm-svn: 83207
2009-10-01 18:25:23 +00:00
Evan Cheng 4fb2891396 Observe hasExtraSrcRegAllocReq and hasExtraDefRegAllocReq. Do not change
operands of instructions with these properties while breaking anti-dep.

llvm-svn: 83198
2009-10-01 08:26:23 +00:00
Devang Patel 34986f12e6 Add another MDNode into DebugLocTuple. This will be used to keep track of inlined functions.
llvm-svn: 83190
2009-10-01 01:15:28 +00:00
Devang Patel 4dbca6dfd4 If location info is attached with an instruction then keep track of alloca slots used by a variable. This info will be used by AsmPrinter to emit debug info for variables.
llvm-svn: 83189
2009-10-01 01:03:26 +00:00
Devang Patel e0709cfc92 Use MachineInstr as an processDebugLoc() argument.
This will allow processDebugLoc() to handle scopes for DWARF debug info. 

llvm-svn: 83183
2009-09-30 23:12:50 +00:00
Devang Patel 3256c751f5 Use MDNode * directly as an RecordSourceLine() argument.
llvm-svn: 83182
2009-09-30 22:51:28 +00:00
Devang Patel 5c13c2d392 Remove dead code.
llvm-svn: 83181
2009-09-30 22:43:52 +00:00
Bob Wilson b633d7a665 Add a new virtual EmitStartOfAsmFile method to the AsmPrinter and use this
to emit target-specific things at the beginning of the asm output.  This
fixes a problem for PPC, where the text sections are not being kept together
as expected.  The base class doInitialization code calls DW->BeginModule()
which emits a bunch of DWARF section directives.  The PPC doInitialization
code then emits all the TEXT section directives, with the intention that they
will be kept together. But as I understand it, the Darwin assembler treats
the default TEXT section as a special case and moves it to the beginning of
the file, which means that all those DWARF sections are in the middle of
the text.  With this change, the EmitStartOfAsmFile hook is called before
the DWARF section directives are emitted, so that all the PPC text section
directives come out right at the beginning of the file.

llvm-svn: 83176
2009-09-30 22:06:26 +00:00
Bob Wilson 53904987ae Fix a comment.
llvm-svn: 83171
2009-09-30 21:26:13 +00:00
Reid Kleckner cea8dab1d1 Silence comparison always false warning in -Asserts mode.
llvm-svn: 83164
2009-09-30 20:43:07 +00:00
Jim Grosbach c87197784a Add additional assert() to verify no extraneous use of a scavenged register.
llvm-svn: 83163
2009-09-30 20:35:36 +00:00
Reid Kleckner 8ff5c19ebd Fix integer overflow in instruction scheduling. This can happen if we have
basic blocks that are so long that their size overflows a short.

Also assert that overflow does not happen in the future, as requested by Evan.

This fixes PR4401.

llvm-svn: 83159
2009-09-30 20:15:38 +00:00
Evan Cheng f305ead1cc Add a target hook to add pre- post-regalloc scheduling passes.
llvm-svn: 83144
2009-09-30 08:49:50 +00:00
Jim Grosbach 882f4c11ed replace TRI->isVirtualRegister() with TargetRegisterInfo::isVirtualRegister()
per customary usage

llvm-svn: 83137
2009-09-30 01:47:59 +00:00
Jim Grosbach cdd3e35005 fix compiler warning
llvm-svn: 83132
2009-09-30 00:37:40 +00:00
Devang Patel c2105298cc Simplify.
llvm-svn: 83123
2009-09-30 00:14:40 +00:00
David Goodwin 17199b56b0 Remove -post-RA-schedule flag and add a TargetSubtarget method to enable post-register-allocation scheduling. By default it is off. For ARM, enable/disable with -mattr=+/-postrasched. Enable by default for cortex-a8.
llvm-svn: 83122
2009-09-30 00:10:16 +00:00
Mike Stump 14cf8ecf0b Add a way for a frontend to generate more complex dwarf location
information.  This allows arbitrary code involving DW_OP_plus_uconst
and DW_OP_deref.  The scheme allows for easy extention to include,
any, or all of the DW_OP_ opcodes.  I thought about just exposing all
of them, but, wasn't sure if people wanted the dwarf opcodes exposed
in the api.  Is that a layering violation?

With this scheme, the entire existing block scheme used by llvm-gcc
can be switched over to the new scheme.  I think that would be
cleaner, as then the compiler specific bits are not present in llvm
proper.  Before the old code can be yanked however, similar code in
clang would have to be removed.

Next up, more testing.

llvm-svn: 83120
2009-09-30 00:08:22 +00:00