Yuka Takahashi [Wed, 24 Oct 2018 08:24:16 +0000 (08:24 +0000)]
[bash-autocompletion] Fix bug when a flag ends with '='
There was a bug that when a flag ends with '=' and no value was suggested,
clang autocompletes the flag itself.
For example, in bash, it looked like this:
```
$ clang -fmodule-file=[tab]
-> $clang -fmodule-file=-fmodule-file
```
This is not what we expect. We expect a file autocompletion when no value
was found. With this patch, pressing tab suggests files in the current
directory.
Reviewers: teemperor, ruiu
Subscribers: cfe-commits
llvm-svn: 345121
Tim Renouf [Wed, 24 Oct 2018 08:14:07 +0000 (08:14 +0000)]
[AMDGPU] Defined gfx909 Raven Ridge 2
Differential Revision: https://reviews.llvm.org/D53418
Change-Id: Ie3d054f2e956c2768988c0f4c0ffd29a47294eef
llvm-svn: 345120
Sam McCall [Wed, 24 Oct 2018 07:59:38 +0000 (07:59 +0000)]
[clangd] Embed fixes as CodeAction, instead of clangd_fixes. Clean up serialization.
Summary:
CodeAction provides us with a standard way of representing fixes inline, so
use it, replacing our existing ad-hoc extension.
After this, it's easy to serialize diagnostics using the structured
toJSON/Protocol.h mechanism rather than assembling JSON ad-hoc.
Reviewers: hokein, arphaman
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53391
llvm-svn: 345119
Eugene Leviant [Wed, 24 Oct 2018 07:48:32 +0000 (07:48 +0000)]
[ThinLTO] Fix dot dumper for regular LTO modules
Regular LTO module identifier is (unsigned)-1. This patch emits correct
module identifier while printing edges with source summary in regular
LTO module.
Differential revision: https://reviews.llvm.org/D53583
llvm-svn: 345118
Martin Storsjo [Wed, 24 Oct 2018 07:42:10 +0000 (07:42 +0000)]
[MinGW] Support for multiarch runtimes layout
Patch by Peiyuan Song!
llvm-svn: 345117
Martin Storsjo [Wed, 24 Oct 2018 07:42:06 +0000 (07:42 +0000)]
[ELF] Remove a superfluous semicolon, fixing warnings. NFC.
llvm-svn: 345116
Dorit Nuzman [Wed, 24 Oct 2018 07:11:38 +0000 (07:11 +0000)]
[LV] Don't have fold-tail under optsize invalidate interleave-groups when
masked-interleaving is enabled
Enable interleave-groups under fold-tail scenario for Opt for size compilation;
D50480 added support for vectorizing loops of arbitrary trip-count without a
remiander, which in turn makes everything in the loop conditional, including
interleave-groups if any. It therefore invalidated all interleave-groups
because we didn't have support for vectorizing predicated interleaved-groups
at the time. In the meantime, D53011 introduced this support, so we don't
have to invalidate interleave-groups when masked-interleaved support is enabled.
Reviewers: Ayal, hsaito, dcaballe, fhahn
Reviewed By: hsaito
Differential Revision: https://reviews.llvm.org/D53559
llvm-svn: 345115
Gil Rapaport [Wed, 24 Oct 2018 07:08:38 +0000 (07:08 +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.
Differential Revision: https://reviews.llvm.org/D51861
llvm-svn: 345114
Sam McCall [Wed, 24 Oct 2018 06:58:42 +0000 (06:58 +0000)]
[clangd] Truncate SymbolID to 16 bytes.
Summary:
The goal is 8 bytes, which has a nonzero risk of collisions with huge indexes.
This patch should shake out any issues with truncation at all, we can lower
further later.
Reviewers: ioeric
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53587
llvm-svn: 345113
Craig Topper [Wed, 24 Oct 2018 06:13:36 +0000 (06:13 +0000)]
[X86] Correct a bad isel predicate. Though I don't think it can be exposed.
This B/W VPTEST instructions are only available with AVX512BW. But lowering should prevent any byte or word elements from getting to isel so this can't be exposed.
llvm-svn: 345112
Richard Trieu [Wed, 24 Oct 2018 02:07:41 +0000 (02:07 +0000)]
[Sema] Fix -Wcomma in dependent context
When there is a dependent type inside a cast, the CastKind becomes CK_Dependent
instead of CK_ToVoid. This fix will check that there is a dependent cast,
the original type is dependent, and the target type is void to ignore the cast.
https://bugs.llvm.org/show_bug.cgi?id=39375
llvm-svn: 345111
Kostya Serebryany [Wed, 24 Oct 2018 01:35:50 +0000 (01:35 +0000)]
[hwasan] when printing a stack-related bugs, also print stack frame descriptions provided by the compiler
llvm-svn: 345110
Adrian Prantl [Wed, 24 Oct 2018 00:06:02 +0000 (00:06 +0000)]
Debug Info (-gmodules): emit full types for non-anchored template specializations
Before this patch, clang would emit a (module-)forward declaration for
template instantiations that are not anchored by an explicit template
instantiation, but still are guaranteed to be available in an imported
module. Unfortunately detecting the owning module doesn't reliably
work when local submodule visibility is enabled and the template is
inside a cross-module namespace.
This make clang debuggable again with -gmodules and LSV enabled.
rdar://problem/
41552377
llvm-svn: 345109
Sanjin Sijaric [Wed, 24 Oct 2018 00:03:34 +0000 (00:03 +0000)]
[ARM64][Windows] Add unwind support to llvm-readobj
This patch adds support for dumping the unwind info from ARM64 COFF object
files.
Differential Revision: https://reviews.llvm.org/D53264
llvm-svn: 345108
Saleem Abdulrasool [Wed, 24 Oct 2018 00:00:52 +0000 (00:00 +0000)]
ARM: handle checking aliases with out-of-bounds GEPs
A global alias may use indices which are not considered in bounds. In
such a case, accessing the base object will fail as it only peers
through inbounds accesses. This pattern is used by the swift compiler
to create references to preceeding members in the type metadata. This
would cause the code generation to fail when targeting a platform that
used ELF as the object file format. Be conservative and fail the
read-only check if we run into an alias that we cannot peer through.
llvm-svn: 345107
Jason Molenda [Tue, 23 Oct 2018 23:45:56 +0000 (23:45 +0000)]
Support nwere versions of the Segger J-Link jtag board software.
Add support in ProcessGDBRemote::GetGDBServerRegisterInfo
for recognizing a generic "arm" architecture that will be used if
nothing better is available so that we don't ignore the register
definitions if we didn't already have an architecture set.
Also in ProcessGDBRemote::DoConnectRemote don't set the target
arch unless we have a valid architecture to set it to.
Platform::ConnectProcess will try to get the current target's
architecture, or the default architecture, when creating the
target for the connection to be attempted. If lldb was started
with a target binary, we want to create this target with that
architecture in case the remote gdb stub doesn't supply a
qHostInfo arch.
Add logging to Target::MergeArchitecture.
<rdar://problem/
34916465>
llvm-svn: 345106
Reid Kleckner [Tue, 23 Oct 2018 23:44:44 +0000 (23:44 +0000)]
Commit missing comment edit and use correct cast to fix std::min overload
llvm-svn: 345105
Reid Kleckner [Tue, 23 Oct 2018 23:35:43 +0000 (23:35 +0000)]
[hurd] Make getMainExecutable get the real binary path
On GNU/Hurd, llvm-config is returning bogus value, such as:
$ llvm-config-6.0 --includedir
/usr/include
while it should be:
$ llvm-config-6.0 --includedir
/usr/lib/llvm-6.0/include
This is because getMainExecutable does not get the actual installation
path. On GNU/Hurd, /proc/self/exe is indeed a symlink to the path that
was used to start the program, and not the eventual binary file. Llvm's
getMainExecutable thus needs to run realpath over it to get the actual
place where llvm was installed (/usr/lib/llvm-6.0/bin/llvm-config), and
not /usr/bin/llvm-config-6.0. This will not change the result on Linux,
where /proc/self/exe already points to the eventual file.
Patch by Samuel Thibault!
While making changes here, I reformatted this block a bit to reduce
indentation and match 2 space indent style.
Differential Revision: https://reviews.llvm.org/D53557
llvm-svn: 345104
Wei Mi [Tue, 23 Oct 2018 23:29:45 +0000 (23:29 +0000)]
[PM] keeping history when original SCC split and then merge into itself
in the same round of SCC update.
In https://reviews.llvm.org/rL309784, inline history is added to prevent
infinite inlining across multiple run of inliner and SCC update, but the
history will only be kept when new SCC is actually generated during SCC update.
We found a case that SCC can be split and then merge into itself in the same
round of SCC update, so the same SCC will be pop out from UR.CWorklist and
then added back immediately, without any new SCC generated, that is why the
existing patch cannot catch the infinite inline case.
What the patch does is even if no new SCC is generated, if only the current
SCC appears in UR.CWorklist again, then keep the inline history.
Differential Revision: https://reviews.llvm.org/D52915
llvm-svn: 345103
Matthias Braun [Tue, 23 Oct 2018 23:19:23 +0000 (23:19 +0000)]
SelectionDAG: Reuse bigger sized constants in memset expansion.
When implementing memset's today we often see this pattern:
$x0 = MOV 0xXYXYXYXYXYXYXYXY
store $x0, ...
$w1 = MOV 0xXYXYXYXY
store $w1, ...
We first create a 64bit constant in a 64bit register with all bytes the
same and then create a 32bit constant with all bytes the same in a 32bit
register. In many targets we could just access the lower byte of the
64bit register instead.
- Ideally this would be handled by the ConstantHoist pass but it runs
too early when memset isn't expanded yet.
- The memset expansion code already had this optimization implemented,
however SelectionDAG constantfolding would constantfold the
"trunc(bigconstnat)" pattern to "smallconstant".
- This patch makes the memset expansion mark the constant as Opaque and
stop DAGCombiner from constant folding in this situation. (Similar to
how ConstantHoisting marks things as Opaque to avoid folding
ADD/SUB/etc.)
Differential Revision: https://reviews.llvm.org/D53181
llvm-svn: 345102
George Karpenkov [Tue, 23 Oct 2018 23:12:12 +0000 (23:12 +0000)]
[analyzer] [NFC] Change scanReachableSymbols to use ranges
Remove unused overload. Clean up some usages.
Differential Revision: https://reviews.llvm.org/D53615
llvm-svn: 345101
George Karpenkov [Tue, 23 Oct 2018 23:11:50 +0000 (23:11 +0000)]
[analyzer] Do not stop tracking CXX methods touching OSObject.
Trust generalized annotations for OSObject.
Differential Revision: https://reviews.llvm.org/D53550
llvm-svn: 345100
George Karpenkov [Tue, 23 Oct 2018 23:11:30 +0000 (23:11 +0000)]
[analyzer] Trust summaries for OSObject::retain and OSObject::release
Refactor the way in which summaries are consumed for safeMetaCast
Differential Revision: https://reviews.llvm.org/D53549
llvm-svn: 345099
Lang Hames [Tue, 23 Oct 2018 23:01:39 +0000 (23:01 +0000)]
[ORC] Re-apply r345077 with fixes to remove ambiguity in lookup calls.
llvm-svn: 345098
Teresa Johnson [Tue, 23 Oct 2018 23:00:29 +0000 (23:00 +0000)]
Revert "[ThinLTO] Fix a crash in lazy loading of Metadata"
This reverts commit r345095. It was accidentally committed.
llvm-svn: 345097
Teresa Johnson [Tue, 23 Oct 2018 22:57:40 +0000 (22:57 +0000)]
[hot-cold-split] Only perform splitting in ThinLTO backend post-link
Summary:
Fix the new PM to only perform hot cold splitting once during ThinLTO,
by skipping it in the pre-link phase.
This was already fixed in the old PM by the move of the hot cold split
pass later (after the early return when PrepareForThinLTO) by r344869.
Reviewers: vsk, sebpop, hiraditya
Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D53611
llvm-svn: 345096
Teresa Johnson [Tue, 23 Oct 2018 22:57:21 +0000 (22:57 +0000)]
[ThinLTO] Fix a crash in lazy loading of Metadata
Summary:
This is a revised version of D41474.
When the debug location is parsed in BitcodeReader::parseFunction, the
scope and inlinedAt MDNodes are obtained via MDLoader->getMDNodeFwdRefOrNull(),
which will create a forward ref if they were not yet loaded.
Specifically, if one of these MDNodes is in the module level metadata
block, and this is during ThinLTO importing, that metadata block is
lazily loaded.
Most places in that invoke getMDNodeFwdRefOrNull have a corresponding call
to resolveForwardRefsAndPlaceholders which will take care of resolving them.
E.g. places that call getMetadataFwdRefOrLoad, or at the end of parsing a
function-level metadata block, or at the end of the initial lazy load of
module level metadata in order to handle invocations of getMDNodeFwdRefOrNull
for named metadata and global object attachments. However, the calls for
the scope/inlinedAt of debug locations are not backed by any such call to
resolveForwardRefsAndPlaceholders.
To fix this, change the scope and inlinedAt parsing to instead use
getMetadataFwdRefOrLoad, which will ensure the forward refs to lazily
loaded metadata are resolved.
Fixes PR35472.
Reviewers: dexonsmith, Sunil_Srivastava, vsk
Subscribers: inglorion, eraman, steven_wu, sebpop, mehdi_amini, dmikulin, vsk, hiraditya, llvm-commits
Differential Revision: https://reviews.llvm.org/D53596
llvm-svn: 345095
Rui Ueyama [Tue, 23 Oct 2018 22:37:14 +0000 (22:37 +0000)]
Move forward declarations to the top of the file and sort.
llvm-svn: 345094
Rui Ueyama [Tue, 23 Oct 2018 22:31:08 +0000 (22:31 +0000)]
Move a function out of a class because it doesn't depend on any class member. NFC.
llvm-svn: 345093
Zachary Turner [Tue, 23 Oct 2018 22:15:27 +0000 (22:15 +0000)]
Remove unused private methods.
llvm-svn: 345092
Zachary Turner [Tue, 23 Oct 2018 22:15:05 +0000 (22:15 +0000)]
Fix some comments pointed out by Leonard Mosescu.
These were originally pointed out in D53511 but I forgot
to incorporate them in my patch.
llvm-svn: 345091
Fangrui Song [Tue, 23 Oct 2018 22:07:34 +0000 (22:07 +0000)]
Actually fix test from r345085 REQUIRE: asserts
llvm-svn: 345090
Fangrui Song [Tue, 23 Oct 2018 22:04:33 +0000 (22:04 +0000)]
Fix test after r345085
llvm-svn: 345089
Rui Ueyama [Tue, 23 Oct 2018 22:03:33 +0000 (22:03 +0000)]
Factor out code to a new function. NFC.
llvm-svn: 345088
Craig Topper [Tue, 23 Oct 2018 21:58:49 +0000 (21:58 +0000)]
[X86] Autogenerate comple checks. NFC
llvm-svn: 345087
Eric Christopher [Tue, 23 Oct 2018 21:55:41 +0000 (21:55 +0000)]
Remove unused variable.
llvm-svn: 345086
Zhizhou Yang [Tue, 23 Oct 2018 21:51:56 +0000 (21:51 +0000)]
Print out DebugCounter info with -print-debug-counter
Summary:
This patch will print out {Counter, Skip, StopAfter} info of all passes which have DebugCounter set at destruction.
It can be used to monitor how many times does certain transformation happen in a pass, and also help check if -debug-counter option is set correctly.
Please refer to this [[ http://lists.llvm.org/pipermail/llvm-dev/2018-July/124722.html | thread ]] for motivation.
Reviewers: george.burgess.iv, davide, greened
Reviewed By: greened
Subscribers: kristina, llozano, mgorny, llvm-commits, mgrang
Differential Revision: https://reviews.llvm.org/D50031
llvm-svn: 345085
Jonas Devlieghere [Tue, 23 Oct 2018 21:51:44 +0000 (21:51 +0000)]
[dwarfdump] Make incompatibility between -diff and -verbose explicit.
Using -diff and -verbose together doesn't work today. We should audit
where these two options interact and fix them. In the meantime we error
out when the user try to specify both.
llvm-svn: 345084
Matt Arsenault [Tue, 23 Oct 2018 21:23:52 +0000 (21:23 +0000)]
Fix typo in verifier error message
llvm-svn: 345083
Peter Collingbourne [Tue, 23 Oct 2018 21:23:18 +0000 (21:23 +0000)]
CGP: Clear data structures at the end of a loop iteration instead of the beginning.
Clearing LargeOffsetGEPMap at the end fixes a bug where if a large
offset GEP is in a dead basic block, we fail an assertion when trying
to delete the block due to the asserting VH in LargeOffsetGEPMap.
Differential Revision: https://reviews.llvm.org/D53464
llvm-svn: 345082
Rui Ueyama [Tue, 23 Oct 2018 21:17:00 +0000 (21:17 +0000)]
Simplify. NFC.
A higher order function `applySyntehtic` can be replaced with a simpler function.
llvm-svn: 345081
Rui Ueyama [Tue, 23 Oct 2018 21:00:28 +0000 (21:00 +0000)]
Remove a global variable that is set but not used.
llvm-svn: 345080
Jordan Rupprecht [Tue, 23 Oct 2018 20:54:51 +0000 (20:54 +0000)]
[llvm-objcopy] Fix use-after-move clang-tidy warning
llvm-svn: 345079
Reid Kleckner [Tue, 23 Oct 2018 20:54:43 +0000 (20:54 +0000)]
Revert r345077 "[ORC] Change how non-exported symbols are matched during lookup."
Doesn't build on Windows. The call to 'lookup' is ambiguous. Clang and
MSVC agree, anyway.
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/787
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\unittests\ExecutionEngine\Orc\CoreAPIsTest.cpp(315): error C2668: 'llvm::orc::ExecutionSession::lookup': ambiguous call to overloaded function
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\include\llvm/ExecutionEngine/Orc/Core.h(823): note: could be 'llvm::Expected<llvm::JITEvaluatedSymbol> llvm::orc::ExecutionSession::lookup(llvm::ArrayRef<llvm::orc::JITDylib *>,llvm::orc::SymbolStringPtr)'
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\include\llvm/ExecutionEngine/Orc/Core.h(817): note: or 'llvm::Expected<llvm::JITEvaluatedSymbol> llvm::orc::ExecutionSession::lookup(const llvm::orc::JITDylibSearchList &,llvm::orc::SymbolStringPtr)'
C:\b\slave\clang-x64-windows-msvc\build\llvm.src\unittests\ExecutionEngine\Orc\CoreAPIsTest.cpp(315): note: while trying to match the argument list '(initializer list, llvm::orc::SymbolStringPtr)'
llvm-svn: 345078
Lang Hames [Tue, 23 Oct 2018 20:20:22 +0000 (20:20 +0000)]
[ORC] Change how non-exported symbols are matched during lookup.
In the new scheme the client passes a list of (JITDylib&, bool) pairs, rather
than a list of JITDylibs. For each JITDylib the boolean indicates whether or not
to match against non-exported symbols (true means that they should be found,
false means that they should not). The MatchNonExportedInJD and MatchNonExported
parameters on lookup are removed.
The new scheme is more flexible, and easier to understand.
This patch also updates JITDylib search orders to be lists of (JITDylib&, bool)
pairs to match the new lookup scheme. Error handling is also plumbed through
the LLJIT class to allow regression tests to fail predictably when a lookup from
a lazy call-through fails.
llvm-svn: 345077
Marshall Clow [Tue, 23 Oct 2018 20:07:45 +0000 (20:07 +0000)]
Off-by-one errors strike again. Thank goodness for ASAN and the bots.
llvm-svn: 345076
Erik Pilkington [Tue, 23 Oct 2018 19:55:38 +0000 (19:55 +0000)]
NFC: Remove MANGLE_CHECKER from ItaniumMangle.cpp
This hasn't even compiled since 2011. It would be useful to have some test to
verify that ItaniumMangle and ItaniumDemangle agree, but this isn't it.
llvm-svn: 345075
Michael Kruse [Tue, 23 Oct 2018 19:46:29 +0000 (19:46 +0000)]
[test-suite/doc] Add list of programs we might add.
Add a list of benchmarks, applications and algorithms which are under
discussion to be added to the test-suite.
The initial list includes the the benchmarks mentioned at
https://llvm.org/PR34216, missing SPEC benchmarks, some image processing
algorithms and a few others. The bug tracker only allows adding to the
discussion, not removing, commenting, adding details to individual
benchmarks.
The first proposal was to add these benchmark into the test-suite
repository, but after a discussion, adding it to llvm/docs/Proposals
seem more appropriate. One advantage is that llvm.org will have a
browsable web page with these suggestions.
Suggested-by: Hal Finkel
Differential Revision: https://reviews.llvm.org/D46714
llvm-svn: 345074
Aaron Ballman [Tue, 23 Oct 2018 19:44:51 +0000 (19:44 +0000)]
Change getRedeclContext() to support enumerations as another kind of transparent context in C.
This change fixes PR15071 and ensures that enumerators redefined in a struct cannot conflict with enumerators defined outside of the struct.
llvm-svn: 345073
Vedant Kumar [Tue, 23 Oct 2018 19:41:12 +0000 (19:41 +0000)]
[HotColdSplitting] Attach MinSize to outlined code
Outlined code is cold by assumption, so it makes sense to optimize it
for minimal code size rather than performance.
After r344869 moved the splitting pass to the end of the IR pipeline,
this does not result in much of a code size reduction. This is probably
because a comparatively small number backend transforms make use of the
MinSize hint.
Running LNT on x86_64, I see that 33/1020 binaries shrink for a total of
919 bytes of TEXT reduction. I didn't measure a significant performance
impact.
Differential Revision: https://reviews.llvm.org/D53518
llvm-svn: 345072
Adrian Prantl [Tue, 23 Oct 2018 19:39:02 +0000 (19:39 +0000)]
Fix doxygen comment.
llvm-svn: 345071
Simon Pilgrim [Tue, 23 Oct 2018 19:07:53 +0000 (19:07 +0000)]
[X86][SSE] Revert rL343922 combinePMULDQ AddToWorklist (PR39398)
We can't add the MULDQ node back to the worklist after the demanded bits change has been committed in case the node has been removed entirely. This will have to wait until we have SimplifyDemandedBitsForTargetNode.
llvm-svn: 345070
Jason Molenda [Tue, 23 Oct 2018 19:03:52 +0000 (19:03 +0000)]
Add UdtRecordCompleter.cpp.
llvm-svn: 345069
Jordan Rupprecht [Tue, 23 Oct 2018 18:46:33 +0000 (18:46 +0000)]
[llvm-strip] Support -s alias for --strip-all. Make both strip and objcopy case sensitive to support both -s (--strip-all) and -S (--strip-debug).
Summary:
GNU strip supports both `-s` and `-S` as aliases for `--strip-all` and `--strip-debug`, respectfully.
As part of this, it turns out that strip/objcopy were accepting case insensitive command line args. I'm not sure if there was an explicit reason for this. The only others uses of this are llvm-cvtres/llvm-mt/llvm-lib, which are all tools specific for windows support. Forcing case sensitivity allows both aliases to exist, but seems like a good idea anyway.
And as a surprise test case adjustment, the llvm-strip unit test was running with `-keep=unavailable_symbol`, despite `keep` not be a valid flag for strip. This is because there is a flag `-K` which, when case insensitivity is permitted, allows it to be interpreted as `-K` = `eep=unavailable_symbol` (e.g. to allow `-Kfoo` == `--keep-symbol=foo`).
Reviewers: jakehehrlich, jhenderson, alexshap
Reviewed By: jakehehrlich
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D53163
llvm-svn: 345068
Marshall Clow [Tue, 23 Oct 2018 18:38:15 +0000 (18:38 +0000)]
When filling a vector<bool> with stuff, initialize the last word of the storage that you're touching. Otherwise, when we lay down the bits with operator&=, we get UB from reading uninitialized memory. Fixes Bug 39354. Thanks to David Wagner for the bug report.
llvm-svn: 345067
Simon Pilgrim [Tue, 23 Oct 2018 18:28:24 +0000 (18:28 +0000)]
[LegalizeDAG] Share Vector/Scalar CTPOP Expansion
As suggested on D53258, this patch move the CTPOP expansion code from SelectionDAGLegalize to TargetLowering to allow it to be reused by the VectorLegalizer.
Proper vector support will be added by D53258.
llvm-svn: 345066
Roman Lebedev [Tue, 23 Oct 2018 18:27:10 +0000 (18:27 +0000)]
X86DAGToDAGISel::matchBitExtract(): lambdas can't have default arguments.
As reported by ctopper.
That is a gcc-only warning at the moment.
llvm-svn: 345065
George Karpenkov [Tue, 23 Oct 2018 18:24:53 +0000 (18:24 +0000)]
[analyzer] Rename trackNullOrUndefValue to trackExpressionValue
trackNullOrUndefValue is a long and confusing name,
and it does not actually reflect what the function is doing.
Give a function a new name, with a relatively clear semantics.
Also remove some dead code.
Differential Revision: https://reviews.llvm.org/D52758
llvm-svn: 345064
Leonard Chan [Tue, 23 Oct 2018 17:55:35 +0000 (17:55 +0000)]
[Fixed Point Arithmetic] Fixed Point to Boolean Cast
This patch is a part of https://reviews.llvm.org/D48456 in an attempt to split
the casting logic up into smaller patches. This contains the code for casting
from fixed point types to boolean types.
Differential Revision: https://reviews.llvm.org/D53308
llvm-svn: 345063
Rui Ueyama [Tue, 23 Oct 2018 17:52:44 +0000 (17:52 +0000)]
Add a comment.
llvm-svn: 345062
Jonas Devlieghere [Tue, 23 Oct 2018 17:49:51 +0000 (17:49 +0000)]
Skip test with older versions of clang
This was failing for the bots that build with older clangs:
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-clang-5.0.2/
http://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake-clang-6.0.1/
llvm-svn: 345061
Simon Pilgrim [Tue, 23 Oct 2018 17:48:30 +0000 (17:48 +0000)]
[LegalizeDAG] Share Vector/Scalar CTLZ Expansion
As suggested on D53258, this patch shares common CTLZ expansion code between VectorLegalizer and SelectionDAGLegalize by putting it in TargetLowering.
Extension to D53474
llvm-svn: 345060
Daniel Sanders [Tue, 23 Oct 2018 17:41:39 +0000 (17:41 +0000)]
Fix MSVC build by correcting placement of declspec after r345056
Going by the MSVC toolchains at godbolt.org, declspec comes after the template<...>.
llvm-svn: 345059
Rui Ueyama [Tue, 23 Oct 2018 17:39:43 +0000 (17:39 +0000)]
Remove a global variable that we can live without.
Out::DebugInfo was used only by GdbIndex class to determine if
we need to create a .gdb_index section, but we can do the same
check without it.
Added a test that this patch doesn't change the existing behavior.
llvm-svn: 345058
Fangrui Song [Tue, 23 Oct 2018 17:24:15 +0000 (17:24 +0000)]
[IR] Fix -Wunused-function after r345052
llvm-svn: 345057
Daniel Sanders [Tue, 23 Oct 2018 17:23:31 +0000 (17:23 +0000)]
[tblgen] Allow FixedLenDecoderEmitter to use APInt-like objects as InsnType
Summary:
Some targets have very long encodings and uint64_t isn't sufficient. uint128_t
isn't portable so such targets need to use an object instead.
There is one catch with this at the moment, no string of bits extracted
from the encoding may exceeed 64-bits. Fields are still permitted to
exceed 64-bits so long as they aren't one contiguous string of bits. If
this proves to be a problem then we can modify the generation of
fieldFromInstruction() calls to account for it but for now I've added an
assertion for this.
InsnType must either be integral or an APInt-like object that must:
* Have a static const max_size_in_bits equal to the number of bits in the encoding.
* be default-constructible and copy-constructible
* be constructible from a uint64_t (this is the key area the interface deviates
from APInt since this constructor does not take the bit width)
* be constructible from an APInt (this can be private)
* be convertible to uint64_t
* Support the ~, &,, ==, !=, and |= operators with other objects of the same type
* Support shift (<<, >>) with signed and unsigned integers on the RHS
* Support put (<<) to raw_ostream&
Reviewers: bogner, charukcs
Subscribers: nhaehnle, llvm-commits
Differential Revision: https://reviews.llvm.org/D52100
llvm-svn: 345056
Zachary Turner [Tue, 23 Oct 2018 17:22:02 +0000 (17:22 +0000)]
Change two methods from const char* to StringRef [NFC].
llvm-svn: 345055
Reid Kleckner [Tue, 23 Oct 2018 17:20:16 +0000 (17:20 +0000)]
[PDB] Fix -Wunused-private-field in DIA
llvm-svn: 345054
Stefan Pintilie [Tue, 23 Oct 2018 17:11:36 +0000 (17:11 +0000)]
[Power9] Add __float128 support in the backend for bitcast to a i128
Add support to allow bit-casting from f128 to i128 and then
extracting 64 bits from the result.
Differential Revision: https://reviews.llvm.org/D49507
llvm-svn: 345053
Sanjay Patel [Tue, 23 Oct 2018 17:06:03 +0000 (17:06 +0000)]
[IR] remove fake binop queries for not/neg
The initial motivation is that we want to remove the
fneg API because that would silently fail if we add
an actual fneg instruction to IR. The same would be
true for the integer ops, so we might as well get rid
of these too.
We have a newer 'match' API that makes checking for
these patterns simpler. It also works with vectors
that may include undef elements in constants.
If any out-of-tree users need updating, they can model
their code changes on these commits:
rL345050
rL345043
rL345042
rL345041
rL345036
rL345030
llvm-svn: 345052
Andrew Savonichev [Tue, 23 Oct 2018 17:05:29 +0000 (17:05 +0000)]
[OpenCL] Remove PIPE_RESERVE_ID_VALID_BIT from opencl-c.h
Summary:
PIPE_RESERVE_ID_VALID_BIT is implementation defined, so lets not keep it in the header.
Previously the topic was discussed here: https://reviews.llvm.org/D32896
Reviewers: Anastasia, yaxunl
Reviewed By: Anastasia
Subscribers: cfe-commits, asavonic, bader
Differential Revision: https://reviews.llvm.org/D52658
llvm-svn: 345051
Sanjay Patel [Tue, 23 Oct 2018 16:54:28 +0000 (16:54 +0000)]
[InstCombine] use 'match' to simplify code
There's probably some vector-with-undef-element pattern
that shows an improvement, so this is probably not quite
'NFC'.
This is the last step towards removing the fake binop
queries for not/neg. Ie, there are no more uses of those
functions in trunk. Fneg should follow.
llvm-svn: 345050
Alexander Kornienko [Tue, 23 Oct 2018 16:48:16 +0000 (16:48 +0000)]
[clang-tidy] Add a separate section for NOLINT(NEXTLINE)? doc.
llvm-svn: 345049
Simon Pilgrim [Tue, 23 Oct 2018 16:45:26 +0000 (16:45 +0000)]
[TTI][X86] Treat SK_Transpose shuffles as SK_PermuteTwoSrc - there's no difference in lowering.
llvm-svn: 345048
Zachary Turner [Tue, 23 Oct 2018 16:37:53 +0000 (16:37 +0000)]
[NativePDB] Add basic support for tag types to the native pdb plugin.
This adds support to LLDB for named types (class, struct, union, and
enum). This is true cross platform support, and hits the PDB file
directly without a dependency on Windows. Tests are added which
compile a program with certain interesting types and then use
load the target in LLDB and use "type lookup -- <TypeName>" to
dump the layout of the type in LLDB without a running process.
Currently only fields are parsed -- we do not parse methods. Also
we don't deal with bitfields or virtual bases correctly. Those
will make good followups.
Differential Revision: https://reviews.llvm.org/D53511
llvm-svn: 345047
Jordan Rupprecht [Tue, 23 Oct 2018 16:35:51 +0000 (16:35 +0000)]
[DebugInfo][GlobalOpt] Fix -debugify for globalopt shrinking globals to booleans.
Summary:
TryToShrinkGlobalToBoolean, when possible, will split store <value> + load <value> into store <bool> + select <bool ? value : 0>. This preserves DebugLoc during that pass.
Fixes PR37959. The test case here is the simplified .ll for:
```
static int foo;
int bar() {
foo = 5;
return foo;
}
```
Reviewers: dblaikie, gbedwell, aprantl
Reviewed By: dblaikie
Subscribers: mehdi_amini, JDevlieghere, dexonsmith, llvm-commits
Tags: #debug-info
Differential Revision: https://reviews.llvm.org/D53531
llvm-svn: 345046
Simon Pilgrim [Tue, 23 Oct 2018 16:27:14 +0000 (16:27 +0000)]
[CostModel][X86] Add transpose shuffle cost tests
llvm-svn: 345045
Andrew Savonichev [Tue, 23 Oct 2018 16:13:16 +0000 (16:13 +0000)]
[OpenCL] Add cl_intel_planar_yuv extension
Just adding a preprocessor #define for the extension.
Patch by Alexey Sotkin and Dmitry Sidorov
Phabricator review: https://reviews.llvm.org/D51402
llvm-svn: 345044
Sanjay Patel [Tue, 23 Oct 2018 16:05:09 +0000 (16:05 +0000)]
[WebAssembly] use 'match' to simplify code; NFC
Vector types are not possible here because this code explicitly
checks for a scalar type, but this is another step towards
completely removing the fake binop queries for not/neg/fneg.
llvm-svn: 345043
Sanjay Patel [Tue, 23 Oct 2018 15:55:06 +0000 (15:55 +0000)]
[Reassociate] replace fake binop queries with 'match' API
We need to update this code before introducing an 'fneg' instruction in IR,
so we might as well kill off the integer neg/not queries too.
This is no-functional-change-intended for scalar code and most vector code.
For vectors, we can see that the 'match' API allows for undef elements in
constants, so we optimize those cases better.
Ideally, there would be a test for each code diff, but I don't see evidence
of that for the existing code, so I didn't try very hard to come up with new
vector tests for each code change.
Differential Revision: https://reviews.llvm.org/D53533
llvm-svn: 345042
Sanjay Patel [Tue, 23 Oct 2018 15:46:10 +0000 (15:46 +0000)]
[SelectionDAG] use 'match' to simplify code; NFC
Vector types are not possible here because this code only starts
matching from the scalar bool value of a conditional branch, but
this is another step towards completely removing the fake binop
queries for not/neg/fneg.
llvm-svn: 345041
Benjamin Kramer [Tue, 23 Oct 2018 15:43:36 +0000 (15:43 +0000)]
[LegalizeDAG] Remove unused variable
llvm-svn: 345040
Simon Pilgrim [Tue, 23 Oct 2018 15:37:19 +0000 (15:37 +0000)]
[LegalizeDAG] Share Vector/Scalar CTTZ Expansion
As suggested on D53258, this patch demonstrates sharing common CTTZ expansion code between VectorLegalizer and SelectionDAGLegalize by putting it in TargetLowering.
I intend to move CTLZ and (scalar) CTPOP over as well and then update D53258 accordingly.
Differential Revision: https://reviews.llvm.org/D53474
llvm-svn: 345039
Andrew Savonichev [Tue, 23 Oct 2018 15:19:20 +0000 (15:19 +0000)]
[OpenCL][NFC] Unify ZeroToOCL* cast types
Reviewers: Anastasia, yaxunl
Reviewed By: Anastasia
Subscribers: asavonic, cfe-commits
Differential Revision: https://reviews.llvm.org/D52654
llvm-svn: 345038
Simon Pilgrim [Tue, 23 Oct 2018 15:13:09 +0000 (15:13 +0000)]
[SLPVectorizer] Add basic support for mul/and/or/xor horizontal reductions
Expand arithmetic reduction to include mul/and/or/xor instructions.
This patch just fixes the SLPVectorizer - the effective reduction costs for AVX1+ are still poor (see rL344846) and will need to be improved before SLP sees this as a valid transform - but we can already see the effect on SSE2 tests.
This partially helps PR37731, but doesn't fix it all as it still falls over on the extraction/reduction order for some reason.
Differential Revision: https://reviews.llvm.org/D53473
llvm-svn: 345037
Sanjay Patel [Tue, 23 Oct 2018 15:05:12 +0000 (15:05 +0000)]
[InstCombine] use 'match' to handle vectors and simplify code
This is another step towards completely removing the fake
binop queries for not/neg/fneg.
llvm-svn: 345036
Samuel Benzaquen [Tue, 23 Oct 2018 14:49:27 +0000 (14:49 +0000)]
Add benchmark for std::set.
Summary:
Benchmarks for construct, find, insert and iterate, with sequential
and random ordered inputs.
It also improves the cartesian product benchmark header to allow for
runtime values to be specified in the product.
Reviewers: EricWF
Subscribers: christof, ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D53523
llvm-svn: 345035
Sanjay Patel [Tue, 23 Oct 2018 14:43:31 +0000 (14:43 +0000)]
[InstCombine] swap select profile metadata when swapping select ops
llvm-svn: 345034
Sanjay Patel [Tue, 23 Oct 2018 14:37:29 +0000 (14:37 +0000)]
[InstCombine] add/move tests for select with inverted condition; NFC
The transform is broken in 2 ways - it doesn't correct metadata (or even drop it),
and it doesn't work with vectors with undef elements.
llvm-svn: 345033
Aleksandr Urakov [Tue, 23 Oct 2018 14:27:45 +0000 (14:27 +0000)]
Revert "[MachinePipeliner] Split MachinePipeliner code into header and cpp files"
This reverts commit
40760b733d9eef841c897338af5e9d81b12551bf.
It seems that the commit is a cuse of the build failure.
llvm-svn: 345032
Sam McCall [Tue, 23 Oct 2018 14:19:54 +0000 (14:19 +0000)]
[clangd] Lazily create CDB, remove setCompileCommandsDir.
Summary:
The only way to actually set the directory is at initialize time,
so now CDB is lazy we can pass it to the constructor.
Reviewers: hokein
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53572
llvm-svn: 345031
Sanjay Patel [Tue, 23 Oct 2018 14:07:39 +0000 (14:07 +0000)]
[SLSR] use 'match' to simplify code; NFC
This pass could probably be modified slightly to allow
vector splat transforms for practically no cost, but
it only works on scalars for now. So the use of the
newer 'match' API should make no functional difference.
llvm-svn: 345030
Kadir Cetinkaya [Tue, 23 Oct 2018 13:49:37 +0000 (13:49 +0000)]
[clang] Fix a null pointer dereference.
Summary:
Sometimes expression inside switch statement can be invalid, for
example type might be incomplete. In those cases code were causing a null
pointer dereference. This patch fixes that.
Reviewers: sammccall, ioeric, hokein
Reviewed By: sammccall
Subscribers: arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D53561
llvm-svn: 345029
Sanjay Patel [Tue, 23 Oct 2018 13:39:40 +0000 (13:39 +0000)]
[SLSR] auto-generate full test assertions; NFC
llvm-svn: 345028
Roman Lebedev [Tue, 23 Oct 2018 13:19:31 +0000 (13:19 +0000)]
Experimental re-land of [X86][BMI1] X86DAGToDAGISel: select BEXTR from x << (32 - y) >> (32 - y) pattern
This initially landed in rL345014, but was reverted in rL345017
due to sanitizer-x86_64-linux-fast buildbot failure in
check-lld (ELF/relocatable-versioned.s) test.
While i'm not yet quite sure what is the problem, one obvious
thing here is that extra truncation roundtrip.
Maybe that's it? If not, will re-revert.
Differential Revision: https://reviews.llvm.org/D53521
llvm-svn: 345027
Hans Wennborg [Tue, 23 Oct 2018 13:17:13 +0000 (13:17 +0000)]
Revert r345009 "[DebugInfo] Generate debug information for labels. (After fix PR39094)"
This broke the Chromium build. See
https://bugs.chromium.org/p/chromium/issues/detail?id=898152#c1 for the
reproducer.
> Generate DILabel metadata and call llvm.dbg.label after label
> statement to associate the metadata with the label.
>
> After fixing PR37395.
> After fixing problems in LiveDebugVariables.
> After fixing NULL symbol problems in AddressPool when enabling
> split-dwarf-file.
> After fixing PR39094.
>
> Differential Revision: https://reviews.llvm.org/D45045
llvm-svn: 345026
Simon Pilgrim [Tue, 23 Oct 2018 13:14:54 +0000 (13:14 +0000)]
Add BROADCAST shuffle cost tests.
Part of a lot of cleanup necessary before PR39368.
llvm-svn: 345025
Sam McCall [Tue, 23 Oct 2018 13:14:02 +0000 (13:14 +0000)]
[clangd] Remove caching of compilation database commands.
Summary:
The CDB implementations used in open-source code are fast, and our private
slow CDB will soon do the relevant caching itself.
Simplifying the GlobalCDB layer in clangd is important to get auto-index
implemented at the right layer.
Reviewers: ioeric, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53439
llvm-svn: 345024
Simon Pilgrim [Tue, 23 Oct 2018 13:00:22 +0000 (13:00 +0000)]
Add BROADCAST shuffle cost tests.
Part of a lot of cleanup necessary before PR39368.
llvm-svn: 345023
Sam McCall [Tue, 23 Oct 2018 11:54:36 +0000 (11:54 +0000)]
[clangd] Support passing a relative path to -compile-commands-dir
Summary: This is useful when using clangd with CMake based projects in Visual Studio Code since when using CMake the `compile_commands.json` file is usually located in a `build` subdirectory which isn't a parent directory of the source files. Allowing passing relative paths to -compile-commands-dir allows specifying `clangd.arguments = ["-compile-commands-dir=build"]` in VSCode's settings file and having it work for each CMake based project that uses the `build` subdirectory as the build directory (instead of having to specify the absolute path to the compile commands directory for each separate project in VSCode's settings).
Patch by Daan De Meyer!
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D53481
llvm-svn: 345022