Commit Graph

1307 Commits

Author SHA1 Message Date
David Greene b035445537 Make !if short-circuit when possible.
llvm-svn: 73076
2009-06-08 19:16:56 +00:00
David Greene 07eba05a61 Add a !regmatch operator to do pattern matching in TableGen.
llvm-svn: 73074
2009-06-08 17:00:34 +00:00
Dale Johannesen 5234d3795f Revert 72707 and 72709, for the moment.
llvm-svn: 72712
2009-06-02 03:12:52 +00:00
Dale Johannesen 0b8ca79253 Make the implicit inputs and outputs of target-independent
ADDC/ADDE use MVT::i1 (later, whatever it gets legalized to)
instead of MVT::Flag.  Remove CARRY_FALSE in favor of 0; adjust
all target-independent code to use this format.

Most targets will still produce a Flag-setting target-dependent
version when selection is done.  X86 is converted to use i32
instead, which means TableGen needs to produce different code
in xxxGenDAGISel.inc.  This keys off the new supportsHasI1 bit
in xxxInstrInfo, currently set only for X86; in principle this
is temporary and should go away when all other targets have
been converted.  All relevant X86 instruction patterns are
modified to represent setting and using EFLAGS explicitly.  The
same can be done on other targets.

The immediate behavior change is that an ADC/ADD pair are no
longer tightly coupled in the X86 scheduler; they can be
separated by instructions that don't clobber the flags (MOV).
I will soon add some peephole optimizations based on using
other instructions that set the flags to feed into ADC.

llvm-svn: 72707
2009-06-01 23:27:20 +00:00
Anton Korobeynikov 08bf4c0f5a Propagate CPU string out of SubtargetFeatures
llvm-svn: 72335
2009-05-23 19:50:50 +00:00
Oscar Fuentes 770c8e7927 CMake: Use libpthread in tblgen when needed. Updated list of source
files for PIC16 target.

llvm-svn: 72277
2009-05-22 20:55:15 +00:00
Dale Johannesen 4ff70e389e TableGen for fast isel seems to assume an 'imm'
operand is the last in a pattern.  There is no
reason this should be true (although apparently
it always is right now).

llvm-svn: 72232
2009-05-21 22:25:49 +00:00
Nick Lewycky 942982278c Fix warning.
llvm-svn: 71834
2009-05-15 03:07:14 +00:00
Nick Lewycky d449e7c8c6 Add extra parenthesis around || statements to pacify compiler.
Also fix up some 80col violations while I'm there.

llvm-svn: 71833
2009-05-15 03:03:14 +00:00
David Greene 3587eed2c4 Implement !if, analogous to $(if) in GNU make.
llvm-svn: 71815
2009-05-14 23:26:46 +00:00
David Greene d571b3c94b Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.
Ok, not really, but do support some common LISP functions:

* car
* cdr
* null

llvm-svn: 71805
2009-05-14 22:38:31 +00:00
David Greene e917fff30f Implement a !foreach operator analogous to GNU make's $(foreach).
Use it on dags and lists like this:

class decls {
  string name;
}

def Decls : decls;

class B<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Sr."))>;

llvm-svn: 71803
2009-05-14 22:23:47 +00:00
David Greene 98ed3c7273 Implement a !subst operation simmilar to $(subst) in GNU make to do
def/var/string substitution on generic pattern templates.  For example:

def Type;
def v4f32 : Type;
def TYPE : Type;

class GenType<Type t> {
  let type = !(subst TYPE, v4f32, t);
}

def TheType : GenType<TYPE>;

llvm-svn: 71801
2009-05-14 21:54:42 +00:00
David Greene e8f3b27e65 Implement !cast.
llvm-svn: 71794
2009-05-14 21:22:49 +00:00
David Greene 5d0c051e66 Operation Enhancements
Create an OpInit class to serve as a base for all operation Inits.

Move parsing of operation constructs to separate functions and reference
from multiple places.

Add some commented out new operations.  Coming soon.

llvm-svn: 71789
2009-05-14 20:54:48 +00:00
David Greene 9d3febea6a Fix PR4207.
If we're resolving a list element access and we're given a VarInit,
return a new VarListElementInit referencing the VarInit.

llvm-svn: 71787
2009-05-14 20:38:52 +00:00
Dale Johannesen 69ee5e4cfe Slightly improve generated code in a degenerate case.
Should remove a warning from MSVC.

llvm-svn: 71603
2009-05-12 22:32:29 +00:00
Duncan Sands af9eaa830a Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.

llvm-svn: 71349
2009-05-09 07:06:46 +00:00
Chris Lattner 8bbd76b031 Change 'make install' to install tblgen, for better support of out-of-tree targets,
patch by Mikael Lepistö!

llvm-svn: 71226
2009-05-08 17:32:47 +00:00
Argyrios Kyrtzidis 58f3811300 Move the tablegen-produced DebugLoc handling into a AsmWriter::processDebugLoc function.
No functionality change.

llvm-svn: 71156
2009-05-07 13:55:51 +00:00
Mikhail Glushenkov b43eb8200f A better error message.
llvm-svn: 71068
2009-05-06 04:54:23 +00:00
Mikhail Glushenkov 6da4749ce6 The 'forward_as' property did not use its second argument.
See PR4159 for details. Patch by Martin Nowack!

llvm-svn: 71054
2009-05-06 01:41:19 +00:00
David Greene 44f9d7a8f0 Allow multiclass def names to contain "#NAME"" where TableGen replaces
#NAME# with the name of the defm instantiating the multiclass.  This is
useful for AVX instruction naming where a "V" prefix is standard
throughout the ISA.  For example:

multiclass SSE_AVX_Inst<...> {
   def SS : Instr<...>;
   def SD : Instr<...>;
   def PS : Instr<...>;
   def PD : Instr<...>;

   def V#NAME#SS : Instr<...>;
   def V#NAME#SD : Instr<...>;
   def V#NAME#PS : Instr<...>;
   def V#NAME#PD : Instr<...>;
}

defm ADD : SSE_AVX_Inst<...>;

Results in 

ADDSS
ADDSD
ADDPS
ADDPD

VADDSS
VADDSD
VADDPS
VADDPD

llvm-svn: 70979
2009-05-05 16:28:25 +00:00
Mikhail Glushenkov d953cd9401 Fix incorrect code generation with ENV.
See PR4157 for details. Patch by Martin Nowack!

llvm-svn: 70973
2009-05-05 12:34:34 +00:00
Dan Gohman cfd6941cf9 Quotes are used for including llvm headers, rather than angles.
llvm-svn: 70879
2009-05-04 17:09:51 +00:00
Argyrios Kyrtzidis 9ae29b2d8f -Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
-Depend on DebugLocs for source line info.

(Comes with Regression-Be-Gone(tm))

llvm-svn: 70871
2009-05-04 16:23:49 +00:00
Argyrios Kyrtzidis 79be34012f Revert r70803 for now, it causes a regression.
llvm-svn: 70811
2009-05-03 23:27:19 +00:00
Argyrios Kyrtzidis ce7196b903 -Remove the DwarfWriter::RecordSourceLine calls from the instruction selectors.
-Depend on DebugLocs for source line info.

llvm-svn: 70803
2009-05-03 22:03:35 +00:00
Argyrios Kyrtzidis a5037484a4 Make DebugLoc independent of DwarfWriter.
-Replace DebugLocTuple's Source ID with CompileUnit's GlobalVariable*
-Remove DwarfWriter::getOrCreateSourceID
-Make necessary changes for the above (fix callsites, etc.)

llvm-svn: 70520
2009-04-30 23:22:31 +00:00
Jakob Stoklund Olesen c8124976af Slightly change TableGen's definition of a register subclass.
A subclass is allowed to have a larger spill size than the superclass, and the
spill alignment must be a multiple of the superclass alignment. This causes
the following new subclass relations:

=== Alpha ===
F4RC -> F8RC

=== PPC ===
F4RC -> F8RC

=== SPU ===
R8C -> R16C -> R32C/R32FP -> R64C/R64FP -> GPRC/VECREG

=== X86 ===
FR32  -> FR64  -> VR128
RFP32 -> RFP64 -> RFP80

These subclass relations are consistent with the behaviour of -join-cross-class-copies.

llvm-svn: 70511
2009-04-30 21:22:44 +00:00
Bob Wilson f71e656631 Rename the CurMultiClass formal parameter of TGParser::AddSubMultiClass
so that it doesn't shadow the instance variable of the same name.
Make the parameter names in method declarations match the definitions.

llvm-svn: 70502
2009-04-30 18:26:19 +00:00
Bob Wilson 92ab820f03 Remove unnecessary "class" keywords.
llvm-svn: 70499
2009-04-30 17:46:20 +00:00
Bob Wilson 56d8625492 Change forward declaration of MultiClass to use the "struct" keyword instead
of "class", so that it matches the subsequent definition.

llvm-svn: 70498
2009-04-30 17:35:11 +00:00
Bill Wendling 026e5d7667 Instead of passing in an unsigned value for the optimization level, use an enum,
which better identifies what the optimization is doing. And is more flexible for
future uses.

llvm-svn: 70440
2009-04-29 23:29:43 +00:00
Bill Wendling 084669a1c9 Second attempt:
Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'll change the JIT with a follow-up patch.

llvm-svn: 70343
2009-04-29 00:15:41 +00:00
Bob Wilson 3d948164f7 Fix trailing whitespace and 80-col. violations in recent TableGen changes.
llvm-svn: 70319
2009-04-28 19:41:44 +00:00
Bill Wendling 56f2987a87 r70270 isn't ready yet. Back this out. Sorry for the noise.
llvm-svn: 70275
2009-04-28 01:04:53 +00:00
Bill Wendling d0ae15946c Massive check in. This changes the "-fast" flag to "-O#" in llc. If you want to
use the old behavior, the flag is -O0. This change allows for finer-grained
control over which optimizations are run at different -O levels.

Most of this work was pretty mechanical. The majority of the fixes came from
verifying that a "fast" variable wasn't used anymore. The JIT still uses a
"Fast" flag. I'm not 100% sure if it's necessary to change it there...

llvm-svn: 70270
2009-04-28 00:21:31 +00:00
Nate Begeman 8d6d4b9289 2nd attempt, fixing SSE4.1 issues and implementing feedback from duncan.
PR2957

ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle
mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes
as the shuffle mask.  A value of -1 represents UNDEF.

In addition to eliminating the creation of illegal BUILD_VECTORS just to 
represent shuffle masks, we are better about canonicalizing the shuffle mask,
resulting in substantially better code for some classes of shuffles.

llvm-svn: 70225
2009-04-27 18:41:29 +00:00
David Greene 7049e79e45 Fix multiclass inheritance to limit value resolution to new defs added
by base multiclasses.  Do not attempt to alter defs from previous base
multiclasses.  This fixes multiple multiclass inheritance.

llvm-svn: 69974
2009-04-24 16:55:41 +00:00
Rafael Espindola b93db668b3 Revert 69952. Causes testsuite failures on linux x86-64.
llvm-svn: 69967
2009-04-24 12:40:33 +00:00
Nate Begeman bb881d66f4 PR2957
ISD::VECTOR_SHUFFLE now stores an array of integers representing the shuffle
mask internal to the node, rather than taking a BUILD_VECTOR of ConstantSDNodes
as the shuffle mask.  A value of -1 represents UNDEF.

In addition to eliminating the creation of illegal BUILD_VECTORS just to 
represent shuffle masks, we are better about canonicalizing the shuffle mask,
resulting in substantially better code for some classes of shuffles.

A clean up of x86 shuffle code, and some canonicalizing in DAGCombiner is next.

llvm-svn: 69952
2009-04-24 03:42:54 +00:00
David Greene 196ac3c69a Make BinOps typed and require a type specifier for !nameconcat. This
allows binops to be used in typed contexts such as when passing
arguments to classes.

llvm-svn: 69921
2009-04-23 21:25:15 +00:00
David Greene f00919a040 Allow defm to inherit from multiple multiclasses.
llvm-svn: 69832
2009-04-22 22:17:51 +00:00
David Greene a9c6c5d39b Implement !nameconcat to concatenate strings and look up the resulting
name in the symbol table, returning an object.

llvm-svn: 69822
2009-04-22 20:18:10 +00:00
David Greene 753ed8fd9c Implement multiclass inheritance.
llvm-svn: 69810
2009-04-22 16:42:54 +00:00
Mikhail Glushenkov c48ede23bd Add some assertions.
Fixes segfaults in some corner cases.

llvm-svn: 69494
2009-04-19 00:22:35 +00:00
Bob Wilson a4c2290e5f Use CallConvLower.h and TableGen descriptions of the calling conventions
for ARM.  Patch by Sandeep Patel.

llvm-svn: 69371
2009-04-17 19:07:39 +00:00
Bob Wilson b8c370a8b5 Fix PR3994: LLVMMatchType arguments do not refer to absolute return value
and argument positions but only to the overloaded intrinsic parameters.
Keep a separate list of these overloaded parameters in CodeGenTarget.cpp
so they can be resolved easily.  Remove assertions from IntrinsicEmitter.cpp:
they were harmless but confusing, and the assertions elsewhere in TableGen
will catch any incorrect values.

llvm-svn: 69316
2009-04-16 21:51:05 +00:00
Chris Lattner cce520f884 prove diagnostic -> group mapping information.
llvm-svn: 69270
2009-04-16 05:52:18 +00:00
Chris Lattner 1e86593b6a encode subgroups into the clang .inc file. -Wall now works!
llvm-svn: 69257
2009-04-16 03:16:12 +00:00
Chris Lattner 13507d6cba start producing subgroup info.
llvm-svn: 69249
2009-04-16 00:53:25 +00:00
Chris Lattner 4816a3488f make sure that empty diag groups get known by clang.
llvm-svn: 69235
2009-04-15 22:33:02 +00:00
Chris Lattner bcba418569 implement support for writing out diagnostic group tables.
llvm-svn: 69219
2009-04-15 20:55:08 +00:00
Chris Lattner e05d99f604 use UppercaseString instead of EmitAllCaps
llvm-svn: 69213
2009-04-15 20:16:12 +00:00
Chris Lattner 3983dfdc83 use escape string.
llvm-svn: 69212
2009-04-15 20:13:18 +00:00
Chris Lattner c2ac800cd7 rename -gen-clang-diags-options -> -gen-clang-diag-groups
llvm-svn: 69208
2009-04-15 20:02:32 +00:00
Chris Lattner 06a7f37265 don't infer diag class from parenting relations, make it an explicit field
in the record.

llvm-svn: 69176
2009-04-15 16:55:46 +00:00
Chris Lattner 4e7b579ecc include the default mapping in the clang diagnostic .inc files.
llvm-svn: 69173
2009-04-15 16:43:18 +00:00
Chris Lattner 3dfaeeaefc minor cleanups
llvm-svn: 69152
2009-04-15 06:26:49 +00:00
Dan Gohman 6c1426308c Rename COPY_TO_SUBCLASS to COPY_TO_REGCLASS, and generalize
it accordingly. Thanks to Jakob Stoklund Olesen for pointing
out how this might be useful.

llvm-svn: 68986
2009-04-13 21:06:25 +00:00
Dan Gohman 60a446ab02 Add a new TargetInstrInfo MachineInstr opcode, COPY_TO_SUBCLASS.
This will be used to replace things like X86's MOV32to32_.

Enhance ScheduleDAGSDNodesEmit to be more flexible and robust
in the presense of subregister superclasses and subclasses. It
can now cope with the definition of a virtual register being in
a subclass of a use.

Re-introduce the code for recording register superreg classes and
subreg classes. This is needed because when subreg extracts and
inserts get coalesced away, the virtual registers are left in
the correct subclass.

llvm-svn: 68961
2009-04-13 15:38:05 +00:00
Dan Gohman e14b8d9853 Generalize getRegisterClassForRegister to handle registers
in multiple classes in the case that the classes are all
in subset/superset relations. This function is used by the
fast-isel emitter, which always wants the super-most set.

llvm-svn: 68957
2009-04-13 15:24:11 +00:00
Owen Anderson 5eb8d26f19 Give register alias checking the hash table treatment too.
llvm-svn: 68730
2009-04-09 22:19:30 +00:00
Owen Anderson 3a888f639e Convert TargetRegisterInfo's super-register checking to use a pre-computed hash table just like subregister checking does.
llvm-svn: 68669
2009-04-09 03:50:16 +00:00
Chris Lattner 3a88fa0ff8 "This adds a getName() method to TargetRegisterClass, just like in TargetRegisterInfo.
This makes debugging register classes a bit easier."

Patch by Jakob Stoklund Olesen!

llvm-svn: 68400
2009-04-03 20:25:41 +00:00
Dan Gohman b425feb2aa Delete ISD::INSERT_SUBREG and ISD::EXTRACT_SUBREG, which are unused.
Note that these are distinct from TargetInstrInfo::INSERT_SUBREG
and TargetInstrInfo::EXTRACT_SUBREG, which are used.

llvm-svn: 68355
2009-04-03 00:25:26 +00:00
Ted Kremenek 061cf25072 Constify method to make VC++ happy. Patch by Brian Diekelman!
llvm-svn: 68222
2009-04-01 18:24:22 +00:00
Dan Gohman 90ea62cba6 Tidy up some comments.
llvm-svn: 68112
2009-03-31 16:48:35 +00:00
Dan Gohman 0837aa99ea Add a comment.
llvm-svn: 68111
2009-03-31 16:46:45 +00:00
Jim Grosbach 975c1cb41a fix a few spelling errors and typos
llvm-svn: 67758
2009-03-26 16:17:51 +00:00
Jim Grosbach 4bae1ac5e8 Use 'bool' for FoundRC
llvm-svn: 67750
2009-03-26 14:45:34 +00:00
Jim Grosbach 292ea55130 Modify getRegisterValueType() to allow for a register being in mutliple
register classes. Before, MVT::Other would be returned anytime a reg was
in multiple register classes. Now, MVT::Other is only returned if the types
for those register classes differ.

llvm-svn: 67714
2009-03-25 23:28:33 +00:00
Ted Kremenek c8e54db801 Add sanity check in Clang TableGen backend to check if 'Component' is a string.
llvm-svn: 67565
2009-03-23 21:54:33 +00:00
Sebastian Redl 8d5baa09f8 Fix the Win32 VS2008 build:
- Make type declarations match the struct/class keyword of the definition.
 - Move AddSignalHandler into the namespace where it belongs.
 - Correctly call functions from template base.
 - Some other small changes.
With this patch, LLVM and Clang should build properly and with far less noise under VS2008.

llvm-svn: 67347
2009-03-19 23:26:52 +00:00
Ted Kremenek dd03b5bb63 Fix regression in 'tblgen -gen-clang-diags-defs': Emit the diagnostic kind instead of "DIAGNOSTICCONTROLLED".
llvm-svn: 67305
2009-03-19 17:18:09 +00:00
Nate Begeman dbe3f77f5b Add support to tablegen for naming the nodes themselves, not just the operands,
in selectiondag patterns.  This is required for the upcoming shuffle_vector rewrite,
and as it turns out, cleans up a hack in the Alpha instruction info.

llvm-svn: 67286
2009-03-19 05:21:56 +00:00
Ted Kremenek 4724b8262f tblgen -gen-clang-diags-options: Output OptionTable entries in lexicographic
order.

llvm-svn: 67244
2009-03-18 21:36:46 +00:00
Ted Kremenek bf76c6d971 'tblgen -gen-clang-diags-options' now outputs the OptionTable:
static const WarningOption OptionTable[] = {
    {"unused-macros", DIAGS(UnusedMacrosDiags)}
    ...
  };

This table is not yet properly sorted.

llvm-svn: 67242
2009-03-18 21:28:47 +00:00
Ted Kremenek 4a330b7ec1 Add another Clang TableGen-backend (-gen-clang-diags-options) for emitting
declarations for controlling groups of warnings. Currently this transforms:

  def UnusedMacrosDiags : Option<"unused-macros", [pp_macro_not_used]>;
  
into:

  static const diag::kind UnusedMacrosDiags[] = { diag::pp_macro_not_used };

llvm-svn: 67239
2009-03-18 21:16:16 +00:00
Chris Lattner 0f6dc78cfe include the null at the end of a memorybuffer as part of the buffer.
This allows tblgen to handle include "foo.td" when the quote is exactly
the last character in a file.  rdar://6695728

llvm-svn: 67232
2009-03-18 20:36:45 +00:00
Douglas Gregor 9f20b83568 Add TGSourceMgr.cpp to CMake build, sort lines
llvm-svn: 67042
2009-03-16 17:04:14 +00:00
Ted Kremenek 9750429e61 Add (hidden) TableGen command option '-clang-component' which specifies the
component's warnings to process for '-gen-clang-diags-defs'.

Also, when the component is specified, generate a '#if' prologue at the top of
the generated .def file (to match the current files).

llvm-svn: 66975
2009-03-13 22:53:41 +00:00
Ted Kremenek dee115697b Add initial implementation of a TableGen backend for converting Clang-warnings
tablegen files to the original .def preprocessor include files. This is my first
TableGen backend; I don't claim that it is awesome.

llvm-svn: 66971
2009-03-13 22:21:17 +00:00
Ted Kremenek 58e32877f1 Further constify Record::isSubClassOf.
llvm-svn: 66970
2009-03-13 22:20:10 +00:00
Chris Lattner 8bd06d8e1b Fix escaping in asm string literals correctly by having tblgen unescape
them, then the asmprinter emitter reescape them.

llvm-svn: 66958
2009-03-13 21:33:17 +00:00
Chris Lattner a614ef2000 add a horrible hack to fix the build.
llvm-svn: 66957
2009-03-13 21:23:43 +00:00
Chris Lattner 1bd3674306 add support for a few simple escape characters in tblgen strings.
llvm-svn: 66949
2009-03-13 21:03:27 +00:00
Chris Lattner ba42e49c14 add a new TGError class and use it to propagate location info with
errors when thrown.  This gets us nice errors like this from tblgen:

CMOVL32rr: 	(set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: error:
Included from X86.td:116:
Parsing X86InstrInfo.td:922: In CMOVL32rr: X86cmov node requires exactly 4 operands!
def CMOVL32rr : I<0x4C, MRMSrcReg,       // if <s, GR32 = GR32
^

instead of just:

CMOVL32rr: 	(set GR32:i32:$dst, (X86cmov GR32:$src1, GR32:$src2))
/Users/sabre/llvm/Debug/bin/tblgen: In CMOVL32rr: X86cmov node requires exactly 4 operands!

This is all I plan to do with this, but it should be easy enough to improve if anyone 
cares (e.g. keeping more loc info in "dag" expr records in tblgen.

llvm-svn: 66898
2009-03-13 16:25:21 +00:00
Chris Lattner bd9b9210c2 give each Record a location.
llvm-svn: 66897
2009-03-13 16:09:24 +00:00
Chris Lattner 87710ca527 make "locations" a class instead of a typedef.
llvm-svn: 66895
2009-03-13 16:01:53 +00:00
Argyrios Kyrtzidis afc74e2326 Unbreak build, bring in std::string for GCC 4.3
llvm-svn: 66876
2009-03-13 08:12:13 +00:00
Evan Cheng bd5616271b Unbreak build.
llvm-svn: 66874
2009-03-13 07:41:30 +00:00
Chris Lattner 8db9bc7ee4 split buffer management and diagnostic printing out of the tblgen
lexer into its own TGSourceMgr class.

llvm-svn: 66873
2009-03-13 07:05:43 +00:00
Chris Lattner be0d672ac4 implement support for C-style string literal concatenation in td files.
llvm-svn: 66663
2009-03-11 17:08:13 +00:00
Chris Lattner e3fc2d13be Change various llvm utilities to use PrettyStackTraceProgram in
their main routines.  This makes the tools print their argc/argv
commands if they crash.

llvm-svn: 66248
2009-03-06 05:34:10 +00:00
Mikhail Glushenkov f6281fb47c 'append_cmd' should split its argument.
Makes '(append_cmd "-foo a b c")' work.

llvm-svn: 65623
2009-02-27 06:46:55 +00:00
Chris Lattner 265fc59cb2 these utils don't need exports.
llvm-svn: 65559
2009-02-26 19:02:23 +00:00
Mon P Wang b402493161 Added support to have TableGen provide information if an intrinsic (core
or target) can be overloaded or not.

llvm-svn: 65404
2009-02-24 23:17:49 +00:00
Bill Wendling c5437ea429 Overhaul my earlier submission due to feedback. It's a large patch, but most of
them are generic changes.

- Use the "fast" flag that's already being passed into the asm printers instead
  of shoving it into the DwarfWriter.

- Instead of calling "MI->getParent()->getParent()" for every MI, set the
  machine function when calling "runOnMachineFunction" in the asm printers.

llvm-svn: 65379
2009-02-24 08:30:20 +00:00
Bill Wendling 786c5973f7 - Use the "Fast" flag instead of "OptimizeForSize" to determine whether to emit
a DBG_LABEL or not. We want to fall back to the original way of emitting debug
  info when we're in -O0/-fast mode.
- Add plumbing in to pass the "Fast" flag to places that need it.
- XFAIL DebugInfo/deaddebuglabel.ll. This is finding 11 labels instead of 8. I
  need to investigate still.

llvm-svn: 65367
2009-02-24 02:35:30 +00:00
Bill Wendling 4d38d7272e We have logic in there to emit a default debugging label at the beginning of a
function. Emitting another label after the prologue messes up the debugging. We
are doing that because the first DebugLoc object it sees is different from the
previous, which was nothing. Check for this situation, and don't emit one if
it's the first.

llvm-svn: 65180
2009-02-20 22:19:20 +00:00
Bill Wendling 0a0987d198 Add an accessor method to DwarfWriter to tell of debugging info should be emitted.
llvm-svn: 65092
2009-02-20 00:44:43 +00:00
Bill Wendling 82d8f120ec Print out a new label only if the debug location *tuple* is different. The debug
locations may change, but the tuples may be the same.

llvm-svn: 65039
2009-02-19 09:16:38 +00:00
Bill Wendling 13aada6fc4 Forgot to check that debug information is supported.
llvm-svn: 65034
2009-02-19 08:06:12 +00:00
Bill Wendling 0f4c581c4a Put code that generates debug labels into TableGen so that it can be used by
everyone.

llvm-svn: 64978
2009-02-18 23:12:06 +00:00
Dan Gohman 8cab4c44bb Add explicit keywords.
llvm-svn: 64915
2009-02-18 16:37:45 +00:00
Cedric Venet d1e179d992 Unbreak the build on win32.
Cleanup some warning.

Remark: when struct/class are declared differently than they are defined, this make problem for VC++ since it seems to mangle class differently that struct. These error are very hard to understand and find. So please, try to keep your definition/declaration in sync.

Only tested with VS2008. hope it does not break anything. feel free to revert.

llvm-svn: 64554
2009-02-14 16:06:42 +00:00
Duncan Sands 73247d2edc Generalize some alias analysis logic from atomic
intrinsics to any IntrWriteArgMem intrinsics.

llvm-svn: 64551
2009-02-14 10:56:35 +00:00
Evan Cheng b9946d9841 Eliminate a 'control reaches end of non-void function' warning.
llvm-svn: 64111
2009-02-09 03:07:24 +00:00
Dale Johannesen 9f3f72f144 Get rid of one more non-DebugLoc getNode and
its corresponding getTargetNode.  Lots of
caller changes.

llvm-svn: 63904
2009-02-06 01:31:28 +00:00
Dale Johannesen f80493bbfd Remove a non-DebugLoc version of getNode.
llvm-svn: 63889
2009-02-05 22:07:54 +00:00
Dale Johannesen b842d529a3 Reapply 63765. Patches for clang and llvm-gcc to follow.
llvm-svn: 63812
2009-02-05 01:49:45 +00:00
Dale Johannesen f08a47bb70 Remove non-DebugLoc forms of CopyToReg and CopyFromReg.
Adjust callers.

llvm-svn: 63789
2009-02-04 23:02:30 +00:00
Dale Johannesen ae616c2c61 Reverting 63765. This broke the build of both clang
and llvm-gcc.

llvm-svn: 63786
2009-02-04 22:47:25 +00:00
Nate Begeman 6ae3aa83d0 New feature: add support for target intrinsics being defined in the
target directories themselves.  This also means that VMCore no longer
needs to know about every target's list of intrinsics.  Future work
will include converting the PowerPC target to this interface as an
example implementation.

llvm-svn: 63765
2009-02-04 19:47:21 +00:00
Duncan Sands 3ed768868d Fix PR3453 and probably a bunch of other potential
crashes or wrong code with codegen of large integers:
eliminate the legacy getIntegerVTBitMask and
getIntegerVTSignBit methods, which returned their
value as a uint64_t, so couldn't handle huge types.

llvm-svn: 63494
2009-02-01 18:06:53 +00:00
Bill Wendling 33dddf3235 Explain why this is here.
llvm-svn: 63342
2009-01-29 23:19:43 +00:00
Bill Wendling 50338007b9 - Add DebugLoc to getTargetNode().
- Modify TableGen to add the DebugLoc when calling getTargetNode.

(The light-weight wrappers are only temporary. The non-DebugLoc version will be
removed once the whole debug info stuff is finished with.)

llvm-svn: 63273
2009-01-29 05:27:31 +00:00
Dan Gohman 84f0165273 Move the code that starts printing the Select_* functions
after the code that sorts the patterns. This doesn't
affect the output, but it makes the code a little easier
to follow.

llvm-svn: 63265
2009-01-29 01:37:18 +00:00
Mikhail Glushenkov 02b47b5e7a Typo.
llvm-svn: 63174
2009-01-28 03:47:58 +00:00
Mikhail Glushenkov 2115d09a10 Add three new option properties.
Adds new option properties 'multi_val', 'one_or_more' and 'zero_or_one'.

llvm-svn: 63172
2009-01-28 03:47:20 +00:00
Evan Cheng 4a0bf66eb8 Eliminate a couple of fields from TargetRegisterClass: SubRegClasses and SuperRegClasses. These are not necessary. Also eliminate getSubRegisterRegClass and getSuperRegisterRegClass. These are slow and their results can change if register file names change. Just use TargetLowering::getRegClassFor() to get the right TargetRegisterClass instead.
llvm-svn: 62762
2009-01-22 09:10:11 +00:00
Chris Lattner 9fc809e980 Make tblgen more portable, allowing it to build with ICC.
Patch by Robert Zeh!

llvm-svn: 62750
2009-01-22 05:10:16 +00:00
Mikhail Glushenkov fbc89cecad Change the hook API back to prevent memory leaks.
llvm-svn: 62686
2009-01-21 13:04:33 +00:00
Mikhail Glushenkov bf9716e15d Allow hooks with arguments.
llvm-svn: 62685
2009-01-21 13:04:00 +00:00
Dan Gohman 3289983d69 Avoid triggering an assertion failure when an instruction pattern
is a leaf node. Patch by Brandner!

llvm-svn: 62361
2009-01-16 21:30:55 +00:00
Dan Gohman 3e35fe8968 Add support for instructions with multiple ComplexPatterns, by
adding more information to the temporary variables names so that
they don't conflict.

llvm-svn: 62296
2009-01-16 02:05:52 +00:00
Duncan Sands dc020f9c3c Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Chris Lattner 2089cd09ba make tblgen autogenerate the nocapture intrinsics for
llvm.memcpy/memset/memmove.  This allows removal of some 
hackish code from basicaa.

llvm-svn: 62071
2009-01-12 02:41:37 +00:00
Chris Lattner 9d0a8770bd add scaffolding to emit argument attributes. No functionality
change.

llvm-svn: 62067
2009-01-12 01:27:55 +00:00
Chris Lattner 49b7ee1b50 make tblgen emit the entire Intrinsic::getAttributes method,
not a random piece of it.  No functionality change.

llvm-svn: 62066
2009-01-12 01:18:58 +00:00
Chris Lattner 9a3113aeb8 add nocapture attribute to llvm.mem* intrinsics and have tblgen
parse them.  tblgen doesn't yet do anything with this info though.

llvm-svn: 62065
2009-01-12 01:12:03 +00:00
Bob Wilson f76486ac8a Improve support for type-generic vector intrinsics by teaching TableGen how
to handle LLVMMatchType intrinsic parameters, and by adding new subclasses
of LLVMMatchType to match vector types with integral elements that are 
either twice as wide or half as wide as the elements of the matched type.

llvm-svn: 61834
2009-01-07 00:09:01 +00:00
Dan Gohman 49c42d5f57 Delete an unused variable and simplify the code.
llvm-svn: 61732
2009-01-05 19:31:28 +00:00
Bob Wilson c9e772efc2 Handle iAny and fAny types in TreePatternNode::UpdateNodeType.
llvm-svn: 61713
2009-01-05 17:52:54 +00:00
Bob Wilson 1b97f3fcea Fix spelling in some comments.
llvm-svn: 61702
2009-01-05 17:23:09 +00:00
Dan Gohman f1fb65c747 Use dyn_cast intead of isa + cast in the generated DAGISel code. This
reduces the amount of code slightly when assertions are enabled.

llvm-svn: 61249
2008-12-19 18:13:39 +00:00
Mon P Wang a501640ffa Added support for vector widening.
llvm-svn: 61209
2008-12-18 20:03:17 +00:00
Mikhail Glushenkov cf029824e1 Fix typo in error message.
llvm-svn: 61191
2008-12-18 04:06:58 +00:00
Mikhail Glushenkov 5932d8c986 Some enhancements for the 'case' expression.
Add (error) and (empty).

llvm-svn: 61117
2008-12-17 02:47:01 +00:00
Mikhail Glushenkov e30a2820f6 Put Edge* classes into anonymous namespace.
Prevents conflicts between plugins.

llvm-svn: 60871
2008-12-11 10:34:18 +00:00
Mikhail Glushenkov 7f1bef5a55 Make 'extern' an option property.
Makes (forward) work better.

llvm-svn: 60667
2008-12-07 16:47:12 +00:00
Mikhail Glushenkov 4cc945da6e Better error message.
llvm-svn: 60664
2008-12-07 16:45:12 +00:00
Mikhail Glushenkov 395cb25ac7 Re-apply Cedric's changes.
Use B instead of Beg (for consistency), but NodeA and NodeB instead of A
and B.

llvm-svn: 60663
2008-12-07 16:44:47 +00:00
Mikhail Glushenkov 0d88271490 Try to guess when the auto-generated cl::Sink option should be marked 'extern'.
This would be much easier to do if the CommandLine library didn't use
global state. Global state is evil.

llvm-svn: 60659
2008-12-07 16:42:47 +00:00
Mikhail Glushenkov 35a46f808b Add a (progn)-like construct for (actions). Implemented as a DAG list.
llvm-svn: 60658
2008-12-07 16:42:22 +00:00
Mikhail Glushenkov 85467c71d2 Use (actions) instead of option properties, support external options.
Also includes a major refactoring. See documentation for more
information.

llvm-svn: 60656
2008-12-07 16:41:11 +00:00
Cedric Venet af333378c9 The use of the construct:
for(Type1 B = ...;;) { Type2 B ; ... }
is bad: code is hard to read and VS VS don't like it (it ignore the second declaration of B).
This patch fix the problem in tablegen. Please don't write code like this. 

llvm-svn: 60590
2008-12-05 13:37:30 +00:00
Dan Gohman 69cc2cbbff Rename isSimpleLoad to canFoldAsLoad, to better reflect its meaning.
llvm-svn: 60487
2008-12-03 18:15:48 +00:00
Dan Gohman cc78cdf275 Mark x86's V_SET0 and V_SETALLONES with isSimpleLoad, and teach X86's
foldMemoryOperand how to "fold" them, by converting them into constant-pool
loads. When they aren't folded, they use xorps/cmpeqd, but for example when
register pressure is high, they may now be folded as memory operands, which
reduces register pressure.

Also, mark V_SET0 isAsCheapAsAMove so that two-address-elimination will
remat it instead of copying zeros around (V_SETALLONES was already marked).

llvm-svn: 60461
2008-12-03 05:21:24 +00:00
Dan Gohman ae3ba45eb2 Add a sanity-check to tablegen to catch the case where isSimpleLoad
is set but mayLoad is not set. Fix all the problems this turned up.

Change code to not use isSimpleLoad instead of mayLoad unless it
really wants isSimpleLoad.

llvm-svn: 60459
2008-12-03 02:30:17 +00:00
Mikhail Glushenkov cc2d0b2c4c Support multiple compilation graph definitions. Not terribly useful, but makes the code more generic.
llvm-svn: 60199
2008-11-28 00:13:47 +00:00
Mikhail Glushenkov 3bb3da6f4c Add 'hidden' and 'really_hidden' option properties.
llvm-svn: 60198
2008-11-28 00:13:25 +00:00
Evan Cheng 83bdb38965 On x86 favors folding short immediate into some arithmetic operations (e.g. add, and, xor, etc.) because materializing an immediate in a register is expensive in turns of code size.
e.g.
movl 4(%esp), %eax
addl $4, %eax

is 2 bytes shorter than

movl $4, %eax
addl 4(%esp), %eax

llvm-svn: 60139
2008-11-27 00:49:46 +00:00
Mikhail Glushenkov 3ac10202c0 Small fix: the error message was incorrect in some cases.
llvm-svn: 60099
2008-11-26 10:55:45 +00:00
Mikhail Glushenkov 20313c954e Support dependencies between plugins by priority-sorting.
llvm-svn: 59449
2008-11-17 17:30:25 +00:00
Mikhail Glushenkov 7549d568d5 Filter ToolPropertiesList to exclude all Tools not mentioned in the compilation graph.
llvm-svn: 59448
2008-11-17 17:29:42 +00:00
Mikhail Glushenkov faae122e07 Add a layer of indirection to make plugins more flexible.
Use strings instead of TableGen defs in the compilation graph
definition. Makes it easier for the plugins to modify an existing graph.

llvm-svn: 59447
2008-11-17 17:29:18 +00:00
Bill Wendling c35325c698 Fix to record comparator to make it work for return values > 1.
llvm-svn: 59242
2008-11-13 12:03:00 +00:00
Bill Wendling 3d2667c8f3 Put comma in correct place for call to StructType::get
llvm-svn: 59241
2008-11-13 10:18:35 +00:00
Bill Wendling 9182147f17 Modify the intrinsics pattern to separate out the "return" types from the
"parameter" types. An intrinsic can now return a multiple return values like
this:

  def add_with_overflow : Intrinsic<[llvm_i32_ty, llvm_i1_ty],
                                    [LLVMMatchType<0>, LLVMMatchType<0>]>;

llvm-svn: 59237
2008-11-13 09:08:33 +00:00
Mikhail Glushenkov a2909684b6 Check the return value of std::getenv.
When constructing std::strings from C strings, we should check the input
value to be not NULL so that the std::string constructor does not
segfault.
Fixes #3047.

llvm-svn: 59131
2008-11-12 12:41:18 +00:00
Mikhail Glushenkov 1cb041242f Add a bit of lazy evaluation to PopulateCompilationGraph().
Only the tools that are mentioned in the compilation graph definition
are now inserted by PopulateCompilationGraph(). This should cut down
plugin loading time a little.

llvm-svn: 59097
2008-11-12 00:05:17 +00:00
Mikhail Glushenkov c1e7dbb1f7 Some cosmetic changes.
llvm-svn: 59096
2008-11-12 00:04:46 +00:00
Mikhail Glushenkov f5a294d08d Allow $CALL and $ENV in command names. Fixes #3025.
llvm-svn: 58922
2008-11-08 19:43:32 +00:00
Anton Korobeynikov 9278247502 Properly escape dashes in TableGen's LLVMC2 emitter.
Patch by Patrick Walton!

llvm-svn: 58901
2008-11-08 10:16:21 +00:00
Dan Gohman cc0d2cfa01 Make tablegen print out a nice error message for a const char*
exception, like it does for a std::string exception.

llvm-svn: 58865
2008-11-07 21:01:13 +00:00
Dan Gohman ce2417f4e1 Use an assert to check that SelectCode isn't called on
nodes that are already selected.

llvm-svn: 58763
2008-11-05 18:30:52 +00:00
Dan Gohman f14b77ebf1 Eliminate the ISel priority queue, which used the topological order for a
priority function. Instead, just iterate over the AllNodes list, which is
already in topological order. This eliminates a fair amount of bookkeeping,
and speeds up the isel phase by about 15% on many testcases.

The impact on most targets is that AddToISelQueue calls can be simply removed.

In the x86 target, there are two additional notable changes.

The rule-bending AND+SHIFT optimization in MatchAddress that creates new
pre-isel nodes during isel is now a little more verbose, but more robust.
Instead of either creating an invalid DAG or creating an invalid topological
sort, as it has historically done, it can now just insert the new nodes into
the node list at a position where they will be consistent with the topological
ordering.

Also, the address-matching code has logic that checked to see if a node was
"already selected". However, when a node is selected, it has all its uses
taken away via ReplaceAllUsesWith or equivalent, so it won't recieve any
further visits from MatchAddress. This code is now removed.

llvm-svn: 58748
2008-11-05 04:14:16 +00:00
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