OSDN Git Service

android-x86/external-llvm-project.git
4 years ago[Analyzer][NFC] Iterator Checkers - Separate iterator modeling and the actual checkers
Adam Balogh [Fri, 15 Nov 2019 11:15:36 +0000 (12:15 +0100)]
[Analyzer][NFC] Iterator Checkers - Separate iterator modeling and the actual checkers

A monolithic checker class is hard to maintain. This patch splits it up
into a modeling part, the three checkers and a debug checker. The common
functions are moved into a library.

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

4 years ago[clang-tidy] Link shared library clangTidyOpenMPModule to library LLVMFrontendOpenMP
Adam Balogh [Wed, 11 Dec 2019 11:34:42 +0000 (12:34 +0100)]
[clang-tidy] Link shared library clangTidyOpenMPModule to library LLVMFrontendOpenMP

Building shared libs was broken, it is fixed now.

4 years ago[AArch64][SVE] Implement intrinsics for non-temporal loads & stores
Kerry McLaughlin [Wed, 11 Dec 2019 10:13:32 +0000 (10:13 +0000)]
[AArch64][SVE] Implement intrinsics for non-temporal loads & stores

Summary:
Adds the following intrinsics:
  - llvm.aarch64.sve.ldnt1
  - llvm.aarch64.sve.stnt1

This patch creates masked loads and stores with the
MONonTemporal flag set when used with the intrinsics above.

Reviewers: sdesmalen, paulwalker-arm, dancgr, mgudim, efriedma, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cfe-commits, llvm-commits

Tags: #llvm

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

4 years ago[PowerPC][NFC] add test case for lwa - loop ds form prep
czhengsz [Wed, 11 Dec 2019 10:58:18 +0000 (05:58 -0500)]
[PowerPC][NFC] add test case for lwa - loop ds form prep

4 years ago[Clang] Pragma vectorize_width() implies vectorize(enable)
Sjoerd Meijer [Wed, 11 Dec 2019 10:37:40 +0000 (10:37 +0000)]
[Clang] Pragma vectorize_width() implies vectorize(enable)

Let's try this again; this has been reverted/recommited a few times. Last time
this got reverted because for this loop:

  void a() {
    #pragma clang loop vectorize(disable)
    for (;;)
      ;
  }

vectorisation was incorrectly enabled and the vectorize.enable metadata was set
due to a logic error. But with this fixed, we now imply vectorisation when:

1) vectorisation is enabled, which means: VectorizeWidth > 1,
2) and don't want to add it when it is disabled or enabled, otherwise we would
   be incorrectly setting it or duplicating the metadata, respectively.

This should fix PR27643.

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

4 years ago[lldb][NFC] Cleanup includes in FormatManagerTests.cpp
Raphael Isemann [Wed, 11 Dec 2019 10:17:34 +0000 (11:17 +0100)]
[lldb][NFC] Cleanup includes in FormatManagerTests.cpp

4 years ago[ARM][LowOverheadLoops] Remove dead loop update instructions.
Sjoerd Meijer [Wed, 11 Dec 2019 10:11:48 +0000 (10:11 +0000)]
[ARM][LowOverheadLoops] Remove dead loop update instructions.

After creating a low-overhead loop, the loop update instruction was still
lingering around hurting performance. This removes dead loop update
instructions, which in our case are mostly SUBS instructions.

To support this, some helper functions were added to MachineLoopUtils and
ReachingDefAnalysis to analyse live-ins of loop exit blocks and find uses
before a particular loop instruction, respectively.

This is a first version that removes a SUBS instruction when there are no other
uses inside and outside the loop block, but there are some more interesting
cases in test/CodeGen/Thumb2/LowOverheadLoops/mve-tail-data-types.ll which
shows that there is room for improvement. For example, we can't handle this
case yet:

    ..
    dlstp.32  lr, r2
  .LBB0_1:
    mov r3, r2
    subs  r2, #4
    vldrh.u32 q2, [r1], #8
    vmov  q1, q0
    vmla.u32  q0, q2, r0
    letp  lr, .LBB0_1
  @ %bb.2:
    vctp.32 r3
    ..

which is a lot more tricky because r2 is not only used by the subs, but also by
the mov to r3, which is used outside the low-overhead loop by the vctp
instruction, and that requires a bit of a different approach, and I will follow
up on this.

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

4 years ago[ARM][MVE] Add intrinsics for immediate shifts. (reland)
Simon Tatham [Wed, 11 Dec 2019 10:04:14 +0000 (10:04 +0000)]
[ARM][MVE] Add intrinsics for immediate shifts. (reland)

This adds the family of `vshlq_n` and `vshrq_n` ACLE intrinsics, which
shift every lane of a vector left or right by a compile-time
immediate. They mostly work by expanding to the IR `shl`, `lshr` and
`ashr` operations, with their second operand being a vector splat of
the immediate.

There's a fiddly special case, though. ACLE specifies that the
immediate in `vshrq_n` can take values up to //and including// the bit
size of the vector lane. But LLVM IR thinks that shifting right by the
full size of the lane is UB, and feels free to replace the `lshr` with
an `undef` half way through the optimization pipeline. Hence, to keep
this legal in source code, I have to detect it at codegen time.
Logical (unsigned) right shifts by the element size are handled by
simply emitting the zero vector; arithmetic ones are converted into a
shift of one bit less, which will always give the same output.

In order to do that check, I also had to enhance the tablegen
MveEmitter so that it can cope with converting a builtin function's
operand into a bare integer to pass to a code-generating subfunction.
Previously the only bare integers it knew how to handle were flags
generated from within `arm_mve.td`.

Reviewers: dmgreen, miyuki, MarkMurrayARM, ostannard

Reviewed By: dmgreen, MarkMurrayARM

Subscribers: echristo, hokein, rdhindsa, kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[lldb/DWARF] Add support for DW_AT_loclists_base&DW_FORM_loclistx
Pavel Labath [Fri, 22 Nov 2019 13:42:28 +0000 (14:42 +0100)]
[lldb/DWARF] Add support for DW_AT_loclists_base&DW_FORM_loclistx

Summary:
This adds support for DWARF5 location lists which are specified
indirectly, via an index into the debug_loclists offset table. This
includes parsing the DW_AT_loclists_base attribute which determines the
location of this offset table, and support for new form DW_FORM_loclistx
which is used in conjuction with DW_AT_location to refer to the location
lists in this way.

The code uses the llvm class to parse the offset information, and I've
also tried to structure it similarly to how the relevant llvm
functionality works.

Reviewers: JDevlieghere, aprantl, clayborg

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[NFC] Correct the example in the comments of JSON.h to avoid mislead
QingShan Zhang [Wed, 11 Dec 2019 10:00:05 +0000 (10:00 +0000)]
[NFC] Correct the example in the comments of JSON.h to avoid mislead
user

4 years ago[ARM][TypePromotion] Enable by default
Sam Parker [Wed, 11 Dec 2019 09:55:40 +0000 (09:55 +0000)]
[ARM][TypePromotion] Enable by default

Enable the TypePromotion pass my default (again).

This patch was originally committed in 393dacacf7e7.
This patch was reverted in a38396939c54.

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

4 years ago[NFC][PowerPC] Remove the dead conditions in the if(cond)
QingShan Zhang [Wed, 11 Dec 2019 09:57:06 +0000 (09:57 +0000)]
[NFC][PowerPC] Remove the dead conditions in the if(cond)

4 years ago[MCRegInfo] Add sub_and_superregs_inclusive iterator range.
Florian Hahn [Wed, 11 Dec 2019 09:38:09 +0000 (09:38 +0000)]
[MCRegInfo] Add sub_and_superregs_inclusive iterator range.

Reviewers: evandro, qcolombet, paquette, MatzeB, arsenm

Reviewed By: paquette

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

4 years ago[clangd] Deduplicate refs from index for cross-file rename.
Haojian Wu [Tue, 10 Dec 2019 21:15:29 +0000 (22:15 +0100)]
[clangd] Deduplicate refs from index for cross-file rename.

Summary:
If the index returns duplicated refs, it will trigger the assertion in
BuildRenameEdit (we expect the processing position is always larger the
the previous one, but it is not true if we have duplication), and also
breaks our heuristics.

This patch make the code robost enough to handle duplications, also
save some cost of redundnat llvm::sort.

Though clangd's index doesn't return duplications, our internal index
kythe will.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, mgrang, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[AArch64][SVE] Move TableGen class definitions for gather loads (NFC)
Andrzej Warzynski [Wed, 11 Dec 2019 08:58:01 +0000 (08:58 +0000)]
[AArch64][SVE] Move TableGen class definitions for gather loads (NFC)

Move 2 intrinsic class definitions so that they're all clustered in
one place.

Patch submitted to test commit access.

4 years ago[PowerPC] [CodeGen] Use MachineBranchProbabilityInfo in EarlyIfPredicator to avoid...
shkzhang [Wed, 11 Dec 2019 09:46:00 +0000 (04:46 -0500)]
[PowerPC] [CodeGen] Use MachineBranchProbabilityInfo in EarlyIfPredicator to avoid the potential bug

Summary:
In the function `EarlyIfPredicator::shouldConvertIf()`, we call
`TII->isProfitableToIfCvt()` with `BranchProbability::getUnknown()`, it may
cause the potential assertion error for those hook which use `BranchProbability`
in `isProfitableToIfCvt()`, for example `SystemZ`.
`SystemZ` use `Probability < BranchProbability(1, 8))` in the function
`SystemZInstrInfo::isProfitableToIfCvt()`, if we call this function with
`BranchProbability::getUnknown()`, it will cause assertion error.

This patch is to fix the potential bug.

Reviewed By: ThomasRaoux

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

4 years ago[LiveRegUnits] Add phys_regs_and_masks iterator range (NFC).
Florian Hahn [Wed, 11 Dec 2019 09:27:01 +0000 (09:27 +0000)]
[LiveRegUnits] Add phys_regs_and_masks iterator range (NFC).

This iterator range just includes physical registers and register masks,
which are interesting when dealing with register liveness.

Reviewers: evandro, t.p.northover, paquette, MatzeB, arsenm

Reviewed By: paquette

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

4 years ago[llvm-readelf] - Do no print an empty symbol version as "<corrupt>"
Georgii Rymar [Tue, 10 Dec 2019 09:44:05 +0000 (12:44 +0300)]
[llvm-readelf] - Do no print an empty symbol version as "<corrupt>"

It is discussed here https://reviews.llvm.org/D71118#inline-643172

Currently when a version is empty, llvm-readelf prints:
"000:   0 (*local*)       2 (<corrupt>)"

But GNU readelf does not treat empty section as corrupt.
There is no sense in having empty versions anyways it seems, but
this change is for consistency with GNU.

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

4 years ago[DWARF5][SplitDwarf] Set default state for -fsplit-dwarf-inlining to be false.
Alexey Lapshin [Tue, 10 Dec 2019 20:41:07 +0000 (23:41 +0300)]
[DWARF5][SplitDwarf] Set default state for -fsplit-dwarf-inlining to be false.

    The -fsplit-dwarf-inlining option does not conform to DWARF5 standard.
It creates children for Skeleton compilation unit. We need default behavior
to be DWARF5 compatible. Thus set default state for -fsplit-dwarf-inlining
into "false".

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

4 years ago[CodeComplete] Fix a crash in preferred type and signature help
Ilya Biryukov [Wed, 11 Dec 2019 08:38:14 +0000 (09:38 +0100)]
[CodeComplete] Fix a crash in preferred type and signature help

Summary: Null type pointers could be dereferenced in some cases.

Reviewers: kadircet, sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[Alignment][NFC] Introduce Align in SROA
Guillaume Chatelet [Tue, 10 Dec 2019 16:09:39 +0000 (17:09 +0100)]
[Alignment][NFC] Introduce Align in SROA

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[llvm-readobj] Fix/improve printing WinEH unwind info for linked PE images
Martin Storsjö [Mon, 25 Nov 2019 13:26:13 +0000 (15:26 +0200)]
[llvm-readobj] Fix/improve printing WinEH unwind info for linked PE images

ARMWinEHPrinter was already designed to handle linked PE images
(since d2941b43f40d), but resolving symbols didn't consistently
take the image base into account (as linked images seldom have a
symbol table, except for in MinGW setups).

Win64EHDumper wasn't really designed to handle linked images (it would
crash if executed on such a file), but a few concepts (getSymbol,
taking a virtual address instead of a relocation, and
getSectionContaining for finding the section containing a certain
virtual address) can be borrowed from ARMWinEHPrinter.

Adjust ARMWinEHPrinter to print the address of the exception handler
routine as a VA instead of an RVA, consistently with other addresses
in the same printout, and make Win64EHDumper print addresses similarly
for image cases.

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

4 years ago[PowerPC] Exploitate the Vector Integer Average Instructions
QingShan Zhang [Wed, 11 Dec 2019 07:25:57 +0000 (07:25 +0000)]
[PowerPC] Exploitate the Vector Integer Average Instructions

PowerPC has instruction to do the semantics of this piece of code:

vector int foo(vector int m, vector int n) {
  return (m + n + 1) >> 1;
}
This patch is adding the match rule to select it.

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

4 years ago[LegalizeTypes] Remove manual worklist management from SoftenFloatRes_FP_EXTEND.
Craig Topper [Wed, 11 Dec 2019 06:18:38 +0000 (22:18 -0800)]
[LegalizeTypes] Remove manual worklist management from SoftenFloatRes_FP_EXTEND.

I think this is no longer needed. The system should take care
of legalizing any new nodes that are added. I think this might
have been needed prior to r371709 or r307053.

4 years ago[ELF] Move a computeIsPreemptible() pass into ICF. NFC
Fangrui Song [Wed, 11 Dec 2019 05:37:57 +0000 (21:37 -0800)]
[ELF] Move a computeIsPreemptible() pass into ICF. NFC

Address post-commit review for D71163.

Reviewed By: ruiu

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

4 years ago[SanitizerCommon] Reduce wasting memory in LowLevelAllocator.
Igor Kudrin [Tue, 10 Dec 2019 14:44:17 +0000 (21:44 +0700)]
[SanitizerCommon] Reduce wasting memory in LowLevelAllocator.

MmapOrDie allocates memory multiple to page size. LowLevelAllocator
should use all that memory for the internal buffer because there are
chances that subsequent requests may be small enough to fit in that
space.

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

4 years ago[cxx_status] Re-add missing cell.
Richard Smith [Wed, 11 Dec 2019 03:56:07 +0000 (19:56 -0800)]
[cxx_status] Re-add missing cell.

4 years ago[c++20] Implement P1946R0: allow defaulted comparisons to take their
Richard Smith [Wed, 11 Dec 2019 03:50:26 +0000 (19:50 -0800)]
[c++20] Implement P1946R0: allow defaulted comparisons to take their
arguments by value.

4 years ago[c++20] Delete defaulted comparison functions if they would invoke an
Richard Smith [Wed, 11 Dec 2019 03:20:46 +0000 (19:20 -0800)]
[c++20] Delete defaulted comparison functions if they would invoke an
inaccessible comparison function.

4 years agoChange the mtc Makefile to check $SDKROOT value instead
Jason Molenda [Wed, 11 Dec 2019 02:46:24 +0000 (18:46 -0800)]
Change the mtc Makefile to check $SDKROOT value instead
of depending on it being set in the environment.  Fred's change
from October assumed that SDKROOT was set in the environment
so that 'xcrun --show-sdk-path' would print the path.  If it
was passed in as a Makefile variable, it wouldn't be set in
the environment and xcrun --show-sdk-path would always show the
macOS SDK path.  When running the lldb testsuite against an ios
device via lit, this seems to be the case.

4 years agoRevert "[DebugInfo] Refactored macro related generation, added a test case for macinf...
Nico Weber [Wed, 11 Dec 2019 02:32:30 +0000 (21:32 -0500)]
Revert "[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo emission."

This reverts commit 307f60a1a3ff04313a75e2fc11bc14df4fc2ffb8.

DebugInfo/X86/debug-macinfo-split-dwarf.ll fails on Windows:

Command Output (stdout):
--
$ ":" "RUN: at line 1"
$ "c:\src\llvm-project\out\gn\bin\llc.exe" "-mtriple=x86_64-pc-windows-gnu" "-O0" "-split-dwarf-file=foo.dwo" "-filetype=obj"
Assertion failed: Section && "Cannot switch to a null section!", file ../../llvm/lib/MC/MCStreamer.cpp, line 1103
Stack dump:
0. Program arguments: c:\src\llvm-project\out\gn\bin\llc.exe -mtriple=x86_64-pc-windows-gnu -O0 -split-dwarf-file=foo.dwo -filetype=obj

4 years agoFix mishandling of invalid-but-non-empty nested name specifiers in name
Richard Smith [Wed, 11 Dec 2019 01:53:15 +0000 (17:53 -0800)]
Fix mishandling of invalid-but-non-empty nested name specifiers in name
classification.

We were accidentally treating invalid scope specs as being empty,
resulting in our trying to form an ADL-only call with a qualified
callee, which tripped up an assert later on.

4 years ago[llvm-ar] Improve tool selection heuristic
Fangrui Song [Tue, 10 Dec 2019 21:45:02 +0000 (13:45 -0800)]
[llvm-ar] Improve tool selection heuristic

If llvm-ar is installed at arm-pokymllib32-linux-gnueabi-llvm-ar, it may
think it is llvm-lib due to the "lib" substring.

Improve the heuristic to make all the following work as intended:

llvm-ar-9 (llvm-9 package on Debian)
llvm-ranlib.exe
Lib.exe (reported by D44808)
arm-pokymllib32-linux-gnueabi-llvm-ar (reported by D71030)

Reviewed By: raj.khem, rupprecht

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

4 years ago[X86] Split v64i1 arguments into 2 v32i1s that will be promoted to v32i8 under min...
Craig Topper [Wed, 11 Dec 2019 01:02:38 +0000 (17:02 -0800)]
[X86] Split v64i1 arguments into 2 v32i1s that will be promoted to v32i8 under min-legal-vector-width=256

This is an improvement to 88dacbd43625cf7aad8a01c0c3b92142c4dc0970

4 years agoReland "Enable `-funwind-tables` flag when building libunwind"
Sergej Jaskiewicz [Fri, 6 Dec 2019 14:26:35 +0000 (17:26 +0300)]
Reland "Enable `-funwind-tables` flag when building libunwind"

Summary:
Relands https://reviews.llvm.org/D70815.

The original commit set `CMAKE_TRY_COMPILE_TARGET_TYPE` to
`STATIC_LIBRARY` globally in libunwind/CMakeLists.txt, which effectively
disabled the linking step in CMake checks.

This broke some builds (see 938c70b86c7d2165f8c28d5700e9c1ac1263307e).

Here we set CMAKE_TRY_COMPILE_TARGET_TYPE to
STATIC_LIBRARY only when checking for presence of the `-funwind-tables`
flag, and then set it back to the original value so it doesn't affect
other checks.

Reviewers: mstorsjo, jfb

Subscribers: mgorny, christof, libcxx-commits

Tags: #libc

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

4 years ago[c++20] Implement P1185R2 (as modified by P2002R0).
Richard Smith [Wed, 11 Dec 2019 00:45:02 +0000 (16:45 -0800)]
[c++20] Implement P1185R2 (as modified by P2002R0).

For each defaulted operator<=> in a class that doesn't explicitly
declare any operator==, also inject a matching implicit defaulted
operator==.

4 years ago[llvm][MIRVRegNamerUtil] Adding hashing against MachineInstr flags.
Puyan Lotfi [Tue, 10 Dec 2019 09:40:36 +0000 (04:40 -0500)]
[llvm][MIRVRegNamerUtil] Adding hashing against MachineInstr flags.

Now, flags will result in differing hashes for a given MI. In effect, if
you have two instructions with everything identical except for their
flags then you should get two different hashes and fewer collisions.

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

4 years agoNFC: Get rid of an unused parameter to CGObjCMac::EmitSelectorAddr.
Erik Pilkington [Wed, 11 Dec 2019 00:43:39 +0000 (16:43 -0800)]
NFC: Get rid of an unused parameter to CGObjCMac::EmitSelectorAddr.

4 years agoRevert "[analyzer] Keep track of escaped locals"
Gabor Horvath [Wed, 11 Dec 2019 00:42:03 +0000 (16:42 -0800)]
Revert "[analyzer] Keep track of escaped locals"

It was a step in the right direction but it is not clear how can this
fit into the checker API at this point. The pre-escape happens in the
analyzer core and the checker has no control over it. If the checker
is not interestd in a pre-escape it would need to do additional work
on each escape to check if the escaped symbol is originated from an
"uninteresting" pre-escaped memory region. In order to keep the
checker API simple we abandoned this solution for now.

We will reland this once we have a better answer for what to do on the
checker side.

This reverts commit f3a28202ef58551db15818f8f51afd21e0f3e231.

4 years ago[FPEnv][X86] Constrained FCmp intrinsics enabling on X86
Wang, Pengfei [Wed, 4 Dec 2019 00:39:21 +0000 (08:39 +0800)]
[FPEnv][X86] Constrained FCmp intrinsics enabling on X86

Summary: This is a follow up of D69281, it enables the X86 backend support for the FP comparision.

Reviewers: uweigand, kpn, craig.topper, RKSimon, cameron.mcinally, andrew.w.kaylor

Subscribers: hiraditya, llvm-commits, annita.zhang, LuoYuanke, LiuChen3

Tags: #llvm

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

4 years ago[libc++] Hide some functions and types in <future> and <thread> as hidden
Louis Dionne [Tue, 10 Dec 2019 23:00:42 +0000 (18:00 -0500)]
[libc++] Hide some functions and types in <future> and <thread> as hidden

Otherwise, weak symbols leak into user programs when using `async` with
non-internal types.

4 years agoRemove unsound caching in LanguageCategory
Adrian Prantl [Tue, 10 Dec 2019 22:29:13 +0000 (14:29 -0800)]
Remove unsound caching in LanguageCategory

Analogous to https://reviews.llvm.org/D71233 it is not safe to cache
something that depends on the actual ValueObject in a cache then keys
only off the type name.

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

4 years agoReplace redundant code in LanguageCategory with templates (NFC)
Adrian Prantl [Tue, 10 Dec 2019 21:22:03 +0000 (13:22 -0800)]
Replace redundant code in LanguageCategory with templates (NFC)

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

4 years agoRevert "Reapply: [DebugInfo] Recover debug intrinsics when killing duplicated/empty..."
Vlad Tsyrklevich [Tue, 10 Dec 2019 23:50:10 +0000 (15:50 -0800)]
Revert "Reapply: [DebugInfo] Recover debug intrinsics when killing duplicated/empty..."

This reverts commit f2ba93971ccc236c0eef5323704d31f48107e04f, it was
causing build timeouts on sanitizer-x86_64-linux-autoconf such as
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-autoconf/builds/44917

4 years ago[FormatManager] Move Language lookup into the obviously non-cached part (NFC)
Adrian Prantl [Tue, 10 Dec 2019 18:58:06 +0000 (10:58 -0800)]
[FormatManager] Move Language lookup into the obviously non-cached part (NFC)

This refactoring makes the lookup caching easier to reason about. This
has no observable effect although it does slightly change what is
being cached.

- Before this patch a negative lookup in the LanguageCategory would be
  cached, but a positive wouldn't.

- After this patch LanguageCategory lookups aren't cached by
  FormatManager, period. (LanguageCategory has its own FormatCache for this!)

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

4 years agoDo not cache hardcoded formats in FormatManager
Adrian Prantl [Tue, 10 Dec 2019 00:38:19 +0000 (16:38 -0800)]
Do not cache hardcoded formats in FormatManager

The cache in FormatCache uses only a type name as key. The hardcoded
formats, synthetic children, etc inspect an entire ValueObject to
determine their eligibility, which isn't modelled in the cache. This
leads to bugs such as the one in this patch (where two similarly named
types in different files have different hardcoded summary
providers). The problem is exaggerated in the Swift language plugin
due to the language's dynamic nature.

rdar://problem/57756763

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

4 years ago[libcxx] Replace func_name with __name__ for compatibility with Python 3
Sergej Jaskiewicz [Fri, 6 Dec 2019 19:17:34 +0000 (22:17 +0300)]
[libcxx] Replace func_name with __name__ for compatibility with Python 3

Summary:
The __name__ attribute is the correct way to get a function name in
Python 3. This also works with Python 2.

Reviewers: jroelofs, EricWF

Subscribers: christof, ldionne, libcxx-commits

Tags: #libc

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

4 years ago[DataFormatters] Change the Get() method to take a LanguageType.
Davide Italiano [Tue, 10 Dec 2019 23:20:49 +0000 (15:20 -0800)]
[DataFormatters] Change the Get() method to take a LanguageType.

Suggested by Adrian.

4 years agoSkip TestGuiBasic.py on ios etc device testing.
Jason Molenda [Tue, 10 Dec 2019 23:15:08 +0000 (15:15 -0800)]
Skip TestGuiBasic.py on ios etc device testing.

4 years ago[X86] Go back to considering v64i1 as a legal type under min-legal-vector-width=256...
Craig Topper [Tue, 10 Dec 2019 22:44:38 +0000 (14:44 -0800)]
[X86] Go back to considering v64i1 as a legal type under min-legal-vector-width=256. Scalarize v64i1 arguments and shuffles under min-legal-vector-width=256.

This reverts 3e1aee2ba717529b651a79ed4fc7e7147358043f in favor
of a different approach.

Scalarizing isn't great codegen, but making the type illegal was
interfering with k constraint in inline assembly.

4 years agoRevert "Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB...
Eric Christopher [Tue, 10 Dec 2019 23:04:02 +0000 (15:04 -0800)]
Revert "Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes"

On multiple retry this issue won't duplicate - will revisit with author if
duplication works again.

This reverts commit c9e0b354e2749ce7ab553974692cb35c8651a869.

4 years agoRemove debugging printf and reformat code.
Eric Christopher [Tue, 10 Dec 2019 23:02:29 +0000 (15:02 -0800)]
Remove debugging printf and reformat code.

4 years ago[TypeCategory] IsApplicable gets a LanguageType, not a ValueObject.
Davide Italiano [Tue, 10 Dec 2019 22:44:51 +0000 (14:44 -0800)]
[TypeCategory] IsApplicable gets a LanguageType, not a ValueObject.

Reviewers: aprantl, teemperor

Subscribers: lldb-commits

Tags: #lldb

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

4 years agoSkip TestMultilineCompletion.py on ios testsuite runs.
Jason Molenda [Tue, 10 Dec 2019 22:54:42 +0000 (14:54 -0800)]
Skip TestMultilineCompletion.py on ios testsuite runs.

4 years ago[IR] allow undefined elements when checking for splat constants
Sanjay Patel [Tue, 10 Dec 2019 20:41:19 +0000 (15:41 -0500)]
[IR] allow undefined elements when checking for splat constants

This mimics the related call in SDAG. The caller is responsible
for ensuring that undef values are propagated safely.

4 years ago[InstSimplify] add tests for insert constant + splat; NFC
Sanjay Patel [Tue, 10 Dec 2019 16:16:47 +0000 (11:16 -0500)]
[InstSimplify] add tests for insert constant + splat; NFC

4 years agoDebugInfo: Clarify some more reasons v4 loc.dwo can't share much implementation with...
David Blaikie [Tue, 10 Dec 2019 22:10:15 +0000 (14:10 -0800)]
DebugInfo: Clarify some more reasons v4 loc.dwo can't share much implementation with loclists.dwo

4 years ago[DWARF] Allow cross-CU references of subprogram definitions
Vedant Kumar [Fri, 15 Nov 2019 23:37:29 +0000 (15:37 -0800)]
[DWARF] Allow cross-CU references of subprogram definitions

This allows a call site tag in CU A to reference a callee DIE in CU B
without resorting to creating an incomplete duplicate DIE for the callee
inside of CU A.

We already allow cross-CU references of subprogram declarations, so it
doesn't seem like definitions ought to be special.

This improves entry value evaluation and tail call frame synthesis in
the LTO setting. During LTO, it's common for cross-module inlining to
produce a call in some CU A where the callee resides in a different CU,
and there is no declaration subprogram for the callee anywhere. In this
case llvm would (unnecessarily, I think) emit an empty DW_TAG_subprogram
in order to fill in the call site tag. That empty 'definition' defeats
entry value evaluation etc., because the debugger can't figure out what
it means.

As a follow-up, maybe we could add a DWARF verifier check that a
DW_TAG_subprogram at least has a DW_AT_name attribute.

rdar://46577651

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

4 years ago[FormatManager] Add a unittest for GetCandidateLanguages()
Davide Italiano [Tue, 10 Dec 2019 21:39:04 +0000 (13:39 -0800)]
[FormatManager] Add a unittest for GetCandidateLanguages()

Reviewers: teemperor, JDevlieghere, aprantl, jingham

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

4 years agoDebug Info: Strengthen the synthesized-property-cleanup.mm test, NFC
Vedant Kumar [Tue, 10 Dec 2019 21:35:50 +0000 (13:35 -0800)]
Debug Info: Strengthen the synthesized-property-cleanup.mm test, NFC

After https://reviews.llvm.org/D71084, the line locations assigned when
emitting cleanups inside of property accessors changed. Update this test
to actually check that those locations are correct.

rdar://57796656

4 years ago[libcxx] [test] Query the target platform, not the host one
Louis Dionne [Tue, 10 Dec 2019 21:34:30 +0000 (16:34 -0500)]
[libcxx] [test] Query the target platform, not the host one

target_info is inferred to WindowsLocalTI on Windows hosts unless
specified otherwise. In the latter case, it doesn't make sense to use
Windows-specific settings if the target is not Windows.

This change should not break anything, because target_info is inferred
based on what platform.system() returns. self.is_windows was set based
on the same platform.system() call.

Thanks to Sergej Jaskiewicz for the patch.

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

4 years ago[OPENMP50]Do not mark the function as used if referenced only in declare
Alexey Bataev [Tue, 10 Dec 2019 21:12:53 +0000 (16:12 -0500)]
[OPENMP50]Do not mark the function as used if referenced only in declare
variant directive.

If the function is used only in declare variant directive as a variant
function, it should not be marked as used to prevent emission of the
target-specific functions. Build the reference in the unevaluated
context.

4 years ago[Remarks][Docs] Enhance documentation for opt-remarks driver options
Francis Visoiu Mistrih [Wed, 4 Dec 2019 18:19:41 +0000 (10:19 -0800)]
[Remarks][Docs] Enhance documentation for opt-remarks driver options

Add better documentation about the naming scheme, add a few more
explicit descriptions and make the sphinx look better.

4 years ago[c++20] Return type deduction for defaulted three-way comparisons.
Richard Smith [Tue, 10 Dec 2019 19:33:27 +0000 (11:33 -0800)]
[c++20] Return type deduction for defaulted three-way comparisons.

4 years ago[cxx_status] Fix table layout.
Richard Smith [Tue, 10 Dec 2019 19:57:28 +0000 (11:57 -0800)]
[cxx_status] Fix table layout.

4 years ago[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo...
Sourabh Singh Tomar [Wed, 4 Dec 2019 13:02:39 +0000 (18:32 +0530)]
[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo emission.

Reviewers: dblaikie, aprantl, jini.susan.george

Tags: #debug-info #llvm

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

4 years agoDeprecate the hasDefaultArgument matcher
Stephen Kelly [Sat, 7 Dec 2019 18:23:15 +0000 (18:23 +0000)]
Deprecate the hasDefaultArgument matcher

Summary:
It doesn't provide a way to match on the contents of the default
argumment.  Rather than give it that capability, make it deprecated and
recomment the use of hasInitializer instead.

Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[lldb] Add #include to appease the modules build
Vedant Kumar [Tue, 10 Dec 2019 20:36:40 +0000 (12:36 -0800)]
[lldb] Add #include to appease the modules build

This #include appears to be completely unnecessary, but it does fix the
following build failure:

http://green.lab.llvm.org/green/job/lldb-cmake/4565/consoleText

FAILED: tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o
/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang++  -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -DLIBXML2_DEFINED -DLLDB_CONFIGURATION_RELEASE -DLLDB_USE_OS_LOG -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/lldb/source/Host -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Host -Itools/lldb/source -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/include -Itools/lldb/include -Iinclude -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include -I/usr/local/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/../clang/include -Itools/lldb/../clang/include -I/usr/local/include -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/. -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -Wdocumentation -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -fmodules -fmodules-cache-path=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/module.cache -fcxx-modules -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk   -UNDEBUG  -fno-exceptions -fno-rtti -std=c++14 -MD -MT tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o -MF tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o.d -o tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o -c /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Host/common/MainLoop.cpp
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Host/common/MainLoop.cpp:211:7: error: use of undeclared identifier 'ppoll'
  if (ppoll(read_fds.data(), read_fds.size(), nullptr, &sigmask) == -1 &&
      ^
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Host/common/MainLoop.cpp:336:25: error: use of undeclared identifier 'HAVE_SYS_EVENT_H'
  ret = pthread_sigmask(HAVE_SYS_EVENT_H ? SIG_UNBLOCK : SIG_BLOCK,
                        ^
2 errors generated.

4 years ago[OPENMP50]Add if clause in target simd directive.
Alexey Bataev [Tue, 10 Dec 2019 17:44:45 +0000 (12:44 -0500)]
[OPENMP50]Add if clause in target simd directive.

According to OpenMP 5.0, if clause can be used in for simd directive. If
condition in the if clause if false, the non-vectorized version of the
loop must be executed.

4 years agoTemporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes
Eric Christopher [Tue, 10 Dec 2019 20:19:30 +0000 (12:19 -0800)]
Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes

This was causing a crash in opt+assert builds on linux and a follow-up
message was posted.

This reverts commit e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf

4 years ago[clangd] Fix an incorrect expectedResult usage in rename test.
Haojian Wu [Tue, 10 Dec 2019 20:13:36 +0000 (21:13 +0100)]
[clangd] Fix an incorrect expectedResult usage in rename test.

expectedResult(Code, expectedResult(T, "abc")) => should be expectedResult(T, "abc")

The test was passed by coincidence.

4 years ago[Wdocumentation] Use C2x/C++14 deprecated attribute
Mark de Wever [Tue, 10 Dec 2019 17:32:30 +0000 (18:32 +0100)]
[Wdocumentation] Use C2x/C++14 deprecated attribute

This replaces the non-standard __attribute__((deprecated)) with the
standard [[deprecated]] when compiling in C2x/C++14 mode.

Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753

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

4 years ago[Wdocumentation] Properly place deprecated attribute
Mark de Wever [Tue, 10 Dec 2019 17:32:29 +0000 (18:32 +0100)]
[Wdocumentation] Properly place deprecated attribute

It is now placed before the function:
- allows to replace __attribute__((deprecated)) with [[deprecated]].
- required for trailing returns.

Fixes bug: https://bugs.llvm.org/show_bug.cgi?id=43753

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

4 years ago[Wdocumentation] Use the command marker.
Mark de Wever [Tue, 10 Dec 2019 17:32:28 +0000 (18:32 +0100)]
[Wdocumentation] Use the command marker.

Use the proper marker for -Wdocumentation-deprecated-sync instead of
hard-coded the backslash.

Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753

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

4 years agoscudo: Tweak how we align UserPtr. NFCI.
Peter Collingbourne [Thu, 5 Dec 2019 01:28:45 +0000 (17:28 -0800)]
scudo: Tweak how we align UserPtr. NFCI.

Instead of testing whether the pointer is aligned, just align it
unconditionally and compare it to the original pointer.

This moves the computation of UserPtr up to before we start preparing the
header, so that the memory tagging code will be able to read the original
header containing the bounds of the previous allocation before it gets
potentially clobbered by the pointer realignment code.

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

4 years agoscudo: Move getChunkFromBlock() allocated check into caller. NFCI.
Peter Collingbourne [Mon, 9 Dec 2019 21:02:24 +0000 (13:02 -0800)]
scudo: Move getChunkFromBlock() allocated check into caller. NFCI.

With tag-on-free we will need to get the chunk of a deallocated block. Change
getChunkFromBlock() so that it doesn't check that the chunk is allocated,
and move the check into the caller, so that it can be reused for this purpose.

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

4 years agoRecommit "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."
Sourabh Singh Tomar [Fri, 29 Nov 2019 05:56:00 +0000 (11:26 +0530)]
Recommit "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."

Reviewers: dblaikie, aprantl, probinson

Tags: #debug-info #llvm

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

4 years agoRevert "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."
Sourabh Singh Tomar [Tue, 10 Dec 2019 19:49:43 +0000 (01:19 +0530)]
Revert "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."

This reverts commit 6ef01588f4d75ef43da4ed2a37ba7a8b8daab259.
Missing Differetial revision.

4 years agoAdd missed #include in llvmorg-10-init-11532-g848934c67d4.
Richard Smith [Tue, 10 Dec 2019 19:34:49 +0000 (11:34 -0800)]
Add missed #include in llvmorg-10-init-11532-g848934c67d4.

4 years ago[cxx_status] Add missed Belfast paper affecting three-way comparisons.
Richard Smith [Tue, 10 Dec 2019 02:01:47 +0000 (18:01 -0800)]
[cxx_status] Add missed Belfast paper affecting three-way comparisons.

4 years ago[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified.
Sourabh Singh Tomar [Fri, 29 Nov 2019 05:56:00 +0000 (11:26 +0530)]
[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified.

4 years ago[BPF] put not-section-attribute externs into BTF ".extern" data section
Yonghong Song [Tue, 10 Dec 2019 19:05:22 +0000 (11:05 -0800)]
[BPF] put not-section-attribute externs into BTF ".extern" data section

Currently for extern variables with section attribute, those
BTF_KIND_VARs will not be placed in any DataSec. This is
inconvenient as any other generated BTF_KIND_VAR belongs to
one DataSec. This patch put these extern variables into
".extern" section so bpf loader can have a consistent
processing mechanism for all data sections and variables.

4 years agoAssert launch success in run_to_breakpoint_do_run
Vedant Kumar [Tue, 10 Dec 2019 19:18:45 +0000 (11:18 -0800)]
Assert launch success in run_to_breakpoint_do_run

4 years agoFix -Wincomplete-umbrella warning in the modules build
Vedant Kumar [Tue, 10 Dec 2019 19:17:47 +0000 (11:17 -0800)]
Fix -Wincomplete-umbrella warning in the modules build

[281/3666] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/IntrinsicInst.cpp.o
/Users/vsk/src/llvm-project-master/llvm/lib/IR/IntrinsicInst.cpp:155:2: warning: missing submodule 'LLVM_IR.ConstrainedOps' [-Wincomplete-umbrella]

4 years agoFix a -Wsign-compare error around wchar_t vs unsigned int.
Eric Christopher [Tue, 10 Dec 2019 19:17:40 +0000 (11:17 -0800)]
Fix a -Wsign-compare error around wchar_t vs unsigned int.

4 years ago[lldb/Host] Use Host/Config.h entries instead of a global define.
Jonas Devlieghere [Tue, 10 Dec 2019 16:54:30 +0000 (08:54 -0800)]
[lldb/Host] Use Host/Config.h entries instead of a global define.

As suggested by Pavel in a code review:

> Can we replace this (and maybe python too, while at it) with a
> Host/Config.h entry? A global definition means that one has to
> recompile everything when these change in any way, whereas in
> practice only a handful of files need this..

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

4 years ago[lldb/Reproducers] Support multiple GDB remotes
Jonas Devlieghere [Sat, 7 Dec 2019 23:28:30 +0000 (15:28 -0800)]
[lldb/Reproducers] Support multiple GDB remotes

When running the test suite with always capture on, a handful of tests
are failing because they have multiple targets and therefore multiple
GDB remote connections. The current reproducer infrastructure is capable
of dealing with that.

This patch reworks the GDB remote provider to support multiple GDB
remote connections, similar to how the reproducers support shadowing
multiple command interpreter inputs. The provider now keeps a list of
packet recorders which deal with a single GDB remote connection. During
replay we rely on the order of creation to match the number of packets
to the GDB remote connection.

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

4 years agoFix bug 44190 - wrong code with #pragma pack(1)
Yaxun (Sam) Liu [Tue, 10 Dec 2019 16:55:33 +0000 (11:55 -0500)]
Fix bug 44190 - wrong code with #pragma pack(1)

https://github.com/llvm/llvm-project/commit/5b330e8d6122c336d81dfd11c864e6c6240a381e caused
a regression on s390:

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

we need to copy if if either the argument is non-byval or the argument is underaligned.

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

4 years agoReplace redundant code in FormatManager and FormatCache with templates (NFC)
Adrian Prantl [Tue, 10 Dec 2019 00:22:26 +0000 (16:22 -0800)]
Replace redundant code in FormatManager and FormatCache with templates (NFC)

This is a preparatory patch for an upcoming bugfix.

FormatManager and friends have four identical implementations of many
accessor functions to deal with the four types of shared pointers in
the FormatCache. This patch replaces these implementations with
templates. While this patch drastically reduces the amount of source
code and its maintainablity, it doesn't actually improve code
size. I'd argue, this is still an improvement.

rdar://problem/57756763

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

4 years agoRevert 30e8f80fd5a4 "[DebugInfo] Don't create multiple DBG_VALUEs when sinking"
Hans Wennborg [Tue, 10 Dec 2019 18:09:24 +0000 (19:09 +0100)]
Revert 30e8f80fd5a4 "[DebugInfo] Don't create multiple DBG_VALUEs when sinking"

This caused non-determinism in the compiler, see command on the Phabricator
code review.

> This patch addresses a performance problem reported in PR43855, and
> present in the reapplication in in 001574938e5. It turns out that
> MachineSink will (often) move instructions to the first block that
> post-dominates the current block, and then try to sink further. This
> means if we have a lot of conditionals, we can needlessly create large
> numbers of DBG_VALUEs, one in each block the sunk instruction passes
> through.
>
> To fix this, rather than immediately sinking DBG_VALUEs, record them in
> a pass structure. When sinking is complete and instructions won't be
> sunk any further, new DBG_VALUEs are added, avoiding lots of
> intermediate DBG_VALUE $noregs being created.
>
> Differential revision: https://reviews.llvm.org/D70676

4 years ago[FPEnv] clang support for constrained FP builtins
Kevin P. Neal [Mon, 11 Nov 2019 19:21:03 +0000 (14:21 -0500)]
[FPEnv] clang support for constrained FP builtins

Change the IRBuilder and clang so that constrained FP intrinsics will be
emitted for builtins when appropriate. Only non-target-specific builtins
are affected in this patch.

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

4 years ago[OPENMP]Remove extra space from error message.
Alexey Bataev [Tue, 10 Dec 2019 17:53:51 +0000 (12:53 -0500)]
[OPENMP]Remove extra space from error message.

Fixed emission of 2 consecutive whitespaces in the error message.

4 years ago[profile] Add explanatory comments to instrprof-darwin-exports.c, NFC
Vedant Kumar [Tue, 10 Dec 2019 17:45:04 +0000 (09:45 -0800)]
[profile] Add explanatory comments to instrprof-darwin-exports.c, NFC

4 years ago[VectorUtils] Fix -Wunused-private-field after D67572
Fangrui Song [Tue, 10 Dec 2019 17:34:23 +0000 (09:34 -0800)]
[VectorUtils] Fix -Wunused-private-field after D67572

4 years ago[OPENMP50]Add if clause in target parallel for simd directive.
Alexey Bataev [Tue, 10 Dec 2019 16:37:03 +0000 (11:37 -0500)]
[OPENMP50]Add if clause in target parallel for simd directive.

According to OpenMP 5.0, if clause can be used in for simd directive. If
condition in the if clause is false, the non-vectorized version of the
loop must be executed.

4 years ago[ELF] --icf: do not fold preemptible symbols
Fangrui Song [Sat, 30 Nov 2019 05:58:36 +0000 (21:58 -0800)]
[ELF] --icf: do not fold preemptible symbols

Fixes PR44124.

A preemptible symbol may refer to a different definition at runtime.
When comparing a pair of relocations, if they refer to different
symbols, and either symbol is preemptible, the two containing sections
should be considered different.

gold has a similar rule https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=ce97fa81e0c46d216b80b143ad8c02fff6906fef

Reviewed By: grimar

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

4 years ago[ELF] Refine section group --gc-sections rules to not discard .debug_types
Fangrui Song [Sat, 7 Dec 2019 00:26:55 +0000 (16:26 -0800)]
[ELF] Refine section group --gc-sections rules to not discard .debug_types

clang/gcc -fdebug-type-sections places .debug_types and
.rela.debug_types in a section group, with a signature symbol which
represents the type signature. The section group is for deduplication
purposes.

After D70146, we will discard such section groups. Refine the rule so
that we will retain the group if no member has the SHF_ALLOC flag.

GNU ld has a similar rule to retain the group if all members have the
SEC_DEBUGGING flag. We try to be more general for future-proof purposes:
if other non-SHF_ALLOC sections have deduplication needs, they may be
placed in a section group. Don't discard them.

Reviewed By: grimar

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

4 years ago[analyzer] Keep track of escaped locals
Gabor Horvath [Sat, 7 Dec 2019 01:11:37 +0000 (17:11 -0800)]
[analyzer] Keep track of escaped locals

We want to escape all symbols that are stored into escaped regions.
The problem is, we did not know which local regions were escaped. Until now.
This should fix some false positives like the one in the tests.

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

4 years ago[RISCV] Improve assembler missing feature warnings
Simon Cook [Tue, 10 Dec 2019 16:44:48 +0000 (16:44 +0000)]
[RISCV] Improve assembler missing feature warnings

This adds support for printing improved missing feature error messages
from the assembler, which now indicates which feature caused the parse
to fail.

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

4 years ago[VectorUtils] Introduce the Vector Function Database (VFDatabase).
Francesco Petrogalli [Wed, 30 Oct 2019 19:08:21 +0000 (19:08 +0000)]
[VectorUtils] Introduce the Vector Function Database (VFDatabase).

This patch introduced the VFDatabase, the framework proposed in
http://lists.llvm.org/pipermail/llvm-dev/2019-June/133484.html. [*]

In this patch the VFDatabase is used to bridge the TargetLibraryInfo
(TLI) calls that were previously used to query for the availability of
vector counterparts of scalar functions.

The VFISAKind field `ISA` of VFShape have been moved into into VFInfo,
under the assumption that different vector ISAs may provide the same
vector signature. At the moment, the vectorizer accepts any of the
available ISAs as long as the signature provided by the VFDatabase
matches the one expected in the vectorization process. For example,
when targeting AVX or AVX2, which both have 256-bit registers, the IR
signature of the two vector functions associated to the two ISAs is
the same. The `getVectorizedFunction` method at the moment returns the
first available match. We will need to add more heuristics to the
search system to decide which of the available version (TLI, AVX,
AVX2, ...)  the system should prefer, when multiple versions with the
same VFShape are present.

Some of the code in this patch is based on the work done by Sumedh
Arani in https://reviews.llvm.org/D66025.

[*] Notice that in the proposal the VFDatabase was called SVFS. The
name VFDatabase is more in line with LLVM recommendations for
naming classes and variables.

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