Commit Graph

4752 Commits

Author SHA1 Message Date
Craig Topper aab53e7785 Mark some more instructions as CodeGenOnly. Remove filters from the disassembler.
llvm-svn: 192522
2013-10-12 04:46:18 +00:00
Will Dietz 981af0021b Add missing #include's to cctype when using isdigit/alpha/etc.
llvm-svn: 192519
2013-10-12 00:55:57 +00:00
Stephen Lin e93a3a088f Really fix CHECK-LABEL and CHECK-DAG interaction. This actually just restores the initial implementation that was in r186162 but got lost in some subsequent refactoring. More explicit variable names and comments are present now to hopefully prevent repeat regression, as well as another test.
llvm-svn: 192477
2013-10-11 18:38:36 +00:00
Rafael Espindola 5c8becd1fd Fix handling of CHECK-DAG inside of CHECK-LABEL.
llvm-svn: 192463
2013-10-11 16:48:02 +00:00
Craig Topper 81034928c6 Remove another unnecessary filter from the disassembler.
llvm-svn: 192425
2013-10-11 06:59:57 +00:00
Craig Topper e1ceeb40c1 Fix so CRC32r64r8 isn't accidentally filtered from the disassembler tables.
llvm-svn: 192339
2013-10-10 04:26:52 +00:00
Craig Topper 2d0d180ab4 More x86 disassembler filtering cleanup.
llvm-svn: 192279
2013-10-09 06:12:53 +00:00
Craig Topper 043d749ba3 Remove some old filters from the x86 disassembler table builder.
llvm-svn: 192275
2013-10-09 05:02:29 +00:00
Craig Topper a984729f8a Remove unneeded MMX instruction definition by moving pattern to an equivalent instruction definition and removing the filtering from the disassembler table building.
llvm-svn: 192175
2013-10-08 06:30:39 +00:00
Craig Topper 72c8cd7bc3 Remove some instructions that existed to provide aliases to the assembler. Can be done with InstAlias instead. Unfortunately, this was causing printer to use 'vmovq' or 'vmovd' based on what was parsed. To cleanup the inconsistencies convert all 'vmovd' with 64-bit registers to 'vmovq', but provide an alias so that 'vmovd' will still parse.
llvm-svn: 192171
2013-10-08 05:53:50 +00:00
Craig Topper 07ad1b23bb Remove some instructions that seem to only exist to trick the filtering checks in the disassembler table creation. Just fix up the filter to let the real instruction through instead.
llvm-svn: 192090
2013-10-07 07:19:47 +00:00
Craig Topper 2658d89728 Add disassembler support for long encodings for INC/DEC in 32-bit mode.
llvm-svn: 192086
2013-10-07 04:28:06 +00:00
David Majnemer 61eae2e30c Revert "Revert "Windows: Add support for unicode command lines""
This reverts commit r192070 which reverted r192069, I forgot to
regenerate the configure scripts.

llvm-svn: 192079
2013-10-07 01:00:07 +00:00
David Majnemer f636cf422e Revert "Windows: Add support for unicode command lines"
This is causing MinGW bots to fail.
This reverts commit r192069.

llvm-svn: 192070
2013-10-06 20:44:34 +00:00
David Majnemer 80bea0c315 Windows: Add support for unicode command lines
Summary:
The MSVCRT deliberately sends main() code-page specific characters.
This isn't too useful to LLVM as we end up converting the arguments to
UTF-16 and subsequently attempt to use the result as, for example, a
file name.  Instead, we need to have the ability to access the Unicode
command line and transform it to UTF-8.

This has the distinct advantage over using the MSVC-specific wmain()
function as our entry point because:
 - It doesn't work on cygwin.
 - It only work on MinGW with caveats and only then on certain versions.
 - We get to keep our entry point as main(). :)

N.B.  This patch includes fixes to other parts of lib/Support/Windows
s.t. we would be able to take advantage of getting the Unicode paths.
E.G.  clang spawning clang -cc1 would want to give it Unicode arguments.

Reviewers: aaron.ballman, Bigcheese, rnk, ruiu

Reviewed By: rnk

CC: llvm-commits, ygao

Differential Revision: http://llvm-reviews.chandlerc.com/D1834

llvm-svn: 192069
2013-10-06 20:25:49 +00:00
Craig Topper a1bbc323fa Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon.
llvm-svn: 192026
2013-10-05 05:38:16 +00:00
Craig Topper d9a6cc031d Revert r191940 to see if it fixes the build bots.
llvm-svn: 191941
2013-10-04 05:52:17 +00:00
Craig Topper a2efe9ebc6 Add OPC_CheckChildSame0-3 to the DAG isel matcher. This replaces sequences of MoveChild, CheckSame, MoveParent. Saves 846 bytes from the X86 DAG isel matcher, ~300 from ARM, ~840 from Hexagon.
llvm-svn: 191940
2013-10-04 05:22:20 +00:00
Craig Topper 9e3e38ae3f Add XOP disassembler support. Fixes PR13933.
llvm-svn: 191874
2013-10-03 05:17:48 +00:00
Pete Cooper d54381749d Add v4f16 to supported value types.
This is useful for some ARM intrinsics such as VCVTN which does a <4 x float> <-> <4 x half> conversion.

llvm-svn: 191870
2013-10-03 03:29:21 +00:00
Rafael Espindola 44fee4e0eb Remove several unused variables.
Patch by Alp Toker.

llvm-svn: 191757
2013-10-01 13:32:03 +00:00
Richard Sandiford 28942d4ca0 Fix pattern sort in DAGISelEmitter.cpp
The old code skipped one of the sorting criteria if either pattern had
no types.  This could lead to cycles of the form X < Y, Y < Z, Z < X.

llvm-svn: 191735
2013-10-01 09:49:01 +00:00
Craig Topper 009de6015f Filter out repeated sections from the X86 disassembler modRMTable. Saves about ~43K from a released build. Unfortunately the disassembler tables are still upwards of 800K.
llvm-svn: 191652
2013-09-30 06:23:19 +00:00
Craig Topper ed59dd34fd Various x86 disassembler fixes.
Add VEX_LIG to scalar FMA4 instructions.
Use VEX_LIG in some of the inheriting checks in disassembler table generator.
Make use of VEX_L_W, VEX_L_W_XS, VEX_L_W_XD contexts.
Don't let VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE inherit from their non-L forms unless VEX_LIG is set.
Let VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE inherit from all of their non-L or non-W cases.
Increase ranking on VEX_L_W, VEX_L_W_XS, VEX_L_W_XD, VEX_L_W_OPSIZE so they get chosen over non-L/non-W forms.

llvm-svn: 191649
2013-09-30 02:46:36 +00:00
Andrew Trick b6854d80e3 Mark the x86 machine model as incomplete. PR17367.
Ideally, the machinel model is added at the time the instructions are
defined. But many instructions in X86InstrSSE.td still need a model.

Without this workaround the scheduler asserts because x86 already has
itinerary classes for these instructions, indicating they should be
modeled by the scheduler. Since we use the new machine model for other
instructions, it expects a new machine model for these too.

llvm-svn: 191391
2013-09-25 18:14:12 +00:00
Craig Topper 0ac6f9fc6a Fix doxygen comments to use correct function name.
llvm-svn: 191356
2013-09-25 06:40:22 +00:00
Craig Topper 95198f4a94 Replace EVT with MVT in CodeGenDAGAPatterns.cpp.
llvm-svn: 191355
2013-09-25 06:37:18 +00:00
Stepan Dyatkovskiy 296484eae2 Patch that forces MergeFunctions pass for clang.
It is temporary patch. We need to keep it in trunk, since it makes easer to test it on buildbots on different platforms.
Once we see stable MergeFunctions behaviour with satisfied perfomance, this patch will be removed.

llvm-svn: 191331
2013-09-24 20:06:31 +00:00
Craig Topper 9836f5995a Fix formatting to match coding standards.
llvm-svn: 191280
2013-09-24 06:21:04 +00:00
Jiangning Liu 63dc840fc5 Initial support for Neon scalar instructions.
Patch by Ana Pazos.

1.Added support for v1ix and v1fx types.
2.Added Scalar Pairwise Reduce instructions.
3.Added initial implementation of Scalar Arithmetic instructions.

llvm-svn: 191263
2013-09-24 02:47:27 +00:00
Craig Topper 51617c3d2c Add missing index comments to the left side of the DAG ISel matcher table for each individual case of SwitchOpcode/Type.
llvm-svn: 191181
2013-09-22 23:18:50 +00:00
Benjamin Kramer 8817cca5ce Provide basic type safety for array_pod_sort comparators.
This makes using array_pod_sort significantly safer. The implementation relies
on function pointer casting but that should be safe as we're dealing with void*
here.

llvm-svn: 191175
2013-09-22 14:09:50 +00:00
Matt Arsenault ce3e4fc934 Missed using check type enum in one place
llvm-svn: 190897
2013-09-17 23:15:35 +00:00
Matt Arsenault c4d2d471ce Use function's argument instead of the global flag.
For now it happens the argument is always the same.

llvm-svn: 190896
2013-09-17 22:45:57 +00:00
Matt Arsenault 38820972e9 FileCheck refactor: use enum instead of bunch of bools
llvm-svn: 190893
2013-09-17 22:30:02 +00:00
Tim Northover 9c30f7a4ff TableGen: fix constness of new comparison function.
libc++ didn't seem to like a non-const call operator.

llvm-svn: 190797
2013-09-16 17:33:40 +00:00
Tim Northover c74e691c27 TableGen: give asm match classes deterministic order.
TableGen was sorting the entries in some of its internal data
structures by pointer. This order filtered through to the final
matching table and affected the diagnostics produced on bad assembly
occasionally.

It also turns out STL algorithms are ridiculously easy to misuse on
containers with custom order methods. (No bugs before, or now that I
know of, but plenty in the middle).

This should fix the sanitizer bot, which ends up with weird pointers.

llvm-svn: 190793
2013-09-16 16:43:19 +00:00
Tim Northover f9aaafd97b AsmMatcher: emit subtarget feature enum in deterministic order.
llvm-svn: 190792
2013-09-16 16:43:16 +00:00
Daniel Sanders a6822ed91f Fix the build for git repositories with multiple remotes.
Summary:
When a git repository had multiple remotes, ${repository} will be set to a multiline string. This causes compilation errors in SVNVersion.inc.

Fix this by limiting the output of utils/GetRepositoryPath to the first remote (which is reasonably likely to be 'origin').

Reviewers: jordan_rose

CC: llvm-commits, t.p.northover

Differential Revision: http://llvm-reviews.chandlerc.com/D1659

llvm-svn: 190778
2013-09-16 09:25:49 +00:00
Benjamin Kramer 7d6052687e Replace some unnecessary vector copies with references.
llvm-svn: 190770
2013-09-15 22:04:42 +00:00
Daniel Dunbar cd625f4e54 [lit] Add an --output option, for writing results in a machine readable form.
llvm-svn: 190738
2013-09-14 01:19:17 +00:00
Daniel Sanders eb03a37cfa Fix build failure reported by Tobias Markmann in bug 17203.
svn 1.8.0 emits an additional line matching 'URL:' in its 'svn info' command
('Relative URL:').
Changed the grep to match only the intended line so that a valid SVNVersion.inc
is generated.

The problem doesnt occur with the svn version I'm using (1.7.5) but Tobias has
confirmed that the change fixes the problem.

See http://llvm.org/bugs/show_bug.cgi?id=17203

llvm-svn: 190685
2013-09-13 12:41:38 +00:00
Joey Gouly 0e76fa7df5 Add an instruction deprecation feature to TableGen.
The 'Deprecated' class allows you to specify a SubtargetFeature that the
instruction is deprecated on.

The 'ComplexDeprecationPredicate' class allows you to define a custom
predicate that is called to check for deprecation.
For example:
  ComplexDeprecationPredicate<"MCR">

would mean you would have to define the following function:
  bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
                             std::string &Info)

Which returns 'false' for not deprecated, and 'true' for deprecated
and store the warning message in 'Info'.

The MCTargetAsmParser constructor was chaned to take an extra argument of
the MCInstrInfo class, so out-of-tree targets will need to be changed.

llvm-svn: 190598
2013-09-12 10:28:05 +00:00
Daniel Dunbar 9aeba4963a [lit] Add support for attach arbitrary metrics to test results.
- This is a work-in-progress and all details are subject to change, but I am
   trying to build up support for allowing lit to be used as a driver for
   performance tests (or other tests which might want to record information
   beyond simple PASS/FAIL).

llvm-svn: 190535
2013-09-11 17:45:11 +00:00
Benjamin Kramer 17c17bce2a llvm-tblgen: Mangle operand replacements into the strings in printAliasInstr.
Cuts down the bloat in the AArch64 asm writer a bit.

llvm-svn: 190527
2013-09-11 15:42:16 +00:00
Benjamin Kramer d77143f89a llvm-tblgen: Stabilize subreg index tables.
Otherwise SequenceToOffsetTable will sort by pointer and becomes non-deterministic.

llvm-svn: 190514
2013-09-11 11:22:26 +00:00
Adrian Prantl e8010fa54c debuginfo-tests: Add support for an lldb wrapper script
to be used on darwin in lieu of gdb.

llvm-svn: 190186
2013-09-06 18:12:01 +00:00
Daniel Dunbar dac381a323 [lit] Allow config files to pass arbitrary values to child configs.
- This aligns with how existing test suites end up wanting to use the local
   config files, conceptually it makes sense to consider them to be inherited.

llvm-svn: 189885
2013-09-03 23:32:55 +00:00
Vincent Lejeune 7deccf0f06 TableGen: Enumerate Schedule Model too.
llvm-svn: 189839
2013-09-03 19:43:28 +00:00
Jim Grosbach f29df34d12 Tidy up. Comment grammar.
llvm-svn: 189618
2013-08-29 22:41:43 +00:00
Jim Grosbach cfb7b917cb Tidy up. Trailing whitespace.
llvm-svn: 189617
2013-08-29 22:41:39 +00:00
Craig Topper 3e1d5da901 Move StringToOffsetTable into the TableGen include directory so I can use it in clang.
llvm-svn: 189567
2013-08-29 05:09:55 +00:00
Daniel Dunbar 9d8271b351 [lit] [tests] Add missing test input file.
llvm-svn: 189561
2013-08-29 03:02:34 +00:00
Daniel Dunbar b8da61fd1b [lit] Fix internal shell's argv[0] handling.
- At least on OS X, it is important for correct behavior of /bin/[ that argv[0]
   is passed as written, and not as the full executable path.

llvm-svn: 189559
2013-08-29 02:52:10 +00:00
Daniel Dunbar 9a83a76b1b [lit] Add support for multiprocessing, under --use-processes for now.
llvm-svn: 189556
2013-08-29 00:54:23 +00:00
Daniel Dunbar b3954fa889 [lit] Implement --max-time support by using provider cancel method.
llvm-svn: 189555
2013-08-29 00:54:19 +00:00
Daniel Dunbar 57ab2df070 [lit] Refactor test execution logic into lit.run.Run.
llvm-svn: 189554
2013-08-29 00:54:15 +00:00
Daniel Dunbar eecb1c1d25 [lit] Put display lock inside the ThreadResultsConsumer.
llvm-svn: 189553
2013-08-29 00:54:09 +00:00
Daniel Dunbar 516dc8b9be [lit] Factor out a results consumer interface for test execution.
- Also, change TestProvider interface to operate on test indices.

llvm-svn: 189552
2013-08-29 00:54:02 +00:00
Daniel Dunbar 562b83a64c [lit] Move top-level execute code into Run object.
llvm-svn: 189551
2013-08-29 00:48:55 +00:00
Daniel Dunbar a1b1ca7a38 [lit] Factor out Run class to capture configuration + discovered tests.
llvm-svn: 189550
2013-08-29 00:48:45 +00:00
Daniel Dunbar d73eaabc8f [lit] Change lit.Test.ResultCode to be unique across pickling.
llvm-svn: 189549
2013-08-29 00:48:39 +00:00
Daniel Dunbar 89d0321774 [lit] Add a TODO.
llvm-svn: 189546
2013-08-29 00:41:15 +00:00
Daniel Dunbar bef5955e22 [lit] Update shtest format to return lit.Test.Result objects.
llvm-svn: 189545
2013-08-29 00:41:09 +00:00
Daniel Dunbar 71c06c0cc2 [lit] Update LitTestCase to support lit.Test.Result.
llvm-svn: 189544
2013-08-29 00:40:59 +00:00
Rui Ueyama 8fb5a9113a Option parsing: support case-insensitive option matching.
Re-submitting r189416 with fix for Windows build on where strcasecmp is not defined.

llvm-svn: 189501
2013-08-28 20:04:31 +00:00
Craig Topper d66476025a Add missing include
llvm-svn: 189448
2013-08-28 07:03:02 +00:00
Rui Ueyama c3779ff83b Revert "Option parsing: support case-insensitive option matching." as it broke Windows buildbot.
This reverts r189416.

llvm-svn: 189424
2013-08-28 00:02:06 +00:00
Rui Ueyama 7159bd9dcb Option parsing: support case-insensitive option matching.
Link.exe's command line options are case-insensitive. This patch
adds a new attribute to OptTable to let the option parser to compare
options, ignoring case.

Command lines are generally case-insensitive on Windows. CL.exe is an
exception. So this new attribute should be useful for other commands
running on Windows.

Differential Revision: http://llvm-reviews.chandlerc.com/D1485

llvm-svn: 189416
2013-08-27 23:47:01 +00:00
Andrea Di Biagio 377496bbad Add function attribute 'optnone'.
This function attribute indicates that the function is not optimized
by any optimization or code generator passes with the 
exception of interprocedural optimization passes.

llvm-svn: 189101
2013-08-23 11:53:55 +00:00
Jakob Stoklund Olesen a8960a1f7c Add an OtherPreserved field to the CalleeSaved TableGen class.
This field specifies registers that are preserved across function calls,
but that should not be included in the generates SaveList array.

This can be used ot generate regmasks for architectures that save
registers through other means, like SPARC's register windows.

llvm-svn: 189084
2013-08-23 02:25:47 +00:00
Elena Demikhovsky c35219e3ee AVX-512: Added masked SHIFT commands, more encoding tests
llvm-svn: 189005
2013-08-22 12:18:28 +00:00
Tim Northover 421804420d ARM: use TableGen patterns to select CMOV operations.
Back in the mists of time (2008), it seems TableGen couldn't handle the
patterns necessary to match ARM's CMOV node that we convert select operations
to, so we wrote a lot of fairly hairy C++ to do it for us.

TableGen can deal with it now: there were a few minor differences to CodeGen
(see tests), but nothing obviously worse that I could see, so we should
probably address anything that *does* come up in a localised manner.

llvm-svn: 188995
2013-08-22 09:57:11 +00:00
Hans Wennborg da68efdb68 Remove llvm-lit from the cmake install target.
Since it's an llvm-internal tool, we shouldn't install it.

llvm-svn: 188976
2013-08-22 01:34:09 +00:00
Daniel Dunbar 39be0b4b4c [lit] Fix a couple lingering Py3 compat issues in ProgressBar.
llvm-svn: 188951
2013-08-21 22:26:47 +00:00
Daniel Dunbar 898d0d34a9 [lit] Lift XFAIL handling to core infrastructure.
llvm-svn: 188949
2013-08-21 22:26:42 +00:00
Daniel Dunbar 02ae385cac [lit] Allow formats to return lit.Test.Result instances directly.
llvm-svn: 188948
2013-08-21 22:26:40 +00:00
Daniel Dunbar 61821065a2 [lit] Factor out a separate Test.Result() object.
llvm-svn: 188947
2013-08-21 22:26:37 +00:00
Daniel Dunbar cf5599cc11 [lit] Simplify --time-tests code.
llvm-svn: 188946
2013-08-21 22:26:34 +00:00
Daniel Dunbar dd003d3332 [lit] Extract TestFormat base class, for future use.
llvm-svn: 188945
2013-08-21 22:26:26 +00:00
Daniel Dunbar 3f0ec8045c [lit] Rewrite TODO list, and elaborate on some things.
- If anyone is interested in lit's feature set, I'd appreciate any comments on
   the elaborated items.

llvm-svn: 188590
2013-08-16 23:30:23 +00:00
Stephen Lin 398b32a2f4 FileCheck: Fix stray quote in CHECK-LABEL error message.
llvm-svn: 188564
2013-08-16 17:29:01 +00:00
Aaron Ballman 414a0cdd38 Fixing a warning about control reaching the end of a non-void function.
llvm-svn: 188524
2013-08-16 01:43:31 +00:00
Daniel Dunbar 730dee40ca [lit] Remove some done TODOs.
llvm-svn: 188502
2013-08-15 22:52:20 +00:00
Daniel Dunbar 25ff9f6014 [llvm-build] Make Py3 compatible.
llvm-svn: 188424
2013-08-14 23:15:39 +00:00
Daniel Dunbar 301d387929 [lit] Add test coverage of gtest format.
llvm-svn: 188417
2013-08-14 22:21:11 +00:00
Daniel Dunbar 54d613b97f [lit] Ensure test output is converted to strings where possible.
- This cleans up the text output of failing tests when run under PY3.

llvm-svn: 188416
2013-08-14 22:21:01 +00:00
Daniel Dunbar e469b981f3 [lit] Support parsing scripts with inconsistent or invalid encodings.
- For whatever reason, we have a lot of test files with bogus unicode
   characters. This patch allows those scripts to still be parsed on Python3 by
   changing the parsing logic to work on binary files, and only require the
   actual script commands to be convertible to ascii.

 - This patch has been tweaked to now ensure that the command strings are not of
   unicode type on Python 2.6-7.

llvm-svn: 188398
2013-08-14 18:22:41 +00:00
Daniel Dunbar 16b934d624 Revert r188376, "[lit] Support parsing scripts with inconsistent or invalid encodings.", this doesn't work yet for bots using the internal shell.
llvm-svn: 188379
2013-08-14 15:55:25 +00:00
Daniel Dunbar cf0702601a [lit] Support parsing scripts with inconsistent or invalid encodings.
- For whatever reason, we have a lot of test files with bogus unicode
   characters. This patch allows those scripts to still be parsed on Python3 by
   changing the parsing logic to work on binary files, and only require the
   actual script commands to be convertible to ascii.

llvm-svn: 188376
2013-08-14 15:24:58 +00:00
Daniel Dunbar b7b4c11c6a [lit] Fix a relative import issue I missed earlier.
llvm-svn: 188360
2013-08-14 05:07:16 +00:00
Daniel Dunbar abb0695237 [lit] Avoid StringIO.
- We barely used it, and it is very hard to use in a 2.5-3 compatible
   way because of changing expectations for its input types.

llvm-svn: 188359
2013-08-14 05:07:13 +00:00
Daniel Dunbar 6d0ed4cd16 [lit] Fix tests to execute lit with same python as invoked with.
llvm-svn: 188358
2013-08-14 05:07:09 +00:00
Daniel Dunbar 1ba25a1e56 [lit] Factor ShTest format script command parsing from other processing.
llvm-svn: 188357
2013-08-14 05:07:04 +00:00
Daniel Dunbar 0a4a23ebac [lit] Move executeCommand() into lit.util.
llvm-svn: 188356
2013-08-14 05:07:01 +00:00
Daniel Dunbar 962fdef115 [lit] Move formats into their own subpackage.
llvm-svn: 188355
2013-08-14 05:06:55 +00:00
NAKAMURA Takumi 8a3357d252 Lit: Introduce "%/[STpst] into parseIntegratedTestScript(), to normalize substitutions.
llvm-svn: 188348
2013-08-14 02:26:31 +00:00
Jack Carter 52f2bea0d3 [Mips][msa] Value types for MSA support.
Added v8f16 to ValueTypes.h, ValueTypes.cpp, ValueTypes.td, 
and CodeGenTarget.cpp

Patch by Daniel Sanders

llvm-svn: 188326
2013-08-13 22:34:26 +00:00
Daniel Dunbar 1be0c73a94 [lit] Support use of setup.py from other directories.
llvm-svn: 188309
2013-08-13 19:08:48 +00:00
Rui Ueyama c2735158fb [FileCheck] Fix a bug that cause FileCheck to misidentify check-prefix
FileCheck should check to make sure the prefix was found, and not a word
containing it (e.g -check-prefix=BASEREL shouldn't match NOBASEREL).

Patch by Ron Ofir.

llvm-svn: 188221
2013-08-12 23:05:59 +00:00
Richard Sandiford 173cf4077f Revert r188164: Stablize MCK_Reg ordering in AsmMatcherEmitter
Apparently caused a failure on Darwin

llvm-svn: 188166
2013-08-12 10:57:51 +00:00
Richard Sandiford 3e2cbf18b7 Stablize MCK_Reg ordering in AsmMatcherEmitter
clang bootstraps intermittently failed for me due a difference in
the MCK_Reg ordering in ARMGenAsmMatcher.inc.  E.g. in my latest
run the stage 1 and stage 3 versions were the same but the stage 2
one was different (though still functionally correct).  This meant
that the .o comparison failed.

MCK_Regs were assigned by iterating over a std::set< std::set<Record*> >,
and since std::set is sorted lexicographically, the order depended on the
order of the pointer values.  This patch replaces the pointer ordering
with LessRecordByID.

llvm-svn: 188164
2013-08-12 10:39:45 +00:00
Daniel Dunbar 6dac00702c [lit] Remove old ExamplesTests directory.
- The actual tests have better coverage than those, and they weren't useful
   anymore.

llvm-svn: 188110
2013-08-09 21:39:36 +00:00
Daniel Dunbar ab320a673f [lit] Move ManyTests examples to lit/examples/many-tests.
llvm-svn: 188109
2013-08-09 21:39:28 +00:00
Daniel Dunbar c38c6f068b [lit] Drop deprecated aliases for lit and old module names.
llvm-svn: 188108
2013-08-09 21:39:24 +00:00
Daniel Dunbar 72868c74f3 [lit] Update lit's own tests to use lit_config and lit package, as appropriate.
llvm-svn: 188107
2013-08-09 21:39:17 +00:00
Daniel Dunbar 2fc495370a [lit] Fix typo.
- Noticed by edward-san (IRC).

llvm-svn: 188096
2013-08-09 19:39:42 +00:00
Daniel Dunbar 6465325e42 [lit] Rename lit.{TestFormats,Util} to their aliased names {formats,util}.
- With compatibility hack in lit.__init__, so this hopefully shouldn't break
   anything.

llvm-svn: 188040
2013-08-09 00:37:15 +00:00
Daniel Dunbar f511d30d8b [lit] Inject the lit specific config object as 'lit_config' when loading config files.
- Injecting it as 'lit' is gross, since that name should be used to refer to
   the actual package. For now both are available so it is possibly to cleanup
   test config files incrementally.

llvm-svn: 188039
2013-08-09 00:37:05 +00:00
Daniel Dunbar e97b673cf5 [lit] Split TestingConfig.frompath() into separate ctor and load methods.
llvm-svn: 188038
2013-08-09 00:36:58 +00:00
Daniel Dunbar 6928bb62ba [lit] Eliminate mustExist parameter from TestingConfig.frompath().
llvm-svn: 188034
2013-08-09 00:09:02 +00:00
Daniel Dunbar b963b0b51a [lit] Only create config copies when a local config file is present.
llvm-svn: 188033
2013-08-09 00:08:56 +00:00
Daniel Dunbar 5d8ab529c2 [lit] Eliminate parent argument from TestingConfig.frompath(), which is effectively unused.
llvm-svn: 188032
2013-08-09 00:08:46 +00:00
Daniel Dunbar c4477dfd92 [lit] Change --show-{tests,suites} to exit after printing.
- This is a more sensible behavior than printing and also running tests.

llvm-svn: 188009
2013-08-08 20:59:25 +00:00
Daniel Dunbar b647d5d21d [lit] Remove --repeat option, which wasn't that useful.
llvm-svn: 188008
2013-08-08 20:59:20 +00:00
Daniel Dunbar e7b9e5fcd0 [lit] Eliminate some nested imports.
llvm-svn: 188007
2013-08-08 20:59:16 +00:00
Daniel Dunbar 2d100cda0c [lit] Remove on_clone member, which is no longer used.
llvm-svn: 188006
2013-08-08 20:59:13 +00:00
Daniel Dunbar e80b42a838 [lit] Remove unnecessary list copy.
llvm-svn: 187934
2013-08-07 23:10:20 +00:00
Daniel Dunbar 403eeea0cf [lit] Always list individual UNRESOLVED tests.
llvm-svn: 187933
2013-08-07 23:10:05 +00:00
Daniel Dunbar 9ee3bb89c9 [lit] Explicitly convert dict items() result to a list.
llvm-svn: 187932
2013-08-07 23:10:01 +00:00
Daniel Dunbar 6468a5ccab [lit] Make string encoding issues explicit.
llvm-svn: 187931
2013-08-07 23:09:55 +00:00
Daniel Dunbar 16606887c4 [lit] Report the traceback when config import fails.
llvm-svn: 187920
2013-08-07 21:43:34 +00:00
Daniel Dunbar df1ed9b886 [lit] Avoid comparisons with None.
llvm-svn: 187919
2013-08-07 21:43:23 +00:00
Daniel Dunbar f6dc230bef [lit] Use list comprehensions instead of map().
llvm-svn: 187918
2013-08-07 21:43:17 +00:00
Daniel Dunbar 1047d9a412 [lit] Avoid deprecated dict.has_key() method.
llvm-svn: 187917
2013-08-07 21:43:12 +00:00
NAKAMURA Takumi 50985962d6 lit/LitConfig.py: Fixup for msys bash.
llvm-svn: 187896
2013-08-07 17:21:23 +00:00
NAKAMURA Takumi c97b753cf4 Lit: Fixup in r187886.
llvm-svn: 187887
2013-08-07 12:53:53 +00:00
NAKAMURA Takumi aa7cea9369 Lit: Resurrect --no-execute dropped in r187852.
For now, builders in bb.pgr.jp are using it.

llvm-svn: 187886
2013-08-07 12:44:29 +00:00
Daniel Dunbar 4e06f0d106 [lit] Use py2&3 compatible exec() syntax.
llvm-svn: 187862
2013-08-07 03:25:28 +00:00
Daniel Dunbar c9568b84b7 [lit] Use newer StringIO class.
llvm-svn: 187861
2013-08-07 03:24:20 +00:00
Daniel Dunbar 3957a8f07f [lit] Use modern absolute/relative import style.
llvm-svn: 187860
2013-08-07 03:23:12 +00:00
Daniel Dunbar 679a82023e [lit] Avoid __cmp__ and cmp().
llvm-svn: 187859
2013-08-07 03:22:02 +00:00
Daniel Dunbar 3a90aebd3a [lit] Avoid use of iterator .next() method.
llvm-svn: 187858
2013-08-07 03:20:54 +00:00
Daniel Dunbar a3ef2f2dd8 [lit] Use .write() methods instead of print statement.
llvm-svn: 187857
2013-08-07 03:19:45 +00:00
Daniel Dunbar bc2f287c63 [lit] Use dual-compatible print() syntax where possible.
llvm-svn: 187856
2013-08-07 03:18:36 +00:00
Daniel Dunbar 318e8976b6 [lit] Remove use of deprecated parameter tuple unpacking.
llvm-svn: 187855
2013-08-07 03:17:27 +00:00
Daniel Dunbar 7defa7a74c [lit] Remove uses of deprecated except syntax.
- Since we only have a few of these, use the cumbersome method of getting the
   exception object from 'sys' to retain the current pre-2.6 compatibility.

llvm-svn: 187854
2013-08-07 03:16:19 +00:00
Daniel Dunbar 5b09842179 [lit] Use more modern syntax for constructing exceptions.
llvm-svn: 187853
2013-08-07 03:15:10 +00:00
Daniel Dunbar a155dcd166 [lit] Drop --no-execute, which isn't generally useful.
llvm-svn: 187852
2013-08-07 03:14:00 +00:00
Daniel Dunbar 668c61f687 [lit] tests: Change discovery test to use --show-tests.
llvm-svn: 187851
2013-08-07 03:12:51 +00:00
Daniel Dunbar 2c687fe7b9 [lit] Add a --show-tests option.
llvm-svn: 187850
2013-08-07 03:11:42 +00:00
Daniel Dunbar 2a5c39de55 [lit] Remove dead ignoreStdError argument.
llvm-svn: 187849
2013-08-07 03:08:46 +00:00
Reid Kleckner d78273f4fd Remove some std stream usage from Support and TableGen
LLVM's coding standards recommend raw_ostream and MemoryBuffer for
reading and writing text.

This has the side effect of allowing clang to compile more of Support
and TableGen in the Microsoft C++ ABI.

llvm-svn: 187826
2013-08-06 22:51:21 +00:00
Tim Northover cf708c3284 Fix handling of CHECK-DAG combined with CHECK-NOT
Patch by Daniel Sanders.

llvm-svn: 187651
2013-08-02 11:32:50 +00:00
Vladimir Medic d3dade29f5 Moving definition of MnemonicContainsDot field from class Instruction to class AsmParser as suggested.
llvm-svn: 187569
2013-08-01 09:25:27 +00:00
Hans Wennborg 8669b97490 Option parsing: remove non-SUPPORT_ALIASARGS fall-back
The clients of this code have been updated to all support AliasArgs.

This depends on Clang r187538 and lld r187541.

llvm-svn: 187546
2013-07-31 23:28:51 +00:00
Hans Wennborg 5fdcf86861 Option parsing: add support for alias arguments.
This makes option aliases more powerful by enabling them to
pass along arguments to the option they're aliasing.

For example, if we have a joined option "-foo=", we can now
specify a flag option "-bar" to be an alias of that, with the
argument "baz".

This is especially useful for the cl.exe compatible clang driver,
where many options are aliases. For example, this patch enables
us to alias "/Ox" to "-O3" (-O is a joined option), and "/WX" to
"-Werror" (again, -W is a joined option).

Differential Revision: http://llvm-reviews.chandlerc.com/D1245

llvm-svn: 187537
2013-07-31 22:44:41 +00:00
Andrew Trick 753663ccce comment typo.
llvm-svn: 187531
2013-07-31 21:05:54 +00:00
Tom Stellard 0ebf29d41f Revert "TableGen: Enumerate Schedule Model too."
This reverts commit 2ca1e4a39c7e0d7a00e66ff5437c6d7ace2404a0.

llvm-svn: 187525
2013-07-31 20:43:08 +00:00
Vincent Lejeune 22e6ddd475 TableGen: Enumerate Schedule Model too.
llvm-svn: 187511
2013-07-31 19:31:20 +00:00
Andrew Trick 9447cce0ed Fix register pressure tables on ARM.
The heuristic that merges register pressure sets was bogus for ARM's S/D regs.

llvm-svn: 187479
2013-07-31 03:24:31 +00:00
Andrew Trick 301dd8d795 Add tracing to the tblgen register pressure table generator.
llvm-svn: 187478
2013-07-31 03:24:28 +00:00
Craig Topper 9469e906a5 Remove use of sprintf added to X86 disassembler tablegen code. Send message with instruction name to errs() instead and use a generic message for the llvm_unreachable. Consistent with other places in this file.
llvm-svn: 187333
2013-07-28 21:28:02 +00:00
Elena Demikhovsky baf51e3e61 fixed compilation issue
llvm-svn: 187325
2013-07-28 08:45:12 +00:00
Elena Demikhovsky 003e7d73b9 Added encoding prefixes for KNL instructions (EVEX).
Added 512-bit operands printing.
Added instruction formats for KNL instructions.

llvm-svn: 187324
2013-07-28 08:28:38 +00:00
Rafael Espindola 8e0f635fe8 Move the default back to pipefail. I accidentally reverted it before.
llvm-svn: 187271
2013-07-26 23:22:43 +00:00
Rafael Espindola 0fe236d873 Propagate pipefail when cloning.
llvm-svn: 187268
2013-07-26 23:17:38 +00:00
Rafael Espindola 2a2a0973b8 Use pipefail when available.
This change makes test with RUN lines like
RUN: opt ... | FileCheck

fail if opt fails, even if it prints what FileCheck wants. Enabling this
found some interesting cases of broken tests that were not being noticed
because opt (or some other tool) was crashing late.

Pipefail is used when the shell supports it or when using the internal
python based tester.

llvm-svn: 187261
2013-07-26 22:32:58 +00:00
Aaron Ballman 13235dadab Using a different loop induction variable than the enclosing scope. No functional changes intended.
llvm-svn: 187159
2013-07-25 22:09:31 +00:00
Justin Holewinski b3d630ca21 Fix a bug in TableGen where the intrinsic function name recognizer could mis-identify names if one was a prefix substring of the other
For two intrinsics 'llvm.nvvm.texsurf.handle' and 'llvm.nvvm.texsurf.handle.internal',
TableGen was emitting matching code like:

  if (Name.startswith("llvm.nvvm.texsurf.handle")) ...
  if (Name.startswith("llvm.nvvm.texsurf.handle.internal")) ...

We can never match "llvm.nvvm.texsurf.handle.internal" here because it will
always be erroneously matched by the first condition.

The fix is to sort the intrinsic names and emit them in reverse order.

llvm-svn: 187119
2013-07-25 12:32:00 +00:00
Andrew Trick 3aacca4622 RegPressure: Order the "pressure sets" by number of regunits per set.
This lets heuristics easily pick the most important set to follow.

llvm-svn: 187108
2013-07-25 07:26:29 +00:00
Craig Topper 690d8ea181 Split generated asm mnemonic matching table into a separate table for each asm variant.
This removes the need to store the asm variant in each row of the single table that existed before. Shaves ~16K off the size of X86AsmParser.o.

llvm-svn: 187026
2013-07-24 07:33:14 +00:00
Craig Topper 64a6e4b193 Remove 'else' after 'return'. No functional change.
llvm-svn: 186929
2013-07-23 06:27:36 +00:00
Craig Topper ad87dc077c Remove trailing whitespace.
llvm-svn: 186928
2013-07-23 06:25:00 +00:00
Nico Rieck b21ebec2c4 lit: Support cancellation on Windows
The current machinery using KeyboardInterrupt for canceling doesn't work
with multiple threads on Windows as it just cancels the currently run tests
but the runners continue.

We install a handler for Ctrl-C which stops the provider from providing any
more tests to the runners. Together with aborting all currently running
tests, this brings lit to a halt.

llvm-svn: 186695
2013-07-19 17:08:08 +00:00
Rafael Espindola 6d35481c94 Add a wrapper for open.
This centralizes the handling of O_BINARY and opens the way for hiding more
differences (like how open behaves with directories).

llvm-svn: 186447
2013-07-16 19:44:17 +00:00
Vladimir Medic 75429adb4d This patch allows targets to define weather the instruction mnemonics in asm matcher tables will contain '.' character.
llvm-svn: 186388
2013-07-16 09:22:38 +00:00
Aaron Ballman e59e358823 Teaching llvm-tblgen to not emit a switch statement when there are no case statements.
llvm-svn: 186330
2013-07-15 16:53:32 +00:00
Craig Topper 06b3b6651e Add 'const' qualifier to some arrays.
llvm-svn: 186312
2013-07-15 08:02:13 +00:00
Craig Topper b94011fd28 Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.
llvm-svn: 186274
2013-07-14 04:42:23 +00:00
Stephen Lin f8bd2e5b86 Add new directive called CHECK-LABEL to FileCheck.
CHECK-LABEL is meant to be used in place on CHECK on lines containing identifiers or other unique labels (they need not actually be labels in the source or output language, though.) This is used to break up the input stream into separate blocks delineated by CHECK-LABEL lines, each of which is checked independently. This greatly improves the accuracy of errors and fix-it hints in many cases, and allows for FileCheck to recover from errors in one block by continuing to subsequent blocks.

Some tests will be converted to use this new directive in forthcoming patches.

llvm-svn: 186162
2013-07-12 14:51:05 +00:00
Charles Davis e8f297ca94 Target/X86: Add explicit Win64 and System V/x86-64 calling conventions.
Summary:
This patch adds explicit calling convention types for the Win64 and
System V/x86-64 ABIs. This allows code to override the default, and use
the Win64 convention on a target that wants to use SysV (and
vice-versa). This is needed to implement the `ms_abi` and `sysv_abi` GNU
attributes.

Reviewers:

CC:

llvm-svn: 186144
2013-07-12 06:02:35 +00:00
Duncan Sands 488c99e075 Correct comment.
llvm-svn: 185987
2013-07-10 00:52:41 +00:00
Nick Lewycky c2ec0725ce Extend 'readonly' and 'readnone' to work on function arguments as well as
functions. Make the function attributes pass add it to known library functions
and when it can deduce it.

llvm-svn: 185735
2013-07-06 00:29:58 +00:00
Rafael Espindola 91487584c9 Add a --crash option to not.
Now the two possible uses of not are
* not cmd
  Will return true if cmd doesn't crash and returns false.
* not --crash cmd
  Will return true if cmd crashes.

It will be used/tested in a followup commit for the clang crash recovery
testing.

llvm-svn: 185678
2013-07-05 02:50:03 +00:00
Craig Topper af0dea1347 Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.
llvm-svn: 185606
2013-07-04 01:31:24 +00:00
Chad Rosier ccd0664393 Improve the compression of the tablegen DiffLists by introducing a new sort
algorithm when assigning EnumValues to the synthesized registers.

The current algorithm, LessRecord, uses the StringRef compare_numeric
function.  This function compares strings, while handling embedded numbers.
For example, the R600 backend registers are sorted as follows:

  T1
  T1_W
  T1_X
  T1_XYZW
  T1_Y
  T1_Z
  T2
  T2_W
  T2_X
  T2_XYZW
  T2_Y
  T2_Z

In this example, the 'scaling factor' is dEnum/dN = 6 because T0, T1, T2
have an EnumValue offset of 6 from one another.  However, in other parts
of the register bank, the scaling factors are different:

dEnum/dN = 5:
  KC0_128_W
  KC0_128_X
  KC0_128_XYZW
  KC0_128_Y
  KC0_128_Z
  KC0_129_W
  KC0_129_X
  KC0_129_XYZW
  KC0_129_Y
  KC0_129_Z

The diff lists do not work correctly because different kinds of registers have
different 'scaling factors'.  This new algorithm, LessRecordRegister, tries to
enforce a scaling factor of 1.  For example, the registers are now sorted as
follows:

  T1
  T2
  T3
  ...
  T0_W
  T1_W
  T2_W
  ...
  T0_X
  T1_X
  T2_X
  ...
  KC0_128_W
  KC0_129_W
  KC0_130_W
  ...

For the Mips and R600 I see a 19% and 6% reduction in size, respectively.  I
did see a few small regressions, but the differences were on the order of a
few bytes (e.g., AArch64 was 16 bytes).  I suspect there will be even
greater wins for targets with larger register files.

Patch reviewed by Jakob.
rdar://14006013

llvm-svn: 185094
2013-06-27 19:38:13 +00:00
Tom Stellard b162d94871 TableGen: Generate a function for getting operand indices based on their defined names
This patch modifies TableGen to generate a function in
${TARGET}GenInstrInfo.inc called getNamedOperandIdx(), which can be used
to look up indices for operands based on their names.

In order to activate this feature for an instruction, you must set the
UseNamedOperandTable bit.

For example, if you have an instruction like:

def ADD : TargetInstr <(outs GPR:$dst), (ins GPR:$src0, GPR:$src1)>;

You can look up the operand indices using the new function, like this:

Target::getNamedOperandIdx(Target::ADD, Target::OpName::dst)  => 0
Target::getNamedOperandIdx(Target::ADD, Target::OpName::src0) => 1
Target::getNamedOperandIdx(Target::ADD, Target::OpName::src1) => 2

The operand names are case sensitive, so $dst and $DST are considered
different operands.

This change is useful for R600 which has instructions with a large number
of operands, many of which model single bit instruction configuration
values.  These configuration bits are common across most instructions,
but may have a different operand index depending on the instruction type.
It is useful to have a convenient way to look up the operand indices,
so these bits can be generically set on any instruction.

llvm-svn: 184879
2013-06-25 21:22:09 +00:00
Rafael Espindola 8c8117240c keep only the StringRef version of getFileOrSTDIN.
llvm-svn: 184826
2013-06-25 05:28:34 +00:00
Stefanus Du Toit 8811ad4f81 Add support for encoding the HLE XACQUIRE and XRELEASE prefixes.
For decoding, keep the current behavior of always decoding these as their REP
versions. In the future, this could be improved to recognize the cases where
these behave as XACQUIRE and XRELEASE and decode them as such.

llvm-svn: 184207
2013-06-18 17:08:10 +00:00
Bob Wilson 37fae74a88 Build Apple's llvmCore with --disable-zlib. <rdar://problem/14182316>
llvm-svn: 184164
2013-06-18 01:22:29 +00:00
Andrew Trick 40c4f38071 Support BufferSize on ProcResGroup for unified MOp schedulers.
And add Sandybridge/Haswell resource buffers.

llvm-svn: 184034
2013-06-15 04:50:06 +00:00
Andrew Trick de2109eb4c Machine Model: Add MicroOpBufferSize and resource BufferSize.
Replace the ill-defined MinLatency and ILPWindow properties with
with straightforward buffer sizes:
MCSchedMode::MicroOpBufferSize
MCProcResourceDesc::BufferSize

These can be used to more precisely model instruction execution if desired.

Disabled some misched tests temporarily. They'll be reenabled in a few commits.

llvm-svn: 184032
2013-06-15 04:49:57 +00:00
Rafael Espindola 280e5cb653 Don't use PathV1.h in FileUtilities.h.
llvm-svn: 183941
2013-06-13 20:41:00 +00:00
Rafael Espindola 7c1023ad27 Avoid using PathV1.h in Program.h.
llvm-svn: 183940
2013-06-13 20:25:38 +00:00
Rafael Espindola 4c7ad8fc27 Have sys::FindProgramByName return a std::string.
llvm-svn: 183928
2013-06-13 19:25:37 +00:00
Rafael Espindola cb2eca0f91 Remove the program class.
It was only used to implement ExecuteAndWait and ExecuteNoWait. Expose just
those two functions and make Execute and Wait implementations details.

llvm-svn: 183864
2013-06-12 20:58:35 +00:00
Benjamin Kramer b22643a47d tblgen: Assert that InstRWs doesn't grows when we don't expect it.
llvm-svn: 183690
2013-06-10 20:19:35 +00:00
Benjamin Kramer 58bd79c4b1 tblgen: always lookup values from the original vector as it could be grown under our feet.
PR16281.

llvm-svn: 183630
2013-06-09 15:20:23 +00:00
Bill Wendling ee30e83ca8 Add a script to help us create source tar balls for the release.
llvm-svn: 183509
2013-06-07 11:15:30 +00:00
Bill Wendling e82e1ff8e6 Use proper exit code.
llvm-svn: 183508
2013-06-07 11:14:37 +00:00
Arnold Schwaighofer f84a03a589 CodeGenSchedule: Use resize instead of copying a vector
llvm-svn: 183465
2013-06-07 00:04:30 +00:00
Arnold Schwaighofer 3bd2524b60 CodeGenSchedule: smallvector.push_back(smallvector[0]) is dangerous
The element passed to push_back is not copied before the vector reallocates.
The client needs to copy the element first before passing it to push_back.

No test case, will be tested by follow-up swift scheduler model change (it
segfaults without this change).

llvm-svn: 183459
2013-06-06 23:23:14 +00:00
Jakub Staszak 8f58b730ab Remove unimplemented definition. Found using [-Wunused-member-function].
llvm-svn: 183426
2013-06-06 17:52:45 +00:00
Arnold Schwaighofer 218f6d8f59 SubtargetEmitter fix
Don't output data if we are supposed to ignore the record.

Reapply of 183255, I don't think this was causing the tablegen segfault on linux
testers.

llvm-svn: 183311
2013-06-05 14:06:50 +00:00
Andrew Trick 78a085170a Fix a tblgen subtargetemitter bug, for future Swift support.
This fixes some of the ridiculously complex code for optimizing the
machine model tables that are shared among all processors of a given
target. A9 and Swift both use the "special" feature that maps old
itinerary classes to new machine model defs. They map different
overlapping subsets of instructions, which wasn't handled correctly.

llvm-svn: 183302
2013-06-05 06:55:20 +00:00
Arnold Schwaighofer 2a70c69d31 Revert series of sched model patches until I figure out what is going on.
llvm-svn: 183273
2013-06-04 22:35:17 +00:00
Arnold Schwaighofer afe7d5c8f5 SubtargetEmitter fix
Don't output data if we are supposed to ignore the record.

llvm-svn: 183255
2013-06-04 22:15:41 +00:00
Ahmed Bougacha b1a4d9da3b Make SubRegIndex size mandatory, following r183020.
This also makes TableGen able to compute sizes/offsets of synthesized
indices representing tuples.

llvm-svn: 183061
2013-05-31 23:45:26 +00:00
Ahmed Bougacha f1ed334d55 Add a way to define the bit range covered by a SubRegIndex.
NOTE: If this broke your out-of-tree backend, in *RegisterInfo.td, change
the instances of SubRegIndex that have a comps template arg to use the
ComposedSubRegIndex class instead.

In TableGen land, this adds Size and Offset attributes to SubRegIndex,
and the ComposedSubRegIndex class, for which the Size and Offset are
computed by TableGen. This also adds an accessor in MCRegisterInfo, and
Size/Offsets for the X86 and ARM subreg indices.

llvm-svn: 183020
2013-05-31 17:08:36 +00:00
Galina Kistanova 5308abb22a Fixed bug when tests in executable partially used absolute paths.
llvm-svn: 182910
2013-05-30 04:56:28 +00:00
Chad Rosier 1bbbb3128a Remove the MCRegAliasIterator tables and compute the aliases dynamically.
The size reduction in the RegDiffLists are rather dramatic.  Here are a few
size differences for MCTargetDesc.o files (before and after) in bytes:
R600 - 36160B - 11184B - 69% reduction
ARM - 28480B - 8368B - 71% reduction
Mips - 816B - 576B - 29% reduction

One side effect of dynamically computing the aliases is that the iterator does
not guarantee that the entries are ordered or that duplicates have been removed.
The documentation implies this is a safe assumption and I found no clients that
requires these attributes (i.e., strict ordering and uniqueness).

My local LNT tester results showed no execution-time failures or significant
compile-time regressions (i.e., beyond what I would consider noise) for -O0g,
-O2 and -O3 runs on x86_64 and i386 configurations.
rdar://12906217

llvm-svn: 182783
2013-05-28 18:08:48 +00:00
Alexey Samsonov 1eba4e3254 Revert r182715 and r182758
llvm-svn: 182761
2013-05-28 10:08:08 +00:00
Alexey Samsonov b262d264d4 Fixup for r182715: provide correct arg to --gtest-filter
llvm-svn: 182758
2013-05-28 09:40:42 +00:00
Galina Kistanova a035f3b2ce Fixed bug when tests in executable partially used absolute paths.
llvm-svn: 182715
2013-05-26 03:58:41 +00:00
Bill Schmidt 9b703f9c5d Recognize ValueType operands in source patterns for fast-isel.
Currently the fast-isel table generator recognizes registers, register
classes, and immediates for source pattern operands.  ValueType
operands are not recognized.  This is not a problem for existing
targets with fast-isel support, but will not work for targets like
PowerPC and SPARC that use types in source patterns.

The proposed patch allows ValueType operands and treats them in the
same manner as register classes.  There is no convenient way to map
from a ValueType to a register class, but there's no need to do so.
The table generator already requires that all types in the source
pattern be identical, and we know the register class of the output
operand already.  So we just assign that register class to any
ValueType operands we encounter.

No functional effect on existing targets.  Testing deferred until the
PowerPC target implements fast-isel.

llvm-svn: 182512
2013-05-22 20:45:11 +00:00
Jakob Stoklund Olesen 9ae96c7aab Add TargetRegisterInfo::getCoveringLanes().
This lane mask provides information about which register lanes
completely cover super-registers. See the block comment before
getCoveringLanes().

llvm-svn: 182034
2013-05-16 18:03:08 +00:00
Bill Wendling 598123ede4 Use proper syntax.
llvm-svn: 181930
2013-05-15 21:38:12 +00:00
Bill Wendling c6e238c676 Add lldb and polly to the projects to tag.
llvm-svn: 181925
2013-05-15 21:36:46 +00:00
Michael Liao 91a1b2c9eb Add 'CHECK-DAG' support
Refer to 'FileCheck.rst'f for details of 'CHECK-DAG'.

llvm-svn: 181827
2013-05-14 20:34:12 +00:00
Michael Liao dcc7d48d55 Refactor string checking. No functionality change.
llvm-svn: 181824
2013-05-14 20:29:52 +00:00
Duncan Sands b33790d898 Get the unittests compiling when building with cmake and the setting
-DLLVM_ENABLE_THREADS=false.

llvm-svn: 181788
2013-05-14 13:29:16 +00:00
Bill Wendling 0dd712e050 Add libcxx and clang-tools-extra to the testing thing.
llvm-svn: 181418
2013-05-08 09:31:10 +00:00
Bill Wendling 7ec39dcc39 Add clang-tools-extra to the list of things to tag for the release.
llvm-svn: 181402
2013-05-08 09:23:53 +00:00
Bill Wendling e1234ee489 Add the libc++ project to those we tag.
llvm-svn: 181371
2013-05-07 22:15:06 +00:00
Reid Kleckner 95012aaa93 Try to fix ProgramTest on FreeBSD
This seemed like the cleanest way to find the test executable.  Also fix
the file mode.

llvm-svn: 180770
2013-04-30 04:30:41 +00:00
Ulrich Weigand e037a492f3 Handle tied sub-operands in AsmMatcherEmitter
The problem this patch addresses is the handling of register tie
constraints in AsmMatcherEmitter, where one operand is tied to a
sub-operand of another operand.  The typical scenario for this to
happen is the tie between the "write-back" register of a pre-inc
instruction, and the base register sub-operand of the memory address
operand of that instruction.

The current AsmMatcherEmitter code attempts to handle tied
operands by emitting the operand as usual first, and emitting
a CVT_Tied node when handling the second (tied) operand.  However,
this really only works correctly if the tied operand does not
have sub-operands (and isn't a sub-operand itself).  Under those
circumstances, a wrong MC operand list is generated.

In discussions with Jim Grosbach, it turned out that the MC operand
list really ought not to contain tied operands in the first place;
instead, it ought to consist of exactly those operands that are
named in the AsmString.  However, getting there requires significant
rework of (some) targets.

This patch fixes the immediate problem, and at the same time makes
one (small) step in the direction of the long-term solution, by
implementing two changes:

1. Restricts the AsmMatcherEmitter handling of tied operands to
   apply solely to simple operands (not complex operands or
   sub-operand of such).

This means that at least we don't get silently corrupt MC operand
lists as output.  However, if we do have tied sub-operands, they
would now no longer be handled at all, except for:

2. If we have an operand that does not occur in the AsmString,
   and also isn't handled as tied operand, simply emit a dummy
   MC operand (constant 0).

This works as long as target code never attempts to access
MC operands that do no not occur in the AsmString (and are
not tied simple operands), which happens to be the case for
all targets where this situation can occur (ARM and PowerPC).

[ Note that this change means that many of the ARM custom
  converters are now superfluous, since the implement the
  same "hack" now performed already by common code. ]

Longer term, we ought to fix targets to never access *any*
MC operand that does not occur in the AsmString (including
tied simple operands), and then finally completely remove
all such operands from the MC operand list.

Patch approved by Jim Grosbach.

llvm-svn: 180677
2013-04-27 18:48:23 +00:00
Michael Gottesman 68be5200b8 Use 'git svn find-rev' in git-svnrevert instead of shell script fu.
Thanks Chandler!

llvm-svn: 180592
2013-04-26 03:27:39 +00:00
Michael Gottesman d813420816 Added the scripts git-svnup/git-svnrevert to utils/git-svn.
It makes more sense to have git-svnup here than catting said file in the
documentation (where we should rather point users to this directory).
I included git-svnrevert as an additional gift to the community. I will update
the documentation in a second commit later today.

git-svnrevert takes in a git hash for a commit, looks up the svn revision for
said commit and then creates the normal git revert commit message with the one
liner message, except instead of saying

  Revert "<<<INSERT ONELINER HERE>>>"

  This reverts commit <<<INSERT GITHASH HERE>>>

It says:

  Revert "<<<INSERT ONELINER HERE>>>"

  This reverts commit r<<<INSERT SVN REVISION HERE>>>

so git hashes will not escape into our svn logs (which just look unseemly).

llvm-svn: 180587
2013-04-26 00:58:45 +00:00
Michael Liao 0b707eb85e Remove SMLoc paired with CHECK-NOT patterns. Not functionality change.
Pattern has source location by itself. After adding a trivial method to
retrieve it, it's unnecessary to pair a source location for CHECK-NOT patterns.
One thing revised after this is the diagnostic info is more accurate by
pointing to the start of the CHECK-NOT pattern instead of the end of the
CHECK-NOT pattern. E.g. diagnostic message previously looks like

    <stdin>:1:1: error: CHECK-NOT: string occurred!
    test
    ^
    test.txt:1:16: note: CHECK-NOT: pattern specified here
    CHECK-NOT: test
                   ^

is changed to

    <stdin>:1:1: error: CHECK-NOT: string occurred!
    test
    ^
    test.txt:1:12: note: CHECK-NOT: pattern specified here
    CHECK-NOT: test
               ^

llvm-svn: 180578
2013-04-25 21:31:34 +00:00
Michael Liao 61bed2fff4 Remove tailing whitespaces
llvm-svn: 180564
2013-04-25 18:54:02 +00:00
Andrew Trick a3801a39de Machine model: Generate table entries for super-resources.
Super-resources and resource groups are two ways of expressing
overlapping sets of processor resources. Now we generate table entries
the same way for both so the scheduler never needs to explicitly check
for super-resources.

llvm-svn: 180162
2013-04-23 23:45:16 +00:00
Andrew Trick cf398b220d Machine model: verify well-formed processor resource groups.
llvm-svn: 180161
2013-04-23 23:45:14 +00:00
Andrew Trick 6aa7a8796b Machine model: rewrite a tablegen loop to avoid comparing record pointers.
llvm-svn: 180160
2013-04-23 23:45:11 +00:00
Chad Rosier 9f7a221fdc [asm parser] Add support for predicating MnemonicAlias based on the assembler
variant/dialect.  Addresses a FIXME in the emitMnemonicAliases function.
Use and test case to come shortly.
rdar://13688439 and part of PR13340.

llvm-svn: 179804
2013-04-18 22:35:36 +00:00
Daniel Dunbar 175aed579d lit: Fix infinite recursion when an out-of-tree test root is located inside the source test root.
llvm-svn: 179402
2013-04-12 19:09:09 +00:00
Daniel Dunbar b5e9727ee5 lit: Add a test for discovery w/ test_exec_root (out-of-tree test root).
llvm-svn: 179401
2013-04-12 19:08:57 +00:00
Michael Liao 95d9440348 Add CLAC/STAC instruction encoding/decoding support
As these two instructions in AVX extension are privileged instructions for
special purpose, it's only expected to be used in inlined assembly.

llvm-svn: 179266
2013-04-11 04:52:28 +00:00
Daniel Dunbar 9448e8594f lit: Don't descend into .git directories during test discovery.
llvm-svn: 179249
2013-04-11 00:31:35 +00:00
Daniel Dunbar 2e4a49ae25 lit: Shorten a metavar to make --help look nicer.
llvm-svn: 179248
2013-04-11 00:31:27 +00:00
Daniel Dunbar 970faff8c1 lit: Add a test for discovery when exact test names are given.
llvm-svn: 179247
2013-04-11 00:31:22 +00:00
Daniel Dunbar 99a67ed76e lit: Add a trivial test of the basic progress bar.
llvm-svn: 179243
2013-04-11 00:05:37 +00:00
Rafael Espindola 3add3e9c4a Move yaml2obj to tools too.
llvm-svn: 178904
2013-04-05 20:00:35 +00:00
Rafael Espindola da37835a8d Use ScalarBitSetTraits.
What was missing was were the type strong operator|.

llvm-svn: 178879
2013-04-05 16:00:31 +00:00
Rafael Espindola 87a0290941 Move obj2yaml to tools to sort out make's dependencies.
llvm-svn: 178835
2013-04-05 02:57:22 +00:00
Rafael Espindola 726c8c3bdd Build obj2yaml with configure+make.
llvm-svn: 178833
2013-04-05 02:24:51 +00:00
Rafael Espindola 7733466c73 Add back parsing of header charactestics.
It had been dropped during the switch to yaml::IO. Also add a test going
from yaml2obj to llvm-readobj. It can be extended as we add more
fields/formats to yaml2obj.

llvm-svn: 178786
2013-04-04 20:30:52 +00:00
Rafael Espindola aff6081415 Remove anonymous namespace.
Looks like the gcc in http://lab.llvm.org:8011/builders/clang-x86_64-darwin11-self-mingw32/ doesn't like "not external linkage":

/Volumes/Macintosh_HD2/buildbots/clang-x86_64-darwin11-self-mingw32/llvm.src/include/llvm/Support/YAMLTraits.h: In instantiation of 'const bool llvm::yaml::has_SequenceMethodTraits<std::vector<<unnamed>::COFFYAML::Relocation, std::allocator<<unnamed>::COFFYAML::Relocation> > >::value':
/Volumes/Macintosh_HD2/buildbots/clang-x86_64-darwin11-self-mingw32/llvm.src/include/llvm/Support/YAMLTraits.h:281:   instantiated from 'llvm::yaml::has_SequenceTraits<std::vector<<unnamed>::COFFYAML::Relocation, std::allocator<<unnamed>::COFFYAML::Relocation> > >'
/Volumes/Macintosh_HD2/buildbots/clang-x86_64-darwin11-self-mingw32/llvm.src/utils/yaml2obj/yaml2obj.cpp:627:   instantiated from here
/Volumes/Macintosh_HD2/buildbots/clang-x86_64-darwin11-self-mingw32/llvm.src/include/llvm/Support/YAMLTraits.h:243: error: 'llvm::yaml::SequenceTraits<std::vector<<unnamed>::COFFYAML::Relocation, std::allocator<<unnamed>::COFFYAML::Relocation> > >::size' is not a valid template argument for type 'size_t (*)(llvm::yaml::IO&, std::vector<<unnamed>::COFFYAML::Relocation, std::allocator<<unnamed>::COFFYAML::Relocation> >&)' because function 'static size_t llvm::yaml::SequenceTraits<std::vector<<unnamed>::COFFYAML::Relocation, std::allocator<<unnamed>::COFFYAML::Relocation> > >::size(llvm::yaml::IO&, std::vector<<unnamed>::COFFYAML::Relocation, std::allocator<<unnamed>::COFFYAML::Relocation> >&)' has not external linkage

llvm-svn: 178600
2013-04-03 01:07:53 +00:00
Rafael Espindola e1d9afa82d Use yaml::IO in yaml2obj.cpp.
The generic structs and specializations will be refactored when obj2yaml is
changed to use yaml::IO.

llvm-svn: 178593
2013-04-02 23:56:40 +00:00
Andrew Trick d97ff1fcee Fix TableGen subtarget-emitter to handle A9/Swift.
A9 uses itinerary classes, Swift uses RW lists. This tripped some
verification when we're expanding variants. I had to refine the
verification a bit.

llvm-svn: 178357
2013-03-29 19:08:31 +00:00
Dan Gohman f6169d020c Revert r178166. According to Howard, this code is actually ok.
llvm-svn: 178319
2013-03-29 00:13:08 +00:00
Dan Gohman 38a723830c Avoid undefined behavior from passing a std::vector's own contents
in as an argument to push_back.

llvm-svn: 178166
2013-03-27 18:44:56 +00:00
Andrew Trick e97978f94c TableGen SubtargetEmitter fix to allow A9 and Swift to coexist.
Allow variants to be defined only for some processors on a target.

llvm-svn: 178074
2013-03-26 21:36:39 +00:00
Dave Zarzycki 656e8515fc x86 -- add the XTEST instruction
llvm-svn: 177888
2013-03-25 18:59:43 +00:00
Jakob Stoklund Olesen 99ffcc83e6 Allow types to be omitted in output patterns.
This syntax is now preferred:

  def : Pat<(subc i32:$b, i32:$c), (SUBCCrr $b, $c)>;

There is no reason to repeat the types in the output pattern.

llvm-svn: 177844
2013-03-24 19:37:00 +00:00
Jakob Stoklund Olesen 04b0f912b6 Allow direct value types to be used in instruction 'set' patterns.
This makes it possible to define instruction patterns like this:

def LDri : F3_2<3, 0b000000,
                (outs IntRegs:$dst), (ins MEMri:$addr),
                "ld [$addr], $dst",
                [(set i32:$dst, (load ADDRri:$addr))]>;
                      ~~~

llvm-svn: 177834
2013-03-24 00:56:16 +00:00
Jakob Stoklund Olesen d906b903eb Allow direct value types in pattern definitions.
Just like register classes, value types can be used in two ways in
patterns:

  (sext_inreg i32:$src, i16)

In a named leaf node like i32:$src, the value type simply provides the
type of the node directly. This simplifies type inference a lot compared
to the current practice of specifiying types indirectly with register
classes.

As an unnamed leaf node, like i16 above, the value type represents
itself as an MVT::Other immediate.

llvm-svn: 177828
2013-03-23 20:35:01 +00:00
Jakob Stoklund Olesen b5b9110b51 Make all unnamed RegisterClass TreePatternNodes typed MVT::i32.
A register class can appear as a leaf TreePatternNode with and without a
name:

  (COPY_TO_REGCLASS GPR:$src, F8RC)

In a named leaf node like GPR:$src, the register class provides type
information for the named variable represented by the node. The TypeSet
for such a node is the set of value types that the register class can
represent.

In an unnamed leaf node like F8RC above, the register class represents
itself as a kind of immediate. Such a node has the type MVT::i32,
we'll never create a virtual register representing it.

This change makes it possible to remove the special handling of
COPY_TO_REGCLASS in CodeGenDAGPatterns.cpp.

llvm-svn: 177825
2013-03-23 18:08:44 +00:00
Benjamin Kramer e963d660cd Plug a memory leak in FileCheck when the input file is empty.
llvm-svn: 177822
2013-03-23 13:56:23 +00:00
Sean Silva cdd21b333a Add TableGen ctags(1) emitter and helper script.
To use this in conjunction with exuberant ctags to generate a single
combined tags file, run tblgen first and then
  $ ctags --append [...]

Since some identifiers have corresponding definitions in C++ code,
it can be useful (if using vim) to also use cscope, and
  :set cscopetagorder=1
so that
  :tag X
will preferentially select the tablegen symbol, while
  :cscope find g X
will always find the C++ symbol.

Patch by Kevin Schoedel!

(a couple small formatting changes courtesy of clang-format)

llvm-svn: 177682
2013-03-21 23:40:38 +00:00