1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

5744 Commits

Author SHA1 Message Date
Daniel Dunbar
5a4535da11 [lit] Factor out a helper for shell command results.
llvm-svn: 271608
2016-06-02 23:32:35 +00:00
Eric Fiselier
6ed176169a Add "REQUIRES-ANY" feature test
Summary:
This patch adds a "REQUIRES-ANY" feature test that is disjunctive. This marks a test as `UNSUPPORTED` if none of the specified features are available.

Libc++ has the need to write feature test such as `// REQUIRES-ANY: c++98, c++03`  when testing of behavior that is specific to older dialects but has since changed.


Reviewers: rnk, ddunbar

Subscribers: ddunbar, probinson, llvm-commits, cfe-commits

Differential Revision: http://reviews.llvm.org/D20757

llvm-svn: 271468
2016-06-02 01:59:57 +00:00
Joerg Sonnenberger
2e0488e88b Update usage(), make sure srcdir is really empty.
llvm-svn: 271396
2016-06-01 14:16:00 +00:00
David Blaikie
b178b36ac6 Reference gdb python type printer scripts from SmallString, SmallVector, ArrayRef, and StringRef
llvm-svn: 271357
2016-06-01 01:02:32 +00:00
Joerg Sonnenberger
c94c01607b Make it easier to process merges in a normal buildable directory tree by
allowing the user to specify the base directory of the checkout.

llvm-svn: 271192
2016-05-29 22:09:54 +00:00
Xinliang David Li
d44bbb4874 FileCheck: dump command line context with empty input
Differential Revision: http://reviews.llvm.org/D20716

llvm-svn: 271047
2016-05-27 21:23:25 +00:00
Benjamin Kramer
a855b3205f Apply clang-tidy's misc-move-constructor-init throughout LLVM.
No functionality change intended, maybe a tiny performance improvement.

llvm-svn: 270997
2016-05-27 14:27:24 +00:00
Benjamin Kramer
63c3e24c6a Avoid some copies by using const references.
clang-tidy's performance-unnecessary-copy-initialization with some manual
fixes. No functional changes intended.

llvm-svn: 270988
2016-05-27 12:30:51 +00:00
John Brawn
af398354eb Add auto-exporting of symbols from tools so that plugins work on Windows
The problem with plugins on Windows is that when building a plugin DLL it needs
to explicitly link against something (an exe or DLL) if it uses symbols from
that thing, and that thing must explicitly export those symbols. Also there's a
limit of 65535 symbols that can be exported. This means that currently plugins
only work on Windows when using BUILD_SHARED_LIBS, and that doesn't work with
MSVC.

This patch adds an LLVM_EXPORT_SYMBOLS_FOR_PLUGINS option, which when enabled
automatically exports from all LLVM tools the symbols that a plugin could want
to use so that a plugin can link against a tool directly. Plugins can specify
what tool they link against by using PLUGIN_TOOL argument to llvm_add_library.
The option can also be enabled on Linux, though there all it should do is
restrict the set of symbols that are exported as by default all symbols are
exported.

This option is currently OFF by default, as while I've verified that it works
with MSVC, linux gcc, and cygwin gcc, I haven't tried mingw gcc and I have no
idea what will happen on OSX. Also unfortunately we can't turn on
LLVM_ENABLE_PLUGINS when the option is ON as bugpoint-passes needs to be
loaded by both bugpoint.exe and opt.exe which is incompatible with this
approach. Also currently clang plugins don't work with this approach, which
will be fixed in future patches.

Differential Revision: http://reviews.llvm.org/D18826

llvm-svn: 270839
2016-05-26 11:16:43 +00:00
Matt Arsenault
4a9e67f4ef TableGen: Use StringRef instead of std::string
llvm-svn: 270741
2016-05-25 18:07:40 +00:00
Eugene Zelenko
2045d7b3aa Fix Clang-tidy modernize-use-bool-literals in generated Target code; other minor fixes; other minor fixes.
Make generated code more readable.

Fix some Include What You Use warnings.

Differential revision: http://reviews.llvm.org/D20317

llvm-svn: 269783
2016-05-17 17:04:23 +00:00
Justin Bogner
d72ab7a6b6 SDAG: Make SelectCodeCommon return void
This means SelectCode unconditionally returns nullptr now. I'll follow
up with a change to make that return void as well, but it seems best
to keep that one very mechanical.

This is part of the work to have Select return void instead of an
SDNode *, which is in turn part of llvm.org/pr26808.

llvm-svn: 269136
2016-05-10 22:58:26 +00:00
Sam Kolton
6ae1dde4c7 [TableGen] AsmMatcher: support for default values for optional operands
Summary:
This change allows to specify "DefaultMethod" for optional operand (IsOptional = 1) in AsmOperandClass that return default value for operand. This is used in convertToMCInst to set default values in MCInst.
Previously if you wanted to set default value for operand you had to create custom converter method. With this change it is possible to use standard converters even when optional operands presented.

Reviewers: tstellarAMD, ab, craig.topper

Subscribers: jyknight, dsanders, arsenm, nhaustov, llvm-commits

Differential Revision: http://reviews.llvm.org/D18242

llvm-svn: 268726
2016-05-06 11:31:17 +00:00
Craig Topper
79fd28882b [TableGen] Fix a memory leak when creating SwitchOpcodeMatchers.
llvm-svn: 268712
2016-05-06 06:56:14 +00:00
Craig Topper
8363434141 [TableGen] Remove isSafeToReorderWithPatternPredicate from DAGISelMatchers as its not used anymore.
llvm-svn: 268711
2016-05-06 06:21:27 +00:00
Craig Topper
df9c65f029 [TableGen] Remove getHash support from DAGISelMatcher. It hasn't been used for some time.
llvm-svn: 268706
2016-05-06 02:37:59 +00:00
Craig Topper
4a8adb2f2c [TableGen] Remove SinkPatternPredicates from the DAG isel matcher optimizer.
Pattern predicates already appear to be emitted as far down as they can be. The optimization was making no changes on any in-tree target.

llvm-svn: 268705
2016-05-06 02:37:56 +00:00
Justin Bogner
b513fa54c6 SDAG: Remove OPC_MarkGlueResults and associated logic. NFC
This opcode never happens in practice, and yet the logic we have in
place to handle it would be undefined behaviour if we ever executed
it. Remove it rather than trying to refactor code that's never
reached.

llvm-svn: 268692
2016-05-05 22:37:45 +00:00
Chris Bieneman
64aa95c1c8 Remove LLVM_ENABLE_TIMESTAMPS
Summary:
As per the discussion on LLVM-dev this patch proposes removing LLVM_ENABLE_TIMESTAMPS.

The only complicated bit of this patch is the Windows support. On windows we used to log an error if /INCREMENTAL was passed to the linker when timestamps were disabled.

With this change since timestamps in code are always disabled we will always compile on windows with /Brepro unless /INCREMENTAL is specified, and we will log a warning when /INCREMENTAL is specified to notify the user that the build will be non-deterministic.

See: http://lists.llvm.org/pipermail/llvm-dev/2016-May/098990.html

Reviewers: bogner, silvas, rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19892

llvm-svn: 268670
2016-05-05 19:57:03 +00:00
James Y Knight
49bc30f7bb Remove bit-rotten CppBackend.
This backend was supposed to generate C++ code which will re-construct
the LLVM IR passed as input. This seems to me to have very marginal
usefulness in the first place.

However, the code has never been updated to use IRBuilder, which makes
its current value negative -- people who look at the output may be
steered to use the *wrong* C++ APIs to construct IR.

Furthermore, it's generated code that doesn't compile since at least
2013.

Differential Revision: http://reviews.llvm.org/D19942

llvm-svn: 268631
2016-05-05 14:35:40 +00:00
Craig Topper
1049b48ef2 [TableGen] Make sure to recursively factor any ScopeMatchers created while forming a SwitchType node. Remove a couple hundred bytes from the X86 matcher table.
llvm-svn: 268611
2016-05-05 06:19:27 +00:00
Craig Topper
d1a2f5a48d [TableGen] Remove stale comment.
llvm-svn: 268610
2016-05-05 06:19:25 +00:00
Hans Wennborg
efd70f135c Win packaging script: include the OpenMP run-time
llvm-svn: 268398
2016-05-03 16:43:40 +00:00
Craig Topper
eb01b2394d [CodeGen] Add some space optimized forms of EmitNode and MorphNodeTo that implicitly indicate the number of result VTs. This shaves about 16K off the X86 matching table taking it down to about 470K.
Overall this reduces the llc binary size with all in-tree targets by about 40K.

llvm-svn: 268365
2016-05-03 05:54:13 +00:00
Craig Topper
cb85db8903 [CodeGen] Add OPC_MoveChild0-OPC_MoveChild7 opcodes to isel matching tables to optimize table size. Shaves about 12K off the X86 matcher table.
llvm-svn: 268209
2016-05-02 01:53:30 +00:00
Rui Ueyama
b8083864d1 [lit] Add %:[STpst] to represent paths without colons on Windows.
Summary:
We need these variables to concatenate two absolute paths to construct
a valid path. Currently, %t\%t is, for example, expanded to C:\foo\C:\foo,
which is not a valid path because ":" is not a valid path character
on Windows. With this patch, %t will be expanded to C\foo.

Differential Revision: http://reviews.llvm.org/D19757

llvm-svn: 268168
2016-04-30 21:32:12 +00:00
Matthias Braun
d0b9d09177 TableGen: Produce CoveredBySubRegs summary for register classes
This will be used in the upcoming "DetectDeadLanes" pass.

llvm-svn: 267850
2016-04-28 03:07:11 +00:00
Matthias Braun
d04f51ebf8 TargetRegisterInfo: Introduce reverseComposeSubRegIndexLaneMask()
This function performs the reverse computation of
composeSubRegIndexLaneMask().

It will be used in the upcoming "DetectDeadLanes" pass.

llvm-svn: 267849
2016-04-28 03:07:07 +00:00
Matthias Braun
ef39a66184 TableGen: Support lanemasks for classes without subregisters
Previously using lanemasks on registers without any subregisters was not
well defined. This commit extends TargetRegisterInfo/tablegen to:
- Report a lanemask of 1 for regclasses without subregisters
- Do the right thing when mapping a 0/1 lanemask from a class without
  subregisters into a class with subregisters in
  TargetRegisterInfo::composeSubRegIndexLaneMasks().

This will be used in the upcoming "DetectDeadLanes" patch.

llvm-svn: 267848
2016-04-28 03:07:04 +00:00
Zachary Turner
e37f3f299f Add natvis visualizers for endian types.
This allows ulittle* and ubig* types to be visualized properly
in VS.

Differential Revision: http://reviews.llvm.org/D19339
Reviewed By: Aaron Ballman

llvm-svn: 267050
2016-04-21 20:58:41 +00:00
Nicolai Haehnle
0127d62008 Split IntrReadArgMem into IntrReadMem and IntrArgMemOnly
Summary:
IntrReadWriteArgMem simply becomes IntrArgMemOnly.

So there are fewer intrinsic properties that express their orthogonality
better, and correspond more closely to the corresponding IR attributes.

Suggested by: Philip Reames

Reviewers: joker.eph, reames, tstellarAMD

Subscribers: jholewinski, arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D19291

llvm-svn: 267021
2016-04-21 17:48:02 +00:00
Amaury Sechet
8c1203a67d Add LLVMGetAttrKindID in the C API in order to facilitate migration away from LLVMAttribute
Summary:
LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values.

See D18749 for reference.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19081

llvm-svn: 266842
2016-04-20 01:02:12 +00:00
Nicolai Haehnle
0c7a341af5 Add IntrWrite[Arg]Mem intrinsic property
Summary:
This property is used to mark an intrinsic that only writes to memory, but
neither reads from memory nor has other side effects.

An example where this is useful is the llvm.amdgcn.buffer.store.format.*
intrinsic, which corresponds to a store instruction that goes through a special
buffer descriptor rather than through a plain pointer.

With this property, the intrinsic should still be handled as having side
effects at the LLVM IR level, but machine scheduling can make smarter
decisions.

Reviewers: tstellarAMD, arsenm, joker.eph, reames

Subscribers: arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D18291

llvm-svn: 266826
2016-04-19 21:58:33 +00:00
Nicolai Haehnle
a767badbd5 [TableGen] Make an error message slightly more informative
Reviewers: ab, spop, stoklund

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19192

llvm-svn: 266823
2016-04-19 21:58:10 +00:00
Saleem Abdulrasool
7e3b0da900 vim: add swiftcc keyword
Update the syntax highlighting for SVN r265480.

llvm-svn: 266705
2016-04-19 02:04:01 +00:00
Mehdi Amini
9ff867f98c [NFC] Header cleanup
Removed some unused headers, replaced some headers with forward class declarations.

Found using simple scripts like this one:
clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap'

Patch by Eugene Kosov <claprix@yandex.ru>

Differential Revision: http://reviews.llvm.org/D19219

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266595
2016-04-18 09:17:29 +00:00
Craig Topper
8419372e6c Declare MVT::SimpleValueType as an int8_t sized enum. This removes 400 bytes from TargetLoweringBase and probably other places.
This required changing several places to print VT enums as strings instead of raw ints since the proper method to use to print became ambiguous. This is probably an improvement anyway.

This also appears to save ~8K from an x86 self host build of llc.

llvm-svn: 266562
2016-04-17 17:37:33 +00:00
Richard Smith
c8f9cc971a Update and fix LLVM_ENABLE_MODULES:
1) We need to add this flag prior to adding any other, in case the user has
specified a -fmodule-cache-path= flag in their custom CXXFLAGS. Such a flag
causes -Werror builds to fail, and thus all config checks fail, until we add
the corresponding -fmodules flag. The modules selfhost bot does this, for
instance.

2) Delete module maps that were putting .cpp files into modules.

3) Enable -fmodules-local-submodule-visibility, to get proper module
visibility rules applied across submodules of the same module. Disable
-fmodules for C builds, since that flag is not available there.

llvm-svn: 266502
2016-04-16 00:48:58 +00:00
Amaury Sechet
9e1c3df5ca Revert "Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away from LLVMAttribute"
This reverts commit 0bcfd95c268bcb180a525e1837e84475df8acdc7.

llvm-svn: 266259
2016-04-13 23:01:39 +00:00
Amaury Sechet
7c6da5b716 Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away from LLVMAttribute
Summary: LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values.

Reviewers: Wallbraker, whitequark, joker.eph, echristo

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18749

llvm-svn: 266257
2016-04-13 22:51:40 +00:00
JF Bastien
15aa6cd737 Delete mergefunctions.clang.svn.patch
The patch doesn't apply, and was removed from zorg by rL266094.

llvm-svn: 266112
2016-04-12 19:44:40 +00:00
Junmo Park
b9169e3854 Minor code cleanup. NFC.
llvm-svn: 266045
2016-04-12 06:02:11 +00:00
Saleem Abdulrasool
55896cb4eb vim: add missing keyword
`source_filename` was introduced as a keyword in SVN r264884, but the syntax
file was not updated.

llvm-svn: 265572
2016-04-06 17:42:16 +00:00
Sanjay Patel
293e730a12 fixed to discard earlier advertising
Also, hardcode (there must be a better way...) the 'utils' dir in the 
advertisement, so it's easier to find.

llvm-svn: 265444
2016-04-05 19:50:21 +00:00
Sanjay Patel
30e1dcd813 add example usage and workflow to --help output
llvm-svn: 265430
2016-04-05 18:00:47 +00:00
Sanjay Patel
1b16935ab4 check or check-next the first line of the function too
We could make this an option if people don't like it. 
But since part of the reason for using a script to generate
checks is to prevent lazy checking that lets bugs crawl 
through, let's have the script check the first line too. 

For asm tests, it ensures that nothing unexpected has 
happened before the first line of asm. This matches the
existing behavior of update_llc_test_checks.py. 

More discussion in PR22897:
https://llvm.org/bugs/show_bug.cgi?id=22897

llvm-svn: 265414
2016-04-05 16:49:07 +00:00
Valery Pykhtin
67ce021dca [TableGen] AsmMatcherEmitter.cpp: replace a sequence of "if" to "switch" in emitValidateOperandClass.
Differential Revision: http://reviews.llvm.org/D18394

llvm-svn: 265412
2016-04-05 16:18:16 +00:00
Matthias Braun
10c7f27ee3 lit: python3 compatibility fix
llvm-svn: 265070
2016-03-31 23:08:55 +00:00
Daniel Dunbar
5f81d65876 [lit][googletest] Handle upstream gtest output
Summary:
Upstream googletest prints "Running main() from gtest_main.cc" to stdout prior
to running tests. LLVM removed that print statement in r61540. If a user were
to use lit to run tests that use upstream googletest, however, lit
reports "Running main()" as an invalid test name.

To avoid such a failure, add an extra conditional to `formats/googletest.py`.
Also add tests to demonstrate the modified behavior.

Reviewers: abdulras, ddunbar

Subscribers: ddunbar, llvm-commits, kastiglione

Differential Revision: http://reviews.llvm.org/D18606

llvm-svn: 265034
2016-03-31 18:22:55 +00:00
Mike Spertus
4c1e81f164 Submitted new file with wrong line endings. Correcting...
llvm-svn: 264620
2016-03-28 19:06:17 +00:00
Mike Spertus
e5577238c4 Use VS2015 Project Support for Natvis to eliminate the need to manually install natvis files
When using Visual Studio 2015, cmake now puts the native visualizers in llvm.sln, so the developer automatically sees custom visualizations.
Much thanks to ariccio who provided extensive help on this change. (manual installation still needed on VS2013)

llvm-svn: 264601
2016-03-28 17:58:38 +00:00
Sanjay Patel
4565d3e5ee workaround for an IR variable named %.
(which SimplifyCFG can produce...)

llvm-svn: 264543
2016-03-27 20:44:35 +00:00
Sanjay Patel
ae386b1b8a add scrubber for excessive leading whitespace
llvm-svn: 264542
2016-03-27 20:43:02 +00:00
Matthias Braun
a1b56ffab3 abtest: Cleanup, improve comments
llvm-svn: 264502
2016-03-26 04:07:55 +00:00
Matthias Braun
8ff16fc446 abtest: Check all files, improve announcements
Simply searching for gooddir/* and baddir/* instead of *.s the script
should also work with .o files.

llvm-svn: 264484
2016-03-26 00:36:58 +00:00
Matthias Braun
cabb126377 Put my abtest scripts into the util directory
See http://lists.llvm.org/pipermail/llvm-dev/2016-March/097640.html
There is also a description/tutorial in the comments of the abtest.py
file.

llvm-svn: 264482
2016-03-26 00:23:59 +00:00
Sanjay Patel
b097267690 fix IR function name regex to allow hyphens
llvm-svn: 264422
2016-03-25 17:00:12 +00:00
Sanjay Patel
005a2447bd Add utility script to generate checks for opt or llc regression tests
This is an enhancement of the existing update_llc_test_checks.py script.
It adds some of the functionality from the script used in D17999 to make
the IR checking more flexible.

The bad news: 
This actually is 'My First Python Program'. Thus, it's likely that I have
violated all best practices of Python programming if I've made a functional
change from the original program. If you see anything that's obviously 
wrong, please let me know or feel free to fix it. I didn't even read any
documentation...

The good news: 
I tested this on ~10 existing opt/llc regression tests, and it does what 
I hoped for. It produces exact checking for IR regression tests and doesn't
signficantly change the existing llc-with-x86-target asm checking. The opt
tests that were modified in r263667, r263668, r263674, and r263679 are
examples of the expected results, except that this version of the script 
puts the check lines ahead of the IR to follow the existing llc/asm 
behavior.

If there are no complaints/fallout, we should be able to remove the 
original script. Extending this script to be used for non-x86 and clang
regression tests would be the expected follow-up steps.

llvm-svn: 264357
2016-03-24 23:19:26 +00:00
Sanjay Patel
b9fb991cea don't hardcode the name of the llc checks script
We lose the 'utils' directory name in our advertising line with
this change. We could retain that, but I don't see the point.
This removes a dependency for making the script apply to more than
'llc'. Ie, we'll want to change the script name if it works with 
opt/clang too.

llvm-svn: 264310
2016-03-24 17:30:38 +00:00
Sanjay Patel
1613bbab8d reorganize llc checks script to allow more flexibility, part 2; NFCI
The goal is to enhance this script to be used with opt and clang:
Break 'main' into functions and change variable names to be more
generic because we want to handle more than x86 asm output.

llvm-svn: 264307
2016-03-24 17:15:42 +00:00
Sanjay Patel
da449610eb reorganize llc checks script to allow more flexibility; NFCI
The goal is to enhance this script to be used with opt and clang:
Group all of the regexes together, so it's easier to see what's going on.
This will make it easier to break main() up into pieces too. 
Also, note that some of the regexes are for x86-specific asm. 

llvm-svn: 264197
2016-03-23 21:40:53 +00:00
Mike Spertus
e5657d5298 Typesafe visualization of PointerIntPairs in Visual Studio
In the <DisplayString> of PointerIntPair , I cast the pointer to the actual type, so VS can leverage it while visualizing, not unlike the recent change to PointerUnion visualization.
In the expansion, the current code is casting to the incorrect type (wrong number of stars), so I fixed that as well.

llvm-svn: 263821
2016-03-18 20:06:16 +00:00
Filipe Cabecinhas
0cf5522f49 [lit] Enqueue tests on a separate thread to not hit limits on parallel queues
Summary:
The multiprocessing.Queue.put() call can hang if we try queueing all the
tests before starting to take them out of the queue.
The current implementation hangs if tests exceed 2^^15, on Mac OS X.
This might happen with a ninja check-all if one has a bunch of llvm
projects.

Reviewers: delcypher, bkramer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17609

llvm-svn: 263731
2016-03-17 18:27:33 +00:00
Chandler Carruth
a33398e005 [lit] Hack lit to allow a test suite to request that it is run "early".
This lets us for example start running the unit test suite early. For
'check-llvm' on my machine, this drops the tim e from 44s to 32s!!!!!

It's pretty ugly. I barely know how to write Python, so feel free to
just tell me how I should write it instead. =D Thanks to Filipe and
others for help.

Differential Revision: http://reviews.llvm.org/D18089

llvm-svn: 263329
2016-03-12 03:03:31 +00:00
Mike Spertus
d305913f05 Type correct Visual Studio native visualization for PointerUnions
Visualize pointer unions by their actual type rather than as void *.

llvm-svn: 263270
2016-03-11 18:26:47 +00:00
Nicolai Haehnle
8e5624582d [TableGen] more helpful error message in MapTableEmitter
Differential Revision: http://reviews.llvm.org/D17275

llvm-svn: 263148
2016-03-10 18:51:58 +00:00
Craig Topper
6445e0ecee [CodeGen] Add space-optimized EmitMergeInputChains1_2 to the DAG isel matching tables. Shaves about 5100 bytes from the X86 matcher table. NFC
llvm-svn: 262815
2016-03-07 07:29:12 +00:00
Matthias Braun
0e6311347c TableGen: Accept itinerary data when checking for schedmodel completeness
llvm-svn: 262548
2016-03-03 00:04:59 +00:00
Matthias Braun
6a33ae7aae TableGen: Display helpfull message for incomplete models.
llvm-svn: 262399
2016-03-01 21:36:12 +00:00
Matthias Braun
6958800987 TableGen: Check scheduling models for completeness
TableGen checks at compiletime that for scheduling models with
"CompleteModel = 1" one of the following holds:

- Is marked with the hasNoSchedulingInfo flag
- The instruction is a subclass of Sched
- There are InstRW definitions in the scheduling model

Typical steps necessary to complete a model:

- Ensure all pseudo instructions that are expanded before machine
  scheduling (usually everything handled with EmitYYY() functions in
  XXXTargetLowering).
- If a CPU does not support some instructions mark the corresponding
  resource unsupported: "WriteRes<WriteXXX, []> { let Unsupported = 1; }".
- Add missing scheduling information.

Differential Revision: http://reviews.llvm.org/D17747

llvm-svn: 262384
2016-03-01 20:03:21 +00:00
Matthias Braun
c86310f545 TableGen: Add hasNoSchedulingInfo to instructions
This introduces a new flag that indicates that a specific instruction
will never be present when the MachineScheduler runs and therefore needs
no scheduling information.

This is in preparation for an upcoming commit which checks completeness
of a scheduling model when tablegen runs.

Differential Revision: http://reviews.llvm.org/D17728

llvm-svn: 262383
2016-03-01 20:03:11 +00:00
Nikolay Haustov
b8a1824976 [TableGen] AsmMatcher: Skip optional operands in the midle of instruction if it is not present
Previosy, if actual instruction have one of optional operands then other optional operands listed before this also should be presented.
For example instruction v_fract_f32 v0, v1, mul:2 have one optional operand - OMod and do not have optional operand clamp. Previously this was not allowed because clamp is listed before omod in AsmString:

string AsmString = "v_fract_f32$vdst, $src0_modifiers$clamp$omod";
Making this work required some hacks (both OMod and Clamp match classes have same PredicateMethod).

Now, if MatchInstructionImpl meets formal optional operand that is not presented in actual instruction it skips this formal operand and tries to match current actual operand with next formal.

Patch by: Sam Kolton

Review: http://reviews.llvm.org/D17568

[AMDGPU] Assembler: Check immediate types for several optional operands in predicate methods
With this change you should place optional operands in order specified by asm string:

clamp -> omod
offset -> glc -> slc -> tfe
Fixes for several tests.
Depends on D17568

Patch by: Sam Kolton

Review: http://reviews.llvm.org/D17644
llvm-svn: 262314
2016-03-01 08:34:43 +00:00
Paul Robinson
7abc61f023 Reapply r262092: [FileCheck] Abort if -NOT is combined with another suffix.
Combinations of suffixes that look useful are actually ignored;
complaining about them will avoid mistakes.

Differential Revision: http://reviews.llvm.org/D17587

llvm-svn: 262263
2016-02-29 22:13:03 +00:00
Daniel Sanders
59b96b55ef [test-release.sh] Add lldb to list of projects (disabled by default)
Reviewers: hans

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17070

llvm-svn: 262211
2016-02-29 11:04:39 +00:00
Paul Robinson
c1ad81589f Revert r262092, caught LLD tests
llvm-svn: 262093
2016-02-26 23:44:10 +00:00
Paul Robinson
38a2b48139 [FileCheck] Abort if -NOT is combined with another suffix.
Combinations of suffixes that look useful actually are ignored;
complaining about them will avoid mistakes.

Differential Revision: http://reviews.llvm.org/D17587

llvm-svn: 262092
2016-02-26 23:34:02 +00:00
Igor Breger
c2763588ac AVX512F: Add GATHER/SCATTER assembler Intel syntax tests for knl/skx/avx . Change memory operand parser handling.
Differential Revision: http://reviews.llvm.org/D17564

llvm-svn: 261862
2016-02-25 13:30:17 +00:00
Xinliang David Li
e8ec116138 Fix comment
llvm-svn: 261672
2016-02-23 19:18:21 +00:00
Craig Topper
a56cc6b159 [X86] Remove some unused encoding checks from the disassembler table building.
llvm-svn: 261418
2016-02-20 06:20:21 +00:00
Craig Topper
be811f1963 [TableGen,X86] Add NDEBUG check to a variable initialization that's only used by asserts. NFC
llvm-svn: 261188
2016-02-18 04:54:32 +00:00
Craig Topper
22068b945c [TableGen,X86] Remove extra optional operand from RawFrm. RawFrm with 2 immediates is handled by RawFrmImm8/RawFrmImm16.
llvm-svn: 261187
2016-02-18 04:54:29 +00:00
Craig Topper
aecb941958 [TableGen] Fix inconsistent spacing. NFC
llvm-svn: 260935
2016-02-16 04:24:58 +00:00
Craig Topper
2b0d5c16e2 [TableGen] Stop passing by reference an integer that doesn't get modified. NFC
llvm-svn: 260934
2016-02-16 04:24:56 +00:00
Craig Topper
f2bd418b92 [TableGen] Remove unused member variable. NFC
llvm-svn: 260933
2016-02-16 04:24:54 +00:00
Craig Topper
eb51671647 [TableGen] Use range-based for loop. NFC
llvm-svn: 260928
2016-02-16 02:48:30 +00:00
Craig Topper
57d60e7e70 [TableGen] Remove constant string argument from a method that's only called once. We can just hardcode the string inside. There already other things that make the method not reusable. NFC
llvm-svn: 260840
2016-02-14 05:22:01 +00:00
Craig Topper
9430c4414c [TableGen] Fix comment about 64-bit type I missed when I removed the underlying type in r260808.
llvm-svn: 260830
2016-02-13 17:58:14 +00:00
Craig Topper
b9483bdc4b [TableGen] Use range-based for loops. NFC
llvm-svn: 260809
2016-02-13 06:03:32 +00:00
Craig Topper
149f7e2025 No need to make the subtarget feature bit enum a uint64_t. This was a leftover from when the feature bit enum contained masks instead of bit indices.
llvm-svn: 260808
2016-02-13 06:03:29 +00:00
Andrew Wilkins
fb2090fa73 Avoid linking LLVM component libraries with libLLVM
Patch by Jack Howarth.

When linking to libLLVM, don't also link to the component
libraries that constitute libLLVM.

Differential Revision: http://reviews.llvm.org/D16945

llvm-svn: 260641
2016-02-12 01:42:43 +00:00
James Y Knight
5460ff3ee3 Add -match-full-lines argument to FileCheck.
This is useful for some tests where more-exact matching is useful, such
as clang's Preprocessor tests.

llvm-svn: 260540
2016-02-11 16:46:09 +00:00
Craig Topper
afb65fa73d [TableGen] Use range-based for loops. NFC
llvm-svn: 260502
2016-02-11 07:39:29 +00:00
Craig Topper
6f4a255e72 [TableGen] Don't call emitSourceFileHeader a second time in the middle of the output file.
llvm-svn: 260501
2016-02-11 07:39:27 +00:00
Craig Topper
5012d80ee2 [TableGen] Whitespace cleanup in output file. NFC
llvm-svn: 260500
2016-02-11 07:39:25 +00:00
Craig Topper
2857d5c70c [TableGen] Simplify code slightly. NFC
llvm-svn: 260499
2016-02-11 07:39:22 +00:00
Matt Arsenault
d5880e4c88 SelectionDAG: Make Properties a field of SDPatternOperator
Currently you can't specify node properties like commutativity on
a PatFrag. If you want to create a PatFrag on a commutative node
with a hasOneUse predicate, this enables you to specify that the
PatFrag is also commutable.

llvm-svn: 260404
2016-02-10 18:40:04 +00:00
Ehsan Akhgari
48aefced4b llvm-config: Add preliminary Windows support
Summary:
This patch adds Windows support for a few of the llvm-config commands,
including cflags, ldflags, libs, and system-libs.

Currently llvm-config is untested, so this patch adds tests for the
commands that it fixes as well.

Reviewers: rnk

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D16762

llvm-svn: 260263
2016-02-09 19:41:14 +00:00
Tom Stellard
5bd77b3a86 TableGen: Add IsOptional field to AsmOperandClass
Summary:
This makes it possible to specify some operands as optional to the AsmMatcher.
Setting this field to true will prevent the AsmMatcher from emitting
'too few operands' errors when there are missing optional operands.

Reviewers: olista01, ab

Subscribers: nhaustov, arsenm, llvm-commits

Differential Revision: http://reviews.llvm.org/D15755

llvm-svn: 259913
2016-02-05 19:59:33 +00:00
Benjamin Kramer
57b36f1497 The canonical way to XFAIL a test for all targets is XFAIL: *, not XFAIL:
Fix the lit bug that enabled this "feature" (empty triple is substring
of all possible target triples) and change the two outliers to use the
documented * syntax.

llvm-svn: 259799
2016-02-04 16:21:38 +00:00
David L Kreitzer
2e3401f7b1 Unify the target opcode enum in TargetOpcodes.h and the FixedInstrs array in
CodeGenTarget.cpp to avoid the ordering dependence. NFCI.

Differential Revision: http://reviews.llvm.org/D16826

llvm-svn: 259726
2016-02-03 23:17:32 +00:00
Reid Kleckner
0262ca1fce Minor performance tweaks to llvm-tblgen (and a few that might be a good idea)
Summary:
This patch adds a reserve call to an expensive function
(`llvm::LoadIntrinsics`), and may fix a few other low hanging
performance fruit (I've put them in comments for now, so we can
discuss).

**Motivation:**

As I'm sure other developers do, when I build LLVM, I build the entire
project with the same config (`Debug`, `MinSizeRel`, `Release`, or
`RelWithDebInfo`). However, the `Debug` config also builds llvm-tblgen
in `Debug` mode. Later build steps that run llvm-tblgen then can
actually be the slowest steps in the entire build. Nobody likes slow
builds.

Reviewers: rnk, dblaikie

Differential Revision: http://reviews.llvm.org/D16832

Patch by Alexander G. Riccio

llvm-svn: 259683
2016-02-03 19:34:28 +00:00
Dylan McKay
f1723e8dcf [TableGen] Add 'register alternative name matching' support
Summary:
This adds a new attribute which targets can set in TableGen which causes a function to be generated which matches register alternative names. This is very similar to `ShouldEmitMatchRegisterName`, except it works on alt names.

This patch is currently used by the out of tree part of the AVR backend. It reduces code duplication greatly, and has the effect that you do not need to hardcode altname to register mappings in C++.

It will not work on targets which have registers which share the same aliases.

Reviewers: stoklund, arsenm, dsanders, hfinkel, vkalintiris

Subscribers: hfinkel, dylanmckay, llvm-commits

Differential Revision: http://reviews.llvm.org/D16312

llvm-svn: 259636
2016-02-03 10:30:16 +00:00
Justin Bogner
6b317c6aeb Remove utils/buildit
The autoconf build system was removed - this doesn't even work and
doesn't need to be here.

llvm-svn: 259582
2016-02-02 21:56:16 +00:00
Eugene Zelenko
0ebce618ad Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D16793

llvm-svn: 259539
2016-02-02 18:20:45 +00:00
Craig Topper
2f7fb265dd [TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead of accidentally copying to a vector.
llvm-svn: 259336
2016-02-01 01:33:42 +00:00
Craig Topper
755daee3dd No need to use utostr/utohexstr when writing into a raw_ostream. NFC
llvm-svn: 259314
2016-01-31 01:55:15 +00:00
Daniel Sanders
2d315c5b48 Bring back the test-suite export in test-release without bringing back the build failures.
Summary:
r257791 disabled the test-suite export since the addition of CMakeLists.txt was
causing build failures. This patch exports the test-suite again but does so
outside the source tree so that it isn't included in the Phase[123] builds.

Reviewers: hans

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D16679

llvm-svn: 259094
2016-01-28 21:09:50 +00:00
Simon Pilgrim
44ce6641ce [utils] Add windows support to update_llc_test_checks.py
Strip dos line endings from llc generated files to allow the regex patterns to match them.

Ensure updated *.ll files are generated with unix style line endings.

llvm-svn: 258987
2016-01-27 21:13:18 +00:00
Yunzhong Gao
789ee55590 Add "/dev/tty" as a special file name for lit tests.
If a lit test has a RUN line that includes a redirection to "/dev/tty", the
redirection goes to the special device file corresponding to the console. It
is /dev/tty on UNIX-like systems and "CON" on Windows.

This patch is needed to implement a test like PR25717 (caused by the size limit
of the Windows system call WriteConsole() prior to Windows 8) where the test
only breaks when outputing to the console and won't fail if using a pipe.

llvm-svn: 258898
2016-01-27 01:48:20 +00:00
Reid Kleckner
822ed5c846 [llvm-tblgen] Avoid StringMatcher for GCC and MS builtin names
This brings the compile time of Function.cpp from ~40s down to ~4s for
me locally. It also shaves off about 400KB of object file size in a
release+asserts build.

I also realized that the AMDGPU backend does not have any GCC builtin
names to match, so the extra lookup was a no-op. I removed it to silence
a zero-length string table array warning. There should be no functional
change here.

This change really ends the story of PR11951.

llvm-svn: 258897
2016-01-27 01:43:12 +00:00
Hans Wennborg
5c299ae400 test-release.sh: Ignore LC_CTYPE in sed invocation on Darwin
Here, sed is used to prepare object files for comparison via cmp. On my Darwin
15.4.0 machine, LC_CTYPE is set to UTF-8 (by default, I believe). Under these
circumstances, anything sed is made to read will be treated as UTF-8, prompting
it to signal an error if it is not, like so:

% sed s/a/b/ <(head -n1 /dev/random) >/dev/null; echo $?
sed: RE error: illegal byte sequence
1
%

To make sed work as expected, I need to set LC_CTYPE to C:

% env LC_CTYPE=C sed s/a/b/ <(head -n1 /dev/random) >/dev/null; echo $?
0
%

Without this change, sed will exit with an error for every single file that it
compares between phase 2 and phase 3, thereby making it look as if the
differences were far larger than they are.

Patch by Elias Pipping!

Differential Revision: http://reviews.llvm.org/D16548

llvm-svn: 258891
2016-01-27 00:19:05 +00:00
Reid Kleckner
50e0e30317 [llvm-tblgen] Stop emitting the intrinsic name matching code
The AMDGPU backend was the last user of the old StringMatcher
recognition code. Move it over to the new lookupLLVMIntrinsicName
funciton, which is now improved to handle all of the interesting edge
cases exposed by AMDGPU intrinsic names.

llvm-svn: 258875
2016-01-26 23:01:21 +00:00
Chris Bieneman
1b8d4f74aa Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

"I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened."
- Obi Wan Kenobi

Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark

Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D16471

llvm-svn: 258861
2016-01-26 21:29:08 +00:00
Eugene Zelenko
966902f532 Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568

llvm-svn: 258831
2016-01-26 18:48:36 +00:00
Reid Kleckner
b834dd994c Sort intrinsics by LLVM intrinsic name, rather than tablegen def name
Step one towards using a simple binary search to lookup intrinsic IDs
instead of our crazy table generated switch+memcmp+startswith code that
makes Function.cpp take about a minute to compile.  See PR24785 and
PR11951 for why we should do this.

The X86 backend contains tables that need to be sorted on intrinsic ID,
so reorder those.

llvm-svn: 258757
2016-01-26 00:55:00 +00:00
Oliver Stannard
4ff6a9f924 [TableGen] Fix sort order of asm operand classes
This is a fix for https://llvm.org/bugs/show_bug.cgi?id=22796.

The previous implementation of ClassInfo::operator< allowed cycles of classes
such that x < y < z < x, meaning that a list of them cannot be correctly
sorted, and the sort order could differ with different standard libraries.

The original implementation sorted classes by ValueName if they were otherwise
equal. This isn't strictly necessary, but some backends seem to accidentally
rely on it. If I reverse this comparison I get 8 test failures spread across
the AArch64, Mips and X86 backends, so I have left it in until those backends
can be fixed.

There was one case in the X86 backend where the observable behaviour of the
assembler is changed by this patch. This was because some of the memory asm
operands were not marked as children of X86MemAsmOperand.

Differential Revision: http://reviews.llvm.org/D16141

llvm-svn: 258677
2016-01-25 10:20:19 +00:00
Craig Topper
eb67a46511 [TableGen] In AsmWriterEmitter unique command search, rather than storing a mapping from instruction to unique command, instead store a list of which instructions each unique command corresponds to.
This simplifies the complexity of the code that tries to find further operands to merge into the unique command.

llvm-svn: 258656
2016-01-24 07:13:28 +00:00
Craig Topper
33bd74d06d [TableGen] Make a class member local to the function that populates it and consumes it later. NFC
llvm-svn: 258490
2016-01-22 05:59:43 +00:00
Craig Topper
22c150cc79 [TableGen] Reorder fields in AsmWriterOperand to remove padding and reduce size. NFC
llvm-svn: 258489
2016-01-22 05:59:40 +00:00
Craig Topper
fc34e453b1 [TableGen] Remove the CGIOpNo from AsmWriterOperand as its not used for anything. NFC
llvm-svn: 258488
2016-01-22 05:59:37 +00:00
Dimitry Andric
9df4ee3b2a In test-release.sh, only run uname -s once. NFC.
llvm-svn: 258439
2016-01-21 22:07:17 +00:00
Dimitry Andric
f7c9b6312a Let test-release.sh checkout subprojects directly into the target tree,
instead of using symlinks

Summary:
In the past I have run into several problems with the way
`test-release.sh` creates all the subproject directories as siblings,
and then uses symlinks to stitch them all together.  In some scenarios
this leads to clang not being able to find header files, etc.

This patch changes the script so it directly exports into the correct
target locations for each subproject.

Reviewers: hans

Subscribers: emaste, llvm-commits

Differential Revision: http://reviews.llvm.org/D16420

llvm-svn: 258436
2016-01-21 21:57:49 +00:00
Quentin Colombet
acf8746c63 [GlobalISel] Add a generic machine opcode for ADD.
The selection process being split into separate passes, we need generic opcodes
to translate the LLVM IR to target independent code.

This patch adds an opcode for addition: G_ADD.

Differential Revision: http://reviews.llvm.org/D15472

llvm-svn: 258333
2016-01-20 19:14:55 +00:00
Nico Weber
3f7b353711 Fix undefined behavior in llvm's local changes to googletest.
r100895 landed an llvm-only change to add minix support to googletest.
It did that by putting "defined()" in a macro, which has undefined
behavior.  Slightly reshuffle things to remove that undefined behavior.
Also mention in README.LLVM that minix support is a local change.

llvm-svn: 258190
2016-01-19 21:22:36 +00:00
Hans Wennborg
f92fdb084e test-release.sh: Use CMake also for Darwin
This didn't work for 3.7, but hopefully it should work now.

llvm-svn: 258168
2016-01-19 19:21:58 +00:00
Craig Topper
a5ac333af9 [TableGen] Merge the SuperClass Record and SMRange vector into a single vector. This removes the state needed to manage the extra vector thus reducing the size of the Record class. NFC
llvm-svn: 258065
2016-01-18 19:52:37 +00:00
Craig Topper
677a8c0da1 [TableGen] Keep a returned const reference instead of making a copy. NFC
llvm-svn: 258020
2016-01-17 20:38:21 +00:00
Craig Topper
6dbe9b8c99 [TableGen] Replace instructions() with getInstructionsByEnumValue(). No need to make an iterator_range when we already have a function that returns an ArrayRef. NFC
llvm-svn: 258019
2016-01-17 20:38:18 +00:00
Craig Topper
a7f2a9aef5 [TableGen] Return ArrayRef instead of a std::vector reference from getInstructionsByEnumValue(). NFC
llvm-svn: 258018
2016-01-17 20:38:14 +00:00
Craig Topper
f11bd508b4 [TableGen] Use std::find instead of a manual loop. NFC
llvm-svn: 258017
2016-01-17 19:51:14 +00:00
Craig Topper
dd4cad9576 [TableGen] Use a StringRef instead of creating a new std::string. It gets passed to a function that takes a StringRef anyway. NFC
llvm-svn: 258007
2016-01-17 08:47:02 +00:00
Craig Topper
b87a77e698 [TableGen] Changes to AsmWriterEmitter to remove the CodeGenInstruction to AsmWriterInst map. NFC
Adds the corresponding CodeGenInstruction number to each AsmWriterInst. Then write all the operand uniqueing loops using the AsmWriterInst array and indices. Then use the CodeGenInstruction index to fill out the OpCodeInfo array.

llvm-svn: 258005
2016-01-17 08:05:33 +00:00
Craig Topper
280927f594 [TableGen] Use std::find instead of a manual loop. NFC
llvm-svn: 258004
2016-01-17 08:05:30 +00:00
Dimitry Andric
89b23978ee Similar to rL257663, remove function keywords from export.sh and
tag.sh, since they are marked to be run with /bin/sh.

llvm-svn: 257994
2016-01-16 15:18:35 +00:00
Hans Wennborg
adee52f242 test-release.sh: Fix clang-tools-extra symlink for CMake build
The CMake and Autoconf builds want the symlink set up differently.

llvm-svn: 257905
2016-01-15 17:04:45 +00:00
Hans Wennborg
d2870a5f7c Exclude test-suite from CMake builds in test-release.sh
It's broken. In 3.7 there wasn't a CMake build for test-suite at all,
so we're not losing something we had before.

llvm-svn: 257791
2016-01-14 19:21:14 +00:00
Craig Topper
6fce6b2142 [TableGen] Pass PassSubtarget flag into getCode instead of storing a copy of the flag in every AsmWriterOperand. NFC
llvm-svn: 257743
2016-01-14 06:15:07 +00:00
Dimitry Andric
e5c8a68798 Remove bashism from merge.sh: POSIX sh does not have the function
reserved word, and it is even superfluous in bash, for this particular
instance.

llvm-svn: 257663
2016-01-13 19:48:50 +00:00
Hans Wennborg
63448e6292 Update version to 3.9.
llvm-svn: 257627
2016-01-13 17:32:32 +00:00
Dan Liew
edaf748ab2 [lit] Fix handling of per test timeout when the installed psutil version
is < ``2.0``.

Older versions of psutil (e.g. ``1.2.1`` which is the version shipped with
Ubuntu 14.04) use a different API for retrieving the child processes.
To handle this try the new API first and if that fails try the old API.

llvm-svn: 257616
2016-01-13 16:43:49 +00:00
Craig Topper
72d3a28a1d [TableGen] Cleanup output formatting and add llvm_unreachables to the output the AsmMatcher uses when it overflows the 64-bit tables. No in tree targets use this code, but I tested it with an temporarily reduced table width.
llvm-svn: 257583
2016-01-13 07:20:13 +00:00
Craig Topper
c0e6293345 [TableGen] Replace some hardcoded assumptions that the OpcodeInfo table is 64-bits for cleanliness. NFC
llvm-svn: 257582
2016-01-13 07:20:12 +00:00
Craig Topper
119171b36d [TableGen] Use std::remove_if instead of an n^2 loop. NFC
llvm-svn: 257581
2016-01-13 07:20:10 +00:00
Craig Topper
b458db6a4a [TableGen] Fix up some stale comments in the AsmMatcher. NFC
llvm-svn: 257580
2016-01-13 07:20:07 +00:00
Craig Topper
68c1fda7f5 [TableGen] Move calls to getValueAsInt out of a loop since they aren't simple functions. NFC
llvm-svn: 257579
2016-01-13 07:20:05 +00:00
Craig Topper
8bf4b9d67a [TableGen] Allow asm writer to use up to 3 OpInfo tables instead of 2. This allows x86 to use 56 total bits made up of a 32-bit, 16-bit, and 8-bit table. Previously we were using 64 total bits.
This saves 14K from the x86 table size. And saves space on other targets as well.

llvm-svn: 257315
2016-01-11 05:13:41 +00:00
Craig Topper
ca1a569d9e [TableGen] Remove unnecessary 0 terminator from an array that only existed to prevent ending an array with a comma. But that's perfectly legal and not something we need to prevent. NFC
llvm-svn: 257314
2016-01-11 05:13:38 +00:00
Craig Topper
e9d3c73857 [TableGen] Remove a few spaces from AsmMatcher output. NFC
llvm-svn: 257308
2016-01-11 02:11:36 +00:00
Dan Liew
277612653e Revert "Teach the CMake build system to run lit's test suite. These can be run"
This reverts r257221.

This caused several build bot failures

* It looks like some of the tests don't work correctly under Windows
* It looks like the lit per test timeout tests fail

So I'm reverting for now. Once the above failures are fixed running
lit's tests can be enabled again.

llvm-svn: 257268
2016-01-09 21:42:57 +00:00
Dan Liew
c14975ef62 Teach the CMake build system to run lit's test suite. These can be run
directy with ``make check-lit`` and are run as part of
``make check-all``.

In principle we should run lit's testsuite before testing LLVM using lit
so that any problems with lit get discovered before testing LLVM so we
can bail out early.  However this implementation (``check-all`` runs all
tests together) seemed simpler and will still report failing lit tests.

Note that the tests and the configured ``lit.site.cfg`` have to be
copied into the build directory to avoid polluting the source tree.

llvm-svn: 257221
2016-01-08 22:36:22 +00:00
Craig Topper
7f328191b4 [TableGen] Use range-based for loops. Also fix one loop to not use some index name as an outer loop. NFC
llvm-svn: 257156
2016-01-08 07:06:32 +00:00
Craig Topper
baeeeaf501 [TableGen] Combine variable declaration and initialization. Move a string into a vector instead of copying. NFC
llvm-svn: 257155
2016-01-08 07:06:29 +00:00
Michael Liao
6b8e21c1bb Modernize to range-based loop
llvm-svn: 257037
2016-01-07 07:58:25 +00:00
Craig Topper
f9081a5564 [TableGen] Call llvm_shutdown on exit so that all the ManagedStatic objects in the support library will be deleted.
llvm-svn: 256732
2016-01-04 04:51:51 +00:00
Craig Topper
3edc30259c [TableGen] Simplify some code slightly. No need to check if the arrays are empty before printing. The loop can be made to print the same thing if the loop is empty. NFC
llvm-svn: 256703
2016-01-03 08:57:41 +00:00
Craig Topper
3e1b28d6ad [TableGen] Replace a logically negated xor of bools with just an equality comparison for readability. NFC
llvm-svn: 256699
2016-01-03 07:33:39 +00:00
Craig Topper
67e81b4a5c [TableGen] Use std::find_if and a lambda instead of manual loops.
llvm-svn: 256698
2016-01-03 07:33:36 +00:00
Craig Topper
e018b0667f [TableGen] Fix a bug introduced in r256627. If the switch was not emitted we still emitted a closing curly brace.
llvm-svn: 256697
2016-01-03 07:33:34 +00:00
Craig Topper
e0da2d5327 [TableGen] Use range-based for loops. NFC
llvm-svn: 256696
2016-01-03 07:33:30 +00:00
Craig Topper
efc9b3c5bb [TableGen] Modify the AsmMatcherEmitter to only apply the table growth from r252440 to the Hexagon target.
This restores the previous behavior of not including the mnemonic in the classes table for every target that starts instruction lines with the mnemonic. Not only did the table size increase by 1 entry, but the class enum increased in size which caused every class in the array to increase in size. It also grew the size of the function that parsers tokens into classes by a substantial amount.

This adds a new HasMnemonicFirst flag to all AsmParsers. It's set to 1 by default and Hexagon target overrides it to 0.

For the X86 target alone this recovers 324KB of size on the llvm-mc executable.

I believe the current state is still a bad design choice for the Hexagon target as it causes most of the parsing to do a linear search through the entire match table to comparing operands against every instruction until it finds one that works. At least for the other targets we do a binary search based on mnemonic over which to do the linear scan.

llvm-svn: 256669
2015-12-31 08:18:23 +00:00
Craig Topper
38bce76cbc [TableGen] Use range-based for loops. NFC
llvm-svn: 256668
2015-12-31 08:18:20 +00:00
Craig Topper
4ee6871a85 [TableGen] Move determination of IsIsolatedToken into the tokenizer instead of trying to search characters around the token. No functional change intended. Verified for in-tree targets.
llvm-svn: 256660
2015-12-31 05:01:45 +00:00
Craig Topper
a7067f89ea [TableGen] Remove unnecessary conversion from StringRef to std::string when outputting to a raw_ostream. NFC
llvm-svn: 256628
2015-12-30 06:00:24 +00:00
Craig Topper
578ed69983 [TableGen] Remove raw_string_ostream by just emitting the header for the switch the first time we emit a case. If the header was never emitted just print the default at the end. NFC
llvm-svn: 256627
2015-12-30 06:00:22 +00:00
Craig Topper
9fc5d25288 [TableGen] Use range-based for loops. NFC
llvm-svn: 256626
2015-12-30 06:00:20 +00:00
Craig Topper
260b1e68a7 [TableGen] Move more things that come from variant into the AsmVariantInfo class so we can reduce some parameters. NFC
llvm-svn: 256625
2015-12-30 06:00:18 +00:00
Craig Topper
945583a0a4 [TableGen] Use 'size_t' instead of 'unsigned' to better match the argument types of addAsmOperand. Simplify some code by using StringRef::find instead of std::find. These were previously done in r247527 and r247528, but another commit seems to have erased them. NFC
llvm-svn: 256624
2015-12-30 06:00:15 +00:00
Craig Topper
098dcff300 De-virtualize mnemonicIsValid and remove from the base class. It's not called by any common code.
llvm-svn: 256544
2015-12-29 07:43:03 +00:00
Craig Topper
61bf0ec165 [TableGen] Add missing space to output.
llvm-svn: 256540
2015-12-29 07:03:25 +00:00
Craig Topper
546717a76c [TableGen] Use range-based for loops. NFC
llvm-svn: 256539
2015-12-29 07:03:23 +00:00
Manuel Jacob
82359bb5a3 [vim] Add token type to Vim syntax file.
llvm-svn: 256512
2015-12-28 19:51:04 +00:00
Dan Liew
d6419a3e16 [lit] Implement support of per test timeout in lit.
This should work with ShTest (executed externally or internally) and GTest
test formats.

To set the timeout a new option ``--timeout=`` has
been added which specifies the maximum run time of an individual test
in seconds. By default this 0 which causes no timeout to be enforced.

The timeout can also be set from a lit configuration file by modifying
the ``lit_config.maxIndividualTestTime`` property.

To implement a timeout we now require the psutil Python module if a
 timeout is requested. This dependency is confined to the newly added
 ``lit.util.killProcessAndChildren()``. A note has been added into the
 TODO document describing how we can remove the dependency on the
 ``pustil`` module in the future. It would be nice to remove this
 immediately but that is a lot more work and Daniel Dunbar believes it is
better that we get a working implementation first and then improve it.

To avoid breaking the existing behaviour the psutil module will not be
imported if no timeout is requested.

The included testcases are derived from test cases provided by
 Jonathan Roelofs which were in an previous attempt to add a per test
 timeout to lit (http://reviews.llvm.org/D6584). Thanks Jonathan!

Reviewers: ddunbar, jroelofs, cmatthews, MatzeB

Subscribers: cmatthews, llvm-commits

Differential Revision: http://reviews.llvm.org/D14706

llvm-svn: 256471
2015-12-27 14:03:49 +00:00
Asaf Badouh
593a27ca5c [X86][PKU] Add {RD,WR}PKRU encoding
Differential Revision: http://reviews.llvm.org/D15711

llvm-svn: 256366
2015-12-24 08:25:00 +00:00
Akira Hatanaka
6a7dbf68a2 Provide a way to specify inliner's attribute compatibility and merging.
This reapplies r256277 with two changes:

- In emitFnAttrCompatCheck, change FuncName's type to std::string to fix
  a use-after-free bug.
- Remove an unnecessary install-local target in lib/IR/Makefile. 

Original commit message for r252949:

Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465

llvm-svn: 256304
2015-12-22 23:57:37 +00:00
Dan Gohman
922f754559 Add an OperandNamespace field to Target.td's Operand.
For targets to add their own operand types as needed, as advertised in
Operand's comment, they need to be able to specify an alternate namespace
for OperandType names too. This matches the RegisterOperand class.

llvm-svn: 256299
2015-12-22 23:37:37 +00:00
Nico Weber
569bc5db3e lit: Limit number of processes on Windows to 32.
llvm-svn: 256291
2015-12-22 23:12:00 +00:00
Akira Hatanaka
dfd76e927a Revert r256277 and r256279.
Some of the bots failed again.

llvm-svn: 256280
2015-12-22 20:29:09 +00:00
Akira Hatanaka
fa235f0243 Provide a way to specify inliner's attribute compatibility and merging.
This reapplies r252990 and r252949. I've added member function getKind
to the Attr classes which returns the enum or string of the attribute.

Original commit message for r252949:

Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465

llvm-svn: 256277
2015-12-22 20:00:05 +00:00
Chih-Hung Hsieh
bd51d0c9b1 [X86] Part 2 to fix x86-64 fp128 calling convention.
Part 1 was submitted in http://reviews.llvm.org/D15134.
Changes in this part:
* X86RegisterInfo.td, X86RecognizableInstr.cpp: Add FR128 register class.
* X86CallingConv.td: Pass f128 values in XMM registers or on stack.
* X86InstrCompiler.td, X86InstrInfo.td, X86InstrSSE.td:
  Add instruction selection patterns for f128.
* X86ISelLowering.cpp:
  When target has MMX registers, configure MVT::f128 in FR128RegClass,
  with TypeSoftenFloat action, and custom actions for some opcodes.
  Add missed cases of MVT::f128 in places that handle f32, f64, or vector types.
  Add TODO comment to support f128 type in inline assembly code.
* SelectionDAGBuilder.cpp:
  Fix infinite loop when f128 type can have
  VT == TLI.getTypeToTransformTo(Ctx, VT).
* Add unit tests for x86-64 fp128 type.

Differential Revision: http://reviews.llvm.org/D11438

llvm-svn: 255558
2015-12-14 22:08:36 +00:00
Ben Craig
070547c587 Reordering fields to reduce padding in LLVM. NFC
llvm-svn: 255554
2015-12-14 21:57:05 +00:00
Hal Finkel
94fa3b65bf [TableGen] Correct Namespace lookup with AltNames in AsmWriterEmitter
AsmWriterEmitter will generate a getRegisterName function with an alternate
register name index as its second argument if the target makes use of them. The
enum of these values is generated in RegisterInfoEmitter. The getRegisterName
generator would assume the namespace could always be found by reading index 1
of the list of AltNameIndices, but this will fail if this list is sorted such
that the NoRegAltName is at index 1. Because this list is sorted by record name
(in CodeGenTarget::ReadRegAltNameIndices), you only run in to problems if your
MyTargetRegisterInfo.td defines a single RegAltNameIndex that sorts lexically
before NoRegAltName.

For example, if a target has something like

  def AnAltNameIndex : RegAltNameIndex

and defines RegAltNameIndices for some registers then, prior to this change,
AsmWriterEmitter would generate references to

  ::AnAltNameIndex and ::NoRegAltName

Patch by Alex Bradbury!

llvm-svn: 255344
2015-12-11 17:31:27 +00:00
Hans Wennborg
b179aaa5e1 Check in the script for building Win snapshots
llvm-svn: 255318
2015-12-11 00:43:42 +00:00
Alexey Bataev
f26d973dc0 [OPENMP] Make -fopenmp to turn on OpenMP support by default.
Patch turns on OpenMP support in clang by default after fixing OpenMP buildbots.
Differential Revision: http://reviews.llvm.org/D13802

llvm-svn: 255222
2015-12-10 05:45:58 +00:00
Craig Topper
55a007dfc9 Use make_range to reduce mentions of iterator type. NFC
llvm-svn: 254872
2015-12-06 05:08:07 +00:00
Craig Topper
bf1c629225 Replace uint16_t with the MCPhysReg typedef in many places. A lot of physical register arrays already use this typedef.
llvm-svn: 254843
2015-12-05 07:13:35 +00:00
Craig Topper
8d7404345a [TableGen] Remove an assumption about the order of encodings in the MVT::SimpleValueType enum. Instead of assuming the types are sorted by size, scan the typeset arrays to find the smallest/largest type. NFC
llvm-svn: 254589
2015-12-03 05:57:37 +00:00
Oliver Stannard
03049a3fcc [AArch64] Add ARMv8.2-A Statistical Profiling Extension
The Statistical Profiling Extension is an optional extension to
ARMv8.2-A. Since it is an optional extension, I have added the
FeatureSPE subtarget feature to control it. The assembler-visible parts
of this extension are the new "psb csync" instruction, which is
equivalent to "hint #17", and a number of system registers.

Differential Revision: http://reviews.llvm.org/D15021

llvm-svn: 254401
2015-12-01 10:48:51 +00:00
Craig Topper
3b1fed5c86 [TableGen] Use SmallString instead of std::string to build up a string to avoid heap allocations. NFC
llvm-svn: 254221
2015-11-28 08:23:02 +00:00
Craig Topper
9208a75ae2 [TableGen] Sort pattern predicates before concatenating into a string so that different orders of the same set will produce the same string. This can reduce the number of unique predicates in the isel tables. NFC
llvm-svn: 254192
2015-11-27 05:44:04 +00:00
Craig Topper
e404cbe233 [SelectionDAG] Add a SDTCisSameSizeAs type constraint that can be used to ensure vector widths match even if the element size and count don't.
llvm-svn: 254138
2015-11-26 07:02:18 +00:00
Craig Topper
5be4caf2ff [TableGen] Flip reversed comments.
llvm-svn: 254136
2015-11-26 06:30:40 +00:00
Krzysztof Parzyszek
ce2383b240 Add vector types for intrinsics
Author: Ron Lieberman <ronl@codeaurora.org>
llvm-svn: 253992
2015-11-24 16:28:14 +00:00
Krzysztof Parzyszek
9a91695856 Add names for the new vector types in CodeGenTarget.cpp
llvm-svn: 253989
2015-11-24 15:50:22 +00:00
Craig Topper
cb7feab115 [TableGen] Use std::remove_if instead of manually coded loops that call erase multiple times. NFC
llvm-svn: 253964
2015-11-24 08:20:47 +00:00
Craig Topper
b68a334495 [TableGen] Use the other version of EnforceVectorEltTypeIs inside the TypeSet version of EnforceVectorEltTypeIs to reduce duplicated code. NFC
llvm-svn: 253963
2015-11-24 08:20:45 +00:00
Craig Topper
2070f1ebe3 [TableGen] Fix formatting and use logical OR. NFC
llvm-svn: 253962
2015-11-24 08:20:44 +00:00
Craig Topper
0247a6313d [TableGen] Use std::set_intersection to merge TypeSets. NFC
llvm-svn: 253961
2015-11-24 08:20:42 +00:00
Craig Topper
c9d0ad15b8 [TableGen] Use SmallVector::assign instead of a resize and replace element.
llvm-svn: 253960
2015-11-24 08:20:41 +00:00
Craig Topper
2c11bd56d2 Revert change that accidentally snuck into r253955.
llvm-svn: 253956
2015-11-24 06:24:06 +00:00
Craig Topper
6988e2723a [TableGen] Use array_pod_sort. NFC
llvm-svn: 253955
2015-11-24 06:22:43 +00:00
James Y Knight
f0ca422f64 Make utils/update_llc_test_checks.py note that the assertions are
autogenerated.

Also update existing test cases which appear to be generated by it and
weren't modified (other than addition of the header) by rerunning it.

llvm-svn: 253917
2015-11-23 21:33:58 +00:00
Craig Topper
cf39e6d0b9 [TableGen] Use std::remove_if instead of manually coded loops that called erase inside them. NFC
llvm-svn: 253857
2015-11-23 07:19:10 +00:00
Craig Topper
5f3125e949 [TableGen] Use empty() instead of checking if size of vector is greater than or equal to 1.
llvm-svn: 253856
2015-11-23 07:19:08 +00:00
Craig Topper
a23aa1f5cf Revert a portion of r253836 that seems to have broke a couple bots.
llvm-svn: 253838
2015-11-22 22:43:40 +00:00
Craig Topper
8e76a28647 [TableGen] Use range-based for loops. NFC
llvm-svn: 253836
2015-11-22 20:46:24 +00:00
Craig Topper
97e6105938 [TableGen] Use std::fill instead of a manually coded loop. NFC
llvm-svn: 253835
2015-11-22 20:46:22 +00:00
David Blaikie
e34f67faf7 Further simplify from r253832 with some unique_ptr and coalescing conditions
llvm-svn: 253834
2015-11-22 20:11:21 +00:00
David Blaikie
44297e7f9b Further simplify from r253832, removing unnecessary intermediate lambdas
llvm-svn: 253833
2015-11-22 20:02:58 +00:00
Craig Topper
ad88d49779 [TableGen] Use std::any_of and std::find instead of manual loops. NFC
llvm-svn: 253832
2015-11-22 19:27:02 +00:00
Simon Pilgrim
6c4fdc447c [Utils] Updated shuffle fuzz script to generate more modern (valid) IR.
llvm-svn: 253821
2015-11-22 16:04:32 +00:00
Krzysztof Parzyszek
73d3ee06e8 Avoid dependency between TableGen and CodeGen
Duplicate a few common definitions between DFAPacketizer.cpp and
DFAPacketizerEmitter.cpp to avoid including files from CodeGen
in TableGen.

llvm-svn: 253820
2015-11-22 15:20:19 +00:00
Krzysztof Parzyszek
f1a4c62989 Now fix errors in NDEBUG build.
Hope this won't break any hardware next.

llvm-svn: 253799
2015-11-21 22:46:52 +00:00
Krzysztof Parzyszek
7310b18508 Fix warnings in NDEBUG build
llvm-svn: 253798
2015-11-21 22:19:50 +00:00
Krzysztof Parzyszek
3a2a5e0f60 Hexagon V60/HVX DFA scheduler support
Extended DFA tablegen to:
  - added "-debug-only dfa-emitter" support to llvm-tblgen

  - defined CVI_PIPE* resources for the V60 vector coprocessor

  - allow specification of multiple required resources
    - supports ANDs of ORs
    - e.g. [SLOT2, SLOT3], [CVI_MPY0, CVI_MPY1] means:
           (SLOT2 OR SLOT3) AND (CVI_MPY0 OR CVI_MPY1)

  - added support for combo resources
    - allows specifying ORs of ANDs
    - e.g. [CVI_XLSHF, CVI_MPY01] means:
           (CVI_XLANE AND CVI_SHIFT) OR (CVI_MPY0 AND CVI_MPY1)

  - increased DFA input size from 32-bit to 64-bit
    - allows for a maximum of 4 AND'ed terms of 16 resources

  - supported expressions now include:

    expression     => term [AND term] [AND term] [AND term]
    term           => resource [OR resource]*
    resource       => one_resource | combo_resource
    combo_resource => (one_resource [AND one_resource]*)

Author: Dan Palermo <dpalermo@codeaurora.org>

kparzysz: Verified AMDGPU codegen to be unchanged on all llc
tests, except those dealing with instruction encodings.

Reapply the previous patch, this time without circular dependencies.

llvm-svn: 253793
2015-11-21 20:00:45 +00:00
Krzysztof Parzyszek
daec852689 Revert r253790: it breaks all builds for some reason.
llvm-svn: 253791
2015-11-21 17:38:33 +00:00
Krzysztof Parzyszek
e1cf64ffc3 Hexagon V60/HVX DFA scheduler support
Extended DFA tablegen to:
  - added "-debug-only dfa-emitter" support to llvm-tblgen

  - defined CVI_PIPE* resources for the V60 vector coprocessor

  - allow specification of multiple required resources
    - supports ANDs of ORs
    - e.g. [SLOT2, SLOT3], [CVI_MPY0, CVI_MPY1] means:
           (SLOT2 OR SLOT3) AND (CVI_MPY0 OR CVI_MPY1)

  - added support for combo resources
    - allows specifying ORs of ANDs
    - e.g. [CVI_XLSHF, CVI_MPY01] means:
           (CVI_XLANE AND CVI_SHIFT) OR (CVI_MPY0 AND CVI_MPY1)

  - increased DFA input size from 32-bit to 64-bit
    - allows for a maximum of 4 AND'ed terms of 16 resources

  - supported expressions now include:

    expression     => term [AND term] [AND term] [AND term]
    term           => resource [OR resource]*
    resource       => one_resource | combo_resource
    combo_resource => (one_resource [AND one_resource]*)

Author: Dan Palermo <dpalermo@codeaurora.org>

kparzysz: Verified AMDGPU codegen to be unchanged on all llc
tests, except those dealing with instruction encodings.

llvm-svn: 253790
2015-11-21 17:23:52 +00:00
Dan Liew
db929f853a [lit] Fix bug when using Python3 where a failing test would not show
the script when running a ShTest with an external or internal shell.

This bug is caused by use of the ``map`` function in Python 3 which
returns an iterable (rather than a list in Python 2). After the iterable
is exhausted it won't return any more output and consequently when
``_runShTest()`` tries to access the ``script`` which has already been
iterated over it is empty. Converting to a list immediatley after
calling ``map()`` fixes this.

This fixes the ``tests/shtest-format.py`` test when running under
Python3 which was previously failing.

llvm-svn: 253556
2015-11-19 11:35:42 +00:00
Rafael Espindola
123f2ae05e Default SetVector to use a DenseSet.
We use to have an odd difference among MapVector and SetVector. The map
used a DenseMop, but the set used a SmallSet, which in turn uses a
std::set.

I have changed SetVector to use a DenseSet. If you were depending on the
old behaviour you can pass an explicit set type or use SmallSetVector.
The common cases for needing to do it are:

* Optimizing for small sets.
* Sets for types not supported by DenseSet.

llvm-svn: 253439
2015-11-18 06:52:18 +00:00
David Blaikie
6d88ef926e StringRef-ify some Option APIs
Patch by Eugene Kosov!

Differential Revision: http://reviews.llvm.org/D14711

llvm-svn: 253360
2015-11-17 19:00:52 +00:00
Matthias Braun
088a172bf6 Assume lane masks are always precise
Allowing imprecise lane masks in case of more than 32 sub register lanes
lead to some tricky corner cases, and I need another bugfix for another
one. Instead I rather declare lane masks as precise and let tablegen
abort if we do not have enough bits.

This does not affect any in-tree target, even AMDGPU only needs 16 lanes
at the moment. If the 32 lanes turn out to be a problem in the future,
then we can easily change the LaneBitmask typedef to uint64_t.

Differential Revision: http://reviews.llvm.org/D14557

llvm-svn: 253279
2015-11-17 00:50:55 +00:00
Akira Hatanaka
3093820c02 [MCTargetAsmParser] Move the member varialbes that reference
MCSubtargetInfo in the subclasses into MCTargetAsmParser and define a
member function getSTI.

This is done in preparation for making changes to shrink the size of
MCRelaxableFragment. (see http://reviews.llvm.org/D14346).

llvm-svn: 253124
2015-11-14 05:20:05 +00:00
Matthias Braun
164bc6fc2c tablegen: Add a simple heuristic to get better names for pressure sets
Differential Revision: http://reviews.llvm.org/D14597

llvm-svn: 253095
2015-11-13 22:30:27 +00:00
Dan Liew
0394d63797 [lit] Improve error message when lit fails to executable a command by
showing the executable it tried to use.

llvm-svn: 253032
2015-11-13 11:38:07 +00:00
Dan Liew
41d8464b41 [lit] Fix bug where `lit.util.which()` would return a directory
instead of executable if the argument was found inside a directory
contained in PATH.

An example where this could cause a problem is if there was a RUN line
that ran the ``test`` command and if the user had a directory in their
PATH that contained a directory called ``test/`` (that occured before
``/usr/bin/``). Lit would try to use the directory as the executable
which would fail with the rather cryptic message.

```
Could not create process due to [Errno 13] Permission denied
```

llvm-svn: 253031
2015-11-13 11:37:25 +00:00
Akira Hatanaka
a41bf2744e Revert r252990.
Some of the buildbots are still failing.

llvm-svn: 252999
2015-11-13 01:44:32 +00:00
Akira Hatanaka
5df31fbb8f Provide a way to specify inliner's attribute compatibility and merging.
This reapplies r252949. I've changed the type of FuncName to be
std::string instead of StringRef in emitFnAttrCompatCheck.

Original commit message for r252949:

Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465

llvm-svn: 252990
2015-11-13 01:23:11 +00:00
Akira Hatanaka
8642e85c17 Revert r252949.
It broke some of the bots including clang-x64-ninja-win7.

llvm-svn: 252951
2015-11-12 21:19:18 +00:00
Akira Hatanaka
ca7dc7a319 Provide a way to specify inliner's attribute compatibility and merging
rules using table-gen. NFC.

This commit adds new classes CompatRule and MergeRule to Attributes.td,
which are used to generate code to check attribute compatibility and
merge attributes of the caller and callee.

rdar://problem/19836465

llvm-svn: 252949
2015-11-12 20:59:43 +00:00
Akira Hatanaka
371384fd34 Move the enum attributes defined in Attributes.h to a table-gen file.
This is a step towards consolidating some of the information regarding
attributes in a single place.

This patch moves the enum attributes in Attributes.h to the table-gen
file. Additionally, it adds definitions of target independent string
attributes that will be used in follow-up commits by the inliner to
check attribute compatibility.

rdar://problem/19836465

llvm-svn: 252796
2015-11-11 20:35:42 +00:00
Matthias Braun
aa2b86a7c3 lit: Show all output with --show-all, even in combination with --succinct
I missed an earlier exit for the --succinct case when I introduced the
-a option.

llvm-svn: 252698
2015-11-11 03:03:54 +00:00
Matthias Braun
05ca020506 TableGen: Emit LaneMask for register classes without subregisters as ~0u
This makes it slightly easier to handle classes with and without
subregister uniformly.

llvm-svn: 252671
2015-11-10 23:23:05 +00:00
Colin LeMahieu
6d56088f23 [AsmParser] Generalize matching for grammars without mnemonic-lead statements
Differential Revision: http://reviews.llvm.org/D14257

llvm-svn: 252440
2015-11-09 00:46:46 +00:00
Colin LeMahieu
51dd820505 [AsmParser] Backends can parameterize ASM tokenization.
llvm-svn: 252439
2015-11-09 00:31:07 +00:00
Eugene Zelenko
7c062ccc18 Fix some Clang-tidy modernize warnings, other minor fixes.
Fixed warnings are: modernize-use-override, modernize-use-nullptr and modernize-redundant-void-arg.

Differential revision: http://reviews.llvm.org/D14312

llvm-svn: 252087
2015-11-04 22:32:32 +00:00
Matthias Braun
80fb3bb810 lit: Add '-a' option to display commands+output of all tests
The existing -v option only displays commands and outputs for failed
tests, the newly introduced -a displays it for all executed tests.

llvm-svn: 251806
2015-11-02 16:13:46 +00:00
Matthias Braun
0ae2b702f7 lit/TestRunner.py: Factor variable subsitution into an own function; NFCI
This is a clearer separation of concerns and makes it easier to reuse
the function.

llvm-svn: 251481
2015-10-28 02:36:45 +00:00
Matthias Braun
0dfea7241c lit/TestRunner.py: Factor out Substitution construction; NFC
This is a clearer separation of concerns and makes it easier to reuse
the functions.

llvm-svn: 251480
2015-10-28 02:36:42 +00:00
Matthias Braun
9f4c72c6f5 lit/TestRunner.py: Get execdir from test.getExecPath() instead of passing it around; NFC
llvm-svn: 251479
2015-10-28 02:36:38 +00:00
Matthias Braun
d9b899525f lit/TestRunner.py: Make parseIntegratedTestScriptCommands() keyword list a parameter; NFC
This allows the function to be easily reused and also simplifies the
code as the keyword list is next to the keyword handling now.

llvm-svn: 251478
2015-10-28 02:36:35 +00:00
Benjamin Kramer
1dc42e5dc7 [TblGen] ArrayRefize CodeGenSchedule. No functionality change intended.
llvm-svn: 251187
2015-10-24 12:46:49 +00:00
Igor Laevsky
cc1f4f3f3e [IntrinsicEmitter] Remove GET_INTRINSIC_MODREF_BEHAVIOR table
There is no need to generate separate table for intrinsics mod ref behaviour.
It can now be determined purely from function attributes.

Differential Revision: http://reviews.llvm.org/D13917

llvm-svn: 251040
2015-10-22 18:35:34 +00:00
NAKAMURA Takumi
05c9ec6d8e Lit: Rework r249161; Move RLIMIT_NPROC to main.py.
The message "raised the process limit..." prevented the progress bar.

llvm-svn: 250420
2015-10-15 15:37:13 +00:00
James Molloy
2ebbfcd5b1 [MISched] Python script to check coverage of misched info
This script prints a CSV of all misched models of a target when given the output of the debug output of subtarget using:

    llvm-tblgen --gen-subtarget --debug-only=subtarget-emitter ...

With thanks to Dave Estes for mentioning the idea at the 2014 LLVM Developers' Meeting.

Patch by Christof Douma!

llvm-svn: 250020
2015-10-12 08:50:47 +00:00
Craig Topper
df32bdfb27 [TableGen] Add a space between type and '*' in front of a variable name in output file. While there replace type with 'auto' since there's a cast on the right side of the assignment. NFC
llvm-svn: 249980
2015-10-11 16:59:29 +00:00
Hans Wennborg
7d1f4ff326 Fix Clang-tidy modernize-use-nullptr warnings in source directories and generated files; other minor cleanups.
Patch by Eugene Zelenko!

Differential Revision: http://reviews.llvm.org/D13321

llvm-svn: 249482
2015-10-06 23:24:35 +00:00
Hal Finkel
9a17051872 [lit] Raise the default soft process limit when possible
It is common to have a default soft process limit, at least on some families of
Linux distributions, of 1024. This is normally more than enough, but if you
have many cores, and you're running tests that create many threads, this can
become a problem. My POWER7 development machine has 48 cores, and when running
the lld regression tests, which often want to create up to 48 threads, I run
into problems. lit, by default, will want to run 48 tests in parallel, and
48*48 < 1024, and so many tests fail like this:

terminate called after throwing an instance of 'std::system_error'

what():  Resource temporarily unavailable
or lit fails like this when launching a test:

OSError: [Errno 11] Resource temporarily unavailable

lit can easily detect this situation and attempt to repair it before launching
tests (by raising the soft process limit to something that will allow ncpus^2
threads to be created), and should do so to prevent spurious test failures.

This is the follow-up to this thread:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/090942.html

llvm-svn: 249161
2015-10-02 17:50:28 +00:00
David Majnemer
a0b6521d43 [WinEH] Make FuncletLayout more robust against catchret
Catchret transfers control from a catch funclet to an earlier funclet.
However, it is not completely clear which funclet the catchret target is
part of.  Make this clear by stapling the catchret target's funclet
membership onto the CATCHRET SDAG node.

llvm-svn: 249052
2015-10-01 18:44:59 +00:00
Maksim Panchenko
cb20c21c8a HHVM calling conventions.
HHVM calling convention, hhvmcc, is used by HHVM JIT for
functions in translated cache. We currently support LLVM back end to
generate code for X86-64 and may support other architectures in the
future.

In HHVM calling convention any GP register could be used to pass and
return values, with the exception of R12 which is reserved for
thread-local area and is callee-saved. Other than R12, we always
pass RBX and RBP as args, which are our virtual machine's stack pointer
and frame pointer respectively.

When we enter translation cache via hhvmcc function, we expect
the stack to be aligned at 16 bytes, i.e. skewed by 8 bytes as opposed
to standard ABI alignment. This affects stack object alignment and stack
adjustments for function calls.

One extra calling convention, hhvm_ccc, is used to call C++ helpers from
HHVM's translation cache. It is almost identical to standard C calling
convention with an exception of first argument which is passed in RBP
(before we use RDI, RSI, etc.)

Differential Revision: http://reviews.llvm.org/D12681

llvm-svn: 248832
2015-09-29 22:09:16 +00:00
Matt Arsenault
ec8097dd1a TableGen: Add LLVM_READONLY to generated InstrMapping functions
These just read from a generated table.

llvm-svn: 248473
2015-09-24 07:51:20 +00:00
Craig Topper
f7207a96cc Remove extra 'nullptr' entry from an array in tablegen register info file. It should never have been accessed.
llvm-svn: 248246
2015-09-22 05:37:16 +00:00