Commit Graph

1926 Commits

Author SHA1 Message Date
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
Anton Korobeynikov c6cd4b5016 'The "or die" is intended to catch the case where nm returned a
non-zero exit status, so nm will already have printed some error
messages.'

Patch by Jay Foad!

llvm-svn: 69677
2009-04-21 16:04:14 +00:00
Evan Cheng 40c52322a7 One Mac OS X, just build with -O3 but without -fstrict-aliasing (which is kinda broken).
llvm-svn: 69630
2009-04-20 22:16:40 +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
Bill Wendling e8b48b49c9 Don't install the libLLVMHello.dylib example.
llvm-svn: 68807
2009-04-10 18:48:38 +00:00
Bill Wendling 591854d441 Don't run "dsymutils" on .a files.
llvm-svn: 68795
2009-04-10 17:45:16 +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
Dan Gohman d3899dc52f Update the polygen grammer to reflect that zext and sext are no longer
valid argument attributes (zeroext and signext are).

llvm-svn: 68053
2009-03-30 19:59:02 +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
Sebastian Redl 9384e2ca4d Add TableGen syntax highlighting for the jEdit editor.
llvm-svn: 67005
2009-03-14 10:15:32 +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
Bob Wilson e4467e46a5 Fix an inconsistent use of LLVMGCCDIR. In all other cases, this directory
refers to the "prefix" directory, i.e., one level above "bin".  LLVMGCCPATH
is used as the directory containing the llvm-gcc executable, so add a "/bin"
suffix to get from LLVMGCCDIR to LLVMGCCPATH.

llvm-svn: 66823
2009-03-12 19:47:24 +00:00
Duncan Sands 4581bebf2a It makes no sense to have a ODR version of common
linkage, so remove it.

llvm-svn: 66690
2009-03-11 20:14:15 +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
Duncan Sands e2881053c9 Remove the one-definition-rule version of extern_weak
linkage: this linkage type only applies to declarations,
but ODR is only relevant to globals with definitions.

llvm-svn: 66650
2009-03-11 08:08:06 +00:00
Daniel Dunbar e2c9defed8 Add -disable-bindings for utils/NewNightlyTest.pl
llvm-svn: 66566
2009-03-10 19:33:13 +00:00
Duncan Sands 12da8ce3d2 Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr.  These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global.  In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time.   This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function.  If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body.  The
code generators on the other hand map weak and weak_odr linkage
to the same thing.

llvm-svn: 66339
2009-03-07 15:45:40 +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
Mike Stump 436f0ef9ff .emacs file bits for automatically setting the llvm.org coding style. Thanks Anton.
llvm-svn: 66032
2009-03-04 14:14:37 +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
Misha Brukman 0f35659b9a * Fixed spelling
* Linters now return their information instead of printing it, to
  enable easier unittesting
* Added support for finding tabs in files, added to C++ linter

llvm-svn: 65202
2009-02-20 23:44:54 +00:00
Misha Brukman 5e5503f5da Keep the newline character at the end of the lines whose trailing whitespace we
are deleting; otherwise, everything ends up on a single line.

llvm-svn: 65185
2009-02-20 22:30:46 +00:00
Misha Brukman f2e5bd8d22 Only strip the newline character at the end of the lines that we're considering
for length and for trailing whitespace; otherwise, the whitespace themselves
will also be removed.

llvm-svn: 65182
2009-02-20 22:28:45 +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
Julien Lerouge cbc2491deb Fix MingW build: define GTEST_OS_WINDOWS if OS is MingW, but disable
exceptions.

llvm-svn: 64367
2009-02-12 08:02:35 +00:00
Bill Wendling e5640dd8ad Don't try to strip a file we just moved.
llvm-svn: 64263
2009-02-11 00:14:53 +00:00
Bill Wendling 6e91f6119a Strip the LTO dylib.
llvm-svn: 64119
2009-02-09 06:42:40 +00:00
Bill Wendling 194d09151a Small fix for the 'strip' command. Do a list of .so files.
llvm-svn: 64112
2009-02-09 04:01:11 +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
Bill Wendling f2116d7450 Don't run 'strip' on files that aren't there.
llvm-svn: 64108
2009-02-09 02:18:35 +00:00
Bill Wendling 783b851b76 Remove warnings about not being able to delete something. Don't run lipo on gccas, gccld, and llvm-config scripts.
llvm-svn: 64107
2009-02-09 02:13:33 +00:00
Evan Cheng b87980a042 Revert 64023. make prefers GNUmakefile over makefile.
llvm-svn: 64024
2009-02-07 19:38:46 +00:00
Evan Cheng b443e95b32 Move Apple style build makefiles to the top level. Just like llvmgcc42.
llvm-svn: 64023
2009-02-07 19:05: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
Mike Stump 354d3de098 FIx spelling.
llvm-svn: 63883
2009-02-05 20:49:49 +00:00
Mike Stump 67f5ceaa82 Probe for flags before using them to try to help compiling with
compilers that don't support those flags.  This hopefully will help
gcc 3.X compile this code.  http://llvm.org/PR3487

llvm-svn: 63882
2009-02-05 20:45:27 +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
Dan Gohman d776b6e51d Fix a missing word.
llvm-svn: 62720
2009-01-21 21:54:44 +00:00
Dan Gohman 01d7dd8607 Versions of VIM included with Intrepid and Leopard at least appear
to handle symlinks just fine, so reword the instructions in the
README accordingly.

llvm-svn: 62719
2009-01-21 21:52:42 +00:00
Dan Gohman 3155533003 Enable syntax highlighting of LLVM and tablegen files by default,
so that users don't have to copy text from the README to get this.

llvm-svn: 62718
2009-01-21 21:47:51 +00:00
Dan Gohman 455be5a0a0 Only set cindent for C and C++ source files.
llvm-svn: 62717
2009-01-21 21:30:25 +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
Misha Brukman b302377dc3 This has been replaced by llvm/utils/lint/cpp_lint.py, which is more
comprehensive and can support more complex style analysis.

llvm-svn: 62002
2009-01-09 19:46:41 +00:00
Chris Lattner 4f6a38e68c remove some exclusions that don't exist anymore.
llvm-svn: 61932
2009-01-08 19:02:03 +00:00
Misha Brukman 93bd1ca55e Use VIM's built-in shorthand for whitespace in regex.
llvm-svn: 61906
2009-01-08 02:17:30 +00:00
Misha Brukman 687501fdd4 Be sure to ignore the end-of-line character when considering trailing
whitespace.

llvm-svn: 61905
2009-01-08 02:16:13 +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 c26da71654 Fix a thinko in the grammar for thread_local variables.
llvm-svn: 61767
2009-01-05 23:03:03 +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
Dan Gohman 30517ecfdc Add the keyword 'default'.
llvm-svn: 61710
2009-01-05 17:44:11 +00:00
Misha Brukman d7fc45a091 Renamed Google Test license file from COPYING to LICENSE.TXT to match LLVM
conventions, per John Criswell.

llvm-svn: 61708
2009-01-05 17:42:15 +00:00
Dan Gohman 1d59d7843c A few more polygen grammar updates.
- After GlobalAssign, emit addrspace before global/constant, to follow
   the new syntax.
 - Eliminate "type void", which is now invalid.
 - Fix invalid liblists like [, "foo"].
 - Tweak whitespace in a few places.

llvm-svn: 61706
2009-01-05 17:29:42 +00:00
Bob Wilson 1b97f3fcea Fix spelling in some comments.
llvm-svn: 61702
2009-01-05 17:23:09 +00:00
Dan Gohman 2c4353d04b gc is not an obsolete keyword.
llvm-svn: 61670
2009-01-05 03:22:02 +00:00
Dan Gohman 7f5ce10172 Update polygen grammar for recent language changes.
llvm-svn: 61669
2009-01-05 03:21:23 +00:00
Dan Gohman 634a3bd68d The .llx suffix is obsolete.
llvm-svn: 61647
2009-01-04 23:10:00 +00:00
Dan Gohman 29ad9bf5c3 Update VIM LLVM IR syntax highlighting.
- Add several new keywords
 - Clean up some obsolete keywords
 - Improve the patterns for constants.
 - Add syntax-highlighting for dejagnu test command comments

llvm-svn: 61646
2009-01-04 23:09:38 +00:00
Dan Gohman be631a3cd1 Set a few more vimrc indentation options.
llvm-svn: 61628
2009-01-04 18:59:55 +00:00
Dan Gohman 2dca828474 Use softtabstop instead of redefining tabstop.
llvm-svn: 61618
2009-01-04 00:05:43 +00:00
Dan Gohman e4159704d9 Switch the vimrc file from smartindent to cindent, which is
smarter about C-ish syntax, and supports the cinoptions
variable. Set cinoptions to suppress the extra indentation
for switch case labels.

llvm-svn: 61617
2009-01-04 00:03:54 +00:00
Misha Brukman a250160ec7 VerifyLineLength() actually takes a max length parameter.
llvm-svn: 61593
2009-01-02 21:24:29 +00:00
Misha Brukman 9d7b49bfd1 Added some basic lint tools for C++ and generic lint tool applicable to all
types of files (TableGen, LLVM assembly, HTML files, etc.)

llvm-svn: 61592
2009-01-02 21:15:30 +00:00
Misha Brukman cc211514c9 Deleted trailing whitespace; no functional changes.
llvm-svn: 61583
2009-01-02 16:28:18 +00:00
Misha Brukman ac7b456c93 vimrc
* Fixed cursors in terminal by setting nocompatible (sorry, vi users)
* Enable syntax highlighting so that this file can stand on its own
* Highlight trailing whitespace
* Fixed commands to delete trailing whitespaces and convert tabs to spaces

llvm.vim and tablegen.vim
* Removed trailing whitespace, as it's now very visible

llvm-svn: 61582
2009-01-02 16:26:14 +00:00
Misha Brukman 80ba6b7732 We also removed gtest-all.cc from the distribution tarball.
llvm-svn: 61581
2009-01-02 15:28:00 +00:00
Misha Brukman bcf15388ab Original patch by Talin.
* Added the first LLVM unittest -- DenseMap.
* Updated mkpatch utility to include llvm/unittests dir
* Added top-level target "unittests" to run all unittests

llvm-svn: 61541
2009-01-01 02:24:48 +00:00
Misha Brukman 22df200727 * Removed gtest-all.cc; .cc files including other .cc files is weird
* Removed gtest_main.cc: we have our own main() elsewhere
* Simplified the Makefile as we don't need SOURCES

* Moved the internal header to gtest/internal/
* Simplified the Makefile to remove -I param to CPP.Flags

* Updated README.LLVM with all the steps I took to massage GTest to
  work in LLVM so far

llvm-svn: 61540
2009-01-01 02:05:43 +00:00
Misha Brukman 922e34993a Moved Google Test code up one directory so that we can use a standard LLVM
Makefile with it, without resorting to the use of VPATH.

Also added Makefiles at every level of the directory tree to properly recurse
to Google Test and build it as a library (original Makefiles by Talin).

llvm-svn: 61539
2009-01-01 01:29:44 +00:00
Misha Brukman c89aba332f Import of Google Test 1.2.1, with the non-essential bits removed.
Added a README.LLVM file to indicate which files and directories
were removed from the original source tarball.

llvm-svn: 61526
2008-12-31 17:34:06 +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
Bill Wendling 160a416fc0 Change so that buildit won't need a parent directory with only the build scripts in them.
llvm-svn: 61061
2008-12-16 00:42:25 +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
Bill Wendling 8d5b57b354 Copy the tblgen utility.
llvm-svn: 59681
2008-11-20 00:11:57 +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
Oscar Fuentes 38d6c9a817 Tell GenLibDeps.pl to inspect .so and .dylib shared files.
llvm-svn: 59158
2008-11-12 20:39:06 +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
Dan Gohman 97acad13de Spell DISABLE_ASSERTIONS correctly.
llvm-svn: 58413
2008-10-30 01:08:03 +00:00
Bill Wendling 6e4ffba212 - Fix SUBVERSION string to handle x.x.x version number formats.
- Add VERBOSE=1 flag.
- Specify the LLVM_SUBMIT_VERSION when doing the "make install".
  The libLTO.dylib relies upon this flag during that time.

llvm-svn: 58298
2008-10-27 23:31:24 +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
Devang Patel 3cda64abd4 Set UNIVERSAL_ARCH value.
Fixes build failure when target is i386.

llvm-svn: 57211
2008-10-06 21:24:48 +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
Chris Lattner 7e438ede4d Make GenLibDeps.pl more robust in the face of broken piping problems.
Patch by Kenneth Boyd!

llvm-svn: 57057
2008-10-04 18:03:46 +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
Devang Patel 3fccede02a Remove.
llvm-svn: 56256
2008-09-16 22:26:44 +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
Devang Patel 4089ccb0fa Extract optimization pass selection code from llvm-gcc into a separate routine.
This can be used by other stand alone tools, such as 'opt'.

llvm-svn: 56229
2008-09-15 21:13:42 +00:00
Dan Gohman 46673ad82a Update the LLVM polygen grammar for recent language changes:
x86_ssecallcc, function notes, and some whitespace adjustments.

llvm-svn: 56221
2008-09-15 16:10:51 +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