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

5793 Commits

Author SHA1 Message Date
Tim Northover
e0ea323e71 GlobalISel: Remove explicit enumerator values from .def file.
They were all auto-incremented from 0 anyway, and I'm getting really annoying
conflicts and runtime failures when different people add more for GlobalISel
(and even when I'm refactoring my own patches).

NFC.

llvm-svn: 276204
2016-07-20 22:58:01 +00:00
Vedant Kumar
5b19d0d059 [utils] Add script to check for code coverage regressions
Differential Revision: https://reviews.llvm.org/D22544

llvm-svn: 276199
2016-07-20 22:44:16 +00:00
Matt Arsenault
c431d0b6a1 TableGen: Allow custom register operand decoder method
This is for a situation where the encoding for a register may be
different depending on the specific operand. For some instructions,
we want to apply additional restrictions beyond the encoding's
constraints.

In AMDGPU some operands are VSrc_32, using the VS_32 pseudo register
class which accept VGPRs, SGPRs, or immediates in the encoding.
Some specific instructions with the same encoding operand do not want
to allow immediates or SGPRs, but the encoding format is different
in this case than a regular VGPR_32 operand.

This allows specifying the encoding should be treated the same
without introducing yet another dummy register class.

llvm-svn: 275929
2016-07-18 23:20:46 +00:00
Vedant Kumar
271dba4dc2 [utils] Generate html reports with the code coverage utility script
Instead of extracting raw coverage mappings into an artifact directory,
actually generate useful html reports for a given list of binaries with
symbol demangling turned on.

No tests, but this is actively being used to drive the (still nascent)
coverage bot.

llvm-svn: 275927
2016-07-18 22:50:10 +00:00
Hans Wennborg
1cc961d882 build_llvm_package.bat: update version to 4.0.0
llvm-svn: 275903
2016-07-18 20:26:46 +00:00
Hans Wennborg
d1d3ea8114 Revert r273099 "If the revision number starts with r, drop it. It will get added back"
This doesn't seem to work with Bash:

$ /work/llvm/utils/release/merge.sh --proj llvm --rev r275870
/work/llvm/utils/release/merge.sh: line 34: ${$1#r}: bad substitution

I get the same error with and without a leading 'r'.

llvm-svn: 275898
2016-07-18 20:06:27 +00:00
Justin Bogner
5a8c8a3672 IR: Sort generic intrinsics before target specific ones
This splits out the intrinsic table such that generic intrinsics come
first and target specific intrinsics are grouped by target. From here
we can find out which target an intrinsic is for or differentiate
between generic and target intrinsics.

The motivation here is to make it easier to move target specific
intrinsic handling out of generic code.

llvm-svn: 275575
2016-07-15 16:31:37 +00:00
Justin Bogner
45e70b6850 TableGen: Fix a confusing use of both i and I as variables. NFC
llvm-svn: 275450
2016-07-14 18:08:33 +00:00
Dean Michael Berris
b3cb9bd89d XRay: Add entry and exit sleds
Summary:
In this patch we implement the following parts of XRay:

- Supporting a function attribute named 'function-instrument' which currently only supports 'xray-always'. We should be able to use this attribute for other instrumentation approaches.
- Supporting a function attribute named 'xray-instruction-threshold' used to determine whether a function is instrumented with a minimum number of instructions (IR instruction counts).
- X86-specific nop sleds as described in the white paper.
- A machine function pass that adds the different instrumentation marker instructions at a very late stage.
- A way of identifying which return opcode is considered "normal" for each architecture.

There are some caveats here:

1) We don't handle PATCHABLE_RET in platforms other than x86_64 yet -- this means if IR used PATCHABLE_RET directly instead of a normal ret, instruction lowering for that platform might do the wrong thing. We think this should be handled at instruction selection time to by default be unpacked for platforms where XRay is not availble yet.

2) The generated section for X86 is different from what is described from the white paper for the sole reason that LLVM allows us to do this neatly. We're taking the opportunity to deviate from the white paper from this perspective to allow us to get richer information from the runtime library.

Reviewers: sanjoy, eugenis, kcc, pcc, echristo, rnk

Subscribers: niravd, majnemer, atrick, rnk, emaste, bmakam, mcrosier, mehdi_amini, llvm-commits

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

llvm-svn: 275367
2016-07-14 04:06:33 +00:00
Saleem Abdulrasool
a7b7b3ed35 vim: separate the keywords into one per line
This achieves the same result as previously by using line wrapping.  This allows
us to have one keyword per line which makes adding a new keyword significantly
easier, especially if they are inserted in a lexicographical sort order as you
no longer need to reflow the content around it.

This only does the keywords as that is the group which changes more often.

llvm-svn: 275248
2016-07-13 03:47:58 +00:00
Saleem Abdulrasool
ea53e31958 vim: add local_unnamed_addr keyword
The `local_unnamed_addr` was introduced in SVN r272709.  Update the syntax
highlighting rules.

llvm-svn: 275245
2016-07-13 03:36:05 +00:00
Hal Finkel
ad4e59155b Add a 'Returned' intrinsic property corresponding to the 'returned' argument attribute
This will be used by the upcoming llvm.noalias intrinsic.

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

llvm-svn: 275034
2016-07-11 01:28:42 +00:00
Justin Bogner
daec247313 TableGen: Update style in CodeGenIntrinsics. NFC
Ran clang-format to remove the namespace indentation, and stopped
repeating names in doc comments since I was updating every line
anyway.

llvm-svn: 274919
2016-07-08 20:14:27 +00:00
Tim Northover
16a302fa3c TableGen: avoid string copy.
llvm-svn: 274584
2016-07-05 22:51:30 +00:00
Tim Northover
86fa0255b2 AArch64: TableGenerate system instruction operands.
The way the named arguments for various system instructions are handled at the
moment has a few problems:

  - Large-scale duplication between AArch64BaseInfo.h and AArch64BaseInfo.cpp
  - That weird Mapping class that I have no idea what I was on when I thought
    it was a good idea.
  - Searches are performed linearly through the entire list.
  - We print absolutely all registers in upper-case, even though some are
    canonically mixed case (SPSel for example).
  - The ARM ARM specifies sysregs in terms of 5 fields, but those are relegated
    to comments in our implementation, with a slightly opaque hex value
    indicating the canonical encoding LLVM will use.

This adds a new TableGen backend to produce efficiently searchable tables, and
switches AArch64 over to using that infrastructure.

llvm-svn: 274576
2016-07-05 21:23:04 +00:00
Tim Northover
049109d83f TableGen: promote "code" type from syntactic sugar.
It's being immediately converted to a "string", but being able to tell what
type the field was originally can be useful in backends.

llvm-svn: 274575
2016-07-05 21:22:55 +00:00
Davide Italiano
ed686df953 [TableGen] Remove dead code. NFCI.
llvm-svn: 274515
2016-07-04 19:21:42 +00:00
Nicolai Haehnle
fe1657d8ae Add writeonly IR attribute
Summary:
This complements the earlier addition of IntrWriteMem and IntrWriteArgMem
LLVM intrinsic properties, see D18291.

Also start using the attribute for memset, memcpy, and memmove intrinsics,
and remove their special-casing in BasicAliasAnalysis.

Reviewers: reames, joker.eph

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 274485
2016-07-04 08:01:29 +00:00
Simon Pilgrim
ac1b38084a [X86][AVX512] Add support for masked shuffle comments
This patch adds support for including the avx512 mask register information in the mask/maskz versions of shuffle instruction comments.

This initial version just adds support for MOVDDUP/MOVSHDUP/MOVSLDUP to reduce the mass of test regenerations, other shuffle instructions can be added in due course.

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

llvm-svn: 274459
2016-07-03 13:08:29 +00:00
John Brawn
5cfa5bd1e5 Make extract_symbols.py be compatible with Python 3
This involved running 2to3 on it and adjusting all uses of subprocess to use
universal_newlines=True so the output is text instead of binary. It remains
compatible with Python 2.7.

llvm-svn: 274365
2016-07-01 17:05:58 +00:00
Marcin Koscielnicki
6a9131b3fe [lit] Add SANITIZER_IGNORE_CVE_2016_2143 to pass_vars.
This variable is used by ASan (and other sanitizers in the future)
on s390x-linux to override a check for CVE-2016-2143 in the running
kernel (see revision 267747 on compiler-rt).  Since the check simply
checks if the kernel version is in a whitelist of known-good versions,
it may miss distribution kernels, or manually-patched kernels - hence
the need for this variable.  To enable running the ASan testsuite on
such kernels, this variable should be passed from the environment
down to the testcases.

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

llvm-svn: 273825
2016-06-26 21:49:58 +00:00
Simon Dardis
1243a9b690 Revert "Revert "[misched] Extend scheduler to handle unsupported features""
This reverts commit r273565.

This was an over-eager revert.

llvm-svn: 273658
2016-06-24 08:43:27 +00:00
Ahmed Bougacha
5c6db14ac7 [TableGen] Use StringRef::compare instead of != and <. NFC.
The previous code would always do 1 or 2 prefix compares;
explicitly only do one.

This speeds up debug -gen-asm-matcher by ~10% (e.g. X86: 40s -> 35s).

llvm-svn: 273583
2016-06-23 17:09:49 +00:00
Simon Dardis
19be77fb82 Revert "[misched] Extend scheduler to handle unsupported features"
This reverts commit r273551.

Patch contained a wrong check for isUnsupported.

llvm-svn: 273565
2016-06-23 14:54:47 +00:00
Aaron Ballman
4edfb012af Explicitly specify the ANSI version of these Win32 APIs. While these are seemingly unrelated changes, they are all NFC because we currently default to the ANSI versions of the APIs when building for Windows. This simply makes the ANSI usage explicit.
llvm-svn: 273564
2016-06-23 14:45:54 +00:00
Simon Dardis
1647555c0b [misched] Extend scheduler to handle unsupported features
Currently isComplete = 1 requires that every instruction must
be described, declared unsupported or marked as having no
scheduling information for a processor.

For some backends such as MIPS, this requirement entails
long regex lists of instructions that are unsupported.

This patch teaches Tablegen to skip over instructions that
are associated with unsupported feature when checking if the
scheduling model is complete.

Patch by: Daniel Sanders

Contributions by: Simon Dardis

Reviewers: MatzeB

Differential Reviewer: http://reviews.llvm.org/D20522

llvm-svn: 273551
2016-06-23 09:22:11 +00:00
Matthias Braun
65c96a9dac TableGen/CodeGenSchedule: Move some getAllDerivedDefinitions() calls out of inner loops
This cuts the runtime of the two slowest tblgen invocations in aarch64
in half for me...

llvm-svn: 273235
2016-06-21 03:24:03 +00:00
Thomas Jablin
301965ec13 test commit: remove trailing whitespace
llvm-svn: 273197
2016-06-20 20:43:26 +00:00
Joerg Sonnenberger
4a74ceeb49 If the revision number starts with r, drop it. It will get added back
later and we don't want to use it twice.

llvm-svn: 273099
2016-06-18 23:23:38 +00:00
David Majnemer
c6df3d773b Remove the ScalarReplAggregates pass
Nearly all the changes to this pass have been done while maintaining and
updating other parts of LLVM.  LLVM has had another pass, SROA, which
has superseded ScalarReplAggregates for quite some time.

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

llvm-svn: 272737
2016-06-15 00:19:09 +00:00
Daniel Sanders
b330481daf [FileCheck] Add --check-prefixes as a shorthand for multiple --check-prefix options.
Summary:
This new alias takes a comma separated list of prefixes which allows
'--check-prefix=A --check-prefix=B --check-prefix=C' to be written as
'--check-prefixes=A,B,C'.

Reviewers: probinson

Subscribers: probinson, llvm-commits, dsanders

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

llvm-svn: 272670
2016-06-14 14:28:04 +00:00
Vedant Kumar
c6b8569cc2 Add support for collating profiles for use with code coverage
Differential Revision: http://reviews.llvm.org/D20993

llvm-svn: 272599
2016-06-13 23:33:48 +00:00
Mike Spertus
d5fba0c8a6 Improved Visual Studio 2015 visualization of SmallVectorImpl
When visualizing small vectors in VS2015, show the first few elements in the DisplayString instead of the size. For example, a SmallVector of DeclAccessPair will visualize like

  {public typename ...Ts, public typename U}

The visualization in VS2013 remains the same because we continue to include the old visualizer with a lower-than-default priority of MediumLow, and the same SmallVector would continue to be visualized as

  {size = 2}

llvm-svn: 272525
2016-06-13 01:43:14 +00:00
Benjamin Kramer
5699dda316 Run clang-tidy's performance-unnecessary-copy-initialization over LLVM.
No functionality change intended.

llvm-svn: 272516
2016-06-12 17:30:47 +00:00
Simon Pilgrim
08b5ad90a3 [X86] Updated test checks script to generalise LCPI symbol refs
The script now replace '.LCPI888_8' style asm symbols with the {{\.LCPI.*}} re pattern - this helps stop hardcoded symbols in 32-bit x86 tests changing with every edit of the file

Refreshed some tests to demonstrate the new check

llvm-svn: 272488
2016-06-11 20:39:21 +00:00
Daniel Dunbar
4f12eba9f0 [lit] Only gather redirected files for command failures.
- The intended use of this was just in diagnostics, so we shouldn't pay the
   cost of reading these all the time.

 - This will avoid including the full output of each command in tests which
   fail, but the most important use case for this was to gather the output of
   the specific command which failed.

llvm-svn: 272365
2016-06-10 04:17:30 +00:00
Vedant Kumar
a599512386 Revert "[lit] Use os.devnull instead of named temp files"
This reverts commit r272290. It breaks a test that depends on being able
to seek the /dev/null equivalent on Windows:

http://bb.pgr.jp/builders/ninja-clang-x64-mingw64-RA/builds/11360

llvm-svn: 272293
2016-06-09 19:36:48 +00:00
Vedant Kumar
6e905448d5 [lit] Use os.devnull instead of named temp files
Use os.devnull instead of tempfiles when substituting '/dev/null' on
Windows machines. This should make the bots just a bit speedier.

Thanks to Yunzhong Gao for testing this patch on Windows!

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

llvm-svn: 272290
2016-06-09 18:38:41 +00:00
Richard Smith
f7f711ffaa Search for llvm-symbolizer binary in the same directory as argv[0], before
looking for it along $PATH. This allows installs of LLVM tools outside of
$PATH to find the symbolizer and produce pretty backtraces if they crash.

llvm-svn: 272232
2016-06-09 00:53:21 +00:00
Benjamin Kramer
d415569b3b 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.

llvm-svn: 272190
2016-06-08 19:09:22 +00:00
Daniel Dunbar
bd13a0caaa [lit] Ensure we get bytes when reading redirected output files.
llvm-svn: 272147
2016-06-08 14:41:44 +00:00
Daniel Dunbar
0e78f81b99 [lit] Ignore errors when decoding redirected output.
llvm-svn: 272066
2016-06-07 22:06:57 +00:00
Daniel Dunbar
103d296079 [lit] Fix an uninitialized var on Windows.
llvm-svn: 272052
2016-06-07 20:14:17 +00:00
Daniel Dunbar
19353b2150 [utils/lit] Show available_features with --show-suites.
llvm-svn: 272022
2016-06-07 16:22:24 +00:00
Daniel Dunbar
45d8260ac8 [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).

llvm-svn: 272021
2016-06-07 16:13:40 +00:00
Mike Spertus
bfcbd10626 Add Visual Studio Visualizer for ArrayRef
Modeled after visualization of llvm::SmallVec

llvm-svn: 271847
2016-06-05 18:34:02 +00:00
Sjoerd Meijer
49ddbd67d0 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

llvm-svn: 271666
2016-06-03 13:17:37 +00:00
Sjoerd Meijer
9a100cced7 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

llvm-svn: 271665
2016-06-03 13:14:19 +00:00
Daniel Dunbar
0aa30c2bae [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

```

llvm-svn: 271610
2016-06-02 23:49:42 +00:00
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