platform/upstream/llvm.git
6 years agoFreeBSD driver / Xray flags moving pthread to compile flags.
Kamil Rytarowski [Thu, 22 Feb 2018 06:31:40 +0000 (06:31 +0000)]
FreeBSD driver / Xray flags moving pthread to compile flags.

Summary:
- Using -lpthread instead, with -pthread the linkage does not work.
-Warning about the -fxray-instrument usage outside of the working cases.

Patch by: David CARLIER

Reviewers: krytarowski, vitalybuka, dberris, emaste

Reviewed By: krytarowski, emaste

Subscribers: srhines, emaste, cfe-commits

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

llvm-svn: 325746

6 years ago[SCEV][NFC] Factor out common logic into a separate method
Max Kazantsev [Thu, 22 Feb 2018 06:27:32 +0000 (06:27 +0000)]
[SCEV][NFC] Factor out common logic into a separate method

SCEV has multiple occurences of code when we need to prove some predicate on
every iteration of a loop and do it with invocations of couple `isLoopEntryGuardedByCond`,
`isLoopBackedgeGuardedByCond`. This patch factors out these two calls into a separate
method. It is a preparation step to extend this logic: it is not the only way how we can prove
such conditions.

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

llvm-svn: 325745

6 years agoRemove empty files
Kamil Rytarowski [Thu, 22 Feb 2018 06:11:28 +0000 (06:11 +0000)]
Remove empty files

Left over after D43382

llvm-svn: 325744

6 years agoXray instrumentation / enabling more tests
Kamil Rytarowski [Thu, 22 Feb 2018 06:08:26 +0000 (06:08 +0000)]
Xray instrumentation / enabling more tests

Summary:
The Unix subdirectory mostly allows only on Linux x86_64 but now we can target x86_64 arch in general.

Patch by David CARLIER

Reviewers: krytarowski, dberris, emaste

Reviewed By: krytarowski, dberris, emaste

Subscribers: emaste, llvm-commits, #sanitizers

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

llvm-svn: 325743

6 years ago[ODRHash] Fix hashing for friend functions.
Richard Trieu [Thu, 22 Feb 2018 05:50:29 +0000 (05:50 +0000)]
[ODRHash] Fix hashing for friend functions.

When hashing a templated function, use the hash of the function it was
instantiated from.

llvm-svn: 325742

6 years ago[ODRHash] Handle some template weirdness.
Richard Trieu [Thu, 22 Feb 2018 05:32:25 +0000 (05:32 +0000)]
[ODRHash] Handle some template weirdness.

Build the index off of DeclarationName instead of Decl pointers.  When finding
an UnresolvedLookupExprClass, hash it as if it were a DeclRefExpr.  This will
allow methods to be hashed.

llvm-svn: 325741

6 years agoAdd another test case to the deduction guide for basic_string.
Marshall Clow [Thu, 22 Feb 2018 05:14:20 +0000 (05:14 +0000)]
Add another test case to the deduction guide for basic_string.

llvm-svn: 325740

6 years ago[PowerPC] Do not produce invalid CTR loop with an FRem
Nemanja Ivanovic [Thu, 22 Feb 2018 03:02:41 +0000 (03:02 +0000)]
[PowerPC] Do not produce invalid CTR loop with an FRem

An FRem instruction inside a loop should prevent the loop from being converted
into a CTR loop since this is not an operation that is legal on any PPC
subtarget. This will always be a call to a library function which means the
loop will be invalid if this instruction is in the body.

Fixes PR36292.

llvm-svn: 325739

6 years ago[Utils] Avoid a hash table lookup in salvageDI, NFC
Vedant Kumar [Thu, 22 Feb 2018 01:29:41 +0000 (01:29 +0000)]
[Utils] Avoid a hash table lookup in salvageDI, NFC

According to the current coverage report salvageDebugInfo() is called
5.12 million times during testing and almost always returns early.

The early return depends on LocalAsMetadata::getIfExists returning null,
which involves a DenseMap lookup in an LLVMContextImpl. We can probably
speed this up by simply checking the IsUsedByMD bit in Value.

llvm-svn: 325738

6 years ago[X86][MMX] Generlize MMX_MOVD64rr combines to accept v4i16/v8i8 build vectors as...
Simon Pilgrim [Wed, 21 Feb 2018 23:07:30 +0000 (23:07 +0000)]
[X86][MMX] Generlize MMX_MOVD64rr combines to accept v4i16/v8i8 build vectors as well as v2i32

Also handle both cases where the lower 32-bits of the MMX is undef or zero extended.

llvm-svn: 325736

6 years agobpf: disable DwarfUsesRelocationsAcrossSections
Yonghong Song [Wed, 21 Feb 2018 22:59:14 +0000 (22:59 +0000)]
bpf: disable DwarfUsesRelocationsAcrossSections

The pahole does not work with BPF backend properly:

  -bash-4.2$ cat test.c
  struct test_t {
    int a;
    int b;
  };
  int test(struct test_t *s) {
    return s->a;
  }
  -bash-4.2$ clang -g -O2 -target bpf -c test.c
  -bash-4.2$ pahole test.o
  struct clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) {
          clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) clang version 7.0.0 (trunk 325446) (llvm/trunk 325464); /*     0     4 */
          clang version 7.0.0 (trunk 325446) (llvm/trunk 325464) clang version 7.0.0 (trunk 325446) (llvm/trunk 325464); /*     4     4 */

          /* size: 8, cachelines: 1, members: 2 */
          /* last cacheline: 8 bytes */
  };
  -bash-4.2$

The reason is that BPF backend is not yet implemented in elfutils backend
  https://github.com/threatstack/elfutils/tree/master/backends
and pahole depends on elfutils for dwarf parsing and resolving relocation.

More specifically, the unsupported relocation in .debug_info for type/member name
against symbol table caused the incorrect result above. The following is
the raw .rel.debug_info for the above example,
  Hex dump of section '.rel.debug_info':
    0x00000000 06000000 00000000 0a000000 0b000000 ................
    0x00000010 0c000000 00000000 0a000000 01000000 ................
    0x00000020 12000000 00000000 0a000000 02000000 ................
    0x00000030 16000000 00000000 0a000000 0e000000 ................
    0x00000040 1a000000 00000000 0a000000 03000000 ................
               ----------------- -------- --------
                reloc location     type   symtab index

  Hex dump of section '.debug_info':
    0x00000000 7b000000 04000000 00000801 00000000 {...............
    0x00000010 0c000000 00000000 00000000 00000000 ................
    0x00000020 00000000 00001000 00000200 00000000 ................

Based on "type", the proper value will be extracted from symbol table
and filled in .debug_info so later on .debug_info can be properly
resolved against debug strings.

There are two ways to fix this problem. One is to fix elfutils by adding
BPF support which is desirable. This could take a long time and won't work
with already deployed pahole. For a short term workaround, we can disable
dwarf cross-section relation which specifically avoids debug_info and
symbol table cross relocation. This should help any dwarf-related tool
which has not implement BPF specific relocations yet.

Now .rel.debug_info does not have any relocation for symbol table and
.debug_info itself contains necessary relocation information by itself.
  Hex dump of section '.debug_info':
    0x00000000 7b000000 04000000 00000801 00000000 {...............
    0x00000010 0c003700 00000000 00003e00 00000000 ..7.......>.....
    0x00000020 00000000 00001000 00000200 00000000 ................
  location 0xc has 0, 0x12 has 0x37, 0x1a has 0x3e in place which
  will be used in relocation resolution. Here, the values of 0, 0x37 and 0x3e
  are offset in .debug_str section.
Please note the difference between two above .debug_info dumps.

With the fix, pahole works properly with BPF backend:
  -bash-4.2$ clang -O2 -g -target bpf -c test.c
  -bash-4.2$ pahole test.o
  struct test_t {
          int                        a;                    /*     0     4 */
          int                        b;                    /*     4     4 */

          /* size: 8, cachelines: 1, members: 2 */
          /* last cacheline: 8 bytes */
  };

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325735

6 years ago[InstCombine] add some random FMF to tests so we know it's not dropped; NFC
Sanjay Patel [Wed, 21 Feb 2018 22:48:28 +0000 (22:48 +0000)]
[InstCombine] add some random FMF to tests so we know it's not dropped; NFC

llvm-svn: 325734

6 years ago[Driver] Generate .eh_frame_hdr for static executables too.
Dan Albert [Wed, 21 Feb 2018 22:36:51 +0000 (22:36 +0000)]
[Driver] Generate .eh_frame_hdr for static executables too.

Summary: libgcc won't unwind without an .eh_frame_hdr section.

Reviewers: srhines, chandlerc

Reviewed By: chandlerc

Subscribers: chandlerc, cfe-commits

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

llvm-svn: 325733

6 years agoResubmit r325107 (case folding DJB hash)
Pavel Labath [Wed, 21 Feb 2018 22:36:31 +0000 (22:36 +0000)]
Resubmit r325107 (case folding DJB hash)

The issue was that the has function was generating different results depending
on the signedness of char on the host platform. This commit fixes the issue by
explicitly using an unsigned char type to prevent sign extension and
adds some extra tests.

The original commit message was:

This patch implements a variant of the DJB hash function which folds the
input according to the algorithm in the Dwarf 5 specification (Section
6.1.1.4.5), which in turn references the Unicode Standard (Section 5.18,
"Case Mappings").

To achieve this, I have added a llvm::sys::unicode::foldCharSimple
function, which performs this mapping. The implementation of this
function was generated from the CaseMatching.txt file from the Unicode
spec using a python script (which is also included in this patch). The
script tries to optimize the function by coalescing adjecant mappings
with the same shift and stride (terms I made up). Theoretically, it
could be made a bit smarter and merge adjecant blocks that were
interrupted by only one or two characters with exceptional mapping, but
this would save only a couple of branches, while it would greatly
complicate the implementation, so I deemed it was not worth it.

Since we assume that the vast majority of the input characters will be
US-ASCII, the folding hash function has a fast-path for handling these,
and only whips out the full decode+fold+encode logic if we encounter a
character outside of this range. It might be possible to implement the
folding directly on utf8 sequences, but this would also bring a lot of
complexity for the few cases where we will actually need to process
non-ascii characters.

Reviewers: JDevlieghere, aprantl, probinson, dblaikie

Subscribers: mgorny, hintonda, echristo, clayborg, vleschuk, llvm-commits

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

llvm-svn: 325732

6 years ago[Hexagon] Add TargetRegisterInfo::getPointerRegClass() override
Tobias Edler von Koch [Wed, 21 Feb 2018 22:27:07 +0000 (22:27 +0000)]
[Hexagon] Add TargetRegisterInfo::getPointerRegClass() override

llvm-svn: 325731

6 years ago[InstCombine] add and use Create*FMF functions; NFC
Sanjay Patel [Wed, 21 Feb 2018 22:18:55 +0000 (22:18 +0000)]
[InstCombine] add and use Create*FMF functions; NFC

llvm-svn: 325730

6 years ago[X86][MMX] Add MMX_MOVD64rr build vector tests showing undef elements in the lower...
Simon Pilgrim [Wed, 21 Feb 2018 22:10:48 +0000 (22:10 +0000)]
[X86][MMX] Add MMX_MOVD64rr build vector tests showing undef elements in the lower half

llvm-svn: 325729

6 years ago[LLDB][PPC64] Fixed next blocked forever at same line
Pavel Labath [Wed, 21 Feb 2018 21:56:18 +0000 (21:56 +0000)]
[LLDB][PPC64] Fixed next blocked forever at same line

Summary:
The PC corresponding to the breakpoint was being calculated wrongly,
which was causing LLDB to never go past the first breakpoint, when
there was a second one adjacent to it.

Reviewers: clayborg, labath

Reviewed By: clayborg, labath

Subscribers: anajuliapc, alexandreyy, lbianc

Differential Revision: https://reviews.llvm.org/D43344
Patch by Leandro Lupori <leandro.lupori@gmail.com>.

llvm-svn: 325728

6 years ago[ORC] Switch to shared_ptr ownership for SymbolSources in VSOs.
Lang Hames [Wed, 21 Feb 2018 21:55:57 +0000 (21:55 +0000)]
[ORC] Switch to shared_ptr ownership for SymbolSources in VSOs.

This makes it easy to free a SymbolSource (and any related
resources) when the last reference in a VSO is dropped.

llvm-svn: 325727

6 years ago[ORC] Switch from a StringMap to an internal VSO in RTDyldObjectLinkingLayer.
Lang Hames [Wed, 21 Feb 2018 21:55:54 +0000 (21:55 +0000)]
[ORC] Switch from a StringMap to an internal VSO in RTDyldObjectLinkingLayer.

This is a first step towards switching to VSOs as the primary symbol tables in
ORC.

llvm-svn: 325726

6 years ago[ORC] Switch RTDyldObjectLinkingLayer to take a unique_ptr<MemoryBuffer> rather
Lang Hames [Wed, 21 Feb 2018 21:55:49 +0000 (21:55 +0000)]
[ORC] Switch RTDyldObjectLinkingLayer to take a unique_ptr<MemoryBuffer> rather
than a shared ObjectFile/MemoryBuffer pair.

There's no need to pre-parse the buffer into an ObjectFile before passing it
down to the linking layer, and moving the parsing into the linking layer allows
us remove the parsing code at each call site.

llvm-svn: 325725

6 years agoCodeGen: handle blocks correctly when inalloca'ed
Saleem Abdulrasool [Wed, 21 Feb 2018 21:47:51 +0000 (21:47 +0000)]
CodeGen: handle blocks correctly when inalloca'ed

When using blocks with C++ on Windows x86, it is possible to have the
block literal be pushed into the inalloca'ed parameters.  Teach IRGen to
handle the case properly by extracting the block literal from the
inalloca parameter.  This fixes the use of blocks with C++ on Windows
x86.

llvm-svn: 325724

6 years agolibcxx: Unbreak external thread library configuration.
Peter Collingbourne [Wed, 21 Feb 2018 21:36:18 +0000 (21:36 +0000)]
libcxx: Unbreak external thread library configuration.

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

llvm-svn: 325723

6 years ago[clang-format] Fix regression when getStyle() called with empty filename
Ben Hamilton [Wed, 21 Feb 2018 21:27:27 +0000 (21:27 +0000)]
[clang-format] Fix regression when getStyle() called with empty filename

Summary:
D43522 caused an assertion failure when getStyle() was called with
an empty filename:

P8065

This adds a test to reproduce the failure and fixes the issue by
ensuring we never pass an empty filename to
Environment::CreateVirtualEnvironment().

Test Plan: New test added. Ran test with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
  Before diff, test failed with P8065. Now, test passes.

Reviewers: vsapsai, jolesiak, krasimir

Reviewed By: vsapsai

Subscribers: klimek, cfe-commits

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

llvm-svn: 325722

6 years ago[sanitizer] Allow to set SANITIZER_CAN_USE_PREINIT_ARRAY externally
Vitaly Buka [Wed, 21 Feb 2018 21:13:07 +0000 (21:13 +0000)]
[sanitizer] Allow to set SANITIZER_CAN_USE_PREINIT_ARRAY externally

llvm-svn: 325720

6 years ago[testsuite] Run lit tests as part of `check-lldb`.
Davide Italiano [Wed, 21 Feb 2018 21:10:44 +0000 (21:10 +0000)]
[testsuite] Run lit tests as part of `check-lldb`.

Also, fix a missing dependency, as lit requires llvm-config
to run. This is becoming more and more important as we
write more FileCheck style tests.

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

llvm-svn: 325719

6 years ago[AArch64] fix IR names to not be 'tmp' because that gives the CHECK script problems
Sanjay Patel [Wed, 21 Feb 2018 20:48:14 +0000 (20:48 +0000)]
[AArch64] fix IR names to not be 'tmp' because that gives the CHECK script problems

llvm-svn: 325718

6 years ago[AArch64] add SLP test for matmul (PR36280); NFC
Sanjay Patel [Wed, 21 Feb 2018 20:34:16 +0000 (20:34 +0000)]
[AArch64] add SLP test for matmul (PR36280); NFC

This is a slight reduction of one of the benchmarks
that suffered with D43079. Cost model changes should
not cause this test to remain scalarized.

llvm-svn: 325717

6 years agoReplace incorrect usage of isInvalidDecl with intended setInvalidDecl
Erich Keane [Wed, 21 Feb 2018 20:29:05 +0000 (20:29 +0000)]
Replace incorrect usage of isInvalidDecl with intended setInvalidDecl

This typo would cause an attempt to multiversion 'main' to issue an
error, but not mark the function as invalid.  This patch fixes it.

llvm-svn: 325716

6 years agoRevert "[IRMover] Implement name based structure type mapping"
Rafael Espindola [Wed, 21 Feb 2018 20:12:18 +0000 (20:12 +0000)]
Revert "[IRMover] Implement name based structure type mapping"

This reverts commit r325686.

There was a misunderstanding and this has not been approved yet.

llvm-svn: 325715

6 years agoRevert r325679: [ELF] Add -nopie alias for -no-pie (PR36423)
Rui Ueyama [Wed, 21 Feb 2018 20:08:14 +0000 (20:08 +0000)]
Revert r325679: [ELF] Add -nopie alias for -no-pie (PR36423)

This reverts commit r325679 that was committed without discussion.
Actually, in the discussion thread, most people opposed to have this
option in lld. Reverting that change doesn't mean that this is a
final decision, but that needs to be discussed first.

llvm-svn: 325714

6 years ago[mips][lld] Address post commit review nit.
Simon Dardis [Wed, 21 Feb 2018 20:01:43 +0000 (20:01 +0000)]
[mips][lld] Address post commit review nit.

Address @ruiu's post commit review comment about a value which is intended
to be a unsigned 32 bit integer as using uint32_t rather than unsigned.

llvm-svn: 325713

6 years agoFix a memory leak and a cross module reference.
Rafael Espindola [Wed, 21 Feb 2018 19:55:11 +0000 (19:55 +0000)]
Fix a memory leak and a cross module reference.

llvm-svn: 325712

6 years ago[hwasan] Fix inline instrumentation.
Evgeniy Stepanov [Wed, 21 Feb 2018 19:52:23 +0000 (19:52 +0000)]
[hwasan] Fix inline instrumentation.

This patch changes hwasan inline instrumentation:

Fixes address untagging for shadow address calculation (use 0xFF instead of 0x00 for the top byte).
Emits brk instruction instead of hlt for the kernel and user space.
Use 0x900 instead of 0x100 for brk immediate (0x100 - 0x800 are unavailable in the kernel).
Fixes and adds appropriate tests.

Patch by Andrey Konovalov.

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

llvm-svn: 325711

6 years agoasan: add kernel inline instrumentation test (retry)
Vedant Kumar [Wed, 21 Feb 2018 19:40:55 +0000 (19:40 +0000)]
asan: add kernel inline instrumentation test (retry)

Add a test that checks that kernel inline instrumentation works.

Patch by Andrey Konovalov!

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

llvm-svn: 325710

6 years ago[testsuite/decorators] Get rid of some `expectFlakey` variants.
Davide Italiano [Wed, 21 Feb 2018 19:18:49 +0000 (19:18 +0000)]
[testsuite/decorators] Get rid of some `expectFlakey` variants.

These seem to be pretty much dead.

llvm-svn: 325708

6 years ago[X86][MMX] Run MMX bitcast test on 32 and 64-bit targets
Simon Pilgrim [Wed, 21 Feb 2018 18:52:16 +0000 (18:52 +0000)]
[X86][MMX] Run MMX bitcast test on 32 and 64-bit targets

llvm-svn: 325707

6 years ago[WebAssembly] Use make<> rather then make_unique<>. NFC.
Sam Clegg [Wed, 21 Feb 2018 18:37:44 +0000 (18:37 +0000)]
[WebAssembly] Use make<> rather then make_unique<>. NFC.

lld uses an arena allocator to one of allocations
like these can just use make<>.

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

llvm-svn: 325706

6 years ago[WebAssembly] Rename member DefinedFunctions -> InputFunctions. NFC.
Sam Clegg [Wed, 21 Feb 2018 18:29:23 +0000 (18:29 +0000)]
[WebAssembly] Rename member DefinedFunctions -> InputFunctions. NFC.

This avoids confusion with the `DefinedFunction` symbol
type.

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

llvm-svn: 325705

6 years agoFix TestBreakpointInGlobalConstructor for Windows
Adrian McCarthy [Wed, 21 Feb 2018 18:08:23 +0000 (18:08 +0000)]
Fix TestBreakpointInGlobalConstructor for Windows

Summary:
This test was failing on Windows because it expected the breakpoint in the
dynamic library to be resolved before the process is launched.  Since the DLL
isn't loaded until the process is launched this didn't work.

The fix creates a special value (-2) for num_expected_locations that ignores
the actual number of breakpoint locations found.

Reviewers: jasonmolenda

Subscribers: sanjoy, lldb-commits

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

llvm-svn: 325704

6 years agoFix racy msan test
Maxim Kuvyrkov [Wed, 21 Feb 2018 18:03:50 +0000 (18:03 +0000)]
Fix racy msan test

Summary:
Child thread may finish before pthread_setname_np() and/or
pthread_getname_np() had a chance to run, which causes these functions
to fail with ENOENT (meaning /proc/self/task/[tid]/comm doesn't exist).

Fix by stalling child thread on a mutex.

Reviewers: eugenis

Reviewed By: eugenis

Subscribers: llvm-commits, #sanitizers

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

llvm-svn: 325703

6 years agoFix remote tests broken by r325690
Pavel Labath [Wed, 21 Feb 2018 17:55:22 +0000 (17:55 +0000)]
Fix remote tests broken by r325690

The patch added an extra argument to the append_to_process_working_directory
function. I have somehow missed updating this test, and it did not show up
because the code was only run in remote mode.

llvm-svn: 325702

6 years agollgs-tests: Fix r325511 for debugserver
Pavel Labath [Wed, 21 Feb 2018 17:38:38 +0000 (17:38 +0000)]
llgs-tests: Fix r325511 for debugserver

Debugserver sends the thread-pcs field with leading zeroes omitted. Teach
parseRegisterValue to pad these as necessary.

llvm-svn: 325701

6 years agoHandle IMAGE_REL_AMD64_ADDR32NB in RuntimeDyldCOFF
Frederich Munch [Wed, 21 Feb 2018 17:18:20 +0000 (17:18 +0000)]
Handle IMAGE_REL_AMD64_ADDR32NB in RuntimeDyldCOFF

Summary:
IMAGE_REL_AMD64_ADDR32NB relocations are currently set to zero in all cases.
This patch sets the relocation to the correct value when possible and shows an error when not.

Reviewers: enderby, lhames, compnerd

Reviewed By: compnerd

Subscribers: LepelTsmok, compnerd, martell, llvm-commits

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

llvm-svn: 325700

6 years ago[LV] Fix test checks, NFC
Alexey Bataev [Wed, 21 Feb 2018 16:48:23 +0000 (16:48 +0000)]
[LV] Fix test checks, NFC

llvm-svn: 325699

6 years ago[X86][MMX] Regenerate MMX MASKMOV test
Simon Pilgrim [Wed, 21 Feb 2018 16:38:08 +0000 (16:38 +0000)]
[X86][MMX] Regenerate MMX MASKMOV test

llvm-svn: 325698

6 years ago[Hexagon] Return true in enableMultipleCopyHints().
Jonas Paulsson [Wed, 21 Feb 2018 16:37:45 +0000 (16:37 +0000)]
[Hexagon]  Return true in enableMultipleCopyHints().

Enable multiple COPY hints to eliminate more COPYs during register allocation.

Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.

Review: Krzysztof Parzyszek
llvm-svn: 325697

6 years ago[X86][MMX] Regenerate MMX arithmetic tests
Simon Pilgrim [Wed, 21 Feb 2018 16:37:10 +0000 (16:37 +0000)]
[X86][MMX] Regenerate MMX arithmetic tests

llvm-svn: 325696

6 years ago[X86] LowerBITCAST - pull out repeated calls to getOperand(0). NFCI.
Simon Pilgrim [Wed, 21 Feb 2018 16:35:40 +0000 (16:35 +0000)]
[X86] LowerBITCAST - pull out repeated calls to getOperand(0). NFCI.

llvm-svn: 325695

6 years ago[clangd] Update canonical header mapping for STL
Eric Liu [Wed, 21 Feb 2018 16:17:25 +0000 (16:17 +0000)]
[clangd] Update canonical header mapping for STL

llvm-svn: 325694

6 years ago[analyzer] Prevent AnalyzerStatsChecker from crash
Peter Szecsi [Wed, 21 Feb 2018 16:06:56 +0000 (16:06 +0000)]
[analyzer] Prevent AnalyzerStatsChecker from crash

The checker marks the locations where the analyzer creates sinks. However, it
can happen that the sink was created because of a loop which does not contain
condition statement, only breaks in the body. The exhausted block is the block
which should contain the condition but empty, in this case.
This change only emits this marking in order to avoid the undefined behavior.

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

llvm-svn: 325693

6 years agoRemove use of the 'gmlt' term from the -fsplit-dwarf-inlining flag description to...
David Blaikie [Wed, 21 Feb 2018 16:00:50 +0000 (16:00 +0000)]
Remove use of the 'gmlt' term from the -fsplit-dwarf-inlining flag description to make it more readily legible

llvm-svn: 325692

6 years ago[clang-format] New API guessLanguage()
Ben Hamilton [Wed, 21 Feb 2018 15:54:31 +0000 (15:54 +0000)]
[clang-format] New API guessLanguage()

Summary:
For clients which don't have a filesystem, calling getStyle() doesn't
make much sense (there's no .clang-format files to search for).

In this diff, I hoist out the language-guessing logic from getStyle()
and move it into a new API guessLanguage().

I also added support for guessing the language of files which have no
extension (they could be C++ or ObjC).

Test Plan: New tests added. Ran tests with:
  % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: jolesiak, krasimir

Reviewed By: jolesiak, krasimir

Subscribers: klimek, cfe-commits, sammccall

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

llvm-svn: 325691

6 years agoFix a couple of more tests to not create files in the source tree
Pavel Labath [Wed, 21 Feb 2018 15:33:53 +0000 (15:33 +0000)]
Fix a couple of more tests to not create files in the source tree

Summary:
These were not being flaky, but they're still making the tree dirty.

These tests were using lldbutil.append_to_process_working_directory to
derive the file path so I fix them by modifying the function to return
the build directory for local tests.

Technically, now the path returned by this function does not point to
the process working directory for local tests, but I think it makes
sense to keep the function name, as I think we should move towards
launching the process in the build directory (and I intend to change
this for the handful of inferiors that actually care about their PWD,
for example because they need to create files there).

Reviewers: davide, aprantl

Subscribers: lldb-commits

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

llvm-svn: 325690

6 years ago[SLP] Fix test checks, NFC.
Alexey Bataev [Wed, 21 Feb 2018 15:32:58 +0000 (15:32 +0000)]
[SLP] Fix test checks, NFC.

llvm-svn: 325689

6 years ago[Sparc] Include __tls_get_addr in symbol table for TLS calls to it
Jonas Devlieghere [Wed, 21 Feb 2018 15:25:26 +0000 (15:25 +0000)]
[Sparc] Include __tls_get_addr in symbol table for TLS calls to it

Global Dynamic and Local Dynamic call relocations only implicitly
reference __tls_get_addr; there is no connection in the ELF file between
the relocations and the symbol other than the specification for the
relocations' semantics. However, it still needs to be in the symbol
table despite the lack of explicit references to the symbol table entry,
since it needs to be bound at link time for these relocations, otherwise
any objects will fail to link.

For details, see https://sourceware.org/bugzilla/show_bug.cgi?id=22832.

Path by: James Clarke (jrtc27)

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

llvm-svn: 325688

6 years ago[SCEV] Temporarily disable loop versioning for the purpose
Silviu Baranga [Wed, 21 Feb 2018 15:20:32 +0000 (15:20 +0000)]
[SCEV] Temporarily disable loop versioning for the purpose
of turning SCEVUnknowns of PHIs into AddRecExprs.

This feature is now hidden behind the -scev-version-unknown flag.

Fixes PR36032 and PR35432.

llvm-svn: 325687

6 years ago[IRMover] Implement name based structure type mapping
Eugene Leviant [Wed, 21 Feb 2018 15:13:48 +0000 (15:13 +0000)]
[IRMover] Implement name based structure type mapping

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

llvm-svn: 325686

6 years ago[X86][MMX] Regenerate MMX PSUB commutation test
Simon Pilgrim [Wed, 21 Feb 2018 15:07:47 +0000 (15:07 +0000)]
[X86][MMX] Regenerate MMX PSUB commutation test

llvm-svn: 325685

6 years ago[X86] Regenerate GPR:XMM bitcast test
Simon Pilgrim [Wed, 21 Feb 2018 15:05:47 +0000 (15:05 +0000)]
[X86] Regenerate GPR:XMM bitcast test

llvm-svn: 325684

6 years ago[ASTMatchers] Regenerate documentation after r325678
Eric Liu [Wed, 21 Feb 2018 14:22:42 +0000 (14:22 +0000)]
[ASTMatchers] Regenerate documentation after r325678

llvm-svn: 325682

6 years ago[ELF] - Simplify. NFC.
George Rimar [Wed, 21 Feb 2018 14:21:23 +0000 (14:21 +0000)]
[ELF] - Simplify. NFC.

llvm-svn: 325681

6 years ago[ELF] Add -nopie alias for -no-pie (PR36423)
Hans Wennborg [Wed, 21 Feb 2018 13:54:26 +0000 (13:54 +0000)]
[ELF] Add -nopie alias for -no-pie (PR36423)

In r324043, --nopie was renamed to --no-pie to presumably fix a typo.

As it turns out, "nopie" wasn't a typo but the spelling used by
OpenBSD's binutils ld. Gold on the other hand spells the flag "no-pie".
(Vanilla binutils doesn't have a flag like this at all.)

Since they do the same thing, let's support both spellings.

llvm-svn: 325679

6 years ago[ASTMatchers] isTemplateInstantiation: also match explicit instantiation declaration.
Eric Liu [Wed, 21 Feb 2018 13:51:27 +0000 (13:51 +0000)]
[ASTMatchers] isTemplateInstantiation: also match explicit instantiation declaration.

Summary:
Example:
template <typename T> class X {}; class A {};
// Explicit instantiation declaration.
extern template class X<A>;

Reviewers: bkramer

Subscribers: klimek, cfe-commits

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

llvm-svn: 325678

6 years agoAMDGPU: Do not combine loads/store across physreg defs
Nicolai Haehnle [Wed, 21 Feb 2018 13:31:35 +0000 (13:31 +0000)]
AMDGPU: Do not combine loads/store across physreg defs

Summary:
Since this pass operates on machine SSA form, this should only really
affect M0 in practice.

Fixes various piglit variable-indexing/vs-varying-array-mat4-index-*

Change-Id: Ib2a1dc3a8d7b08225a8da49a86f533faa0986aa8
Fixes: r317751 ("AMDGPU: Merge S_BUFFER_LOAD_DWORD_IMM into x2, x4")

Reviewers: arsenm, mareko, rampitec

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

llvm-svn: 325677

6 years ago[AMDGPU][MC] Added lds support for MUBUF instructions
Dmitry Preobrazhensky [Wed, 21 Feb 2018 13:13:48 +0000 (13:13 +0000)]
[AMDGPU][MC] Added lds support for MUBUF instructions

See bug 28234: https://bugs.llvm.org/show_bug.cgi?id=28234

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

Reviewers: vpykhtin, artem.tamazov, arsenm
llvm-svn: 325676

6 years ago[X86][MMX] Add PR29222 test case
Simon Pilgrim [Wed, 21 Feb 2018 12:06:27 +0000 (12:06 +0000)]
[X86][MMX] Add PR29222 test case

llvm-svn: 325675

6 years ago[X86][MMX] Add some MMX build vector tests
Simon Pilgrim [Wed, 21 Feb 2018 12:01:30 +0000 (12:01 +0000)]
[X86][MMX] Add some MMX build vector tests

llvm-svn: 325674

6 years ago[ELF] - Simplify testcase. NFC.
George Rimar [Wed, 21 Feb 2018 11:56:55 +0000 (11:56 +0000)]
[ELF] - Simplify testcase. NFC.

This removes script input file and inlines script into
testcase body. That is consistent with othet LS tests
and makes testcase easier to read.

llvm-svn: 325673

6 years ago[Sema] Classify conversions from enum to float as narrowing
Mikhail Maltsev [Wed, 21 Feb 2018 10:08:18 +0000 (10:08 +0000)]
[Sema] Classify conversions from enum to float as narrowing

Summary:
According to [dcl.init.list]p7:
  A narrowing conversion is an implicit conversion
  - ...
  - from an integer type or unscoped enumeration type to a
    floating-point type, except where the source is a constant
    expression and the actual value after conversion will fit into
    the target type and will produce the original value when
    converted back to the original type, or
  - ...

Currently clang does not handle the 'unscoped enumeration' case. This
patch fixes the corresponding check.

Reviewers: faisalv, rsmith, rogfer01

Reviewed By: rogfer01

Subscribers: rogfer01, cfe-commits

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

llvm-svn: 325668

6 years agoRISCV: Add COFF address space
Martell Malone [Wed, 21 Feb 2018 06:42:38 +0000 (06:42 +0000)]
RISCV: Add COFF address space

PE spec defines and reserves to following for RISCV

IMAGE_FILE_MACHINE_RISCV32  0x5032
IMAGE_FILE_MACHINE_RISCV64  0x5064
IMAGE_FILE_MACHINE_RISCV128 0x5128

https://msdn.microsoft.com/en-us/library/windows/desktop/ms680547(v=vs.85).aspx

Reviewers: asb, rnk, compnerd

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

llvm-svn: 325667

6 years agoFix TestAppleTypesIsProduced after r324226
Frederic Riss [Wed, 21 Feb 2018 06:20:03 +0000 (06:20 +0000)]
Fix TestAppleTypesIsProduced after r324226

This test was accessing self.debug_info, which doesn't exist anymore. For
some reason the macOS bots are skipping this test because they think the
compiler is not clang. We'll look into this separately.

llvm-svn: 325666

6 years ago[Fuchsia] Include libClang and clang-include-fixer in the toolchain
Petr Hosek [Wed, 21 Feb 2018 04:39:15 +0000 (04:39 +0000)]
[Fuchsia] Include libClang and clang-include-fixer in the toolchain

libClang is used by other Clang based tools such as cquery while
clang-include-fixer is generally a useful tool.

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

llvm-svn: 325665

6 years agoMsan, fixing DTLS_on_tls_get_addr signature empty implementation
Kamil Rytarowski [Wed, 21 Feb 2018 04:16:45 +0000 (04:16 +0000)]
Msan, fixing DTLS_on_tls_get_addr signature empty implementation

Summary: No supported oses normally compiled that code (or not for a long time) probably never caught it.

Patch by: David CARLIER

Reviewers: vitalybuka, krytarowski

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

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

llvm-svn: 325664

6 years agoIn C++14 onwards, it is permitted to read mutable members in constant
Richard Smith [Wed, 21 Feb 2018 03:38:30 +0000 (03:38 +0000)]
In C++14 onwards, it is permitted to read mutable members in constant
expressions, if their lifetime began during the evaluation of the expression.

This is technically not allowed in C++11, though we could consider permitting
it there too, as an extension.

llvm-svn: 325663

6 years ago[clangd] #include statements support for Open definition
Marc-Andre Laperle [Wed, 21 Feb 2018 02:39:08 +0000 (02:39 +0000)]
[clangd] #include statements support for Open definition

Summary: ctrl-clicking on #include statements now opens the file being pointed by that statement.

Reviewers: malaperle, krasimir, bkramer, ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: jkorous-apple, ioeric, mgrang, klimek, ilya-biryukov, arphaman, cfe-commits

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

llvm-svn: 325662

6 years agoClean up use of C allocation functions
Serge Pavlov [Wed, 21 Feb 2018 02:02:39 +0000 (02:02 +0000)]
Clean up use of C allocation functions

If the value returned by `malloc`, `calloc` or `realloc` is not checked
for null pointer, this change replaces them for `safe_malloc`,
`safe_calloc` or `safe_realloc`, which are defined in the namespace `llvm`.
These function report fatal error on out of memory.

In the plain C files, assertion statements are added to ensure that memory
is successfully allocated.

The aim of this change is to get better diagnostics of OOM on Windows.

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

llvm-svn: 325661

6 years ago[BDCE] Salvage debug info from dying insts
Vedant Kumar [Wed, 21 Feb 2018 01:55:33 +0000 (01:55 +0000)]
[BDCE] Salvage debug info from dying insts

This results in 15 additional unique source variables in a stage2 build
of FileCheck (at '-Os -g'), with a negligible increase in the size of
the .debug_loc section.

llvm-svn: 325660

6 years ago[Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 21 Feb 2018 01:45:26 +0000 (01:45 +0000)]
[Sema] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 325659

6 years agorevert r325515: [TTI CostModel] change default cost of FP ops to 1 (PR36280)
Sanjay Patel [Wed, 21 Feb 2018 01:42:52 +0000 (01:42 +0000)]
revert r325515: [TTI CostModel] change default cost of FP ops to 1 (PR36280)

There are too many perf regressions resulting from this, so we need to
investigate (and add tests for) targets like ARM and AArch64 before
trying to reinstate.

llvm-svn: 325658

6 years ago[lit] Fix a problem with spaces in the python path by adding quotes around it
Aaron Smith [Wed, 21 Feb 2018 00:41:30 +0000 (00:41 +0000)]
[lit] Fix a problem with spaces in the python path by adding quotes around it

These are the last tests left to fix after D43265.

llvm-svn: 325657

6 years ago[WebAssembly] Use stable sort when sorting ctore functions
Sam Clegg [Wed, 21 Feb 2018 00:34:34 +0000 (00:34 +0000)]
[WebAssembly] Use stable sort when sorting ctore functions

Patch by Nicholas Wilson!

llvm-svn: 325656

6 years ago[X86] Disable CLWB in Cannon Lake
Craig Topper [Wed, 21 Feb 2018 00:16:50 +0000 (00:16 +0000)]
[X86] Disable CLWB in Cannon Lake

Cannon Lake does not support CLWB, therefore it
does not include all features listed under SKX.

Patch by Gabor Buella

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

llvm-svn: 325655

6 years ago[X86] Disable CLWB for Cannon Lake
Craig Topper [Wed, 21 Feb 2018 00:15:48 +0000 (00:15 +0000)]
[X86] Disable CLWB for Cannon Lake

Cannon Lake does not support CLWB, therefore it
does not include all features listed under SKX anymore.

Instead, enumerate all SKX features with the exception of CLWB.

Patch by Gabor Buella

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

llvm-svn: 325654

6 years ago[mips] Spectre variant two mitigation for MIPSR2
Simon Dardis [Wed, 21 Feb 2018 00:06:53 +0000 (00:06 +0000)]
[mips] Spectre variant two mitigation for MIPSR2

This patch provides mitigation for CVE-2017-5715, Spectre variant two,
which affects the P5600 and P6600. It implements the LLVM part of
-mindirect-jump=hazard. It is _not_ enabled by default for the P5600.

The migitation strategy suggested by MIPS for these processors is to use
hazard barrier instructions. 'jalr.hb' and 'jr.hb' are hazard
barrier variants of the 'jalr' and 'jr' instructions respectively.

These instructions impede the execution of instruction stream until
architecturally defined hazards (changes to the instruction stream,
privileged registers which may affect execution) are cleared. These
instructions in MIPS' designs are not speculated past.

These instructions are used with the attribute +use-indirect-jump-hazard
when branching indirectly and for indirect function calls.

These instructions are defined by the MIPS32R2 ISA, so this mitigation
method is not compatible with processors which implement an earlier
revision of the MIPS ISA.

Performance benchmarking of this option with -fpic and lld using
-z hazardplt shows a difference of overall 10%~ time increase
for the LLVM testsuite. Certain benchmarks such as methcall show a
substantially larger increase in time due to their nature.

Reviewers: atanasyan, zoran.jovanovic

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

llvm-svn: 325653

6 years ago[lit] Update how clang and other binaries are found in per-configuration directories
Aaron Smith [Wed, 21 Feb 2018 00:05:51 +0000 (00:05 +0000)]
[lit] Update how clang and other binaries are found in per-configuration directories

Summary:
This is modeled after the clang and llvm lit tests.

Several properties have CMAKE_CFG_INTDIR as part of the path - this works correctly when the cmake generator only supports one configuration which is known at configuration time, but it does not work correctly when the cmake generator supports multiple configurations (for example, VS).

For VS, CMAKE_CFG_INTDIR ends up set as $Configuration and then it is never updated correctly. Instead, the lit configuration can use a property that can be overwritten at run time. AddLLVM does that for several properties (such as LLVM_TOOLS_DIR).

This change is also removing properties from the lit/CMakeLists.txt that are actually set during the call to configure_lit_site_cfg

Reviewers: zturner, lldb-commits

Reviewed By: zturner

Subscribers: llvm-commits, labath, stella.stamenova, mgorny, hintonda

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

llvm-svn: 325652

6 years ago[mips] Spectre variant two mitigation for MIPSR2
Simon Dardis [Wed, 21 Feb 2018 00:05:05 +0000 (00:05 +0000)]
[mips] Spectre variant two mitigation for MIPSR2

This patch provides mitigation for CVE-2017-5715, Spectre variant two,
which affects the P5600 and P6600. It provides the option
-mindirect-jump=hazard, which instructs the LLVM backend to replace
indirect branches with their hazard barrier variants.

This option is accepted when targeting MIPS revision two or later.

The migitation strategy suggested by MIPS for these processors is to
use two hazard barrier instructions. 'jalr.hb' and 'jr.hb' are hazard
barrier variants of the 'jalr' and 'jr' instructions respectively.

These instructions impede the execution of instruction stream until
architecturally defined hazards (changes to the instruction stream,
privileged registers which may affect execution) are cleared. These
instructions in MIPS' designs are not speculated past.

These instructions are used with the option -mindirect-jump=hazard
when branching indirectly and for indirect function calls.

These instructions are defined by the MIPS32R2 ISA, so this mitigation
method is not compatible with processors which implement an earlier
revision of the MIPS ISA.

Implementation note: I've opted to provide this as an
-mindirect-jump={hazard,...} style option in case alternative
mitigation methods are required for other implementations of the MIPS
ISA in future, e.g. retpoline style solutions.

Reviewers: atanasyan

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

llvm-svn: 325651

6 years ago[lit] Fix a problem with spaces in the python path by adding quotes around it
Aaron Smith [Wed, 21 Feb 2018 00:03:41 +0000 (00:03 +0000)]
[lit] Fix a problem with spaces in the python path by adding quotes around it

Summary:
This fixes two failing tests on Windows with an installed version of python that has spaces in the path.

* elf/lto/cache.ll
* mach-o/dependency_info.yaml

Reviewers: zturner, llvm-commits, stella.stamenova

Subscribers: emaste, arichardson

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

llvm-svn: 325650

6 years ago[InstCombine] C / -X --> -C / X
Sanjay Patel [Wed, 21 Feb 2018 00:01:45 +0000 (00:01 +0000)]
[InstCombine] C / -X --> -C / X

We already do this in DAGCombiner, but it should
also be good to eliminate the fsub use in IR.

This is similar to rL325648.

llvm-svn: 325649

6 years ago[InstCombine] -X / C --> X / -C for FP
Sanjay Patel [Tue, 20 Feb 2018 23:51:16 +0000 (23:51 +0000)]
[InstCombine] -X / C --> X / -C for FP

We already do this in DAGCombiner, but it should
also be good to eliminate the fsub use in IR.

llvm-svn: 325648

6 years ago[mips][lld] Spectre variant two mitigation for MIPSR2
Simon Dardis [Tue, 20 Feb 2018 23:49:17 +0000 (23:49 +0000)]
[mips][lld] Spectre variant two mitigation for MIPSR2

This patch provides migitation for CVE-2017-5715, Spectre variant two,
which affects the P5600 and P6600. It implements the LLD part of
-z hazardplt. Like the Clang part of this patch, I have opted for that
specific option name in case alternative migitation methods are required
in the future.

The mitigation strategy suggested by MIPS for these processors is to use
hazard barrier instructions. 'jalr.hb' and 'jr.hb' are hazard
barrier variants of the 'jalr' and 'jr' instructions respectively.

These instructions impede the execution of instruction stream until
architecturally defined hazards (changes to the instruction stream,
privileged registers which may affect execution) are cleared. These
instructions in MIPS' designs are not speculated past.

These instructions are defined by the MIPS32R2 ISA, so this mitigation
method is not compatible with processors which implement an earlier
revision of the MIPS ISA.

For LLD, this changes PLT stubs to use 'jalr.hb' and 'jr.hb'.

Reviewers: atanasyan, ruiu

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

llvm-svn: 325647

6 years agoFix assert when template argument deduction's original call arg checking triggers...
Richard Smith [Tue, 20 Feb 2018 23:47:12 +0000 (23:47 +0000)]
Fix assert when template argument deduction's original call arg checking triggers class template instantiation.

llvm-svn: 325646

6 years ago[WebAssembly] Rename GlobalSymbol types. NFC.
Sam Clegg [Tue, 20 Feb 2018 23:38:27 +0000 (23:38 +0000)]
[WebAssembly] Rename GlobalSymbol types. NFC.

Purely a rename in preparation for adding new global symbol type.

We want to use GlobalSymbol to represent real wasm globals and
DataSymbol for pointers to things in linear memory (what ELF would
call STT_OBJECT).

This reduces the size the patch to add the explicit symbol table
which is coming soon!

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

llvm-svn: 325645

6 years ago[InstCombine] add tests for fdiv with negated op and constant op; NFC
Sanjay Patel [Tue, 20 Feb 2018 23:34:43 +0000 (23:34 +0000)]
[InstCombine] add tests for fdiv with negated op and constant op; NFC

llvm-svn: 325644

6 years agoRevert "[AMDGPU] Increased vector length for global/constant loads."
Konstantin Zhuravlyov [Tue, 20 Feb 2018 23:30:21 +0000 (23:30 +0000)]
Revert "[AMDGPU] Increased vector length for global/constant loads."

https://reviews.llvm.org/rL325518

It breaks following OpenCL conformance tests:
  - Basic - parameter_types
  - Basic - vload_private

llvm-svn: 325643

6 years ago[PatternMatch] allow vector matches with m_FNeg
Sanjay Patel [Tue, 20 Feb 2018 23:29:05 +0000 (23:29 +0000)]
[PatternMatch] allow vector matches with m_FNeg

llvm-svn: 325642

6 years ago[DSE] Don't DSE stores that subsequent memmove calls read from
Sanjoy Das [Tue, 20 Feb 2018 23:19:34 +0000 (23:19 +0000)]
[DSE] Don't DSE stores that subsequent memmove calls read from

Summary:
We used to remove the first memmove in cases like this:

  memmove(p, p+2, 8);
  memmove(p, p+2, 8);

which is incorrect.  Fix this by changing isPossibleSelfRead to what was most
likely the intended behavior.

Historical note: the buggy code was added in https://reviews.llvm.org/rL120974
to address PR8728.

Reviewers: rsmith

Subscribers: mcrosier, llvm-commits, jlebar

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

llvm-svn: 325641

6 years agoWhen multiple sanitizers are enabled (ubsan + something else), use all relevant black...
Richard Smith [Tue, 20 Feb 2018 23:17:41 +0000 (23:17 +0000)]
When multiple sanitizers are enabled (ubsan + something else), use all relevant blacklists.

Ideally, we'd only use the ubsan blacklist for ubsan sanitizers, and only use
the other-sanitizer blacklist for its sanitizers, but this at least enables the
intended suppressions.

llvm-svn: 325640

6 years ago[InstCombine] auto-generate full checks; NFC
Sanjay Patel [Tue, 20 Feb 2018 23:08:47 +0000 (23:08 +0000)]
[InstCombine] auto-generate full checks; NFC

llvm-svn: 325639

6 years ago[InstCombine] add test for vector -X/-Y; NFC
Sanjay Patel [Tue, 20 Feb 2018 22:46:38 +0000 (22:46 +0000)]
[InstCombine] add test for vector -X/-Y; NFC

m_FNeg doesn't match vector types.

llvm-svn: 325637