1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

4530 Commits

Author SHA1 Message Date
Andrew Trick
3a4f1261f9 Machine model: verify well-formed processor resource groups.
llvm-svn: 180161
2013-04-23 23:45:14 +00:00
Andrew Trick
69561e2961 Machine model: rewrite a tablegen loop to avoid comparing record pointers.
llvm-svn: 180160
2013-04-23 23:45:11 +00:00
Chad Rosier
645b701422 [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
992a59103b 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
ebb57e0ea4 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
75c886a312 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
2b76085497 lit: Don't descend into .git directories during test discovery.
llvm-svn: 179249
2013-04-11 00:31:35 +00:00
Daniel Dunbar
aeb45789dd lit: Shorten a metavar to make --help look nicer.
llvm-svn: 179248
2013-04-11 00:31:27 +00:00
Daniel Dunbar
35c0a36655 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
0415c80e33 lit: Add a trivial test of the basic progress bar.
llvm-svn: 179243
2013-04-11 00:05:37 +00:00
Rafael Espindola
67ed9d1cfb Move yaml2obj to tools too.
llvm-svn: 178904
2013-04-05 20:00:35 +00:00
Rafael Espindola
1041b0bbec Use ScalarBitSetTraits.
What was missing was were the type strong operator|.

llvm-svn: 178879
2013-04-05 16:00:31 +00:00
Rafael Espindola
b2b188b238 Move obj2yaml to tools to sort out make's dependencies.
llvm-svn: 178835
2013-04-05 02:57:22 +00:00
Rafael Espindola
c8aa300d21 Build obj2yaml with configure+make.
llvm-svn: 178833
2013-04-05 02:24:51 +00:00
Rafael Espindola
5e796656b1 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
12643c4bec 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
44e98eeac2 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
4e1ed3a6dc 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
333b99112b Revert r178166. According to Howard, this code is actually ok.
llvm-svn: 178319
2013-03-29 00:13:08 +00:00
Dan Gohman
9f0372854d 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
19f83ecc6b 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
2949721b7d x86 -- add the XTEST instruction
llvm-svn: 177888
2013-03-25 18:59:43 +00:00
Jakob Stoklund Olesen
b8c553e610 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
2b502e642b 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
332c7f8ecf 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
a8e8e879c0 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
2d6ca3aea4 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
b2ca5c4ca4 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
Reid Kleckner
804b51ca54 [lit] Avoid CRLFs in bash scripts on Windows
Native Windows Python will do line ending translation by default, which
we don't want in bash scripts.  If we're not native Windows Python, then
'b' is ignored.

llvm-svn: 177602
2013-03-20 23:32:14 +00:00
Ulrich Weigand
6cee29625a Extend TableGen instruction selection matcher to improve handling
of complex instruction operands (e.g. address modes).

Currently, if a Pat pattern creates an instruction that has a complex
operand (i.e. one that consists of multiple sub-operands at the MI
level), this operand must match a ComplexPattern DAG pattern with the
correct number of output operands.

This commit extends TableGen to alternatively allow match a complex
operands against multiple separate operands at the DAG level.

This allows using Pat patterns to match pre-increment nodes like
pre_store (which must have separate operands at the DAG level) onto
an instruction pattern that uses a multi-operand memory operand,
like the following example on PowerPC (will be committed as a
follow-on patch):

  def STWU  : DForm_1<37, (outs ptr_rc:$ea_res), (ins GPRC:$rS, memri:$dst),
                    "stwu $rS, $dst", LdStStoreUpd, []>,
                    RegConstraint<"$dst.reg = $ea_res">, NoEncode<"$ea_res">;

  def : Pat<(pre_store GPRC:$rS, ptr_rc:$ptrreg, iaddroff:$ptroff),
            (STWU GPRC:$rS, iaddroff:$ptroff, ptr_rc:$ptrreg)>;

Here, the pair of "ptroff" and "ptrreg" operands is matched onto the
complex operand "dst" of class "memri" in the "STWU" instruction.

Approved by Jakob Stoklund Olesen.

llvm-svn: 177428
2013-03-19 19:51:09 +00:00
Andrew Trick
ee650f250f TableGen fix for the new machine model.
Properly handle cases where a group of instructions have different
SchedRW lists with the same itinerary class.
This was supposed to work, but I left in an early break.

llvm-svn: 177317
2013-03-18 20:42:25 +00:00
Jakob Stoklund Olesen
9bba6f749a Extract a method.
This computes the type of an instruction operand or result based on the
records in the instruction's ins and outs lists.

llvm-svn: 177244
2013-03-18 04:08:07 +00:00
Jakob Stoklund Olesen
b984ca6d18 Use ArrayRef<MVT::SimpleValueType> when possible.
Not passing vector references around makes it possible to use
SmallVector in most places.

llvm-svn: 177235
2013-03-17 17:26:09 +00:00
Andrew Trick
d9ea1ed5c1 Machine model. Allow mixed itinerary classes and SchedRW lists.
We always supported a mixture of the old itinerary model and new
per-operand model, but it required a level of indirection to map
itinerary classes to SchedRW lists. This was done for ARM A9.

Now we want to define x86 SchedRW lists, with the goal of removing its
itinerary classes, but still support the itineraries in the mean
time. When I original developed the model, Atom did not have
itineraries, so there was no reason to expect this requirement.

llvm-svn: 177226
2013-03-16 18:58:55 +00:00
Jakob Stoklund Olesen
46174e4527 Add SchedRW as an Instruction field.
Don't require instructions to inherit Sched<...>. Sometimes it is more
convenient to say:

  let SchedRW = ... in {
    ...
  }

Which is now possible.

llvm-svn: 177199
2013-03-15 22:51:13 +00:00
Andrew Trick
aab9978611 Fix r177112: Add ProcResGroup.
This is the other half of r177122 that I meant to commit at the same time.

llvm-svn: 177123
2013-03-14 22:47:01 +00:00
Andrew Trick
d133b52150 MachineModel: Add a ProcResGroup class.
This allows abitrary groups of processor resources. Using something in
a subset automatically counts againts the superset. Currently, this
only works if the superset is also a ProcResGroup as opposed to a
SuperUnit.

This allows SandyBridge to be expressed naturally, which will be
checked in shortly.

def SBPort01 : ProcResGroup<[SBPort0, SBPort1]>;
def SBPort15 : ProcResGroup<[SBPort1, SBPort5]>;
def SBPort23  : ProcResGroup<[SBPort2, SBPort3]>;
def SBPort015 : ProcResGroup<[SBPort0, SBPort1, SBPort5]>;

llvm-svn: 177112
2013-03-14 21:21:50 +00:00
NAKAMURA Takumi
7822c4abc1 lit.TestFormats.GoogleTest: Honor LitConfig.noExecute, or --no-execute were ignored.
llvm-svn: 176930
2013-03-13 06:16:33 +00:00
Kevin Enderby
319d315d55 Fixes disassembler crashes on 2013 Haswell RTM instructions.
rdar://13318048

llvm-svn: 176828
2013-03-11 21:17:13 +00:00
Andrew Trick
ab2046b460 MIsched machine model: tablegen subtarget emitter improvement.
Fix the way resources are counted. I'm taking some time to cleanup the
way MachineScheduler handles in-order machine resources. Eventually
we'll need more PPC/Atom test cases in tree.

llvm-svn: 176390
2013-03-01 23:31:26 +00:00
Bill Wendling
b16f9837ef Enable syntax highlighting for reStructuredText files.
Patch by Journeyer J. Joh!

llvm-svn: 176235
2013-02-28 06:43:24 +00:00
Michael J. Spencer
1f361eb77c [TableGen] Fix ICE on MSVC 2012 Release builds.
llvm-svn: 176125
2013-02-26 21:29:47 +00:00
Kostya Serebryany
f560b78692 Unify clang/llvm attributes for asan/tsan/msan (LLVM part)
These are two related changes (one in llvm, one in clang).
LLVM: 
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG: 
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176075
2013-02-26 06:58:09 +00:00
Matt Beaumont-Gay
c6ce965ace 'Hexadecimal' has two 'a's and only one 'i'.
llvm-svn: 176031
2013-02-25 18:11:18 +00:00
Jyotsna Verma
37dad03d5b Fix for bug 15246 -- out-of-bound error in the TableGen backend, CodeGenMapTable.cpp.
llvm-svn: 175185
2013-02-14 17:58:13 +00:00
David Peixotto
0a3102166e PR14992 - Tablegen incorrectly converts ARM tLDMIA_UPD pseudo to tLDMIA
Fixed bug in tablegen conversion when source pseudo instruction has
a different number of arguments than the destination instruction.

llvm-svn: 175066
2013-02-13 19:21:47 +00:00
Guy Benyei
92dac48079 Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
llvm-svn: 175006
2013-02-12 21:21:59 +00:00
Kay Tiong Khoo
d299c572f3 Added 0x0D to 2-byte opcode extension table for prefetch* variants
Fixed decode of existing 3dNow prefetchw instruction
Intel is scheduled to add a compatible prefetchw (same encoding) to future CPUs

llvm-svn: 174920
2013-02-12 00:19:12 +00:00
Kostya Serebryany
8e2f1fbfb7 [tsan/msan] adding thread_safety and uninitialized_checks attributes
llvm-svn: 174864
2013-02-11 08:13:54 +00:00
Daniel Dunbar
87a628ad87 [lit] Add a display function for lit.Test.TestResult.
llvm-svn: 174667
2013-02-07 21:34:34 +00:00
Guy Benyei
e5a7b5054c Canonicalize line endings to Linux style also when the --strict-whitespace flag is in use. This flag is supposed to affect horizontal whitespaces only.
llvm-svn: 174541
2013-02-06 20:40:38 +00:00
Jim Grosbach
6f7278da17 Allow targets to add custom asm operand matching logic.
For example, ARM has several instructions with a literal '#0' immediate in the syntax
that's not represented as an actual operand. The asm matcher is expected a token
operand, but the parser will have created an immediate operand. This is currently
handled by dedicated per-instruction C++ munging of the ParsedAsmOperand list, but
will be better handled by this hook.

llvm-svn: 174487
2013-02-06 06:00:06 +00:00
Bob Wilson
0c5819e04c Preprocess Apple llvmCore headers to reflect NDEBUG setting. <rdar://12568983>
If an Apple llvmCore build is done without assertions, and a client uses
the llvmCore headers with assertions enabled, or vice versa, then things will
break because some of the structure sizes in the API are different.  Use the
unifdef tool to make the headers unconditionally match the way the llvmCore
libraries were built.

llvm-svn: 174460
2013-02-05 22:59:42 +00:00
Bob Wilson
388e081f6a Set the deployment target for Apple llvmCore builds. <rdar://problem/12712431>
llvm-svn: 174397
2013-02-05 17:29:03 +00:00
Eli Bendersky
89664e61b6 Fix comments
llvm-svn: 174390
2013-02-05 16:53:11 +00:00
Jack Carter
3dfa61ae2c This patch that sets the EmitAlias flag in td files
and enables the instruction printer to print aliased 
instructions. 

Due to usage of RegisterOperands a change in common 
code (utils/TableGen/AsmWriterEmitter.cpp) is required 
to get the correct register value if it is a RegisterOperand.

Contributer: Vladimir Medic
 
llvm-svn: 174358
2013-02-05 08:32:10 +00:00
Andrew Trick
2969f0d0aa MachineModel: Inconsequential TableGen SubtargetEmitter fix.
Drive by fix. I noticed some missing logic that might bite future
users. This shouldn't affect the final output on currently modeled
targets.

llvm-svn: 174142
2013-02-01 03:19:54 +00:00
Daniel Dunbar
c1a371e4ba [lit] Add a test for internal shell execution behaviors.
llvm-svn: 174102
2013-01-31 22:15:20 +00:00
Daniel Dunbar
bc2e9247e5 [lit] Change to raise InternalShellError for all command execution issues.
llvm-svn: 174101
2013-01-31 22:15:15 +00:00
Daniel Dunbar
f0b8d0bee5 [lit] Fix bug where InternalShellError messages were discarded.
- Also, change the exit code to match 'sh'.

llvm-svn: 174089
2013-01-31 20:58:16 +00:00
Daniel Dunbar
9974bc4dd7 [lit] Fix a shell parsing bug with ';' not separated by whitespace.
- Testing finds bugs, who knew.

llvm-svn: 174087
2013-01-31 20:51:17 +00:00
Daniel Dunbar
b1cf0346bf [lit] Add a test for the various ShTest format features.
llvm-svn: 174072
2013-01-31 18:05:01 +00:00
Daniel Dunbar
6da49ae5e5 [lit] TestRunner: Eliminate failDueToStderr argument, which is now unused.
llvm-svn: 174071
2013-01-31 18:04:45 +00:00
Daniel Dunbar
68b35e0a6d [lit] Delete the now-unused SyntaxCheckTest format.
- Also, kill the pointless LitFormats module.

llvm-svn: 174070
2013-01-31 18:04:38 +00:00
Jakob Stoklund Olesen
71dc1e3b47 Clarify intent.
llvm-svn: 174068
2013-01-31 17:56:23 +00:00
Derek Schuff
ef8694af28 [MC] bundle alignment: prevent padding instructions from crossing bundle boundaries
llvm-svn: 174067
2013-01-31 17:00:03 +00:00
Tim Northover
e2b0519ed8 Add AArch64 as an experimental target.
This patch adds support for AArch64 (ARM's 64-bit architecture) to
LLVM in the "experimental" category. Currently, it won't be built
unless requested explicitly.

This initial commit should have support for:
    + Assembly of all scalar (i.e. non-NEON, non-Crypto) instructions
      (except the late addition CRC instructions).
    + CodeGen features required for C++03 and C99.
    + Compilation for the "small" memory model: code+static data <
      4GB.
    + Absolute and position-independent code.
    + GNU-style (i.e. "__thread") TLS.
    + Debugging information.

The principal omission, currently, is performance tuning.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

llvm-svn: 174054
2013-01-31 12:12:40 +00:00
Daniel Dunbar
6acef346f3 [lit] Move unittest adaptor code into discovery module.
- Also, add a test for it.

llvm-svn: 174019
2013-01-31 01:23:39 +00:00
Daniel Dunbar
29c19beaa9 [lit] Run the ShUtil tests as part of the test suite.
llvm-svn: 174018
2013-01-31 01:23:26 +00:00
Daniel Dunbar
78d1ba3a49 [lit] Set parallel mode for coverage tests.
llvm-svn: 174017
2013-01-31 01:23:18 +00:00
Daniel Dunbar
5bab9b90e8 [lit] Move discovery code into its own module.
llvm-svn: 174014
2013-01-31 01:14:01 +00:00
Daniel Dunbar
40874f9354 [lit] Add a MANIFEST file and a script for sanity checking the source dist.
llvm-svn: 174002
2013-01-31 00:21:59 +00:00
Daniel Dunbar
e013a12e40 [lit] Add a basic discovery test.
llvm-svn: 174001
2013-01-31 00:21:51 +00:00
Daniel Dunbar
dc2f271868 [lit] Add a script for checking test coverage.
llvm-svn: 174000
2013-01-31 00:21:44 +00:00
Daniel Dunbar
28d80bd222 [lit] Add a test suite for lit itself.
llvm-svn: 173999
2013-01-31 00:21:39 +00:00
Alexey Samsonov
981596c6d0 [lit] Make GoogleTest test runner correctly discover tests in the source root
llvm-svn: 173907
2013-01-30 07:27:45 +00:00
Daniel Dunbar
98b98e8186 [lit] Add some TODO notes to myself.
llvm-svn: 173857
2013-01-30 00:12:24 +00:00
David Greene
0308949962 Avoid Unnecessary Builds
By default, stop the universe build if a key component fails.  This
avoids useless builds when we know a package is broken anyway.
Provide a --keep-going option to override this behavior.

llvm-svn: 173723
2013-01-28 22:05:50 +00:00
NAKAMURA Takumi
311d4c23b3 [CMake][Lit][unittests] Deprecate CMAKE_BUILD_TYPE in each build directory for unittests.
For example,
cur) unittests/ADT/Release/ADTTests
new) unittests/ADT/ADTTests

RUNTIME_BUILD_MODE can be substituted to CMAKE_CFG_INTDIR.

With Make and Ninja, the tree is not built with multiple configurations.
Then, including the build type in target directory doesn't make sense.
See also "How can I build multiple modes without switching?"
http://www.cmake.org/Wiki/CMake_FAQ
CMAKE_CFG_INTDIR is set to "."

With multiple-configuration-aware build system, like Visual Studio, each unittest is built on appropriate directory, for example,
unittests/ADT/Release/ADTTests.exe
CMAKE_CFG_INTDIR is set to build system's variable, like "$(Configuration)" or "$(OutDir)".

Thus, "--param build_config" is also deprecated.

llvm-svn: 173616
2013-01-27 12:20:50 +00:00
Bill Wendling
ba6c1893c9 Use the AttributeSet instead of AttributeWithIndex.
In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.

llvm-svn: 173606
2013-01-27 03:25:05 +00:00
Aaron Ballman
32a26a9844 A port of the Visual Studio 2012 debugger visualizers for common LLVM and clang datatypes. Patch thanks to Nico Rieck!
llvm-svn: 173532
2013-01-25 23:37:25 +00:00
Bob Wilson
f542c2cef8 Use xcrun to find the right compiler when building llvmCore. <rdar://12801151>
llvm-svn: 173468
2013-01-25 18:40:25 +00:00
NAKAMURA Takumi
c305122653 lit/ShUtil.py: Deprecate '!' in shell expression. It is not sh-compatible.
llvm-svn: 173421
2013-01-25 06:30:36 +00:00
Bill Wendling
9e0064d80b Add the IR attribute 'sspstrong'.
SSPStrong applies a heuristic to insert stack protectors in these situations:

* A Protector is required for functions which contain an array, regardless of
  type or length.

* A Protector is required for functions which contain a structure/union which
  contains an array, regardless of type or length.  Note, there is no limit to
  the depth of nesting.

* A protector is required when the address of a local variable (i.e., stack
  based variable) is exposed. (E.g., such as through a local whose address is
  taken as part of the RHS of an assignment or a local whose address is taken as
  part of a function argument.)

This patch implements the SSPString attribute to be equivalent to
SSPRequired. This will change in a subsequent patch.

llvm-svn: 173230
2013-01-23 06:41:41 +00:00
NAKAMURA Takumi
4728443a0f llvm/utils/valgrind/x86_64-pc-linux-gnu.supp: Add /usr/bin/cmp.
llvm-svn: 172981
2013-01-20 15:30:29 +00:00
Manuel Klimek
7802b396a3 Add basic command line parsing to TestMain.
Summary:
This allows unit tests for components that use Support/Debug.h to print
debug information from test runs by specifying -debug when running the
test.

CC: llvm-commits

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

llvm-svn: 172801
2013-01-18 10:18:50 +00:00
Dmitri Gribenko
847200db76 Remove support for Tcl test format since nobody uses it
llvm-svn: 172794
2013-01-18 06:57:01 +00:00
Daniel Dunbar
74c91efbfd [utils] Update find-rev utility to take a branch argument (name of the git-svn
branch).

llvm-svn: 172740
2013-01-17 18:57:21 +00:00
David Greene
b397f03b15 Use --enable-werror
Use --enable-werror during configure time rather than
--with-extra-options.  This is cleaner and easier to read.

llvm-svn: 172581
2013-01-16 00:17:38 +00:00
Chad Rosier
99207e5c20 [ms-inline asm] Address the FIXME in AsmParser.cpp.
// FIXME: Constraints are hard coded to 'm', but we need an 'r'
// constraint for addressof.  This needs to be cleaned up!

Test cases are already in place.  Specifically,
clang/test/CodeGen/ms-inline-asm.c t15(), t16(), and t24().

llvm-svn: 172569
2013-01-15 23:07:53 +00:00
Bob Wilson
6cd3b6cddc Fix quoting problems from my previous change. <rdar://problem/13001651>
I give up trying to get all of the settings into COMMON_MAKEFLAGS, so just
do the easy thing and repeat the ones with interesting quoting issues
in each make command.

llvm-svn: 172296
2013-01-12 02:31:42 +00:00
Michael Ilseman
d8715c1e7a Support for half intrinsics. Pushes MMX into slower encoding path.
llvm-svn: 172159
2013-01-11 01:45:05 +00:00
Bob Wilson
d478d6df36 Update Apple's build script for llvmCore. <rdar://problem/12914321>
This change is basically just copying changes that we've used for Apple's
clang builds to the script used for building llvmCore. Besides cleaning it
up to use xcrun to locate the proper versions of tools, especially for cross
compiling, it fixes the build to work with newer versions of clang that
honor SDKROOT settings in the environment.

llvm-svn: 172138
2013-01-10 22:59:51 +00:00
Jordan Rose
6b1722a271 TableGen: Keep track of superclass reference ranges.
def foo : bar;
          ~~~

This allows us to produce more precise diagnostics about a certain
superclass, and even provide fixits.

llvm-svn: 172085
2013-01-10 18:50:11 +00:00
Tim Northover
23593199e1 Remove locale-dependence of enum mangling and use existing function.
llvm-svn: 172077
2013-01-10 16:47:31 +00:00
Tim Northover
3b5855ecfc Make TableGen mangle operand method names before putting in enum.
The purpose of this patch is to allow PredicateMethods to be set to something
like "isUImm<8>", calling a C++ template method to reduce code duplication. For
this to work, the PredicateMethod must be mangled into a valid C++ identifier
for insertion into an enum.

llvm-svn: 172073
2013-01-10 15:17:36 +00:00
Tim Northover
3e5ebc3e07 Check whether MCInst operand isImm before calling getImm.
When processing possible aliases, TableGen assumes that if an operand *can* be
an immediate, then it always *will* be. This is incorrect for the AArch64
backend. This patch inserts a check in the generated code to make sure isImm is
true first.

llvm-svn: 171972
2013-01-09 13:32:04 +00:00
Andrew Trick
c15e94c204 MIsched: add an ILP window property to machine model.
This was an experimental option, but needs to be defined
per-target. e.g. PPC A2 needs to aggressively hide latency.

I converted some in-order scheduling tests to A2. Hal is working on
more test cases.

llvm-svn: 171946
2013-01-09 03:36:49 +00:00
Joel Jones
9cde9d58b5 Add highlighting for "int" keyword
llvm-svn: 171863
2013-01-08 16:23:02 +00:00
Eli Bendersky
2f7a1bfc7f Add some additional tests for the .bundle_lock align_to_end feature that didn't
make into the last commit.

Also, update the test-generation script to generate an exhaustive test for
align_to_end as well, and include the generated test.

llvm-svn: 171811
2013-01-07 23:12:59 +00:00
Joel Jones
c3f5b613fc Claim ".td" files. Improve README cp command. Drop "Bundle" from description
llvm-svn: 171758
2013-01-07 17:07:10 +00:00
Joel Jones
9df037b59d Add Textmate bundle for Tablegen syntax-highlighting
llvm-svn: 171496
2013-01-04 18:55:24 +00:00
Michael J. Spencer
8e9968e6f2 [Support][Endian] Add support for specifying the alignment and native unaligned types.
* Add support for specifying the alignment to use.
* Add the concept of native endianness. Used for unaligned native types.

The native alignment and read/write simplification is based on a patch by Richard Smith.

llvm-svn: 171406
2013-01-02 20:14:11 +00:00
Chandler Carruth
03fda8f594 Sort a few more #include lines in tools/... unittests/... and utils/...
llvm-svn: 171363
2013-01-02 10:26:28 +00:00
Chandler Carruth
1879729aa9 Rename VMCore directory to IR.
Aside from moving the actual files, this patch only updates the build
system and the source file comments under lib/... that are relevant.

I'll be updating other docs and other files in smaller subsequnet
commits.

While I've tried to test this, but it is entirely possible that there
will still be some build system fallout.

Also, note that I've not changed the library name itself: libLLVMCore.a
is still the library name. I'd be interested in others' opinions about
whether we should rename this as well (I think we should, just not sure
what it might break)

llvm-svn: 171359
2013-01-02 09:10:48 +00:00
Eli Bendersky
38abc56548 Fix comment typo
llvm-svn: 171113
2012-12-26 18:15:42 +00:00
NAKAMURA Takumi
5b4a443c29 TableGen/FixedLenDecoderEmitter.cpp: Fix a potential mask overflow in fieldFromInstruction().
Reported by Yang Yongyong, thanks!

llvm-svn: 171101
2012-12-26 06:43:14 +00:00
Elena Demikhovsky
33e7b6276c Added 6 more value types: v32i1, v64i1, v32i16, v32i8, v64i8, v8f64
llvm-svn: 171026
2012-12-24 10:03:57 +00:00
Daniel Dunbar
ddefc57253 [utils] Tweak utils/clang-parse-diagnostics-file to ignore autoconf diagnostics.
- Also, don't print headers if we aren't going to print any diagnostics.

llvm-svn: 170973
2012-12-22 00:47:06 +00:00
Bill Wendling
a16e5519db Change 'AttrVal' to 'AttrKind' to better reflect that it's a kind of attribute instead of the value of the attribute.
llvm-svn: 170972
2012-12-22 00:37:52 +00:00
Benjamin Kramer
fee2de20ab Teach sort_includes.py to drop duplicated includes.
llvm-svn: 170911
2012-12-21 18:00:08 +00:00
Eli Bendersky
5420e6ae4a Add a largish auto-generated test for the aligned bundling feature, along with
the script generating it. The test should never be modified manually. If anyone
needs to change it, please change the script and re-run it.

The script is placed into utils/testgen - I couldn't think of a better place,
and after some discussion on IRC this looked like a logical location.

llvm-svn: 170720
2012-12-20 19:16:57 +00:00
NAKAMURA Takumi
72d12c87ec llvmbuild/main.py: Let LibraryDependencies.inc deterministic.
FYI, llvm and clang can be built deterministically between stage 2 and stage3, among iterative clean rebuilds, with GNU ar;

configure --disable-timestamps
make AR.Flags=crsD RANLIB=echo

llvm-svn: 170682
2012-12-20 10:35:18 +00:00
Richard Smith
bf1fd53e22 Fix an uninitialized member variable, found by -fsanitize=bool.
llvm-svn: 170627
2012-12-20 01:05:39 +00:00
Jim Grosbach
431f84fb2f MC: Add MCInstrDesc::mayAffectControlFlow() method.
MC disassembler clients (LLDB) are interested in querying if an
instruction may affect control flow other than by virtue of being
an explicit branch instruction. For example, instructions which
write directly to the PC on some architectures.

llvm-svn: 170610
2012-12-19 23:38:53 +00:00
Roman Divacky
7a967134bc Remove edis - the enhanced disassembler. Fixes PR14654.
llvm-svn: 170578
2012-12-19 19:55:47 +00:00
Bill Wendling
56d9c4b832 Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.
llvm-svn: 170502
2012-12-19 07:18:57 +00:00
Bill Wendling
10c1be166f Fix grammar-o.
llvm-svn: 169798
2012-12-11 00:23:07 +00:00
Anshuman Dasgupta
38feea3c57 Fix PR14568: Avoid the DFA packetizer from making an invalid read
beyond array bounds.

No test case since I cannot reproduce an ICE with this bug. According
to Carlos -- the bug reporter -- a segfault occurs only when LLVM is
compiled with a specific version of GCC.

llvm-svn: 169783
2012-12-10 22:45:57 +00:00
Bill Wendling
3f153ce37b s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.
llvm-svn: 169651
2012-12-07 23:16:57 +00:00
NAKAMURA Takumi
10b6852107 unittest/googletest/Makefile: Unbreak out-of-tree build.
- Use SOURCES instead of Source. See Makefile.rules and MakefileGuide.html.
  - Don't assume the current directory. $(wildcard *.cc) doesn't match anything on corresponding build directory.

llvm-svn: 169568
2012-12-07 01:25:45 +00:00
Alexey Samsonov
8388a78977 Try to unbreak makefile build by excluding gtest-all.cc source
llvm-svn: 169564
2012-12-06 23:59:54 +00:00
Alexey Samsonov
f9bf4312f3 Modify the LLVM checkout of googletest:
1) don't delete gtest-all.cc (which is used to gather all gtest source
   files in a single file) 
2) make including LLVMSupport headers optional (on by default).
   Sanitizer tools may want to use their own versions of googletest
   compiled with specific flags, instead of the common googletest
   library used for all other LLVM/Clang unittests.

llvm-svn: 169559
2012-12-06 23:04:41 +00:00
Richard Smith
f3e386b4af PR10867: Analogue of r169441 for when using external 'sh'. And actually run the test!
llvm-svn: 169446
2012-12-05 23:15:33 +00:00
Richard Smith
27aef165bb PR10867. lit would interpret
RUN: a
  RUN: b || true

as "a && (b || true)" in Tcl mode, and as "(a && b) || true" in sh mode.
Everyone seems to (quite reasonably) write tests assuming the Tcl behavior,
so use that in sh mode too.

llvm-svn: 169441
2012-12-05 22:54:26 +00:00
Andrew Trick
67c084b14c RegisterPresssureTracker: Track live physical register by unit.
This is much simpler to reason about, more efficient, and
fixes some corner cases involving implicit super-register defs.
Fixed rdar://12797931.

llvm-svn: 169425
2012-12-05 21:37:42 +00:00
Andrew Trick
193523c593 RegisterPressure API. Add support for physical register units.
At build-time register pressure was always computed in terms of
register units. But the compile-time API was expressed in terms of
register classes because it was intended for virtual registers (and
physical register units weren't yet used anywhere in codegen).

Now that the codegen uses physreg units consistently, prepare for
tracking register pressure also in terms of live units, not live
registers.

llvm-svn: 169360
2012-12-05 06:47:12 +00:00
Michael J. Spencer
c0bd8f95ce Copy clang/Driver/<Option parsing stuff> to llvm.
llvm-svn: 169344
2012-12-05 00:29:32 +00:00
NAKAMURA Takumi
f5b5d0eac4 KillTheDoctor.cpp: Restore Win32 SDK headers before r169251.
llvm-svn: 169255
2012-12-04 11:34:27 +00:00
Chandler Carruth
3e8b3f66be Sort the #include lines for utils/...
I've tried to find main moudle headers where possible, but the TableGen
stuff may warrant someone else looking at it.

llvm-svn: 169251
2012-12-04 10:37:14 +00:00
Chandler Carruth
2fffa5c0d2 Teach the include sorter to quickly skip files with an extension that
doesn't look like it will have C++ code in it.

Suggestions on a better heuristic are welcome.

llvm-svn: 169248
2012-12-04 10:08:59 +00:00
Chandler Carruth
64bbcb3d1f Teach the include sorter to skip files under test trees and under INPUTS
trees. This allows running the input sorter on the entire clang
repository cleanly now.

llvm-svn: 169247
2012-12-04 09:59:54 +00:00
Chandler Carruth
f20915b38c Teach the include sorting script about the gtest headers; sort them with
the system headers.

llvm-svn: 169242
2012-12-04 09:44:38 +00:00
Chandler Carruth
ac00768d41 Address review comments from Matt on the sort_includes.py script.
1) Teach it to handle files with #include on the first line -- these do
   actually exist in LLVM.
2) Support llvm-c and clang-c include projects.
3) Nuke some stail imports.
4) Switch to using os.path to split the file extension off.
5) Remove debugging leftovers.
6) Add docstring (a really puny one) for the sort function.

I'm continuing te avoid stripping the whitespace on the RHS to preserve
whatever newline characters happen to be in the original file.

llvm-svn: 169222
2012-12-04 07:04:58 +00:00
Chandler Carruth
4fe3ec872c Teach the include sorter to not choke on include guards. ;]
Kind of important when prepping the include/... tree version of the sort
changes.

llvm-svn: 169132
2012-12-03 17:01:46 +00:00
Chandler Carruth
fb558fa381 Add a completely hack-ish tool to sort includes according to the coding
standards.

I am a terrible Python programmer. Patches more the welcome. Please tell
me how this should look if it should look differently. It's just a tiny
little script so it didn't make sense to go through pre-commit review,
especially as someone who actually knows python may want to just rip it
apart and do it The Right Way.

I will be preparing a commit shortly that uses this script to
canonicalize *all* of the #include lines in LLVM. Really, all of them.

llvm-svn: 169125
2012-12-03 14:23:44 +00:00
Bill Wendling
8664bd9153 Remove 'deplibs' keyword, since it's no longer used.
llvm-svn: 169116
2012-12-03 06:34:06 +00:00
Benjamin Kramer
4e6d511382 Bring vim keyword lists up to date.
llvm-svn: 169110
2012-12-02 16:40:38 +00:00
Eli Bendersky
99a08c0b07 Fix a bug in FileCheck that wouldn't let define variables as follows:
; CHECK: [[VAR:[a-z]]]

The problem was that to find the end of the regex var definition, it was
simplistically looking for the next ]] and finding the incorrect one. A
better approach is to count nesting of brackets (taking escaping into
account). This way the brackets that are part of the regex can be discovered
and skipped properly, and the ]] ending is detected in the right place.

llvm-svn: 169109
2012-12-02 16:02:41 +00:00
Eli Bendersky
7ccdc0d825 Support referencing variables defined on the same line.
See http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157198.html
and related discussions.

llvm-svn: 169101
2012-12-01 21:54:48 +00:00
Michael Ilseman
5f2988f933 Update the emacs mode to recognize fadd, fsum, fmul, fdiv, frem, fcmp, icmp
llvm-svn: 169064
2012-12-01 00:42:27 +00:00
Michael Ilseman
7b3d46a0b9 Vim mode updated to recognize fast-math flags
llvm-svn: 169055
2012-11-30 23:18:21 +00:00
Daniel Dunbar
4ca39306cc lit: Add a simple test suite for checking test runner parallelism.
llvm-svn: 169038
2012-11-30 21:34:04 +00:00
Eli Bendersky
6982657b67 Clean up whitespace and add comments
llvm-svn: 169002
2012-11-30 14:22:14 +00:00
Eli Bendersky
0c0c679bab Make FileCheck return 2 in case of an error as documented,
instead of 1 or true (?!)

llvm-svn: 169001
2012-11-30 13:51:33 +00:00
Jakob Stoklund Olesen
7cbcf348ea Add an MCPhysReg typedef to replace naked uint16_t.
Use this type for arrays of physical registers.

llvm-svn: 168850
2012-11-29 02:39:28 +00:00
Jakob Stoklund Olesen
79c1e7f5af Remove all references to TargetInstrInfoImpl.
This class has been merged into its super-class TargetInstrInfo.

llvm-svn: 168760
2012-11-28 02:35:17 +00:00
Daniel Dunbar
86d6f27a6f lit: Bump the version to .3.
llvm-svn: 168750
2012-11-28 00:06:11 +00:00
Richard Smith
2eb09a43e4 Remove unused internal linkage variable.
llvm-svn: 168729
2012-11-27 21:51:36 +00:00
Ted Kremenek
6519f20118 Generalize matching of add_executable to add_XXX_executable.
llvm-svn: 168490
2012-11-22 07:48:52 +00:00
Bill Wendling
62a846033f Make the AttrListPtr object a part of the LLVMContext.
When code deletes the context, the AttributeImpls that the AttrListPtr points to
are now invalid. Therefore, instead of keeping a separate managed static for the
AttrListPtrs that's reference counted, move it into the LLVMContext and delete
it when deleting the AttributeImpls.

llvm-svn: 168354
2012-11-20 05:09:20 +00:00
Pawel Wodnicki
783831134f really fix permissions
llvm-svn: 168256
2012-11-17 06:38:44 +00:00
Pawel Wodnicki
e6169ef812 fix permissions
llvm-svn: 168255
2012-11-17 06:35:19 +00:00
Pawel Wodnicki
513df99461 adding whose code is it anywa tools
llvm-svn: 168254
2012-11-17 06:24:37 +00:00
Weiming Zhao
85dce59506 Remove hard coded registers in ARM ldrexd and strexd instructions
This patch replaces the hard coded GPR pair [R0, R1] of
Intrinsic:arm_ldrexd and [R2, R3] of Intrinsic:arm_strexd with
even/odd GPRPair reg class.
Similar to the lowering of atomic_64 operation.

llvm-svn: 168207
2012-11-16 21:55:34 +00:00
Dmitri Gribenko
84238ab4c9 FileCheck: remove useless 'continue' at the end of a 'while(){}' loop.
llvm-svn: 168048
2012-11-15 16:50:59 +00:00
Eric Christopher
caf5a23d81 Remove the CellSPU port.
Approved by Chris Lattner.

llvm-svn: 167984
2012-11-14 22:09:20 +00:00
Alexander Kornienko
8e387e3189 Support for [[@LINE]], [[@LINE+<offset>]], [[@LINE-<offset>]] expressions in
FileCheck.

llvm-svn: 167978
2012-11-14 21:07:37 +00:00
Alexander Kornienko
61396a2725 Added %(line), %(line+<number>), %(line-<number>) substitutions to lit
llvm-svn: 167971
2012-11-14 20:26:19 +00:00
Benjamin Kramer
511004a2cd Simplify the SmallVector pretty printer for LLDB a bit and make it work with reference types.
llvm-svn: 167674
2012-11-10 09:45:32 +00:00
Evandro Menezes
3163eb097c Fix issue with invalid flat operand number
Avoid iterating over list of operands beyond the number of operands in it.

PS: this fixes issue with revision #167634.
llvm-svn: 167635
2012-11-09 21:27:03 +00:00
Evandro Menezes
065305e336 Fix issue with invalid flat operand number
Avoid iterating over list of operands beyond the number of operands in it.

llvm-svn: 167634
2012-11-09 20:29:37 +00:00
Michael Liao
59114df23b Add support of RTM from TSX extension
- Add RTM code generation support throught 3 X86 intrinsics:
  xbegin()/xend() to start/end a transaction region, and xabort() to abort a
  tranaction region

llvm-svn: 167573
2012-11-08 07:28:54 +00:00
Rafael Espindola
d404d4c18c Fix a build problem with xlc. The error message was
"../llvm-git/utils/TableGen/CodeGenSchedule.cpp", line 1594.12: 1540-0218 (S) The call does not match any parameter list for "operator+".
"../llvm-git/include/llvm/ADT/STLExtras.h", line 130.1: 1540-1283 (I) "template <class _Iterator, class Func> llvm::operator+(mapped_iterator<_Iterator,Func>::difference_type, const mapped_iterator<_Iterator,Func> &)" is not a viable candidate.

Patch by Kai.

llvm-svn: 167311
2012-11-02 20:57:36 +00:00
Jakob Stoklund Olesen
4498c89d5f Generate a table-driven version of TRI::composeSubRegIndices().
Explicitly allow composition of null sub-register indices, and handle
that common case in an inlinable stub.

Use a compressed table implementation instead of the previous nested
switches which generated pretty bad code.

llvm-svn: 167190
2012-11-01 00:32:10 +00:00
Kaelyn Uhrain
2a749e70d9 Don't return false when the function's return type is a pointer.
llvm-svn: 166719
2012-10-25 21:25:08 +00:00
Joerg Sonnenberger
839f6c1a88 Remove exception handling usage from tblgen.
Most places can use PrintFatalError as the unwinding mechanism was not
used for anything other than printing the error. The single exception
was CodeGenDAGPatterns.cpp, where intermediate errors during type
resolution were ignored to simplify incremental platform development.
This use is replaced by an error flag in TreePattern and bailout earlier
in various places if it is set. 

llvm-svn: 166712
2012-10-25 20:33:17 +00:00
David Blaikie
097e5ab972 Remove unused member & unnecessary semicolon.
llvm-svn: 166694
2012-10-25 17:04:55 +00:00
NAKAMURA Takumi
ed7a16786a llvm/utils/TableGen/CMakeLists.txt: Update corresponding to r166685.
llvm-svn: 166686
2012-10-25 15:57:56 +00:00
Sebastian Pop
af468d8d5a add TableGen support to create relationship maps between instructions
Relationship maps are represented as InstrMapping records which are parsed by
TableGen and the information is used to construct mapping tables to represent
appropriate relations between instructions. These tables are emitted into
XXXGenInstrInfo.inc file along with the functions to query them.

Patch by Jyotsna Verma <jverma@codeaurora.org>.

llvm-svn: 166685
2012-10-25 15:54:06 +00:00
Joerg Sonnenberger
8fa017919b Don't use stack unwinding to provide the location information for
SetTheory, but pass down the location explicitly.

llvm-svn: 166629
2012-10-24 22:03:59 +00:00
Lang Hames
784ac6493a Allow the commuted form of tied-operand constraints in tablegen ("$dst = $src",
rather than "$src = $dst").

llvm-svn: 166382
2012-10-20 22:44:13 +00:00
Daniel Dunbar
7abcd13b24 lit: Rename the valgrind leaks feature to match what is currently used
(vg_leak).

llvm-svn: 166306
2012-10-19 20:29:30 +00:00
Daniel Dunbar
48d2376b89 lit: Remove support for XTARGET.
- The XTARGET feature (inherited from old DG tests) was just confusing (and
   barely ever used). The same effect can now be achieved with a combination of
   the more useful REQUIRES and XFAIL.

llvm-svn: 166305
2012-10-19 20:29:27 +00:00
Daniel Dunbar
4747331126 lit: Add 'valgrind' and 'valgrind-leaks' features when valgrind is used.
- These can be used with the XFAIL options.

llvm-svn: 166303
2012-10-19 20:12:00 +00:00
Daniel Dunbar
b86f0140e9 lit: Propagate TERM variable in environment, some tools can do really obscure
odd things if this is missing.

llvm-svn: 166289
2012-10-19 17:23:34 +00:00
Daniel Dunbar
edc1b1982d lit: Allow XFAIL: lines to also refer to "features".
llvm-svn: 166224
2012-10-18 20:43:04 +00:00
Bill Wendling
f2fff93263 Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
llvm-svn: 165924
2012-10-15 07:29:08 +00:00
Bill Wendling
a77399599d Attributes Rewrite
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.

llvm-svn: 165917
2012-10-15 04:46:55 +00:00
Chad Rosier
c8a0d67b5d [ms-inline asm] Use the new API introduced in r165830 in lieu of the
MapAndConstraints vector.  Also remove the unused Kind argument.

llvm-svn: 165833
2012-10-12 22:53:36 +00:00
Richard Trieu
60455a67f5 Change (!list.size() == 0) to (!list.empty()). No functional change.
llvm-svn: 165812
2012-10-12 17:57:35 +00:00
Sean Silva
2174f713f4 Remove unnecessary classof()'s
isa<> et al. automatically infer when the cast is an upcast (including a
self-cast), so these are no longer necessary.

llvm-svn: 165767
2012-10-11 23:30:49 +00:00
Chad Rosier
60c4d7d5a4 Remove extra semicolons.
llvm-svn: 165757
2012-10-11 22:25:56 +00:00
Sean Silva
61b37b272d tblgen: Compile TableGen without RTTI.
TableGen no longer needs RTTI!

llvm-svn: 165651
2012-10-10 20:27:18 +00:00
Sean Silva
f01bff0182 tblgen: Move mini Type hierarchy to LLVM-style RTTI.
llvm-svn: 165648
2012-10-10 20:24:49 +00:00
Sean Silva
cbe79850e7 tblgen: Use semantically correct RTTI functions.
Also, some minor cleanup.

llvm-svn: 165647
2012-10-10 20:24:47 +00:00
Sean Silva
a6a1c05042 tblgen: Mechanically move dynamic_cast<> to dyn_cast<>.
Some of these dyn_cast<>'s would be better phrased as isa<> or cast<>.
That will happen in a future patch.

There are also two dyn_cast_or_null<>'s slipped in instead of
dyn_cast<>'s, since they were causing crashes with just dyn_cast<>.

llvm-svn: 165646
2012-10-10 20:24:43 +00:00
Bill Wendling
a55d5af923 Pass into the AttributeWithIndex::get method an ArrayRef of attribute
enums. These are then created via the correct Attributes creation method.

llvm-svn: 165607
2012-10-10 06:13:42 +00:00
Andrew Trick
782f561e6a TableGen subtarget emitter cleanup.
Consistently evaluate Aliases and Sequences recursively.

llvm-svn: 165604
2012-10-10 05:43:13 +00:00
Andrew Trick
13b4f59560 misched: Generate IsBuffered flag for machine resources.
llvm-svn: 165602
2012-10-10 05:43:04 +00:00
Micah Villmow
fe3338a7eb Move TargetData to DataLayout.
llvm-svn: 165403
2012-10-08 16:39:34 +00:00
Chad Rosier
179f50da7a [ms-inline asm] Add a few typedefs to simplify future changes.
llvm-svn: 165324
2012-10-05 18:41:14 +00:00
Sean Silva
f8b271827e tblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.
This is a mechanical change of dynamic_cast<> to dyn_cast<>. A number of
these uses are actually more like isa<> or cast<>, and will be changed
to the semanticaly appropriate one in a future patch.

llvm-svn: 165291
2012-10-05 03:31:58 +00:00
Andrew Trick
d6d5b63b3b Added instregex support to TableGen subtarget emitter.
This allows the processor-specific machine model to override selected
base opcodes without any fanciness.
e.g. InstRW<[CoreXWriteVANDP], (instregex "VANDP")>.

llvm-svn: 165180
2012-10-03 23:06:32 +00:00
Andrew Trick
00263532fa TableGen subtarget emitter, nearly first class support for SchedAlias.
A processor can now arbitrarily alias one SchedWrite onto
another. Only the SchedAlias definition need be within the processor
model. The aliased SchedWrite may be a SchedVariant, WriteSequence, or
transitively refer to another alias.

llvm-svn: 165179
2012-10-03 23:06:28 +00:00
Andrew Trick
35fd7cbe58 Cleanup TableGen subtarget emitter.
llvm-svn: 165178
2012-10-03 23:06:25 +00:00
Chad Rosier
9c4444321b [ms-inline asm] Default to the 'm' constraint. This matches the behavior of the
MSVC compiler.

llvm-svn: 165174
2012-10-03 22:18:38 +00:00
Sean Silva
c8c1f73145 tblgen: Migrate llvm-tblgen to new TableGenMain API.
llvm-svn: 165166
2012-10-03 21:29:19 +00:00
Chad Rosier
37e4157d8c Fix 80-column violations. Cleanup whitespace in generated code.
llvm-svn: 164983
2012-10-02 00:25:57 +00:00
Chad Rosier
5e80eb4c86 [ms-inline asm] Add the convertToMapAndConstraints() function that is used to
map constraints and MCInst operands to inline asm operands.  This replaces the
getMCInstOperandNum() function.

The logic to determine the constraints are not in place, so we still default to
a register constraint (i.e., "r"). Also, we no longer build the MCInst but
rather return just the opcode to get the MCInstrDesc.

llvm-svn: 164979
2012-10-01 23:45:51 +00:00
Sylvestre Ledru
b77340e506 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
llvm-svn: 164768
2012-09-27 10:14:43 +00:00
Sylvestre Ledru
1c5e7904de Fix a typo 'iff' => 'if'
llvm-svn: 164767
2012-09-27 09:59:43 +00:00
Chad Rosier
4c89e0343a Rather then have a wrapper function, have tblgen instantiate the implementation.
Also remove an unused argument.

llvm-svn: 164567
2012-09-24 22:57:55 +00:00
Chad Rosier
599b467187 Rather then have a wrapper function, have tblgen instantiate the implementation.
llvm-svn: 164548
2012-09-24 19:32:29 +00:00
Andrew Trick
7a73f9d7f4 Machine Model (-schedmodel only). Added SchedAliases.
Allow subtargets to tie SchedReadWrite types to processor specific
sequences or variants.

llvm-svn: 164451
2012-09-22 02:24:21 +00:00
Chad Rosier
fd5e542cea [ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser.
llvm-svn: 164420
2012-09-21 22:21:26 +00:00
Chad Rosier
64fd35f379 Whitespace.
llvm-svn: 164406
2012-09-21 19:25:59 +00:00
Dmitri Gribenko
aeecde380d Clarify comment.
llvm-svn: 164371
2012-09-21 15:26:34 +00:00
Micah Villmow
cb0e426061 Add in new data types that are used by AMDIL/ANL among others.
llvm-svn: 164261
2012-09-19 22:47:07 +00:00
Owen Anderson
76c554cf2a Soften the pattern-can-never-match error in TableGen into a warning. This pattern can be very useful in cases where you want to define a multiclass that covers both commutative and non-commutative operators (say, add and sub).
llvm-svn: 164256
2012-09-19 22:15:06 +00:00
Craig Topper
abbf768c15 Remove code for setting the VEX L-bit as a function of operand size from the code emitters and the disassembler table builder. Fix a couple instructions that were still missing VEX_L.
llvm-svn: 164204
2012-09-19 06:37:45 +00:00
Andrew Trick
3ed8eed2ed SchedMachineModel: compress the CPU's WriteLatencyTable.
llvm-svn: 164199
2012-09-19 04:43:19 +00:00
Sean Silva
a07c612e3e Iterate deterministicaly over ClassInfo*'s
Fixes an observed instance of nondeterministic TableGen output.

Review by Jakob.

llvm-svn: 164191
2012-09-19 01:47:03 +00:00
Sean Silva
c291496fe7 Iterate deterministically over register classes
Fixes an observed instance of nondeterministic TableGen output.

Review by Jakob.

llvm-svn: 164190
2012-09-19 01:47:01 +00:00
Sean Silva
eedf4ffbcb Refactor Record* by-ID comparator to Record.h
This is a generally useful utility; there's no reason to have it hidden
in CodeGenDAGPatterns.cpp.

Also, rename it to fit the other comparators in Record.h

Review by Jakob.

llvm-svn: 164189
2012-09-19 01:47:00 +00:00
Benjamin Kramer
9958678403 FileCheck: Fix off-by-one bug that made CHECK-NOT: ignore the next character after the colon.
llvm-svn: 164165
2012-09-18 20:51:39 +00:00
Craig Topper
2c492a1861 Make custom operand parsing mnemonic indices use the same mnemonic table as the match table. Reorder fields in OperandMatchEntry to provide the least amount of padding for in tree targets.
llvm-svn: 164109
2012-09-18 07:02:21 +00:00
Craig Topper
c4107aa8c2 Use variable type for index into mnemonic table. Shrinks size of index field on in tree targets. Saving static data space.
llvm-svn: 164108
2012-09-18 06:10:45 +00:00
Andrew Trick
6cba50cbb4 Replaced ReInitMCSubtargetInfo with InitMCProcessor.
Now where we used to call ReInitMCSubtargetInfo, we actually recompute
the same information as InitMCSubtargetInfo instead of only setting
the feature bits.

llvm-svn: 164105
2012-09-18 05:33:15 +00:00
Andrew Trick
73e100e6f5 comment typo
llvm-svn: 164097
2012-09-18 04:03:30 +00:00
Andrew Trick
418db6184f TableGen subtarget emitter. Use getSchedClassIdx.
llvm-svn: 164096
2012-09-18 03:55:55 +00:00
Andrew Trick
b7b658d440 TableGen subtarget emitter. Generate resolveSchedClass generated hook for resolving instruction variants.
llvm-svn: 164095
2012-09-18 03:41:43 +00:00
Andrew Trick
c2ee4420fd TableGen subtarget emitter. Remove unnecessary header dependence.
llvm-svn: 164094
2012-09-18 03:32:57 +00:00
Andrew Trick
65c7aae93f TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
llvm-svn: 164092
2012-09-18 03:18:56 +00:00
Craig Topper
24762462b0 Mark asm matcher conversion table as const.
llvm-svn: 164088
2012-09-18 01:41:49 +00:00
Craig Topper
5f44668251 Fix typo in comment. No functional change.
llvm-svn: 164086
2012-09-18 01:13:36 +00:00
Andrew Trick
2b04a12c0c Backout the wrong subtarget emitter fix
llvm-svn: 164078
2012-09-17 23:14:15 +00:00
Andrew Trick
1956ad7efe Fix release build after reverting
llvm-svn: 164075
2012-09-17 23:05:04 +00:00
Andrew Trick
150c97940b Revert r164061-r164067. Most of the new subtarget emitter.
I have to work out the Target/CodeGen header dependencies
before putting this back.

llvm-svn: 164072
2012-09-17 23:00:42 +00:00
Andrew Trick
9400ee3c79 InitMCProcessor
llvm-svn: 164066
2012-09-17 22:19:12 +00:00
Andrew Trick
81e5a058f2 comment typo
llvm-svn: 164064
2012-09-17 22:19:04 +00:00
Andrew Trick
22072f5bf2 TableGen subtarget emitter. Use getSchedClassIdx.
llvm-svn: 164063
2012-09-17 22:19:01 +00:00
Andrew Trick
7403ff5282 TableGen subtarget emitter. Generate resolveSchedClass generated hook for resolving instruction variants.
llvm-svn: 164062
2012-09-17 22:18:58 +00:00
Andrew Trick
8a499d1f62 TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
llvm-svn: 164061
2012-09-17 22:18:55 +00:00
Andrew Trick
f5182127b1 TableGen subtarget emitter. Format and emit data tables for the new machine model.
llvm-svn: 164060
2012-09-17 22:18:50 +00:00
Andrew Trick
ef09f46517 TableGen subtarget emitter. Generate data tables for the new machine model.
Map the CodeGenSchedule object model onto data tables. The structure
of the data tables is defined in MC, so for convenience we include
MCSchedule.h. The alternative is maintaining a redundant copy of the
table structure definitions. Mapping the object model onto data tables
is sufficiently complicated that it should not be interleaved with
emitting source code. This avoids major problem with the backend for
itinerary generation.

llvm-svn: 164059
2012-09-17 22:18:48 +00:00
Andrew Trick
cf41195b6a TableGen subtarget emitter. Emit processor resources for the new machine model.
llvm-svn: 164058
2012-09-17 22:18:45 +00:00
Andrew Trick
d15e58e200 TableGen subtarget parser: Add getProcResourcesIdx().
llvm-svn: 164057
2012-09-17 22:18:43 +00:00
Jim Grosbach
68def8a302 TableGen: Add initializer.
Keep GCC's warnings happy. It can't reason out that the state machine won't
ever hit the potentially uninitialized use in OPC_FilterValue.

llvm-svn: 164041
2012-09-17 18:00:53 +00:00
Axel Naumann
bcdf671ac4 Fix a few vars that can end up being used without initialization.
The cases where no initialization happens should still be checked for logic flaws.

llvm-svn: 164032
2012-09-17 14:20:57 +00:00
Michael Liao
00438be1a0 Fix typo
llvm-svn: 164012
2012-09-17 04:43:39 +00:00
Craig Topper
5e50ef6b15 Add 'virtual' keywoards to output file for overridden functions.
llvm-svn: 164002
2012-09-16 18:25:36 +00:00
Craig Topper
f3580aa31e Add 'virtual' keywoards to output file for overridden functions.
llvm-svn: 163999
2012-09-16 16:35:22 +00:00
Dmitri Gribenko
dd5d6c0da7 Fix Doxygen issues: wrap code examples in \code and use \p to refer to
parameters.

llvm-svn: 163984
2012-09-15 20:22:05 +00:00
Craig Topper
7989d0ccdc Revert r163878 as it breaks on targets with alternate register names. Such targets do not exist in the main tree so this was not noticed.
llvm-svn: 163959
2012-09-15 01:22:42 +00:00
Andrew Trick
25c8faee30 TableGen subtarget parser. Handle new machine model.
Collect processor resources from the subtarget defs.

llvm-svn: 163953
2012-09-15 00:20:02 +00:00
Andrew Trick
0587f1d794 TableGen subtarget parser. Handle new machine model.
Infer SchedClasses from variants defined by the target or subtarget.

llvm-svn: 163952
2012-09-15 00:19:59 +00:00
Andrew Trick
b324ff57ad TableGen subtarget parser. Handle new machine model.
Collect SchedClasses and SchedRW types from the subtarget defs.

llvm-svn: 163951
2012-09-15 00:19:57 +00:00
Craig Topper
0320f5eded Allow the second opcode info table to be 8, 16, or 32-bits as needed to represent additional fragments. This recovers some space on ATT X86 syntax and PowerPC which only need 40-bits instead of 48-bits. This also increases ARM to 64-bits to fully encode all of its operands.
llvm-svn: 163880
2012-09-14 08:33:11 +00:00
Craig Topper
5cd6b912e7 Reduce size of register name index tables by using uint16_t for all in tree targets. If more than 16-bits are needed for any out of tree targets, code will detect and use uint32_t instead.
llvm-svn: 163878
2012-09-14 06:37:49 +00:00