Simon Pilgrim [Sun, 5 May 2019 18:34:38 +0000 (18:34 +0000)]
Move getOpcode() call into if statement. NFCI.
Avoids a cppcheck "Local variable name shadows outer variable" warning.
llvm-svn: 359991
Cameron McInally [Sun, 5 May 2019 18:22:09 +0000 (18:22 +0000)]
Precommit an FNeg InstructionSimplify test.
llvm-svn: 359990
Simon Pilgrim [Sun, 5 May 2019 17:53:09 +0000 (17:53 +0000)]
[SLPVectorizer] Prefer pre-increments. NFCI.
llvm-svn: 359989
Craig Topper [Sun, 5 May 2019 17:46:17 +0000 (17:46 +0000)]
[LLParser] Remove unused variable after r359987. NFC
llvm-svn: 359988
Craig Topper [Sun, 5 May 2019 17:19:23 +0000 (17:19 +0000)]
[LLParser] Remove unnecessary error check making sure NUW/NSW flags aren't set on a non-integer operation.
Summary: This check appears to be a leftover from when add/sub/mul could be either integer or fp. The NSW/NUW flags are only set for add/sub/mul/shl earlier. And we check that those operations only have integer types just below this. So it seems unnecessary to explicitly error for NUW/NSW being used on a add/sub/mul that have the wrong type that would later error for that.
Reviewers: spatel, dblaikie, jyknight, arsenm
Reviewed By: spatel
Subscribers: wdng, llvm-commits, hiraditya
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61562
llvm-svn: 359987
Craig Topper [Sun, 5 May 2019 17:19:19 +0000 (17:19 +0000)]
[LLParser] Simplify type checking in ParseArithmetic and ParseUnaryOp.
Summary:
These methods previously took a 0, 1, or 2 to indicate what types were allowed, but the 0 encoding which meant both fp and integer types has been unused for years. Its leftover from when add/sub/mul used to be shared between int and fp
Simplify it by changing it to just a bool to distinquish int and fp.
Reviewers: spatel, dblaikie, jyknight, arsenm
Reviewed By: spatel
Subscribers: wdng, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61561
llvm-svn: 359986
Craig Topper [Sun, 5 May 2019 17:19:16 +0000 (17:19 +0000)]
[Constants] Simplify type checking switch in ConstantExpr::get.
Summary:
Remove duplicate checks that both operands have the same type. This is checked
before the switch.
Use 'integer' or 'floating-point' instead of 'arithmetic' type. I think this
might be a leftover to the days when floating point and integer operations
shared the same opcodes.
Reviewers: spatel, RKSimon, dblaikie
Reviewed By: RKSimon
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D61558
llvm-svn: 359985
Simon Pilgrim [Sun, 5 May 2019 17:10:05 +0000 (17:10 +0000)]
Revert rL359962 : Use DiagRuntimeBehavior for -Wunsequenced to weed out false positives
where either the modification or the other access is unreachable.
........
Try to fix buildbots
llvm-svn: 359984
Andrea Di Biagio [Sun, 5 May 2019 16:07:27 +0000 (16:07 +0000)]
[MCA] Notify event listeners when instructions transition to the Pending state. NFCI
llvm-svn: 359983
Cameron McInally [Sun, 5 May 2019 16:07:09 +0000 (16:07 +0000)]
Add FNeg IR constant folding support
llvm-svn: 359982
Simon Pilgrim [Sun, 5 May 2019 12:51:47 +0000 (12:51 +0000)]
[X86] Make X86RegisterInfo(const Triple &TT) constructor explicit.
Fixes cppcheck warning.
llvm-svn: 359981
Nicolas Lesser [Sun, 5 May 2019 12:35:12 +0000 (12:35 +0000)]
[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
Nicolas Lesser [Sun, 5 May 2019 12:15:17 +0000 (12:15 +0000)]
[C++] Interpret unknown identifier in parameter clause as unknown type
instead of as parameter name without a type.
llvm-svn: 359979
Michal Gorny [Sun, 5 May 2019 12:06:32 +0000 (12:06 +0000)]
[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
Michal Gorny [Sun, 5 May 2019 12:06:22 +0000 (12:06 +0000)]
[lldb] [lit] Fix more filename mismatches in Register tests
llvm-svn: 359977
Simon Pilgrim [Sun, 5 May 2019 12:00:14 +0000 (12:00 +0000)]
[X86] Fix some cppcheck "Local variable name shadows outer variable" warnings. NFCI.
llvm-svn: 359976
Simon Pilgrim [Sun, 5 May 2019 10:37:38 +0000 (10:37 +0000)]
[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
Simon Pilgrim [Sun, 5 May 2019 10:30:04 +0000 (10:30 +0000)]
[SelectionDAG] Use any_of/all_of where possible. NFCI.
llvm-svn: 359974
Simon Pilgrim [Sun, 5 May 2019 10:27:45 +0000 (10:27 +0000)]
Move Value *RHSCIOp def into the scope where its actually used. NFCI.
llvm-svn: 359973
Cameron McInally [Sat, 4 May 2019 14:56:08 +0000 (14:56 +0000)]
Add InstCombine tests for FNeg instruction.
llvm-svn: 359970
Sanjay Patel [Sat, 4 May 2019 12:46:32 +0000 (12:46 +0000)]
[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
Nicolas Lesser [Sat, 4 May 2019 11:28:11 +0000 (11:28 +0000)]
[NFC] Add parentheses to avoid -Wparentheses.
llvm-svn: 359968
Hamza Sood [Sat, 4 May 2019 10:49:46 +0000 (10:49 +0000)]
[c++20] Implement P0428R2 - Familiar template syntax for generic lambdas
Differential Revision: https://reviews.llvm.org/D36527
llvm-svn: 359967
Nicolas Lesser [Sat, 4 May 2019 10:21:50 +0000 (10:21 +0000)]
[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
Fangrui Song [Sat, 4 May 2019 09:12:18 +0000 (09:12 +0000)]
[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
Richard Smith [Sat, 4 May 2019 06:46:18 +0000 (06:46 +0000)]
[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
Stanislav Mekhanoshin [Sat, 4 May 2019 06:40:20 +0000 (06:40 +0000)]
[AMDGPU] Fixed asan error after D61536
llvm-svn: 359963
Richard Smith [Sat, 4 May 2019 05:20:14 +0000 (05:20 +0000)]
Use DiagRuntimeBehavior for -Wunsequenced to weed out false positives
where either the modification or the other access is unreachable.
llvm-svn: 359962
Stanislav Mekhanoshin [Sat, 4 May 2019 04:30:57 +0000 (04:30 +0000)]
AMDGPU] gfx1010 hazard recognizer
Differential Revision: https://reviews.llvm.org/D61536
llvm-svn: 359961
Richard Trieu [Sat, 4 May 2019 04:22:33 +0000 (04:22 +0000)]
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
Stanislav Mekhanoshin [Sat, 4 May 2019 04:20:37 +0000 (04:20 +0000)]
[AMDGPU] gfx1010: use fmac instructions
Differential Revision: https://reviews.llvm.org/D61527
llvm-svn: 359959
Richard Smith [Sat, 4 May 2019 04:00:45 +0000 (04:00 +0000)]
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
Petr Hosek [Sat, 4 May 2019 00:55:14 +0000 (00:55 +0000)]
[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
Richard Smith [Sat, 4 May 2019 00:27:21 +0000 (00:27 +0000)]
[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
Richard Smith [Sat, 4 May 2019 00:23:18 +0000 (00:23 +0000)]
[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
Lang Hames [Sat, 4 May 2019 00:23:09 +0000 (00:23 +0000)]
[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
Nicolas Lesser [Sat, 4 May 2019 00:09:00 +0000 (00:09 +0000)]
[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
Richard Smith [Fri, 3 May 2019 23:51:38 +0000 (23:51 +0000)]
CWG issue 727: Fix numerous bugs in support for class-scope explicit
specializations for variable templates.
llvm-svn: 359947
Saleem Abdulrasool [Fri, 3 May 2019 23:19:27 +0000 (23:19 +0000)]
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
Owen Pan [Fri, 3 May 2019 23:15:40 +0000 (23:15 +0000)]
[clang-format] Fix bug in block comment reflow that joins * and /
Fixes PR41213
Differential Revision: https://reviews.llvm.org/D61276
llvm-svn: 359943
Alexander Kornienko [Fri, 3 May 2019 23:11:32 +0000 (23:11 +0000)]
[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
Sanjay Patel [Fri, 3 May 2019 22:47:29 +0000 (22:47 +0000)]
[x86] add tests for fneg IR with undef; NFC
llvm-svn: 359941
Jessica Paquette [Fri, 3 May 2019 22:37:46 +0000 (22:37 +0000)]
[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
Craig Topper [Fri, 3 May 2019 22:03:29 +0000 (22:03 +0000)]
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
Stanislav Mekhanoshin [Fri, 3 May 2019 21:53:53 +0000 (21:53 +0000)]
[AMDGPU] gfx1010 wait count insertion
Differential Revision: https://reviews.llvm.org/D61534
llvm-svn: 359938
Stanislav Mekhanoshin [Fri, 3 May 2019 21:26:39 +0000 (21:26 +0000)]
[AMDGPU] gfx1010 s_code_end generation
Also add some missing metadata in the streamer.
Differential Revision: https://reviews.llvm.org/D61531
llvm-svn: 359937
Cameron McInally [Fri, 3 May 2019 21:19:12 +0000 (21:19 +0000)]
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
Stanislav Mekhanoshin [Fri, 3 May 2019 21:17:29 +0000 (21:17 +0000)]
[AMDGPU] gfx1010 loop alignment
Differential Revision: https://reviews.llvm.org/D61529
llvm-svn: 359935
Mandeep Singh Grang [Fri, 3 May 2019 21:12:36 +0000 (21:12 +0000)]
[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
Mandeep Singh Grang [Fri, 3 May 2019 21:12:24 +0000 (21:12 +0000)]
[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
Raphael Isemann [Fri, 3 May 2019 21:01:45 +0000 (21:01 +0000)]
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
Jonas Devlieghere [Fri, 3 May 2019 20:58:56 +0000 (20:58 +0000)]
[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
Jonas Devlieghere [Fri, 3 May 2019 20:42:45 +0000 (20:42 +0000)]
[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
Jonas Devlieghere [Fri, 3 May 2019 20:37:09 +0000 (20:37 +0000)]
[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
Jonas Devlieghere [Fri, 3 May 2019 20:33:58 +0000 (20:33 +0000)]
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
Adrian Prantl [Fri, 3 May 2019 20:28:19 +0000 (20:28 +0000)]
Supply a default implementation of IsRuntimeSupportValue.
Thanks to Pavel for pointing this out.
llvm-svn: 359925
Reid Kleckner [Fri, 3 May 2019 20:17:14 +0000 (20:17 +0000)]
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
Alexey Bataev [Fri, 3 May 2019 20:00:38 +0000 (20:00 +0000)]
[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
Shafik Yaghmour [Fri, 3 May 2019 19:59:22 +0000 (19:59 +0000)]
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
David Carlier [Fri, 3 May 2019 19:46:55 +0000 (19:46 +0000)]
[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
Matt Arsenault [Fri, 3 May 2019 19:06:57 +0000 (19:06 +0000)]
Reapply r359906, "RegAllocFast: Add heuristic to detect values not live-out of a block"
This reverts commit r359912.
This should pass now, since the clang test was made less fragile in
r359918.
llvm-svn: 359919
Matt Arsenault [Fri, 3 May 2019 19:04:14 +0000 (19:04 +0000)]
Ensure there is stack usage in stack size warning test
r359906 broke this because the only stack usage was from a spill which
can be avoided since the only block is a return.
llvm-svn: 359918
Don Hinton [Fri, 3 May 2019 18:56:25 +0000 (18:56 +0000)]
[CommandLine] Enable Grouping for short options by default. Part 4 of 5
Summary:
This change enables `cl::Grouping` for short options --
options with names of a single character. This is consistent with GNU
getopt behavior.
Reviewers: rnk, MaskRay
Reviewed By: MaskRay
Subscribers: thopre, cfe-commits, MaskRay, rupprecht, hiraditya, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D61270
llvm-svn: 359917
Nico Weber [Fri, 3 May 2019 18:54:18 +0000 (18:54 +0000)]
Attempt to fix the clang-sphinx-docs bot after r358797
llvm-svn: 359916
Simon Pilgrim [Fri, 3 May 2019 18:20:28 +0000 (18:20 +0000)]
[DAGCombine] Remove repeated variables. NFCI.
llvm-svn: 359915
Evgeniy Stepanov [Fri, 3 May 2019 18:20:16 +0000 (18:20 +0000)]
[hwasan] Fix HWASAN_WITH_INTERCEPTORS=OFF build on not-android.
Summary:
I'm not aware of any platforms where this will work, but the code should at least compile.
HWASAN_WITH_INTERCEPTORS=OFF means there is magic in libc that would call __hwasan_thread_enter /
__hwasan_thread_exit as appropriate.
Reviewers: pcc, winksaville
Subscribers: srhines, kubamracek, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D61337
llvm-svn: 359914
David Blaikie [Fri, 3 May 2019 18:11:31 +0000 (18:11 +0000)]
Remove else-after-return
llvm-svn: 359913
Nico Weber [Fri, 3 May 2019 18:08:03 +0000 (18:08 +0000)]
Revert r359906, "RegAllocFast: Add heuristic to detect values not live-out of a block"
Makes clang/test/Misc/backend-stack-frame-diagnostics-fallback.cpp fail.
llvm-svn: 359912
Simon Pilgrim [Fri, 3 May 2019 18:02:33 +0000 (18:02 +0000)]
[TargetLowering] SimplifySetCC - remove repeated variable. NFCI.
Also reduce scope of Temp variable.
llvm-svn: 359911
Gheorghe-Teodor Bercea [Fri, 3 May 2019 17:59:18 +0000 (17:59 +0000)]
[CUDA][Clang][Bugfix] Add missing CUDA 9.2 case
Summary:
The bug was reported on the OpenMP-dev list:
.../obj-release/lib/clang/9.0.0/include/__clang_cuda_intrinsics.h:173:35: error: '__nvvm_shfl_sync_idx_i32' needs target feature ptx60|ptx61|ptx63|ptx64
__MAKE_SYNC_SHUFFLES(__shfl_sync, __nvvm_shfl_sync_idx_i32,
This problem occurs when trying to compile a .cu file that requires a newer ptx version (>ptx60 in this case) than ptx42.
Reviewers: tra, ABataev, caomhin
Reviewed By: tra
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61474
llvm-svn: 359910
Don Hinton [Fri, 3 May 2019 17:47:29 +0000 (17:47 +0000)]
[CommandLine] Change help output to prefix long options with `--` instead of `-`. NFC . Part 3 of 5
Summary:
By default, `parseCommandLineOptions()` will accept either a
`-` or `--` prefix for long options -- options with names longer than
a single character.
While this change does not affect behavior, it will be helpful with a
subsequent change that requires long options use the `--` prefix.
Reviewers: rnk, thopre
Reviewed By: thopre
Subscribers: thopre, cfe-commits, hiraditya, llvm-commits
Tags: #llvm, #clang
Differential Revision: https://reviews.llvm.org/D61269
llvm-svn: 359909
Evgeniy Stepanov [Fri, 3 May 2019 17:31:49 +0000 (17:31 +0000)]
Revert "[CodeGenPrepare] limit overflow intrinsic matching to a single basic block"
This reverts commit r359879, which introduced a compiler crash.
llvm-svn: 359908
Nico Weber [Fri, 3 May 2019 17:26:17 +0000 (17:26 +0000)]
Mark is_trivially_destructible as unsupported with apple-clang-9
See discussion on https://reviews.llvm.org/D48292
llvm-svn: 359907
Matt Arsenault [Fri, 3 May 2019 17:03:24 +0000 (17:03 +0000)]
RegAllocFast: Add heuristic to detect values not live-out of a block
Add an improved/new heuristic to catch more cases when values are not
live out of a basic block.
Patch by Matthias Braun
llvm-svn: 359906
Brian Cain [Fri, 3 May 2019 16:50:38 +0000 (16:50 +0000)]
[hexagon] change AsmParser assertion to error
For immediates that can't be evaluated in assembler-mapped instructions, we
should return 'invalid operand' instead of assert.
llvm-svn: 359905
Yonghong Song [Fri, 3 May 2019 16:40:16 +0000 (16:40 +0000)]
[Docs][CodeGenerator][eBPF] Correct the values for BPF_X and BPF_K
Fix the values of BPF_X and BPF_K according to BPFInstrFormats.td:
"
def BPF_K : BPFSrcType<0x0>;
def BPF_X : BPFSrcType<0x1>;
"
The right value for BPF_X is 0x1, and the right value for BPF_K is 0x0.
Signed-off-by: Wang YanQing <udknight@gmail.com>
Differential Revision: https://reviews.llvm.org/D61512
llvm-svn: 359904
Craig Topper [Fri, 3 May 2019 16:15:15 +0000 (16:15 +0000)]
[X86] Allow assembly parser to accept x/y/z suffixes on non-memory vfpclassps/pd and on memory forms in intel syntax
The x/y/z suffix is needed to disambiguate the memory form in at&t syntax since no xmm/ymm/zmm register is mentioned.
But we should also allow it for the register and broadcast forms where its not needed for consistency. This matches gas.
The printing code will still only use the suffix for the memory form where it is needed.
llvm-svn: 359903
Don Hinton [Fri, 3 May 2019 16:15:13 +0000 (16:15 +0000)]
[llvm] Revert r231274: "Devirtualize ~parser<T> by making it protected in base classes and making derived classes final"
Summary: This patch was previously applied in r231221, and reverted in
r231254 because it broke self-hosting. It was subsequently fixed and
reapplied in r231274. Unfortunately, making the `parser<T>` classes
final prevents inheritance which makes it impossible to implement
custom parsers.
Reverting r231221 restores the ability to customize parsers.
Reviewers: dblaikie
Reviewed By: dblaikie
Subscribers: craig.topper, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60955
llvm-svn: 359902
Simon Pilgrim [Fri, 3 May 2019 15:56:06 +0000 (15:56 +0000)]
[X86] LowerToHorizontalOp - Tidyup calls to getHopForBuildVector. NFCI.
Merge the if() tests for the various HADD/SUB + Subtarget tests
llvm-svn: 359901
Simon Pilgrim [Fri, 3 May 2019 15:50:37 +0000 (15:50 +0000)]
[SelectionDAG] CreateTopologicalOrder - don't use iterator
We shouldn't use an iterator to loop across a std::vector when the same loop is adding elements to that std::vector
Found by cppcheck
llvm-svn: 359900
Matt Arsenault [Fri, 3 May 2019 15:37:07 +0000 (15:37 +0000)]
AMDGPU: Select VOP3 form of sub
The VOP3 form should always be the preferred selection form to be
shrunk later.
The r600 sub test needs to be split out because it asserts on the
arguments in the new test during the calling convention lowering.
llvm-svn: 359899
Matt Arsenault [Fri, 3 May 2019 15:21:53 +0000 (15:21 +0000)]
AMDGPU: Support shrinking add with FI in SIFoldOperands
Avoids test regression in a future patch
llvm-svn: 359898
Robert Lougher [Fri, 3 May 2019 15:14:19 +0000 (15:14 +0000)]
Revert r359549 - incorrect update of test checks. NFC
llvm-svn: 359897
Sanjay Patel [Fri, 3 May 2019 15:09:53 +0000 (15:09 +0000)]
[x86] add tests for fneg with undefs; NFC
This was originally part of D61419.
llvm-svn: 359896
Matt Arsenault [Fri, 3 May 2019 15:08:36 +0000 (15:08 +0000)]
AMDGPU: Remove redundant patterns for shifts
llvm-svn: 359895
Matt Arsenault [Fri, 3 May 2019 15:08:35 +0000 (15:08 +0000)]
AMDGPU: Remove redundant patterns for sub
There were 2 patterns for sub, one selecting to sub and one to
subrev. Only one of these will succeed, so remove the reversed one.
llvm-svn: 359894
Matt Arsenault [Fri, 3 May 2019 14:54:38 +0000 (14:54 +0000)]
AMDGPU: Add baseline test for future patch
llvm-svn: 359893
Alexey Bataev [Fri, 3 May 2019 14:47:20 +0000 (14:47 +0000)]
[OPENMP][NVPTX]Improved several standard OpenMP functions, NFC.
Summary:
Used parallelLevel[] counter to simplify and improve implementation of
the existing standard OpenMP functions. Functions are tested already in
several tests, the patch is NFC.
Reviewers: grokos, gtbercea, kkwli0
Subscribers: guansong, jdoerfert, caomhin, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D61459
llvm-svn: 359892
Matt Arsenault [Fri, 3 May 2019 14:40:10 +0000 (14:40 +0000)]
AMDGPU: Replace shrunk instruction with dummy implicit_def
This was broken if the original operand was killed. The kill flag
would appear on both instructions, and fail the verifier. Keep the
kill flag, but remove the operands from the old instruction. This has
an added benefit of really reducing the use count for future folds.
Ideally the pass would be structured more like what PeepholeOptimizer
does to avoid this hack to avoid breaking instruction iterators.
llvm-svn: 359891
Simon Pilgrim [Fri, 3 May 2019 14:38:24 +0000 (14:38 +0000)]
[TargetLowering] ShrinkDemandedConstant - reduce scope of TLO.DAG variable. NFCI.
Only ever used in one block
llvm-svn: 359890
Simon Pilgrim [Fri, 3 May 2019 14:37:00 +0000 (14:37 +0000)]
[X86] Remove repeated variables. NFCI.
llvm-svn: 359889
Nico Weber [Fri, 3 May 2019 14:27:12 +0000 (14:27 +0000)]
gn build: Merge r359878
llvm-svn: 359888
Sid Manning [Fri, 3 May 2019 14:14:01 +0000 (14:14 +0000)]
Let --discard-all imply --strip-debug.
This will match gnu strip's behavior.
Differential Revision: https://reviews.llvm.org/D61092
llvm-svn: 359887
Simon Pilgrim [Fri, 3 May 2019 14:07:38 +0000 (14:07 +0000)]
[X86] Add X64 common prefixes and regenerate mul i64 tests
Noticed while reviewing D61472
llvm-svn: 359886
Matt Arsenault [Fri, 3 May 2019 13:55:40 +0000 (13:55 +0000)]
AMDGPU: Forgot to commit test file for r358890
llvm-svn: 359885
Simon Pilgrim [Fri, 3 May 2019 13:50:38 +0000 (13:50 +0000)]
Avoid cppcheck operator precedence warnings. NFCI.
Prefer ((X & Y) ? A : B) to (X & Y ? A : B)
llvm-svn: 359884
Matt Arsenault [Fri, 3 May 2019 13:42:56 +0000 (13:42 +0000)]
AMDGPU: Fix incorrect commute with sub when folding immediates
When a fold of an immediate into a sub/subrev required shrinking the
instruction, the wrong VOP2 opcode was used. This was using the VOP2
equivalent of the original instruction, not the commuted instruction
with the inverted opcode.
llvm-svn: 359883
Matt Arsenault [Fri, 3 May 2019 13:42:55 +0000 (13:42 +0000)]
AMDGPU: Fix test verification
This should run the verifier, and needs to enable trackRegLiveness.
llvm-svn: 359882
Sanjay Patel [Fri, 3 May 2019 13:25:06 +0000 (13:25 +0000)]
[LICM] auto-generate complete test checks; NFC
llvm-svn: 359881
Sam McCall [Fri, 3 May 2019 13:17:29 +0000 (13:17 +0000)]
[clangd] Fix header-guard check for include insertion, and don't index header guards.
Summary:
Both of these attempt to check whether a header guard exists while parsing the
file. However the file is only marked as guarded once clang finishes processing
it. We defer the checks and work until SymbolCollector::finish().
This is ugly and ad-hoc, deferring *all* work might be cleaner.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61442
llvm-svn: 359880