Commit Graph

5840 Commits

Author SHA1 Message Date
Benjamin Kramer
36538ffe93 Apply most suggestions of clang-tidy's performance-unnecessary-value-param
Avoids unnecessary copies. All changes audited & pass tests with asan.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 19:09:22 +00:00
Daniel Dunbar
3a7c4849b7 [lit] Ensure we get bytes when reading redirected output files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 14:41:44 +00:00
Daniel Dunbar
8a560fc113 [lit] Ignore errors when decoding redirected output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272066 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 22:06:57 +00:00
Daniel Dunbar
311dd52c44 [lit] Fix an uninitialized var on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272052 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 20:14:17 +00:00
Daniel Dunbar
dc6c68ee03 [utils/lit] Show available_features with --show-suites.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272022 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 16:22:24 +00:00
Daniel Dunbar
89f76ce51d [lit] Improve logging with file redirection.
- This will cause lit to automatically include the first 1K of data in
   redirected output files when a command fails (previously if the command
   failed, but the main point of the test was, say, a `FileCheck` later on, then
   the log wasn't helpful in showing why the command failed).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 16:13:40 +00:00
Mike Spertus
0b28fbb3a5 Add Visual Studio Visualizer for ArrayRef
Modeled after visualization of llvm::SmallVec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271847 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-05 18:34:02 +00:00
Sjoerd Meijer
d02bd6484d AsmWriterEmitter.cpp assumes that all operands of a printed alias
will appear after a blank. This assumption does not hold in the ARM
target.

Patch by: Roger Ferrer Ibanez

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271666 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 13:17:37 +00:00
Sjoerd Meijer
6762cdb53a Currently AsmWriterEmiter.cpp (used by tblgen -gen-asm-writer) does not
consider the Predicates attached to InstAlias when generating printAliasInstr.
This forces users of printAliasInstr to check those predicates beforehand.

This commit adds them in the condition set of the IAPrinter object.

Patch by: Roger Ferrer Ibanez

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271665 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-03 13:14:19 +00:00
Daniel Dunbar
bf67aefcd0 [lit] Improve readability of failing scripts.
- This only applies to scripts executed by the _internal_ shell script
   interpreter.

 - This patch reworks the log to look more like a shell transcript, and be less
   verbose (but in the interest of calling attention to the important parts).

Here is an example of the new format, for commands with/without failures and
with/without output:
```
$ true
$ echo hi
hi

$ false
note: command had no output on stdout or stderr
error: command failed with exit status 1

```

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 23:49:42 +00:00
Daniel Dunbar
25aa67311c [lit] Factor out a helper for shell command results.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 23:32:35 +00:00
Eric Fiselier
960b5867c5 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 01:59:57 +00:00
Joerg Sonnenberger
645eab26ad Update usage(), make sure srcdir is really empty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271396 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 14:16:00 +00:00
David Blaikie
ed2188ea17 Reference gdb python type printer scripts from SmallString, SmallVector, ArrayRef, and StringRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-01 01:02:32 +00:00
Joerg Sonnenberger
d703145852 Make it easier to process merges in a normal buildable directory tree by
allowing the user to specify the base directory of the checkout.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-29 22:09:54 +00:00
Xinliang David Li
a5135a874c FileCheck: dump command line context with empty input
Differential Revision: http://reviews.llvm.org/D20716



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271047 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 21:23:25 +00:00
Benjamin Kramer
14aae01bc3 Apply clang-tidy's misc-move-constructor-init throughout LLVM.
No functionality change intended, maybe a tiny performance improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270997 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 14:27:24 +00:00
Benjamin Kramer
b397ac432d Avoid some copies by using const references.
clang-tidy's performance-unnecessary-copy-initialization with some manual
fixes. No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270988 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 12:30:51 +00:00
John Brawn
f653fb8714 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 11:16:43 +00:00
Matt Arsenault
2b7ac01da2 TableGen: Use StringRef instead of std::string
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270741 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 18:07:40 +00:00
Eugene Zelenko
d307f96d68 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-17 17:04:23 +00:00
Justin Bogner
182dac04e5 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269136 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-10 22:58:26 +00:00
Sam Kolton
f117ec1a64 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 11:31:17 +00:00
Craig Topper
886b4ecfe7 [TableGen] Fix a memory leak when creating SwitchOpcodeMatchers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 06:56:14 +00:00
Craig Topper
00b2aa2818 [TableGen] Remove isSafeToReorderWithPatternPredicate from DAGISelMatchers as its not used anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268711 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 06:21:27 +00:00
Craig Topper
4714294593 [TableGen] Remove getHash support from DAGISelMatcher. It hasn't been used for some time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268706 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 02:37:59 +00:00
Craig Topper
489f3e9ac6 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-06 02:37:56 +00:00
Justin Bogner
5f2e6ee2b7 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268692 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 22:37:45 +00:00
Chris Bieneman
6a6b44f90f 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268670 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 19:57:03 +00:00
James Y Knight
257fabb186 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268631 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 14:35:40 +00:00
Craig Topper
408b811d1e [TableGen] Make sure to recursively factor any ScopeMatchers created while forming a SwitchType node. Remove a couple hundred bytes from the X86 matcher table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268611 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 06:19:27 +00:00
Craig Topper
14b553012a [TableGen] Remove stale comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268610 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-05 06:19:25 +00:00
Hans Wennborg
6e9b03bb11 Win packaging script: include the OpenMP run-time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268398 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 16:43:40 +00:00
Craig Topper
8d0e28ce95 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-03 05:54:13 +00:00
Craig Topper
b5bf834f5d [CodeGen] Add OPC_MoveChild0-OPC_MoveChild7 opcodes to isel matching tables to optimize table size. Shaves about 12K off the X86 matcher table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-02 01:53:30 +00:00
Rui Ueyama
d5ebabfb3e [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@268168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-30 21:32:12 +00:00
Matthias Braun
baad40b586 TableGen: Produce CoveredBySubRegs summary for register classes
This will be used in the upcoming "DetectDeadLanes" pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:11 +00:00
Matthias Braun
89abe6466a TargetRegisterInfo: Introduce reverseComposeSubRegIndexLaneMask()
This function performs the reverse computation of
composeSubRegIndexLaneMask().

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:07 +00:00
Matthias Braun
3b74a145c8 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-28 03:07:04 +00:00
Zachary Turner
6efffd31d2 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267050 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 20:58:41 +00:00
Nicolai Haehnle
a7af0d6280 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-21 17:48:02 +00:00
Amaury Sechet
7b1322cacb 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266842 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-20 01:02:12 +00:00
Nicolai Haehnle
318d6a2351 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266826 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 21:58:33 +00:00
Nicolai Haehnle
39980d6882 [TableGen] Make an error message slightly more informative
Reviewers: ab, spop, stoklund

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 21:58:10 +00:00
Saleem Abdulrasool
decc22f16d vim: add swiftcc keyword
Update the syntax highlighting for SVN r265480.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-19 02:04:01 +00:00
Mehdi Amini
f6071e14c5 [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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266595 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-18 09:17:29 +00:00
Craig Topper
ca89139c6d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266562 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-17 17:37:33 +00:00
Richard Smith
43ef70d524 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-16 00:48:58 +00:00
Amaury Sechet
609cf3b89c Revert "Add LLVMGetAttrKindIDInContext in the C API in order to facilitate migration away from LLVMAttribute"
This reverts commit 0bcfd95c268bcb180a525e1837e84475df8acdc7.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-13 23:01:39 +00:00
Amaury Sechet
2af3e8f798 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-13 22:51:40 +00:00
JF Bastien
4734513b3a Delete mergefunctions.clang.svn.patch
The patch doesn't apply, and was removed from zorg by rL266094.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266112 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 19:44:40 +00:00
Junmo Park
dcd4d749c1 Minor code cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-12 06:02:11 +00:00
Saleem Abdulrasool
1ebdc6b129 vim: add missing keyword
`source_filename` was introduced as a keyword in SVN r264884, but the syntax
file was not updated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265572 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-06 17:42:16 +00:00
Sanjay Patel
3a27360c9d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 19:50:21 +00:00
Sanjay Patel
d8f98f3e4e add example usage and workflow to --help output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265430 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 18:00:47 +00:00
Sanjay Patel
4d9b8c9ce1 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265414 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 16:49:07 +00:00
Valery Pykhtin
89372a56d6 [TableGen] AsmMatcherEmitter.cpp: replace a sequence of "if" to "switch" in emitValidateOperandClass.
Differential Revision: http://reviews.llvm.org/D18394

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-05 16:18:16 +00:00
Matthias Braun
44f51d9b56 lit: python3 compatibility fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265070 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-31 23:08:55 +00:00
Daniel Dunbar
30a91fe472 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@265034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-31 18:22:55 +00:00
Mike Spertus
2a8d48af30 Submitted new file with wrong line endings. Correcting...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264620 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28 19:06:17 +00:00
Mike Spertus
b2c8f180f9 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)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264601 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-28 17:58:38 +00:00
Sanjay Patel
044daf4379 workaround for an IR variable named %.
(which SimplifyCFG can produce...)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264543 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-27 20:44:35 +00:00
Sanjay Patel
a21dabc498 add scrubber for excessive leading whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-27 20:43:02 +00:00
Matthias Braun
abcfbb3c69 abtest: Cleanup, improve comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-26 04:07:55 +00:00
Matthias Braun
4508f5d028 abtest: Check all files, improve announcements
Simply searching for gooddir/* and baddir/* instead of *.s the script
should also work with .o files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264484 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-26 00:36:58 +00:00
Matthias Braun
b56f8c310d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-26 00:23:59 +00:00
Sanjay Patel
1ffcfe8d01 fix IR function name regex to allow hyphens
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:00:12 +00:00
Sanjay Patel
79b059889d 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 23:19:26 +00:00
Sanjay Patel
8674e1c5a3 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 17:30:38 +00:00
Sanjay Patel
002b8db36a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-24 17:15:42 +00:00
Sanjay Patel
c062937b5e 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. 



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264197 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-23 21:40:53 +00:00
Mike Spertus
67bf5dd452 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 20:06:16 +00:00
Filipe Cabecinhas
e2a5365d55 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263731 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 18:27:33 +00:00
Chandler Carruth
cdb6339f8b [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-12 03:03:31 +00:00
Mike Spertus
fcb50867e5 Type correct Visual Studio native visualization for PointerUnions
Visualize pointer unions by their actual type rather than as void *.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-11 18:26:47 +00:00
Nicolai Haehnle
5dae380620 [TableGen] more helpful error message in MapTableEmitter
Differential Revision: http://reviews.llvm.org/D17275

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263148 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-10 18:51:58 +00:00
Craig Topper
4016ad20d2 [CodeGen] Add space-optimized EmitMergeInputChains1_2 to the DAG isel matching tables. Shaves about 5100 bytes from the X86 matcher table. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262815 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-07 07:29:12 +00:00
Matthias Braun
0101cb0a0b TableGen: Accept itinerary data when checking for schedmodel completeness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-03 00:04:59 +00:00
Matthias Braun
3b1588aa81 TableGen: Display helpfull message for incomplete models.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262399 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 21:36:12 +00:00
Matthias Braun
eab2869a64 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262384 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 20:03:21 +00:00
Matthias Braun
279476d30d 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262383 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 20:03:11 +00:00
Nikolay Haustov
344528bfec [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-01 08:34:43 +00:00
Paul Robinson
5dc46f59dd 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 22:13:03 +00:00
Daniel Sanders
0562fb318f [test-release.sh] Add lldb to list of projects (disabled by default)
Reviewers: hans

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-29 11:04:39 +00:00
Paul Robinson
05af933abd Revert r262092, caught LLD tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262093 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26 23:44:10 +00:00
Paul Robinson
ede28b79ea [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262092 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-26 23:34:02 +00:00
Igor Breger
7f2251533a AVX512F: Add GATHER/SCATTER assembler Intel syntax tests for knl/skx/avx . Change memory operand parser handling.
Differential Revision: http://reviews.llvm.org/D17564

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-25 13:30:17 +00:00
Xinliang David Li
2c17b9c60c Fix comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261672 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-23 19:18:21 +00:00
Craig Topper
f150810c18 [X86] Remove some unused encoding checks from the disassembler table building.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 06:20:21 +00:00
Craig Topper
2082d39556 [TableGen,X86] Add NDEBUG check to a variable initialization that's only used by asserts. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261188 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 04:54:32 +00:00
Craig Topper
a5754d7efa [TableGen,X86] Remove extra optional operand from RawFrm. RawFrm with 2 immediates is handled by RawFrmImm8/RawFrmImm16.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 04:54:29 +00:00
Craig Topper
35e38d845b [TableGen] Fix inconsistent spacing. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260935 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:58 +00:00
Craig Topper
69dced0d4c [TableGen] Stop passing by reference an integer that doesn't get modified. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260934 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:56 +00:00
Craig Topper
6ff0feee63 [TableGen] Remove unused member variable. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 04:24:54 +00:00
Craig Topper
33543a37a7 [TableGen] Use range-based for loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260928 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 02:48:30 +00:00
Craig Topper
487820cc86 [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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-14 05:22:01 +00:00
Craig Topper
9a4d26a079 [TableGen] Fix comment about 64-bit type I missed when I removed the underlying type in r260808.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260830 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 17:58:14 +00:00
Craig Topper
dcbac18d6e [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 06:03:32 +00:00
Craig Topper
c46e309ffa 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260808 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-13 06:03:29 +00:00
Andrew Wilkins
724b31e65d 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260641 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-12 01:42:43 +00:00
James Y Knight
5b06a939bd 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260540 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 16:46:09 +00:00
Craig Topper
7f53bedefc [TableGen] Use range-based for loops. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260502 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 07:39:29 +00:00
Craig Topper
a78623e3e8 [TableGen] Don't call emitSourceFileHeader a second time in the middle of the output file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 07:39:27 +00:00
Craig Topper
083ca64734 [TableGen] Whitespace cleanup in output file. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260500 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 07:39:25 +00:00
Craig Topper
269f2734b8 [TableGen] Simplify code slightly. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260499 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-11 07:39:22 +00:00
Matt Arsenault
b9f1dbe18d 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260404 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-10 18:40:04 +00:00
Ehsan Akhgari
a20946b352 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-09 19:41:14 +00:00
Tom Stellard
25257d8bf4 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-05 19:59:33 +00:00
Benjamin Kramer
67256b88e5 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-04 16:21:38 +00:00
David L Kreitzer
af50aacb9a 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259726 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 23:17:32 +00:00
Reid Kleckner
6ebd4e68e8 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259683 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 19:34:28 +00:00
Dylan McKay
f4afd08249 [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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259636 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 10:30:16 +00:00
Justin Bogner
4b23ca53a3 Remove utils/buildit
The autoconf build system was removed - this doesn't even work and
doesn't need to be here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 21:56:16 +00:00
Eugene Zelenko
380d47d651 Fix Clang-tidy readability-redundant-control-flow warnings; other minor fixes.
Differential revision: http://reviews.llvm.org/D16793


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 18:20:45 +00:00
Craig Topper
3f0462d7e0 [TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead of accidentally copying to a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 01:33:42 +00:00
Craig Topper
ac8a991748 No need to use utostr/utohexstr when writing into a raw_ostream. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 01:55:15 +00:00
Daniel Sanders
508957013b 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 21:09:50 +00:00
Simon Pilgrim
10fe174ef8 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258987 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 21:13:18 +00:00
Yunzhong Gao
4f57979e46 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 01:48:20 +00:00
Reid Kleckner
fa21741f38 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 01:43:12 +00:00
Hans Wennborg
89b5a6785f 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 00:19:05 +00:00
Reid Kleckner
80814c51f4 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 23:01:21 +00:00
Chris Bieneman
caeade4234 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258861 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 21:29:08 +00:00
Eugene Zelenko
51ecde1f0a Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:48:36 +00:00
Reid Kleckner
fa883c2abc 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258757 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 00:55:00 +00:00
Oliver Stannard
09f29b2ea4 [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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258677 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-25 10:20:19 +00:00
Craig Topper
aed38efd95 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-24 07:13:28 +00:00
Craig Topper
a4f2978e0c [TableGen] Make a class member local to the function that populates it and consumes it later. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 05:59:43 +00:00
Craig Topper
43b79903fe [TableGen] Reorder fields in AsmWriterOperand to remove padding and reduce size. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258489 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 05:59:40 +00:00
Craig Topper
1c09f96ebe [TableGen] Remove the CGIOpNo from AsmWriterOperand as its not used for anything. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 05:59:37 +00:00
Dimitry Andric
ad24fed421 In test-release.sh, only run uname -s once. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258439 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-21 22:07:17 +00:00
Dimitry Andric
0ae89f95ca 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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-21 21:57:49 +00:00
Quentin Colombet
8a7d012332 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258333 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-20 19:14:55 +00:00
Nico Weber
3c247736dd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 21:22:36 +00:00
Hans Wennborg
f049f0721c test-release.sh: Use CMake also for Darwin
This didn't work for 3.7, but hopefully it should work now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258168 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:21:58 +00:00
Craig Topper
401ee722ee [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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258065 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-18 19:52:37 +00:00
Craig Topper
8ce1d779bc [TableGen] Keep a returned const reference instead of making a copy. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258020 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 20:38:21 +00:00
Craig Topper
e4b8552199 [TableGen] Replace instructions() with getInstructionsByEnumValue(). No need to make an iterator_range when we already have a function that returns an ArrayRef. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 20:38:18 +00:00
Craig Topper
3356fb6f86 [TableGen] Return ArrayRef instead of a std::vector reference from getInstructionsByEnumValue(). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 20:38:14 +00:00
Craig Topper
671078454d [TableGen] Use std::find instead of a manual loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 19:51:14 +00:00
Craig Topper
e0b4b2fd22 [TableGen] Use a StringRef instead of creating a new std::string. It gets passed to a function that takes a StringRef anyway. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 08:47:02 +00:00
Craig Topper
73251b7217 [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 08:05:33 +00:00
Craig Topper
9990e7de74 [TableGen] Use std::find instead of a manual loop. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258004 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-17 08:05:30 +00:00
Dimitry Andric
2f248688c9 Similar to rL257663, remove function keywords from export.sh and
tag.sh, since they are marked to be run with /bin/sh.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-16 15:18:35 +00:00
Hans Wennborg
f75308f366 test-release.sh: Fix clang-tools-extra symlink for CMake build
The CMake and Autoconf builds want the symlink set up differently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257905 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 17:04:45 +00:00
Hans Wennborg
faaa9dde56 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257791 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 19:21:14 +00:00
Craig Topper
efefcdd53d [TableGen] Pass PassSubtarget flag into getCode instead of storing a copy of the flag in every AsmWriterOperand. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257743 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14 06:15:07 +00:00
Dimitry Andric
307c714edd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257663 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 19:48:50 +00:00
Hans Wennborg
a07c74ea61 Update version to 3.9.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257627 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 17:32:32 +00:00
Dan Liew
5ef672de8d [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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257616 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13 16:43:49 +00:00