platform/upstream/llvm.git
4 years ago[analyzer] Note last writes to a condition only in a nested stackframe
Kristof Umann [Wed, 14 Aug 2019 09:39:38 +0000 (09:39 +0000)]
[analyzer] Note last writes to a condition only in a nested stackframe

Exactly what it says on the tin! The comments in the code detail this a
little more too.

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

llvm-svn: 368817

4 years ago[MinGW] Correct handling different forms of a few options
Martin Storsjo [Wed, 14 Aug 2019 09:35:44 +0000 (09:35 +0000)]
[MinGW] Correct handling different forms of a few options

Support the equals form of the long --entry=<symbol> option,
add a test for the -e<symbol> form.

Add tests for single dash forms of -exclude-all-symbols and
-export-all-symbols.

Support single-dash forms of -out-implib and -output-def, support
the equals form of --output-def=<file>. (We previously had a test
to explicitly disallow -out-implib, but it turns out that GNU ld
actually does support it just fine, despite also matching the
-o<file> option.)

Disallow the double-dashed --u form, add a test for -u<symbol>.

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

llvm-svn: 368816

4 years ago[MinGW] Restructure Options.td to use multiclass where sensible. NFC.
Martin Storsjo [Wed, 14 Aug 2019 09:35:40 +0000 (09:35 +0000)]
[MinGW] Restructure Options.td to use multiclass where sensible. NFC.

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

llvm-svn: 368815

4 years ago[MinGW] Remove stray/inconsistent comment chars in test file. NFC.
Martin Storsjo [Wed, 14 Aug 2019 09:35:36 +0000 (09:35 +0000)]
[MinGW] Remove stray/inconsistent comment chars in test file. NFC.

Test directives don't need to be in comments in this file.

llvm-svn: 368814

4 years agoRevert r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"
George Rimar [Wed, 14 Aug 2019 08:56:55 +0000 (08:56 +0000)]
Revert r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"

It broke clang BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16455

llvm-svn: 368813

4 years ago[llvm/Object] - Convert SectionRef::getName() to return Expected<>
George Rimar [Wed, 14 Aug 2019 08:46:54 +0000 (08:46 +0000)]
[llvm/Object] - Convert SectionRef::getName() to return Expected<>

SectionRef::getName() returns std::error_code now.
Returning Expected<> instead has multiple benefits.

For example, it forces user to check the error returned.
Also Expected<> may keep a valuable string error message,
what is more useful than having a error code.
(Object\invalid.test was updated to show the new messages printed.)

This patch makes a change for all users to switch to Expected<> version.

Note: in a few places the error returned was ignored before my changes.
In such places I left them ignored. My intention was to convert the interface
used, and not to improve and/or the existent users in this patch.
(Though I think this is good idea for a follow-ups to revisit such places
and either remove consumeError calls or comment each of them to clarify why
it is OK to have them).

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

llvm-svn: 368812

4 years ago[llvm-objdump] - Add a relocation-xindex-symbol.test test case.
George Rimar [Wed, 14 Aug 2019 08:33:26 +0000 (08:33 +0000)]
[llvm-objdump] - Add a relocation-xindex-symbol.test test case.

This rewrites the exitent test case to use YAML instead of the precompiled object
and moves it from test/Object to an appropriate llvm-objdump tests folder.

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

llvm-svn: 368811

4 years ago[Intrinsics] Add a 'NoAlias' intrinsic property; annotate llvm.memcpy
David Bolvansky [Wed, 14 Aug 2019 08:33:07 +0000 (08:33 +0000)]
[Intrinsics] Add a 'NoAlias' intrinsic property; annotate llvm.memcpy

Reviewers: jdoerfert

Reviewed By: jdoerfert

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

llvm-svn: 368810

4 years ago[Codegen] Updated test for D66158
David Bolvansky [Wed, 14 Aug 2019 08:32:31 +0000 (08:32 +0000)]
[Codegen] Updated test for D66158

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 368809

4 years agoFix the -Wunused-variable warning.
Haojian Wu [Wed, 14 Aug 2019 08:20:42 +0000 (08:20 +0000)]
Fix the -Wunused-variable warning.

llvm-svn: 368808

4 years ago[InstCombine][NFC] Autogenerate checks in adjust-for-minmax.ll
Roman Lebedev [Wed, 14 Aug 2019 08:12:20 +0000 (08:12 +0000)]
[InstCombine][NFC] Autogenerate checks in adjust-for-minmax.ll

Being affected by WIP patch.

llvm-svn: 368807

4 years ago[API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr
Pavel Labath [Wed, 14 Aug 2019 08:11:20 +0000 (08:11 +0000)]
[API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr

Summary:
It seems this was an unintended side-effect of D26698. AFAICT, these
functions did return an empty string before that patch, and the patch
contained code which attempted to ensure that, but those efforts were
negated by ConstString::AsCString, which by default returns a nullptr
even for empty strings.

This patch:
- fixes the GetOutput/Error methods to really return empty strings
- adds and explicit test for that
- removes a workaround in lldbtest.py, which was masking this problem
  from our other tests

Reviewers: jingham, clayborg

Subscribers: zturner, lldb-commits

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

llvm-svn: 368806

4 years agoRemoved dead code from clang/tools/libclang/CXIndexDataConsumer.{cpp,h}
Dmitri Gribenko [Wed, 14 Aug 2019 07:32:51 +0000 (07:32 +0000)]
Removed dead code from clang/tools/libclang/CXIndexDataConsumer.{cpp,h}

Reviewers: jkorous

Subscribers: dexonsmith, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 368805

4 years ago[NewPM][PassInstrumentation] IR printing support from clang driver
Taewook Oh [Wed, 14 Aug 2019 07:11:09 +0000 (07:11 +0000)]
[NewPM][PassInstrumentation] IR printing support from clang driver

Summary: https://reviews.llvm.org/D50923 enabled the IR printing support for the new pass manager, but only for the case when `opt` tool is used as a driver. This patch is to enable the IR printing when `clang` is used as a driver.

Reviewers: fedor.sergeev, philip.pfaffe

Subscribers: cfe-commits, yamauchi, llvm-commits

Tags: #clang

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

llvm-svn: 368804

4 years ago[lldb] Reinstate original guard variable check
Raphael Isemann [Wed, 14 Aug 2019 05:52:33 +0000 (05:52 +0000)]
[lldb] Reinstate original guard variable check

The isGuardVariableSymbol option for ignoring Microsoft's ABI
was originally added to get the bots green, but now that we found
the actual issue (that we checked for prefix instead of suffix
in the MS ABI check), we should be able to properly implement
the guard variable check without any strange Microsoft exceptions.

llvm-svn: 368802

4 years ago[LV] Fold-tail flag
Dorit Nuzman [Wed, 14 Aug 2019 05:22:20 +0000 (05:22 +0000)]
[LV] Fold-tail flag

This is the compiler-flag equivalent of the Predicate pragma
(https://reviews.llvm.org/D65197), to direct the vectorizer to fold the
remainder-loop into the main-loop using predication.

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

Reviewers: Ayal, hsaito, fhahn, SjoerdMeije
llvm-svn: 368801

4 years agoRevert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM'
David L. Jones [Wed, 14 Aug 2019 04:50:33 +0000 (04:50 +0000)]
Revert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM'

This reverts r368526 (git commit 7e71aa24bc0788690fea7f0d7eab400c6a784deb)
This reverts r368542 (git commit cb5a90fd314a7914cf293797bb4fd7a6841052cf)

llvm-svn: 368800

4 years agoRemove minimum toolchain soft-error
JF Bastien [Wed, 14 Aug 2019 04:30:51 +0000 (04:30 +0000)]
Remove minimum toolchain soft-error

Summary:
Back in January I changed the minimum toolchain version required to build clang
and LLVM: D57264. Since then we've release LLVM 8, following
[our process](http://llvm.org/docs/DeveloperPolicy.html#toolchain)
it's therefore now a good time to remove the soft-error and officially deprecate
older toolchains. I tried this out last Tursday night to see if any bots
complained, and I saw no complaints. I also manually audited bots and didn't see
any bot that should break, but their toolchain information is unreliable and
some bots are offline.

Once this patch stick we'll move to C++14 as we've
[already agreed](http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html).

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, EricWF, thakis, chandlerc

Tags: #llvm

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

llvm-svn: 368799

4 years agoCoroutines: adjust for SVN r358739
John McCall [Wed, 14 Aug 2019 03:54:25 +0000 (03:54 +0000)]
Coroutines: adjust for SVN r358739

CallSite has been removed in favour of CallBase.  Adjust the coroutine split to
account for that.

llvm-svn: 368798

4 years agoDon't run a full verifier pass in coro-splitting's private pipeline.
John McCall [Wed, 14 Aug 2019 03:54:18 +0000 (03:54 +0000)]
Don't run a full verifier pass in coro-splitting's private pipeline.

Potentially addresses rdar://49022293.

llvm-svn: 368797

4 years agoRemove unreachable blocks before splitting a coroutine.
John McCall [Wed, 14 Aug 2019 03:54:13 +0000 (03:54 +0000)]
Remove unreachable blocks before splitting a coroutine.

The suspend-crossing algorithm is not correct in the presence of uses
that cannot be reached on some successor path from their defs.

llvm-svn: 368796

4 years agoSupport swifterror in coroutine lowering.
John McCall [Wed, 14 Aug 2019 03:54:05 +0000 (03:54 +0000)]
Support swifterror in coroutine lowering.

The support for swifterror allocas should work in all lowerings.
The support for swifterror arguments only really works in a lowering
with prototypes where you can ensure that the prototype also has a
swifterror argument; I'm not really sure how it could possibly be
made to work in the switch lowering.

llvm-svn: 368795

4 years agoUpdate for optimizer changes.
John McCall [Wed, 14 Aug 2019 03:53:58 +0000 (03:53 +0000)]
Update for optimizer changes.

rdar://37352868

llvm-svn: 368794

4 years agoIn coro.retcon lowering, don't explode if the optimizer messes around with the linkag...
John McCall [Wed, 14 Aug 2019 03:53:52 +0000 (03:53 +0000)]
In coro.retcon lowering, don't explode if the optimizer messes around with the linkage of the prototype or the exact types of the yielded values.

llvm-svn: 368793

4 years agoFix a use-after-free in the coro.alloca treatment.
John McCall [Wed, 14 Aug 2019 03:53:46 +0000 (03:53 +0000)]
Fix a use-after-free in the coro.alloca treatment.

llvm-svn: 368792

4 years agoAdd intrinsics for doing frame-bound dynamic allocations within a coroutine.
John McCall [Wed, 14 Aug 2019 03:53:40 +0000 (03:53 +0000)]
Add intrinsics for doing frame-bound dynamic allocations within a coroutine.

These rely on having an allocator provided to the coroutine and thus,
for now, only work in retcon lowerings.

llvm-svn: 368791

4 years agoGuard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is...
John McCall [Wed, 14 Aug 2019 03:53:31 +0000 (03:53 +0000)]
Guard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is not guaranteed to be defined in all builds.

llvm-svn: 368790

4 years agoGeneralize llvm.coro.suspend.retcon to allow an arbitrary number of arguments to...
John McCall [Wed, 14 Aug 2019 03:53:26 +0000 (03:53 +0000)]
Generalize llvm.coro.suspend.retcon to allow an arbitrary number of arguments to be passed back to the continuation function.

llvm-svn: 368789

4 years agoExtend coroutines to support a "returned continuation" lowering.
John McCall [Wed, 14 Aug 2019 03:53:17 +0000 (03:53 +0000)]
Extend coroutines to support a "returned continuation" lowering.

A quick contrast of this ABI with the currently-implemented ABI:

- Allocation is implicitly managed by the lowering passes, which is fine
  for frontends that are fine with assuming that allocation cannot fail.
  This assumption is necessary to implement dynamic allocas anyway.

- The lowering attempts to fit the coroutine frame into an opaque,
  statically-sized buffer before falling back on allocation; the same
  buffer must be provided to every resume point.  A buffer must be at
  least pointer-sized.

- The resume and destroy functions have been combined; the continuation
  function takes a parameter indicating whether it has succeeded.

- Conversely, every suspend point begins its own continuation function.

- The continuation function pointer is directly returned to the caller
  instead of being stored in the frame.  The continuation can therefore
  directly destroy the frame when exiting the coroutine instead of having
  to leave it in a defunct state.

- Other values can be returned directly to the caller instead of going
  through a promise allocation.  The frontend provides a "prototype"
  function declaration from which the type, calling convention, and
  attributes of the continuation functions are taken.

- On the caller side, the frontend can generate natural IR that directly
  uses the continuation functions as long as it prevents IPO with the
  coroutine until lowering has happened.  In combination with the point
  above, the frontend is almost totally in charge of the ABI of the
  coroutine.

- Unique-yield coroutines are given some special treatment.

llvm-svn: 368788

4 years ago[FileCheck] Document FILECHECK_OPTS in -help
Joel E. Denny [Wed, 14 Aug 2019 02:56:20 +0000 (02:56 +0000)]
[FileCheck] Document FILECHECK_OPTS in -help

Reviewed By: thopre

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

llvm-svn: 368787

4 years ago[FileCheck] Move -dump-input diagnostic to first line
Joel E. Denny [Wed, 14 Aug 2019 02:56:09 +0000 (02:56 +0000)]
[FileCheck] Move -dump-input diagnostic to first line

Without this patch, `-dump-input` prints a diagnostic at the end of
its marker range.  For example:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~ error: no match found
```

This patch moves it to the beginning like this:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~ error: no match found
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~
```

The former somehow looks nicer because the diagnostic doesn't appear
to be somewhere within the marker range.  However, the latter is more
practical, especially when the marker range includes the remainder of
a very long dump.  First, in the case of an error, this patch enables
me to search the dump for `error:` and usually immediately land where
the detected error began.  Second, when trying to follow FileCheck's
logic, it's best to read top down, so this patch enables me to see
each diagnostic as soon as I encounter its marker.

Reviewed By: thopre

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

llvm-svn: 368786

4 years agoAdd __has_builtin support for builtin function-like type traits.
Richard Smith [Wed, 14 Aug 2019 02:30:11 +0000 (02:30 +0000)]
Add __has_builtin support for builtin function-like type traits.

Summary:
Previously __has_builtin(__builtin_*) would return false for
__builtin_*s that we modeled as keywords rather than as functions
(because they take type arguments). With this patch, all builtins
that are called with function-call-like syntax return true from
__has_builtin (covering __builtin_* and also the __is_* and __has_* type
traits and the handful of similar builtins without such a prefix).

Update the documentation on __has_builtin and on type traits to match.
While doing this I noticed the type trait documentation was out of date
and incomplete; that's fixed here too.

Reviewers: aaron.ballman

Subscribers: jfb, kristina, cfe-commits

Tags: #clang

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

llvm-svn: 368785

4 years ago[ELF] Initialize 2 fields of Symbol in SymbolTable::insert
Fangrui Song [Wed, 14 Aug 2019 01:52:47 +0000 (01:52 +0000)]
[ELF] Initialize 2 fields of Symbol in SymbolTable::insert

A new symbol is added to elf::symtab in 3 steps:

1) SymbolTable::insert creates a placeholder.
2) Symbol::mergeProperties
3) Symbol::replace

Fields referenced by steps 2) and 3) should be initialized in
SymbolTable::insert.  `traced` and `referenced` were missed previously.
This did not cause problems because compilers generated code that
initialized them (bit fields) to 0.

Reviewed By: grimar

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

llvm-svn: 368784

4 years ago[libcxxabi] Define _LIBCXXABI_GUARD_ABI_ARM on WebAssembly
Sam Clegg [Wed, 14 Aug 2019 01:30:48 +0000 (01:30 +0000)]
[libcxxabi] Define _LIBCXXABI_GUARD_ABI_ARM on WebAssembly

This matches ItaniumCXXABI.cpp.

Fixes PR42680

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

llvm-svn: 368783

4 years agoFix warning: suggest braces around initialization of subobject
Jonas Devlieghere [Wed, 14 Aug 2019 01:25:10 +0000 (01:25 +0000)]
Fix warning: suggest braces around initialization of subobject

This patch adds braces to the DEFINE_XMM macro.

llvm-svn: 368782

4 years ago[GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source...
Aditya Nandakumar [Wed, 14 Aug 2019 01:23:33 +0000 (01:23 +0000)]
[GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source index

https://reviews.llvm.org/D66182

llvm-svn: 368781

4 years ago[analyzer] Don't delete TaintConfig copy constructor
Alex Langford [Wed, 14 Aug 2019 01:09:07 +0000 (01:09 +0000)]
[analyzer] Don't delete TaintConfig copy constructor

Summary:
Explicitly deleting the copy constructor makes compiling the function
`ento::registerGenericTaintChecker` difficult with some compilers. When we
construct an `llvm::Optional<TaintConfig>`, the optional is constructed with a
const TaintConfig reference which it then uses to invoke the deleted TaintConfig
copy constructor.

I've observered this failing with clang 3.8 on Ubuntu 16.04.

Reviewers: compnerd, Szelethus, boga95, NoQ, alexshap

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, llvm-commits, cfe-commits

Tags: #clang

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

llvm-svn: 368779

4 years ago[ORC] Fix clang-interpreter example code broken by r368707.
Douglas Yung [Wed, 14 Aug 2019 01:03:35 +0000 (01:03 +0000)]
[ORC] Fix clang-interpreter example code broken by r368707.

llvm-svn: 368778

4 years ago[analyzer][NFC] Prepare visitors for different tracking kinds
Kristof Umann [Wed, 14 Aug 2019 00:48:57 +0000 (00:48 +0000)]
[analyzer][NFC] Prepare visitors for different tracking kinds

When we're tracking a variable that is responsible for a null pointer
dereference or some other sinister programming error, we of course would like to
gather as much information why we think that the variable has that specific
value as possible. However, the newly introduced condition tracking shows that
tracking all values this thoroughly could easily cause an intolerable growth in
the bug report's length.

There are a variety of heuristics we discussed on the mailing list[1] to combat
this, all of them requiring to differentiate in between tracking a "regular
value" and a "condition".

This patch introduces the new `bugreporter::TrackingKind` enum, adds it to
several visitors as a non-optional argument, and moves some functions around to
make the code a little more coherent.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-June/062613.html

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

llvm-svn: 368777

4 years agoUpdate Python tests for lldb-server on Windows
Aaron Smith [Wed, 14 Aug 2019 00:14:15 +0000 (00:14 +0000)]
Update Python tests for lldb-server on Windows

Summary: Thanks to Hui Huang and reviewers for all the help with this patch!

Reviewers: labath, jfb, clayborg

Reviewed By: labath

Subscribers: Hui, clayborg, dexonsmith, lldb-commits

Tags: #lldb

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

llvm-svn: 368776

4 years ago[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.
Amara Emerson [Tue, 13 Aug 2019 23:51:20 +0000 (23:51 +0000)]
[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.

The destinations should be FPRs (for now).

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

llvm-svn: 368775

4 years agoEnable lldb-server on Windows
Aaron Smith [Tue, 13 Aug 2019 23:50:54 +0000 (23:50 +0000)]
Enable lldb-server on Windows

Summary:
This commit contains three small changes to enable lldb-server on Windows.

- Add lldb-server for Windows to the build
- Disable pty redirection on Windows for the initial lldb-server bring up
- Add a support to get the parent pid for a process on Windows
- Ifdef some signals which aren't supported on Windows

Thanks to Hui Huang for the help with this patch!

Reviewers: labath

Reviewed By: labath

Subscribers: JDevlieghere, compnerd, Hui, amccarth, xiaobai, srhines, mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 368774

4 years ago[analyzer] Track the right hand side of the last store regardless of its value
Kristof Umann [Tue, 13 Aug 2019 23:48:10 +0000 (23:48 +0000)]
[analyzer] Track the right hand side of the last store regardless of its value

Summary:
The following code snippet taken from D64271#1572188 has an issue: namely,
because `flag`'s value isn't undef or a concrete int, it isn't being tracked.

int flag;
bool coin();

void foo() {
  flag = coin();
}

void test() {
  int *x = 0;
  int local_flag;
  flag = 1;

  foo();
  local_flag = flag;
  if (local_flag)
    x = new int;

  foo();
  local_flag = flag;
  if (local_flag)
    *x = 5;
}

This, in my opinion, makes no sense, other values may be interesting too.
Originally added by rC185608.

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

llvm-svn: 368773

4 years ago[DebugLine] Be more robust in geussing the path style
Jonas Devlieghere [Tue, 13 Aug 2019 23:30:11 +0000 (23:30 +0000)]
[DebugLine] Be more robust in geussing the path style

My previous change didn't fix the Windows bot. This patch is an attempt
to make guessing the path style more robust by first looking at the
compile dir and falling back to the actual file if that's unsuccessful.

llvm-svn: 368772

4 years ago[analyzer] Prune calls to functions with linear CFGs that return a non-zero constrain...
Kristof Umann [Tue, 13 Aug 2019 23:22:33 +0000 (23:22 +0000)]
[analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

During the evaluation of D62883, I noticed a bunch of totally
meaningless notes with the pattern of "Calling 'A'" -> "Returning value"
-> "Returning from 'A'", which added no value to the report at all.

This patch (not only affecting tracked conditions mind you) prunes
diagnostic messages to functions that return a value not constrained to
be 0, and are also linear.

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

llvm-svn: 368771

4 years ago[AArch64] Remove incorrect usage of MONonTemporal.
Eli Friedman [Tue, 13 Aug 2019 23:12:14 +0000 (23:12 +0000)]
[AArch64] Remove incorrect usage of MONonTemporal.

This has no effect at the moment, but might matter if we try to
implement non-temporal loads in the future.

llvm-svn: 368770

4 years ago[analyzer] exploded-graph-rewriter: Implement displaying Store pointers.
Artem Dergachev [Tue, 13 Aug 2019 23:04:56 +0000 (23:04 +0000)]
[analyzer] exploded-graph-rewriter: Implement displaying Store pointers.

They're useful when trying to understand what's going on
inside your LazyCompoundValues.

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

llvm-svn: 368769

4 years ago[analyzer] exploded-graph-rewriter: Implement manual graph trimming.
Artem Dergachev [Tue, 13 Aug 2019 23:04:53 +0000 (23:04 +0000)]
[analyzer] exploded-graph-rewriter: Implement manual graph trimming.

When -trim-egraph is unavailable (say, when you're debugging a crash on
a real-world code that takes too long to reduce), it makes sense to view
the untrimmed graph up to the crashing node's predecessor, then dump the ID
(or a pointer) of the node in the attached debugger, and then trim
the dumped graph in order to keep only paths from the root to the node.

The newly added --to flag does exactly that:

$ exploded-graph-rewriter.py ExprEngine.dot --to 0x12229acd0

Multiple nodes can be specified. Stable IDs of nodes can be used
instead of pointers.

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

llvm-svn: 368768

4 years ago[analyzer] exploded-graph-rewriter: NFC: Refactor explorers into trimmers.
Artem Dergachev [Tue, 13 Aug 2019 23:04:50 +0000 (23:04 +0000)]
[analyzer] exploded-graph-rewriter: NFC: Refactor explorers into trimmers.

Explorers aren't the right abstraction. For the purposes of displaying svg files
we don't care in which order do we explore the nodes. We may care about this for
other analyses, but we're not there yet.

The function of cutting out chunks of the graph is performed poorly by
the explorers, because querying predecessors/successors on the explored nodes
yields original successors/predecessors even if they aren't being explored.

Introduce a new entity, "trimmers", that do one thing but to it right: cut out
chunks of the graph. Trimmers mutate the graph, so stale edges aren't even
visible to their consumers in the pipeline. Additionally, trimmers are
intrinsically composable: multiple trimmers can be applied to the graph
sequentially.

Refactor the single-path explorer into the single-path trimmer.
Rename the test file for consistency.

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

llvm-svn: 368767

4 years ago[analyzer] exploded-graph-rewriter: Open the converted graph immediately.
Artem Dergachev [Tue, 13 Aug 2019 23:04:47 +0000 (23:04 +0000)]
[analyzer] exploded-graph-rewriter: Open the converted graph immediately.

Change the default behavior: the tool no longer dumps the rewritten .dot file
to stdout, but instead it automatically converts it into an .html file
(which essentially wraps an .svg file) and immediately opens it with
the default web browser.

This means that the tool should now be fairly easy to use:

  $ exploded-graph-rewriter.py /tmp/ExprEngine.dot

The benefits of wrapping the .svg file into an .html file are:

    - It'll open in a web browser, which is the intended behavior.
      An .svg file would be open with an image viewer/editor instead.
    - It avoids the white background around the otherwise dark svg area
      in dark mode.

The feature can be turned off by passing a flag '--rewrite-only'.
The LIT substitution is updated to enforce the old mode because
we don't want web browsers opening on our buildbots.

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

llvm-svn: 368766

4 years ago[analyzer] Disable the checker-plugins test on Darwin.
Artem Dergachev [Tue, 13 Aug 2019 23:04:44 +0000 (23:04 +0000)]
[analyzer] Disable the checker-plugins test on Darwin.

Fixes a buildbot.

llvm-svn: 368765

4 years ago[ORC] Fix SpeculativeJIT example code broken by r368707.
Lang Hames [Tue, 13 Aug 2019 22:44:54 +0000 (22:44 +0000)]
[ORC] Fix SpeculativeJIT example code broken by r368707.

llvm-svn: 368764

4 years ago[Polly-ACC] Fix test after IR-printer change.
Michael Kruse [Tue, 13 Aug 2019 22:42:08 +0000 (22:42 +0000)]
[Polly-ACC] Fix test after IR-printer change.

After r367755, even unnamed parameters are printed in IR dumps. Change
the test to expect te additional %0 in the line.

llvm-svn: 368763

4 years ago[clang][DirectoryWatcher] Fix Windows stub after LLVM change
Jan Korous [Tue, 13 Aug 2019 22:39:50 +0000 (22:39 +0000)]
[clang][DirectoryWatcher] Fix Windows stub after LLVM change

r367979 changed DirectoryWatcher::Create to return an llvm::Expected.
Adjust the Windows stub accordingly.

(upstreamed from github.com/apple/swift-clang)

llvm-svn: 368762

4 years ago[clang] DirectoryWatcher for Windows stubs (to fix build break).
Jan Korous [Tue, 13 Aug 2019 22:39:26 +0000 (22:39 +0000)]
[clang] DirectoryWatcher for Windows stubs (to fix build break).

This is just a code skeleton for DirectoryWatcher-windows.cpp so the
build on Windows stops breaking.

(upstreamed from github.com/apple/swift-clang)

llvm-svn: 368761

4 years agoAttempt to fix issue with unresolved lit test in TableGen
Jessica Paquette [Tue, 13 Aug 2019 22:32:26 +0000 (22:32 +0000)]
Attempt to fix issue with unresolved lit test in TableGen

Build bots are unhappy about the Common directory.

Add an excludes list to lit.local.cfg.

llvm-svn: 368760

4 years agoInitial support for native debugging of x86/x64 Windows processes
Aaron Smith [Tue, 13 Aug 2019 22:18:01 +0000 (22:18 +0000)]
Initial support for native debugging of x86/x64 Windows processes

Summary: Thanks to Hui Huang and the reviewers for all the help with this patch.

Reviewers: labath, Hui, jfb, clayborg, amccarth

Reviewed By: labath

Subscribers: amccarth, compnerd, dexonsmith, mgorny, jfb, teemperor, lldb-commits

Tags: #lldb

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

llvm-svn: 368759

4 years ago[NFCI] Explicitly provide user-defined constructor for SectionRef
Alex Langford [Tue, 13 Aug 2019 22:16:18 +0000 (22:16 +0000)]
[NFCI] Explicitly provide user-defined constructor for SectionRef

I am changing this to work around an issue that is being hit when
building with clang 3.8. Specifically, clang 3.8 requires that we have a user
defined default constructor for SectionRef for the default initialization of a
const SectionRef.

llvm-svn: 368758

4 years ago[GlobalISel][NFC] Factor out common target code from GlobalISelEmitterTests
Jessica Paquette [Tue, 13 Aug 2019 22:14:37 +0000 (22:14 +0000)]
[GlobalISel][NFC] Factor out common target code from GlobalISelEmitterTests

Factor out commonly-used target code from the GlobalISelEmitter tests into
a GlobalISelEmitterCommon.td file. This is tested by the original
GlobalISelEmitter.td test.

This reduces the amount of boilerplate code necessary for tests like this.

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

llvm-svn: 368757

4 years agoRelax opcode checks in test to check for only a number instead of a specific number.
Douglas Yung [Tue, 13 Aug 2019 22:05:18 +0000 (22:05 +0000)]
Relax opcode checks in test to check for only a number instead of a specific number.

llvm-svn: 368756

4 years ago[analyzer][NFC] Make sure that the BugReport is not modified during the construction...
Kristof Umann [Tue, 13 Aug 2019 22:03:08 +0000 (22:03 +0000)]
[analyzer][NFC] Make sure that the BugReport is not modified during the construction of non-visitor pieces

I feel this is kinda important, because in a followup patch I'm adding different
kinds of interestingness, and propagating the correct kind in BugReporter.cpp is
just one less thing to worry about.

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

llvm-svn: 368755

4 years agoAdd a missing header comment, NFC
Erik Pilkington [Tue, 13 Aug 2019 22:01:39 +0000 (22:01 +0000)]
Add a missing header comment, NFC

llvm-svn: 368754

4 years ago[GlobalISel]: Fix lowering of G_SHUFFLE_VECTOR with scalar sources
Aditya Nandakumar [Tue, 13 Aug 2019 21:49:11 +0000 (21:49 +0000)]
[GlobalISel]: Fix lowering of G_SHUFFLE_VECTOR with scalar sources

https://reviews.llvm.org/D66171

llvm-svn: 368753

4 years ago[analyzer][NFC] Refactoring BugReporter.cpp P6.: Completely get rid of interestingnes...
Kristof Umann [Tue, 13 Aug 2019 21:48:17 +0000 (21:48 +0000)]
[analyzer][NFC] Refactoring BugReporter.cpp P6.: Completely get rid of interestingness propagation

Apparently this does literally nothing.

When you think about this, it makes sense. If something is really important,
we're tracking it anyways, and that system is sophisticated enough to mark
actually interesting statements as such. I wouldn't say that it's even likely
that subexpressions are also interesting (array[10 - x + x]), so I guess even
if this produced any effects, its probably undesirable.

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

llvm-svn: 368752

4 years agoFactor architecture dependent code out of loop.cu
Jon Chesterfield [Tue, 13 Aug 2019 21:41:47 +0000 (21:41 +0000)]
Factor architecture dependent code out of loop.cu

Summary:
[libomptarget] Factor architecture dependent code out of loop.cu

Related to the patch series starting D64217. Added subscribers to said series as reviewers. This effort is smaller in scope.

This patch factors out just enough architecture dependent code from loop.cu to allow the same source to be used with amdgcn, given a different target_impl.h. Testing is that the same bitcode (modulo variable names) is generated for libomptarget before and after the refactor, for nvptx and the out of tree amdgcn.

Reviewers: jdoerfert, ABataev, bollu, jfb, tra, grokos, Hahnfeld, guansong, xtian, gregrodgers, ronlieb, hfinkel, gtbercea, guraypp, arpith-jacob

Reviewed By: jdoerfert, ABataev

Subscribers: dexonsmith, openmp-commits

Tags: #openmp

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

llvm-svn: 368751

4 years ago[WebAssembly] Make clang emit correct va_arg code for structs
Guanzhong Chen [Tue, 13 Aug 2019 21:41:11 +0000 (21:41 +0000)]
[WebAssembly] Make clang emit correct va_arg code for structs

Summary:
In the WebAssembly backend, when lowering variadic function calls, non-single
member aggregate type arguments are always passed by pointer.

However, when emitting va_arg code in clang, the arguments are instead read as
if they are passed directly. This results in the pointer being read as the
actual structure.

Fixes https://github.com/emscripten-core/emscripten/issues/9042.

Reviewers: tlively, sbc100, kripken, aheejin, dschuff

Reviewed By: dschuff

Subscribers: dschuff, jgravelle-google, sunfish, cfe-commits

Tags: #clang

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

llvm-svn: 368750

4 years ago[libc++] Mark two <chrono> tests as unsupported on AppleClang 11
Louis Dionne [Tue, 13 Aug 2019 21:34:49 +0000 (21:34 +0000)]
[libc++] Mark two <chrono> tests as unsupported on AppleClang 11

The operator""y and operator""d will eventually be supported by
AppleClang, but no released version supports them at the moment.

llvm-svn: 368749

4 years agoRemove the extra `;`.
Michael Liao [Tue, 13 Aug 2019 21:26:42 +0000 (21:26 +0000)]
Remove the extra `;`.

llvm-svn: 368748

4 years ago[GISel] Pass MachineRegisterInfo by const reference to matcher.
Mark Lacey [Tue, 13 Aug 2019 21:17:14 +0000 (21:17 +0000)]
[GISel] Pass MachineRegisterInfo by const reference to matcher.

Summary: NFC.

Reviewers: aditya_nandakumar, volkan

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368747

4 years ago[DWARF] Guess the path style
Jonas Devlieghere [Tue, 13 Aug 2019 21:00:27 +0000 (21:00 +0000)]
[DWARF] Guess the path style

Try to guess the FileSpec path style before defaulting to native.

llvm-svn: 368746

4 years ago[analyzer][NFC] Address inlines of D65484
Kristof Umann [Tue, 13 Aug 2019 20:42:48 +0000 (20:42 +0000)]
[analyzer][NFC] Address inlines of D65484

llvm-svn: 368745

4 years ago [AIX]Lowering global address for 32/64bit small/large code models
Xiangling Liao [Tue, 13 Aug 2019 20:29:01 +0000 (20:29 +0000)]
[AIX]Lowering global address for 32/64bit small/large code models

    This patch implements global address lowering for 32/64 bit with small/large code models.
    1.For 32bit large code model on AIX, there are newly added pseudo opcode LWZtocL & ADDIStocHA32, the support of which on MC layer will be
       provided by future patches.
    2.The default code model on AIX should be small code model.
    3.Since AIX does not have medium code model, "report_fatal_error" when users specify it.

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

llvm-svn: 368744

4 years ago[Refactor] Moving SourceExtraction header from lib to include
Shaurya Gupta [Tue, 13 Aug 2019 20:21:00 +0000 (20:21 +0000)]
[Refactor] Moving SourceExtraction header from lib to include

Summary:
- Moved the SourceExtraction header from lib to include so that it can be used in clangd.

Reviewers: arphaman

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

Tags: #clang

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

llvm-svn: 368743

4 years ago[DWARF} Use LLVM's debug line parser in LLDB.
Jonas Devlieghere [Tue, 13 Aug 2019 19:51:51 +0000 (19:51 +0000)]
[DWARF} Use LLVM's debug line parser in LLDB.

The line number table header was substantially revised in DWARF 5 and is
not fully supported by LLDB's current debug line implementation.

This patch replaces the LLDB debug line parser with its counterpart in
LLVM. This was possible because of the limited contact surface between
the code to parse the DWARF debug line section and the rest of LLDB.

We pay a small cost in terms of performance and memory usage. This is
something we plan to address in the near future.

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

llvm-svn: 368742

4 years ago[Symbol] Decouple clang from CompilerType
Alex Langford [Tue, 13 Aug 2019 19:40:36 +0000 (19:40 +0000)]
[Symbol] Decouple clang from CompilerType

Summary:
Ideally CompilerType would have no knowledge of clang or any individual
TypeSystem. Decoupling clang is relatively straightforward.

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

llvm-svn: 368741

4 years ago[ORC] Fix BuildingAJIT tutorial code broken by r368707.
Lang Hames [Tue, 13 Aug 2019 19:38:52 +0000 (19:38 +0000)]
[ORC] Fix BuildingAJIT tutorial code broken by r368707.

llvm-svn: 368740

4 years agoDon't use std::errc
Alexey Bataev [Tue, 13 Aug 2019 19:32:36 +0000 (19:32 +0000)]
Don't use std::errc

Summary:
As noted on Errc.h:

// * std::errc is just marked with is_error_condition_enum. This means that
//   common patters like AnErrorCode == errc::no_such_file_or_directory take
//   4 virtual calls instead of two comparisons.

And on some libstdc++ those virtual functions conclude that

------------------------
int main() {
  std::error_code foo = std::make_error_code(std::errc::no_such_file_or_directory);
  return foo == std::errc::no_such_file_or_directory;
}
-------------------------

should exit with 0.

Reviewers: thakis, rnk, jfb

Reviewed By: thakis

Subscribers: lebedev.ri, dexonsmith, xbolva00, cfe-commits, caomhin

Tags: #clang

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

llvm-svn: 368739

4 years agoRevert "Fix crash on switch conditions of non-integer types in templates"
Dmitri Gribenko [Tue, 13 Aug 2019 19:07:28 +0000 (19:07 +0000)]
Revert "Fix crash on switch conditions of non-integer types in templates"

This reverts commit r368706. It broke ClangTidy tests.

llvm-svn: 368738

4 years ago[analyzer][NFC] Refactoring BugReporter.cpp P5.: Compact mile long function invocatio...
Kristof Umann [Tue, 13 Aug 2019 19:01:33 +0000 (19:01 +0000)]
[analyzer][NFC] Refactoring BugReporter.cpp P5.: Compact mile long function invocations into objects

In D65379, I briefly described the construction of bug paths from an
ExplodedGraph. This patch is about refactoring the code processing the bug path
into a bug report.

A part of finding a valid bug report was running all visitors on the bug path,
so we already have a (possibly empty) set of diagnostics for each ExplodedNode
in it.
Then, for each diagnostic consumer, we construct non-visitor diagnostic pieces.

* We first construct the final diagnostic piece (the warning), then
* We start ascending the bug path from the error node's predecessor (since the
error node itself was used to construct the warning event). For each node
  * We check the location (whether its a CallEnter, CallExit) etc. We simultaneously
  keep track of where we are with the execution by pushing CallStack when we see a
  CallExit (keep in mind that everything is happening in reverse!), popping it
  when we find a CallEnter, compacting them into a single PathDiagnosticCallEvent.

void f() {
  bar();
}

void g() {
  f();
  error(); // warning
}

=== The bug path ===

(root) -> f's CallEnter -> bar() -> f's CallExit -> (error node)

=== Constructed report ===

  f's CallEnter -> bar() -> f's CallExit
           ^               /
            \             V
(root) --->  f's CallEvent --> (error node)

  * We also keep track of different PathPieces different location contexts
  * (CallEvent::path in the above example has f's LocationContext, while the
  CallEvent itself is in g's context) in a LocationContextMap object. Construct
  whatever piece, if any, is needed for the note.
  * If we need to generate edges (or arrows) do so. Make sure to also connect
  these pieces with the ones that visitors emitted.
  * Clean up the constructed PathDiagnostic by making arrows nicer, pruning
  function calls, etc.

So I complained about mile long function invocations with seemingly the same
parameters being passed around. This problem, as I see it, a natural candidate
for creating classes and tying them all together.

I tried very hard to make the implementation feel natural, like, rolling off the
tongue. I introduced 2 new classes: PathDiagnosticBuilder (I mean, I kept the
name but changed almost everything in it) contains every contextual information
(owns the bug path, the diagnostics constructed but the visitors, the BugReport
itself, etc) needed for constructing a PathDiagnostic object, and is pretty much
completely immutable. BugReportContruct is the object containing every
non-contextual information (the PathDiagnostic object we're constructing, the
current location in the bug path, the location context map and the call stack I
meantioned earlier), and is passed around all over the place as a single entity
instead of who knows how many parameters.

I tried to used constness, asserts, limiting visibility of fields to my
advantage to clean up the code big time and dramatically improve safety. Also,
whenever I found the code difficult to understand, I added comments and/or
examples.

Here's a complete list of changes and my design philosophy behind it:

* Instead of construcing a ReportInfo object (added by D65379) after finding a
valid bug report, simply return an optional PathDiagnosticBuilder object straight
away. Move findValidReport into the class as a static method. I find
GRBugReporter::generatePathDiagnostics a joy to look at now.
* Rename generatePathDiagnosticForConsumer to generate (maybe not needed, but
felt that way in the moment) and moved it to PathDiagnosticBuilder. If we don't
need to generate diagnostics, bail out straight away, like we always should have.
After that, construct a BugReportConstruct object, leaving the rest of the logic
untouched.
* Move all static methods that would use contextual information into
PathDiagnosticBuilder, reduce their parameter count drastically by simply
passing around a BugReportConstruct object.
* Glance at the code I removed: Could you tell what the original
PathDiagnosticBuilder::LC object was for? It took a gooood long while for me to
realize that nothing really. It is always equal with the LocationContext
associated with our current position in the bug path. Remove it completely.
* The original code contains the following expression quite a bit:
LCM[&PD.getActivePath()], so what does it mean? I said that we collect the
contexts associated with different PathPieces, but why would we ever modify that,
shouldn't it be set? Well, theoretically yes, but in the implementation, the
address of PathDiagnostic::getActivePath doesn't change if we move to an outer,
previously unexplored function. Add both descriptive method names and
explanations to BugReportConstruct to help on this.
* Add plenty of asserts, both for safety and as a poor man's documentation.

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

llvm-svn: 368737

4 years ago[AMDGPU] Fix to 'Fold readlane from copy of SGPR or imm'
Tim Renouf [Tue, 13 Aug 2019 18:57:55 +0000 (18:57 +0000)]
[AMDGPU] Fix to 'Fold readlane from copy of SGPR or imm'

That change (r363670) could leave a copy from vgpr to sgpr. Fixed.

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

Change-Id: I00c3fe6fda2e8e1e36f53195b881b1449c777ea4
llvm-svn: 368736

4 years ago[analyzer][NFC] Refactoring BugReporter.cpp P4.: If it can be const, make it const
Kristof Umann [Tue, 13 Aug 2019 18:48:08 +0000 (18:48 +0000)]
[analyzer][NFC] Refactoring BugReporter.cpp P4.: If it can be const, make it const

When I'm new to a file/codebase, I personally find C++'s strong static type
system to be a great aid. BugReporter.cpp is still painful to read however:
function calls are made with mile long parameter lists, seemingly all of them
taken with a non-const reference/pointer. This patch fixes nothing but this:
make a few things const, and hammer it until it compiles.

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

llvm-svn: 368735

4 years ago[NFC][clang] Adding argument based Phase list filtering to getComplicationPhases
Puyan Lotfi [Tue, 13 Aug 2019 18:42:03 +0000 (18:42 +0000)]
[NFC][clang] Adding argument based Phase list filtering to getComplicationPhases

This patch removes usage of FinalPhase from anywhere outside of the scope where
it is used to do argument handling.  It also adds argument based trimming of
the Phase list pulled out of the Types.def table.

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

llvm-svn: 368734

4 years ago[ARM] Add MVE beats vector cost model
David Green [Tue, 13 Aug 2019 18:12:08 +0000 (18:12 +0000)]
[ARM] Add MVE beats vector cost model

The MVE architecture has the idea of "beats", where a vector instruction can be
executed over several ticks of the architecture. This adds a similar system
into the Arm backend cost model, multiplying the cost of all vector
instructions by a factor.

This factor essentially becomes the expected difference between scalar code
and vector code, on average. MVE Vector instructions can also overlap so the a
true cost of them is often lower. But equally scalar instructions can in some
situations be dual issued, or have other optimisations such as unrolling or
make use of dsp instructions. The default is chosen as 2. This should not
prevent vectorisation is a most cases (as the vector instructions will still be
doing at least 4 times the work), but it will help prevent over vectorising in
cases where the benefits are less likely.

This adds things so far to the obvious places in ARMTargetTransformInfo, and
updates a few related costs like not treating float instructions as cost 2 just
because they are floats.

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

llvm-svn: 368733

4 years ago[clang] Refactor doc comments to Decls attribution
Jan Korous [Tue, 13 Aug 2019 18:11:44 +0000 (18:11 +0000)]
[clang] Refactor doc comments to Decls attribution

- Create ASTContext::attachCommentsToJustParsedDecls so we don't have to load external comments in Sema when trying to attach existing comments to just parsed Decls.
- Keep comments ordered and cache their decomposed location - faster SourceLoc-based searching.
- Optimize work with redeclarations.
- Keep one comment per redeclaration chain (represented by canonical Decl) instead of comment per redeclaration.
- For redeclaration chains with no comment attached keep just the last declaration in chain that had no comment instead of every comment-less redeclaration.

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

llvm-svn: 368732

4 years ago[llvm-profdata] Profile dump for compact binary format
Wenlei He [Tue, 13 Aug 2019 17:56:08 +0000 (17:56 +0000)]
[llvm-profdata] Profile dump for compact binary format

Summary: Fix "llvm-profdata show" so it can work with compact binary format profile. The change is to mark all functions "used" so SampleProfileReaderCompactBinary::read will read in all profiles available for dumping. The function names will be MD5 hash for compact binary format.

Reviewers: wmi, davidxl, danielcdh

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 368731

4 years ago[AutoUpgrader] Make ArcRuntime Autoupgrader more conservative
Steven Wu [Tue, 13 Aug 2019 17:52:21 +0000 (17:52 +0000)]
[AutoUpgrader] Make ArcRuntime Autoupgrader more conservative

Summary:
This is a tweak to r368311 and r368646 which auto upgrades the calls to
objc runtime functions to objc runtime intrinsics, in order to make sure
that the auto upgrader does not trigger with up-to-date bitcode.

It is possible for bitcode that is up-to-date to contain direct calls to
objc runtime function and those are not inserted by compiler as part of
ARC and they should not be upgraded. Now auto upgrader only triggers as
when the old style of ARC marker is used so it is guaranteed that it
won't trigger on update-to-date bitcode.

This also means it won't do this upgrade for bitcode from llvm-8 and
llvm-9, which preserves the behavior of those releases. Ideally they
should be upgraded as well but it is more important to make sure
AutoUpgrader will not trigger on up-to-date bitcode.

Reviewers: ahatanak, rjmccall, dexonsmith, pete

Reviewed By: dexonsmith

Subscribers: hiraditya, jkorous, llvm-commits

Tags: #llvm

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

llvm-svn: 368730

4 years ago[NFC] Fixed test
David Bolvansky [Tue, 13 Aug 2019 17:51:28 +0000 (17:51 +0000)]
[NFC] Fixed test

llvm-svn: 368729

4 years agoclang: Don't warn on unused momit-leaf-frame-pointer when frame pointers are off.
Nico Weber [Tue, 13 Aug 2019 17:37:09 +0000 (17:37 +0000)]
clang: Don't warn on unused momit-leaf-frame-pointer when frame pointers are off.

This fixes a regression from r365860: As that commit message
states, there are 3 valid states targeted by the combination of
-f(no-)omit-frame-pointer and -m(no-)omit-leaf-frame-pointer.

After r365860 it's impossible to get from state 10 (omit just
leaf frame pointers) to state 11 (omit all frame pointers)
in a single command line without getting a warning.

This change restores that functionality.

Fixes PR42966.

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

llvm-svn: 368728

4 years agoUse Register over unsigned in LateEHPrepare (NFC)
Heejin Ahn [Tue, 13 Aug 2019 17:35:44 +0000 (17:35 +0000)]
Use Register over unsigned in LateEHPrepare (NFC)

Summary:
While D65962 is pending for review, I landed D65475 that added one more
use of `unsigned`. Changed it to `Register`.

Reviewers: dsanders

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 368727

4 years ago[util] Allow callsigns when running git llvm revert
Jordan Rupprecht [Tue, 13 Aug 2019 17:19:53 +0000 (17:19 +0000)]
[util] Allow callsigns when running git llvm revert

llvm-svn: 368726

4 years ago[NFC] Updated tests after r368724
David Bolvansky [Tue, 13 Aug 2019 17:19:16 +0000 (17:19 +0000)]
[NFC] Updated tests after r368724

llvm-svn: 368725

4 years ago[SimplifyLibCalls] Add noalias from known callsites
David Bolvansky [Tue, 13 Aug 2019 17:18:46 +0000 (17:18 +0000)]
[SimplifyLibCalls] Add noalias from known callsites

Summary:
Should be fine for memcpy, strcpy, strncpy.

Reviewers: jdoerfert, efriedma

Reviewed By: jdoerfert

Subscribers: uenoku, llvm-commits

Tags: #llvm

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

llvm-svn: 368724

4 years ago[ValueTracking] Improve reverse assumption inference
Nikita Popov [Tue, 13 Aug 2019 17:15:42 +0000 (17:15 +0000)]
[ValueTracking] Improve reverse assumption inference

Use isGuaranteedToTransferExecutionToSuccessor() instead of
isSafeToSpeculativelyExecute() when seeing whether we can propagate
the information in an assume backwards in isValidAssumeForContext().
The latter is more general - it also allows arbitrary loads/stores -
and is also the condition we want: if our assume is guaranteed to
execute, its condition not holding would be UB.

Original patch by arielb1.

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

llvm-svn: 368723

4 years ago[NFC] Revisited/updated tests
David Bolvansky [Tue, 13 Aug 2019 17:07:02 +0000 (17:07 +0000)]
[NFC] Revisited/updated tests

llvm-svn: 368722

4 years agoReland r368691: "[AIX] Implement LR prolog/epilog save/restore"
Hubert Tong [Tue, 13 Aug 2019 17:05:53 +0000 (17:05 +0000)]
Reland r368691: "[AIX] Implement LR prolog/epilog save/restore"

Trying again with the code changes (and not just the new test).

Summary:
This patch fixes the offsets of fields in the stack frame linkage save
area for AIX.

Reviewers: sfertile, hubert.reinterpretcast, jasonliu, Xiangling_L, xingxue, ZarkoCA, daltenty

Reviewed By: hubert.reinterpretcast

Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

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

Patch by Chris Bowler!

llvm-svn: 368721

4 years ago[NFC][AIX] Use assert instead of llvm_unreachable
David Tenty [Tue, 13 Aug 2019 17:04:51 +0000 (17:04 +0000)]
[NFC][AIX] Use assert instead of llvm_unreachable

Addresses post-commit comments on https://reviews.llvm.org/D64825. Use
assert instead of llvm_unreachable to check if invalid csect types are being
generated. Use report_fatal_error on unimplemented XCOFF features.

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

llvm-svn: 368720

4 years ago[lld][WebAssembly] Allow linking of pic code into static binaries
Sam Clegg [Tue, 13 Aug 2019 17:02:02 +0000 (17:02 +0000)]
[lld][WebAssembly] Allow linking of pic code into static binaries

Summary: See https://github.com/emscripten-core/emscripten/issues/9013

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 368719

4 years ago[Dwarf] Complete the list of type tags.
Jonas Devlieghere [Tue, 13 Aug 2019 17:00:54 +0000 (17:00 +0000)]
[Dwarf] Complete the list of type tags.

An incorrect verification error revealed that the list of type tags was
incomplete. This patch adds the missing types by adding a tag kind to
the Dwarf.def file, which is used by the `isType` function.

A test was added for the original verification error.

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

llvm-svn: 368718

4 years ago[analyzer][NFC] Refactoring BugReporter.cpp P3.: std::shared_pointer<PathDiagnosticPi...
Kristof Umann [Tue, 13 Aug 2019 16:45:48 +0000 (16:45 +0000)]
[analyzer][NFC] Refactoring BugReporter.cpp P3.: std::shared_pointer<PathDiagnosticPiece> -> PathDiagnosticPieceRef

find clang/ -type f -exec sed -i 's/std::shared_ptr<PathDiagnosticPiece>/PathDiagnosticPieceRef/g' {} \;
git diff -U3 --no-color HEAD^ | clang-format-diff-6.0 -p1 -i

Just as C++ is meant to be refactored, right?

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

llvm-svn: 368717

4 years ago[X86] Add some vXi8 extract subvector cost model tests
Simon Pilgrim [Tue, 13 Aug 2019 16:44:40 +0000 (16:44 +0000)]
[X86] Add some vXi8 extract subvector cost model tests

We don't have full 512-bit test coverage yet - but there's enough to help test D65892

llvm-svn: 368716