Commit Graph

302909 Commits

Author SHA1 Message Date
Bill Wendling ec54d6121c Ignore implicit things like ConstantExpr.
llvm-svn: 346461
2018-11-09 01:32:30 +00:00
Jonas Devlieghere 86ef28f1a2 [not] Improve error reporting consistency.
Makes `not` use WithColor from Support so it prints 'error' in color
when applicable.

llvm-svn: 346460
2018-11-09 01:17:22 +00:00
Zachary Turner eb98774299 Fix a test whose output changed.
A previous commit fixed an issue with our AST generation where
we were outputting enum decls incorrectly.  But we forgot to
update the test output.  This patch updates the test output
accordingly.

llvm-svn: 346459
2018-11-09 01:09:10 +00:00
Bill Wendling 9f20f3e537 Use correct parameter name in comment.
llvm-svn: 346458
2018-11-09 01:04:05 +00:00
Jonas Devlieghere 9560f353ed [FileSystem] Make use of FS in TildeExpressionResolver
In order to call real_path from the TildeExpressionResolver we need
access to the FileSystem. Since the resolver lives under utility we have
to pass in the FS.

llvm-svn: 346457
2018-11-09 00:50:50 +00:00
Adrian Prantl e884ccb1cb Fix CMake build when building with -fmodules-local-submodule-visibility.
llvm-svn: 346456
2018-11-09 00:49:18 +00:00
Bill Wendling 8003edc9aa Compound literals, enums, et al require const expr
Summary:
Compound literals,  enums, file-scoped arrays, etc. require their
initializers and size specifiers to be constant. Wrap the initializer
expressions in a ConstantExpr so that we can easily check for this later
on.

Reviewers: rsmith, shafik

Reviewed By: rsmith

Subscribers: cfe-commits, jyknight, nickdesaulniers

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

llvm-svn: 346455
2018-11-09 00:41:36 +00:00
Adrian Prantl 009cc9b7ca Fix a use-after-free introduced by r344915.
r344915 added a call to ApplyDebugLocation to the sanitizer check
function emitter. Some of the sanitizers are emitted in the function
epilogue though and the LexicalScopeStack is emptied out before. By
detecting this situation and early-exiting from ApplyDebugLocation the
fallback location is used, which is equivalent to the return location.

rdar://problem/45859802

llvm-svn: 346454
2018-11-09 00:26:15 +00:00
Jonas Devlieghere f5b6d11cf2 [VFS] Add "expand tilde" argument to getRealPath.
Add an optional argument to expand tildes in the path to mirror llvm's
implementation of the corresponding function.

llvm-svn: 346453
2018-11-09 00:26:10 +00:00
Evgeniy Stepanov 4680386c34 [hwasan] Remove dead code.
llvm-svn: 346452
2018-11-09 00:03:39 +00:00
Eric Fiselier b50daf7a21 Attempt to enable -Wconversion
llvm-svn: 346451
2018-11-08 23:57:32 +00:00
Petr Hosek 1f597e6e6b [llvm-rc] Support absolute filenames in manifests
CMake generate manifests that contain absolute filenames and these
currently result in assertion error. This change ensures that we
handle these correctly.

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

llvm-svn: 346450
2018-11-08 23:45:00 +00:00
Jonas Devlieghere 7010ef34d5 Update FileSpec constructor signature
llvm-svn: 346449
2018-11-08 23:21:00 +00:00
Philip Reames 8c7b78767a [docs][statepoint] Document explicitly provided stack slots
Functionality for this was added a while ago, though never documented or extensively tested.  Document it with an explicit warning.

llvm-svn: 346448
2018-11-08 23:20:40 +00:00
Philip Reames e777f013ac [docs][statepoints] add a section spelling out simplifications for non-relocating GCs
llvm-svn: 346447
2018-11-08 23:07:04 +00:00
Philip Reames 78b46457fb [docs] Add some subsections to make it possible to find portions of the statepoint overview
llvm-svn: 346446
2018-11-08 22:56:41 +00:00
Heejin Ahn 0c68a875fa [WebAssembly] Fix LowerEmscriptenEHSjLj when there's only longjmp
Summary:
The pass incorrectly assumed if there's a longjmp declaration in the
module, there is also a setjmp function declaration. Fixed it, and now
the pass only converts longjmp and does not do any other transformation
when there's no setjmp declaration in the module.

Fixes PR39562.

Reviewers: jgravelle-google, sbc100

Subscribers: dschuff, sunfish, llvm-commits

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

llvm-svn: 346445
2018-11-08 22:56:26 +00:00
Davide Italiano ca591dea10 Revert "Fix bug in PE/COFF plugin and ValueObjectVariable."
It breaks some tests on MacOS.

llvm-svn: 346444
2018-11-08 22:47:40 +00:00
Jason Molenda 0585921b7f Change $CURRENT_ARCH settings in xcode project file to hardcoded
"x86_64" - used for finding the llvm build directory.  Newer
Xcodes do not define CURRENT_ARCH.

llvm-svn: 346443
2018-11-08 22:41:19 +00:00
Jorge Gorbe Moya a6e6c18ade [lldb] Silence unhandled enums warning.
The warning was introduced by r346392, which introduces new builtin
types (to support cl_intel_device_side_avc_motion_estimation OpenCL
extension).

Note that this patch only inserts empty cases to silence the warning and
unblock our integrate, does not aim to add support for the new types in
lldb.

llvm-svn: 346441
2018-11-08 22:04:58 +00:00
Eli Friedman ab296670e1 [ARM64] [Windows] Improve error reporting for unsupported SEH unwind.
Use report_fatal_error instead of crashing or miscompiling. (It's
currently easier than it should be to hit this case because we don't
reuse codes across epilogs.)

llvm-svn: 346440
2018-11-08 21:20:52 +00:00
David Blaikie 436f7b6d8a [Frontend/Modules] Show diagnostics on prebuilt module configuration mismatch too
The current version only emits  the below error for a module (attempted to be loaded) from the `prebuilt-module-path`:

```
error: module file blabla.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```

With this change, if the prebuilt module is used, we allow the proper diagnostic behind the configuration mismatch to be shown.

```
error: POSIX thread support was disabled in PCH file but is currently enabled
error: module file blabla.pcm cannot be loaded due to a configuration mismatch with the current compilation [-Wmodule-file-config-mismatch]
```

(A few lines later an error is emitted anyways, so there is no reason not to complain for configuration mismatches if a config mismatch is found and kills the build.)

Reviewed By: dblaikie

Tags: #clang

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

llvm-svn: 346439
2018-11-08 20:47:30 +00:00
Florian Hahn a684a99441 [LoopInterchange] Support reductions across inner and outer loop.
This patch adds logic to detect reductions across the inner and outer
loop by following the incoming values of PHI nodes in the outer loop. If
the incoming values take part in a reduction in the inner loop or come
from outside the outer loop, we found a reduction spanning across inner
and outer loop.

With this change, ~10% more loops are interchanged in the LLVM
test-suite + SPEC2006.

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

Reviewers: mcrosier, efriedma, karthikthecool, davide, hfinkel, dmgreen

Reviewed By: efriedma

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

llvm-svn: 346438
2018-11-08 20:44:19 +00:00
Craig Topper 8cca8bd4aa [SelectionDAG] Assert on the width of DemandedElts argument to computeKnownBits for all vector typed operations not just build_vector.
Fix AArch64 unit test that fails with the assertion added.

llvm-svn: 346437
2018-11-08 20:29:17 +00:00
Pirama Arumuga Nainar e61652a384 [LTO] Drop non-prevailing definitions only if linkage is not local or appending
Summary:
This fixes PR 37422

In ELF, non-weak symbols can also be non-prevailing.  In this particular
PR, the __llvm_profile_* symbols are non-prevailing but weren't getting
dropped - causing multiply-defined errors with lld.

Also add a test, strong_non_prevailing.ll, to ensure that multiple
copies of a strong symbol are dropped.

To fix the test regressions exposed by this fix,
- do not mark prevailing copies for symbols with 'appending' linkage.
There's no one prevailing copy for such symbols.
- fix the prevailing version in dead-strip-fulllto.ll
- explicitly pass exported symbols to llvm-lto in fumcimport.ll and
funcimport_var.ll

Reviewers: tejohnson, pcc

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith,
dang, srhines, llvm-commits

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

llvm-svn: 346436
2018-11-08 20:10:07 +00:00
Jorge Gorbe Moya d17315d898 [lldb] Fix initialization order warnings.
Moved the declaration of m_kind below the declaration of cvclass,
cvunion and cvenum. This order is necessary because in one of the
constructors the initialization of m_kind depends on the value of
cvclass.

third_party/llvm/llvm/tools/lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp:50:7: error: field 'cvclass' will be initialized after field 'm_kind' [-Werror,-Wreorder]
    : cvclass(std::move(c)),
      ^
third_party/llvm/llvm/tools/lldb/source/Plugins/SymbolFile/NativePDB/PdbUtil.cpp:51:14: error: field 'cvclass' is uninitialized when used here [-Werror,-Wuninitialized]
      m_kind(cvclass.Kind == TypeRecordKind::Struct ? Struct : Class) {}

llvm-svn: 346435
2018-11-08 19:57:59 +00:00
Simon Pilgrim 0b01062dba [X86] Regenerate loaduse test
llvm-svn: 346434
2018-11-08 19:42:11 +00:00
Sanjay Patel b5535dc7b3 [x86] use shuffles for scalar insertion into high elements of a constant vector
As discussed in D54073, we have a potential regression from more aggressive vector narrowing here, so let's try to avoid that by changing build-vector lowering slightly.

Insert-vector-element lowering always does this since there's no "pinsr" for ymm/zmm:

// If the vector is wider than 128 bits, extract the 128-bit subvector, insert
// into that, and then insert the subvector back into the result.

...but we can sometimes do better for insert-into-constant-vector by using shuffle lowering.

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

llvm-svn: 346433
2018-11-08 19:16:27 +00:00
Nirav Dave 6ce9f72f76 [DAGCombine] Improve alias analysis for chain of independent stores.
FindBetterNeighborChains simulateanously improves the chain
dependencies of a chain of related stores avoiding the generation of
extra token factors. For chains longer than the GatherAllAliasDepths,
stores further down in the chain will necessarily fail, a potentially
significant waste and preventing otherwise trivial parallelization.

This patch directly parallelize the chains of stores before improving
each store. This generally improves DAG-level parallelism.

Reviewers: courbet, spatel, RKSimon, bogner, efriedma, craig.topper, rnk

Subscribers: sdardis, javed.absar, hiraditya, jrtc27, atanasyan, llvm-commits

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

llvm-svn: 346432
2018-11-08 19:14:20 +00:00
Reid Kleckner f3dc9649ce Fix -Wextra-qualification warning
llvm-svn: 346431
2018-11-08 18:53:56 +00:00
Zachary Turner 91dbd52890 Fix bug in PE/COFF plugin and ValueObjectVariable.
There are two bugs here.  The first is that MSVC and clang-cl
emit their bss section under the name '.data' instead of '.bss'
but with the size and file offset set to 0.  ObjectFilePECOFF
didn't handle this, and would only recognize a section as bss
if it was actually called '.bss'.  The effect of this is that
if we tried to print the value of a variable that lived in BSS
we would fail.

The second bug is that ValueObjectVariable was only returning
the forward type, which is insufficient to print the value of an
enum.  So we bump this up to the layout type.

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

llvm-svn: 346430
2018-11-08 18:50:31 +00:00
Zachary Turner 056e4ab497 [NativePDB] Higher fidelity reconstruction of AST from Debug Info.
In order to accurately put a type into the correct location in the AST
we construct from debug info, we need to be able to determine what
DeclContext (namespace, global, nested class, etc) that it goes into.
PDB doesn't contain this mapping.  It does, however, contain the reverse
mapping.  That is, for a given class type T, you can determine all
classes Q1, Q2, ..., Qn that are nested inside of T.  We need to know,
for a given class type Q, what type T is it nested inside of.

This patch builds this map as a pre-processing step when we first
load the PDB by scanning every type.  Initial tests show that while
this can be slow in debug builds of LLDB, it is quite fast in release
builds (less than 2 seconds for a ~1GB PDB, and it only needs to happen
once).

Furthermore, having this pre-processing step in place allows us to
repurpose it for building up other kinds of indexing to it down the
line.  For the time being, this gives us very accurate reconstruction
of the DeclContext hierarchy.

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

llvm-svn: 346429
2018-11-08 18:50:11 +00:00
Shafik Yaghmour 8c5ec1ff46 Refactor ClangASTContext::AddEnumerationValueToEnumerationType() to remove redundant parameter which can be calculated from other parameter.
rdar://problem/43822994

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

llvm-svn: 346428
2018-11-08 18:42:00 +00:00
Reid Kleckner 7a44fe956a [COFF] Improve relocation against discarded section error
Summary:
Reuse the "referenced by" note diagnostic code that we already use for
undefined symbols. In my case, it turned this:
  lld-link: error: relocation against symbol in discarded section: .text
  lld-link: error: relocation against symbol in discarded section: .text
  ...

Into this:
  lld-link: error: relocation against symbol in discarded section: .text
  >>> referenced by libANGLE.lib(CompilerGL.obj):(.SCOVP$M)
  >>> referenced by libANGLE.lib(CompilerGL.obj):(.SCOVP$M)
  ...

  lld-link: error: relocation against symbol in discarded section: .text
  >>> referenced by obj/third_party/angle/libGLESv2/entry_points_egl_ext.obj:(.SCOVP$M)
  >>> referenced by obj/third_party/angle/libGLESv2/entry_points_egl_ext.obj:(.SCOVP$M)
  ...

I think the new output is more useful.

Reviewers: ruiu, pcc

Subscribers: llvm-commits

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

llvm-svn: 346427
2018-11-08 18:38:17 +00:00
Sanjay Patel c4f719feb0 [x86] add RUNs for AVX1; NFC
Differences in splat-ability might be reason to differentiate some cases.

llvm-svn: 346426
2018-11-08 18:18:20 +00:00
Roman Lebedev 3817292069 [NFC][BdVer2] Load and store throughput tests: also check sched stats (PR39465)
As noted by Andrea Di Biagio in https://bugs.llvm.org/show_bug.cgi?id=39465
both the loads and stores occupy both the store and load queues.
This is clearly wrong.

llvm-svn: 346425
2018-11-08 18:15:58 +00:00
Matt Davis 9e719705d0 [llvm-mca] Partially revert r346417.
Restored the llvm:: namespace qualifier on make_unique.
This removes the ambiguity with make_unique.  

llvm-svn: 346424
2018-11-08 18:08:43 +00:00
Nicolai Haehnle 6979b70427 Add test case for the regression caused by r344696
(That change has since been reverted.)

Reduced from https://bugs.freedesktop.org/show_bug.cgi?id=108611

llvm-svn: 346423
2018-11-08 18:01:38 +00:00
Tom Stellard 28d662164d InstCombine: Avoid introducing poison values when lowering llvm.amdgcn.[us]bfe
Summary:
When the 3rd argument to these intrinsics is zero, lowering them
to shift instructions produces poison values, since we end up with
shift amounts equal to the number of bits in the shifted value.  This
means we can only lower these intrinsics if we can prove that the
3rd argument is not zero.

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: bnieuwenhuizen, jvesely, wdng, nhaehnle, llvm-commits

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

llvm-svn: 346422
2018-11-08 17:57:57 +00:00
Vedant Kumar d6699423f1 [CodeExtractor] Mark functions noreturn when applicable
This eliminates the outlining penalty for llvm.trap/unreachable, because
callers no longer have to emit cleanup/ret instructions after calling an
outlined `noreturn` function.

rdar://45523626

llvm-svn: 346421
2018-11-08 17:57:09 +00:00
Dan Liew 7383b4fba4 Introduce `sanitizer_malloc_introspect_t` for Darwin which is a sub-class of Darwin's `malloc_introspection_t` and use it when setting up the malloc zone.
Summary:
Currently `sanitizer_malloc_introspection_t` just adds a version field
which is used to version the allocator ABI. The current allocator ABI
version is returned by the new `GetMallocZoneAllocatorEnumerationVersion()` function.

The motivation behind this change is to allow external processes to
determine the allocator ABI of a sanitized process.

rdar://problem/45284065

Reviewers: kubamracek, george.karpenkov, vitalybuka

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 346420
2018-11-08 17:50:34 +00:00
Andrea Di Biagio d66f4e472a [llvm-mca] PR39261: Rename FetchStage to EntryStage.
This fixes PR39261.

FetchStage is a misnomer. It causes confusion with the frontend fetch stage,
which we don't currently simulate.  I decided to rename it into EntryStage
mainly because this is meant to be a "source" stage for all pipelines.

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

llvm-svn: 346419
2018-11-08 17:49:30 +00:00
Sam McCall 3c1f4903b7 [clang-tidy] Untangle layering in ClangTidyDiagnosticConsumer somewhat. NFC
Summary:
Clang's hierarchy is CompilerInstance -> DiagnosticsEngine -> DiagnosticConsumer.
(Ownership is optional/shared, but this structure is fairly clear).

Currently ClangTidyDiagnosticConsumer *owns* the DiagnosticsEngine:
 - this inverts the hierarchy, which is confusing
 - this means ClangTidyDiagnosticConsumer() mutates the passed-in context, which
   is both surprising and limits flexibility
 - it's not possible to use a different DiagnosticsEngine with ClangTidy

This means a little bit more code in the places ClangTidy is used standalone,
but more flexibility in using ClangTidy with other diagnostics configurations.

Reviewers: hokein

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 346418
2018-11-08 17:42:16 +00:00
Matt Davis 08b64d60fe [llvm-mca] Remove unneeded namespace qualifier. NFC.
llvm-svn: 346417
2018-11-08 17:32:45 +00:00
Philip Reames 9ffd5eb081 [docs] Clarify ELF section naming for StackMaps and fix a typo
llvm-svn: 346416
2018-11-08 17:20:35 +00:00
Sam McCall cf3c9c116f [clang-tidy] fix test after r346414
llvm-svn: 346415
2018-11-08 17:10:31 +00:00
Sam McCall 2c78247041 [Tooling] Produce diagnostics for missing input files.
Summary:
This was disabled way back in 2011, in the dark times before Driver was VFS-aware.

Also, make driver more VFS-aware :-)

This breaks one ClangTidy test (we improved the error message), will fix when
submitting.

Reviewers: ioeric

Subscribers: cfe-commits, alexfh

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

llvm-svn: 346414
2018-11-08 16:57:01 +00:00
Yaxun Liu 4bbdebc49a Fix bitcast to address space cast for coerced load/stores
Coerced load/stores through memory do not take into account potential
address space differences when it creates its bitcasts.

Patch by David Salinas.

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

llvm-svn: 346413
2018-11-08 16:55:46 +00:00
Adrian Prantl 778fba3188 [dsymutil] Copy the LC_BUILD_VERSION load command into the companion binary.
LC_BUILD_VERSION contains platform information that is useful for LLDB
to match up dSYM bundles with binaries. This patch copies the load
command over into the dSYM.

rdar://problem/44145175
rdar://problem/45883463

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

llvm-svn: 346412
2018-11-08 16:54:59 +00:00
Jinsong Ji 5fd3e75478 [PowerPC][llvm-exegesis] Add a PowerPC target
This is patch to add PowerPC target to llvm-exegesis.
The target does just enough to be able to run llvm-exegesis in latency mode for at least some opcodes.

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

llvm-svn: 346411
2018-11-08 16:51:42 +00:00