platform/upstream/llvm.git
4 years agoRevert "[lldb/DWARF] Use DW_AT_call_pc to determine artificial frame address"
Vedant Kumar [Tue, 24 Mar 2020 19:22:12 +0000 (12:22 -0700)]
Revert "[lldb/DWARF] Use DW_AT_call_pc to determine artificial frame address"

This reverts commit 6905394d153960ded3a7b884a9747ed2d4a6e8d8. The
changed test is failing on Debian/x86_64, possibly because lldb is
subtracting an offset from the DW_AT_call_pc address used for the
artificial frame:

http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/7171/steps/test/logs/stdio

/home/worker/lldb-x86_64-debian/lldb-x86_64-debian/llvm-project/lldb/test/API/functionalities/tail_call_frames/unambiguous_sequence/main.cpp:6:17: error: CHECK-NEXT: expected string not found in input
 // CHECK-NEXT: frame #1: 0x{{[0-9a-f]+}} a.out`func3() at main.cpp:14:3 [opt] [artificial]
                ^
<stdin>:3:2: note: scanning from here
 frame #1: 0x0000000000401127 a.out`func3() at main.cpp:13:4 [opt] [artificial]

4 years ago[VectorCombine] add tests for bitcast (shuffle); NFC
Sanjay Patel [Tue, 24 Mar 2020 19:11:15 +0000 (15:11 -0400)]
[VectorCombine] add tests for bitcast (shuffle); NFC

4 years ago[lldb][NFC] Always update m_cache_{hits/misses} in FormatCache
Raphael Isemann [Tue, 24 Mar 2020 19:16:41 +0000 (20:16 +0100)]
[lldb][NFC] Always update m_cache_{hits/misses} in FormatCache

Summary:
These two variables are only incremented under LLDB_CONFIGURATION_DEBUG but their
value is always logged when verbose lldb formatter logging is enabled, which causes that our
cache hit/miss log looks like this in non-Debug builds:

```
Cache hits: 0 - Cache Misses: 0
...
Cache hits: 0 - Cache Misses: 0
...
Cache hits: 0 - Cache Misses: 0
```

This just always increments those two counters independent of build mode.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

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

4 years ago[lldb] Don't dump the frame in SBTarget::EvaluateExpression in LLDB_CONFIGURATION_DEBUG
Raphael Isemann [Tue, 24 Mar 2020 19:16:07 +0000 (20:16 +0100)]
[lldb] Don't dump the frame in SBTarget::EvaluateExpression in LLDB_CONFIGURATION_DEBUG

Summary:
Dumping the frame using the user-set format could cause that a debug LLDB doesn't behave as a release LLDB,
which could potentially break replaying a reproducer.

Also it's kinda strange that the frame format set by the user is used in the internal log output.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

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

4 years ago[mlir] Revamp operation documentation generation
River Riddle [Tue, 24 Mar 2020 18:57:13 +0000 (11:57 -0700)]
[mlir] Revamp operation documentation generation

Summary:
This revisions performs several cleanups to the generated dialect documentation:
* Standardizes format of attributes/operands/results sections
* Splits out operation/type/dialect documentation generation to allow for composing generated and hand-written documentation
* Add section for declarative assembly syntax and successors
* General cleanup

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

4 years agoRe-land "Avoid emitting unreachable SP adjustments after `throw`"
Reid Kleckner [Tue, 24 Mar 2020 18:49:44 +0000 (11:49 -0700)]
Re-land "Avoid emitting unreachable SP adjustments after `throw`"

This reverts commit 4e0fe038f438ae1679eae9e156e1f248595b2373. Re-lands
65b21282c710afe9c275778820c6e3c1cf46734b.

After landing 5ff5ddd0adc89f8827b345577bbb3e7eb74fc644 to add int3 into
trailing unreachable blocks, we can now remove these extra stack
adjustments without confusing the Win64 unwinder. See
https://llvm.org/45064#c4 or X86AvoidTrailingCall.cpp for a full
explanation.

Fixes PR45064.

4 years ago[lit] Allow passing extra commands to executeShTest
Louis Dionne [Thu, 19 Mar 2020 03:17:11 +0000 (23:17 -0400)]
[lit] Allow passing extra commands to executeShTest

This allows creating custom test formats on top of `executeShTest` that
inject commands at the beginning of the file being parsed, without
requiring these commands to physically appear in the test file itself.

For example, one could define a test format that prints out additional
debug information at the beginning of each test. More realistically,
this has been used to define custom test formats like one that supports
compilation failure tests (e.g. with the extension `compile.fail.cpp`)
by injecting a command that calls the compiler on the file itself and
expects it to fail.

Without this change, the only alternative is to create a temporary file
with the same content as the original test, then prepend the desired
`// RUN:` lines to that file, and call `executeShTest` on that file
instead. This is both slow and cumbersome to do.

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

4 years ago[lldb/DWARF] Use DW_AT_call_pc to determine artificial frame address
Vedant Kumar [Wed, 18 Mar 2020 00:59:08 +0000 (17:59 -0700)]
[lldb/DWARF] Use DW_AT_call_pc to determine artificial frame address

lldb currently guesses the address to use when creating an artificial
frame (i.e., a frame constructed by determining the sequence of (tail)
calls which must have happened).

Guessing the address creates problems -- use the actual address provided
by the DW_AT_call_pc attribute instead.

Depends on D76336.

rdar://60307600

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

4 years ago[DWARF] Emit DW_AT_call_pc for tail calls
Vedant Kumar [Wed, 18 Mar 2020 00:56:28 +0000 (17:56 -0700)]
[DWARF] Emit DW_AT_call_pc for tail calls

Record the address of a tail-calling branch instruction within its call
site entry using DW_AT_call_pc. This allows a debugger to determine the
address to use when creating aritificial frames.

This creates an extra attribute + relocation at tail call sites, which
constitute 3-5% of all call sites in xnu/clang respectively.

rdar://60307600

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

4 years agoNFC: Fix typos in TestingGuide documentation
Louis Dionne [Tue, 24 Mar 2020 18:54:25 +0000 (14:54 -0400)]
NFC: Fix typos in TestingGuide documentation

4 years ago[libomptarget][nfc] Explicitly static function scope shared variables
JonChesterfield [Tue, 24 Mar 2020 18:51:36 +0000 (18:51 +0000)]
[libomptarget][nfc] Explicitly static function scope shared variables

Summary:
[libomptarget][nfc] Explicitly static function scope shared variables

`__shared__` in CUDA implies static in function scope. See e.g. D.2.1.1
in CUDA_C_Programming_Guide.pdf,
http://developer.download.nvidia.com/compute/DevZone/docs/html/C/doc/

This is surprising for non-cuda developers, see e.g. D73239 where I thought
local variables would be thread local.

Tested by IR diff of libomptarget.bc (no change), running in tree tests,
and binary diff of the nvcc static archives (no significant change).

Reviewers: jdoerfert, ABataev, grokos

Reviewed By: jdoerfert

Subscribers: openmp-commits

Tags: #openmp

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

4 years ago[lit] NFC: Document missing result codes
Louis Dionne [Tue, 24 Mar 2020 18:45:17 +0000 (14:45 -0400)]
[lit] NFC: Document missing result codes

These result codes already exist, but they were not documented. I assume
this is an oversight when adding these result codes.

4 years ago[DivRemPairs] Freeze operands if they can be undef values
Juneyoung Lee [Tue, 24 Mar 2020 18:31:45 +0000 (03:31 +0900)]
[DivRemPairs] Freeze operands if they can be undef values

Summary:
DivRemPairs is unsound with respect to undef values.

```
      // bb1:
      //   %rem = srem %x, %y
      // bb2:
      //   %div = sdiv %x, %y
      // -->
      // bb1:
      //   %div = sdiv %x, %y
      //   %mul = mul %div, %y
      //   %rem = sub %x, %mul
```

If X can be undef, X should be frozen first.
For example, let's assume that Y = 1 & X = undef:
```
   %div = sdiv undef, 1 // %div = undef
   %rem = srem undef, 1 // %rem = 0
 =>
   %div = sdiv undef, 1 // %div = undef
   %mul = mul %div, 1   // %mul = undef
   %rem = sub %x, %mul  // %rem = undef - undef = undef
```
http://volta.cs.utah.edu:8080/z/m7Xrx5

Same for Y. If X = 1 and Y = (undef | 1), %rem in src is either 1 or 0,
but %rem in tgt can be one of many integer values.

This resolves https://bugs.llvm.org/show_bug.cgi?id=42619 .

This miscompilation disappears if undef value is removed, but it may take a while.
DivRemPair happens pretty late during the optimization pipeline, so this optimization seemed as a good candidate to fix without major regression using freeze than other broken optimizations.

Reviewers: spatel, lebedev.ri, george.burgess.iv

Reviewed By: spatel

Subscribers: wuzish, regehr, nlopes, nemanjai, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SelectionDAG] Don't crash when freezing illegal float types
Benjamin Kramer [Tue, 24 Mar 2020 18:44:18 +0000 (19:44 +0100)]
[SelectionDAG] Don't crash when freezing illegal float types

4 years ago[X86][AVX] Add some v32i16 to v32i8 style truncation shuffle tests
Simon Pilgrim [Tue, 24 Mar 2020 17:56:49 +0000 (17:56 +0000)]
[X86][AVX] Add some v32i16 to v32i8 style truncation shuffle tests

4 years agoAMDGPU/GlobalISel: Add more tests for add3 folding
Matt Arsenault [Tue, 24 Mar 2020 18:30:24 +0000 (14:30 -0400)]
AMDGPU/GlobalISel: Add more tests for add3 folding

Forget to squash into 2ea46051055b37faf95c58daad57608bb7610f58

4 years agoAMDGPU/GlobalISel: Add some more tests for add3 folding
Matt Arsenault [Tue, 24 Mar 2020 18:26:23 +0000 (14:26 -0400)]
AMDGPU/GlobalISel: Add some more tests for add3 folding

These currently fail to form add3 due to the pointer type, but they
should be handle.

4 years agoAMDGPU/GlobalISel: Fix smrd loads of v4i64
Matt Arsenault [Sun, 9 Feb 2020 21:30:22 +0000 (16:30 -0500)]
AMDGPU/GlobalISel: Fix smrd loads of v4i64

4 years ago[ValueTracking] improve undef/poison analysis for constant vectors
Sanjay Patel [Tue, 24 Mar 2020 17:34:39 +0000 (13:34 -0400)]
[ValueTracking] improve undef/poison analysis for constant vectors

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

4 years ago[lldb] Remove some debugging printfs from ITSession code
Raphael Isemann [Tue, 24 Mar 2020 17:09:25 +0000 (18:09 +0100)]
[lldb] Remove some debugging printfs from ITSession code

Summary:
This seems only useful for debugging and it's just plainly printf'ing to the console instead
of some log, so let's remove this.

Reviewers: #lldb, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: JDevlieghere

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

4 years ago[gn build] Port b91905a2637
LLVM GN Syncbot [Tue, 24 Mar 2020 16:46:53 +0000 (16:46 +0000)]
[gn build] Port b91905a2637

4 years agoRevert "Include static prof data when collecting loop BBs"
Hiroshi Yamauchi [Tue, 24 Mar 2020 16:23:26 +0000 (09:23 -0700)]
Revert "Include static prof data when collecting loop BBs"

This reverts commit 129c911efaa492790c251b3eb18e4db36b55cbc5.

Due to an internal benchmark regression.

4 years ago[gn build] (manually) port 8140f6bcde4 better
Nico Weber [Tue, 24 Mar 2020 16:39:49 +0000 (12:39 -0400)]
[gn build] (manually) port 8140f6bcde4 better

4 years ago[gn build] (manually) port 8140f6bcde4
Nico Weber [Tue, 24 Mar 2020 16:38:25 +0000 (12:38 -0400)]
[gn build] (manually) port 8140f6bcde4

4 years ago[gn build] Port 49e5a97ec36
Nico Weber [Tue, 24 Mar 2020 16:36:08 +0000 (12:36 -0400)]
[gn build] Port 49e5a97ec36

4 years ago[lldb/Reproducers] Collect files imported by command script import
Jonas Devlieghere [Tue, 24 Mar 2020 15:54:26 +0000 (08:54 -0700)]
[lldb/Reproducers] Collect files imported by command script import

Files imported by the script interpreter aren't opened by LLDB so they
don't end up in the reproducer. The solution is to explicitly add them
to the FileCollector.

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

4 years ago[ARM] Fold VMOVrh VLDR to LDRH
David Green [Tue, 24 Mar 2020 10:14:52 +0000 (10:14 +0000)]
[ARM] Fold VMOVrh VLDR to LDRH

This adds a simple fold to combine VMOVrh load to a integer load.
Similar to what is already performed for BITCAST, but needs to account
for the types being of different sizes, creating an zero extending load.

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

4 years ago[InstSimplify] add tests for freeze(constexpr); NFC
Sanjay Patel [Tue, 24 Mar 2020 15:38:56 +0000 (11:38 -0400)]
[InstSimplify] add tests for freeze(constexpr); NFC

4 years ago[MachinePipeliner] Fix a bug in Output Dependency chains
Lama [Tue, 24 Mar 2020 14:32:00 +0000 (14:32 +0000)]
[MachinePipeliner] Fix a bug in Output Dependency chains

The current implementation collects all Preds/Succs of a Dep of kind Output, creating a long chain and subsequently a schedule with an unnecessarily large II.
Was this done on purpose for a reason I'm missing?

Reviewed By: bcahoon

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

4 years ago[X86][SSE1] Add support for logic+movmsk patterns (PR42870)
Simon Pilgrim [Tue, 24 Mar 2020 14:28:25 +0000 (14:28 +0000)]
[X86][SSE1] Add support for logic+movmsk patterns (PR42870)

rL368506 handled the basic case, but we need to account for boolean logic patterns as well.

4 years ago[ARM][CMSE] Fix clang/test/Driver/save-temps.c test.
Alexander Belyaev [Tue, 24 Mar 2020 14:14:06 +0000 (15:14 +0100)]
[ARM][CMSE] Fix clang/test/Driver/save-temps.c test.

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

4 years ago[Parser] Fix the assertion crash in ActOnStartOfSwitch stmt.
Haojian Wu [Sat, 21 Mar 2020 12:48:35 +0000 (13:48 +0100)]
[Parser] Fix the assertion crash in ActOnStartOfSwitch stmt.

Summary:
After we parse the switch condition, we don't do the type check for
type-dependent expr (e.g. TypoExpr) (in Sema::CheckSwitchCondition), then the
TypoExpr is corrected to an invalid-type expr (in Sema::MakeFullExpr) and passed
to the ActOnStartOfSwitchStmt, which triggers the assertion.

Fix https://github.com/clangd/clangd/issues/311

Reviewers: sammccall

Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[libc++] Fix installation of cxx_experimental
Louis Dionne [Tue, 24 Mar 2020 14:06:00 +0000 (10:06 -0400)]
[libc++] Fix installation of cxx_experimental

cxx_experimental was never installed because ${experimental_lib} always
expands to an empty target. This seems to have been broken by 97d6fcce4ec6.

4 years ago[CUDA][HIP] Add -Xarch_device and -Xarch_host options
Yaxun (Sam) Liu [Mon, 23 Mar 2020 18:23:09 +0000 (14:23 -0400)]
[CUDA][HIP] Add -Xarch_device and -Xarch_host options

The argument after -Xarch_device will be added to the arguments for CUDA/HIP
device compilation and will be removed for host compilation.

The argument after -Xarch_host will be added to the arguments for CUDA/HIP
host compilation and will be removed for device compilation.

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

4 years ago[DWARF] Fix v5 debug_line parsing of prologues with many files
Pavel Labath [Fri, 20 Mar 2020 14:27:37 +0000 (15:27 +0100)]
[DWARF] Fix v5 debug_line parsing of prologues with many files

Summary:
The directory_count and file_name_count fields are (section 6.2.4 of
DWARF5 spec) supposed to be uleb128s, not bytes. This bug meant that it
was not possible to correctly parse headers with more than 128 files or
directories.

I've found this bug by code inspection, though the limit is so small
someone would have run into it for real sooner or later. I've verified
that the producer side handles many files correctly, and that we are
able to parse such files after this fix.

Reviewers: dblaikie, jhenderson

Subscribers: aprantl, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SelDag] Add FREEZE
Juneyoung Lee [Mon, 23 Mar 2020 04:03:13 +0000 (13:03 +0900)]
[SelDag] Add FREEZE

Summary:
- Add FREEZE node to SelDag
- Lower FreezeInst (in IR) to FREEZE node
- Add Legalization for FREEZE node

Reviewers: qcolombet, bogner, efriedma, lebedev.ri, nlopes, craig.topper, arsenm

Reviewed By: lebedev.ri

Subscribers: wdng, xbolva00, Petar.Avramovic, liuz, lkail, dylanmckay, hiraditya, Jim, arsenm, craig.topper, RKSimon, spatel, lebedev.ri, regehr, trentxintong, nlopes, mkuper, llvm-commits

Tags: #llvm

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

4 years ago[InstSimplify] add more tests for freeze(constant); NFC
Sanjay Patel [Tue, 24 Mar 2020 13:41:43 +0000 (09:41 -0400)]
[InstSimplify] add more tests for freeze(constant); NFC

These should really be moved over to a ConstantFolding test file,
but since this may overlap with the in-progress D76010 and similar
tests already exist here, we can do that as a later cleanup.

4 years ago[lld-link] Support /map option, matching link.exe 's /map output format
Sylvain Audi [Mon, 23 Mar 2020 21:06:48 +0000 (17:06 -0400)]
[lld-link] Support /map option, matching link.exe 's /map output format

Added support for /map and /map:[filepath].
The output was derived from Microsoft's Link.exe output when using that same option.
Note that /MAPINFO support was not added.

The previous implementation of MapFile.cpp/.h was meant for /lldmap, and was renamed to LLDMapFile.cpp/.h
MapFile.cpp/.h is now for /MAP
However, a small fix was added to lldmap, replacing a std::sort with std::stable_sort to enforce reproducibility.

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

4 years agoData formatters: fix detection of C strings
Jaroslav Sevcik [Tue, 24 Mar 2020 13:08:39 +0000 (14:08 +0100)]
Data formatters: fix detection of C strings

Summary:
Detection of C strings does not work well for pointers. If the value object holding a (char*) pointer does not have an address (e.g., if it is a temp), the value is not considered a C string and its formatting is left to DumpDataExtractor rather than the special handling in  ValueObject::DumpPrintableRepresentation. This leads to inconsistent outputs, e.g., in escaping non-ASCII characters. See the test for an example; the second test expectation is not met (without this patch). With this patch, the C string detection only insists that the pointer value is valid. The patch makes the code consistent with how the pointer is obtained in ValueObject::ReadPointedString.

Reviewers: teemperor

Reviewed By: teemperor

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[X86][SSE1] Add additional logic+movmsk patterns that scalarize (PR42870)
Simon Pilgrim [Tue, 24 Mar 2020 13:20:24 +0000 (13:20 +0000)]
[X86][SSE1] Add additional logic+movmsk patterns that scalarize (PR42870)

rL368506 handled the basic case, but we need to account for boolean logic patterns as well.

4 years ago[mlir][StandardToSPIRV] Add support for lowering unary ops
Hanhan Wang [Tue, 24 Mar 2020 13:15:54 +0000 (09:15 -0400)]
[mlir][StandardToSPIRV] Add support for lowering unary ops

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

4 years ago[ConstantRange] Add initial support for binaryXor.
Florian Hahn [Tue, 24 Mar 2020 12:47:24 +0000 (12:47 +0000)]
[ConstantRange] Add initial support for binaryXor.

The initial implementation just delegates to APInt's implementation of
XOR for single element ranges and conservatively returns the full set
otherwise.

Reviewers: nikic, spatel, lebedev.ri

Reviewed By: nikic

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

4 years ago[CodeGen] Fix test attr-noreturn.c when run from my home directory
Sam McCall [Tue, 24 Mar 2020 12:59:16 +0000 (13:59 +0100)]
[CodeGen] Fix test attr-noreturn.c when run from my home directory

4 years ago[AST] Use TypeDependence bitfield to calculate dependence on Types. NFC
Sam McCall [Thu, 19 Mar 2020 10:58:00 +0000 (11:58 +0100)]
[AST] Use TypeDependence bitfield to calculate dependence on Types. NFC

Summary:
This clears the way for adding an Error dependence bit to Type and having it
mostly-automatically propagated.

Reviewers: hokein

Subscribers: jfb, cfe-commits

Tags: #clang

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

4 years agoMake helpers static. NFC.
Benjamin Kramer [Tue, 24 Mar 2020 12:43:00 +0000 (13:43 +0100)]
Make helpers static. NFC.

4 years agoFix unused variable warning
Simon Pilgrim [Tue, 24 Mar 2020 11:40:02 +0000 (11:40 +0000)]
Fix unused variable warning

4 years agoIncrease DIAG_SIZE_DRIVER as we're close to hitting it
Russell Gallop [Tue, 24 Mar 2020 11:43:51 +0000 (11:43 +0000)]
Increase DIAG_SIZE_DRIVER as we're close to hitting it

4 years ago[ReleaseNotes,ARM] MVE intrinsics are all implemented!
Simon Tatham [Tue, 24 Mar 2020 11:37:51 +0000 (11:37 +0000)]
[ReleaseNotes,ARM] MVE intrinsics are all implemented!

Summary:
The next release of LLVM will support the full ACLE spec for MVE intrinsics,
so it's worth saying so in the release notes.

Reviewers: kristof.beyls

Reviewed By: kristof.beyls

Subscribers: cfe-commits, hans, dmgreen, llvm-commits

Tags: #llvm, #clang

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

4 years ago[clangd] Change line break behaviour for hoverinfo
Lorenz Junglas [Tue, 24 Mar 2020 11:30:51 +0000 (12:30 +0100)]
[clangd] Change line break behaviour for hoverinfo

`parseDocumentation` retains hard line breaks and removes soft line
breaks inside documentation comments.
Wether a line break is hard or soft is determined by the following rules
(some of which have been discussed in
https://github.com/clangd/clangd/issues/95):

Line breaks that are preceded by a punctuation are retained
Line breaks that are followed by "interesting characters" (e.g. Markdown
syntax, doxygen commands) are retained
All other line breaks are removed

Related issue: https://github.com/clangd/clangd/issues/95

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

4 years ago[lldb][NFC] Mark GetNextPersistentVariableName as overriden to silence warning
Raphael Isemann [Tue, 24 Mar 2020 11:30:01 +0000 (12:30 +0100)]
[lldb][NFC] Mark GetNextPersistentVariableName as overriden to silence warning

This was triggering -Winconsistent-missing-override warnings.

4 years ago[NFC][ARM] Add missing tests
Sam Parker [Tue, 24 Mar 2020 11:07:20 +0000 (11:07 +0000)]
[NFC][ARM] Add missing tests

4 years ago[UpdateTestChecks] Use common ir function name matcher and extend to accept periods...
Simon Pilgrim [Tue, 24 Mar 2020 10:59:08 +0000 (10:59 +0000)]
[UpdateTestChecks] Use common ir function name matcher and extend to accept periods in names (PR37586)

Remove the local versions of the IR_FUNCTION_RE matcher (they weren't doing anything different), and ensure all the function name matchers accept '.' and '-'.

We don't need to use '\.' inside python regex sets either, or '\-' as long as thats at the end of the set.

4 years agotsan: Adding releaseAcquire() to ThreadClock
Dmitry Vyukov [Tue, 24 Mar 2020 09:27:08 +0000 (10:27 +0100)]
tsan: Adding releaseAcquire() to ThreadClock

realeaseAcquire() is a new function added to TSan in support of the Go data-race detector.
It's semantics is:

void ThreadClock::releaseAcquire(SyncClock *sc) const {
  for (int i = 0; i < kMaxThreads; i++) {
    tmp = clock[i];
    clock[i] = max(clock[i], sc->clock[i]);
    sc->clock[i] = tmp;
  }
}

For context see: https://go-review.googlesource.com/c/go/+/220419

Reviewed-in: https://reviews.llvm.org/D76322
Author: dfava (Daniel Fava)

4 years ago[ARM][CMSE] Implement CMSE attributes
Momchil Velikov [Tue, 24 Mar 2020 09:32:51 +0000 (09:32 +0000)]
[ARM][CMSE] Implement CMSE attributes

This patch adds CMSE attributes `cmse_nonsecure_call` and
`cmse_nonsecure_entry`.  As usual, specification is available here:
https://developer.arm.com/docs/ecm0359818/latest

Patch by Javed Absar, Bradley Smith, David Green, Momchil Velikov,
possibly others.

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

4 years ago[ARM] Don't split trunc stores that can be better handled as VMOVN
David Green [Tue, 24 Mar 2020 08:47:50 +0000 (08:47 +0000)]
[ARM] Don't split trunc stores that can be better handled as VMOVN

We deliberately split stores of the form
store(truncate(larger-than-legal-type)) into two stores, allowing each
store to perform part of the truncate for free.

There are times however where it makes more sense to use VMOVN to
de-interlace the results back into a single vector, and store that in
one go. This adds a check for that situation, not splitting the store if
it looks like a VMOVN can be more useful.

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

4 years ago[ARM][LowOverheadLoops] Add checks for narrowing
Sam Parker [Tue, 24 Mar 2020 08:41:48 +0000 (08:41 +0000)]
[ARM][LowOverheadLoops] Add checks for narrowing

Modify ValidateLiveOuts to track 'FalseLaneZeros' more precisely,
including checks on specific operations that can generate non-zeros
from zero values, e.g VMVN. We can then check that any instructions
that retain some information in their output register (all narrowing
instructions) that they only use and def registers that always have
zeros in their falsely predicated bytes, whether or not tail
predication happens.

Most of the logic remains the same, just the names of the data
structures and helpers have been renamed to reflect the change in
logic. The key change, apart from the opcode checkers, is that the
FalseZeros set now strictly contains only instructions which will
always generate zeros, and not instructions that could also have
their false bytes masked away later.

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

4 years ago[ARM][MVE] Add target flag for narrowing insts
Sam Parker [Tue, 24 Mar 2020 08:23:05 +0000 (08:23 +0000)]
[ARM][MVE] Add target flag for narrowing insts

Add a flag, 'RetainsPreviousHalfElement', for operations that operate
on top/bottom halves of their input and only write to half of their
destination, leaving the other half to retain its previous value.

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

4 years ago[AST] Add RecoveryExpr to retain expressions on semantic errors
Haojian Wu [Thu, 19 Mar 2020 15:30:40 +0000 (16:30 +0100)]
[AST] Add RecoveryExpr to retain expressions on semantic errors

Normally clang avoids creating expressions when it encounters semantic
errors, even if the parser knows which expression to produce.

This works well for the compiler. However, this is not ideal for
source-level tools that have to deal with broken code, e.g. clangd is
not able to provide navigation features even for names that compiler
knows how to resolve.

The new RecoveryExpr aims to capture the minimal set of information
useful for the tools that need to deal with incorrect code:

source range of the expression being dropped,
subexpressions of the expression.
We aim to make constructing RecoveryExprs as simple as possible to
ensure writing code to avoid dropping expressions is easy.

Producing RecoveryExprs can result in new code paths being taken in the
frontend. In particular, clang can produce some new diagnostics now and
we aim to suppress bogus ones based on Expr::containsErrors.

We deliberately produce RecoveryExprs only in the parser for now to
minimize the code affected by this patch. Producing RecoveryExprs in
Sema potentially allows to preserve more information (e.g. type of an
expression), but also results in more code being affected. E.g.
SFINAE checks will have to take presence of RecoveryExprs into account.

Initial implementation only works in C++ mode, as it relies on compiler
postponing diagnostics on dependent expressions. C and ObjC often do not
do this, so they require more work to make sure we do not produce too
many bogus diagnostics on the new expressions.

See documentation of RecoveryExpr for more details.

original patch from Ilya
This change is based on https://reviews.llvm.org/D61722

Reviewers: sammccall, rsmith

Reviewed By: sammccall, rsmith

Tags: #clang

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

4 years ago[lldb-vscode] Add missing launchCommands entry in the package.json
Walter Erquinigo [Sat, 21 Mar 2020 02:33:14 +0000 (19:33 -0700)]
[lldb-vscode] Add missing launchCommands entry in the package.json

4 years ago[PowerPC] fix a typo in commit 3f85134d710c
Chen Zheng [Tue, 24 Mar 2020 05:53:59 +0000 (01:53 -0400)]
[PowerPC] fix a typo in commit 3f85134d710c

Implement target hook isProfitableToHoist - typo fix.

4 years agoFix another instance where a variable was renamed in the generated LLVM IR. [NFC]
Douglas Yung [Tue, 24 Mar 2020 05:52:56 +0000 (22:52 -0700)]
Fix another instance where a variable was renamed in the generated LLVM IR. [NFC]

4 years ago[Coroutines] Also check lifetime intrinsic for local variable when build
Jun Ma [Tue, 10 Mar 2020 10:32:55 +0000 (18:32 +0800)]
[Coroutines] Also check lifetime intrinsic for local variable when build
coroutine frame

Currently we move all allocas into the frame when build coroutine frame in
CoroSplit pass. However, this can be relaxed.

Since CoroSplit pass run after Inline pass, we can use lifetime intrinsic to
do such analysis: If the scope of lifetime intrinsic is not across any suspend
point, rather than move the allocas to frame, we can just move them to entry bb
of corresponding function. This reduce the frame size.

More importantly, this also avoid data race in multithread environment.
Consider one inline function by coroutine: it starts a thread which access
local variables, while after inline the movement of allocs to frame also access
them. cause data race.

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

4 years ago[Coroutines] Insert lifetime intrinsics even O0 is used
Jun Ma [Fri, 13 Mar 2020 07:27:45 +0000 (15:27 +0800)]
[Coroutines] Insert lifetime intrinsics even O0 is used

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

4 years ago[GlobalOpt] Treat null-check of loaded value as use of global (PR35760)
Vedant Kumar [Mon, 23 Mar 2020 22:09:38 +0000 (15:09 -0700)]
[GlobalOpt] Treat null-check of loaded value as use of global (PR35760)

PR35760 shows an example program which, when compiled with `clang -O0`
or gcc at any optimization level, prints '0'. However, llvm transforms
the program in a way that causes it to print '1'.

Fix the issue by having `AllUsesOfValueWillTrapIfNull` return false when
analyzing a load from a global which is used by an `icmp`. This special
case was untested [0] so this is just deleting dead code.

An alternative fix might be to change the GlobalStatus analysis for the
global to report "Stored" instead of "StoredOnce". However, "StoredOnce"
is appropriate when only one value other than the initializer is stored
to the global.

[0]
http://lab.llvm.org:8080/coverage/coverage-reports/coverage/Users/buildslave/jenkins/workspace/coverage/llvm-project/llvm/lib/Transforms/IPO/GlobalOpt.cpp.html#L662

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

4 years ago[MLIR][NFC] flat affine constraints - refactor to share, renames
Uday Bondhugula [Tue, 24 Mar 2020 04:22:41 +0000 (09:52 +0530)]
[MLIR][NFC] flat affine constraints - refactor to share, renames

- refactor to remove duplicate code
- some renaming / comment updates for readability

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D76667

4 years agoMake test more flexible for when the variable is renamed in the generated LLVM IR...
Douglas Yung [Tue, 24 Mar 2020 05:03:21 +0000 (22:03 -0700)]
Make test more flexible for when the variable is renamed in the generated LLVM IR. [NFC]

4 years ago[objc_direct] also go through implementations when looking for clashes
Pierre Habouzit [Mon, 23 Mar 2020 22:10:03 +0000 (15:10 -0700)]
[objc_direct] also go through implementations when looking for clashes

Some methods are sometimes declared in the @implementation blocks which
can cause undiagnosed clashes.

Just write a checkObjCDirectMethodClashes() for this purpose.

Also make sure that "unavailable" selectors do not inherit
objc_direct_members.

Differential Revision: https://reviews.llvm.org/D76643
Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Radar-ID: rdar://problem/59332804, rdar://problem/59782963

4 years ago[libc] Enable llvmlibc clang-tidy checks
Paula Toth [Tue, 24 Mar 2020 03:33:56 +0000 (20:33 -0700)]
[libc] Enable llvmlibc clang-tidy checks

Summary:
Add  clang-tidy for llvm-libc source directory.

Example of check in action:
```
/workspace/llvm-project/libc/src/string/strcpy.cpp:10:1: error: system include stdio.h not allowed [llvmlibc-restrict-system-libc-headers,-warnings-as-errors]
#include <stdio.h>
^~~~~~~~~~~~~~~~~~
```

Reviewers: sivachandra, abrachet

Reviewed By: sivachandra, abrachet

Subscribers: aheejin, MaskRay, tschuett, libc-commits

Tags: #libc-project

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

4 years ago[NFC][RUIP] Small debug output refine
Jinsong Ji [Tue, 24 Mar 2020 02:55:30 +0000 (02:55 +0000)]
[NFC][RUIP] Small debug output refine

Add a new line, so that we always print MI in a new line,
before and after UpdateRegMask, for easier check..

4 years agoAdd an algorithm for performing "optimal" layout of a struct.
John McCall [Fri, 20 Mar 2020 20:45:39 +0000 (16:45 -0400)]
Add an algorithm for performing "optimal" layout of a struct.

The algorithm supports both assigning a fixed offset to a field prior to
layout and allowing fields to have sizes that aren't multiples of their
required alignments.  This means that the well-known algorithm of sorting
by decreasing alignment isn't always good enough.  Still, we start with
that, and only if that leaves padding around do we fall back on a greedy
padding-minimizing algorithm.

There is no known efficient algorithm for producing a guaranteed-minimal
layout in all cases.  In fact, allowing arbitrary fixed-offset fields means
there's a straightforward reduction from bin-packing, making this NP-hard.
But as usual with such problems, we can still efficiently produce adequate
solutions to the cases that matter most to us.

I intend to use this in coroutine frame layout, where the retcon lowerings
very badly want to minimize total space usage, and where the switch lowering
can indeed produce a header with interior padding if the promise field is
highly-aligned.  But it may be useful in a much wider variety of situations.

4 years ago[MLIR] move loopUnrollJamBy*Factor to loop transforms utils
Uday Bondhugula [Mon, 23 Mar 2020 18:26:00 +0000 (23:56 +0530)]
[MLIR] move loopUnrollJamBy*Factor to loop transforms utils

The declarations for these were already part of transforms utils, but
the definitions were left in affine transforms. Move definitions to loop
transforms utils.

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D76633

4 years agoCreate basic SBEnvironment class
Walter Erquinigo [Sat, 21 Mar 2020 02:31:33 +0000 (19:31 -0700)]
Create basic SBEnvironment class

4 years ago[MLIR][NFC] loop tiling - improve comments / naming
Uday Bondhugula [Mon, 23 Mar 2020 15:02:58 +0000 (20:32 +0530)]
[MLIR][NFC] loop tiling - improve comments / naming

Improve comments, naming, and other cleanup

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D76616

4 years ago[mlir] [VectorOps] A "reference" lowering of vector.transpose to LLVM IR
aartbik [Mon, 23 Mar 2020 22:31:51 +0000 (15:31 -0700)]
[mlir] [VectorOps] A "reference" lowering of vector.transpose to LLVM IR

Summary: Makes the vector.tranpose runnable on CPU.

Reviewers: nicolasvasilache, andydavis1, rriddle

Reviewed By: nicolasvasilache

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[VirtualFileSystem] Add unit test for vfs::YAMLVFSWriter
Jonas Devlieghere [Tue, 24 Mar 2020 00:47:18 +0000 (17:47 -0700)]
[VirtualFileSystem] Add unit test for vfs::YAMLVFSWriter

Add a unit test for vfs::YAMLVFSWriter.

This patch exposes an issue in the writer: when we call addFileMapping
with a directory, the VFS writer will emit it as a regular file, causing
any of the nested files or directories to not be found.

4 years agoscudo: Create a public include directory. NFCI.
Peter Collingbourne [Mon, 23 Mar 2020 23:08:18 +0000 (16:08 -0700)]
scudo: Create a public include directory. NFCI.

For MTE error reporting we will need to expose interfaces for crash handlers
to use to interpret scudo headers and metadata. The intent is that these
interfaces will live in scudo/interface.h.

Move the existing interface.h into an include/scudo directory and make it
independent of the internal headers, so that we will be able to add the
interfaces there.

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

4 years agoRevert "Create basic SBEnvironment class"
Walter Erquinigo [Tue, 24 Mar 2020 01:20:10 +0000 (18:20 -0700)]
Revert "Create basic SBEnvironment class"

This reverts commit fd868f517d2c5ca8c0f160dbec0857b14ecf74c1.

4 years agoCreate basic SBEnvironment class
Walter Erquinigo [Sat, 21 Mar 2020 02:31:33 +0000 (19:31 -0700)]
Create basic SBEnvironment class

4 years agoFix a bug in the .mlir lexer, where a \0 character in a file is treated as a colon...
Chris Lattner [Mon, 23 Mar 2020 22:39:32 +0000 (15:39 -0700)]
Fix a bug in the .mlir lexer, where a \0 character in a file is treated as a colon (due to an accidental fall through) instead of whitespace.

Summary:
While here, simplify the lexer a bit by eliminating the unneeded 'operator'
classification of certain sigils, they can just be treated as 'punctuation'.

Reviewers: rriddle!

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[OpenMPOpt] Initialize value to avoid use of uninitialized memory
Johannes Doerfert [Tue, 24 Mar 2020 00:14:34 +0000 (19:14 -0500)]
[OpenMPOpt] Initialize value to avoid use of uninitialized memory

This should fix the issue reported here:
  https://reviews.llvm.org/D76058#1937554

4 years ago[GlobalISel] Combine G_SELECTs of the form (cond ? x : x) into x
Jessica Paquette [Fri, 20 Mar 2020 01:12:18 +0000 (18:12 -0700)]
[GlobalISel] Combine G_SELECTs of the form (cond ? x : x) into x

When we find something like this:

```
%a:_(s32) = G_SOMETHING ...
...
%select:_(s32) = G_SELECT %cond(s1), %a, %a
```

We can remove the select and just replace it entirely with `%a` because it's
always going to result in `%a`.

Same if we have

```
%select:_(s32) = G_SELECT %cond(s1), %a, %b
```

where we can deduce that `%a == %b`.

This implements the following cases:

- `%select:_(s32) = G_SELECT %cond(s1), %a, %a` -> `%a`

- `%select:_(s32) = G_SELECT %cond(s1), %a, %some_copy_from_a` -> `%a`

- `%select:_(s32) = G_SELECT %cond(s1), %a, %b` -> `%a` when `%a` and `%b`
   are defined by identical instructions

This gives a few minor code size improvements on CTMark at -O3 for AArch64.

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

4 years ago[clangd] Rename theia-derived semantic highlighting protocol. NFC
Sam McCall [Mon, 23 Mar 2020 23:31:14 +0000 (00:31 +0100)]
[clangd] Rename theia-derived semantic highlighting protocol. NFC

This feature is being added to LSP with a different (request-response)
protocol in 3.16, so this should avoid some confusion.

4 years ago[compiler-rt] Add ConsumeRandomLengthString() version without arguments.
Max Moroz [Thu, 19 Mar 2020 19:42:23 +0000 (12:42 -0700)]
[compiler-rt] Add ConsumeRandomLengthString() version without arguments.

Reviewers: hctim, metzman

Subscribers: dberris, #sanitizers

Tags: #sanitizers

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

4 years agoUpdate documentation for __builtin_operator_new and
Richard Smith [Mon, 23 Mar 2020 23:30:46 +0000 (16:30 -0700)]
Update documentation for __builtin_operator_new and
__builtin_operator_delete to match r328134.

4 years ago[msan] Fix sigaltstack false positive.
Evgenii Stepanov [Mon, 23 Mar 2020 23:15:58 +0000 (16:15 -0700)]
[msan] Fix sigaltstack false positive.

struct stack_t on Linux x86_64 has internal padding which may be left
uninitialized. The check should be replaced with multiple checks for
individual fields of the struct. For now, remove the check altogether.

4 years ago[analyzer] Delete unneeded headers and using after D76509 for layering check
Fangrui Song [Mon, 23 Mar 2020 23:09:59 +0000 (16:09 -0700)]
[analyzer] Delete unneeded headers and using after D76509 for layering check

Otherwise it is incorrect to remove clangStaticAnalyzerFrontend's
dependency on clangRewrite and clangToolingCore.

4 years ago[PowerPC] Improve handling of some BUILD_VECTOR nodes
Nemanja Ivanovic [Mon, 23 Mar 2020 22:34:05 +0000 (17:34 -0500)]
[PowerPC] Improve handling of some BUILD_VECTOR nodes

An analysis of real world code turned up a number of patterns with BUILD_VECTOR
of nodes resulting from operations on extracted vector elements for which we
produce poor code. This addresses those cases. No attempt is made for
completeness as that would entail a large amount of work for something that
there is no evidence of in real code.

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

4 years ago[examples] Fixes for BUILD_SHARED_LIBS=on
Stephen Neuendorffer [Mon, 23 Mar 2020 22:20:54 +0000 (15:20 -0700)]
[examples] Fixes for BUILD_SHARED_LIBS=on

4 years ago[MLIR] Fixes for BUILD_SHARED_LIBS=on
Stephen Neuendorffer [Mon, 23 Mar 2020 22:20:14 +0000 (15:20 -0700)]
[MLIR] Fixes for BUILD_SHARED_LIBS=on

4 years ago[MLIR] Insert loop.yield to IfOp regions only if it's void.
Alexander Belyaev [Mon, 23 Mar 2020 21:33:33 +0000 (22:33 +0100)]
[MLIR] Insert loop.yield to IfOp regions only if it's void.

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

4 years ago[OPENMP50]Add 'default' modifier in reduction clauses.
Alexey Bataev [Mon, 23 Mar 2020 21:30:38 +0000 (17:30 -0400)]
[OPENMP50]Add 'default' modifier in reduction clauses.

Added full support for 'default' modifier in the reduction clauses.

4 years ago[PowerPC]: e500 target can't use lwsync, use msync instead
Justin Hibbits [Mon, 23 Mar 2020 14:44:39 +0000 (09:44 -0500)]
[PowerPC]: e500 target can't use lwsync, use msync instead

The e500 core has a silicon bug that triggers an illegal instruction
program trap on any sync other than msync.  Other cores will typically
ignore illegal sync types, and the documentation even implies that the
'illegal' bits are ignored.

Address this hardware deficiency by only using msync, like the PPC440.

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

4 years agoPR45142: 'template ~X<T>' is ill-formed; reject it rather than crashing.
Richard Smith [Mon, 23 Mar 2020 22:05:38 +0000 (15:05 -0700)]
PR45142: 'template ~X<T>' is ill-formed; reject it rather than crashing.

4 years agoImprove module.pcm lock file performance on machines with high core counts
Ladd Van Tol [Mon, 23 Mar 2020 21:16:55 +0000 (14:16 -0700)]
Improve module.pcm lock file performance on machines with high core counts

Summary:
When building a large Xcode project with multiple module dependencies, and mixed Objective-C & Swift, I observed a large number of clang processes stalling at zero CPU for 30+ seconds throughout the build. This was especially prevalent on my 18-core iMac Pro.

After some sampling, the major cause appears to be the lock file implementation for precompiled modules in the module cache. When the lock is heavily contended by multiple clang processes, the exponential backoff runs in lockstep, with some of the processes sleeping for 30+ seconds in order to acquire the file lock.

In the attached patch, I implemented a more aggressive polling mechanism that limits the sleep interval to a max of 500ms, and randomizes the wait time. I preserved a limited form of exponential backoff. I also updated the code to use cross-platform timing, thread sleep, and random number capabilities available in C++11.

On iMac Pro (2.3 GHz Intel Xeon W, 18 core):

Xcode 11.1 bundled clang:

502.2 seconds (average of 5 runs)

Custom clang build with LockFileManager patch applied:

276.6 seconds (average of 5 runs)

This is a 1.82x speedup for this use case.

On MacBook Pro (4 core 3.1GHz Intel i7):

Xcode 11.1 bundled clang:

539.4 seconds (average of 2 runs)

Custom clang build with LockFileManager patch applied:

509.5 seconds (average of 2 runs)

As expected, machines with fewer cores benefit less from this change.

```
Call graph:
    2992 Thread_393602   DispatchQueue_1: com.apple.main-thread  (serial)
      2992 start  (in libdyld.dylib) + 1  [0x7fff6a1683d5]
        2992 main  (in clang) + 297  [0x1097a1059]
          2992 driver_main(int, char const**)  (in clang) + 2803  [0x1097a5513]
            2992 cc1_main(llvm::ArrayRef<char const*>, char const*, void*)  (in clang) + 1608  [0x1097a7cc8]
              2992 clang::ExecuteCompilerInvocation(clang::CompilerInstance*)  (in clang) + 3299  [0x1097dace3]
                2992 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&)  (in clang) + 509  [0x1097dcc1d]
                  2992 clang::FrontendAction::Execute()  (in clang) + 42  [0x109818b3a]
                    2992 clang::ParseAST(clang::Sema&, bool, bool)  (in clang) + 185  [0x10981b369]
                      2992 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)  (in clang) + 37  [0x10983e9b5]
                        2992 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&)  (in clang) + 141  [0x10983ecfd]
                          2992 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*)  (in clang) + 695  [0x10983f3b7]
                            2992 clang::Parser::ParseObjCAtDirectives(clang::Parser::ParsedAttributesWithRange&)  (in clang) + 637  [0x10a9be9bd]
                              2992 clang::Parser::ParseModuleImport(clang::SourceLocation)  (in clang) + 170  [0x10c4841ba]
                                2992 clang::Parser::ParseModuleName(clang::SourceLocation, llvm::SmallVectorImpl<std::__1::pair<clang::IdentifierInfo*, clang::SourceLocation> >&, bool)  (in clang) + 503  [0x10c485267]
                                  2992 clang::Preprocessor::Lex(clang::Token&)  (in clang) + 316  [0x1098285cc]
                                    2992 clang::Preprocessor::LexAfterModuleImport(clang::Token&)  (in clang) + 690  [0x10cc7af62]
                                      2992 clang::CompilerInstance::loadModule(clang::SourceLocation, llvm::ArrayRef<std::__1::pair<clang::IdentifierInfo*, clang::SourceLocation> >, clang::Module::NameVisibilityKind, bool)  (in clang) + 7989  [0x10bba6535]
                                        2992 compileAndLoadModule(clang::CompilerInstance&, clang::SourceLocation, clang::SourceLocation, clang::Module*, llvm::StringRef)  (in clang) + 296  [0x10bba8318]
                                          2992 llvm::LockFileManager::waitForUnlock()  (in clang) + 91  [0x10b6953ab]
                                            2992 nanosleep  (in libsystem_c.dylib) + 199  [0x7fff6a22c914]
                                              2992 __semwait_signal  (in libsystem_kernel.dylib) + 10  [0x7fff6a2a0f32]

```

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

4 years ago[lldb/PlatformDarwin] Always delete destination file first in PutFile
Fred Riss [Thu, 19 Mar 2020 15:43:41 +0000 (08:43 -0700)]
[lldb/PlatformDarwin] Always delete destination file first in PutFile

Summary:
The default behavior of Platform::PutFile is to open the file and
truncate it if it already exists. This works fine and is a sensible
default, but it interacts badly with code-signing on iOS, as doing so
invalidates the signature of the file (even if the new content has a
valid code signature).

We have a couple tests which on purpose reload a different binary with
the same name. Those tests are currently broken because of the above
interaction.

This patch simply makes the Darwin platform unconditionally delete the
destination file before sending the new one to work around this issue.

Reviewers: jasonmolenda

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[lld] Enabling loading LLVM pass plugins
Eli Friedman [Mon, 23 Mar 2020 19:20:05 +0000 (12:20 -0700)]
[lld] Enabling loading LLVM pass plugins

Add the relevant magic bits to allow "-mllvm=-load=plugin.so" etc.

This is now using export_executable_symbols_for_plugins, so symbols are
only exported if plugins are enabled.

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

4 years ago[gn build] Port 7bf871c39f7
LLVM GN Syncbot [Mon, 23 Mar 2020 21:05:55 +0000 (21:05 +0000)]
[gn build] Port 7bf871c39f7

4 years ago[analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIM...
Simon Pilgrim [Mon, 23 Mar 2020 21:02:54 +0000 (21:02 +0000)]
[analyzer] ConstraintManager - use EXPENSIVE_CHECKS instead of (gcc specific) __OPTIMIZE__ guard

This was noticed on D71817, which removed another use of __OPTIMIZE__

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

4 years agoAMDGPU: Allow vectorization of round intrinsic
Matt Arsenault [Fri, 20 Mar 2020 21:16:46 +0000 (17:16 -0400)]
AMDGPU: Allow vectorization of round intrinsic

There seems to be a small benefit to the legalized sequence for v2f16
round with packed instructions, so allow vectorizing it by reducing
the cost.

An unintended side effect is vectorization of f32 round also
happens. The current FMA logic seems off to me, and isn't checking for
packed instructions.

4 years ago[Clang] Fix HIP tests when running on Windows with the LLVM toolchain is in the path
Alexandre Ganea [Mon, 23 Mar 2020 20:54:24 +0000 (16:54 -0400)]
[Clang] Fix HIP tests when running on Windows with the LLVM toolchain is in the path

On Windows, when the LLVM toolchain is in the current path (%PATH%), fusing the linker yields c:\{path}\lld.exe whereas the hip tests did not expect the .exe part.
This only happens if LLD is not present in the build folder, which consequently makes the code in Driver::GetProgramPath() to fall back to %PATH% and platform-specific search, which includes the .exe part (see https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/Driver.cpp#L4733).

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