Alex Lorenz [Thu, 26 Sep 2019 19:28:51 +0000 (19:28 +0000)]
[clang-scan-deps] Allow continuation line backslashes followed by whitespace
in the dependency source minimizer
Clang allows continuations that have whitespace between the backslash and the newline.
This patch ensures that the dependency source minimizer can handle the whitespace between
the backslash and the newline when looking for a line continuation.
Differential Revision: https://reviews.llvm.org/D68052
llvm-svn: 373007
David Bolvansky [Thu, 26 Sep 2019 19:01:18 +0000 (19:01 +0000)]
[NFC] Precommit tests for D68089
llvm-svn: 373006
Artem Dergachev [Thu, 26 Sep 2019 18:52:00 +0000 (18:52 +0000)]
Revert "[analyzer] A speculative attempt to avoid gcc-7 crashes..."
This reverts commit r372940 which was an overreaction to a flaky buildbot.
llvm-svn: 373005
Reid Kleckner [Thu, 26 Sep 2019 18:13:19 +0000 (18:13 +0000)]
Only pass -coverage-notes-file when emitting coverage
The only functional change here is that -coverage-notes-file is not
passed to -cc1 in some situations.
This code appears to be trying to put the gcno and gcda output next to
the final object file, but it's doing that in a really convoluted way
that needs to be re-examined. It looks for -c or -S in the original
command, and then looks at the -o argument if present in order to handle
the -fno-integrated-as case. However, this doesn't work if this is a
link command with multiple inputs. I looked into fixing this, but the
check-profile test suite has a lot of dependencies on this behavior, so
I left it all alone.
llvm-svn: 373004
Lawrence D'Anna [Thu, 26 Sep 2019 17:54:59 +0000 (17:54 +0000)]
Convert FileSystem::Open() to return Expected<FileUP>
Summary:
This patch converts FileSystem::Open from this prototype:
Status
Open(File &File, const FileSpec &file_spec, ...);
to this one:
llvm::Expected<std::unique_ptr<File>>
Open(const FileSpec &file_spec, ...);
This is beneficial on its own, as llvm::Expected is a more modern
and recommended error type than Status. It is also a necessary step
towards https://reviews.llvm.org/D67891, and further developments
for lldb_private::File.
Reviewers: JDevlieghere, jasonmolenda, labath
Reviewed By: labath
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D67996
llvm-svn: 373003
Kevin P. Neal [Thu, 26 Sep 2019 17:50:25 +0000 (17:50 +0000)]
Document requirement of function attributes with constrained floating
point.
Reviewed by: andrew.w.kaylor, uweigand, efriedma
Approved by: andrew.w.kaylor
Differential Revision: https://reviews.llvm.org/D67839
llvm-svn: 373002
Simon Pilgrim [Thu, 26 Sep 2019 17:38:47 +0000 (17:38 +0000)]
DAGISelMatcherOpt - TGParser::ParseOperation - silence static analyzer cast_or_null<CheckTypeMatcher> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, replace with an null/isa assertion and cast<CheckTypeMatcher>.
llvm-svn: 373001
Craig Topper [Thu, 26 Sep 2019 17:20:50 +0000 (17:20 +0000)]
[InstCombine] Use m_Zero instead of isNullValue() when checking if a GEP index is all zeroes to prevent an infinite loop.
The test case here previously infinite looped. Only one element from the GEP is used so SimplifyDemandedVectorElts would replace the other lanes in each index with undef leading to the first index being <0, undef, undef, undef>. But there's a GEP transform that tries to replace an index into a 0 sized type with a zero index. But the zero index check only works on ConstantInt 0 or ConstantAggregateZero so it would turn the index back to zeroinitializer. Resulting in a loop.
The fix is to use m_Zero() to allow a vector of zeroes and undefs.
Differential Revision: https://reviews.llvm.org/D67977
llvm-svn: 373000
Reid Kleckner [Thu, 26 Sep 2019 17:19:22 +0000 (17:19 +0000)]
Move normalization of `\` in #includes from -fms-compatibility to -fms-extensions
Handling backslashes in include paths in the implementation isn't
non-conforming.
llvm-svn: 372999
Pavel Labath [Thu, 26 Sep 2019 17:15:18 +0000 (17:15 +0000)]
SystemInitializer: Define macros for experimental targets too
llvm-svn: 372998
Simon Pilgrim [Thu, 26 Sep 2019 17:11:02 +0000 (17:11 +0000)]
TGParser::ParseOperation - silence static analyzer dyn_cast<TypedInit> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<TypedInit> directly and if not assert will fire for us.
I've also pulled out the repeated getType() call which was the only user of the pointer.
llvm-svn: 372997
Fangrui Song [Thu, 26 Sep 2019 17:10:09 +0000 (17:10 +0000)]
[ELF] Set SectionBase::partition in processSectionCommands
Fixes PR43461 (regression caused by D67504)
The partition field of a SECTIONS-specified section is not set after
D67504. The 0 value affects findSection() which checks if the partition
field is 1.
So `Out::initArray = findSection(".init_array")` is null, and
DT_INIT_ARRAYSZ is not set.
Reviewed By: peter.smith
Differential Revision: https://reviews.llvm.org/D68087
llvm-svn: 372996
Matt Davis [Thu, 26 Sep 2019 17:03:20 +0000 (17:03 +0000)]
[lld][mach-o] Avoid segfaulting when handling an empty section list.
Summary:
The following patch avoids segfaulting if the section list is empty when writing a mach-o MH_OBJECT. I ran into this case from a more complicated example trying to dead_strip while using '-r' in lld.
I'm not sure if having empty sections is a legal mach-o, but it does seem that other llvm-binutils tools can ingest such a boring object with out issue. Would it be better to emit an error, emit a warning, or do nothing? It seems that adding a warning diagnostic might be helpful to users, as I did not expect to have a section-less object when the linker was done.
Reviewers: kledzik, ruiu
Subscribers: llvm-commits, jrm
Tags: #lld, #llvm
Differential Revision: https://reviews.llvm.org/D67735
llvm-svn: 372995
Reid Kleckner [Thu, 26 Sep 2019 16:56:25 +0000 (16:56 +0000)]
Un-XFAIL coverage_no_integrated_as.c test on Windows
You can't use -fno-integrated-as for *-msvc triples because no usable
standalone assembler exists. Perhaps we could teach clang to emit a .s
and then reinvoke itself, but that's a bit silly.
Anyway, fix the test by using an Itanium ABI triple, which will become
mingw, which will assume gnu as is a usable assembler.
llvm-svn: 372994
Simon Pilgrim [Thu, 26 Sep 2019 16:30:36 +0000 (16:30 +0000)]
ConstantFold - silence static analyzer dyn_cast<ExtractValueInst> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<ExtractValueInst> directly and if not assert will fire for us.
llvm-svn: 372993
Simon Pilgrim [Thu, 26 Sep 2019 16:05:55 +0000 (16:05 +0000)]
ARMBaseInstrInfo getOperandLatency - silence static analyzer dyn_cast<> null dereference warnings. NFCI.
The static analyzer is warning about potential null dereferences, but we should be able to use cast<> directly and if not assert will fire for us.
llvm-svn: 372992
Jinsong Ji [Thu, 26 Sep 2019 15:49:11 +0000 (15:49 +0000)]
[PowerPC] Fix typo in rL372985
llvm-svn: 372991
Wei Mi [Thu, 26 Sep 2019 15:36:25 +0000 (15:36 +0000)]
[LoopInfo] Limit the iterations to check whether a loop has dedicated exits
for extreme large case.
We had a case that a single loop which has 4000 exits and the average number
of predecessors of each exit is > 1000, and we found compiling the case spent
a significant amount of time on checking whether a loop has dedicated exits.
This patch adds a limit for the iterations to the check. With the patch, the
time to compile our testcase reduced from 1000s to 200s (clang release build).
Differential Revision: https://reviews.llvm.org/D67359
llvm-svn: 372990
Jakub Kuderski [Thu, 26 Sep 2019 15:20:17 +0000 (15:20 +0000)]
Handle successor's PHI node correctly when flattening CFG merges two if-regions
Summary:
FlattenCFG merges two 'if' basicblocks by inserting one basicblock
to another basicblock. The inserted basicblock can have a successor
that contains a PHI node whoes incoming basicblock is the inserted
basicblock. Since the existing code does not handle it, it becomes
a badref.
if (cond1)
statement
if (cond2)
statement
successor - contains PHI node whose predecessor is cond2
-->
if (cond1 || cond2)
statement
(BB for cond2 was deleted)
successor - contains PHI node whose predecessor is cond2 --> bad ref!
Author: Jaebaek Seo
Reviewers: asbirlea, kuhar, tstellar, chandlerc, davide, dexonsmith
Reviewed By: kuhar
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68032
llvm-svn: 372989
Matt Arsenault [Thu, 26 Sep 2019 15:20:16 +0000 (15:20 +0000)]
Fix typo
llvm-svn: 372988
Guillaume Chatelet [Thu, 26 Sep 2019 15:13:05 +0000 (15:13 +0000)]
[NFC] Rearrange Value::getPointerAlignment
Reviewers: courbet
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67918
llvm-svn: 372987
Sean Fertile [Thu, 26 Sep 2019 15:12:30 +0000 (15:12 +0000)]
Updated comments in LWZtoc pseudo expansion.
Refined a couple of the comments in the LWZtoc expansion code based on
a post commit review comment.
llvm-svn: 372986
Jinsong Ji [Thu, 26 Sep 2019 15:11:33 +0000 (15:11 +0000)]
[PowerPC] Add missing pattern for VSX Scalar Negative Multiply-Subtract Single Precision
Summary:
This was found during review of https://reviews.llvm.org/D66050.
In the simple test of fdiv, we miss to fold
```
fneg 2, 2
xsmaddasp 3, 2, 0
```
to
```
xsnmsubasp 3, 2, 0
```
We have the patterns for Double Precision and vectors, just missing
Single Precision, the patch add that.
Reviewers: #powerpc, hfinkel, nemanjai, steven.zhang
Reviewed By: #powerpc, steven.zhang
Subscribers: wuzish, hiraditya, kbarton, MaskRay, shchenz, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67595
llvm-svn: 372985
Hans Wennborg [Thu, 26 Sep 2019 14:57:55 +0000 (14:57 +0000)]
build_llvm_package.bat: Bootstrap with VS 2019
llvm-svn: 372984
Louis Dionne [Thu, 26 Sep 2019 14:51:10 +0000 (14:51 +0000)]
[libc++] Take 2: Implement LWG 2510
Summary:
LWG2510 makes tag types like allocator_arg_t explicitly default
constructible instead of implicitly default constructible. It also
makes the constructors for std::pair and std::tuple conditionally
explicit based on the explicit-ness of the default constructibility
for the pair/tuple's elements.
This was previously committed as r372777 and reverted in r372832 due to
the commit breaking LLVM's build in C++14 mode. This issue has now been
addressed.
Reviewers: mclow.lists
Subscribers: christof, jkorous, dexonsmith, libcxx-commits
Tags: #libc
Differential Revision: https://reviews.llvm.org/D65161
llvm-svn: 372983
Haojian Wu [Thu, 26 Sep 2019 14:11:23 +0000 (14:11 +0000)]
[clangd] Bump vscode-clangd v0.0.18
CHANGELOG:
- enable semantic highlighting by default
- upgrade the LSP dependencies to pickup the incoming LSP v3.15.0
llvm-svn: 372981
Haojian Wu [Thu, 26 Sep 2019 14:04:52 +0000 (14:04 +0000)]
[clangd][vscode] Add npm helper commands to package/release the extension.
Summary: Help to fix https://github.com/clangd/clangd/issues/159.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68080
llvm-svn: 372980
Dmitri Gribenko [Thu, 26 Sep 2019 13:55:01 +0000 (13:55 +0000)]
Return results by value from ClangTidyCheckFactories::createChecks
llvm-svn: 372979
Dmitri Gribenko [Thu, 26 Sep 2019 13:47:29 +0000 (13:47 +0000)]
Use std::unique_ptr in ClangTidyCheckFactories
I had to explicitly define some destructors that could only be defined
in the corresponding .cpp files.
llvm-svn: 372978
Simon Pilgrim [Thu, 26 Sep 2019 13:33:15 +0000 (13:33 +0000)]
[FlattenCFG] Silence static analyzer dyn_cast<BranchInst> null dereference warnings. NFCI.
The static analyzer is warning about a potential null dereferences, but we should be able to use cast<BranchInst> directly and if not assert will fire for us.
llvm-svn: 372977
Jan Kratochvil [Thu, 26 Sep 2019 13:31:59 +0000 (13:31 +0000)]
[lldb] Code cleanup: Simplify SBCommandReturnObject
A simplification for D67589. m_opaque_up can never be nullptr (unless one calls
a ctor with nullptr or one uses SetLLDBObjectPtr with nullptr).
Also protected SetLLDBObjectPtr is not used anywhere (I haven't found it would
ever be used).
Differential revision: https://reviews.llvm.org/D68083
llvm-svn: 372976
Sven van Haastregt [Thu, 26 Sep 2019 13:31:36 +0000 (13:31 +0000)]
[OpenCL] Add -Wconversion to fdeclare-opencl-builtins test
Add the -Wconversion -Werror options to check no unexpected conversion
is done.
Patch by Pierre Gondois and Sven van Haastregt.
Differential Revision: https://reviews.llvm.org/D67714
llvm-svn: 372975
Raphael Isemann [Thu, 26 Sep 2019 12:33:48 +0000 (12:33 +0000)]
[lldb][modern-type-lookup] Fix crash when activating modern-type-lookup on Linux
There is no ClangModulesDeclVendor on Linux so that cast is triggering an assert.
Let's just remove it as it just casts the type to itself.
llvm-svn: 372974
Owen Reynolds [Thu, 26 Sep 2019 12:32:11 +0000 (12:32 +0000)]
[llvm-ar][test] Move MRI tests from "llvm/test/Object/"
llvm/test/Object/ contains tests for the ArchiveWriter library, however
support for MRI scripts is found in llvm-ar and not the library. This
diff moves the MRI related tests and removes those that are duplicates.
Differential Revision: https://reviews.llvm.org/D68038
llvm-svn: 372973
Bjorn Pettersson [Thu, 26 Sep 2019 12:16:01 +0000 (12:16 +0000)]
[InstCombine] Don't assume CmpInst has been visited in getFlippedStrictnessPredicateAndConstant
Summary:
Removing an assumption (assert) that the CmpInst already has been
simplified in getFlippedStrictnessPredicateAndConstant. Solution is
to simply bail out instead of hitting the assertion. Instead we
assume that any profitable rewrite will happen in the next iteration
of InstCombine.
The reason why we can't assume that the CmpInst already has been
simplified is that the worklist does not guarantee such an ordering.
Solves https://bugs.llvm.org/show_bug.cgi?id=43376
Reviewers: spatel, lebedev.ri
Reviewed By: lebedev.ri
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68022
llvm-svn: 372972
Raphael Isemann [Thu, 26 Sep 2019 11:48:45 +0000 (11:48 +0000)]
[lldb][www] Update bot links
llvm-svn: 372971
Haojian Wu [Thu, 26 Sep 2019 11:35:34 +0000 (11:35 +0000)]
[clangd][vscode] Update vscode lsp dependencies to pickup the new changes in LSP v3.15.0.
Summary: This would enable the newly-added semantic selection feature in vscode.
Reviewers: usaxena95
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67964
llvm-svn: 372970
Haojian Wu [Thu, 26 Sep 2019 11:34:11 +0000 (11:34 +0000)]
[clangd][vscode] Turn on the semantic highlighting by default.
Summary:
We have turned on the flag manually and used it for a while, and don't see any
major issues, let's enable it by default.
Reviewers: ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68077
llvm-svn: 372969
Clement Courbet [Thu, 26 Sep 2019 11:32:44 +0000 (11:32 +0000)]
[llvm-exegesis][NFC] Remove dead code.
Summary: `hasAliasingImplicitRegistersThrough()` is no longer used.
Reviewers: gchatelet
Subscribers: tschuett, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68078
llvm-svn: 372968
David Zarzycki [Thu, 26 Sep 2019 11:32:02 +0000 (11:32 +0000)]
[Testing] unbreak after r372963
llvm-svn: 372967
Simon Pilgrim [Thu, 26 Sep 2019 11:30:47 +0000 (11:30 +0000)]
MetadataLoader lazyLoadOneMetadata - silence static analyzer dyn_cast<MDNode> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<MDNode> directly and if not assert will fire for us.
llvm-svn: 372966
Raphael Isemann [Thu, 26 Sep 2019 11:30:41 +0000 (11:30 +0000)]
[lldb][modern-type-lookup] Add test for using the ClangModulesDeclVendor
llvm-svn: 372965
Simon Pilgrim [Thu, 26 Sep 2019 11:30:35 +0000 (11:30 +0000)]
Remove local shadow constant. NFCI.
ValueTracking.cpp already has a local static MaxDepth = 6 constant - this one seems to have been missed when rL124183 landed.
llvm-svn: 372964
David Zarzycki [Thu, 26 Sep 2019 11:12:29 +0000 (11:12 +0000)]
[libcxx] Do not implicitly #include assert.h
Users should only get the assert() macros if they explicitly include
them.
Found after switching from the GNU C++ stdlib to the LLVM C++ stdlib.
llvm-svn: 372963
Simon Pilgrim [Thu, 26 Sep 2019 11:09:08 +0000 (11:09 +0000)]
[ValueTracking] Silence static analyzer dyn_cast<Operator> null dereference warnings. NFCI.
The static analyzer is warning about a potential null dereferences, but since the pointer is only used in a switch statement for Operator::getOpcode() (with an empty default) then its easiest just to wrap this in a null test as the dyn_cast might return null here.
llvm-svn: 372962
Tatyana Krasnukha [Thu, 26 Sep 2019 10:57:11 +0000 (10:57 +0000)]
Don't stop execution in batch mode when process stops with SIGINT or SIGSTOP
Summary: Usually, SIGINT and SIGSTOP don't imply a crash, e.g. SIGSTOP is sent on process launch and attach on some platforms.
Differential Revision: https://reviews.llvm.org/D67776
llvm-svn: 372961
Simon Pilgrim [Thu, 26 Sep 2019 10:56:14 +0000 (10:56 +0000)]
MemorySanitizer - silence static analyzer dyn_cast<> null dereference warnings. NFCI.
The static analyzer is warning about a potential null dereferences, but we should be able to use cast<> directly and if not assert will fire for us.
llvm-svn: 372960
Simon Pilgrim [Thu, 26 Sep 2019 10:56:07 +0000 (10:56 +0000)]
PGOMemOPSizeOpt - silence static analyzer dyn_cast<MemIntrinsic> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<MemIntrinsic> directly and if not assert will fire for us.
llvm-svn: 372959
Simon Pilgrim [Thu, 26 Sep 2019 10:55:57 +0000 (10:55 +0000)]
[BPF] Remove unused variables. NFCI.
Fixes a dyn_cast<> null dereference warning.
llvm-svn: 372958
Petar Avramovic [Thu, 26 Sep 2019 10:48:07 +0000 (10:48 +0000)]
[MIPS GlobalISel] Lower aggregate structure return arguments
Implement aggregate structure split to simpler types in splitToValueTypes.
splitToValueTypes is used for return values.
According to MipsABIInfo from clang/lib/CodeGen/TargetInfo.cpp,
aggregate structure arguments for O32 always get simplified and thus
will remain unsupported by the MIPS GlobalISel for the time being.
For O32, aggregate structures can be encountered only for complex number
returns e.g. 'complex float' or 'complex double' from <complex.h>.
Differential Revision: https://reviews.llvm.org/D67963
llvm-svn: 372957
Simon Pilgrim [Thu, 26 Sep 2019 10:35:19 +0000 (10:35 +0000)]
HexagonAsmParser::ParseDirectiveFalign - silence static analyzer dyn_cast<MCConstantExpr> null dereference warning. NFCI.
The static analyzer is warning about a potential null dereference, but we should be able to use cast<MCConstantExpr> directly and if not assert will fire for us.
llvm-svn: 372956
Simon Pilgrim [Thu, 26 Sep 2019 10:23:57 +0000 (10:23 +0000)]
[SLPVectorizer][X86] Add SSE common check prefix to let us merge SSE2+SLM checks
llvm-svn: 372955
Simon Pilgrim [Thu, 26 Sep 2019 10:14:38 +0000 (10:14 +0000)]
[CostModel][X86] Fix SLM <2 x i64> icmp costs
SLM is 2 x slower for <2 x i64> comparison ops than other vector types, we should account for this like we do for SLM <2 x i64> add/sub/mul costs.
This should remove some of the SLM codegen diffs in D43582
llvm-svn: 372954
Haojian Wu [Thu, 26 Sep 2019 09:56:37 +0000 (09:56 +0000)]
[clang-tidy] Make llvm-header-guard work on llvm git monorepo
Reviewers: gribozavr
Reviewed By: gribozavr
Subscribers: xazax.hun, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D68026
llvm-svn: 372953
Pavel Labath [Thu, 26 Sep 2019 09:47:32 +0000 (09:47 +0000)]
SystemInitializer: Use Targets.def to selectively initialize ABI plugins
This avoids having to define additional macros in the cmake file, and
and also makes the logic in the cpp files more compact. It is also
easily extendible to other plugin types (instruction emulation?) that
should only be initialized if the corresponding llvm target is built.
Thanks to Ilya Birukov for pointing me to this file.
llvm-svn: 372952
Simon Atanasyan [Thu, 26 Sep 2019 09:13:20 +0000 (09:13 +0000)]
[mips] Relax jalr/jr instructions using R_MIPS_JALR relocation
The R_MIPS_JALR relocation denotes jalr/jr instructions in position
independent code. Both these instructions take a target's address from
the $25 register. If offset to the target symbol fits into the 18-bits,
it's more efficient to replace jalr/jr by bal/b instructions.
Differential Revision: https://reviews.llvm.org/D68057
llvm-svn: 372951
Jonas Paulsson [Thu, 26 Sep 2019 08:38:07 +0000 (08:38 +0000)]
[SystemZ] Recognize mnop-mcount in backend
With -pg -mfentry -mnop-mcount, a nop is emitted instead of the call to
fentry.
Review: Ulrich Weigand
https://reviews.llvm.org/D67765
llvm-svn: 372950
David Zarzycki [Thu, 26 Sep 2019 08:19:44 +0000 (08:19 +0000)]
[Testing] Workaround libcxx bug when OS is "none"
If clang is configured to use libcxx as the default C++ standard
library, then using "none" for the OS in the target triple will cause
libcxx to #error needlessly. Passing -nostdinc++ is a workaround for
these tests. See also: https://reviews.llvm.org/D68075
Please note: this workaround will probably exist for a few years until
the installed version of libcxx is updated.
llvm-svn: 372949
Kadir Cetinkaya [Thu, 26 Sep 2019 07:27:43 +0000 (07:27 +0000)]
[clangd] Add a helper for extracting nonlocal decls in a FunctionDecl
Summary:
To be used by define-inline code action to determine whether the
function/method body will still be valid in another context.
Traverses clang-ast to find all decl nodes under the function decl and stores
the non-local ones.
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67748
llvm-svn: 372948
Craig Topper [Thu, 26 Sep 2019 07:27:26 +0000 (07:27 +0000)]
[X86] Remove isCodeGenOnly from (V)ROUND.*_Int and put it on the non _Int form instead.
This matches what's done for VRNDSCALE and most other instructions.
This mainly determines which instruction will be preferred by
disassembler and assembly parser. The printing and encoding
information is the same.
We prefer the _Int form since it uses the VR128 class due to
intrinsic interface. For some of EVEX features like embedded
rounding, we only select from intrinsics today. So there is
only a VR128 version. So making the VR128 version the preferred
is overally consistent.
llvm-svn: 372947
Raphael Isemann [Thu, 26 Sep 2019 07:06:05 +0000 (07:06 +0000)]
[lldb][NFC] Use AppendEmptyArgument in CompletionRequest constructor
We now have a utility function for this purpose.
(Also fixing the typo in the related comment while I'm at it.)
llvm-svn: 372946
Artem Dergachev [Thu, 26 Sep 2019 07:01:31 +0000 (07:01 +0000)]
[analyzer] A speculative attempt to avoid gcc-7 crashes caused by r372942.
llvm-svn: 372945
Mikael Holmen [Thu, 26 Sep 2019 06:49:37 +0000 (06:49 +0000)]
[SortIncludesTest] Add SortPriority fields to fix -Wmissing-field-initializers after D64695/r372919
llvm-svn: 372944
Mikael Holmen [Thu, 26 Sep 2019 06:35:55 +0000 (06:35 +0000)]
[IfConversion] Disallow TBB == FBB for valid triangles
Summary:
Previously the case
EBB
| \_
| |
| TBB
| /
FBB
was treated as a valid triangle also when TBB and FBB was the same basic
block. This could then lead to an invalid CFG when we removed the edge
from EBB to TBB, since that meant we would also remove the edge from EBB
to FBB.
Since TBB == FBB is quite a degenerated case of a triangle, we now
don't treat it as a valid triangle anymore, and thus we will avoid the
trouble with updating the CFG.
Reviewers: efriedma, dmgreen, kparzysz
Reviewed By: efriedma
Subscribers: bjope, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67832
llvm-svn: 372943
Artem Dergachev [Thu, 26 Sep 2019 06:33:21 +0000 (06:33 +0000)]
[analyzer] Avoid small vectors of non-default-constructibles.
Unconfuses certain compilers.
llvm-svn: 372942
Craig Topper [Thu, 26 Sep 2019 04:42:58 +0000 (04:42 +0000)]
[X86] Mark the EVEX encoded PSADBW instructions as commutable to enable load folding of the other operand.
The SSE and VEX versions are already correct.
llvm-svn: 372941
Keno Fischer [Thu, 26 Sep 2019 02:07:51 +0000 (02:07 +0000)]
[ConstantFolding] Use FoldBitCast correctly
Previously we might attempt to use a BitCast to turn bits into vectors of pointers,
but that requires an inttoptr cast to be legal. Add an assertion to detect the formation of illegal bitcast attempts
early (in the tests, we often constant-fold away the result before getting to this assertion check),
while being careful to still handle the early-return conditions without adding extra complexity in the result.
Patch by Jameson Nash <jameson@juliacomputing.com>.
Differential Revision: https://reviews.llvm.org/D65057
llvm-svn: 372940
Fangrui Song [Thu, 26 Sep 2019 02:02:17 +0000 (02:02 +0000)]
[clang-format] Add SortPriority fields to fix -Wmissing-field-initializers after D64695/r372919
llvm-svn: 372939
Nick Lewycky [Thu, 26 Sep 2019 00:58:55 +0000 (00:58 +0000)]
Improve C API support for atomicrmw and cmpxchg.
atomicrmw and cmpxchg have a volatile flag, so allow them to be get and set with LLVM{Get,Set}Volatile. atomicrmw and fence have orderings, so allow them to be get and set with LLVM{Get,Set}Ordering. Add missing LLVMAtomicRMWBinOpFAdd and LLVMAtomicRMWBinOpFSub enum constants. AtomicCmpXchg also has a weak flag, add a getter/setter for that too. Add a getter/setter for the binary-op of an atomicrmw.
atomicrmw and cmpxchg have a volatile flag, so allow it to be set/get with LLVMGetVolatile and LLVMSetVolatile. Add missing LLVMAtomicRMWBinOpFAdd and LLVMAtomicRMWBinOpFSub enum constants. AtomicCmpXchg also has a weak flag, add a getter/setter for that too. Add a getter/setter for the binary-op of an atomicrmw.
Add LLVMIsA## for CatchSwitchInst, CallBrInst and FenceInst, as well as AtomicCmpXchgInst and AtomicRMWInst.
Update llvm-c-test to include atomicrmw and fence, and to copy volatile for the four applicable instructions.
Differential Revision: https://reviews.llvm.org/D67132
llvm-svn: 372938
Mitch Phillips [Thu, 26 Sep 2019 00:54:30 +0000 (00:54 +0000)]
[libFuzzer] [NFC] Fix grammar error with "it's"
llvm-svn: 372937
Yitzhak Mandelbaum [Thu, 26 Sep 2019 00:53:56 +0000 (00:53 +0000)]
[libTooling] Add `run` combinator to Stencils.
Summary:
This revision adds `run`, a StencilPart that runs a user-defined function that
computes a result over `MatchFinder::MatchResult`.
Reviewers: gribozavr
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67969
llvm-svn: 372936
Thomas Raoux [Thu, 26 Sep 2019 00:16:01 +0000 (00:16 +0000)]
[TargetLowering] Make allowsMemoryAccess methode virtual.
Rename old function to explicitly show that it cares only about alignment.
The new allowsMemoryAccess call the function related to alignment by default
and can be overridden by target to inform whether the memory access is legal or
not.
Differential Revision: https://reviews.llvm.org/D67121
llvm-svn: 372935
Sam Clegg [Wed, 25 Sep 2019 23:33:16 +0000 (23:33 +0000)]
[MC][WebAssembly] Error on data symbols in the text section.
Previously we had an assert but this can actually occur in valid user
code so we need to handle this in release builds too.
Differential Revision: https://reviews.llvm.org/D67997
llvm-svn: 372934
Craig Topper [Wed, 25 Sep 2019 23:25:15 +0000 (23:25 +0000)]
[X86] Use VR512_0_15RegClass intead of VR512RegClass in X86VZeroUpper.
This pass is only concerned with ZMM0-15 and YMM0-15. For YMM
we use VR256 which only contains YMM0-15, but for ZMM we were
using VR512 which contains ZMM0-31. Using VR512_0_15 is more
correct.
Given that the ABI and register allocator will use registers in
order, its unlikely that register from 16-31 would be used
without also using 0-15. So this probably doesn't functionally
matter.
llvm-svn: 372933
Alina Sbirlea [Wed, 25 Sep 2019 23:24:39 +0000 (23:24 +0000)]
[MemorySSA] Avoid adding Phis in the presence of unreachable blocks.
Summary:
If a block has all incoming values with the same MemoryAccess (ignoring
incoming values from unreachable blocks), then use that incoming
MemoryAccess and do not create a Phi in the first place.
Revert IDF work-around added in rL372673; it should not be required unless
the Def inserted is the first in its block.
The patch also cleans up a series of tests, added during the many
iterations on insertDef.
The patch also fixes PR43438.
The same issue that occurs in insertDef with "adding phis, hence the IDF of
Phis is needed", can also occur in fixupDefs: the `getPreviousRecursive`
call only adds Phis walking on the predecessor edges, which means there
may be the case of a Phi added walking the CFG "backwards" which
triggers the needs for an additional Phi in successor blocks.
Such Phis are added during fixupDefs only in the presence of unreachable
blocks.
Hence this highlights the need to avoid adding Phis in blocks with
unreachable predecessors in the first place.
Reviewers: george.burgess.iv
Subscribers: Prazek, sanjoy.google, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67995
llvm-svn: 372932
Roman Lebedev [Wed, 25 Sep 2019 22:59:59 +0000 (22:59 +0000)]
[InstCombine] foldUnsignedUnderflowCheck(): one last pattern with 'sub' (PR43251)
https://rise4fun.com/Alive/0j9
llvm-svn: 372930
Roman Lebedev [Wed, 25 Sep 2019 22:59:48 +0000 (22:59 +0000)]
[NFC][InstCombine] Tests for 'base u<= offset && (base - offset) != 0' pattern (PR43251)
llvm-svn: 372929
Roman Lebedev [Wed, 25 Sep 2019 22:59:41 +0000 (22:59 +0000)]
[InstSimplify] Handle more 'A </>/>=/<= B &&/|| (A - B) !=/== 0' patterns (PR43251)
https://rise4fun.com/Alive/sl9s
https://rise4fun.com/Alive/2plN
https://bugs.llvm.org/show_bug.cgi?id=43251
llvm-svn: 372928
Roman Lebedev [Wed, 25 Sep 2019 22:59:24 +0000 (22:59 +0000)]
[NFC][InstSimplify] More exaustive test coverage for 'A </>/>=/<= B &&/|| (A - B) !=/== 0' pattern (PR43251)
llvm-svn: 372927
Reid Kleckner [Wed, 25 Sep 2019 22:50:50 +0000 (22:50 +0000)]
Simplify -fms-compatibility include lookup logic, NFC
This include search logic has an extra parameter to deal with Windows
includes with backslashes, which get normalized to forward slashes on
non-Windows under -fms-compatibility.
Hoist the conditional operator out of LookupHeaderIncludeOrImport and
pass the result in instead of repeating the ?: expression everywhere.
llvm-svn: 372926
Evgeniy Stepanov [Wed, 25 Sep 2019 22:38:20 +0000 (22:38 +0000)]
Fix memory leak in DeclTest.
Fixes a leak introduced in r372903, detected on the ASan bot.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/35430/steps/check-clang%20asan/logs/stdio
Direct leak of 192 byte(s) in 1 object(s) allocated from:
#0 0x561d88 in operator new(unsigned long) /b/sanitizer-x86_64-linux-fast/build/llvm-project/compiler-rt/lib/asan/asan_new_delete.cc:105
#1 0x1a48779 in clang::ItaniumMangleContext::create(clang::ASTContext&, clang::DiagnosticsEngine&) /b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/lib/AST/ItaniumMangle.cpp:5134:10
#2 0xdff000 in Decl_AsmLabelAttr_Test::TestBody() /b/sanitizer-x86_64-linux-fast/build/llvm-project/clang/unittests/AST/DeclTest.cpp:97:23
llvm-svn: 372925
Eli Friedman [Wed, 25 Sep 2019 22:35:47 +0000 (22:35 +0000)]
[LICM] Don't verify domtree/loopinfo unless EXPENSIVE_CHECKS is enabled.
For large functions, verifying the whole function after each loop takes
non-linear time.
Differential Revision: https://reviews.llvm.org/D67571
llvm-svn: 372924
Nick Desaulniers [Wed, 25 Sep 2019 22:28:27 +0000 (22:28 +0000)]
[Verifier] add invariant check for callbr
Summary:
The list of indirect labels should ALWAYS have their blockaddresses as
argument operands to the callbr (but not necessarily the other way
around). Add an invariant that checks this.
The verifier catches a bad test case that was added recently in r368478.
I think that was a simple mistake, and the test was made less strict in
regards to the precise addresses (as those weren't specifically the
point of the test).
This invariant will be used to find a reported bug.
Link: https://www.spinics.net/lists/arm-kernel/msg753473.html
Link: https://github.com/ClangBuiltLinux/linux/issues/649
Reviewers: craig.topper, void, chandlerc
Reviewed By: void
Subscribers: ychen, lebedev.ri, javed.absar, kristof.beyls, hiraditya, llvm-commits, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67196
llvm-svn: 372923
Adhemerval Zanella [Wed, 25 Sep 2019 21:46:24 +0000 (21:46 +0000)]
[libcxxabi] Fix arm build failer with libgcc
Both arm32 armv7/armv8 bots which do not use compiler-rt are failing
to a linking issue:
[100%] Built target cxxabi_static
CMakeFiles/cxxabi_shared.dir/cxa_demangle.cpp.o: In function `(anonymous namespace)::itanium_demangle::OutputStream::writeUnsigned(unsigned long long, bool)':
/home/buildslave/buildslave/libcxx-libcxxabi-libunwind-armv7-linux-noexceptions/llvm/projects/libcxxabi/src/demangle/Utility.h:55: undefined reference to `__aeabi_uldivmod'
/home/buildslave/buildslave/libcxx-libcxxabi-libunwind-armv7-linux-noexceptions/llvm/projects/libcxxabi/src/demangle/Utility.h:56: undefined reference to `__aeabi_uldivmod'
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)
It seems after r371273 OutputStream is used more extensively and
is pulling OutputStream::writeUnsigned (which thus requires unsigned
integer module).
The straightfoward fix is to explicit link against libgcc if
compiler-rt is not used.
llvm-svn: 372921
Jonas Devlieghere [Wed, 25 Sep 2019 20:59:56 +0000 (20:59 +0000)]
[Dwarf] Fix switch cases that take an dw_tag_t.
Now that dw_tag_t is an enum, a default case is required.
llvm-svn: 372920
Paul Hoad [Wed, 25 Sep 2019 20:33:01 +0000 (20:33 +0000)]
[clang-format] Modified SortIncludes and IncludeCategories to priority for sorting #includes within the Group Category.
Summary:
This new Style rule is made as a part of adding support for NetBSD KNF in clang-format. NetBSD have it's own priority of includes which should be followed while formatting NetBSD code. This style sorts the Cpp Includes according to the priorities of NetBSD, as mentioned in the [Style Guide](http://cvsweb.netbsd.org/bsdweb.cgi/src/share/misc/style?rev=HEAD&content-type=text/x-cvsweb-markup)
The working of this Style rule shown below:
**Configuration:**
This revision introduces a new field under IncludeCategories named `SortPriority` which defines the priority of ordering the `#includes` and the `Priority` will define the categories for grouping the `#include blocks`.
Reviewers: cfe-commits, mgorny, christos, MyDeveloperDay
Reviewed By: MyDeveloperDay
Subscribers: lebedev.ri, rdwampler, christos, mgorny, krytarowski
Patch By: Manikishan
Tags: #clang, #clang-format
Differential Revision: https://reviews.llvm.org/D64695
llvm-svn: 372919
Yitzhak Mandelbaum [Wed, 25 Sep 2019 20:04:25 +0000 (20:04 +0000)]
[libTooling][NFC] Switch StencilTest.cpp to use EXPECT_THAT_EXPECTED
Summary:
Currently, some tests use homegrown matchers to handle `llvm::Expected`
values. This revision standardizes on EXPECT_THAT_EXPECTED and `HasValue`.
Reviewers: ilya-biryukov
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67973
llvm-svn: 372918
Alexey Bataev [Wed, 25 Sep 2019 19:43:37 +0000 (19:43 +0000)]
[OPENMP50]Parsing/sema support for 'implementation/vendor' context
selector.
Added basic parsing/semantic support for
'implementation={vendor(<vendor>)}' context selector.
llvm-svn: 372917
Louis Dionne [Wed, 25 Sep 2019 19:40:48 +0000 (19:40 +0000)]
[libc++] Purge mentions of GCC 4 from the test suite
We don't support GCC 4 and older according to the documentation, so
we should pretend it doesn't exist.
This is a re-application of r372787.
llvm-svn: 372916
Florian Hahn [Wed, 25 Sep 2019 19:33:26 +0000 (19:33 +0000)]
[InstSimplify] Match 1.0 and 0.0 for both operands in SimplifyFMAMul
Because we do not constant fold multiplications in SimplifyFMAMul,
we match 1.0 and 0.0 for both operands, as multiplying by them
is guaranteed to produce an exact result (if it is allowed to do so).
Note that it is not enough to just swap the operands to ensure a
constant is on the RHS, as we want to also cover the case with
2 constants.
Reviewers: lebedev.ri, spatel, reames, scanon
Reviewed By: lebedev.ri, reames
Differential Revision: https://reviews.llvm.org/D67553
llvm-svn: 372915
Jonas Devlieghere [Wed, 25 Sep 2019 19:31:54 +0000 (19:31 +0000)]
[lit] Do a better job at parsing unsupported tests.
When all the tests run by dotest are unsupported, it still reports
RESULT: PASSED which we translate to success for lit. We can better
report the status as unsupported when we see that there are unsupported
tests but no passing tests. This will not affect the situation where
there are failures or unexpected passes, because those report a non-zero
exit code.
Differential revision: https://reviews.llvm.org/D68039
llvm-svn: 372914
Roman Lebedev [Wed, 25 Sep 2019 19:06:40 +0000 (19:06 +0000)]
[InstCombine] Fold (A - B) u>=/u< A --> B u>/u<= A iff B != 0
https://rise4fun.com/Alive/KtL
This also shows that the fold added in D67412 / r372257
was too specific, and the new fold allows those test cases
to be handled more generically, therefore i delete now-dead code.
This is yet again motivated by
D67122 "[UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour"
llvm-svn: 372912
Roman Lebedev [Wed, 25 Sep 2019 19:06:26 +0000 (19:06 +0000)]
[NFC][InstCombine] Add tests for (X - Y) < X --> Y <= X iff Y != 0
https://rise4fun.com/Alive/KtL
This should go to InstCombiner::foldICmpBinO(), next to
"Convert sub-with-unsigned-overflow comparisons into a comparison of args."
llvm-svn: 372911
Vadzim Dambrouski [Wed, 25 Sep 2019 18:58:07 +0000 (18:58 +0000)]
[MSP430] Allow msp430_intrcc functions to not have interrupt attribute.
Summary:
Useful in case you want to have control over interrupt vector generation.
For example in Rust language we have an arrangement where all unhandled
ISR vectors gets mapped to a single default handler function. Which is
hard to implement when LLVM tries to generate vectors on its own.
Reviewers: asl, krisb
Subscribers: hiraditya, JDevlieghere, awygle, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D67313
llvm-svn: 372910
Eric Fiselier [Wed, 25 Sep 2019 18:56:54 +0000 (18:56 +0000)]
Add forward declaration of operator<< in <string_view> as required.
This declaration was previously missing despite appearing in the
synopsis. Users are still required to include <ostream> to get the
definition of the streaming operator.
llvm-svn: 372909
Stanislav Mekhanoshin [Wed, 25 Sep 2019 18:50:34 +0000 (18:50 +0000)]
[AMDGPU] Improve fma.f64 test. NFC.
llvm-svn: 372908
Eric Fiselier [Wed, 25 Sep 2019 18:43:40 +0000 (18:43 +0000)]
add tests that debug mode catches nullptr->string_view conversions in comparison operators
llvm-svn: 372907
Stanislav Mekhanoshin [Wed, 25 Sep 2019 18:40:20 +0000 (18:40 +0000)]
[AMDGPU] gfx10 v_fmac_f16 operand folding
Fold immediates into v_fmac_f16.
Differential Revision: https://reviews.llvm.org/D68037
llvm-svn: 372906
Haibo Huang [Wed, 25 Sep 2019 18:17:45 +0000 (18:17 +0000)]
[lldb] Excludes private headers from SWIG dependency.
Reviewers: xiaobai
Subscribers: mgorny, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D68040
llvm-svn: 372905
Bob Haarman [Wed, 25 Sep 2019 18:16:02 +0000 (18:16 +0000)]
[emacs] simplify and improve keyword highlighting in tablegen-mode.el
Summary:
The keyword and type keyword matchers in tablegen-mode.el checked
for space, newline, tab, or open paren after the regular expression
that matches keywords (or type keywords, respectively). This is
unnecessary, because those regular expressions already include word
boundaries. This change removes the extra check. This also causes
"def" in "def:" to be highlighted as a keyword, which was missed
before.
Reviewers: lattner, MaskRay
Reviewed By: MaskRay
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68002
llvm-svn: 372904