Commit Graph

8134 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen
11ee508d7b Report errors correctly for unselected target intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 18:50:03 +00:00
Dan Gohman
cd2ae14ce3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 00:36:22 +00:00
Evan Cheng
a2f8047134 When LiveVariables is adding implicit-def to model "partial dead", add the earlyclobber marker if the superreg def has it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 23:39:27 +00:00
Evan Cheng
0789707c49 Print earlyclobber for implicit-defs as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 23:37:31 +00:00
Jim Grosbach
33524c3b26 Make loop not recalc getNumOperands() each time around
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84138 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 21:22:39 +00:00
Devang Patel
c90aefe95e Add support to record DbgScope as inlined scope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 21:08:09 +00:00
Jim Grosbach
d0c3832754 quiet compiler warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84133 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 21:07:11 +00:00
Duncan Sands
b01bbdcc1a 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84106 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 16:11:37 +00:00
Dan Gohman
9ba0e2ba87 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84060 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 00:02:01 +00:00
Dan Gohman
363bbc0110 Add a few README.txt items.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 23:58:05 +00:00
Devang Patel
1619dc3b9e s/DebugLoc.CompileUnit/DebugLoc.Scope/g
s/DebugLoc.InlinedLoc/DebugLoc.InlinedAtLoc/g



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84054 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 23:28:53 +00:00
Duncan Sands
3a66a68b0c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 21:04:12 +00:00
David Goodwin
d452ea6a64 Add debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 19:16:03 +00:00
Daniel Dunbar
6e4bdfc229 Fix a -Asserts warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83950 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 06:47:08 +00:00
Devang Patel
6ef7517314 Find enclosing subprogram info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83922 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 23:11:24 +00:00
Devang Patel
1f03471a2d Set default location for a function if it is not set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83921 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 23:10:55 +00:00
Dale Johannesen
3a6b9eb868 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 18:49:00 +00:00
Dan Gohman
7fa50ede61 Remove a redundant member variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83857 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 16:44:10 +00:00
Nate Begeman
677c89d8bf 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%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 05:53:58 +00:00
Chris Lattner
f5e16139f2 Fix PR5087, patch by Jakub Staszak!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-12 04:22:44 +00:00
Dan Gohman
bcea859fc1 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83699 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-10 01:32:21 +00:00
Dan Gohman
c81b783e27 Make getMachineNode return a MachineSDNode* instead of a generic SDNode*
since it won't do any folding. This will help avoid some inconvenient
casting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83698 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-10 01:29:16 +00:00
Dan Gohman
5bf7c2a346 Fix a missing initialization of PostRAScheduler's AA member.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83695 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-10 00:15:38 +00:00
Dan Gohman
98976e4dcd The ScheduleDAG framework now requires an AliasAnalysis argument, though
it isn't needed in the ScheduleDAGSDNodes schedulers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83691 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 23:33:48 +00:00
Dan Gohman
a70dca156f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 23:27:56 +00:00
Devang Patel
ac1ceb3dd3 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 22:42:28 +00:00
Dan Gohman
599a87aca0 isTriviallyReMaterializable checks the
TargetInstrDesc::isRematerializable flag, so it isn't necessary to do
this check in its callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 21:02:10 +00:00
Dan Gohman
91e69c3715 Add basic infrastructure and x86 support for preserving MachineMemOperand
information when unfolding memory references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 18:10:05 +00:00
Devang Patel
c525472828 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83655 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 17:51:49 +00:00
Jim Grosbach
71c8dc9b20 when previous scratch register is killed, flag the value as no longer tracking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 17:33:33 +00:00
Evan Cheng
64efb555ce Give Dan and my recent changes, machine LICM is now code size neutral.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83624 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 06:31:25 +00:00
Evan Cheng
3dc326ba83 Fix a logic error that caused non-rematable loop invariants loads to be licm'ed out of loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83622 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 06:21:52 +00:00
Evan Cheng
35ca9203f2 Reset kill markers after live interval is reconstructed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83608 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 01:17:11 +00:00
Evan Cheng
9c8068078b Remove code that makes no sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 22:42:35 +00:00
Devang Patel
85d29e2de3 Clear variable debug info map at the end of the function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 20:41:17 +00:00
Bob Wilson
5fcbf0d26e Add a SelectionDAG getTargetInsertSubreg convenience function,
similar to getTargetExtractSubreg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 18:49:46 +00:00
Devang Patel
eda312193d Do not record line number to implicitly mark start of function if function has arguments. Extra line number entries trip gdb in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 18:48:03 +00:00
Dan Gohman
8a261e44f7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83555 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 17:00:02 +00:00
Jim Grosbach
65c58daa8b Re-enable register scavenging in Thumb1 by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 01:46:59 +00:00
Jim Grosbach
e40bf5f9f4 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83519 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-08 01:09:45 +00:00
Jim Grosbach
9f3a559dff reverting thumb1 scavenging default due to test failure while I figure out what's up.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 22:49:41 +00:00
Chris Lattner
831a2bba04 second half of lazy liveness removal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 22:49:30 +00:00
Jim Grosbach
bafa3d9f6a Enable thumb1 register scavenging by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 22:26:31 +00:00
Jim Grosbach
b8452b80f4 grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 19:08:36 +00:00
Jim Grosbach
391e1704c2 add initializers for clarity. Add missing assignment of PrevLastUseOp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 18:44:24 +00:00
Owen Anderson
c024df648e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83480 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 18:40:17 +00:00
Dan Gohman
2627e08e05 Replace some code for aggressive-remat with MachineInstr::isInvariantLoad, and
teach it how to recognize invariant physical registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:47:20 +00:00
Dan Gohman
e33f44cfc5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83475 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:38:06 +00:00
Dan Gohman
2dbc4c84f6 Add a few simple MachineVerifier checks for MachineMemOperands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:36:00 +00:00
Jim Grosbach
b58f498f75 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:12:56 +00:00
Dan Gohman
bd31b173d2 Fix this comment. The loop header is the loop entry point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 00:33:10 +00:00
Devang Patel
60b35bd8ec Add support to handle debug info attached to an instruction.
This is not yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 18:37:31 +00:00
Dan Gohman
e3cc3f3c84 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 17:38:38 +00:00
Duncan Sands
ac53a0b272 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 15:40:36 +00:00
Jim Grosbach
6e214805b1 grammar
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83378 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 15:03:44 +00:00
Devang Patel
8a4087ddc7 Fix cut-n-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83367 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 03:15:38 +00:00
Devang Patel
af0e272683 Update processDebugLoc() so that it can be used to process debug info before and after printing an instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83363 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 02:19:11 +00:00
Devang Patel
89703cf838 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83362 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 02:01:32 +00:00
Devang Patel
0d20ac8d17 Add utility routine to set begin and end labels for DbgScopes.
This will be used by processDebugLoc().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:50:42 +00:00
Devang Patel
b39566d719 Remove unintentional function decl.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83356 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:31:35 +00:00
Devang Patel
e717faa467 Add utility routine to collect variable debug info. This is not yet used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83355 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:26:37 +00:00
Devang Patel
454e957979 Set default location for the function if it is not already set.
This code is not  yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 00:09:08 +00:00
Devang Patel
6f3dc920b0 Existence of a compile unit for input source file is a good indicator to check debug info's presence in a module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 00:03:14 +00:00
Devang Patel
ffd9c3dd4a If subprogram die is not available then construct new one.
This can happen if debug info is processed lazily.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 23:59:00 +00:00
Devang Patel
fd07cf56cd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 23:40:42 +00:00
Devang Patel
b71a16d10d Set address while constructing DIE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 23:22:08 +00:00
Jim Grosbach
540b05d227 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 22:30:23 +00:00
Devang Patel
f84548db63 Gracefully handle various scopes while recording source line info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 18:03:19 +00:00
Chris Lattner
cf0fe8d813 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83297 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 05:54:46 +00:00
Chris Lattner
92bef66c10 stop MachineFunctionPass from claiming that it preserves LoopDependence info,
which causes dependence info to be linked into lli.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 02:35:05 +00:00
Jakob Stoklund Olesen
b44fad7f95 Whitespace and formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83285 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-04 18:18:39 +00:00
Lang Hames
6cc91e39c0 Oops. Renamed remaining MachineInstrIndex references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 04:31:31 +00:00
Lang Hames
cc3b0650f1 Renamed MachineInstrIndex to LiveIndex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 04:21:37 +00:00
Benjamin Kramer
8bff4af612 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-02 15:59:52 +00:00
David Goodwin
63bcbb72f7 All callee-saved registers are live-out of a return block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83223 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 23:28:47 +00:00
David Goodwin
9843a93e83 Remove neonfp attribute and instead set default based on CPU string. Add -arm-use-neon-fp to override the default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 22:19:57 +00:00
David Goodwin
471850ab84 Restore the -post-RA-scheduler flag as an override for the target specification. Remove -mattr for setting PostRAScheduler enable and instead use CPU string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 21:46:35 +00:00
Devang Patel
af9e84701b Add support to extract lexical scope information from DebugLoc attached with an machine instruction.
This is not yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 20:31:14 +00:00
David Goodwin
c7951f8e09 Use MachineFrameInfo.getPristineRegs() to determine which callee-saved registers are available for anti-dependency breaking. Some cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 19:45:32 +00:00
Devang Patel
d38dd11e12 Record first and last instruction of a scope in DbgScope.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 18:25:23 +00:00
Evan Cheng
714e8bc1fc Observe hasExtraSrcRegAllocReq and hasExtraDefRegAllocReq. Do not change
operands of instructions with these properties while breaking anti-dep.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 08:26:23 +00:00
Devang Patel
a1434045c3 Add another MDNode into DebugLocTuple. This will be used to keep track of inlined functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 01:15:28 +00:00
Devang Patel
75549f4444 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83189 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-01 01:03:26 +00:00
Devang Patel
b0fdedb3fd Use MachineInstr as an processDebugLoc() argument.
This will allow processDebugLoc() to handle scopes for DWARF debug info. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 23:12:50 +00:00
Devang Patel
3d910835fc Use MDNode * directly as an RecordSourceLine() argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 22:51:28 +00:00
Devang Patel
a63710124a Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 22:43:52 +00:00
Bob Wilson
812209a58c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83176 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 22:06:26 +00:00
Bob Wilson
bc9506f5ee Fix a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83171 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 21:26:13 +00:00
Reid Kleckner
3a90c9b8ed Silence comparison always false warning in -Asserts mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83164 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 20:43:07 +00:00
Jim Grosbach
32030fe021 Add additional assert() to verify no extraneous use of a scavenged register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83163 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 20:35:36 +00:00
Reid Kleckner
c277ab08a2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 20:15:38 +00:00
Evan Cheng
629adde699 Add a target hook to add pre- post-regalloc scheduling passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83144 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 08:49:50 +00:00
Jim Grosbach
366e021fb2 replace TRI->isVirtualRegister() with TargetRegisterInfo::isVirtualRegister()
per customary usage

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83137 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 01:47:59 +00:00
Jim Grosbach
0a13e566ab fix compiler warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83132 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 00:37:40 +00:00
Devang Patel
fdc826f6e8 Simplify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 00:14:40 +00:00
David Goodwin
0dad89fa94 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83122 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 00:10:16 +00:00
Mike Stump
3e4c9bdb67 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-30 00:08:22 +00:00
Jim Grosbach
a9a9c95f67 Additional check for regno==0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83103 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 20:11:10 +00:00
Devang Patel
9dddf97480 Remove unnecessary cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 19:56:13 +00:00
Devang Patel
5ccdd10b1a Remove std::string uses from DebugInfo interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83083 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 18:40:58 +00:00
Jim Grosbach
9a0b6e6ded Simplify the tracking of virtual frame index registers. Ranges cannot overlap,
so a simple "current register" will suffice. Also add some additional
sanity-checking assertions to make sure things are as we expect.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83081 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 18:23:15 +00:00
Jim Grosbach
9ab2238df9 Moving register scavenging to a post pass results in virtual registers in
the instruction we're scavenging for. The scavenger needs to know to avoid
them when analyzing register usage.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-29 17:24:37 +00:00
Devang Patel
e30e678865 s/class Metadata/class MetadataContext/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 21:41:20 +00:00
Devang Patel
a2148402ce Do not use global typedef for MDKindID.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83016 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 21:14:55 +00:00
Jakob Stoklund Olesen
544df3651e Use KILL instead of IMPLICIT_DEF in LowerSubregs pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83007 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 20:32:46 +00:00
Dan Gohman
937d2d8624 Use VerifySchedule instead of doing the work manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82995 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 16:09:41 +00:00
Evan Cheng
0e6b590b91 Coalescer should not delete extract_subreg, insert_subreg, and subreg_to_reg of
physical registers. This is especially critical for the later two since they
start the live interval of a super-register. e.g.
%DO<def> = INSERT_SUBREG %D0<undef>, %S0<kill>, 1
If this instruction is eliminated, the register scavenger will not be happy as
D0 is not defined previously.
This fixes PR5055.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82968 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-28 05:28:43 +00:00
Tilmann Scheller
8ff95de83c Use explicit structs instead of std::pair to map callee saved regs to spill slots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-27 17:58:47 +00:00
Dan Gohman
11eab02b77 Convert comparisons like (x == infinity) to (x >= infinity) on targets
where FCMP_OEQ is not legal and FCMP_OGE is, such as x86. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82861 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 15:24:17 +00:00
Dan Gohman
45094e34bc Don't hoist or sink instructions with physreg uses if the physreg is
allocatable. Even if it doesn't appear to have any defs, it may latter
on after register allocation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82834 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-26 02:34:00 +00:00
Dan Gohman
a8fb336c2e Unbreak MachineLICM for instructions that reference RIP on x86-64 too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82825 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 23:58:45 +00:00
Dan Gohman
4b2ebc1928 Move MachineMemOperand::getAlignment out of line, to avoid needing
MathExtras.h in MachineMemOperand.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 23:33:20 +00:00
Daniel Dunbar
295a8089cd Remove unused variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82821 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 23:26:56 +00:00
Dan Gohman
19778e7558 Fix MachineSink to be able to sink instructions that use physical registers
which have no defs anywhere in the function. In particular, this fixes sinking
of instructions that reference RIP on x86-64, which is currently being modeled
as a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 22:53:29 +00:00
Dan Gohman
2bf0649e05 Simplify a few more uses of reg_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82812 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 22:26:13 +00:00
Dan Gohman
29438d13e0 Simplify this code by using use_iterator instead of reg_iterator
and skipping the defs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 22:24:52 +00:00
Evan Cheng
483011018e Flip -disable-post-RA-scheduler to -post-RA-scheduler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82803 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 21:38:11 +00:00
Dan Gohman
c76909abfe Improve MachineMemOperand handling.
- Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions.
   This eliminates MachineInstr's std::list member and allows the data to be
   created by isel and live for the remainder of codegen, avoiding a lot of
   copying and unnecessary translation. This also shrinks MemSDNode.
 - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated
   fields for MachineMemOperands.
 - Change MemSDNode to have a MachineMemOperand member instead of its own
   fields with the same information. This introduces some redundancy, but
   it's more consistent with what MachineInstr will eventually want.
 - Ignore alignment when searching for redundant loads for CSE, but remember
   the greatest alignment.

Target-specific code which previously used MemOperandSDNodes with generic
SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range
so that the SelectionDAG framework knows that MachineMemOperand information
is available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 20:36:54 +00:00
Dan Gohman
602b0c8c17 Rename getTargetNode to getMachineNode, for consistency with the
naming scheme used in SelectionDAG, where there are multiple kinds
of "target" nodes, but "machine" nodes are nodes which represent
a MachineInstr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82790 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:54:59 +00:00
Dale Johannesen
a45bfd31de Make sure sin, cos, sqrt calls are marked readonly
before producing FSIN, FCOS, FSQRT.  If they aren't
so marked we have to assume they might set errno.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 18:00:35 +00:00
Dale Johannesen
52fb79b7f9 Generate FSQRT from calls to the sqrt function, which
allows appropriate backends to generate a sqrt instruction.

On x86, this isn't done at -O0 because we go through
FastISel instead.  This is a behavior change from before
this series of sqrt patches started.  I think this is OK
considering that compile speed is most important at -O0, but
could be convinced otherwise.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82778 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 17:23:22 +00:00
Bob Wilson
0035f9c3b9 pr4926: ARM requires the stack pointer to be aligned, even for leaf functions.
For the AAPCS ABI, SP must always be 4-byte aligned, and at any "public
interface" it must be 8-byte aligned.  For the older ARM APCS ABI, the stack
alignment is just always 4 bytes.  For X86, we currently align SP at
entry to a function (e.g., to 16 bytes for Darwin), but no stack alignment
is needed at other times, such as for a leaf function.

After discussing this with Dan, I decided to go with the approach of adding
a new "TransientStackAlignment" field to TargetFrameInfo.  This value
specifies the stack alignment that must be maintained even in between calls.
It defaults to 1 except for ARM, where it is 4.  (Some other targets may
also want to set this if they have similar stack requirements. It's not
currently required for PPC because it sets targetHandlesStackFrameRounding
and handles the alignment in target-specific code.) The existing StackAlignment
value specifies the alignment upon entry to a function, which is how we've
been using it anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82767 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 14:41:49 +00:00
Nate Begeman
cc66cdd79c Fix combiner-aa issue with bases which are different, but can alias.
Previously, it treated GV+28 GV+0 as different bases, and assumed they could
not alias.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 06:05:26 +00:00
Dan Gohman
8fc13cb4f7 Add a version of dumpr() that has a SelectionDAG* argument.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82742 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-25 00:34:34 +00:00
Jim Grosbach
3d6cb88a64 Start of revamping the register scavenging in PEI. ARM Thumb1 is the driving
interest for this, as it currently reserves a register rather than using
the scavenger for matierializing constants as needed.

Instead of scavenging registers on the fly while eliminating frame indices,
new virtual registers are created, and then a scavenged collectively in a
post-pass over the function. This isolates the bits that need to interact
with the scavenger, and sets the stage for more intelligent use, and reuse,
of scavenged registers.

For the time being, this is disabled by default. Once the bugs are worked out,
the current scavenging calls in replaceFrameIndices() will be removed and
the post-pass scavenging will be the default. Until then,
-enable-frame-index-scavenging enables the new code. Currently, only the
Thumb1 back end is set up to use it.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 23:52:18 +00:00
Mike Stump
7e3720da38 Delete space after function name, before (, reflow a comment and
delete a few blank lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82729 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 23:21:26 +00:00
Mike Stump
ee4b8a7781 Fix spacing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82727 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 23:11:08 +00:00
David Goodwin
1f52895692 Make the end-of-itinerary mark explicit. Some cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82709 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 20:22:50 +00:00
Bob Wilson
c34666ee18 Fix a hypothetical problem for targets with StackGrowsUp and a non-zero
LocalAreaOffset.  (We don't have any of those right now.)
PEI::calculateFrameObjectOffsets includes the absolute value of the
LocalAreaOffset in the cumulative offset value used to calculate the
stack frame size.  It then adds the raw value of the LocalAreaOffset
to the stack size.  For a StackGrowsDown target, that raw value is negative
and has the effect of cancelling out the absolute value that was added
earlier, but that obviously won't work for a StackGrowsUp target.  Change
to subtract the absolute value of the LocalAreaOffset.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 16:42:27 +00:00
Chris Lattner
b55e068e53 unconditionally compute MMI even if the target doesn't support EH or Debug info, because the target may use it for other things, this fixes PR5036
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82684 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 05:44:53 +00:00
Evan Cheng
393e277ecd Fix PR5024 with a big hammer: disable the double-def assertion in the scavenger.
LiveVariables add implicit kills to correctly track partial register kills. This works well enough and is fairly accurate. But coalescer can make it impossible to maintain these markers. e.g.

        BL <ga:sss1>, %R0<kill,undef>, %S0<kill>, %R0<imp-def>, %R1<imp-def,dead>, %R2<imp-def,dead>, %R3<imp-def,dead>, %R12<imp-def,dead>, %LR<imp-def,dead>, %D0<imp-def>, ...
...
	%reg1031<def> = FLDS <cp#1>, 0, 14, %reg0, Mem:LD4[ConstantPool]
...
   	%S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When reg1031 and S0 are coalesced, the copy (FCPYS) will be eliminated the the implicit-kill of D0 is lost. In this case it's possible to move the marker to the FLDS. But in many cases, this is not possible. Suppose

	%reg1031<def> = FOO <cp#1>, %D0<imp-def>
...
   	%S0<def> = FCPYS %reg1031<kill>, 14, %reg0, %D0<imp-use,kill>

When FCPYS goes away, the definition of S0 is the "FOO" instruction. However, transferring the D0 implicit-kill to FOO doesn't work since it is the def of D0 itself. We need to fix this in another time by introducing a "kill" pseudo instruction to track liveness.

Disabling the assertion is not ideal, but machine verifier is doing that job now. It's important to know double-def is not a miscomputation since it means a register should be free but it's not tracked as free. It's a performance issue instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 02:27:09 +00:00
Evan Cheng
ad934b821c Clean up LiveVariables and change how it deals with partial updates and kills. This also eliminate the horrible check which scan forward to the end of the basic block. It should be faster and more accurate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82676 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-24 02:15:22 +00:00
Dan Gohman
4e918b2c8c Use getStoreSize() instead of getStoreSizeInBits()/8.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 21:07:02 +00:00
Dan Gohman
8a55ce4a39 Rename several variables from EVT to more descriptive names, now that EVT
is also the name of their type, as declarations like "EVT EVT" look
really odd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 21:02:20 +00:00
Jakob Stoklund Olesen
39523e2cfb Fix verification of explicit operands.
The machine code verifier did not check for explicit operands correctly. It
used MachineInstr::getNumExplicitOperands, but that method may cheat and use
the declared count in the TargetInstrDesc.

Now we check the explicit operands one at a time in visitMachineOperand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 20:57:55 +00:00
Bob Wilson
94188d4e67 Edit a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 18:53:19 +00:00
David Goodwin
8f909345bc Fix bug in kill flag updating for post-register-allocation scheduling. When the kill flag of a superreg needs to be cleared because there are one or more subregs live, we instead add implicit-defs of those subregs and leave the kill flag on the superreg. This allows us to end the live-range of the superreg without ending the live-ranges of the subregs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82629 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 16:35:25 +00:00
Evan Cheng
296925dc16 Fix PR5024. LiveVariables physical register defs should *commit* only after all
of the defs are processed.
Also fix a implicit_def propagation bug: a implicit_def of a physical register
should be applied to uses of the sub-registers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82616 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 06:28:31 +00:00
Evan Cheng
f7cd853071 Fix a obvious logic error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 05:23:19 +00:00
Dan Gohman
cd26ec5f3c Give MachineMemOperand an operator<<, factoring out code from
two different places for printing MachineMemOperands.

Drop the virtual from Value::dump and instead give Value a
protected virtual hook that can be overridden by subclasses
to implement custom printing. This lets printing be more
consistent, and simplifies printing of PseudoSourceValue
values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82599 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 01:33:16 +00:00
Mike Stump
d75e9aad24 This is overly constraining with respect to clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82591 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-23 00:13:30 +00:00
David Goodwin
047ae2f2ad Use early returns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 16:47:52 +00:00
Evan Cheng
60c7df2c93 Fix PR5024. LiveVariables::FindLastPartialDef should return a set of sub-registers that were defined by the last partial def, not just a single sub-register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82535 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 08:34:46 +00:00
Evan Cheng
014d624a28 Fix a pasto. Also simplify for Bill's benefit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 01:48:19 +00:00
Evan Cheng
1c17c1bc54 Minor bug fix. LowerSubregs should translate
%S0<def> = EXTRACT_SUBREG %Q0<kill>, 1
to
%S0<def> = IMPLICIT_DEF %Q0<imp-use,kill>

Implicit_def does not *read* any register so the operand should be marked "implicit". The missing "implicit" marker on the operand is wrong, but it doesn't actually break anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82503 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-22 00:29:40 +00:00
Evan Cheng
cf985a9545 Clean up spill weight computation. Also some changes to give loop induction
variable increment / decrement slighter high priority. 

This has major impact on some micro-benchmarks. On MultiSource/Applications
and spec tests, it's a minor win. It also reduce 256.bzip instruction count
by 8%, 55 on 164.gzip on i386 / Darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 21:12:25 +00:00
Dan Gohman
28f02fdd76 Change MachineMemOperand's alignment value to be the alignment of
the base pointer, without the offset. This matches MemSDNode's
new alignment behavior, and holds more interesting information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 19:47:04 +00:00
Dan Gohman
a079ff3805 Fix this assertion string to mention subreg_to_reg.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 15:18:33 +00:00
Jakob Stoklund Olesen
a5ba07c3d1 Verify that phi instructions refer to MBBs in the CFG.
The machine code verifier no longer tolerates phi instructions with noop
operands. All MBBs on a phi instruction must be in the CFG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 07:19:08 +00:00
Evan Cheng
b0f5973bee Fix PR4986. "r1024 = insert_subreg r1024, undef, 2" cannot be turned in an implicit_def. Instead, it's an identity copy so it should be eliminated. Also make sure to update livevariable kill information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-21 04:32:32 +00:00