Commit Graph

987 Commits

Author SHA1 Message Date
Dan Gohman daca2240b1 Give tablegen's Type a destructor, to suppress spurious
"Type has virtual functions but non-virtual destructor"
warnings.

llvm-svn: 58710
2008-11-04 18:09:07 +00:00
Dan Gohman ade09cd9d3 Add some asserts to verify MVT invariant assumptions.
llvm-svn: 58701
2008-11-04 16:03:56 +00:00
Dan Gohman d7546abb8a Change how extended types are represented in MVTs. Instead of fiddling
bits, use a union of a SimpleValueType enum and a regular Type*.

This increases the size of MVT on 64-bit hosts from 32 bits to 64 bits.
In most cases, this doesn't add significant overhead. There are places
in codegen that use arrays of MVTs, so these are now larger, but
they're small in common cases.

This eliminates restrictions on the size of integer types and vector
types that can be represented in codegen. As the included testcase
demonstrates, it's now possible to codegen very large add operations.
There are still some complications with using very large types. PR2880
is still open so they can't be used as return values on normal targets,
there are no libcalls defined for very large integers so operations
like multiply and divide aren't supported.

This also introduces a minimal tablgen Type library, capable of
handling IntegerType and VectorType. This will allow parts of
TableGen that don't depend on using SimpleValueType values to handle
arbitrary integer and vector types.

llvm-svn: 58623
2008-11-03 17:56:27 +00:00
David Greene ce2a938186 Have TableGen emit setSubgraphColor calls under control of a -gen-debug
flag.  Then in a debugger developers can set breakpoints at these calls
to see waht is about to be selected and what the resulting subgraph
looks like.  This really helps when debugging instruction selection.

llvm-svn: 58278
2008-10-27 21:56:29 +00:00
Cedric Venet 4e6ad3c12b Remove tabs from my previous commit.
llvm-svn: 58263
2008-10-27 19:21:35 +00:00
Matthijs Kooijman d470f73e2c Remove redundant word in tblgen error message.
llvm-svn: 58250
2008-10-27 15:59:43 +00:00
Cedric Venet 10a11f033c Add a default constructor to AsmWriterOperand to make VS2008sp1 happy. (AsmWriterOperand is used in a std::pair, and VS need to generate the default constructor of this pair).
llvm-svn: 58185
2008-10-26 15:40:44 +00:00
Argyrios Kyrtzidis 9e50bff478 Unbreak LLVM on the MSVC compiler:
-Bring in int64_t for TableGen/Record.h and TableGen/TGLexer.h
-Define strtoull

llvm-svn: 57970
2008-10-22 09:54:13 +00:00
Evan Cheng 010e9b0760 Add RCBarriers to TargetInstrDesc. It's a list of register classes the given instruction can "clobber". For example, on x86 the call instruction can modify all of the XMM and fp stack registers.
TableGen has been taught to generate the lists from instruction definitions.

llvm-svn: 57722
2008-10-17 21:00:09 +00:00
Dan Gohman 10549c29a8 Use INT64_C to emit constant values, to avoid problems with
constants that don't fit in an int. This fixes
"this decimal constant is unsigned only in ISO C90"
warnings.

llvm-svn: 57668
2008-10-17 04:40:39 +00:00
Dan Gohman ca0546facc Fun x86 encoding tricks: when adding an immediate value of 128,
use a SUB instruction instead of an ADD, because -128 can be
encoded in an 8-bit signed immediate field, while +128 can't be.
This avoids the need for a 32-bit immediate field in this case.

A similar optimization applies to 64-bit adds with 0x80000000,
with the 32-bit signed immediate field.

To support this, teach tablegen how to handle 64-bit constants.

llvm-svn: 57663
2008-10-17 01:33:43 +00:00
Dan Gohman 6e979020cd Add support for having multiple predicates on a TreePatternNode.
This will allow predicates to be composed, which will allow the
predicate definitions to become less redundant, and eventually
will allow DAGISelEmitter.cpp to emit less redundant code.

llvm-svn: 57562
2008-10-15 06:17:21 +00:00
Duncan Sands 26ff6f9c54 Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.

llvm-svn: 57291
2008-10-08 07:23:46 +00:00
Chris Lattner 758ce7260d Fix shift overflow bug that would occur when a field was a full 32-bits
in tblgen.  This is PR2827, thanks to Waldemar Knorr for tracking this
down.

llvm-svn: 57124
2008-10-05 18:31:58 +00:00
Dale Johannesen 867d549fce Handle some 64-bit atomics on x86-32, some of the time.
llvm-svn: 56963
2008-10-02 18:53:47 +00:00
Dan Gohman b486350b15 Move the primary fast-isel top-level comments to FastISel.cpp, where
they'll be a little more visible. Also, update and reword them a bit.

llvm-svn: 56877
2008-09-30 20:48:29 +00:00
Dan Gohman 843fe14fab Move the code that handles DAGISel error conditions into
helper functions instead of duplicating it inline each time
it is needed. This eliminates a few hundred or so copies
of this code in each target.

llvm-svn: 56759
2008-09-27 23:53:14 +00:00
Dan Gohman 6e0548336a Rename ConstantSDNode's getSignExtended to getSExtValue, for
consistancy with ConstantInt, and re-implement it in terms
of ConstantInt's getSExtValue.

llvm-svn: 56700
2008-09-26 21:54:37 +00:00
Devang Patel 4c758ea3e0 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Mikhail Glushenkov 53aa586844 Move llvmc2 header files under include/llvm/CompilerDriver
llvm-svn: 56466
2008-09-22 20:50:40 +00:00
Mikhail Glushenkov 47afe73081 Plugin support for llvmc2 (a-la opt).
llvm-svn: 56465
2008-09-22 20:49:34 +00:00
Mikhail Glushenkov 4825a0bb2f Make comments a little bit more clear.
llvm-svn: 56463
2008-09-22 20:48:22 +00:00
Mikhail Glushenkov 8a2bdc74b2 Get rid of GlobalLanguageMap. Global state is evil.
llvm-svn: 56462
2008-09-22 20:47:46 +00:00
Mikhail Glushenkov 9c13f724fc Add a (forward_as) option property
llvm-svn: 56459
2008-09-22 20:46:19 +00:00
Mikhail Glushenkov b50080e6cb Delete the file llvmc2/doc/LLVMC-Enhancements.rst + some minor language/spelling fixes.
llvm-svn: 56458
2008-09-22 20:45:17 +00:00
Oscar Fuentes a229b3c9a7 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Evan Cheng 038ca4aa0f Add instruction names as comments to InstBits entries.
llvm-svn: 56275
2008-09-17 06:29:52 +00:00
Bill Wendling 24c79f28b1 Reverting r56249. On further investigation, this functionality isn't needed.
Apologies for the thrashing.

llvm-svn: 56251
2008-09-16 21:48:12 +00:00
Bill Wendling 8bc392fb1d - Change "ExternalSymbolSDNode" to "SymbolSDNode".
- Add linkage to SymbolSDNode (default to external).
- Change ISD::ExternalSymbol to ISD::Symbol.
- Change ISD::TargetExternalSymbol to ISD::TargetSymbol

These changes pave the way to allowing SymbolSDNodes with non-external linkage.

llvm-svn: 56249
2008-09-16 21:12:30 +00:00
Dan Gohman ec270fb640 Change ConstantSDNode and ConstantFPSDNode to use ConstantInt* and
ConstantFP* instead of APInt and APFloat directly.

This reduces the amount of time to create ConstantSDNode
and ConstantFPSDNode nodes when ConstantInt* and ConstantFP*
respectively are already available, as is the case in
SelectionDAGBuild.cpp. Also, it reduces the amount of time
to legalize constants into constant pools, and the amount of
time to add ConstantFP operands to MachineInstrs, due to
eliminating ConstantInt::get and ConstantFP::get calls.

It increases the amount of work needed to create new constants
in cases where the client doesn't already have a ConstantInt*
or ConstantFP*, such as legalize expanding 64-bit integer constants
to 32-bit constants. And it adds a layer of indirection for the
accessor methods. But these appear to be outweight by the benefits
in most cases.

It will also make it easier to make ConstantSDNode and
ConstantFPNode more consistent with ConstantInt and ConstantFP.

llvm-svn: 56162
2008-09-12 18:08:03 +00:00
Dan Gohman effb894453 Rename ConstantSDNode::getValue to getZExtValue, for consistency
with ConstantInt. This led to fixing a bug in TargetLowering.cpp
using getValue instead of getAPIntValue.

llvm-svn: 56159
2008-09-12 16:56:44 +00:00
Evan Cheng c5af471be5 Indentation.
llvm-svn: 56107
2008-09-11 17:31:12 +00:00
Jim Grosbach 56938af9e2 lib/Target/SubtargetFeature.cpp asserts that the FeatureKV[] table be sorted
by its first field, but TableGen doesn't actually enforce creating it that 
way. TableGen sorts the records that will be used to create it by the names 
of the records, not the Name field of those records.

This patch corrects the sort to use the "Name" field of the record as the 
sort key.

llvm-svn: 56106
2008-09-11 17:05:32 +00:00
Evan Cheng f66e1120c6 Change getSubReg semantics. It now returns zero if the specified register doesn't have a subreg of the specified index.
llvm-svn: 56099
2008-09-11 06:25:25 +00:00
Dan Gohman f6ac018926 Fix typos in (generated) comments.
llvm-svn: 55916
2008-09-08 16:29:36 +00:00
Evan Cheng ca14c07175 Correctly handle physical register inputs. They are not explicit input operands in the resulting machine instrs.
llvm-svn: 55893
2008-09-08 08:39:33 +00:00
Evan Cheng 105c581135 Eliminate a compile time warning.
llvm-svn: 55878
2008-09-07 09:00:57 +00:00
Evan Cheng 09638d34a5 Fix indentation of generated code.
llvm-svn: 55876
2008-09-07 08:23:06 +00:00
Evan Cheng 7cab17af29 Ignore multi-instruction patterns. e.g.
def : Pat<(i8 (trunc GR32:$src)),
          (i8 (EXTRACT_SUBREG (MOV32to32_ GR32:$src), x86_subreg_8bit))>

llvm-svn: 55875
2008-09-07 08:19:51 +00:00
Evan Cheng 24422d4928 Let tblgen only generate fastisel routines, not the class definition. This makes it easier for targets to define its own fastisel class.
llvm-svn: 55679
2008-09-03 00:03:49 +00:00
Evan Cheng 34f3a962b0 Change getBinaryCodeForInstr prototype. First operand MachineInstr& should be const. Make corresponding changes.
llvm-svn: 55623
2008-09-02 06:51:36 +00:00
Owen Anderson 0673a8af14 Add initial support for fast isel of instructions that have inputs pinned to physical registers.
llvm-svn: 55545
2008-08-29 17:45:56 +00:00
Dan Gohman d58f3e36d0 Add a target callback for FastISel.
llvm-svn: 55512
2008-08-28 23:21:34 +00:00
Gabor Greif f304a7aa4d erect abstraction boundaries for accessing SDValue members, rename Val -> Node to reflect semantics
llvm-svn: 55504
2008-08-28 21:40:38 +00:00
Owen Anderson 787f100462 Add support for fast-isel of opcodes that require use of extract_subreg. Because of how extract_subreg is treated, it requires special case handling.
llvm-svn: 55480
2008-08-28 18:06:12 +00:00
Dan Gohman 6d153b02c9 Update a comment to reflect recent changes.
llvm-svn: 55418
2008-08-27 16:18:22 +00:00
Dan Gohman 5ca269e684 Basic FastISel support for floating-point constants.
llvm-svn: 55401
2008-08-27 01:09:54 +00:00
Gabor Greif abfdf928d8 disallow direct access to SDValue::ResNo, provide a getter instead
llvm-svn: 55394
2008-08-26 22:36:50 +00:00
Dan Gohman 44003cc354 Refactor a bunch of FastISelEmitter code into a helper class, and
put each major step in a separate function. This makes the high
level sequence of events easier to follow.

llvm-svn: 55385
2008-08-26 21:21:20 +00:00
Cedric Venet cf7154b2d6 - small bug corrected: incorrect iterator type.
- fix to please VS: add a return after an assert.

llvm-svn: 55380
2008-08-26 19:49:04 +00:00