Commit Graph

295368 Commits

Author SHA1 Message Date
Simon Pilgrim 99d475f97d [X86][SSE] isFNEG - Use getTargetConstantBitsFromNode to handle all constant cases
isFNEG was duplicating much of what was done by getTargetConstantBitsFromNode in its own calls to getTargetConstantFromNode.

Noticed while reviewing D48467.

llvm-svn: 338358
2018-07-31 10:13:17 +00:00
Martin Storsjo 293079f2de [ARM] Allow automatically deducing the thumb instruction size for .inst
This matches GAS, that allows unsuffixed .inst for thumb.

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

llvm-svn: 338357
2018-07-31 09:27:07 +00:00
Martin Storsjo af18947f0a [ARM] Support the .inst directive for MachO and COFF targets
Contrary to ELF, we don't add any markers that distinguish data generated
with .short/.long from normal instructions, so the .inst directive only
adds compatibility with assembly that uses it.

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

llvm-svn: 338356
2018-07-31 09:27:01 +00:00
Martin Storsjo 3e3d39d07e [AArch64] Support the .inst directive for MachO and COFF targets
Contrary to ELF, we don't add any markers that distinguish data generated
with .long from normal instructions, so the .inst directive only adds
compatibility with assembly that uses it.

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

llvm-svn: 338355
2018-07-31 09:26:52 +00:00
Sam Parker 2a6c842fda [ARM] Revert r337821
Re-enabling ARMCodeGenPrepare by default after failing to reproduce
the bootstrap issues that I was concerned it was causing.

llvm-svn: 338354
2018-07-31 09:04:14 +00:00
Aleksandr Urakov 09240ef776 Improve support of PDB as an external layout source
Summary:
This patch improves support of PDB as an external layout source
in the next cases:

- Multiple non-virtual inheritance from packed base classes. When using
  external layout, there's no need to align `NonVirtualSize` of a base class.
  It may cause an overlapping when the next base classes will be layouted
  (but there is a slightly different case in the test because I can't find
  a way to specify a base offset);
- Support of nameless structs and unions. There is no info about nameless child
  structs and unions in Microsoft cl-emitted PDBs. Instead all its fields
  are just treated as outer structure's (union's) fields. This also causes
  a fields overlapping, and makes it possible for unions to have fields located
  at a non-zero offset.

Reviewers: rsmith, zturner, rnk, mstorsjo, majnemer

Reviewed By: rnk

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 338353
2018-07-31 08:27:06 +00:00
Hsiangkai Wang 615540d0f2 Test commit.
llvm-svn: 338352
2018-07-31 06:09:29 +00:00
Hiroshi Inoue 2f6769be60 [InstSimplify] tests for D48828, D49981: fold extraction from std::pair
Minor touch up in the previous comment.

llvm-svn: 338351
2018-07-31 05:29:20 +00:00
Hiroshi Inoue 5427d3efc2 [InstSimplify] tests for D48828, D49981: fold extraction from std::pair
Updated unit tests for D48828 and D49981.

llvm-svn: 338350
2018-07-31 05:10:36 +00:00
Dean Michael Berris f8d5969943 [XRay][compiler-rt] Update test to use similar structure
This is a follow-up to D50037.

llvm-svn: 338349
2018-07-31 04:47:37 +00:00
Max Kazantsev eb8e9c0940 [NFC] Collect statistics in GuardWidening
llvm-svn: 338348
2018-07-31 04:37:11 +00:00
Dean Michael Berris 3bd20d4605 [XRay][compiler-rt] Profiling Mode: Include file header in buffers
Summary:
This change provides access to the file header even in the in-memory
buffer processing. This allows in-memory processing of the buffers to
also check the version, and the format, of the profile data.

Reviewers: eizan, kpw

Reviewed By: eizan

Subscribers: llvm-commits

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

llvm-svn: 338347
2018-07-31 04:16:54 +00:00
Diego Caballero 3587150fcb [VPlan] Introduce VPLoopInfo analysis.
The patch introduces loop analysis (VPLoopInfo/VPLoop) for VPBlockBases.
This analysis will be necessary to perform some H-CFG transformations and
detect and introduce regions representing a loop in the H-CFG.

Reviewers: fhahn, rengolin, mkuper, hfinkel, mssimpso

Reviewed By: fhahn 

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

llvm-svn: 338346
2018-07-31 01:57:29 +00:00
Raphael Isemann 56bf356a4b Remove Stream::UnitTest
Summary: No one is using this method, and it also doesn't really make a lot of sense to have it around.

Reviewers: davide

Reviewed By: davide

Subscribers: davide, lldb-commits

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

llvm-svn: 338345
2018-07-31 01:21:36 +00:00
Reid Kleckner d2bad6c639 Revert r338340 "[MS Demangler] Better demangling of template arguments."
Breaks the build with GCC, apparently.

llvm-svn: 338344
2018-07-31 01:08:42 +00:00
Richard Smith 6fff5c412b [coroutines] Fix handling of dependent co_await in StmtProfiler.
Fix "Invalid operator call kind" error (llvm_unreachable) in
DecodeOperatorCall when profiling a dependent co_await.

Patch by Victor Zverovich!

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

llvm-svn: 338343
2018-07-31 00:47:41 +00:00
Craig Topper 9164b9b16e [X86] Stop accidentally running the Bonnell LEA fixup path on Goldmont.
In one place we checked X86Subtarget.slowLEA() to decide if the pass should run. But to decide what the pass should we only check isSLM. This resulted in Goldmont going down the Bonnell path.

llvm-svn: 338342
2018-07-31 00:43:54 +00:00
Ana Pazos 2baa767455 [RISCV] Fixed test case failure due to r338047
llvm-svn: 338341
2018-07-31 00:36:28 +00:00
Zachary Turner 4f85809a84 [MS Demangler] Better demangling of template arguments.
This patch fixes demangling of template aliases as template-template
arguments, and also fixes function pointers and references as
not type template parameters.  All of these can be properly
demangled now, so I've ported over the test
clang/test/CodeGenCXX/ms-template-callbacks.cpp.  All of these
tests pass

llvm-svn: 338340
2018-07-31 00:26:52 +00:00
Artem Dergachev cdd783713d [analyzer] Rename test: cxx17-mandatory-elision.cpp -> copy-elision.cpp
It reflects its contents more accurately. No functional change intended.

llvm-svn: 338339
2018-07-31 00:18:35 +00:00
Erik Pilkington ca019e745d [Sema] Relax a failing assert in TemplateArgumentLoc
Any of these template argument kinds can be represented with an expression, so
accept them in this constructor.

Patch by Balaji Iyer!

rdar://41459965

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

llvm-svn: 338338
2018-07-31 00:18:30 +00:00
Amara Emerson 1e8c164c63 [AArch64][GlobalISel] Add isel support for G_BLOCK_ADDR.
Also refactors some existing code to materialize addresses for the large code
model so it can be shared between G_GLOBAL_VALUE and G_BLOCK_ADDR.

This implements PR36390.

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

llvm-svn: 338337
2018-07-31 00:09:02 +00:00
Amara Emerson 0e86c07077 [AArch64][GlobalISel] Make G_BLOCK_ADDR legal.
Differential Revision: https://reviews.llvm.org/D49902

llvm-svn: 338336
2018-07-31 00:08:56 +00:00
Amara Emerson 6aff5a7810 [GlobalISel] Add a G_BLOCK_ADDR opcode to handle IR blockaddress constants.
Differential Revision: https://reviews.llvm.org/D49900

llvm-svn: 338335
2018-07-31 00:08:50 +00:00
Reid Kleckner cae1b9fef2 Pacify sanitizer lint script that still does not run on Windows
llvm-svn: 338334
2018-07-31 00:08:26 +00:00
Artem Dergachev 67fdf81f0c [analyzer] CStringChecker: Remember to highlight the argument expression range.
When emitting a bug report, it is important to highlight which argument of the
call-expression is causing the problem.

Before:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^~~~~~~~~~~~

After:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^      ~

Affects other output modes as well, not just text.

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

llvm-svn: 338333
2018-07-30 23:44:37 +00:00
Marshall Clow 934864bfa7 Code cleanup - change naked 'throw' expressions to call helpre function '__throw_future_error'. The behavior change is that if you build libc++ with exceptions disabled, and then use that in a program that sets the value of the future twice (for example), it will now abort instead of behaving unpredictably.
llvm-svn: 338332
2018-07-30 23:33:48 +00:00
Reid Kleckner a5ed43c1c9 [asan/win] Use SRW locks to fix a race in BlockingMutex
Summary:
Before my change, BlockingMutex used Windows critial sections. Critical
sections can only be initialized by calling InitializeCriticalSection,
dynamically.

The primary sanitizer allocator expects to be able to reinterpret zero
initialized memory as a BlockingMutex and immediately lock it.
RegionInfo contains a mutex, and it placement new is never called for
it. These objects are accessed via:
  RegionInfo *GetRegionInfo(uptr class_id) const {
    DCHECK_LT(class_id, kNumClasses);
    RegionInfo *regions = reinterpret_cast<RegionInfo *>(SpaceEnd());
    return &regions[class_id];
  }
The memory comes from the OS without any other initialization.

For various reasons described in the comments, BlockingMutex::Lock would
check if the object appeared to be zero-initialized, and it would lazily
call the LinkerInitialized constructor to initialize the critical
section. This pattern is obviously racy, and the code had a bunch of
FIXMEs about it.

The best fix here is to use slim reader writer locks, which can start
out zero-initialized. They are available starting in Windows Vista. I
think it's safe to go ahead and use them today.

Reviewers: kcc, vitalybuka

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 338331
2018-07-30 23:32:33 +00:00
Zachary Turner a51403f5cc [MS Demangler] Add ms-return-qualifiers.test.
This is a copy of the tests from
clang/CodeGenCXX/ms-return-qualifiers.cpp converted to demangling
tests.

llvm-svn: 338330
2018-07-30 23:22:39 +00:00
Craig Topper 2f60ef2c78 [DAGCombiner][TargetLowering] Pass a SmallVector instead of a std::vector to BuildSDIV/BuildUDIV/etc.
The vector contains the SDNodes that these functions create. The number of nodes is always a small number so we should use SmallVector to avoid a heap allocation.

llvm-svn: 338329
2018-07-30 23:22:00 +00:00
Eric Christopher a2227a3f9a Revert "Add a definition for FieldSize that seems to make sense here."
This reverts commit r338327, the problem was previously fixed in r338321.

llvm-svn: 338328
2018-07-30 23:21:51 +00:00
Eric Christopher 8f02a9ed3c Add a definition for FieldSize that seems to make sense here.
This could be sunk out of the if statements, but fix the warning for now.

llvm-svn: 338327
2018-07-30 23:17:27 +00:00
Fangrui Song f35ff042f4 [docs] Sort ld.lld.1 options
Reviewers: ruiu

Subscribers: llvm-commits

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

llvm-svn: 338326
2018-07-30 23:07:44 +00:00
Tim Shen f72252e679 [libcxx] fix `>> 42` UB in <experimental/simd>
llvm-svn: 338325
2018-07-30 23:05:40 +00:00
Zachary Turner 931e879cef [MS Demangler] Add rudimentary C++11 Support
This patch adds support for demangling r-value references, new
operators such as the ""_foo operator, lambdas, alias types,
nullptr_t, and various other C++11'isms.

There is 1 failing test remaining in this file, which appears to
be related to back-referencing. This type of problem has the
potential to get ugly so I'd rather fix it in a separate patch.

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

llvm-svn: 338324
2018-07-30 23:02:10 +00:00
George Karpenkov 8f6d65c685 [analyzer] [tests] Add an option for showing statistics after running tests.
Do not show statistics by default.

llvm-svn: 338323
2018-07-30 23:01:47 +00:00
George Karpenkov 13d3748e7c [analyzer] [tests] Style fixes for testing harness.
llvm-svn: 338322
2018-07-30 23:01:20 +00:00
Scott Linder a7c4568583 Fix use of uninitialized variable in r338299
llvm-svn: 338321
2018-07-30 22:52:07 +00:00
Fangrui Song bac187bece [docs] Add missing options to ld.lld.1
Differential Revision: https://reviews.llvm.org/D49938

llvm-svn: 338320
2018-07-30 22:31:00 +00:00
Matt Davis 8d253a71c0 [llvm-mca][docs] Add instruction flow documentation. NFC.
Summary:
This patch mostly copies the existing Instruction Flow, and stage descriptions
from the mca README.  I made a few text tweaks, but no semantic changes,
and made reference to the "default pipeline."  I also removed the internals
references (e.g., reference to class names and header files).  I did leave the
LSUnit name around, but only as an abbreviated word for the load-store unit.


Reviewers: andreadb, courbet, RKSimon, gbedwell, filcab

Reviewed By: andreadb

Subscribers: tschuett, jfb, llvm-commits

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

llvm-svn: 338319
2018-07-30 22:30:14 +00:00
Tim Shen 38cd7de5ac Re-apply "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to."
...with proper guarding #ifdefs for unsupported C++11.

llvm-svn: 338318
2018-07-30 22:27:38 +00:00
Sanjay Patel 9f807f44b1 [DAGCombiner] transform sub-of-shifted-signbit to add
This is exchanging a sub-of-1 with add-of-minus-1:
https://rise4fun.com/Alive/plKAH

This is another step towards improving select-of-constants codegen (see D48970).

x86 is the motivating target, and those diffs all appear to be wins. PPC and AArch64 look neutral.
I've limited this to early combining (!LegalOperations) in case a target wants to reverse it, but
I think canonicalizing to 'add' is more likely to produce further transforms because we have more
folds for 'add'.

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

llvm-svn: 338317
2018-07-30 22:21:37 +00:00
Tim Shen 6f33ea4ef6 Revert "[libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to."
This reverts commit r338309.

llvm-svn: 338316
2018-07-30 22:21:22 +00:00
George Karpenkov 8a0f890e29 [analyzer] [NFC] Simplify some visitors by giving a convenient getter from state to analysis manager
Differential Revision: https://reviews.llvm.org/D49772

llvm-svn: 338315
2018-07-30 22:18:47 +00:00
George Karpenkov 81c84a9755 [analyzer] Bugfix for autorelease + main run loop leak checker
Do not warn when the other message-send-expression is correctly wrapped
in a different autorelease pool.

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

llvm-svn: 338314
2018-07-30 22:18:21 +00:00
Jonathan Peyton 28226e7d64 [OpenMP] Fix tasking + parallel bug
From the bug report, the runtime needs to initialize the nproc variables
(inside middle init) for each root when the task is encountered, otherwise,
a segfault can occur.

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

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

llvm-svn: 338313
2018-07-30 21:47:56 +00:00
George Karpenkov f44b9070b9 [analyzer] Fix crash in RunLoopAutoreleaseChecker on empty children
Differential Revision: https://reviews.llvm.org/D50012

llvm-svn: 338312
2018-07-30 21:44:15 +00:00
Raphael Isemann 129fe89ffb Remove unnecessary newlines from break command help text.
Summary:
We usually don't have trailing newlines in the short help strings. This just adds
unnecessary extra lines when printing the help text of these commands.

Subscribers: lldb-commits

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

llvm-svn: 338311
2018-07-30 21:41:13 +00:00
Diego Caballero 2a34ac86d3 [VPlan] Introduce VPlan-based dominator analysis.
The patch introduces dominator analysis for VPBlockBases and extend
VPlan's GraphTraits specialization with the required interfaces. Dominator
analysis will be necessary to perform some H-CFG transformations and
to introduce VPLoopInfo (LoopInfo analysis on top of the VPlan representation).

Reviewers: fhahn, rengolin, mkuper, hfinkel, mssimpso

Reviewed By: fhahn

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

llvm-svn: 338310
2018-07-30 21:33:31 +00:00
Tim Shen 47ad09b339 [libcxx] implement <simd> ABI for Clang/GCC vector extension, constructors, copy_from and copy_to.
Summary:
This patch adds a new macro _LIBCPP_HAS_NO_VECTOR_EXTENSION for detecting
whether a vector extension (\_\_attribute\_\_((vector_size(num_bytes)))) is
available.

On the top of that, this patch implements the following API:
* all constructors
* operator[]
* copy_from
* copy_to

It also defines simd_abi::native to use vector extension, if available.
In GCC and Clang, certain values with vector extension are passed by registers,
instead of memory.

Based on D41148.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits, MaskRay, lichray, sanjoy

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

llvm-svn: 338309
2018-07-30 21:23:13 +00:00