Commit Graph

1479 Commits

Author SHA1 Message Date
Evan Cheng
4eecdeb3fa Get rid of the annoying blank lines before labels.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 08:39:46 +00:00
Evan Cheng
a844bdeab3 SDIsel processes llvm.dbg.declare by recording the variable debug information descriptor and its corresponding stack frame index in MachineModuleInfo. This only works if the local variable is "homed" in the stack frame. It does not work for byval parameter, etc.
Added ISD::DECLARE node type to represent llvm.dbg.declare intrinsic. Now the intrinsic calls are lowered into a SDNode and lives on through out the codegen passes.
For now, since all the debugging information recording is done at isel time, when a ISD::DECLARE node is selected, it has the side effect of also recording the variable. This is a short term solution that should be fixed in time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 04:07:54 +00:00
Evan Cheng
334dc1f58d Revert 46556 and 46585. Dan please fix the PseudoSourceValue problem and re-commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 21:00:00 +00:00
Evan Cheng
bb81d97feb Add an extra operand to LABEL nodes which distinguishes between debug, EH, or misc labels. This fixes the EH breakage. However I am not convinced this is *the* solution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46609 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 09:59:15 +00:00
Christopher Lamb
8535624739 Allow ComplexExpressions in InstrInfo.td files to be slightly more... complex! ComplexExpressions can now have attributes which affect how TableGen interprets
the pattern when generating matchin code. 

The first (and currently, only) attribute causes the immediate parent node of the ComplexPattern operand to be passed into the matching code rather than the node at the root of the entire DAG containing the pattern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 07:27:46 +00:00
Dan Gohman
c6c391dadd Create a new class, MemOperand, for describing memory references
in the backend. Introduce a new SDNode type, MemOperandSDNode, for
holding a MemOperand in the SelectionDAG IR, and add a MemOperand
list to MachineInstr, and code to manage them. Remove the offset
field from SrcValueSDNode; uses of SrcValueSDNode that were using
it are all all using MemOperandSDNode now.

Also, begin updating some getLoad and getStore calls to use the
PseudoSourceValue objects.

Most of this was written by Florian Brander, some
reorganization and updating to TOT by me.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-31 00:25:39 +00:00
Devang Patel
c60141ba43 Always put version numbers at the end because they are optional.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-30 18:30:11 +00:00
Dan Gohman
0e9dfb0900 Update this file for 2.0 syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46512 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 12:35:50 +00:00
Scott Michel
6be48d49cf Fix to bug 1951: tblgen gratuitously renames variables when no temporary was
generated. This feature would only show up in fairly complex patterns, such
as this one in CellSPU:

  def : Pat<(add (SPUhi tconstpool:$in, 0), (SPUlo tconstpool:$in, 0)),
	    (IOHLlo (ILHUhi tconstpool:$in), tconstpool:$in)>;

which generated the following emit code:

SDNode *Emit_0(const SDOperand &N, unsigned Opc0, unsigned Opc1, MVT::ValueType VT0, MVT::ValueType VT1) DISABLE_INLINE {
  SDOperand N0 = N.getOperand(0);
  SDOperand N00 = N0.getOperand(0);
  SDOperand N01 = N0.getOperand(1);
  SDOperand N1 = N.getOperand(1);
  SDOperand N10 = N1.getOperand(0);
  SDOperand N11 = N1.getOperand(1);
  SDOperand Tmp3(CurDAG->getTargetNode(Opc0, VT0, N00), 0);
  return CurDAG->SelectNodeTo(N.Val, Opc1, VT1, Tmp3, Tmp2); /* Tmp2 s/b N00 */
}

Tested against the test suites without incident.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 02:29:31 +00:00
Anton Korobeynikov
7674b9d297 Add interator interface to DAGInit also
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46250 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-22 11:00:07 +00:00
Anton Korobeynikov
82137bd061 Provide iterator access to ListInit contents
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 22:30:26 +00:00
Evan Cheng
b4eae999f6 Fix makefiles to enable Apply style debug build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46180 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-18 21:01:00 +00:00
Devang Patel
3de01e10ae Enable CBE
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46112 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-17 02:10:08 +00:00
Chuck Rose III
9a79de3d09 Add files to windows project files. Also include <algorithm> explicitly so that vstudio build works
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46013 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 21:43:17 +00:00
Evan Cheng
6bfa8a121d Rename CCIfStruct to CCIfByVal and CCStructAssign to CCPassByVal. Remove unused parameters of CCStructAssign and add size and alignment requirement info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 03:34:58 +00:00
Evan Cheng
5daafa9b1b Revert my last commit. Not needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 03:10:35 +00:00
Evan Cheng
3d64f1c018 Need a space to separate Make options.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 17:58:03 +00:00
Evan Cheng
e04c90bde5 Add -disable-lto optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45900 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 04:27:18 +00:00
Evan Cheng
01b8fccca0 ByVal arguments are passed on stack. Make sure to allocate a slot using size and alignment information on the parameter attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45897 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 01:07:41 +00:00
Chris Lattner
a22edc82ca Simplify the side effect stuff a bit more and make licm/sinking
both work right according to the new flags.

This removes the TII::isReallySideEffectFree predicate, and adds
TII::isInvariantLoad. 

It removes NeverHasSideEffects+MayHaveSideEffects and adds
UnmodeledSideEffects as machine instr flags.  Now the clients
can decide everything they need.

I think isRematerializable can be implemented in terms of the
flags we have now, though I will let others tackle that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 23:08:24 +00:00
Chris Lattner
ba7e756c22 Start inferring side effect information more aggressively, and fix many bugs in the
x86 backend where instructions were not marked maystore/mayload, and perf issues where
instructions were not marked neverHasSideEffects.  It would be really nice if we could
write patterns for copy instructions.

I have audited all the x86 instructions down to MOVDQAmr.  The flags on others and on
other targets are probably not right in all cases, but no clients currently use this
info that are enabled by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 07:59:24 +00:00
Chris Lattner
811281e788 Fix a crash on code like: let x = 1 {x
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 07:01:53 +00:00
Chris Lattner
214884ba03 if an instr lacks a pattern, assume it has side effects (unless never has s-e is true).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 05:40:54 +00:00
Chris Lattner
bc0b9f70ae start inferring 'no side effects'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 05:39:30 +00:00
Chris Lattner
8926038785 Infer mayload
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45819 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 04:44:48 +00:00
Chris Lattner
710e995889 realize that instructions who match intrinsics that read memory read memory.
Also, instructions with any nodes that are SDNPMayLoad also read memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45817 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-10 04:38:57 +00:00
Chris Lattner
dcc8b4f5d3 add a mayLoad property for machine instructions, a correlary to mayStore.
This is currently not set by anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-08 18:05:21 +00:00
Chris Lattner
749c6f6b5e rename TargetInstrDescriptor -> TargetInstrDesc.
Make MachineInstr::getDesc return a reference instead
of a pointer, since it can never be null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45695 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 07:27:27 +00:00
Chris Lattner
0ff23966fe Rename all the M_* flags to be namespace qualified enums, and switch
all clients over to using predicates instead of these flags directly.
These are now private values which are only to be used to statically
initialize the tables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45692 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 06:42:05 +00:00
Chris Lattner
8f707e15fb rename hasVariableOperands() -> isVariadic(). Add some comments.
Evan, please review the comments I added to getNumDefs to make sure
that they are accurate, thx.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 05:19:29 +00:00
Chris Lattner
4764189298 Move M_* flags down in the file. Move SchedClass up in the
TargetInstrDescriptor class and shrink to 16-bits, saving a 
word in TargetInstrDescriptor.  Add some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 05:06:49 +00:00
Chris Lattner
af3eb7c758 the name field of instructions is never set to a non-empty string,
just unconditionally use the def name of the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45684 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 04:57:31 +00:00
Chris Lattner
8ca5c67c6e Add predicates methods to TargetOperandInfo, and switch all clients
over to using them, instead of diddling Flags directly.  Change the
various flags from const variables to enums.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 02:39:19 +00:00
Chris Lattner
834f1ce031 rename isLoad -> isSimpleLoad due to evan's desire to have such a predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 23:38:27 +00:00
Chris Lattner
2e48a70b35 rename isStore -> mayStore to more accurately reflect what it captures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45656 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 08:36:04 +00:00
Chris Lattner
c8478d8b12 Change the 'isStore' inferrer to look for 'SDNPMayStore'
instead of "ISD::STORE".  This allows us to mark target-specific dag
nodes as storing (such as ppc byteswap stores).  This allows us to remove
more explicit isStore flags from the .td files.

Finally, add a warning for when a .td file contains an explicit 
isStore and tblgen is able to infer it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45654 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 06:44:58 +00:00
Chris Lattner
e67bde5bb1 set the 'isstore' flag for instructions whose pattern is an
intrinsic that writes to memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45650 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 05:36:50 +00:00
Chris Lattner
2d51a4ce8f remove some old hacky code that tried to infer whether a store
occured in a pattern, but failed miserably.  The new code works for
any instruction that has a store in its pattern, including all the 
x86 mem op mem instructions.

The only target-independent code that uses this is branch folding,
so this won't change anything in practice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45648 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 02:16:26 +00:00
Chris Lattner
a529a37fbd rearrange some code to allow inferring instr info from the pattern of the instr, but don't do so yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45647 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 01:53:37 +00:00
Chris Lattner
f1ab4f18aa improve const correctness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 01:52:22 +00:00
Chris Lattner
6cc654b27a Split the impl of CodeGenInstruction out to its own .cpp file, add a getName() accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 01:35:39 +00:00
Chris Lattner
5fbe275304 final cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45644 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 01:21:51 +00:00
Chris Lattner
ef8339b11a further simplifications and cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45643 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 01:20:13 +00:00
Chris Lattner
951740afb4 simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45642 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 01:12:44 +00:00
Chris Lattner
fe71893183 rename CodegenDAGPatterns -> CodeGenDAGPatterns
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45641 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 01:10:31 +00:00
Chris Lattner
7b11712ef2 split enum emission out from InstrInfoEmitter into it's own tblgen backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45640 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 00:49:05 +00:00
Chris Lattner
93c7e41825 fix build on case sensitive file systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45639 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 23:37:52 +00:00
Chris Lattner
200c57e8ea now that computing CodegenDAGPatterns doesn't implicitly print stuff
out, DAGISelEmitter can compute it in its ctor, which simplifies some code.

Now we can use CodegenDAGPatterns in other parts of tblgen that want access
to dag pattern info, woo!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45636 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 22:58:54 +00:00
Chris Lattner
443e3f9dd6 move Node Transformation printing from CodeGenDAGPatterns -> DAGISelEmitter.
The only difference in output is that we now print them in alphabetical 
order instead of reverse alphabetical order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45635 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 22:54:53 +00:00
Chris Lattner
dc32f9802a move predicate printing code from CodeGenDAGPatterns -> DAGISelEmitter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45634 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 22:43:57 +00:00