Commit Graph

269355 Commits

Author SHA1 Message Date
Ahmed Bougacha a24e4cda00 Revert "[AsmParser] Hash is not a comment on some targets"
This reverts commit r310457.

It causes clang-produced IR to fail llvm codegen.

llvm-svn: 310662
2017-08-10 21:23:00 +00:00
Reid Kleckner 8d4d57035f Revert "[clang-tidy] Refactor the code and add a close-on-exec check on memfd_create() in Android module."
This reverts commit r310630.

The new code broke on Windows and was untested. On Linux, it was
selecting the "int" overload of operator<<, which definitely does not
print the right thing when fed a "Mode" char.

llvm-svn: 310661
2017-08-10 21:21:15 +00:00
Reid Kleckner 6be1ed05c7 Disable some IR death tests when SEH is available
They hang for me locally. I suspect that there is a use-after-free when
attempting to destroy an LLVMContext after asserting from the middle of
metadata tracking. It doesn't seem worth debugging it further.

llvm-svn: 310660
2017-08-10 21:14:07 +00:00
Nirav Dave f8556ad48f Revert "[DAG] Cleanup unused nodes after store merge. NFCI."
This reverts commit r310648 which causes an unexpected assertion failure

llvm-svn: 310659
2017-08-10 21:03:36 +00:00
Craig Topper 9a6110b2d3 [InstCombine] Make (X|C1)^C2 -> X^(C1^C2) iff X&~C1 == 0 work for splat vectors
This also corrects the description to match what was actually implemented. The old comment said X^(C1|C2), but it implemented X^((C1|C2)&~(C1&C2)). I believe ((C1|C2)&~(C1&C2)) is equivalent to (C1^C2).

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

llvm-svn: 310658
2017-08-10 20:35:34 +00:00
Craig Topper 699ae0c173 [X86] Implement __builtin_cpu_is
This patch adds support for __builtin_cpu_is. I've tried to match the strings supported to the latest version of gcc.

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

llvm-svn: 310657
2017-08-10 20:28:30 +00:00
Nirav Dave 4d28c0ff4f [DAG] Relax type restriction for store merge
Summary: Allow stores of bitcastable types to be merged by peeking through BITCAST nodes and recasting stored values constant and vector extract nodes as necessary.

Reviewers: jyknight, hfinkel, efriedma, RKSimon, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 310655
2017-08-10 19:52:45 +00:00
Simon Pilgrim b59c2d9d73 [CostModel][X86] Add SSE2 two-src shuffle costs
llvm-svn: 310654
2017-08-10 19:32:35 +00:00
Eli Friedman e9499dd4c7 [ARM] Clarify legal addressing modes for ARM and Thumb2. NFC
The existing code is very clever, but not clear, which seems
like the wrong tradeoff here.

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

llvm-svn: 310653
2017-08-10 19:31:27 +00:00
Benjamin Kramer dbbe5756c1 [gold-plugin] Use more StringRef. No functionality change intended.
llvm-svn: 310652
2017-08-10 19:28:00 +00:00
Kamil Rytarowski 7a6b680622 Enable ASAN on NetBSD
Summary:
This enables also static runtime option.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, filcab, kcc, fjricci

Reviewed By: vitalybuka

Subscribers: mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310651
2017-08-10 19:08:39 +00:00
Simon Pilgrim 7354531b82 [CostModel][X86] Add avx1 two-src shuffle costs
llvm-svn: 310650
2017-08-10 19:02:51 +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
Nirav Dave 99d9d24553 [DAG] Cleanup unused nodes after store merge. NFCI.
llvm-svn: 310648
2017-08-10 18:53:14 +00:00
Kamil Rytarowski 4ad374ea76 Add NetBSD support in asan_linux.cc
Summary:
Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas.

Sponsored by <The NetBSD Foundation>

Reviewers: fjricci, vitalybuka, joerg, kcc, filcab

Reviewed By: vitalybuka

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310647
2017-08-10 18:51:51 +00:00
Kamil Rytarowski fbd51b954d Enable SafeStack on NetBSD
Summary:
make check-safestack:

-- Testing: 8 tests, 8 threads --
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 0.44s
  Expected Passes    : 7
  Unsupported Tests  : 1

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, kcc, fjricci, filcab

Reviewed By: vitalybuka

Subscribers: mgorny, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 310646
2017-08-10 18:40:09 +00:00
Simon Pilgrim ac2e50a4ca [CostModel][X86] Add avx2 two-src shuffle costs
llvm-svn: 310645
2017-08-10 18:29:34 +00:00
Ed Maste 93cdee661c remove FreeBSD xfail decorator from TestCppNsImport
The Linux xfail decorator was removed in r272326 with the claim that the
test "runs reliably on the linux x86 buildbot." It also runs reliably on
FreeBSD for me.

llvm.org/pr25925

llvm-svn: 310644
2017-08-10 18:26:52 +00:00
Yan Wang acd70d3c6b [clang-tidy] Fix a buildbot.
Fix format in ReleaseNotes.rst.

llvm-svn: 310643
2017-08-10 18:19:40 +00:00
Taewook Oh f5040b9685 Make .file directive to have basename only
Summary:
Currently LLVM puts directory along with the filename in .file directive, but this behavior doesn't match gcc. There's a no clear description about which one is right (https://sourceware.org/binutils/docs/as/File.html#File), but one document (https://sourceware.org/gdb/current/onlinedocs/stabs/ELF-Linker-Relocation.html) suggests that STT_FILE symbol in elf file is expected to have basename only, which should have a same sting file .file directive according to (https://docs.oracle.com/cd/E26502_01/html/E28388/eoiyg.html).

This also affects badly on the build system that uses hashing, as the directory info could be differnt from developer to developer even when they're working on same file.

Reviewers: pcc, mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 310642
2017-08-10 18:17:11 +00:00
Simon Pilgrim 2f529412e1 [CostModel][X86] Extend two src shuffle cost tests
Cover most 128/256/512/1024-bit cases for vXf64/vXi64, vXf32/vXi32, vXi16 + vXi8

llvm-svn: 310641
2017-08-10 18:02:45 +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
Craig Topper 57b4d8646b [InstCombine] Fix a crash in getSelectCondition if we happen to have two inverse vectors of i1 constants.
We used to try to truncate the constant vector to vXi1, but if it's already i1 this would fail. Instead we now use IRBuilder::getZExtOrTrunc which should check the type and only create a trunc if needed. I believe this should trigger constant folding in the IRBuilder and ultimately do the same thing just with the additional type check.

llvm-svn: 310639
2017-08-10 17:48:14 +00:00
Craig Topper cd13ebca5f [InstCombine] Add a DEBUG_COUNTER to InstCombine to limit how many instructions are visited for debug
Sometimes it would be nice to stop InstCombine mid way through its combining to see the current IR. By using a debug counter we can place an upper limit on how many instructions to process.

This will also allow skipping the first X combines, but that has the potential to change later combines since earlier canonicalizations might have been skipped.

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

llvm-svn: 310638
2017-08-10 17:48:12 +00:00
Craig Topper 9cd976d041 [DebugCounter] Move the semicolon out of the DEBUG_COUNTER macro and require it to be placed at the end of each use.
This make it consistent with STATISTIC which it will often appears near.

While there move one DEBUG_COUNTER instance out of an anonymous namespace. It's already declaring a static variable so the namespace is unnecessary.

llvm-svn: 310637
2017-08-10 17:48:11 +00:00
Benjamin Kramer 74fbf45f4c [gold-plugin] Avoid race condition when creating temporary files.
This is both a potential security issue and a potential functionality
issue because we create temporary files from multiple threads. Use
the safe version of createTemporaryFile instead.

llvm-svn: 310636
2017-08-10 17:38:41 +00:00
Simon Pilgrim fe67612eba [CostModel][X86] Add avx512vbmi broadcast/reverse/single-src shuffle cost tests
llvm-svn: 310633
2017-08-10 17:33:25 +00:00
Simon Pilgrim 702e5fa391 [CostModel][X86] Improve single src shuffle costs
Add missing SK_PermuteSingleSrc costs for AVX2 targets and earlier, also added some of the simpler SK_PermuteTwoSrc costs to support splitting of SK_PermuteSingleSrc shuffles

llvm-svn: 310632
2017-08-10 17:27:20 +00:00
Simon Pilgrim c3e546fe42 Fix 'not all control paths return' warning on windows builds. NFCI.
llvm-svn: 310631
2017-08-10 17:20:09 +00:00
Yan Wang d61c2a18cb [clang-tidy] Refactor the code and add a close-on-exec check on memfd_create() in Android module.
Summary:
1. Refactor the structure of the code by adding a base class for all close-on-exec checks, which implements most of the needed functions.
2. memfd_create() is better to set MFD_CLOEXEC flag to avoid file descriptor leakage.

Reviewers: alexfh, aaron.ballman, hokein

Reviewed By: alexfh, hokein

Subscribers: Eugene.Zelenko, chh, cfe-commits, srhines, mgorny, JDevlieghere, xazax.hun

Tags: #clang-tools-extra

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

llvm-svn: 310630
2017-08-10 17:18:10 +00:00
Brian Gesiak 75023dbf51 [Parse] Document Parser::SkipFunctionBodies
Reviewers: erikjv, doug.gregor

Subscribers: cfe-commits

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

llvm-svn: 310627
2017-08-10 17:02:04 +00:00
Ed Maste 140dd57242 remove FreeBSD xfail decorator from TestCallStdStringFunction
This test is consistently reporting unexpected pass for me on FreeBSD
10 and 12. It was failing on the old FreeBSD buildbot which has now been
retired for some time. Will investigate further if this fails once a new
buildbot is configured and running tests.

llvm.org/pr17807

llvm-svn: 310626
2017-08-10 17:01:51 +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
Ed Maste e3842476de remove FreeBSD xfail decorator from TestExitDuringBreak
This test passes for me on FreeBSD 10 and 12(-CURRENT).

llvm.org/pr18190

llvm-svn: 310624
2017-08-10 16:48:36 +00:00
Marek Sokolowski d0c5bfa233 Fixup for r310621: Hint the compilers about unreachable code.
llvm-svn: 310623
2017-08-10 16:46:52 +00:00
Bob Wilson 7a85cc52d7 Add a getName accessor for ModuleMacros.
Swift would like to be able to access the name of a ModuleMacro.
There was some discussion of this in
https://github.com/apple/swift-clang/pull/93, suggesting that it makes
sense to have this accessor in Clang.

llvm-svn: 310622
2017-08-10 16:42:46 +00:00
Marek Sokolowski 719e22d4f4 Add .rc scripts tokenizer.
This extends the shell of llvm-rc tool with the ability of tokenization
of the input files. Currently, ASCII and ASCII-compatible UTF-8 files
are supported.

Thanks to Nico Weber (thakis) for his original work in this area.

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

llvm-svn: 310621
2017-08-10 16:21:44 +00:00
Rui Ueyama 27fbd1e14a Remove ResolvedReloc.
ResolvedReloc struct is always passed to a callback function and not
stored anywhere. That is, in effect, we use the struct to pack multiple
arguments to one argument, which doesn't make much sense. This patch
removes the struct and passes the members to the callback directly.

llvm-svn: 310620
2017-08-10 16:21:04 +00:00
Krzysztof Parzyszek bea30c6286 Add "Restored" flag to CalleeSavedInfo
The liveness-tracking code assumes that the registers that were saved
in the function's prolog are live outside of the function. Specifically,
that registers that were saved are also live-on-exit from the function.
This isn't always the case as illustrated by the LR register on ARM.

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

llvm-svn: 310619
2017-08-10 16:17:32 +00:00
Ilya Biryukov b88de41636 Fixed a race condition in PrecompiledPreamble.
Summary:
Two PrecompiledPreambles, used in parallel on separate threads,
could be writing preamble to the same temporary file.

Reviewers: bkramer, krasimir, klimek

Reviewed By: klimek

Subscribers: cfe-commits

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

llvm-svn: 310618
2017-08-10 16:10:40 +00:00
Rui Ueyama 9c77d27004 Garbage-collect common symbols.
Liveness is usually a notion of input sections, but this patch adds
"liveness" bit to common symbols because they don't belong to any
input section.

This patch is based on https://reviews.llvm.org/D36520

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

llvm-svn: 310617
2017-08-10 15:54:27 +00:00
Momchil Velikov 57c681f33e Place implictly declared functions at block scope
Such implicitly declared functions behave as if the enclosing block
contained the declaration extern int name() (C90, 6.3.3.2 Function calls),
thus their names should have block scope (C90, 6.1.2.1 Scope of identifiers).

This patch fixes https://bugs.llvm.org/show_bug.cgi?id=33224

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

llvm-svn: 310616
2017-08-10 15:43:06 +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
Philip Pfaffe 7b5eaa6f62 Add missing license text to two headers. NFC.
llvm-svn: 310612
2017-08-10 15:40:36 +00:00
Sanjay Patel 71de9d7cab [InstCombine] add memcpy expansion tests with potential DL dependency; NFC
Current behavior is to transform these independently of the datalayout.

There's a proposal to change this in D35035:
https://reviews.llvm.org/D35035

llvm-svn: 310611
2017-08-10 15:37:26 +00:00
Marcello Maggioni 61f48ca35e [unittests] Adding a unittest for ChangeTaTargetIndex. NFC
Differential Revision: https://reviews.llvm.org/D36565

llvm-svn: 310610
2017-08-10 15:35:25 +00:00
Brian Gesiak a9d31f9199 [Parse] Document PrintStats, SkipFunctionBodies
Summary:
Add documentation for `clang::ParseAST` parameters `PrintStats` and
`SkipFunctionBodies`. Also, remove a tiny bit of trailing whitespace.

Reviewers: craig.topper, doug.gregor, erikjv

Subscribers: cfe-commits

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

llvm-svn: 310609
2017-08-10 15:30:35 +00:00
Nirav Dave 06242a99ce [DAG] Rewrite expression. NFC.
llvm-svn: 310608
2017-08-10 15:29:33 +00:00