Commit Graph

276599 Commits

Author SHA1 Message Date
Alexei Starovoitov 9bd566f8c8 [bpf] remove unused variable
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 318615
2017-11-19 02:41:53 +00:00
Alexei Starovoitov 9a67245d88 [bpf] allow direct and indirect calls
kernel verifier is becoming smarter and soon will support
direct and indirect function calls.
Remove obsolete error from BPF backend.
Make call to use PCRel_4 fixup.
'bpf to bpf' calls are distinguished from 'bpf to kernel' calls
by insn->src_reg == BPF_PSEUDO_CALL == 1 which is used as relocation
indicator similar to ld_imm64->src_reg == BPF_PSEUDO_MAP_FD == 1
The actual 'call' instruction remains the same for both
'bpf to kernel' and 'bpf to bpf' calls.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
llvm-svn: 318614
2017-11-19 01:35:00 +00:00
Craig Topper 9a94dfc457 [X86] Switch cannonlake to use the SkylakeServer scheduling model instead of Haswell.
Cannonlake comes after skylake and supports avx512 so this is probably a closer model for now.

llvm-svn: 318613
2017-11-19 01:25:30 +00:00
Craig Topper 81037f385e [X86] Add skeleton support for icelake CPU.
There are several patches out for review right now to implement Icelake features. This adds a CPU to collect them under.

llvm-svn: 318612
2017-11-19 01:12:00 +00:00
Craig Topper 17078ff0e0 [X86] Fix 80 column violation and remove trailing whitespace. NFC
llvm-svn: 318611
2017-11-19 01:11:58 +00:00
Craig Topper 436c9263fb [X86] Add cpu detection for cannonlake.
This uses the same encoding for cannonlake in the proposed gcc patches here. https://gcc.gnu.org/ml/gcc-patches/2017-11/msg00551.html

llvm-svn: 318610
2017-11-19 00:46:21 +00:00
Saleem Abdulrasool b3a66f7641 Driver: remove `SupportsObjCGC` (NFC)
This option is not used in the frontend.  Remove the method.

llvm-svn: 318609
2017-11-19 00:45:33 +00:00
Martell Malone 13c5d7379a [Driver] add initial support for alpine linux
set -pie as default for musl linux targets
add detection of alpine linux
append appropriate compile flags for alpine

Reviewers: rnk

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

llvm-svn: 318608
2017-11-19 00:08:12 +00:00
Eric Fiselier c812560c14 [LIT] Fix testing out-of-tree Clang builds
Summary:
Currently, LIT configures the LLVM binary path before the Clang binary path. However this breaks testing out-of-tree Clang builds (where the LLVM binary path includes a copy of Clang).

This patch reverses the order of the paths when looking for Clang, putting the Clang binary directory first.

Reviewers: zturner, beanz, chapuni, modocache, EricWF

Reviewed By: EricWF

Subscribers: mgorny, cfe-commits, llvm-commits

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

llvm-svn: 318607
2017-11-19 00:00:49 +00:00
Simon Pilgrim 72f40041f6 [MC][X86] Add test case from PR19251
llvm-svn: 318605
2017-11-18 23:23:25 +00:00
Simon Pilgrim 6960fe2e4e [MC][X86] Add teet case from PR32807
llvm-svn: 318603
2017-11-18 23:06:42 +00:00
Eric Fiselier 1ed231de44 Fix use of config.h in public headers.
The CodeGenCoverage.h header is installed, but it references
the build-only header "llvm/Config/config.h". This breaks use
of the CodeGenCoverage.h header once it is installed, because config.h isn't
available.

This patch fixes the error by moving the config.h include from
the CodeGenCoverage.h header (where it's not needed), to the
CodeGenCoverage.cpp source file.

llvm-svn: 318602
2017-11-18 22:42:26 +00:00
Jonas Hahnfeld 87d4426988 [OpenMP] Show error if VLAs are not supported
Some target devices (e.g. Nvidia GPUs) don't support dynamic stack
allocation and hence no VLAs. Print errors with description instead
of failing in the backend or generating code that doesn't work.

This patch handles explicit uses of VLAs (local variable in target
or declare target region) or implicitly generated (private) VLAs
for reductions on VLAs or on array sections with non-constant size.

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

llvm-svn: 318601
2017-11-18 21:00:46 +00:00
Jonas Toth 9b1dc4c275 [clang-tidy] Add new hicpp-multiway-paths-covered check for missing branches
Summary:
This check searches for missing `else` branches in `if-else if`-chains and
missing `default` labels in `switch` statements, that use integers as condition.

It is very similar to -Wswitch, but concentrates on integers only, since enums are
already covered.

The option to warn for missing `else` branches is deactivated by default, since it is
very noise on larger code bases.

Running it on LLVM:
{F5354858} for default configuration
{F5354866} just for llvm/lib/Analysis/ScalarEvolution.cpp, the else-path checker is very noisy!

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: aaron.ballman

Subscribers: lebedev.ri, Eugene.Zelenko, cfe-commits, mgorny, JDevlieghere, xazax.hun

Tags: #clang-tools-extra

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

llvm-svn: 318600
2017-11-18 19:48:33 +00:00
Simon Pilgrim 41fc45c4e6 [X86][AVX512VL] Add AVX512VL tests to the vselect packss tests.
PR34553 has gone, adding tests to ensure it doesn't come back.

vselect_packss_v16i64 still has some awful codegen on AVX512 targets....

llvm-svn: 318599
2017-11-18 19:47:59 +00:00
Sanjay Patel 7b61dc7a23 [CodeGen] change const-ness of complex calls
After clarification about the C standard, POSIX, and implementations:
The C standard allows errno-setting, and it's (unfortunately for optimization) even 
more clearly stated in the newer additions to the standards.

We can leave these functions as always constant ('c') because they don't 
actually do any math and therefore won't set errno:
cimag ( http://en.cppreference.com/w/c/numeric/complex/cimag )
creal ( http://en.cppreference.com/w/c/numeric/complex/creal )
cproj ( http://en.cppreference.com/w/c/numeric/complex/cproj )
conj (http://en.cppreference.com/w/c/numeric/complex/conj ) 

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

llvm-svn: 318598
2017-11-18 19:31:57 +00:00
Craig Topper 65b8a2c9e1 [X86] Add another gather test with v8i8 sign extended indices.
This requires the indices to be legalized and sign extended.

llvm-svn: 318597
2017-11-18 19:25:35 +00:00
Craig Topper 5d404f58dd [X86] Simplify the gather/scatter isel predicates.
We don't need a dyn_cast, the predicate already specified the base node. We only need to check the type of the index, the base ptr is guaranteed to be scalar.

llvm-svn: 318596
2017-11-18 19:05:12 +00:00
Craig Topper 410bbcdcf1 [X86] Qualify a few places with ExperimentalVectorWideningLegalization.
I'm playing around with this flag and these places cause errors if not qualified.

llvm-svn: 318595
2017-11-18 18:49:16 +00:00
Simon Pilgrim c9bc55a08d [X86] Add todo comment for TRUNC(SUB(X,C)) -> SUB(TRUNC(X),C')
As discussed on PR35295, but it causes regressions in combineSubToSubus which need to be addressed first 

llvm-svn: 318594
2017-11-18 18:33:07 +00:00
Florian Hahn 2a266a343f [CallSiteSplitting] Remove some indirection (NFC).
Summary:
With this patch I tried to reduce the complexity of the code sightly, by
removing some indirection. Please let me know what you think.

Reviewers: junbuml, mcrosier, davidxl

Reviewed By: junbuml

Subscribers: llvm-commits

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

llvm-svn: 318593
2017-11-18 18:14:13 +00:00
Sanjay Patel c0d1b2ee2e [x86] add tests for unnecessary shuffling; NFC
llvm-svn: 318592
2017-11-18 16:25:38 +00:00
Martin Storsjo 94b59240e2 [X86] Output cfi directives for saved XMM registers even if no GPRs are saved
This makes sure that functions that only clobber xmm registers
(on win64) also get the right cfi directives, if dwarf exceptions
are enabled.

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

llvm-svn: 318591
2017-11-18 06:23:48 +00:00
Craig Topper 3a431cfb13 [X86] Fix typo in variable name. NFC
llvm-svn: 318590
2017-11-18 05:09:55 +00:00
Quentin Colombet c0d34d38cb [AArch64] Map G_LOAD on FPR when the definition goes to a copy to FPR
We used to detect loads feeding fp instructions, but we were
failing to take into account cases where this happens through copies.
For instance, loads can fed copies coming from the ABI lowering
of floating point arguments/results.

llvm-svn: 318589
2017-11-18 04:28:59 +00:00
Quentin Colombet 63816c0957 [AArch64] Map G_STORE on FPR when the source comes from a FPR copy
We used to detect that stores were fed by fp instructions, but we were
failing to take into account cases where this happens through copies.
For instance, stores can be fed by copies coming from the ABI lowering
of floating point arguments.

llvm-svn: 318588
2017-11-18 04:28:58 +00:00
Quentin Colombet fe538f7145 [RegisterBankInfo] Relax the assert of having matching type sizes on default mappings
Instead of asserting that the type sizes are exactly equal, we check
that the new size is big enough to contain the original type.
We have to relax this constrain because, right now, we sometimes
specify that things that are smaller than a storage type are legal
instead of widening everything to the size of a storage type.
E.g., we say that G_AND s16 is legal and we map that on GPR32.

This is something we may revisit in the future (either by changing
the legalization process or keeping track separately of the storage
size and the size of the type), but let us reflect the reality of
the situation for now.

llvm-svn: 318587
2017-11-18 04:28:58 +00:00
Quentin Colombet 91801f68aa [AArch64][RegisterBankInfo] Teach instruction mapping about gpr32 -> fpr16 cross copies
Turns out this copies can actually occur because of the way we lower the
ABI for half.

llvm-svn: 318586
2017-11-18 04:28:56 +00:00
Rafael Espindola 8dc0e1095f Reorder static functions. NFC.
llvm-svn: 318584
2017-11-18 02:12:53 +00:00
Rafael Espindola 041299e3eb Split realPathFromHandle in two.
By having an UTF-16 version we avoid some code duplication in calling
GetFinalPathNameByHandleW.

llvm-svn: 318583
2017-11-18 02:05:59 +00:00
Eugene Zelenko 821f6983dc [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 318582
2017-11-18 01:47:41 +00:00
Walter Lee 9abeecc07c [asan] Add a full redzone after every stack variable
We were not doing that for large shadow granularity.  Also add more
stack frame layout tests for large shadow granularity.

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

llvm-svn: 318581
2017-11-18 01:13:18 +00:00
Davide Italiano e77c8425e1 [ABI] Remove dead code that was copy-pasted all around. NFCI.
llvm-svn: 318580
2017-11-18 00:54:31 +00:00
Davide Italiano 389dbb715c [Module] Throw away some more commented code. NFCI.
llvm-svn: 318579
2017-11-18 00:52:29 +00:00
Hans Wennborg 989a65cd29 Fix some -Wunused-variable warnings
llvm-svn: 318578
2017-11-18 00:49:18 +00:00
Davide Italiano 2078234697 [ABI/SysV] Remove more dead code. NFCI.
llvm-svn: 318577
2017-11-18 00:35:27 +00:00
Davide Italiano f5b0135c6b [Core] Garbage collect dead code untouched in years. NFCI.
This sketching can be resurrected if anybody needs it, although
I doubt is relevant these days.

llvm-svn: 318576
2017-11-18 00:34:09 +00:00
Evgeniy Stepanov 9d564cdcb0 Revert "[asan] Use dynamic shadow on 32-bit Android" and 3 more.
Revert the following commits:
  r318369 [asan] Fallback to non-ifunc dynamic shadow on android<22.
  r318235 [asan] Prevent rematerialization of &__asan_shadow.
  r317948 [sanitizer] Remove unnecessary attribute hidden.
  r317943 [asan] Use dynamic shadow on 32-bit Android.

MemoryRangeIsAvailable() reads /proc/$PID/maps into an mmap-ed buffer
that may overlap with the address range that we plan to use for the
dynamic shadow mapping. This is causing random startup crashes.

llvm-svn: 318575
2017-11-18 00:22:34 +00:00
Daniel Sanders c54aa9c844 [globalisel][tablegen] Generalize pointer-type inference by introducing ptypeN. NFC
ptypeN is functionally the same as typeN except that it informs the
SelectionDAG importer that an operand should be treated as a pointer even
if it was written as iN. This is important for patterns that use iN instead
of iPTR to represent pointers. E.g.:
  (set GPR64:$dst, (load GPR64:$addr))

Previously, this was handled as a hardcoded special case for the appropriate
operands to G_LOAD and G_STORE.

llvm-svn: 318574
2017-11-18 00:16:44 +00:00
Evgeniy Stepanov 0b44f44bcf [asan] Fix asan_device_setup on KitKat.
"ln" from toybox does not understand -f (force) flag.

llvm-svn: 318573
2017-11-17 23:52:34 +00:00
Reid Kleckner 6810c20c1b [lit] Try to improve Ctrl-C behavior on Windows
This functionality was broken during a refactor a while back because
'pool' is no longer in scope.

llvm-svn: 318572
2017-11-17 23:52:33 +00:00
Petr Hosek 41bfed13ca [CMake][runtimes] Don't passthrough prefixes for non-default targets
The passthrough is useful for setting up the options for the default
build, but we already have a different mechanism to pass CMake flags
to builds for builtins and runtimes targets so this is not really
needed there. Furthermore, when the flags are set for the default
build, with the prefix passthrough set we have to explicitly override
all options in other targets which can be cumbersome.

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

llvm-svn: 318571
2017-11-17 23:51:53 +00:00
Eugene Zelenko fd70e5de39 [AST] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 318570
2017-11-17 23:43:46 +00:00
Petr Hosek b74f98c4e4 [libunwind][CMake] Provide option to disable instalation of the library
This is useful in cases where we only build static library and
libunwind.a is combined with libc++abi.a into a single archive in which
case we don't want to have libunwind.a installed separately. The same
option is already provided by libcxx CMake build.

This change also adds the install-unwind target for consistency with the
libcxxabi and libcxx CMake build.

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

llvm-svn: 318569
2017-11-17 23:29:46 +00:00
Petr Hosek aa96d2ebbc [libcxxabi][CMake] Provide option to disable installing of the library
This is useful in cases where we only build static library and
libc++abi.a is combined with libc++.a into a single archive in which
case we don't want to have libc++abi.a installed separately. The same
option is already provided by libcxx CMake build.

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

llvm-svn: 318568
2017-11-17 23:25:09 +00:00
Anna Zaks 8ffd1932d0 Change code owner for Clang Static Analyzer to Devin Coughlin.
Differential Revision: https://reviews.llvm.org/D39964

llvm-svn: 318567
2017-11-17 23:19:04 +00:00
Zachary Turner dfeb170011 Fix an issue with llvm lit tool substitutions.
When using an installed clang with an in-tree llvm, we were not
searching in the right paths for the tools.

llvm-svn: 318564
2017-11-17 22:51:43 +00:00
Petr Hosek 56a1f07156 [CMake][libcxxabi] Support merging objects when statically linking unwinder
When using LLVM unwinder and static unwinder option is set, merge
libunwind and libc++abi objects into a single archive. libc++ already
supports merging libc++abi.a and libc++.a into a single archive; with
this change, it is possible to also include libunwind.a in the same
archive which is useful when doing static link and using libc++ as
a default C++ library and compiler-rt as a default runtime library.

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

llvm-svn: 318563
2017-11-17 22:49:39 +00:00
Michal Gorny ba996aba01 [cmake] Use llvm-lit directory when provided for stand-alone build
After the recent lit test changes, clang attempts to run its tests
via llvm-lit by default. However, the llvm-lit binary is not present
when performing stand-alone build resulting in a failure out of the box.

To solve that, add the llvm-lit directory to CMake when performing
a stand-alone build and LLVM sources are provided. This includes
the CMake rules generating the llvm-lit binary and effectively makes
it possible for clang to use it.

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

llvm-svn: 318562
2017-11-17 22:21:23 +00:00
Zhaoshi Zheng ceec175dff [NFC] Make r318597 compatible with clang-format
llvm-svn: 318561
2017-11-17 22:05:19 +00:00