Jonas Devlieghere [Fri, 9 Nov 2018 01:59:28 +0000 (01:59 +0000)]
Revert "[FileSystem] Make use of FS in TildeExpressionResolver"
The whole point of this change was making it possible to resolve paths
without depending on the FileSystem, which is not what I did here. Not
sure what I was thinking...
llvm-svn: 346466
Thomas Lively [Fri, 9 Nov 2018 01:57:00 +0000 (01:57 +0000)]
[WebAssembly] Read prefixed opcodes as ULEB128s
Summary: Depends on D54126.
Reviewers: aheejin, dschuff, aardappel
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D54138
llvm-svn: 346465
Thomas Lively [Fri, 9 Nov 2018 01:49:19 +0000 (01:49 +0000)]
[WebAssembly][NFC] Reorder SIMD section
Summary:
Reorders the sections in the SIMD tablegen file to roughly match the
new opcode ordering. Depends on D54126.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D54134
llvm-svn: 346464
Thomas Lively [Fri, 9 Nov 2018 01:45:56 +0000 (01:45 +0000)]
[WebAssembly] Renumber and LEB128-encode SIMD opcodes
Reviewers: aheejin, dschuff, aardappel
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D54126
llvm-svn: 346463
Thomas Lively [Fri, 9 Nov 2018 01:38:44 +0000 (01:38 +0000)]
[WebAssembly] Lower select for vectors
Summary:
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D53675
llvm-svn: 346462
Bill Wendling [Fri, 9 Nov 2018 01:32:30 +0000 (01:32 +0000)]
Ignore implicit things like ConstantExpr.
llvm-svn: 346461
Jonas Devlieghere [Fri, 9 Nov 2018 01:17:22 +0000 (01:17 +0000)]
[not] Improve error reporting consistency.
Makes `not` use WithColor from Support so it prints 'error' in color
when applicable.
llvm-svn: 346460
Zachary Turner [Fri, 9 Nov 2018 01:09:10 +0000 (01:09 +0000)]
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
Bill Wendling [Fri, 9 Nov 2018 01:04:05 +0000 (01:04 +0000)]
Use correct parameter name in comment.
llvm-svn: 346458
Jonas Devlieghere [Fri, 9 Nov 2018 00:50:50 +0000 (00:50 +0000)]
[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
Adrian Prantl [Fri, 9 Nov 2018 00:49:18 +0000 (00:49 +0000)]
Fix CMake build when building with -fmodules-local-submodule-visibility.
llvm-svn: 346456
Bill Wendling [Fri, 9 Nov 2018 00:41:36 +0000 (00:41 +0000)]
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
Adrian Prantl [Fri, 9 Nov 2018 00:26:15 +0000 (00:26 +0000)]
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
Jonas Devlieghere [Fri, 9 Nov 2018 00:26:10 +0000 (00:26 +0000)]
[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
Evgeniy Stepanov [Fri, 9 Nov 2018 00:03:39 +0000 (00:03 +0000)]
[hwasan] Remove dead code.
llvm-svn: 346452
Eric Fiselier [Thu, 8 Nov 2018 23:57:32 +0000 (23:57 +0000)]
Attempt to enable -Wconversion
llvm-svn: 346451
Petr Hosek [Thu, 8 Nov 2018 23:45:00 +0000 (23:45 +0000)]
[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
Jonas Devlieghere [Thu, 8 Nov 2018 23:21:00 +0000 (23:21 +0000)]
Update FileSpec constructor signature
llvm-svn: 346449
Philip Reames [Thu, 8 Nov 2018 23:20:40 +0000 (23:20 +0000)]
[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
Philip Reames [Thu, 8 Nov 2018 23:07:04 +0000 (23:07 +0000)]
[docs][statepoints] add a section spelling out simplifications for non-relocating GCs
llvm-svn: 346447
Philip Reames [Thu, 8 Nov 2018 22:56:41 +0000 (22:56 +0000)]
[docs] Add some subsections to make it possible to find portions of the statepoint overview
llvm-svn: 346446
Heejin Ahn [Thu, 8 Nov 2018 22:56:26 +0000 (22:56 +0000)]
[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
Davide Italiano [Thu, 8 Nov 2018 22:47:40 +0000 (22:47 +0000)]
Revert "Fix bug in PE/COFF plugin and ValueObjectVariable."
It breaks some tests on MacOS.
llvm-svn: 346444
Jason Molenda [Thu, 8 Nov 2018 22:41:19 +0000 (22:41 +0000)]
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
Jorge Gorbe Moya [Thu, 8 Nov 2018 22:04:58 +0000 (22:04 +0000)]
[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
Eli Friedman [Thu, 8 Nov 2018 21:20:52 +0000 (21:20 +0000)]
[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
David Blaikie [Thu, 8 Nov 2018 20:47:30 +0000 (20:47 +0000)]
[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
Florian Hahn [Thu, 8 Nov 2018 20:44:19 +0000 (20:44 +0000)]
[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
Craig Topper [Thu, 8 Nov 2018 20:29:17 +0000 (20:29 +0000)]
[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
Pirama Arumuga Nainar [Thu, 8 Nov 2018 20:10:07 +0000 (20:10 +0000)]
[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
Jorge Gorbe Moya [Thu, 8 Nov 2018 19:57:59 +0000 (19:57 +0000)]
[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
Simon Pilgrim [Thu, 8 Nov 2018 19:42:11 +0000 (19:42 +0000)]
[X86] Regenerate loaduse test
llvm-svn: 346434
Sanjay Patel [Thu, 8 Nov 2018 19:16:27 +0000 (19:16 +0000)]
[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
Nirav Dave [Thu, 8 Nov 2018 19:14:20 +0000 (19:14 +0000)]
[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
Reid Kleckner [Thu, 8 Nov 2018 18:53:56 +0000 (18:53 +0000)]
Fix -Wextra-qualification warning
llvm-svn: 346431
Zachary Turner [Thu, 8 Nov 2018 18:50:31 +0000 (18:50 +0000)]
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
Zachary Turner [Thu, 8 Nov 2018 18:50:11 +0000 (18:50 +0000)]
[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
Shafik Yaghmour [Thu, 8 Nov 2018 18:42:00 +0000 (18:42 +0000)]
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
Reid Kleckner [Thu, 8 Nov 2018 18:38:17 +0000 (18:38 +0000)]
[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
Sanjay Patel [Thu, 8 Nov 2018 18:18:20 +0000 (18:18 +0000)]
[x86] add RUNs for AVX1; NFC
Differences in splat-ability might be reason to differentiate some cases.
llvm-svn: 346426
Roman Lebedev [Thu, 8 Nov 2018 18:15:58 +0000 (18:15 +0000)]
[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
Matt Davis [Thu, 8 Nov 2018 18:08:43 +0000 (18:08 +0000)]
[llvm-mca] Partially revert r346417.
Restored the llvm:: namespace qualifier on make_unique.
This removes the ambiguity with make_unique.
llvm-svn: 346424
Nicolai Haehnle [Thu, 8 Nov 2018 18:01:38 +0000 (18:01 +0000)]
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
Tom Stellard [Thu, 8 Nov 2018 17:57:57 +0000 (17:57 +0000)]
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
Vedant Kumar [Thu, 8 Nov 2018 17:57:09 +0000 (17:57 +0000)]
[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
Dan Liew [Thu, 8 Nov 2018 17:50:34 +0000 (17:50 +0000)]
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
Andrea Di Biagio [Thu, 8 Nov 2018 17:49:30 +0000 (17:49 +0000)]
[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
Sam McCall [Thu, 8 Nov 2018 17:42:16 +0000 (17:42 +0000)]
[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
Matt Davis [Thu, 8 Nov 2018 17:32:45 +0000 (17:32 +0000)]
[llvm-mca] Remove unneeded namespace qualifier. NFC.
llvm-svn: 346417
Philip Reames [Thu, 8 Nov 2018 17:20:35 +0000 (17:20 +0000)]
[docs] Clarify ELF section naming for StackMaps and fix a typo
llvm-svn: 346416
Sam McCall [Thu, 8 Nov 2018 17:10:31 +0000 (17:10 +0000)]
[clang-tidy] fix test after r346414
llvm-svn: 346415
Sam McCall [Thu, 8 Nov 2018 16:57:01 +0000 (16:57 +0000)]
[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
Yaxun Liu [Thu, 8 Nov 2018 16:55:46 +0000 (16:55 +0000)]
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
Adrian Prantl [Thu, 8 Nov 2018 16:54:59 +0000 (16:54 +0000)]
[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
Jinsong Ji [Thu, 8 Nov 2018 16:51:42 +0000 (16:51 +0000)]
[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
Davide Italiano [Thu, 8 Nov 2018 16:21:29 +0000 (16:21 +0000)]
Revert "[MSP430] Add MC layer"
This commit broke the module buildbots.
Error:
lib/Target/MSP430/MSP430GenAsmMatcher.inc:1027:1: error: redundant
namespace 'llvm' [-Wmodules-import-nested-redundant]
^
llvm-svn: 346410
Calixte Denizet [Thu, 8 Nov 2018 16:16:04 +0000 (16:16 +0000)]
[Profile] The test for gcov-fork seems to be ok on arm
Summary: Remove the XFAIL for arm since it seems to be ok
Reviewers: marco-c
Reviewed By: marco-c
Subscribers: javed.absar, kristof.beyls, delcypher, chrib, llvm-commits, #sanitizers, sylvestre.ledru
Differential Revision: https://reviews.llvm.org/D54263
llvm-svn: 346409
Alexey Bataev [Thu, 8 Nov 2018 15:47:39 +0000 (15:47 +0000)]
[OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.
The base pointer for the lambda mapping must point to the lambda capture
placement and pointer must point to the captured variable itself. Patch
fixes this problem.
llvm-svn: 346408
Alexey Bataev [Thu, 8 Nov 2018 15:47:30 +0000 (15:47 +0000)]
[OPENMP]Make lambda mapping follow reqs for PTR_AND_OBJ mapping.
Summary:
The base pointer for the lambda mapping must point to the lambda capture
placement and pointer must point to the captured variable itself. Patch
fixes this problem.
Reviewers: gtbercea
Subscribers: guansong, openmp-commits, kkwli0, caomhin
Differential Revision: https://reviews.llvm.org/D54260
llvm-svn: 346407
Jonas Paulsson [Thu, 8 Nov 2018 15:29:48 +0000 (15:29 +0000)]
[SystemZ] Bugfix in shouldCoalesce()
It was discovered in randomized testing that the SystemZ implementation of
shouldCoalesce() could be caused to crash when subreg liveness was
enabled. This was because an undef use of the virtual register was copied
outside current MBB at the point of shouldCoalesce() being called. For more
details, see https://bugs.llvm.org/show_bug.cgi?id=39276.
This patch changes the check for MBB locality from livein/liveout checks to
do checks for all instructions of both intervals being inside MBB. This
avoids the cases with dead defs / undef uses outside MBB, which are not
affecting liveness in/out of MBB.
The original test case included as a reduced .mir test case.
Review: Ulrich Weigand
https://reviews.llvm.org/D54197
llvm-svn: 346406
Philip Reames [Thu, 8 Nov 2018 15:17:10 +0000 (15:17 +0000)]
[docs] Clarify expectations for stack map sections and AOT compilers
llvm-svn: 346405
Roman Lebedev [Thu, 8 Nov 2018 14:48:56 +0000 (14:48 +0000)]
[NFC][BdVer2] Tests for load and store throughput (PR39465)
During review it was noted that while it appears that
the Piledriver can do two [consecutive] loads per cycle,
it can only do one store per cycle. It was suggested
that the sched model incorrectly models that,
but it was opted to fix this afterwards.
These tests show that the two consecutive loads are
modelled correctly, and one consecutive stores is not
modelled incorrectly. Unless i'm missing the point.
https://bugs.llvm.org/show_bug.cgi?id=39465
llvm-svn: 346404
Alexandre Ganea [Thu, 8 Nov 2018 14:42:37 +0000 (14:42 +0000)]
[LLD] Fix Microsoft precompiled headers cross-compile on Linux
Differential revision: https://reviews.llvm.org/D54122
llvm-svn: 346403
Simon Pilgrim [Thu, 8 Nov 2018 14:07:17 +0000 (14:07 +0000)]
[X86][SSE] Add PR39387 shuffle test case
llvm-svn: 346402
Petr Pavlu [Thu, 8 Nov 2018 13:02:10 +0000 (13:02 +0000)]
[ARM] Enable spilling of the hGPR register class in Thumb2
Generalize code in Thumb2InstrInfo::storeRegToStackSlot() and
loadRegToStackSlot() to allow the GPR class or any of its sub-classes
(including hGPR) to be stored/loaded by ARM::t2STRi12/ARM::t2LDRi12.
Differential Revision: https://reviews.llvm.org/D51927
llvm-svn: 346401
Clement Courbet [Thu, 8 Nov 2018 12:37:56 +0000 (12:37 +0000)]
[llvm-exegesis][NFC] Add missing header guard + cosmetics.
Reviewers: gchatelet
Reviewed By: gchatelet
Subscribers: tschuett, llvm-commits
Differential Revision: https://reviews.llvm.org/D54252
llvm-svn: 346400
Simon Pilgrim [Thu, 8 Nov 2018 12:14:10 +0000 (12:14 +0000)]
[X86][AVX] Tidyup prefixes and regenerate interleaved tests
Share common AVX prefix and split off AVX2OR512 prefix instead
llvm-svn: 346399
Clement Courbet [Thu, 8 Nov 2018 12:09:45 +0000 (12:09 +0000)]
Revert "[llvm-exegesis] Add a snippet generator to generate snippets to compute ROB sizes."
This reverts accidental commit rL346394.
llvm-svn: 346398
Max Kazantsev [Thu, 8 Nov 2018 11:54:35 +0000 (11:54 +0000)]
Return "[IndVars] Smart hard uses detection"
The patch has been reverted because it ended up prohibiting propagation
of a constant to exit value. For such values, we should skip all checks
related to hard uses because propagating a constant is always profitable.
Differential Revision: https://reviews.llvm.org/D53691
llvm-svn: 346397
Renato Golin [Thu, 8 Nov 2018 11:51:27 +0000 (11:51 +0000)]
Adding Yvan as release test backup for Diana
Thanks for offering to help, Yvan! :)
llvm-svn: 346396
Clement Courbet [Thu, 8 Nov 2018 11:45:14 +0000 (11:45 +0000)]
[llvm-exegesis] Add a snippet generator to generate snippets to compute ROB sizes.
llvm-svn: 346394
Hans Wennborg [Thu, 8 Nov 2018 11:27:04 +0000 (11:27 +0000)]
clang-cl: Add "/clang:" pass-through arg support.
The clang-cl driver disables access to command line options outside of the
"Core" and "CLOption" sets of command line arguments. This filtering makes it
impossible to pass arguments that are interpreted by the clang driver and not
by either 'cc1' (the frontend) or one of the other tools invoked by the driver.
An example driver-level flag is the '-fno-slp-vectorize' flag, which is
processed by the driver in Clang::ConstructJob and used to set the cc1 flag
"-vectorize-slp". There is no negative cc1 flag or -mllvm flag, so it is not
currently possible to disable the SLP vectorizer from the clang-cl driver.
This change introduces the "/clang:" argument that is available when the
driver mode is set to CL compatibility. This option works similarly to the
"-Xclang" option, except that the option values are processed by the clang
driver rather than by 'cc1'. An example usage is:
clang-cl /clang:-fno-slp-vectorize /O2 test.c
Another example shows how "/clang:" can be used to pass a flag where there is
a conflict between a clang-cl compat option and an overlapping clang driver
option:
clang-cl /MD /clang:-MD /clang:-MF /clang:test_dep_file.dep test.c
In the previous example, the unprefixed /MD selects the DLL version of the msvc
CRT, while the prefixed -MD flag and the -MF flags are used to create a make
dependency file for included headers.
One note about flag ordering: the /clang: flags are concatenated to the end of
the argument list, so in cases where the last flag wins, the /clang: flags
will be chosen regardless of their order relative to other flags on the driver
command line.
Patch by Neeraj K. Singh!
Differential revision: https://reviews.llvm.org/D53457
llvm-svn: 346393
Andrew Savonichev [Thu, 8 Nov 2018 11:25:41 +0000 (11:25 +0000)]
[OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension
Summary:
Documentation can be found at https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_device_side_avc_motion_estimation.txt
Patch by Kristina Bessonova
Reviewers: Anastasia, yaxunl, shafik
Reviewed By: Anastasia
Subscribers: arphaman, sidorovd, AlexeySotkin, krisb, bader, asavonic, cfe-commits
Differential Revision: https://reviews.llvm.org/D51484
llvm-svn: 346392
Anton Korobeynikov [Thu, 8 Nov 2018 10:17:52 +0000 (10:17 +0000)]
[MSP430] Fix encodeInstruction() for big endian hosts
Reviewers: asl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D54251
llvm-svn: 346391
Gil Rapaport [Thu, 8 Nov 2018 09:01:19 +0000 (09:01 +0000)]
[LSR] Combine unfolded offset into invariant register
LSR reassociates constants as unfolded offsets when the constants fit as
immediate add operands, which currently prevents such constants from being
combined later with loop invariant registers.
This patch modifies GenerateCombinations() to generate a second formula which
includes the unfolded offset in the combined loop-invariant register.
This commit fixes a bug in the original patch (committed at r345114, reverted
at r345123).
Differential Revision: https://reviews.llvm.org/D51861
llvm-svn: 346390
Max Kazantsev [Thu, 8 Nov 2018 05:07:58 +0000 (05:07 +0000)]
[SCEV][NFC] Verify IR in isLoop[Entry,Backedge]GuardedByCond
We have a lot of various bugs that are caused by misuse of SCEV (in particular in LV),
all of them can simply be described as "we ask SCEV to prove some fact on invalid IR".
Some of examples of those are PR36311, PR37221, PR39160.
The problem is that these failues manifest differently (what we saw was failure of various
asserts across SCEV, but there can also be miscompiles). This patch adds an assert into two
SCEV methods that strongly rely on correctness of the IR and are involved in known failues.
This will at least allow us to have a clear indication of what was wrong in this case.
This patch also fixes a unit test with incorrect IR that fails this verification.
Differential Revision: https://reviews.llvm.org/D52930
Reviewed By: fhahn
llvm-svn: 346389
whitequark [Thu, 8 Nov 2018 04:04:04 +0000 (04:04 +0000)]
[bindings/go] Add Go bindings to LLVMGetIndices
Summary: This instruction is useful for inspecting extractvalue/insertvalue in IR. Unlike most other operations, indices cannot be inspected using the generic Value.Opcode() function so a specialized function needs to be added.
Reviewers: whitequark, pcc
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53883
llvm-svn: 346388
whitequark [Thu, 8 Nov 2018 04:00:18 +0000 (04:00 +0000)]
[OCaml] Fix incorrect use of CAMLlocal in nested blocks
Summary:
The OCaml manual states:
> Local variables of type value must be declared with one of the
> CAMLlocal macros. [...] These macros must be used at the beginning
> of the function, not in a nested block.
This patch moves several instances of CAMLlocal macros from nested
blocks to the function beginning.
Reviewers: whitequark
Reviewed By: whitequark
Subscribers: CodaFi, llvm-commits
Differential Revision: https://reviews.llvm.org/D53841
llvm-svn: 346387
whitequark [Thu, 8 Nov 2018 03:58:01 +0000 (03:58 +0000)]
[MergeFuncs] Improve ordering of equal functions
Summary:
MergeFunctions currently tries to process strong functions before
weak functions, because weak functions can simply call strong
functions, while a strong/weak function cannot call a weak function
(a backing strong function is needed).
This patch additionally tries to process external functions before
local functions, because we definitely have to keep the external
function, but may be able to drop the local one (and definitely
can if it is also unnamed_addr).
Unfortunately, this exposes an existing bug in the implementation:
The FnTree and FNodesInTree structures can currently go out of
sync in the case where two weak functions are merged, because the
function in FnTree/FNodesInTree is RAUWed. This leaves it behind in
FnTree (this is intended, as it is the strong backing function which
should be used for further merges), while it is replaced in
FNodesInTree (this is not intended).
This is fixed by switching FNodesInTree from using a ValueMap to
using a DenseMap of AssertingVH.
This exposes another minor issue: Currently FNodesInTree is not
cleared after MergeFunctions finishes running. Currently, this is
potentially dangerous (e.g. if something else wants to RAUW a function
with a non-function), but at the very least it is unnecessary/inefficient.
After the change to use AssertingVH it becomes more problematic,
because there are certainly passes that remove functions.
This issue is fixed by clearing FNodesInTree at the end of the pass.
Reviewers: jfb, whitequark
Reviewed By: whitequark
Subscribers: rkruppe, llvm-commits
Differential Revision: https://reviews.llvm.org/D53271
llvm-svn: 346386
whitequark [Thu, 8 Nov 2018 03:57:55 +0000 (03:57 +0000)]
[MergeFuncs] Call removeUsers() prior to unnamed_addr RAUW
Summary:
For unnamed_addr functions we RAUW instead of only replacing direct callers. However, functions in which replacements were performed currently are not added back to the worklist, resulting in missed merging opportunities.
Fix this by calling removeUsers() prior to RAUW.
Reviewers: jfb, whitequark
Reviewed By: whitequark
Subscribers: rkruppe, llvm-commits
Differential Revision: https://reviews.llvm.org/D53262
llvm-svn: 346385
Thomas Lively [Thu, 8 Nov 2018 02:35:28 +0000 (02:35 +0000)]
[WebAssembly] Add V128 to WebAssemblyInstrInfo::copyPhysReg
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D53872
llvm-svn: 346384
Nathan Lanza [Thu, 8 Nov 2018 01:10:24 +0000 (01:10 +0000)]
Revert "Reorder FindPythonInterp so that config-ix can use PYTHON_EXECUTABLE"
This reverts commit rL346367 due to test error in compiler-rt.
llvm-svn: 346383
Reid Kleckner [Thu, 8 Nov 2018 00:57:33 +0000 (00:57 +0000)]
[sancov] Put .SCOV* sections into the right comdat groups on COFF
Avoids linker errors about relocations against discarded sections.
This was uncovered during the Chromium clang roll here:
https://chromium-review.googlesource.com/c/chromium/src/+/
1321863#message-
717516acfcf829176f6a2f50980f7a4bdd66469a
After this change, Chromium's libGLESv2 links successfully for me.
Reviewers: metzman, hans, morehouse
Differential Revision: https://reviews.llvm.org/D54232
llvm-svn: 346381
David Blaikie [Thu, 8 Nov 2018 00:35:54 +0000 (00:35 +0000)]
NFC: DebugInfo: Track the origin CU rather than just the base address for range lists
Turns out knowing more than just the base address might be useful -
specifically a future change to respect a DICompileUnit flag for the use
of base address specifiers in DWARF < 5.
llvm-svn: 346380
Jessica Paquette [Thu, 8 Nov 2018 00:33:38 +0000 (00:33 +0000)]
[MachineOutliner][NFC] Only map blocks which have adjacent legal instructions
If a block doesn't have any ranges of adjacent legal instructions, then it
can't have outlining candidates. There's no point in mapping legal isntructions
in situations like this.
I noticed this reduces the size of the suffix tree in sqlite3 for AArch64 at
-Oz by about 3%.
llvm-svn: 346379
Shoaib Meenai [Thu, 8 Nov 2018 00:29:33 +0000 (00:29 +0000)]
[clang] Set CMP0075 to new
Make the check_include_file* macros honor CMAKE_REQUIRED_LIBRARIES. This
shouldn't cause any of the configuration checks to give different
results, and I verified that a clean configure before and after this
change resulted in identical CMake caches on my machine. The same change
was done for LLVM in r346377.
llvm-svn: 346378
Shoaib Meenai [Thu, 8 Nov 2018 00:18:12 +0000 (00:18 +0000)]
[cmake] Set CMP0075 to NEW
Make the check_include_file* macros honor CMAKE_REQUIRED_LIBRARIES. This
shouldn't cause any of the configuration checks to give different
results (and I did clean configures before and after this change and
confirmed that the resulting CMake caches were identical, though of
course that's just one machine). This suppresses a warning when building
with CMake 3.12 or later.
This doesn't suppress the warning in clang, because clang does its own
cmake_minimum_required call even when being built in-tree, and that
resets all policy settings. I'll address that separately.
Differential Revision: https://reviews.llvm.org/D54236
llvm-svn: 346377
Stanislav Mekhanoshin [Thu, 8 Nov 2018 00:16:23 +0000 (00:16 +0000)]
[AMDGPU] Extend promote alloca vectorization
Promote alloca can vectorize a small array by bitcasting it to a
vector type. Extend vectorization for the case when alloca is
already a vector type. We still want to replace GEPs with an
insert/extract element instructions in this case.
Differential Revision: https://reviews.llvm.org/D54219
llvm-svn: 346376
Jonas Devlieghere [Thu, 8 Nov 2018 00:14:50 +0000 (00:14 +0000)]
[FileSystem] Add convenience method to check for directories.
Replace calls to LLVM's is_directory with calls to LLDB's FileSytem
class. For this I introduced a new convenience method that, like the
other methods, takes either a path or filespec. This still uses the LLVM
functions under the hood.
Differential revision: https://reviews.llvm.org/D54135
llvm-svn: 346375
Anton Korobeynikov [Thu, 8 Nov 2018 00:03:45 +0000 (00:03 +0000)]
[MSP430] Add MC layer
Summary:
This change implements assembler parser, code emitter, ELF object writer
and disassembler for the MSP430 ISA. Also, more instruction forms are added
to the target description.
Reviewers: asl
Reviewed By: asl
Subscribers: pftbest, krisb, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D53661
llvm-svn: 346374
Jessica Paquette [Thu, 8 Nov 2018 00:02:11 +0000 (00:02 +0000)]
[MachineOutliner][NFC] Don't map MBBs that don't contain legal instructions
I noticed that there are lots of basic blocks that don't have enough legal
instructions in them to warrant outlining. We can skip mapping these entirely.
In sqlite3, compiled for AArch64 at -Oz, this results in a 10% reduction of
the total nodes in the suffix tree. These nodes can never be part of a
repeated substring, and so they don't impact the result at all.
Before this, there were 62128 nodes in the tree for sqlite3. After this, there
are 56457 nodes.
llvm-svn: 346373
Jonas Devlieghere [Thu, 8 Nov 2018 00:01:32 +0000 (00:01 +0000)]
Extend virtual file system with `isLocal` method
Expose the `llvm::sys::fs::is_local` function through the VFS.
Differential revision: https://reviews.llvm.org/D54127
llvm-svn: 346372
Jordan Rupprecht [Wed, 7 Nov 2018 23:53:50 +0000 (23:53 +0000)]
[llvm-readobj] Implement LLVM style printer for --notes
Summary:
Port the GNU style printNotes method to the LLVMStyle subclass.
This is basically just a heavy refactor so that the note parsing/formatting logic from the GNUStyle::printNotes can be shared with LLVMStyle::printNotes.
Reviewers: MaskRay
Reviewed By: MaskRay
Subscribers: dschuff, fedor.sergeev, llvm-commits
Differential Revision: https://reviews.llvm.org/D54220
llvm-svn: 346371
Rong Xu [Wed, 7 Nov 2018 23:51:20 +0000 (23:51 +0000)]
[PGO] Exit early if all count values are zero
If all the edge counts for a function are zero, skip count population and
annotation, as nothing will happen. This can save some compile time.
Differential Revision: https://reviews.llvm.org/D54212
llvm-svn: 346370
Fangrui Song [Wed, 7 Nov 2018 23:51:13 +0000 (23:51 +0000)]
Fix -Wimplicit-fallthrough warning
Reviewers: EricWF, ldionne, mclow.lists
Reviewed By: ldionne
Subscribers: christof, libcxx-commits
Differential Revision: https://reviews.llvm.org/D54234
llvm-svn: 346369
Daniel Sanders [Wed, 7 Nov 2018 23:33:55 +0000 (23:33 +0000)]
Add 'REQUIRES: default_triple' to test/CodeGen/MIR/X86/zero-probability.mir
llvm-svn: 346368
Nathan Lanza [Wed, 7 Nov 2018 23:22:09 +0000 (23:22 +0000)]
Reorder FindPythonInterp so that config-ix can use PYTHON_EXECUTABLE
Summary:
Code in config-ix tries to call `PYTHON_EXECUTABLE` to search for some
python modules but that variable isn't set until the moved chunk of
code that finds Python is called.
Reorder it so CMake can use PYTHON_EXECUTABLE
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D52763
llvm-svn: 346367
Eli Friedman [Wed, 7 Nov 2018 22:30:56 +0000 (22:30 +0000)]
[AArch64] [Windows] Address post-commit review comment on r346358.
In this context, usesWindowsCFI() is basically the same thing as
isOSWindows(), but it makes the relevant property of the target
more explicit.
llvm-svn: 346366
Jorge Gorbe Moya [Wed, 7 Nov 2018 22:30:01 +0000 (22:30 +0000)]
Add parentheses to silence warning.
DWARFContext.cpp:356:20: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
llvm-svn: 346365
Nicolai Haehnle [Wed, 7 Nov 2018 21:53:43 +0000 (21:53 +0000)]
Revert "AMDGPU: Divergence-driven selection of scalar buffer load intrinsics"
This reverts commit r344696 for now (except for some test additions).
See https://bugs.freedesktop.org/show_bug.cgi?id=108611.
llvm-svn: 346364