Commit Graph

315721 Commits

Author SHA1 Message Date
Simon Pilgrim 70ee2def90 [X86] Make X86RegisterInfo(const Triple &TT) constructor explicit.
Fixes cppcheck warning.

llvm-svn: 359981
2019-05-05 12:51:47 +00:00
Nicolas Lesser 5125a02a03 [clang] fixing -ast-print for variadic parameter pack in lambda capture
Summary:
currently for:
```
 template<typename ... T>
void f(T... t) {
  auto l = [t...]{};
}
```
`clang -ast-print file.cpp`
outputs:

```
template <typename ...T> void f(T ...t) {
    auto l = [t]         {
        }
;
}
```
notice that there is not `...` in the capture list of the lambda. this patch fixes this issue. and add test for it.

Patch by Tyker

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 359980
2019-05-05 12:35:12 +00:00
Nicolas Lesser ee0571734f [C++] Interpret unknown identifier in parameter clause as unknown type
instead of as parameter name without a type.

llvm-svn: 359979
2019-05-05 12:15:17 +00:00
Michal Gorny 60211cb872 [lldb] [lit] Simplify general-purpose register tests
Use output constraints for specific general-purpose registers in order
to simplify the tests.  They save us from having to manually put
the values in correct registers, and reduce the number of registers
needed as a result.

llvm-svn: 359978
2019-05-05 12:06:32 +00:00
Michal Gorny dca69eb29c [lldb] [lit] Fix more filename mismatches in Register tests
llvm-svn: 359977
2019-05-05 12:06:22 +00:00
Simon Pilgrim cbcd9b1b92 [X86] Fix some cppcheck "Local variable name shadows outer variable" warnings. NFCI.
llvm-svn: 359976
2019-05-05 12:00:14 +00:00
Simon Pilgrim 5b05f20a3a [SLPVectorizer] Make getSpillCost() const. NFCI.
Ideally getTreeCost() should be const as well but non-const Type creation would need to be addressed first.

llvm-svn: 359975
2019-05-05 10:37:38 +00:00
Simon Pilgrim 0f89b76b84 [SelectionDAG] Use any_of/all_of where possible. NFCI.
llvm-svn: 359974
2019-05-05 10:30:04 +00:00
Simon Pilgrim 7a2e855a0f Move Value *RHSCIOp def into the scope where its actually used. NFCI.
llvm-svn: 359973
2019-05-05 10:27:45 +00:00
Cameron McInally fd254e429e Add InstCombine tests for FNeg instruction.
llvm-svn: 359970
2019-05-04 14:56:08 +00:00
Sanjay Patel 5ab41a7a05 [CodeGenPrepare] limit overflow intrinsic matching to a single basic block (2nd try)
This is a subset of the original commit from rL359879
which was reverted because it could crash when using the 'RemovedInstructions'
structure that enables delayed deletion of dead instructions. The motivating
compile-time win does not require that change though. We should get most of
that win from this change alone.

Using/updating a dominator tree to match math overflow patterns may be very
expensive in compile-time (because of the way CGP uses a DT), so just handle
the single-block case.

See post-commit thread for rL354298 for more details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190422/646276.html

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

llvm-svn: 359969
2019-05-04 12:46:32 +00:00
Nicolas Lesser 55dc751ef7 [NFC] Add parentheses to avoid -Wparentheses.
llvm-svn: 359968
2019-05-04 11:28:11 +00:00
Hamza Sood 8205a814a6 [c++20] Implement P0428R2 - Familiar template syntax for generic lambdas
Differential Revision: https://reviews.llvm.org/D36527

llvm-svn: 359967
2019-05-04 10:49:46 +00:00
Nicolas Lesser 9c32fa1b1f [lldb] Fix buildbot failure due to clang AST change.
In r359949 several AST node constructors were modified without the
corresponding change in lldb, which caused build failures.

llvm-svn: 359966
2019-05-04 10:21:50 +00:00
Fangrui Song 08b28ce2f2 [llvm-nm] Convert weak.test to use yaml2obj and fix unntested 'v'
This restores part of the good change reverted by r359830.

llvm-svn: 359965
2019-05-04 09:12:18 +00:00
Richard Smith cb1beee76f [c++20] Implement tweaked __VA_OPT__ rules from P1042R1:
* __VA_OPT__ is expanded if the *expanded* __VA_ARGS__ is non-empty,
   not if the original argument contained no tokens.
 * Placemarkers at the start and end of __VA_OPT__ are retained just
   long enough to paste them with adjacent ## operators. We never paste
   "across" a discarded placemarker.

llvm-svn: 359964
2019-05-04 06:46:18 +00:00
Stanislav Mekhanoshin 5ddd564e19 [AMDGPU] Fixed asan error after D61536
llvm-svn: 359963
2019-05-04 06:40:20 +00:00
Richard Smith 5dbfa76334 Use DiagRuntimeBehavior for -Wunsequenced to weed out false positives
where either the modification or the other access is unreachable.

llvm-svn: 359962
2019-05-04 05:20:14 +00:00
Stanislav Mekhanoshin 51d1415a16 AMDGPU] gfx1010 hazard recognizer
Differential Revision: https://reviews.llvm.org/D61536

llvm-svn: 359961
2019-05-04 04:30:57 +00:00
Richard Trieu cf9bd8ade7 Reduce amount of work ODR hashing does.
When a FunctionProtoType is in the original type in a DecayedType, the decayed
type is a PointerType which points back the original FunctionProtoType.  The
visitor for ODRHashing will attempt to process both Type's, doing double work.
By chaining together multiple DecayedType's and FunctionProtoType's, this would
result in 2^N Type's visited only N DecayedType's and N FunctionProtoType's
exsit.  Another bug where VisitDecayedType and VisitAdjustedType did
redundant work doubled the work at each level, giving 4^N Type's visited.  This
patch removed the double work and detects when a FunctionProtoType decays to
itself to only check the Type once.  This lowers the exponential runtime to
linear runtime.  Fixes https://bugs.llvm.org/show_bug.cgi?id=41625

llvm-svn: 359960
2019-05-04 04:22:33 +00:00
Stanislav Mekhanoshin 28a1936f6d [AMDGPU] gfx1010: use fmac instructions
Differential Revision: https://reviews.llvm.org/D61527

llvm-svn: 359959
2019-05-04 04:20:37 +00:00
Richard Smith 37be3363b5 Disallow the operand of __builtin_constant_p from modifying enclosing
state when it's encountered while evaluating a constexpr function.

We attempt to follow GCC trunk's behavior here, but it is somewhat
inscrutible, so our behavior is only approximately the same for now.
Specifically, we only permit modification of objects whose lifetime
began within the operand of the __builtin_constant_p. GCC appears to
have effectively the same restriction, but also some unknown restriction
based on where and how the local state of the constexpr function is
mentioned within the operand (see added testcases).

llvm-svn: 359958
2019-05-04 04:00:45 +00:00
Petr Hosek 1e393064fa [Driver] Create non-existent directory for -fcrash-diagnostics-dir
When user specifies non-existent directory to -fcrash-diagnostics-dir,
create it rather than failing with an error as would be the case before.

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

llvm-svn: 359954
2019-05-04 00:55:14 +00:00
Richard Smith 3c7688bd57 [cxx_status] Don't list -fmodules / -fmodules-ts against C++ modules
support; those turn on different modules modes. The real C++ modules
support is behind -std=c++2a like the rest of C++20.

llvm-svn: 359953
2019-05-04 00:27:21 +00:00
Richard Smith de510a8eea [cxx_status] Replace "SVN" entries with Clang 8 as appropriate.
Also: use the "svn" color for "explicit(bool)" rather than the "full" color.
llvm-svn: 359951
2019-05-04 00:23:18 +00:00
Lang Hames ce8255f3e2 [JITLink] Add two useful Section operations: find by name, get address range.
These operations were already used in eh-frame registration, and are likely to
be used in other runtime registrations, so this commit moves them into a header
where they can be re-used.

llvm-svn: 359950
2019-05-04 00:23:09 +00:00
Nicolas Lesser 5fe2ddbdf4 [clang] adding explicit(bool) from c++2a
this patch adds support for the explicit bool specifier.

Changes:
- The parsing for the explicit(bool) specifier was added in ParseDecl.cpp.
- The storage of the explicit specifier was changed. the explicit specifier was stored as a boolean value in the FunctionDeclBitfields and in the DeclSpec class. now it is stored as a PointerIntPair<Expr*, 2> with a flag and a potential expression in CXXConstructorDecl, CXXDeductionGuideDecl, CXXConversionDecl and in the DeclSpec class.
- Following the AST change, Serialization, ASTMatchers, ASTComparator and ASTPrinter were adapted.
- Template instantiation was adapted to instantiate the potential expressions of the explicit(bool) specifier When instantiating their associated declaration.
- The Add*Candidate functions were adapted, they now take a Boolean indicating if the context allowing explicit constructor or conversion function and this boolean is used to remove invalid overloads that required template instantiation to be detected.
- Test for Semantic and Serialization were added.

This patch is not yet complete. I still need to check that interaction with CTAD and deduction guides is correct. and add more tests for AST operations. But I wanted first feedback.
Perhaps this patch should be spited in smaller patches, but making each patch testable as a standalone may be tricky.

Patch by Tyker

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

llvm-svn: 359949
2019-05-04 00:09:00 +00:00
Richard Smith a6b41d7c52 CWG issue 727: Fix numerous bugs in support for class-scope explicit
specializations for variable templates.

llvm-svn: 359947
2019-05-03 23:51:38 +00:00
Saleem Abdulrasool 5a36558c5b ExpressionParser: only force link MCJIT when needed
This was added to support FreeBSD.  The inclusion of this header increases the
size of `lldb-server` due to MCJIT being forcefully preserved.  Conditionalise
the inclusion to shared builds of LLVM which will allow for MCJIT to be stripped
if unnecessary when performing static linking of tools.  This shaves off ~28% of
the binary size for lldb-server when linked with gold using
`-ffunction-sections` and `-fdata-sections`.

llvm-svn: 359944
2019-05-03 23:19:27 +00:00
Owen Pan 3dcb892d2d [clang-format] Fix bug in block comment reflow that joins * and /
Fixes PR41213

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

llvm-svn: 359943
2019-05-03 23:15:40 +00:00
Alexander Kornienko 3f796f974d [lld] Specify output file explicitly
The test shouldn't try to create `a.out` in the current directory, which can be
read-only (and it is in our test setup).

llvm-svn: 359942
2019-05-03 23:11:32 +00:00
Sanjay Patel dd2e91a181 [x86] add tests for fneg IR with undef; NFC
llvm-svn: 359941
2019-05-03 22:47:29 +00:00
Jessica Paquette 910630c1e4 [AArch64][GlobalISel] Use fcsel instead of csel for G_SELECT on FPRs
This saves us some unnecessary copies.

If the inputs to a G_SELECT are floating point, we should use fcsel rather than
csel.

Changes here are...

- Teach selectCopy about s1-to-s1 copies across register banks.
- AArch64RegisterBankInfo about G_SELECT in general.
- Teach the instruction selector about the FCSEL instructions.

Also add two tests:

- select-select.mir to show that we get the expected FCSEL
- regbank-select.mir (unfortunately named) to show the register banks on
G_SELECT are properly preserved

And update fast-isel-select.ll to show that we do the same thing as other
instruction selectors in these cases.

llvm-svn: 359940
2019-05-03 22:37:46 +00:00
Craig Topper 99f8c4f5b6 Make the git-llvm script work on older git versions that don't support git rev-parse --git-common-dir.
Not all versions of git support git rev-parse --git-common-dir. Rather than erorr or print any kind of
useful error, they just print back '--git-common-dir' instead of a directory. The git-llvm script
ends up taking this '--git-common-dir' as a diretory name to use.

Not sure exactly what happens after that, but the end result is that the 'git llvm push' ends up
looking like it pushed your commits, but really did nothing.

This patch makes the script detect the bogus directory name for --git-common-dir and falls back to using --git-dir instead.

llvm-svn: 359939
2019-05-03 22:03:29 +00:00
Stanislav Mekhanoshin d9dcf392c7 [AMDGPU] gfx1010 wait count insertion
Differential Revision: https://reviews.llvm.org/D61534

llvm-svn: 359938
2019-05-03 21:53:53 +00:00
Stanislav Mekhanoshin 41bbe101a2 [AMDGPU] gfx1010 s_code_end generation
Also add some missing metadata in the streamer.

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

llvm-svn: 359937
2019-05-03 21:26:39 +00:00
Cameron McInally be7138b467 Update PatternMatcher for FNeg
Match both FNeg(X) and FSub(+-0.0, X) in FNeg_match

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

llvm-svn: 359936
2019-05-03 21:19:12 +00:00
Stanislav Mekhanoshin 93f15c922f [AMDGPU] gfx1010 loop alignment
Differential Revision: https://reviews.llvm.org/D61529

llvm-svn: 359935
2019-05-03 21:17:29 +00:00
Mandeep Singh Grang 5dc8aeb26d [COFF, ARM64] Fix ABI implementation of struct returns
Summary:
Refer the ABI doc at: https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=vs-2019#return-values

Related clang patch: D60349

Reviewers: rnk, efriedma, TomTan, ssijaric

Reviewed By: rnk, efriedma

Subscribers: mstorsjo, javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

llvm-svn: 359934
2019-05-03 21:12:36 +00:00
Mandeep Singh Grang 85a0f8fe6c [COFF, ARM64] Fix ABI implementation of struct returns
Summary:
Related llvm patch: D60348.
Patch co-authored by Sanjin Sijaric.

Reviewers: rnk, efriedma, TomTan, ssijaric, ostannard

Reviewed By: efriedma

Subscribers: dmajor, richard.townsend.arm, ostannard, javed.absar, kristof.beyls, cfe-commits

Tags: #clang

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

llvm-svn: 359932
2019-05-03 21:12:24 +00:00
Raphael Isemann 090a5b29b8 Fixed some minor style issues in rLLDB359921 [NFC]
Ran clang-format on the added test file and use the new StringRef
comparison over the temporary ConstStrings. Also aligned the
end of one of the code string literals.

llvm-svn: 359931
2019-05-03 21:01:45 +00:00
Jonas Devlieghere 94f3568633 [test] Make check more strict
Before this change the test would always pass if the path to the test
contained the number 11 in it. Thanks to Ted for pointing this out.

llvm-svn: 359930
2019-05-03 20:58:56 +00:00
Jonas Devlieghere e078c9507c [lldb] Remove the 'www' folder.
Now that the new website is live and everything is generated from the
repository, we don't need the www folder anymore.

llvm-svn: 359929
2019-05-03 20:42:45 +00:00
Jonas Devlieghere e5f7d601ee [Alias] Add 're' alias for register
This patch makes `re` an alias for `register`. Currently `re<TAB>` gives
you the choice between `register` and `reproducer`. Given that you use
`register` a lot more often, it should win for the common substring.

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

llvm-svn: 359927
2019-05-03 20:37:09 +00:00
Jonas Devlieghere c1e2c5340b Make lldb-mi optional and change how we deal with missing tools in lit
We don't need the variables in lit, we can use the capabilities to check
if the utility exists.

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

llvm-svn: 359926
2019-05-03 20:33:58 +00:00
Adrian Prantl 80b047ef66 Supply a default implementation of IsRuntimeSupportValue.
Thanks to Pavel for pointing this out.

llvm-svn: 359925
2019-05-03 20:28:19 +00:00
Reid Kleckner 0a1b1d6e62 Shrink SectionChunk by combining Relocs and SectionName sizes
SectionChunk is one of the most frequently allocated data structures in
LLD, since there are about four per function when optimizations and
debug info are enabled (.text, .pdata, .xdata, .debug$S).

A PE COFF file cannot be larger than 2GB, so there is an inherent limit
on the length of the section name and the number of relocations.
Decompose the ArrayRef and StringRef into pointer and size, and put them
back together in the accessors for section name and relocation list.

I plan to gather complete performance numbers later by padding
SectionChunk with dead data and measuring performance after all the size
optimizations are done.

llvm-svn: 359923
2019-05-03 20:17:14 +00:00
Alexey Bataev a857e31011 [OPENMP][NVPTX]Improve thread limit counter, NFC.
Summary:
Patch improves performance of the full runtime mode by moving
thread-limit counter to the shared memory. It also allows to save
global memory.

Reviewers: grokos, gtbercea, kkwli0

Subscribers: guansong, jdoerfert, caomhin, openmp-commits

Tags: #openmp

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

llvm-svn: 359922
2019-05-03 20:00:38 +00:00
Shafik Yaghmour e5cbe78259 Fix for ambiguous lookup in expressions between local variable and namespace
Summary:
In an Objective-C context a local variable and namespace can cause an ambiguous name lookup when used in an expression. The solution involves mimicking the existing C++ solution which is to add local using declarations for local variables. This causes a different type of lookup to be used which eliminates the namespace during acceptable results filtering.

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

llvm-svn: 359921
2019-05-03 19:59:22 +00:00
David Carlier 70f5e050e7 [Lsan] Disabling explicitally FreeBSD
As it is not implemented upon usage, it just provokes numerous linkage issues so better switch off clearly.

Reviewers: vitalybuka, morehouse

Reviewed By: morehouse

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

llvm-svn: 359920
2019-05-03 19:46:55 +00:00