Commit Graph

2835 Commits

Author SHA1 Message Date
Dehao Chen 5e97f23441 Expose -mllvm -accurate-sample-profile to clang.
Summary: With accurate sample profile, we can do more aggressive size optimization. For some size-critical application, this can reduce the text size by 20%

Reviewers: davidxl, rsmith

Reviewed By: davidxl, rsmith

Subscribers: mehdi_amini, eraman, sanjoy, cfe-commits

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

llvm-svn: 311707
2017-08-24 21:37:33 +00:00
Petar Jovanovic 5076511ed6 [mips] Introducing option -mabs=[legacy/2008]
In patch r205628 using abs.[ds] instruction is forced, as they should behave
in accordance with flags Has2008 and ABS2008. Unfortunately for revisions
prior mips32r6 and mips64r6, abs.[ds] is not generating correct result when
working with NaNs. To generate a sequence which always produce a correct
result but also to allow user more control on how his code is compiled,
option -mabs is added where user can choose legacy or 2008.
By default legacy mode is used on revisions prior R6. Mips32r6 and mips64r6
use abs2008 mode by default.

Patch by Aleksandar Beserminji

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

llvm-svn: 311669
2017-08-24 16:06:30 +00:00
Chad Rosier 38aa163611 [Driver][AArch64] Add tests for RDM feature.
Differential Revision: https://reviews.llvm.org/D37106

llvm-svn: 311660
2017-08-24 14:32:55 +00:00
Leo Li 23bb21cb92 [Driver] Register effective triple before get arm float abi.
Summary:
We need to register effective triple before calling `getARMFloatABI`.
Add missing code when `--print-libgcc-file-name` is passed.

Reviewers: atanasyan, rsmith, mgorny, peter.smith, kristof.beyls, compnerd, jroelofs

Reviewed By: compnerd

Subscribers: llvm-commits, aemerson, javed.absar, srhines, kristof.beyls, pirama

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

llvm-svn: 311624
2017-08-24 01:51:51 +00:00
Rui Ueyama a93f087d3e Revert r311552: [Bash-autocompletion] Add support for static analyzer flags
This reverts commit r311552 because it broke ubsan and asan bots.

llvm-svn: 311557
2017-08-23 14:48:58 +00:00
Yuka Takahashi 5e7071f5d7 [Bash-autocompletion] Add support for static analyzer flags
Summary:
This is a patch for clang autocomplete feature.

It will collect values which -analyzer-checker takes, which is defined in
clang/StaticAnalyzer/Checkers/Checkers.inc, dynamically.
First, from ValuesCode class in Options.td, TableGen will generate C++
code in Options.inc. Options.inc will be included in DriverOptions.cpp, and
calls OptTable's addValues function. addValues function will add second
argument to Option's Values class. Values contains string like "foo,bar,.."
which is handed to Values class
in OptTable.

Reviewers: v.g.vassilev, teemperor, ruiu

Subscribers: hiraditya, cfe-commits

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

llvm-svn: 311552
2017-08-23 13:39:47 +00:00
Dan Albert 79865d98d0 Degeneralize more tests.
As before, not every platform supports LTO. Make sure the platform
we're targeting is one that supports it (regardless of the *host*
platform).

llvm-svn: 311488
2017-08-22 21:16:22 +00:00
Dan Albert c3a11d5a00 Revert "Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""""
With tests fixed for Windows style paths now that they are going
through path canonicalization.

llvm-svn: 311487
2017-08-22 21:05:01 +00:00
George Karpenkov a2f383d072 Fixed driver tests for -fsanitize=fuzzer.
llvm-svn: 311412
2017-08-22 00:04:05 +00:00
George Karpenkov 9f6f74c2c5 Moving libFuzzer to compiler-rt: required updates to the Clang driver.
Differential Revision: https://reviews.llvm.org/D36909

llvm-svn: 311406
2017-08-21 23:25:19 +00:00
Akira Hatanaka a423cb431d [Driver][Darwin] Do not pass -munwind-table if -fno-excpetions is
supplied.

With this change, -fno-exceptions disables unwind tables unless
-funwind-tables is supplied too or the target is x86-64 (x86-64 requires
emitting unwind tables).

rdar://problem/33934446

llvm-svn: 311397
2017-08-21 22:46:46 +00:00
Sam Parker ffccda6303 [ARM][AArch64] Cortex-A75 and Cortex-A55 tests
Add frontend tests for Cortex-A75 and Cortex-A55, Arm's latest
big.LITTLE A-class cores. They implement the ARMv8.2-A architecture,
including the cryptography and RAS extensions, plus the optional dot
product extension. They also implement the RCpc AArch64 extension
from ARMv8.3-A.

Cortex-A75:
https://developer.arm.com/products/processors/cortex-a/cortex-a75

Cortex-A55:
https://developer.arm.com/products/processors/cortex-a/cortex-a55

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

llvm-svn: 311319
2017-08-21 08:52:45 +00:00
Matt Morehouse 5c7fc76983 [SanitizerCoverage] Add stack depth tracing instrumentation.
Summary:
Augment SanitizerCoverage to insert maximum stack depth tracing for
use by libFuzzer.  The new instrumentation is enabled by the flag
-fsanitize-coverage=stack-depth and is compatible with the existing
trace-pc-guard coverage.  The user must also declare the following
global variable in their code:
  thread_local uintptr_t __sancov_lowest_stack

https://bugs.llvm.org/show_bug.cgi?id=33857

Reviewers: vitalybuka, kcc

Reviewed By: vitalybuka

Subscribers: kubamracek, hiraditya, cfe-commits, llvm-commits

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

llvm-svn: 311186
2017-08-18 18:43:30 +00:00
Konstantin Zhuravlyov 0ebd9e18ef AMDGPU: Rename r600-mcpu.cl->amdgpu-mcpu.cl
llvm-svn: 311178
2017-08-18 17:29:07 +00:00
Konstantin Zhuravlyov a42719406f AMDGPU: add missing amdgcn processors and tests
- gfx600
  - gfx601
  - gfx703
  - gfx902
  - gfx903

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

llvm-svn: 311141
2017-08-18 01:13:39 +00:00
Hal Finkel e85a818add Don't use -no-integrated-as in test/Driver/opt-record.c
-no-integrated-as is not supported on some targets (e.g.,
x86_64-pc-windows-msvc). Testing using -save-temps is good enough to cover the
relevant logic, and that should work everywhere.

llvm-svn: 311043
2017-08-16 21:51:31 +00:00
Hal Finkel 67814df3ea Base optimization-record file names on the final output
Using Output.getFilename() to construct the file name used for optimization
recording in Clang::ConstructJob, when -c is provided, does not work correctly
if we're not using the integrated assembler. With -no-integrated-as (or
-save-temps) Output.getFilename() gives the name of the temporary assembly
file, not the final output file. Instead, use the final output (as provided by
-o). If this is not available, then fall back to using a name based on the
input file.

Fixes PR31532.

llvm-svn: 311041
2017-08-16 21:34:27 +00:00
Petr Hosek 766288b191 [Driver] SafeStack does not need a runtime library on Fuchsia
Patch by Roland McGrath

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

llvm-svn: 311034
2017-08-16 19:06:05 +00:00
Dan Albert 5671b890ea Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux."""
llvm-svn: 310977
2017-08-15 23:57:34 +00:00
Dan Albert 8afdd2f81e Revert "Add a target for new LTO plugin name tests."
llvm-svn: 310976
2017-08-15 23:57:32 +00:00
Dan Albert 255387650a Add a target for new LTO plugin name tests.
Not all targets will use -plugin with -flto. Pick a fixed target so
this works regardless of the default target (regardless of host OS,
the toolchain should be picking the correct LTO plugin for a target
that supports it).

llvm-svn: 310966
2017-08-15 22:10:44 +00:00
Dan Albert fe9f1e60c5 Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""
Summary:
Relanding https://reviews.llvm.org/D35739 which was reverted because
it broke the tests on non-Linux. The tests have been fixed to be
platform agnostic, and additional tests have been added to make sure
that the plugin has the correct extension on each platform
(%pluginext doesn't work in CHECK lines).

Reviewers: srhines, pirama

Reviewed By: srhines

Subscribers: emaste, mehdi_amini, eraman, cfe-commits

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

llvm-svn: 310960
2017-08-15 21:31:17 +00:00
Kuba Mracek 5b57633a45 [clang] Get rid of "%T" expansions
The %T lit expansion expands to a common directory shared between all the tests in the same directory, which is unexpected and unintuitive, and more importantly, it's been a source of subtle race conditions and flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it would be best to simply ban %T and only keep %t, which is unique to each test. When a test needs a temporary directory, it can just create one using mkdir %t.

This patch removes %T in clang.

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

llvm-svn: 310950
2017-08-15 19:47:06 +00:00
Jonas Hahnfeld 21b60edb05 Fix memory leak in ToolChain::TranslateOpenMPTargetArgs
rL310433 introduced a code path where DAL is not returned and must be freed.
This change allows to run openmp-offload.c when Clang is built with ASan.

llvm-svn: 310817
2017-08-14 07:44:05 +00:00
Alex Shlyapnikov a9f6a52925 Disabling openmp-offload.c on linux until it is stabilized on all local configurations.
Differential revision: https://reviews.llvm.org/D29660

llvm-svn: 310772
2017-08-11 23:10:39 +00:00
Gheorghe-Teodor Bercea 0499212ebf [OpenMP] Move failing flag tests to disabled GPU
offloading test file. This should prevent further errors
with the sanitizer.

Diff: D29660
llvm-svn: 310765
2017-08-11 21:17:50 +00:00
George Karpenkov 33613f63f6 Add -fsanitize=fuzzer-no-link flag to the driver.
The flag will perform instrumentation necessary to the fuzzing,
but will NOT link libLLVMFuzzer.a library.
Necessary when modifying CFLAGS for projects which may produce
executables as well as a fuzzable target.

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

llvm-svn: 310733
2017-08-11 17:22:58 +00:00
Gheorghe-Teodor Bercea 9c52574886 [OpenMP] Enable previously successful offloading tests.
Create a separate test file to contain all tests for OpenMP
offloading to GPUs.

Make libdevice checking more robust by accounting for
the case in which no libdevice is found.

This changes are in connrection with diff: D29660

llvm-svn: 310718
2017-08-11 15:46:22 +00:00
Simon Dardis 16bddf21cf [mips] Add missing mips-registered-target to mips test.
llvm-svn: 310715
2017-08-11 15:23:23 +00:00
Simon Dardis ad9d05de8f [mips] Support implicit gpopt with N64 when using -fno-pic
As clang defaults to -mno-abicalls when using -fno-pic for N64, implicitly use
-mgpopt in that case.

Reviewers: atanasyan

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

llvm-svn: 310714
2017-08-11 15:01:34 +00:00
Kamil Rytarowski 9fef3b3948 Enable bunch of sanitizers on NetBSD/X86 and X86_64
Summary:
Enable more sanitizers:
 - i386 and amd64:
 * SanitizerKind::Vptr;
 * SanitizerKind::Leak;
 * SanitizerKind::SafeStack;
 * SanitizerKind::Function;

 - amd64 only:
 * SanitizerKind::Thread;

These sanitizers are in the process of upstreaming to LLVM projects.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, dim, vitalybuka, kcc, filcab, fjricci

Reviewed By: vitalybuka

Subscribers: #sanitizers, cfe-commits

Tags: #sanitizers

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

llvm-svn: 310649
2017-08-10 18:53:52 +00:00
Alex Shlyapnikov 5f1ac1444b Disabling openmp-offload.c on linux until it is stabilized on all local configurations.
llvm-svn: 310640
2017-08-10 17:55:01 +00:00
Gheorghe-Teodor Bercea 14528c60ba [OpenMP] Delete tests in openmp-offload.c which cuase failures
until a better way to perform these tests is figured out.

Change connected to diff: D29654

llvm-svn: 310625
2017-08-10 16:56:59 +00:00
Simon Atanasyan c717041e84 [mips] Group all `-mabicalls` related checks in the single place. NFC
llvm-svn: 310615
2017-08-10 15:42:31 +00:00
Simon Atanasyan c038841e8b [mips] Show warning in case of mixing -mlong-calls and -mabicalls options
While we do not support `-mshared / -mno-shared` properly, show warning
and ignore `-mlong-calls` option in case of implicitly or explicitly
provided `-mabicalls` option.

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

llvm-svn: 310614
2017-08-10 15:42:25 +00:00
Simon Atanasyan 3306e3a8e8 [mips] Notify user that `-mabicalls` is ignored on non-PIC N64 ABI
The -mabicalls option does not make sense in the case of non position
independent code for the N64 ABI. After this change the driver shows a
warning that -mabicalls is ignored in that case.

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

llvm-svn: 310613
2017-08-10 15:42:16 +00:00
Alex Lorenz 994f231792 Revert r310489 and follow-up commits r310505, r310519, r310537 and r310549
Commit r310489 caused 'openmp-offload.c' test failures on Darwin and other
platforms:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/39230/testReport/junit/Clang/Driver/openmp_offload_c/

The follow-up commits tried to fix the test, but the test is still failing.

llvm-svn: 310580
2017-08-10 10:34:46 +00:00
Gheorghe-Teodor Bercea 57dbc55c88 [OpenMP] Remove offending test.
Diff: D29660
llvm-svn: 310537
2017-08-09 23:47:41 +00:00
Gheorghe-Teodor Bercea 94ab42b49c [OpenMP] Fix failing test for D29660.
Non-functional change.

llvm-svn: 310519
2017-08-09 20:52:58 +00:00
Hans Wennborg 7d928cc596 Make -std=c++17 an alias of -std=c++1z
As suggested on PR33912.

Trying to keep this small to make it easy to merge to the 5.0 branch. We
can do a follow-up with more thorough renaming (diagnostic text,
options, ids, etc.) later.

(For C++14 this was done in r215982, and I think a smaller patch for the
3.5 branch:
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20140818/113013.html)

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

llvm-svn: 310516
2017-08-09 20:12:53 +00:00
Gheorghe-Teodor Bercea 9d652e9294 [OpenMP] Make the PTX version tests general enough to work on all toolchains.
Add explicit test for Darwin and PowerPC. Clean-up tests.

Non-functional change.

Original diff: D29660

llvm-svn: 310505
2017-08-09 18:25:52 +00:00
Gheorghe-Teodor Bercea 6b26dcb6d6 [OpenMP] Add flag for overwriting default PTX version for OpenMP targets
Summary:
This flag "--fopenmp-ptx=" enables the overwriting of the default PTX version used for GPU offloaded OpenMP target regions: "+ptx42".



Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar

Reviewed By: ABataev

Subscribers: rengolin, cfe-commits

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

llvm-svn: 310489
2017-08-09 15:56:54 +00:00
Gheorghe-Teodor Bercea 0846582878 [OpenMP] Add flag for disabling the default generation of relocatable OpenMP target code for NVIDIA GPUs.
Summary: Previously we have added the "-c" flag which gets passed to PTXAS by default to generate relocatable OpenMP target code by default. This set of flags exposes control over this behaviour.

Reviewers: arpith-jacob, caomhin, carlo.bertolli, ABataev, Hahnfeld, jlebar, hfinkel, tstellar

Reviewed By: ABataev

Subscribers: Hahnfeld, rengolin, cfe-commits

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

llvm-svn: 310484
2017-08-09 15:27:39 +00:00
Gheorghe-Teodor Bercea b9d117233f [OpenMP] Make OpenMP generated code for the NVIDIA device relocatable by default
Original Diff: D29642

This patch was previously reverted due to an error with patch D29654
that this depends on.

llvm-svn: 310479
2017-08-09 14:59:35 +00:00
Gheorghe-Teodor Bercea 5289843597 [OpenMP] Fix bug regarding cubin integration into host binary
when a BindArchAction is used.

This is not a functional change.

Original Diff: D29654

llvm-svn: 310433
2017-08-09 01:02:19 +00:00
Kostya Serebryany 9f338dcd4f [sanitizer-coverage] -fsanitize-coverage=bb,inline-8bit-counters
llvm-svn: 310409
2017-08-08 20:20:40 +00:00
Gheorghe-Teodor Bercea ee914104d9 Non-functional change. Fix test for D29654.
llvm-svn: 310368
2017-08-08 15:13:07 +00:00
Gheorghe-Teodor Bercea 2c92693280 [OpenMP] OpenMP device offloading code generation produces a cubin file which is then integrated in the host binary using the host linker.
Diff: D29654

llvm-svn: 310362
2017-08-08 14:33:05 +00:00
Alex Lorenz 7e9c478cda Revert r310291, r310300 and r310332 because of test failure on Darwin
The commit r310291 introduced the failure. r310332 was a test fix commit and
r310300 was a followup commit. I reverted these two to avoid merge conflicts
when reverting.

The 'openmp-offload.c' test is failing on Darwin because the following
run lines:
// RUN:   touch %t1.o
// RUN:   touch %t2.o
// RUN:   %clang -### -no-canonical-prefixes -fopenmp=libomp -fopenmp-targets=nvptx64-nvidia-cuda -save-temps -no-canonical-prefixes %t1.o %t2.o 2>&1 \
// RUN:   | FileCheck -check-prefix=CHK-TWOCUBIN %s

trigger the following assertion:

Driver.cpp:3418:
    assert(CachedResults.find(ActionTC) != CachedResults.end() &&
           "Result does not exist??");

llvm-svn: 310345
2017-08-08 11:20:17 +00:00
Reid Kleckner 908ac3916d Fix openmp-offload.c test on Windows
llvm-svn: 310332
2017-08-08 01:36:16 +00:00