Commit Graph

43 Commits

Author SHA1 Message Date
Dan Gohman 2f277c866d Don't set kill flags for instructions which the scheduler has cloned.
llvm-svn: 103827
2010-05-14 22:01:14 +00:00
Dan Gohman afd2b8bbb7 Don't set kill flags on uses of CopyFromReg nodes. InstrEmitter doesn't
create separate virtual registers for CopyFromReg values, so uses of
them don't necessarily kill the value.

llvm-svn: 103519
2010-05-11 21:59:14 +00:00
Evan Cheng ffb9f18dfe Indentation.
llvm-svn: 103441
2010-05-10 23:08:19 +00:00
Dan Gohman 7de01ec2c9 SDDbgValues are apparently not being legalized. Fix a symptom of the problem,
and not the real problem itself, by dropping debug info for i128 values.
rdar://7958162.

llvm-svn: 103310
2010-05-07 22:19:08 +00:00
Dan Gohman 779c69bbc5 Add a DebugLoc argument to TargetInstrInfo::copyRegToReg, so that it
doesn't have to guess.

llvm-svn: 103194
2010-05-06 20:33:48 +00:00
Evan Cheng f869d9adf2 Teach scheduler about REG_SEQUENCE.
llvm-svn: 102984
2010-05-04 00:22:40 +00:00
Dan Gohman 0e79c864c3 Re-enable isel kill flags, now that the local allocator is ignoring them.
llvm-svn: 102981
2010-05-04 00:12:15 +00:00
Dan Gohman 4959cf19b2 Re-disable kill flags, as there is more trouble.
llvm-svn: 102826
2010-05-01 01:57:56 +00:00
Dan Gohman 77ef6f6a17 Re-enable kill flags from SelectionDAGISel, with a fix: don't
try to put a kill flag on a DBG_INFO instruction.

llvm-svn: 102820
2010-05-01 00:50:53 +00:00
Dan Gohman 25c1653700 Get rid of the EdgeMapping map. Instead, just check for BasicBlock
changes before doing phi lowering for switches.

llvm-svn: 102809
2010-05-01 00:01:06 +00:00
Dan Gohman 8acc8f7dfd EmitDbgValue doesn't need its EdgeMapping argument.
llvm-svn: 102742
2010-04-30 19:35:33 +00:00
Dan Gohman 587e0800e5 Temporarily disable SelectionDAG kill flags, which are causing trouble.
llvm-svn: 102680
2010-04-30 00:32:51 +00:00
Dan Gohman ac55510c4e Set register kill flags on the SelectionDAG path, at least in the
easy cases.

llvm-svn: 102678
2010-04-30 00:08:21 +00:00
Bob Wilson a1e343095f Avoid adding a null MD node operand, which crashes with "-debug" when trying
to print the operand.

llvm-svn: 102395
2010-04-26 22:56:56 +00:00
Evan Cheng ed69b382ea - Move TargetLowering::EmitTargetCodeForFrameDebugValue to TargetInstrInfo and rename it to emitFrameIndexDebugValue.
- Teach spiller to modify DBG_VALUE instructions to reference spill slots.

llvm-svn: 102323
2010-04-26 07:38:55 +00:00
Dale Johannesen 582565e991 Stop abusing EmitInstrWithCustomInserter for target-dependent
form of DEBUG_VALUE, as it doesn't have reasonable default
behavior for unsupported targets.  Add a new hook instead.
No functional change.

llvm-svn: 102320
2010-04-25 21:33:54 +00:00
Dan Gohman 0c862a86fa Delete a redundant return statement.
llvm-svn: 101860
2010-04-20 01:58:20 +00:00
Dan Gohman bcaf681cde Add const qualifiers to CodeGen's use of LLVM IR constructs.
llvm-svn: 101334
2010-04-15 01:51:59 +00:00
Chris Lattner 51065568cd Have the inst emitter add the !srcloc mdnode to the machine instr.
Have the asmprinter use the mdnode to scavenge a source location if
present.  Document this nonsense in langref.

llvm-svn: 100607
2010-04-07 05:38:05 +00:00
Chris Lattner 3b9f02a2aa Three changes:
1. Introduce some enums and accessors in the InlineAsm class
   that eliminate a ton of magic numbers when handling inline
   asm SDNode.
2. Add a new MDNodeSDNode selection dag node type that holds
   a MDNode (shocking!)
3. Add a new argument to ISD::INLINEASM nodes that hold !srcloc
   metadata, propagating it to the instruction emitter, which
   drops it.

No functionality change.

llvm-svn: 100605
2010-04-07 05:20:54 +00:00
Dale Johannesen d1976e35c4 Allow for the possibility that a debug-value points
to a SDNode that didn't have code generated for it.

llvm-svn: 100566
2010-04-06 21:59:56 +00:00
Evan Cheng eb50ac5ccc LiveVariables should clear kill / dead markers first. This allows us to remove a hack in the scheduler.
llvm-svn: 99597
2010-03-26 02:12:24 +00:00
Chris Lattner fc4ec25363 fix a valgrind error on copy-constructor-synthesis.cpp, which is caused when
the custom insertion hook deletes the instruction, then we try to set dead
flags on it.  Neither the code that I added nor the code that was there 
before was safe.

llvm-svn: 99538
2010-03-25 18:49:10 +00:00
Chris Lattner 4690af8567 Make the NDEBUG assertion stronger and more clear what is
happening.

Enhance scheduling to set the DEAD flag on implicit defs
more aggressively.  Before, we'd set an implicit def operand
to dead if it were present in the SDNode corresponding to
the machineinstr but had no use.  Now we do it in this case
AND if the implicit def does not exist in the SDNode at all.

This exposes a couple of problems: one is the FIXME, which
causes a live intervals crash on CodeGen/X86/sibcall.ll.
The second is that it makes machinecse and licm more 
aggressive (which is a good thing) but also exposes a case
where licm hoists a set0 and then it doesn't get resunk.

Talking to codegen folks about both these issues, but I need
this patch in in the meantime.

llvm-svn: 99485
2010-03-25 05:40:48 +00:00
Chris Lattner e2a504ee82 reapply 99444/99445, which I speculatively reverted in
r99453.

llvm-svn: 99482
2010-03-25 04:41:16 +00:00
Evan Cheng 563fe3cc12 Change how dbg_value sdnodes are converted into machine instructions. Their placement should be determined by the relative order of incoming llvm instructions. The scheduler will now use the SDNode ordering information to determine where to insert them. A dbg_value instruction is inserted after the instruction with the last highest source order and before the instruction with the next highest source order. It will optimize the placement by inserting right after the instruction that produces the value if they have consecutive order numbers.
Here is a theoretical example that illustrates why the placement is important.

tmp1 = 
store tmp1 -> x
...
tmp2 = add ...
...
call
...
store tmp2 -> x

Now mem2reg comes along:

tmp1 = 
dbg_value (tmp1 -> x)
...
tmp2 = add ...
...
call
...
dbg_value (tmp2 -> x)

When the debugger examine the value of x after the add instruction but before the call, it should have the value of tmp1.

Furthermore, for dbg_value's that reference constants, they should not be emitted at the beginning of the block (since they do not have "producers").

This patch also cleans up how SDISel manages DbgValue nodes. It allow a SDNode to be referenced by multiple SDDbgValue nodes. When a SDNode is deleted, it uses the information to find the SDDbgValues and invalidate them. They are not deleted until the corresponding SelectionDAG is destroyed.

llvm-svn: 99469
2010-03-25 01:38:16 +00:00
Chris Lattner ddca7b09f7 revert 99444/99445. This doesn't cause the failure of
2006-07-19-stwbrx-crash.ll for me, but it's the only likely
patch in the blame list of several bots.  Lets see if this
fixes it.

llvm-svn: 99453
2010-03-24 23:41:19 +00:00
Chris Lattner e70742450f remove dead argument.
llvm-svn: 99445
2010-03-24 22:47:12 +00:00
Chris Lattner 26136636e0 split EmitNode in half to reduce indentation.
llvm-svn: 99444
2010-03-24 22:45:47 +00:00
Evan Cheng 00fd0b6749 Rename SDDbgValue.h to SDNodeDbgValue.h for consistency.
llvm-svn: 98513
2010-03-14 19:56:39 +00:00
Chris Lattner ee2fbbc978 change the LabelSDNode to be EHLabelSDNode and make it hold
an MCSymbol.  Make the EH_LABEL MachineInstr hold its label
with an MCSymbol instead of ID.  Fix a bug in MMI.cpp which
would return labels named "Label4" instead of "label4".

llvm-svn: 98463
2010-03-14 02:33:54 +00:00
Dale Johannesen 29108f0b6c Cosmetic: lengthen names and improve comments.
llvm-svn: 98202
2010-03-10 23:37:24 +00:00
Dale Johannesen 49de0607a8 Progress towards shepherding debug info through SelectionDAG.
No functional effect yet.  This is still evolving and should
not be viewed as final.

llvm-svn: 98195
2010-03-10 22:13:47 +00:00
Dale Johannesen 10a77adede Add some new bits of debug info handling. No
functional change yet.

llvm-svn: 97855
2010-03-06 00:03:23 +00:00
Chris Lattner b06015aa69 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.

llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Evan Cheng 32bfe1e837 Trim unneeded includes.
llvm-svn: 94105
2010-01-21 21:44:43 +00:00
Dan Gohman 7a6611793f Target-independent support for TargetFlags on BlockAddress operands,
and support for blockaddresses in x86-32 PIC mode.

llvm-svn: 89506
2009-11-20 23:18:13 +00:00
Dan Gohman 6b3f32e6d7 Fix a typo in a comment.
llvm-svn: 88953
2009-11-16 20:35:59 +00:00
Dan Gohman d814e32e57 Don't mark registers dead here when processing nodes with MVT::Flag
results. This works around a problem affecting targets which rely on
MVT::Flag to handle physical register defs.

llvm-svn: 85638
2009-10-30 23:57:47 +00:00
Dan Gohman 6c9388011b Initial target-independent CodeGen support for BlockAddresses.
llvm-svn: 85556
2009-10-30 01:27:03 +00:00
Dan Gohman 453d64c9f5 Rename usesCustomDAGSchedInserter to usesCustomInserter, and update a
bunch of associated comments, because it doesn't have anything to do
with DAGs or scheduling. This is another step in decoupling MachineInstr
emitting from scheduling.

llvm-svn: 85517
2009-10-29 18:10:34 +00:00
Dan Gohman 4b46cbfc23 Mark dead physregdefs dead immediately. This helps MachineSink and
MachineLICM and other things which run before LiveVariables is run.

llvm-svn: 85360
2009-10-28 01:13:53 +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