Commit Graph

323062 Commits

Author SHA1 Message Date
Reid Kleckner c41b58fd40 Remove cmake checks for MSVC 1900 / VS 2013
Our minimum Visual C++ version is 19.10 from Visual Studio 2017.

llvm-svn: 367362
2019-07-30 22:49:11 +00:00
Jan Korous c32e10794d [clangd][NFC] Fix typo in comment
llvm-svn: 367361
2019-07-30 22:18:04 +00:00
Alex Langford 0e252e38ef [Symbol] Use llvm::Expected when getting TypeSystems
Summary:
This commit achieves the following:
- Functions used to return a `TypeSystem *` return an
  `llvm::Expected<TypeSystem *>` now. This means that the result of a call
  is always checked, forcing clients to move more carefully.
- `TypeSystemMap::GetTypeSystemForLanguage` will either return an Error or a
  non-null pointer to a TypeSystem.

Reviewers: JDevlieghere, davide, compnerd

Subscribers: jdoerfert, lldb-commits

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

llvm-svn: 367360
2019-07-30 22:12:34 +00:00
JF Bastien d56dc1d926 [NFC] Improve cmake diagnostic when checking atomics
llvm-svn: 367359
2019-07-30 22:08:38 +00:00
Alex Langford 0723173114 [SymbolFile] SymbolFileDWARF::ParseLineTable should lock its module
As of svn rL367298, SymbolFileDWARF locks the module in many cases where
it needs to parse some aspect of the DWARF symbol file.
SymbolFileDWARF::ParseLineTable needs to lock the module because
SymbolVendor::ParseLineTable no longer locks it.

llvm-svn: 367358
2019-07-30 21:22:17 +00:00
Craig Topper 8b58371fae [X86] Fix mistake in comment. NFC
The code is matching sext not zext.

llvm-svn: 367357
2019-07-30 21:00:24 +00:00
Roman Lebedev 1e4a094b37 [benchmark] Fix win32 link on case-sensitive fs
Summary: This fixes cross-builds with MinGW from case-sensitive file-systems (on Linux)

This is a cherry-pick from
https://github.com/google/benchmark/pull/840
8e48105d46

Original patch by: @jschueller (Julien Schueller) !

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

llvm-svn: 367356
2019-07-30 20:47:59 +00:00
Stanislav Mekhanoshin 9aff33bb95 [AMDGPU] Print register pressure for agpr and vgpr separately
Differential Revision: https://reviews.llvm.org/D65476

llvm-svn: 367355
2019-07-30 20:45:15 +00:00
Jan Korous 2ee6497e8f [clangd][NFC] Typo in comment
llvm-svn: 367354
2019-07-30 20:39:39 +00:00
Sam McCall 71d4544961 Revert "[NFC][clang] Refactor getCompilationPhases()+Types.def step 3."
This reverts commit d2254dbf21.
This (unintentionally?) changed behavior, disallowing e.g. -x objective-c++-header

llvm-svn: 367353
2019-07-30 20:38:11 +00:00
Alina Sbirlea 4bc625cae0 [MemorySSA] Extend allowed behavior for simplified instructions.
Summary:
LoopRotate may simplify instructions, leading to the new instructions not having memory accesses created for them.
Allow this behavior, by allowing the new access to be null when the template is null, and looking upwards for the proper defined access when dealing with simplified instructions.

Reviewers: george.burgess.iv

Subscribers: jlebar, Prazek, llvm-commits

Tags: #llvm

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

llvm-svn: 367352
2019-07-30 20:10:33 +00:00
Rainer Orth bb669c25ba [Driver] Support -fsanitize=function on Solaris/x86
UBSan-Standalone-x86_64 :: TestCases/TypeCheck/Function/function.cpp currently
FAILs on Solaris/x86_64:

  clang-9: error: unsupported option '-fsanitize=function' for target 'x86_64-pc-solaris2.11'

AFAICS, there's nothing more to do then enable that sanitizer in the driver (for x86 only),
which is what this patch does, together with updating another testcase.

Tested on x86_64-pc-solaris2.11.

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

llvm-svn: 367351
2019-07-30 20:04:53 +00:00
JF Bastien 42c9f3c911 [NFC] simplify Darwin environment handling
The previous code detected conflicts through copy-pasta, this versions
uses a 'loop'.

llvm-svn: 367350
2019-07-30 20:01:46 +00:00
Michael Liao f3983cc14a [NVPTX] Fix PR41651
Summary:
- Use the passed `DL` directly as retrieving data layout from CS by
  checking the called function is not reliable. Under indirect function
  call, there is no called function.

Subscribers: jholewinski, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367349
2019-07-30 19:52:01 +00:00
Jonas Devlieghere 3a56174d85 [dsymutil] Pass LinkOptions by value instead of const ref.
When looping over the difference architectures in a fat binary, we
modify the link options before dispatching the link step to a different
thread. Passing the options by cont reference is not thread safe, as we
might modify its fields before the whole sturct is copied over.

Given that the link options are already stored in the DwarfLinker, we
can easily fix this by passing a copy of the link options instead of a
reference, which would just get copied later on.

llvm-svn: 367348
2019-07-30 19:34:26 +00:00
Stanislav Mekhanoshin 450afcea39 [AMDGPU] Reserve all AGPRs on targets which do not have them
Differential Revision: https://reviews.llvm.org/D65471

llvm-svn: 367347
2019-07-30 19:29:33 +00:00
Erik Pilkington be19c48f6d [Parser] Lambda capture lists can start with '*'
Fixes llvm.org/PR42778

llvm-svn: 367346
2019-07-30 19:21:20 +00:00
Puyan Lotfi d2254dbf21 [NFC][clang] Refactor getCompilationPhases()+Types.def step 3.
Dropping the 'u' entry and the entire Flags table from Types.def.
Now it'll be a bit easier to tablegenify this.

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

llvm-svn: 367345
2019-07-30 19:03:17 +00:00
Austin Kerbow c99f62e313 [AMDGPU/GlobalISel] Add llvm.amdgcn.fdiv.fast legalization.
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: volkan, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

llvm-svn: 367344
2019-07-30 18:49:16 +00:00
Jonas Hahnfeld 52b87ac32f [OpenMP] Rename last file to cpp and remove LIBOMP_CFLAGS
All other files are already C++ and the build system has always
passed '-x c++' for C files, effectively compiling them as C++.

To stay warning free we need one fix in ittnotify_static.{c,cpp}:
The variable dll_path can be written to, so it must not be const.
GCC complained with -Wcast-qual and I think it's right.

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

llvm-svn: 367343
2019-07-30 18:37:28 +00:00
Hideto Ueno 6e2be4eab3 [FunctionAttrs] Annotate "willreturn" for AssumeLikeInst
Summary:
In D37215, AssumeLikeInstruction are regarded as `willreturn`. In this patch, annotation is added to those which don't have `willreturn` now(`sideeffect, object_size, experimental_widenable_condition`).

Reviewers: jdoerfert, nikic, sstefan1

Reviewed By: nikic

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367342
2019-07-30 18:35:29 +00:00
Nico Weber 3b0769b7b4 gn build: Update comment I failed to update in r367340 / D65462
llvm-svn: 367341
2019-07-30 18:19:13 +00:00
Nico Weber 2859bbb3e2 gn build: Fix check-clang-tools after r362702.
r362702 added a test that requires clang-tidy to be linked
into libclang, so add that to the gn build.

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

llvm-svn: 367340
2019-07-30 18:16:55 +00:00
Thomas Lively e0a9dce543 [WebAssembly] Do not emit tail calls with return type mismatch
Summary:
return_call and return_call_indirect are only valid if the return
types of the callee and caller match. We were previously not enforcing
that, which was producing invalid modules.

Reviewers: aheejin

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

Tags: #llvm

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

llvm-svn: 367339
2019-07-30 18:08:39 +00:00
Jonas Devlieghere 130ec06843 [Reproducers] Fix incorrect help message
The help message mentioned the `log` command (probably because I copied
it from there originally).

llvm-svn: 367338
2019-07-30 18:06:38 +00:00
Reid Kleckner c0e275df3d Remove cache for macro arg stringization
Summary:
The cache recorded the wrong expansion location for all but the first
stringization. It seems uncommon to stringize the same macro argument
multiple times, so this cache doesn't seem that important.

Fixes PR39942

Reviewers: vsk, rsmith

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 367337
2019-07-30 17:58:22 +00:00
JF Bastien 7cb03c0dc4 [NFC] remove obsolete comment
LLVM_ALIGNAS was removed from this class in http://llvm.org/r338099 but the comment was left there. The class is still sommewhat relevant despite the comment, let's keep it there with its one use.

llvm-svn: 367336
2019-07-30 17:21:30 +00:00
Florian Hahn d0b6f42936 Revert [GVN] Preserve loop related analysis/canonical forms.
This reverts r367332 (git commit 2d7227ec3a)

llvm-svn: 367335
2019-07-30 17:04:58 +00:00
Francis Visoiu Mistrih d9402ee03f [Docs] Fix sphinx warning in OCamlLangImpl5.rst
The path to the image was outdated.

http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/33865/steps/docs-llvm-html/logs/stdio

llvm/docs/tutorial/OCamlLangImpl5.rst:173: WARNING: image file not readable: tutorial/LangImpl05-cfg.png

llvm-svn: 367334
2019-07-30 16:56:45 +00:00
Tom Roeder 61493df7c6 [clang-tidy] Fix the documentation for linuxkernel-must-use-errs.
Summary:
This changes ReleaseNotes.txt to have the first sentence of the full
documentation from linuxkernel-must-use-errs.rst.

This addresses a comment from the review of rL367071 in
https://reviews.llvm.org/D59963.

Reviewers: Eugene.Zelenko

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 367333
2019-07-30 16:49:28 +00:00
Florian Hahn 2d7227ec3a [GVN] Preserve loop related analysis/canonical forms.
LoopInfo can be easily preserved by passing it to the functions that
modify the CFG (SplitCriticalEdge and MergeBlockIntoPredecessor.
SplitCriticalEdge also preserves LoopSimplify and LCSSA form when when passing in
LoopInfo. The test case shows that we preserve LoopSimplify and
LoopInfo. Adding addPreservedID(LCSSAID) did not preserve LCSSA for some
reason.

Also I am not sure if it is possible to preserve those in the new pass
manager, as they aren't analysis passes.

Reviewers: reames, hfinkel, davide, jdoerfert

Reviewed By: jdoerfert

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

llvm-svn: 367332
2019-07-30 16:43:39 +00:00
Jonas Devlieghere d3ae0bc310 [dotest] Remove multiprocessing
Now that the Xcode project is removed, I want to focus on dotest as a
test framework, and remove its driver capabilities for which we already
rely on llvm's lit. Removing multiprocessing is the first step in that
direction.

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

llvm-svn: 367331
2019-07-30 16:42:47 +00:00
JF Bastien 8990516869 [NFC] Remove uses of LLVM_ALIGNAS
It's not useful anymore: we mandate C++11, and already use alignas in a bunch of places.

llvm-svn: 367330
2019-07-30 16:31:06 +00:00
Michael Liao 0d6615cc19 [Support] Workaround a GCC 4.8 bug on constant expression evaluation.
Summary:
- The following stripped code trigger a gcc-4.8 bug. To work that
  around, move the alignment evaluation into template parameter.

```
// https://godbolt.org/z/58p5_X
//

enum { aligned = 0, unaligned = 1 };

template <typename T, int alignment> struct PickAlignment {
  enum { value = alignment == 0 ? alignof(T) : alignment };
};

template <typename ValueType, std::size_t Alignment> struct packed {
private:
  struct {
    alignas(
        PickAlignment<ValueType, Alignment>::value) char buffer[sizeof(int)];
  } Value;
};

using ule16_t = packed<uint16_t, unaligned>;

ule16_t x;
```

- Also, replace `alignas` with `LLVMALIGN_AS` to improve the compiler
  compatibility.

Reviewers: jfb

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 367329
2019-07-30 16:11:48 +00:00
Francis Visoiu Mistrih 5ed3d146f8 [Remarks] Add two serialization modes for remarks: separate and standalone
The default mode is separate, where the metadata is serialized
separately from the remarks.

Another mode is the standalone mode, where the metadata is serialized
before the remarks, on the same stream.

llvm-svn: 367328
2019-07-30 16:01:40 +00:00
Kit Barton de0b633999 [LoopFusion] Extend use of OptimizationRemarkEmitter
Summary:
This patch extends the use of the OptimizationRemarkEmitter to provide
information about loops that are not fused, and loops that are not eligible for
fusion. In particular, it uses the OptimizationRemarkAnalysis to identify loops
that are not eligible for fusion and the OptimizationRemarkMissed to identify
loops that cannot be fused.

It also reuses the statistics to provide the messages used in the
OptimizationRemarks. This provides common message strings between the
optimization remarks and the statistics.

I would like feedback on this approach, in general. If people are OK with this,
I will flesh out additional remarks in subsequent commits.

Subscribers: hiraditya, jsji, llvm-commits

Tags: #llvm

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

llvm-svn: 367327
2019-07-30 15:58:43 +00:00
Matt Arsenault 57ef94fb06 AMDGPU: Avoid emitting "true" predicates
Empty condition strings are considerde always true. This removes a lot
of clutter from the generated matcher tables.

This shrinks the source size of AMDGPUGenDAGISel.inc from 7.3M to
6.1M.

llvm-svn: 367326
2019-07-30 15:56:43 +00:00
Roman Lebedev 5e0adce40f [DivRemPairs] Add srem-of-srem tests (PR42823, D65298, D65451)
The @srem_of_srem_expanded case exposed a RAUW pitfall in D65298.
Right now these don't appear to fail verification,
so it should be safe to precommit them.

https://reviews.llvm.org/D65298
https://bugs.llvm.org/show_bug.cgi?id=42823
https://reviews.llvm.org/D65451

llvm-svn: 367325
2019-07-30 15:46:03 +00:00
Sean Fertile 39f3503814 Address post commit review comments on revision 366727.
Addresses number of comment made on D64652 after commiting:

- Reorders function decls in the TargetLoweringObjectFileXCOFF class.
- Fix comment in MCSectionXCOFF to include description of external reference
  csects.
- Convert several llvm_unreachables to report_fatal_error
- Convert several dyn_casts to casts as they are expected not to fail.
- Avoid copying DataLayout object.

llvm-svn: 367324
2019-07-30 15:37:01 +00:00
David Major 027bb52790 [COFF][ARM64] Reorder handling of aarch64 MSVC builtins
In `CodeGenFunction::EmitAArch64BuiltinExpr()`, bulk move all of the aarch64 MSVC-builtin cases to an earlier point in the function (the `// Handle non-overloaded intrinsics first` switch block) in order to avoid an unreachable in `GetNeonType()`. The NEON type-overloading logic is not appropriate for the Windows builtins.

Fixes https://llvm.org/pr42775

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

llvm-svn: 367323
2019-07-30 15:32:49 +00:00
Roman Lebedev be612ea471 [InstCombine] Fold "x ?% y ==/!= 0" to "x & (y-1) ==/!= 0" iff y is power-of-two
Summary:
I have stumbled into this by accident while preparing to extend backend `x s% C ==/!= 0` handling.

While we did happen to handle this fold in most of the cases,
the folding is indirect - we fold `x u% y` to `x & (y-1)` (iff `y` is power-of-two),
or first turn `x s% -y` to `x u% y`; that does handle most of the cases.
But we can't turn `x s% INT_MIN` to `x u% -INT_MIN`,
and thus we end up being stuck with `(x s% INT_MIN) == 0`.

There is no such restriction for the more general fold:
https://rise4fun.com/Alive/IIeS

To be noted, the fold does not enforce that `y` is a constant,
so it may indeed increase instruction count.
This is consistent with what `x u% y`->`x & (y-1)` already does.
I think it makes sense, it's at most one (simple) extra instruction,
while `rem`ainder is really much more un-simple (and likely **very** costly).

Reviewers: spatel, RKSimon, nikic, xbolva00, craig.topper

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 367322
2019-07-30 15:28:22 +00:00
Mehdi Amini c960c0a491 Ask confirmation when `git llvm push` will push multiple commits
This can reduce unexpectedly pushing more than expected by the user.

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

llvm-svn: 367321
2019-07-30 15:25:14 +00:00
Mehdi Amini 7492b1ea07 Fix `git llvm` script when no arguments are supplied on Python 3
Instead of displaying a help message, it was issuing an error message:

  AttributeError: 'Namespace' object has no attribute 'func'

https://bugs.python.org/issue16308 has more information on the bug.

llvm-svn: 367320
2019-07-30 15:25:11 +00:00
Eric Fiselier 54bb5413e6 add more information to benchmark test failures
llvm-svn: 367319
2019-07-30 15:11:41 +00:00
Simon Pilgrim b989bc47c0 [X86] SimplifyDemandedVectorEltsForTargetNode should be calling resolveTargetShuffleInputs not getTargetShuffleMask
Add TODO comment.

llvm-svn: 367318
2019-07-30 15:06:09 +00:00
Nico Weber 9aae539d4c libcxx: Define __STDCPP_THREADS__ to 1, not to __cplusplus.
[cpp.predefined]p2:

   __STDCPP_THREADS__
    Defined, and has the value integer literal 1, if and only if a program
    can have more than one thread of execution .

Also define it only if it's not defined already, since it's supposed
to be defined by the compiler.

Also move it from thread to __config (which requires setting it only
if _LIBCPP_HAS_NO_THREADS is not defined).

Part of PR33230. The intent is to eventually make the compiler define
this instead.

llvm-svn: 367316
2019-07-30 14:32:47 +00:00
Hans Wennborg 9ad716ed39 gn build: Use rebase_path on filename args to libcxx/utils/gen_link_script.py
$ ninja -j800
  [1/5] ACTION //libcxx/src:cxx_linker_script(//llvm/utils/gn/build/toolchain:stage2_unix)
  FAILED: lib/libc++.so
  python ../libcxx/utils/gen_link_script.py --input //build.gn/lib/libc++.so.0 --output //build.gn/lib/libc++.so c++abi unwind
  GENERATING SCRIPT: 'INPUT(libc++.so.0 -lc++abi -lunwind)' as file //build.gn/lib/libc++.so
  Traceback (most recent call last):
    File "../libcxx/utils/gen_link_script.py", line 57, in <module>
      sys.exit(main())
    File "../libcxx/utils/gen_link_script.py", line 50, in main
      with open(args.output, 'w') as f:
  IOError: [Errno 2] No such file or directory: '//build.gn/lib/libc++.so'
  ninja: build stopped: subcommand failed.

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

llvm-svn: 367314
2019-07-30 14:17:58 +00:00
Haojian Wu debf4817f4 [clangd] Fix a regression in rL366996.
Summary: That patch made the tweak always annotate the whole file by accident.

Reviewers: jvikstrom

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 367313
2019-07-30 14:17:45 +00:00
Aaron Ballman d5e206ee73 Add typedef declaration information to the JSON AST dump.
When dumping a desugared QualType and the type is a type alias, also print out the id for the type alias declaration.

llvm-svn: 367312
2019-07-30 13:42:19 +00:00
Sam Elliott 1d8b3788e4 [RISCV] Attempt to make rv{32,64}i-aliases-invalid.s less flaky
These tests have been disabled on Linux and Windows due to failing
there. I think that could be down to a race condition between stdout
and stderr, so I have disabled output to stdout.

For the moment, only re-enable on linux, because I don't have a windows
machine to test on.

llvm-svn: 367311
2019-07-30 13:40:51 +00:00