Commit Graph

322 Commits

Author SHA1 Message Date
Evan Cheng
59b3655564 Pretty print DBG_VALUE machine instructions.
Before:
DBG_VALUE %RSI, 0, !-1; dbg:SimpleRegisterCoalescing.cpp:2707
Now:
DBG_VALUE %RSI, 0, !"this"; dbg:SimpleRegisterCoalescing.cpp:2707


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-28 20:03:13 +00:00
Bob Wilson
1793ab9e70 Use getNumImplicitDefs() and getNumImplicitUses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100850 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 04:46:43 +00:00
Bob Wilson
0855cadb00 Fix up some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-09 04:34:03 +00:00
Evan Cheng
a57fabe815 Coalescer should not delete copy instructions whose defs are partially dead. e.g.
%RDI<def,dead> = MOV64rr %RAX<kill>, %EDI<imp-def>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-08 20:02:37 +00:00
Chris Lattner
24ad3ed71f fix a latent bug my inline asm stuff exposed:
MachineOperand::isIdenticalTo wasn't handling metadata operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 18:03:19 +00:00
Chris Lattner
a4f2bb08de stop using DebugLoc::getUnknownLoc()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100215 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 20:17:23 +00:00
Chris Lattner
de4845c163 Switch the code generator (except the JIT) onto the new DebugLoc
representation.  This eliminates the 'DILocation' MDNodes for 
file/line/col tuples from -O0 -g codegen.

This remove the old DebugLoc class, making it a typedef for DebugLoc,
I'll rename NewDebugLoc next.

I didn't update the JIT to use the new apis, so it will continue to
work, but be as slow as before.  Someone should eventually do this
or, better yet, rip out the JIT debug info stuff and build the JIT
on top of MC.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100209 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-02 19:42:39 +00:00
Chris Lattner
72aaa3c798 add support for MCSymbols as operands to MachineInstrs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98433 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-13 08:14:18 +00:00
Devang Patel
3c91b05d2b Avoid using DIDescriptor.isNull().
This is a first step towards eliminating checks in Descriptor constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97975 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 20:52:55 +00:00
Devang Patel
0ef3fa6aab Revert r97947.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97963 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 19:20:38 +00:00
Devang Patel
d8cc5d5256 Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97947 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-08 18:25:48 +00:00
Evan Cheng
67eaa08f2b Move MachineInstrExpressionTrait::getHashValue() out of line so it can skip over only virtual register defs. This matches what isEqual() is doing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97680 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 23:37:30 +00:00
Evan Cheng
34cdf6edf5 Fix funky indentation and add comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97670 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 21:54:14 +00:00
Evan Cheng
506049f29f - Change MachineInstr::isIdenticalTo to take a new option that determines whether it should skip checking defs or at least virtual register defs. This subsumes part of the TargetInstrInfo::isIdentical functionality.
- Eliminate TargetInstrInfo::isIdentical and replace it with produceSameValue. In the default case, produceSameValue just checks whether two machine instructions are identical (except for virtual register defs). But targets may override it to check for unusual cases (e.g. ARM pic loads from constant pools).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-03 01:44:33 +00:00
Evan Cheng
ac1abde05b Swap parameters of isSafeToMove and isSafeToReMat for consistency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97578 91177308-0d34-0410-b5e6-96231b3b80d8
2010-03-02 19:03:01 +00:00
David Greene
ba2b297ca5 Add non-temporal flags to MachineMemOperand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96226 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-15 16:48:31 +00:00
Dan Gohman
f451cb870e Fix "the the" and similar typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 16:03:48 +00:00
Dale Johannesen
9653f9ec97 Add isDebug argument to ChangeToRegister; this prevents
the field from being used uninitialized later in some cases.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95735 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-10 00:41:49 +00:00
Chris Lattner
518bb53485 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95687 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-09 19:54:29 +00:00
Jakob Stoklund Olesen
b1bb4afbc7 Identify predicate and optional-def operands when printing machine
instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-19 22:08:34 +00:00
Devang Patel
6b61f5816e Replace DebugLocTuple with DILocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93630 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-16 06:09:35 +00:00
Dale Johannesen
5f72a5ebc8 Further progration of metadata operands. The
dumper doesn't really do what I want yet, but
at least it doesn't crash now.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93272 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-13 00:00:24 +00:00
Jakob Stoklund Olesen
8efadf94b5 Add <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and kills.
An instruction like this:

  %reg1097:1<def> = VMOVSR %R3<kill>, 14, %reg0

Must be replaced with this when substituting physical registers:

  %S0<def> = VMOVSR %R3<kill>, 14, %reg0, %D0<imp-def>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-06 00:29:28 +00:00
David Greene
3b32533410 Change errs() to dbgs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92545 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-04 23:48:20 +00:00
Chris Lattner
5e9cd43423 snip one more #include from Metadata.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92214 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-28 08:30:43 +00:00
Bill Wendling
164558e59c Remove dead store.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 13:45:50 +00:00
Bill Wendling
ad2cf9dd63 Remove dead store from copy-pasto.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-25 13:44:36 +00:00
Jim Grosbach
06801722a4 Add @earlyclobber TableGen constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-16 19:43:02 +00:00
Evan Cheng
d8f079c25e Follow up to 90488. Turn a check into an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90815 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 23:10:34 +00:00
Dan Gohman
4b808b014b Don't print the debug directory; it's often long and uninteresting. Omit
the column number if it is not known. Handle the case of a missing filename
better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90630 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 00:20:51 +00:00
Evan Cheng
9aed9396a6 Watch out for PHI instruction with no source operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90488 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 21:50:58 +00:00
Evan Cheng
229694f0ee Fill out codegen SSA updater. It's not yet tested.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 02:31:43 +00:00
Dan Gohman
261a7d983d Devang pointed out that this code should use DIScope instead of
DICompileUnit. This code now prints debug filenames successfully.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-01 00:45:56 +00:00
Dan Gohman
75ae593a27 Print the debug info line and column in MachineInstr::print even when there's
no filename. This situation is apparently fairly common right now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-23 21:29:08 +00:00
Dan Gohman
834651c945 Initialize the new AsmPrinterFlags field to 0, fixing uses of
uninitialized memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-16 22:49:38 +00:00
Dan Gohman
80f6c58981 Print "..." instead of all the uninteresting register clobbers on call
instructions. This makes CodeGen dumps significantly less noisy.

Example before:
  BL <ga:@bar>, %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,dead>, %D1<imp-def,dead>, %D2<imp-def,dead>, %D3<imp-def,dead>, %D4<imp-def,dead>, %D5<imp-def,dead>, %D6<imp-def,dead>, %D7<imp-def,dead>, %D16<imp-def,dead>, %D17<imp-def,dead>, %D18<imp-def,dead>, %D19<imp-def,dead>, %D20<imp-def,dead>, %D21<imp-def,dead>, %D22<imp-def,dead>, %D23<imp-def,dead>, %D24<imp-def,dead>, %D25<imp-def,dead>, %D26<imp-def,dead>, %D27<imp-def,dead>, %D28<imp-def,dead>, %D29<imp-def,dead>, %D30<imp-def,dead>, %D31<imp-def,dead>, %CPSR<imp-def,dead>, %FPSCR<imp-def,dead>

Same example after:
  BL <ga:@bar>, %R0<imp-def>, %R1<imp-def,dead>, %LR<imp-def,dead>, %CPSR<imp-def,dead>, ...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86583 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 19:38:45 +00:00
Dan Gohman
8d4e3b5b48 Use WriteAsOperand to print GlobalAddress MachineOperands. This
prints them with the leading '@'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 18:03:10 +00:00
Dan Gohman
0ba90f3e34 Make -print-machineinstrs more readable.
- Be consistent when referring to MachineBasicBlocks: BB#0.
 - Be consistent when referring to virtual registers: %reg1024.
 - Be consistent when referring to unknown physical registers: %physreg10.
 - Be consistent when referring to known physical registers: %RAX
 - Be consistent when referring to register 0: %reg0
 - Be consistent when printing alignments: align=16
 - Print jump table contents.
 - Don't print host addresses, in general.
 - and various other cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-31 20:19:03 +00:00
Dan Gohman
8c2b52552c Initial target-independent CodeGen support for BlockAddresses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85556 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-30 01:27:03 +00:00
Evan Cheng
5affca0763 Need a comma after imp-use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 07:56:02 +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
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
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
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
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
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
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
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
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
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