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

7091 Commits

Author SHA1 Message Date
Hans Wennborg
508dc3e225 Build LLVM-C.dll by default on windows and enable in release package
With the fixes to the building of LLVM-C.dll in D56781 this should now
be safe to land. This will greatly simplify dealing with LLVM for people
that just want to use the C API on windows. This is a follow up from
D35077.

Patch by Jakob Bornecrantz!

Differential revision: https://reviews.llvm.org/D56774

llvm-svn: 352250
2019-01-25 22:45:17 +00:00
Nico Weber
76033369a6 gn build: Merge r352149
llvm-svn: 352202
2019-01-25 14:53:30 +00:00
Nico Weber
afa8033cbe gn build: Revert r352200, commit message was wrong
llvm-svn: 352201
2019-01-25 14:52:50 +00:00
Nico Weber
0ecac48cd5 gn build: Merge r352148
llvm-svn: 352200
2019-01-25 14:50:14 +00:00
Peter Collingbourne
aff560ac75 gn build: Set is_clang to true in stage2 toolchains.
Differential Revision: https://reviews.llvm.org/D57202

llvm-svn: 352146
2019-01-25 01:18:55 +00:00
Nico Weber
86a0198c8d gn build: Build clang with -fno-strict-aliasing, make building with gcc much quieter
- gcc doesn't understand -Wstring-conversion, so pass that only to clang
- disable a few gcc warnings that are noisy and also disabled in the cmake build
- -Wstrict-aliasing pointed out that the cmake build builds clang with
  -fno-strict-aliasing, so do that too

Differential Revision: https://reviews.llvm.org/D57191

llvm-svn: 352141
2019-01-25 00:29:17 +00:00
Nico Weber
69ded40d03 gn build: Merge r351990
llvm-svn: 352096
2019-01-24 20:19:18 +00:00
Nico Weber
a5aba5c47a gn build: Merge r351320 (the 9.0.0 version bump)
llvm-svn: 352002
2019-01-24 01:00:52 +00:00
Simon Pilgrim
53cb95b13e [IR] Match intrinsic parameter by scalar/vectorwidth
This patch replaces the existing LLVMVectorSameWidth matcher with LLVMScalarOrSameVectorWidth.

The matching args must be either scalars or vectors with the same number of elements, but in either case the scalar/element type can differ, specified by LLVMScalarOrSameVectorWidth.

I've updated the _overflow intrinsics to demonstrate this - allowing it to return a i1 or <N x i1> overflow result, matching the scalar/vectorwidth of the other (add/sub/mul) result type.

The masked load/store/gather/scatter intrinsics have also been updated to use this, although as we specify the reference type to be llvm_anyvector_ty we guarantee the mask will be <N x i1> so no change in behaviour

Differential Revision: https://reviews.llvm.org/D57090

llvm-svn: 351957
2019-01-23 16:00:22 +00:00
Peter Collingbourne
aa6dcf0b5b gn build: Merge r351820.
llvm-svn: 351919
2019-01-23 02:19:56 +00:00
Nico Weber
08e216f48b gn build: Merge r351880
llvm-svn: 351918
2019-01-23 02:10:10 +00:00
Joel E. Denny
ef0283f95a [FileCheck] Suppress old -v/-vv diags if dumping input
The old diagnostic form of the trace produced by -v and -vv looks
like:

```
check1:1:8: remark: CHECK: expected string found in input
CHECK: abc
       ^
<stdin>:1:3: note: found here
; abc def
  ^~~
```

When dumping annotated input is requested (via -dump-input), I find
that this old trace is not useful and is sometimes harmful:

1. The old trace is mostly redundant because the same basic
   information also appears in the input dump's annotations.

2. The old trace buries any error diagnostic between it and the input
   dump, but I find it useful to see any error diagnostic up front.

3. FILECHECK_OPTS=-dump-input=fail requests annotated input dumps only
   for failed FileCheck calls.  However, I have to also add -v or -vv
   to get a full set of annotations, and that can produce massive
   output from all FileCheck calls in all tests.  That's a real
   problem when I run this in the IDE I use, which grinds to a halt as
   it tries to capture all that output.

When -dump-input=fail|always, this patch suppresses the old trace from
-v or -vv.  Error diagnostics still print as usual.  If you want the
old trace, perhaps to see variable expansions, you can set
-dump-input=none (the default).

Reviewed By: probinson

Differential Revision: https://reviews.llvm.org/D55825

llvm-svn: 351881
2019-01-22 21:41:42 +00:00
Nico Weber
5321e96990 gn build: Stop passing -DLLVM_LIBXML2_ENABLED to some targets
This is a remnant from before the gn build had a working config.h.

Defining LLVM_LIBXML2_ENABLED only for targets that depend on build/libs/xml is
nice in that only some of the codebase needs to be rebuilt when
llvm_enable_libxml2 changes -- but config.h already defines it and defining it
there and then redundantly a second time for some targets is worse than having
it just in config.h.

No behavior change.

Differential Revision: https://reviews.llvm.org/D56908

llvm-svn: 351758
2019-01-21 18:59:11 +00:00
Nico Weber
6295f7103b gn build: Merge r351627, r351548, r351701
llvm-svn: 351757
2019-01-21 18:56:39 +00:00
Eric Fiselier
fbb246b9e8 make XFAIL, REQUIRES, and UNSUPPORTED support multi-line expressions
llvm-svn: 351668
2019-01-20 00:51:02 +00:00
Chandler Carruth
b9332cb8d7 Update structured references to the license to the new license.
Since these are intended to be short and succinct, I've used the SPDX
full name. It's human readable, but formally agreed upon and will be
part of the SPDX spec for licenses.

llvm-svn: 351649
2019-01-19 11:30:51 +00:00
Chandler Carruth
ae65e281f3 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Reid Kleckner
fa6cb76678 [X86] Deduplicate static calling convention helpers for code size, NFC
Summary:
Right now we include ${TGT}GenCallingConv.inc once per each instruction
selection method implemented by ${TGT}:
- ${TGT}ISelLowering.cpp
- ${TGT}CallLowering.cpp
- ${TGT}FastISel.cpp

Instead, add a mechanism to tablegen for marking a particular convention
as "External", which causes tablegen to emit into the ::llvm namespace,
instead of as a static helper. This allows us to provide a header to
forward declare it, so we can simply call the function from all the
places it is referenced. Typically the calling convention analyzer is
called indirectly, so it doesn't benefit from inlining.

This saves a bit of final binary size, but mostly just saves object file
size:

before  after   diff   artifact
12852K  12492K  -360K  X86ISelLowering.cpp.obj
4640K   4280K   -360K  X86FastISel.cpp.obj
1704K   2092K   +388K  X86CallingConv.cpp.obj
52448K  52336K  -112K  llc.exe

I didn't collect before numbers for X86CallLowering.cpp.obj, which is
for GlobalISel, but we should save 360K there as well.

This patch applies the strategy to the X86 backend, but there is no
reason it couldn't be applied to the other backends that implement
multiple ISel strategies, like AArch64.

Reviewers: craig.topper, hfinkel, efriedma

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D56883

llvm-svn: 351616
2019-01-19 00:33:02 +00:00
Nico Weber
fa15d4bb37 Use llvm_canonicalize_cmake_booleans for LLVM_LIBXML2_ENABLED [llvm]
r291284 added a nice mechanism to consistently pass CMake on/off toggles to
lit. This change uses it for LLVM_LIBXML2_ENABLED too (which was added around
the same time and doesn't use the new system yet).

Also alphabetically sort the list passed to llvm_canonicalize_cmake_booleans()
in llvm/test/CMakeLists.txt.

No intended behavior change.

Differential Revision: https://reviews.llvm.org/D56912

llvm-svn: 351615
2019-01-19 00:10:54 +00:00
Pavel Labath
40e9380144 [ADT] Add streaming operators for llvm::Optional
Summary:
The operators simply print the underlying value or "None".

The trickier part of this patch is making sure the streaming operators
work even in unit tests (which was my primary motivation, though I can
also see them being useful elsewhere). Since the stream operator was a
template, implicit conversions did not kick in, and our gtest glue code
was explicitly introducing an implicit conversion to make sure other
implicit conversions do not kick in :P. I resolve that by specializing
llvm_gtest::StreamSwitch for llvm:Optional<T>.

Reviewers: sammccall, dblaikie

Reviewed By: sammccall

Subscribers: mgorny, dexonsmith, kristina, llvm-commits

Differential Revision: https://reviews.llvm.org/D56795

llvm-svn: 351548
2019-01-18 12:52:03 +00:00
Nico Weber
667cf61859 gn build: unbreak mac (and maybe win) after r351258, r351277
The check-hwasan build files assert that current_os == "linux" || current_os ==
"android", so pull it in only there.

ar is unused on mac, so don't set it in the stage2 toolchain. (It'd be nicer to
use llvm-libtool on mac instead of host libtool, but llvm-libtool doesn't seem
to understand the -no_warning_for_no_symbols flag.)

Differential Revision: https://reviews.llvm.org/D56898

llvm-svn: 351519
2019-01-18 04:09:30 +00:00
Nico Weber
0c94c23e35 gn build: Merge r351499
llvm-svn: 351516
2019-01-18 03:38:53 +00:00
Nico Weber
9264894fc9 mac: Correctly disable tools/lto tests when building with LLVM_ENABLE_PIC=OFF
llvm/tools sets LLVM_TOOL_LTO_BUILD to Off if LLVM_ENABLE_PIC=OFF, but that's
not visible in llvm/test.

r289662 added the llvm_tool_lto_build lit parameter, there the intent was to
use it with an explicit -DLLVM_TOOL_LTO_BUILD=OFF, which is visible globally.
On the review for that (D27739), a mild preference was expressed for using a
lit parameter over checking the existence of libLTO.dylib. Since that works
with the LLVM_ENABLE_PIC=OFF case too and since it matches what we do for the
gold plugin, switch to that approach.

Differential Revision: https://reviews.llvm.org/D56805

llvm-svn: 351515
2019-01-18 03:36:04 +00:00
Nico Weber
a32a50a832 llvm build: Merge r351448
llvm-svn: 351469
2019-01-17 20:20:56 +00:00
Hans Wennborg
c466a75471 build_llvm_package.bat: Run more tests
llvm-svn: 351436
2019-01-17 13:11:15 +00:00
Peter Collingbourne
0e57b6e44c gn build: Add headers to compiler-rt build files.
Also fix sort order in llvm/lib/CodeGen/GlobalISel/BUILD.gn.

llvm-svn: 351367
2019-01-16 18:45:12 +00:00
Hans Wennborg
7d67e5d0c6 Revert r351324 "Build LLVM-C.dll by default on windows and enable in release package"
This broke the build, ending up with too long command-lines when invoking gen-mscv-exports.py.

> As it says in the subject, should have gone long enough now that this
> should be safe. This will greatly simplify dealing with LLVM for people
> that just want to use the C API on windows. This is a follow up from
> D35077.
>
> Patch by Jakob Bornecrantz!
>
> Differential revision: https://reviews.llvm.org/D56774

llvm-svn: 351329
2019-01-16 12:36:28 +00:00
Hans Wennborg
d5243cd3e9 Build LLVM-C.dll by default on windows and enable in release package
As it says in the subject, should have gone long enough now that this
should be safe. This will greatly simplify dealing with LLVM for people
that just want to use the C API on windows. This is a follow up from
D35077.

Patch by Jakob Bornecrantz!

Differential revision: https://reviews.llvm.org/D56774

llvm-svn: 351324
2019-01-16 11:47:56 +00:00
Hans Wennborg
78f30ff3a6 Bump the trunk version to 9.0.0svn
llvm-svn: 351320
2019-01-16 10:57:02 +00:00
Hans Wennborg
c754f995d9 Include lldb in Win snapshots again (PR37307)
llvm-svn: 351309
2019-01-16 08:38:28 +00:00
Peter Collingbourne
f67bc623d8 gn build: Merge r351283.
llvm-svn: 351293
2019-01-16 02:27:12 +00:00
Peter Collingbourne
e58561f877 gn build: Add check-hwasan target.
The Android sanitizer tests are currently some of the most difficult
to run correctly, requiring at least 3 build directories which have
to be configured in just the right way and built in the correct order
(see e.g. [1] and the functions that it calls).

This patch adds a check-hwasan target which greatly simplifies running
the hwasan tests for gn users, taking advantage of its support for
multiple toolchains. With this the tests can be run simply by setting
an NDK path and running "ninja check-hwasan" with a compatible Android
device connected. The Linux/x86_64 and Android/aarch64 targets are
tested in parallel.

[1] https://github.com/llvm/llvm-zorg/blob/master/zorg/buildbot/builders/sanitizers/buildbot_android.sh

Differential Revision: https://reviews.llvm.org/D56713

llvm-svn: 351277
2019-01-16 00:15:25 +00:00
Peter Collingbourne
c6dd831c47 gn build: Add a stage2 host toolchain and make the hwasan runtime buildable on x86_64 Linux.
Differential Revision: https://reviews.llvm.org/D56711

llvm-svn: 351258
2019-01-15 22:02:12 +00:00
Peter Collingbourne
087cc9fbff gn build: Add a resource_dir.gni file.
The path to the resource directory will end up being used in several
more places once the support for running check-hwasan lands. This
moves the definition to a central location so that it can be used
from those places.

Differential Revision: https://reviews.llvm.org/D56700

llvm-svn: 351255
2019-01-15 21:44:59 +00:00
Peter Collingbourne
5788f38076 gn build: Move target flags from toolchain to a .gni file.
While here, add a use_lld flag and default it to true when using
clang on non-mac.

Differential Revision: https://reviews.llvm.org/D56710

llvm-svn: 351248
2019-01-15 21:24:00 +00:00
Peter Collingbourne
e504dae9e1 gn build: Add build files for compiler-rt/lib/{hwasan,interception,sanitizer_common,ubsan}.
This allows the hwasan runtime to be built for Android aarch64.

Differential Revision: https://reviews.llvm.org/D56628

llvm-svn: 351246
2019-01-15 21:08:21 +00:00
Peter Collingbourne
de7b481ed5 gn build: Merge r351216, r351228.
llvm-svn: 351242
2019-01-15 21:02:49 +00:00
Craig Topper
9f55f29946 [Nios2] Remove Nios2 backend
As mentioned here http://lists.llvm.org/pipermail/llvm-dev/2019-January/129121.html This backend is incomplete and has not been maintained in several months.

Differential Revision: https://reviews.llvm.org/D56691

llvm-svn: 351231
2019-01-15 19:59:19 +00:00
Hans Wennborg
28ed037d55 gn build: Don't assume valgrind.h exists on Linux
It didn't on my machine, so defaulting it to off seems better.

Differential revision: https://reviews.llvm.org/D56727

llvm-svn: 351202
2019-01-15 16:51:45 +00:00
Peter Collingbourne
dced64438d gn build: Rename llvm_host_triple to llvm_current_triple and have it use current_{cpu,os}.
This makes e.g. ToolChain::isCrossCompiling() in
clang/lib/Driver/ToolChain.cpp return the correct result
if the compiler was cross-compiled. This change also affects
llvm_default_target_triple, so cross-compiled compilers default to
targeting the cross-compilation target, which makes more sense than
the host that the compiler was compiled on.

This change will also be necessary in order for the correct triples
to appear in generated lit files for non-native targets.

Differential Revision: https://reviews.llvm.org/D56696

llvm-svn: 351168
2019-01-15 08:20:29 +00:00
Peter Collingbourne
fd5e7692d9 gn build: Make a couple of improvements to the unix toolchain.
Add an asm tool (will be required for building sanitizer_common on
x64) and set a soname for DSOs so that anything that links against
them gets the correct DT_NEEDED.

Differential Revision: https://reviews.llvm.org/D56705

llvm-svn: 351167
2019-01-15 08:14:38 +00:00
Peter Collingbourne
7f9dca5ace gn build: Switch to using current_os in lib/Support/BUILD.gn.
Differential Revision: https://reviews.llvm.org/D56704

llvm-svn: 351166
2019-01-15 07:17:03 +00:00
Peter Collingbourne
89ce163305 gn build: Split no-RTTI flag into a config.
Some of the sanitizer runtime code needs to be built with RTTI;
this allows that code to opt in to RTTI.

Differential Revision: https://reviews.llvm.org/D56627

llvm-svn: 351155
2019-01-15 02:43:33 +00:00
Peter Collingbourne
3309a3ab97 gn build: Stop defining LLVM_ON_UNIX globally.
This macro is already being defined in llvm-config.h.

Differential Revision: https://reviews.llvm.org/D56626

llvm-svn: 351154
2019-01-15 02:42:47 +00:00
George Karpenkov
d7322a71b7 [lit] llvm-lit.in: specify file encoding to UTF-8
This is needed because otherwise if source dir is at location whose path
contains non-ASCII character then python will complain about
SyntaxError.

SyntaxError: Non-ASCII character '\xc4' in file
/home/D?vis/libc++/src/build/bin/llvm-lit on line 16, but no encoding
declared; see http://python.org/dev/peps/pep-0263/ for details

Patch by davispuh

Differential Revision: https://reviews.llvm.org/D50201

llvm-svn: 351113
2019-01-14 20:02:11 +00:00
Nico Weber
836b276e53 gn build: Unbreak mac build after r350977
llvm-svn: 351090
2019-01-14 18:30:35 +00:00
Nico Weber
8a58e6a620 gn build: Fix path to gn.py in docs
llvm-svn: 351088
2019-01-14 18:26:55 +00:00
Nico Weber
882a1fa563 gn build: svn propset svn:executable on utils/gn/gn.py
llvm-svn: 351085
2019-01-14 18:24:44 +00:00
Nico Weber
c11843323d gn build: Add gn.py wrapper script that adds --dotfile= and --root= parameters
Since people weren't enthused about moving the .gn file to the toplevel in
D56419, here's a script to make gn at least somewhat more pleasant to invoke
(useful for gn clean, gn args --list, gn desc, etc).

Differential Revision: https://reviews.llvm.org/D56565

llvm-svn: 351064
2019-01-14 12:50:40 +00:00
Thomas Preud'homme
716e6fb7bd Detect incorrect FileCheck variable CLI definition
Summary:
While the backend code of FileCheck relies on definition of variable
from the command-line to have an equal sign '=' and a variable name
before that, the frontend does not actually enforce it. This leads to
FileCheck crashing when invoked with invalid syntax for the -D option.

This patch adds the missing validation in the frontend. It also makes
the -D option an AlwaysPrefix option to be able to detect -D=FOO as
being a define without variable and -D as missing its value.

Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions)

Reviewers: jdenny

Subscribers: JonChesterfield, hiraditya, kristina, probinson,
llvm-commits

Differential Revision: https://reviews.llvm.org/D55940

llvm-svn: 351039
2019-01-14 09:29:10 +00:00