Simon Pilgrim [Mon, 25 Mar 2019 18:51:57 +0000 (18:51 +0000)]
[SelectionDAG] Add icmp UNDEF handling to SelectionDAG::FoldSetCC
First half of PR40800, this patch adds DAG undef handling to icmp instructions to match the behaviour in llvm::ConstantFoldCompareInstruction and SimplifyICmpInst, this permits constant folding of vector comparisons where some elements had been reduced to UNDEF (by SimplifyDemandedVectorElts etc.).
This involved a lot of tweaking to reduced tests as bugpoint loves to reduce icmp arguments to undef........
Differential Revision: https://reviews.llvm.org/D59363
llvm-svn: 356938
Teresa Johnson [Mon, 25 Mar 2019 18:38:48 +0000 (18:38 +0000)]
[CGP] Build the DominatorTree lazily
Summary:
In r355512 CGP was changed to build the DominatorTree only once per
function traversal, to avoid repeatedly building it each time it was
accessed. This solved one compile time issue but introduced another. In
the second case, we now were building the DT unnecessarily many times
when we performed many function traversals (i.e. more than once per
function when running CGP because of changes made each time).
Change to saving the DT in the CodeGenPrepare object, and building it
lazily when needed. It is reset whenever we need to rebuild it.
The case that exposed the issue there are 617 functions, and we walk
them (i.e. execute the "while (MadeChange)" loop in runOnFunction) a
total of 12083 times (so previously we were building the DT 12083
times). With this patch we only build the DT 844 times (average of 1.37
times per function). We dropped the total time to compile this file from
538.11s without this patch to 339.63s with it.
There is still an issue as CGP is taking much longer than all other
passes even with this patch, and before a recent compiler release cut at
r355392 the total time to this compile was only 97 sec with a huge
reduction in CGP time. I suspect that one of the other recent changes to
CGP led to iterating each function many more times on average, but I
need to do some more investigation.
Reviewers: spatel
Subscribers: jdoerfert, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59696
llvm-svn: 356937
Dimitry Andric [Mon, 25 Mar 2019 18:37:49 +0000 (18:37 +0000)]
Fix interoperability test compilation on FreeBSD
Summary:
While building the 8.0 releases on FreeBSD, I encountered the following
error in the regression tests, where ompt/misc/interoperability.cpp
failed to compile, with:
```
projects/openmp/runtime/test/ompt/misc/interoperability.cpp:7:10: fatal error: 'alloca.h' file not found
#include <alloca.h>
^~~~~~~~~~
```
Like on NetBSD, alloca(3) is defined in <stdlib.h> instead.
Reviewers: emaste, jlpeyton, krytarowski, mgorny, protze.joachim
Reviewed By: jlpeyton
Subscribers: jdoerfert, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D59736
llvm-svn: 356936
Louis Dionne [Mon, 25 Mar 2019 18:37:28 +0000 (18:37 +0000)]
[pstl] Gate usage of TBB in test on whether TBB is used as a backend
__PSTL_USE_PAR_POLICIES is the wrong macro to use there, since the PSTL
could conceivably be using parallel policies but not TBB as a backend.
llvm-svn: 356935
Dimitry Andric [Mon, 25 Mar 2019 18:37:14 +0000 (18:37 +0000)]
Fix gettid warnings on FreeBSD
Summary:
[Split off from D59451 to get this fix in separately]
While building the 8.0 releases on FreeBSD, I encountered the following
warnings in openmp quite a few times:
```
In file included from projects/openmp/runtime/src/kmp_settings.cpp:27:
projects/openmp/runtime/src/kmp_wrapper_getpid.h:35:2: warning: #warning is a language extension [-Wpedantic]
#warning No gettid found, use getpid instead
^
projects/openmp/runtime/src/kmp_wrapper_getpid.h:35:2: warning: No gettid found, use getpid instead [-W#warnings]
2 warnings generated.
```
I added a gettid wrapper that uses FreeBSD's pthread_getthreadid_np(3)
function for this.
Reviewers: emaste, jlpeyton, krytarowski, mgorny, protze.joachim
Reviewed By: jlpeyton
Subscribers: jfb, jdoerfert, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D59735
llvm-svn: 356934
Jonathan Peyton [Mon, 25 Mar 2019 18:17:55 +0000 (18:17 +0000)]
[OpenMP] Fix pause check with version info
Add 5.0 guard to pause code for now.
Patch by Terry Wilmarth
Differential Revision: https://reviews.llvm.org/D59428
llvm-svn: 356933
Thomas Lively [Mon, 25 Mar 2019 18:10:26 +0000 (18:10 +0000)]
Revert "[WebAssembly] Add linker options to control feature checking"
This reverts commit
5991328c96b6146999cfa74ede42901f8c01f2fa.
llvm-svn: 356932
Sylvestre Ledru [Mon, 25 Mar 2019 18:06:20 +0000 (18:06 +0000)]
clang -dumpversion returns 4.2.1 for legacy reason, update it
Summary:
It has been introduced in 2011 for gcc compat:
https://github.com/llvm-mirror/clang/commit/
95a907fc0f2f717dca38a379c1d2353bfea06d4f
it is probably time to remove it to remove the confusion.
reported: https://bugs.llvm.org/show_bug.cgi?id=38836
https://bugs.launchpad.net/ubuntu/+source/llvm-defaults/+bug/
1810860
Reviewers: ddunbar, rnk
Reviewed By: rnk
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D56803
llvm-svn: 356931
Sanjay Patel [Mon, 25 Mar 2019 17:53:56 +0000 (17:53 +0000)]
[x86] add another vector zext test; NFC
Goes with the proposal in D59777
llvm-svn: 356930
Mikhail R. Gadelha [Mon, 25 Mar 2019 17:47:45 +0000 (17:47 +0000)]
Moved everything SMT-related to LLVM and updated the cmake scripts.
Differential Revision: https://reviews.llvm.org/D54978
llvm-svn: 356929
Krasimir Georgiev [Mon, 25 Mar 2019 17:29:16 +0000 (17:29 +0000)]
[clang-format] Refine structured binding detection
Summary:
Revision r356575 had the unfortunate consequence that now clang-format never
detects an ObjC call expression after `&&`.
This patch tries harder to distinguish between C++17 structured bindings and
ObjC call expressions and adds a few regression tests.
Reviewers: klimek
Reviewed By: klimek
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59774
llvm-svn: 356928
Jonas Devlieghere [Mon, 25 Mar 2019 17:27:14 +0000 (17:27 +0000)]
[Args] Handle backticks to prevent crash.
Currently LLDB crashes when autocompleting a command that ends with a
backtick because the quote character wasn't handled. This fixes that and
adds a unit test for this function.
Differential revision: https://reviews.llvm.org/D59779
llvm-svn: 356927
Matt Arsenault [Mon, 25 Mar 2019 17:15:44 +0000 (17:15 +0000)]
MISched: Don't schedule regions with 0 instructions
I think this is correct, but may not necessarily be the correct fix
for the assertion I'm really trying to solve. If a scheduling region
was found that only has dbg_value instructions, the RegPressure
tracker would end up in an inconsistent state because it would skip
over any debug instructions and point to an instruction outside of the
scheduling region. It may still be possible for this to happen if
there are some real schedulable instructions between dbg_values, but I
haven't managed to break this.
The testcase is extremely sensitive and I'm not sure how to make it
more resistent to future scheduler changes that would avoid stressing
this situation.
llvm-svn: 356926
Bruno Ricci [Mon, 25 Mar 2019 17:08:51 +0000 (17:08 +0000)]
[Sema][NFCI] Don't allocate storage for the various CorrectionCandidateCallback unless we are going to do some typo correction
The various CorrectionCandidateCallbacks are currently heap-allocated
unconditionally. This was needed because of delayed typo correction.
However these allocations represent currently 15.4% of all allocations
(number of allocations) when parsing all of Boost (!), mostly because
of ParseCastExpression, ParseStatementOrDeclarationAfterAttrtibutes
and isCXXDeclarationSpecifier. Note that all of these callback objects
are small. Let's not do this.
Instead initially allocate the callback on the stack, and only do a
heap allocation if we are going to do some typo correction. Do this by:
1. Adding a clone function to each callback, which will do a polymorphic
clone of the callback. This clone function is required to be implemented
by every callback (of which there is a fair amount). Make sure this is
the case by making it pure virtual.
2. Use this clone function when we are going to try to correct a typo.
This additionally cut the time of -fsyntax-only on all of Boost by 0.5%
(not that much, but still something). No functional changes intended.
Differential Revision: https://reviews.llvm.org/D58827
Reviewed By: rnk
llvm-svn: 356925
Tom Stellard [Mon, 25 Mar 2019 17:01:29 +0000 (17:01 +0000)]
merge-request.sh: Update 8.0 metabug for 8.0.1
llvm-svn: 356924
Nico Weber [Mon, 25 Mar 2019 16:50:24 +0000 (16:50 +0000)]
Attempt to fix sphinx bot after r356897
llvm-svn: 356923
Matt Arsenault [Mon, 25 Mar 2019 16:47:42 +0000 (16:47 +0000)]
AMDGPU: Preserve LiveIntervals in WQM
This seems to already be done, but wasn't marked.
llvm-svn: 356922
Louis Dionne [Mon, 25 Mar 2019 16:44:08 +0000 (16:44 +0000)]
[pstl] Make sure unit tests exit with a non-zero error code when they fail
The previous test system would only print errors to stderr, however CMake
(and lit) detect failure via the program returning a non-zero error code.
So all the tests would always pretend they passed.
llvm-svn: 356921
Evandro Menezes [Mon, 25 Mar 2019 16:38:48 +0000 (16:38 +0000)]
[clang] Remove cmake warning message (NFC)
Recognize an empty string for CLANG_DEFAULT_UNWINDLIB as a valid option.
llvm-svn: 356920
James Henderson [Mon, 25 Mar 2019 16:36:26 +0000 (16:36 +0000)]
[llvm-objcopy]Preserve data in segments not covered by sections
llvm-objcopy previously knew nothing about data in segments that wasn't
covered by section headers, meaning that it wrote zeroes instead of what
was there. As it is possible for this data to be useful to the loader,
this patch causes llvm-objcopy to start preserving this data. Data in
sections that are explicitly removed continues to be written as zeroes.
This fixes https://bugs.llvm.org/show_bug.cgi?id=41005.
Reviewed by: jakehehrlich, rupprecht
Differential Revision: https://reviews.llvm.org/D59483
llvm-svn: 356919
Marshall Clow [Mon, 25 Mar 2019 16:35:59 +0000 (16:35 +0000)]
Cleaup of requirements for optional. While researching LWG3196, I realized that optional did not reject 'const in_place_t' like it should. Added a test as well, and a check for arrays (which were already disallowed, but now we get a better error message). Should not affect anyone's code.
llvm-svn: 356918
Louis Dionne [Mon, 25 Mar 2019 16:20:49 +0000 (16:20 +0000)]
[PSTL][NFC] Add missing #include
llvm-svn: 356917
Ilya Biryukov [Mon, 25 Mar 2019 16:18:56 +0000 (16:18 +0000)]
[clangd] Add .cu files to VSCode extension
Summary:
clangd should be able to handle those with a proper compilation
database. However, users using 'nvcc' might start seeing spurious errors
in '.cu' files after this change.
My plan is to land and release this, but be ready to revert in
case of negative user feedback.
Reviewers: hokein
Reviewed By: hokein
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59759
llvm-svn: 356916
Simon Pilgrim [Mon, 25 Mar 2019 16:14:21 +0000 (16:14 +0000)]
[SLPVectorizer] Update file missed in rL356913
Differential Revision: https://reviews.llvm.org/D59738
llvm-svn: 356915
Sanjay Patel [Mon, 25 Mar 2019 15:54:34 +0000 (15:54 +0000)]
[x86] add tests for vector zext; NFC
The AVX1 lowering is poor.
llvm-svn: 356914
Simon Pilgrim [Mon, 25 Mar 2019 15:53:55 +0000 (15:53 +0000)]
[SLPVectorizer] reorderInputsAccordingToOpcode - remove non-Instruction canonicalization
Remove attempts to commute non-Instructions to the LHS - the codegen changes appear to rely on chance more than anything else and also have a tendency to fight existing instcombine canonicalization which moves constants to the RHS of commutable binary ops.
This is prep work towards:
(a) reusing reorderInputsAccordingToOpcode for alt-shuffles and removing the similar reorderAltShuffleOperands
(b) improving reordering to optimized cases with commutable and non-commutable instructions to still find splat/consecutive ops.
Differential Revision: https://reviews.llvm.org/D59738
llvm-svn: 356913
Haojian Wu [Mon, 25 Mar 2019 15:46:07 +0000 (15:46 +0000)]
Revert "[clang-format] Keep protobuf "package" statement on one line"
This reverts commit r356835. This patch causes a regression, see the
test below:
verifyFormat("// Detached comment\n\n"
"// Leading comment\n"
"syntax = \"proto2\"; // trailing comment\n\n"
"// in foo.bar package\n"
"package foo.bar; // foo.bar package\n");
llvm-svn: 356912
Adrian Prantl [Mon, 25 Mar 2019 15:38:18 +0000 (15:38 +0000)]
Update the lldb driver to support the -O and -S options when passing --repl
At the moment when --repl is passed to lldb it silently ignores any
commands passed via the options below:
--one-line-before-file <command>
Tells the debugger to execute this one-line lldb command before any file provided on the command line has been loaded.
--one-line <command>
Tells the debugger to execute this one-line lldb command after any file provided on the command line has been loaded.
--source-before-file <file>
Tells the debugger to read in and execute the lldb commands in the given file, before any file has been loaded.
--source <file>
Tells the debugger to read in and execute the lldb commands in the given file, after any file has been loaded.
-O <value> Alias for --one-line-before-file
-o <value> Alias for --one-line
-S <value> Alias for --source-before-file
-s <value> Alias for --source
The -O and -S options are quite useful when writing tests for the REPL
though, e.g. to change settings prior to entering REPL mode. This
patch updates the driver to still respect the commands supplied via -O
and -S when passing --repl instead of silently ignoring them. As -s
and -o don't really make sense in REPL mode, commands supplied via
those options are still ignored, but the driver now emits a warning to
make that clear to the user.
Patch by Nathan Hawes!
Differential Revision: https://reviews.llvm.org/D59681
llvm-svn: 356911
Serge Guelton [Mon, 25 Mar 2019 15:23:34 +0000 (15:23 +0000)]
Python 2/3 compat: StringIO
Differential Revision: https://reviews.llvm.org/D59582
llvm-svn: 356910
Serge Guelton [Mon, 25 Mar 2019 15:22:41 +0000 (15:22 +0000)]
Python 2/3 compat: tkinter
Differential Revision: https://reviews.llvm.org/D59586
llvm-svn: 356909
Serge Guelton [Mon, 25 Mar 2019 15:21:29 +0000 (15:21 +0000)]
Python 2/3 compat: str vs basestring
Differential Revision: https://reviews.llvm.org/D59589
llvm-svn: 356908
Serge Guelton [Mon, 25 Mar 2019 15:18:55 +0000 (15:18 +0000)]
Revert 356905
Commited from wrong directory...
llvm-svn: 356907
Serge Guelton [Mon, 25 Mar 2019 15:14:56 +0000 (15:14 +0000)]
Python 2/3 compat: queue vs Queue
Differential Revision: https://reviews.llvm.org/D59590
llvm-svn: 356906
Serge Guelton [Mon, 25 Mar 2019 15:14:15 +0000 (15:14 +0000)]
Python 2/3 compat: queue vs Queue
Differential Revision: https://reviews.llvm.org/D59590
llvm-svn: 356905
Serge Guelton [Mon, 25 Mar 2019 15:12:48 +0000 (15:12 +0000)]
Python 2/3 compat: unichr vs chr
llvm-svn: 356904
Louis Dionne [Mon, 25 Mar 2019 14:56:29 +0000 (14:56 +0000)]
[libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms
Summary:
I can't see a good reason to disallow this, even though it isn't the
standard way we build libc++ for Apple platforms.
Making this work on Apple platforms requires using different flags for
--whole-archive and removing the -D flag when running `ar` to merge
archives because that flag isn't supported by the `ar` shipped on Apple
platforms. This shouldn't be an issue since the -D option appears to be
enabled by default in GNU `ar`.
Reviewers: phosek, EricWF, serge-sans-paille
Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits
Differential Revision: https://reviews.llvm.org/D59513
llvm-svn: 356903
Alexander Kornienko [Mon, 25 Mar 2019 14:46:51 +0000 (14:46 +0000)]
[clang-tidy] ClangTidy.h -> ClangTidyCheck.h
llvm-svn: 356902
Pavel Labath [Mon, 25 Mar 2019 14:45:31 +0000 (14:45 +0000)]
MinidumpYAML.cpp: Fix some code standard violations missed during review
functions should begin with lower case letters. NFC.
llvm-svn: 356901
Louis Dionne [Mon, 25 Mar 2019 14:45:21 +0000 (14:45 +0000)]
[pstl][CMake] Move include() closer to its point of use
llvm-svn: 356900
Jonas Paulsson [Mon, 25 Mar 2019 14:28:32 +0000 (14:28 +0000)]
[RegAlloc] Simplify MIR test
Remove the IR part from test/CodeGen/X86/regalloc-copy-hints.mir (added by
r355854).
To make the test remain functional, the parts of the MBB names referring to
BB names have been removed, as well as all machine memory operands.
llvm-svn: 356899
Pavel Labath [Mon, 25 Mar 2019 14:09:27 +0000 (14:09 +0000)]
Minidump: Use minidump constants defined in llvm
This patch begins the process of migrating the "minidump" plugin to the
minidump parser in llvm. The llvm parser is not fully finished yet, but
even now, a lot of things can be switched over. The gradual migration
process will allow us to easier detect if things break than doing a big
one-step migration. Doing it early will allow us to make sure that the
llvm parser fits the use case that we need in lldb.
In this patch I start with the various minidump constants, which have
their llvm equivalent. It doesn't contain any functional changes. The
diff just reflects the different naming of things in llvm.
llvm-svn: 356898
Nico Weber [Mon, 25 Mar 2019 14:09:10 +0000 (14:09 +0000)]
Rename directory housing clang-include-fixer to be eponymous
Makes the name of this directory consistent with the names of the other
directories in clang-tools-extra.
Similar to r356254. No intended behavior change.
Differential Revision: https://reviews.llvm.org/D59750
llvm-svn: 356897
Pavel Labath [Mon, 25 Mar 2019 14:02:16 +0000 (14:02 +0000)]
Reapply minidump changes reverted in r356806
The changes were reverted due to ubsan errors (unaligned accesses). Here
I fix those errors by first copying the data into aligned storage.
Besides fixing alignment issues, this also fixes reading of minidump
strings on big-endian systems.
llvm-svn: 356896
Brock Wyma [Mon, 25 Mar 2019 13:50:26 +0000 (13:50 +0000)]
[DebugInfo] IntelJitEventListener follow up for "add SectionedAddress ..."
Following r354972 the Intel JIT Listener would not report line table
information because the section indices did not match. There was
a similar issue with the PerfJitEventListener. This change performs
the section index lookup when building the object address used to
query the line table information.
Differential Revision: https://reviews.llvm.org/D59490
llvm-svn: 356895
Haojian Wu [Mon, 25 Mar 2019 13:14:10 +0000 (13:14 +0000)]
[clangd] Add std subnamespace symbols to the symbol map.
Reviewers: ioeric, serge-sans-paille
Reviewed By: ioeric
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59364
llvm-svn: 356894
Haojian Wu [Mon, 25 Mar 2019 12:49:46 +0000 (12:49 +0000)]
[pp-trace] Use ClangTool in pp-trace, NFC
Summary:
This patch partially reverts the commit rL356849.
Unfortunately, tooling::createExecutorFromCommandLineArgs doesn't
corperate well with our internal infrastructure, which leads failing
lit tests. We use ClangTool at the moment, until we find a better
solution to smooth it.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59764
llvm-svn: 356893
Alexander Kornienko [Mon, 25 Mar 2019 12:38:26 +0000 (12:38 +0000)]
[clang-tidy] Switch checks to #include "ClangTidyCheck.h"
llvm-svn: 356892
Louis Dionne [Mon, 25 Mar 2019 12:37:51 +0000 (12:37 +0000)]
[pstl] Call the right overload of std::equal with an execution policy
Thanks to Mikhail Dvorskiy for the patch.
Differential Revision: https://reviews.llvm.org/D59705
llvm-svn: 356891
Alexander Kornienko [Mon, 25 Mar 2019 12:36:30 +0000 (12:36 +0000)]
[clang-tidy] Separate the check-facing interface
Summary:
Move ClangTidyCheck to a separate header/.cpp
Switch checks to #include "ClangTidyCheck.h"
Mention ClangTidyCheck.h in the docs
Reviewers: hokein, gribozavr, aaron.ballman
Reviewed By: hokein
Subscribers: mgorny, javed.absar, xazax.hun, arphaman, jdoerfert, llvm-commits, cfe-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D59714
llvm-svn: 356890
George Rimar [Mon, 25 Mar 2019 12:34:25 +0000 (12:34 +0000)]
[llvm-objcopy] - Refactor the code. NFC.
The idea of the patch is about to move out the code to a new
helper static functions (to reduce the size of 'handleArgs' and to
isolate the parts of it's logic).
Differential revision: https://reviews.llvm.org/D59762
llvm-svn: 356889
Anastasia Stulova [Mon, 25 Mar 2019 11:54:02 +0000 (11:54 +0000)]
[OpenCL] Allow addr space spelling without __ prefix in C++.
For backwards compatibility we allow alternative spelling of address
spaces - 'private', 'local', 'global', 'constant', 'generic'.
In order to accept 'private' correctly, parsing has been changed to
understand different use cases - access specifier vs address space.
Fixes PR40707 and PR41011!
Differential Revision: https://reviews.llvm.org/D59603
llvm-svn: 356888
Fangrui Song [Mon, 25 Mar 2019 11:40:11 +0000 (11:40 +0000)]
[pp-trace] Try fixing MSVC C2248 after rCTE356849
llvm-svn: 356887
Petar Avramovic [Mon, 25 Mar 2019 11:38:06 +0000 (11:38 +0000)]
[MIPS GlobalISel] Select copy for arguments from FPRBRegBank
Move selectCopy into MipsInstructionSelector class.
Select copy for arguments from FPRBRegBank for MIPS32.
Differential Revision: https://reviews.llvm.org/D59644
llvm-svn: 356886
Nico Weber [Mon, 25 Mar 2019 11:33:19 +0000 (11:33 +0000)]
gn build: Clean up README.rst a bit
- Make introduction a bit shorter
- Add a `git clone` step to Quick start
- Put command to run first in each of the Quick start steps
- Use ``code`` instead of `label` throughout; this is .rst not .md
Differential Revision: https://reviews.llvm.org/D59600
llvm-svn: 356885
Nico Weber [Mon, 25 Mar 2019 11:32:27 +0000 (11:32 +0000)]
gn build: Let get.py keep zip file in memory instead of using a temp file
The zip is small, and it's a bit less code this way.
No intended behavior change.
Differential Revision: https://reviews.llvm.org/D59677
llvm-svn: 356884
Petar Avramovic [Mon, 25 Mar 2019 11:30:46 +0000 (11:30 +0000)]
[MIPS GlobalISel] Add floating point register bank
Add floating point register bank for MIPS32.
Implement getRegBankFromRegClass for float register classes.
Differential Revision: https://reviews.llvm.org/D59643
llvm-svn: 356883
Petar Avramovic [Mon, 25 Mar 2019 11:23:41 +0000 (11:23 +0000)]
[MIPS GlobalISel] Lower float and double arguments in registers
Lower float and double arguments in registers for MIPS32.
When float/double argument is passed through gpr registers
select appropriate move instruction.
Differential Revision: https://reviews.llvm.org/D59642
llvm-svn: 356882
Xing GUO [Mon, 25 Mar 2019 11:02:49 +0000 (11:02 +0000)]
[llvm-readobj] Separate `Symbol Version` dumpers into `LLVM style` and `GNU style`
Summary:
Currently, llvm-readobj can dump symbol version sections only in LLVM style. In this patch, I would like to separate these dumpers into GNU style and
LLVM style for future implementation.
Reviewers: grimar, jhenderson, mattd, rupprecht
Reviewed By: jhenderson, rupprecht
Subscribers: ormris, dyung, RKSimon, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59186
llvm-svn: 356881
Ilya Biryukov [Mon, 25 Mar 2019 10:15:11 +0000 (10:15 +0000)]
[clangd] Send empty diagnostics when a file is closed
Summary:
The LSP clients cannot know clangd will not send diagnostic updates
for closed files, so we send them an empty list of diagnostics to
avoid showing stale diagnostics for closed files in the UI, e.g. in the
"Problems" pane of VSCode.
Fixes PR41217.
Reviewers: hokein
Reviewed By: hokein
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59757
llvm-svn: 356880
Haojian Wu [Mon, 25 Mar 2019 09:53:19 +0000 (09:53 +0000)]
Add llvm:: qualifer to make_unique, NFC
To avoid potential "make_unique is ambiguous" compiler errors.
llvm-svn: 356878
Hafiz Abid Qadeer [Mon, 25 Mar 2019 09:41:49 +0000 (09:41 +0000)]
Fix a broken comment line. NFC.
Just checking that commit access is working after licensing changes.
llvm-svn: 356876
Hans Wennborg [Mon, 25 Mar 2019 09:27:42 +0000 (09:27 +0000)]
Fix the build with GCC 4.8 after r356783
llvm-svn: 356875
Balazs Keri [Mon, 25 Mar 2019 09:16:39 +0000 (09:16 +0000)]
[ASTImporter] Changed use of Import to Import_New in ASTNodeImporter.
Reviewers: a.sidorin, shafik, martong, a_sidorin
Reviewed By: a_sidorin
Subscribers: a_sidorin, rnkovacs, gamesh411, dkrupp, martong, Szelethus, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D53757
llvm-svn: 356874
Sjoerd Meijer [Mon, 25 Mar 2019 08:54:47 +0000 (08:54 +0000)]
[TTI] Move getIntrinsicCost to allow functions to be overridden. NFC
Moving this to base class TargetTransformInfoImplCRTPBase allows static_cast to
a subtarget so that calls to e.g. getMemcpyCost actually go the overridden
functions.
Differential revision: https://reviews.llvm.org/D59706
llvm-svn: 356873
Diana Picus [Mon, 25 Mar 2019 08:54:29 +0000 (08:54 +0000)]
[ARM GlobalISel] 64-bit memops should be aligned
We currently use only VLDR/VSTR for all 64-bit loads/stores, so the
memory operands must be word-aligned. Mark aligned operations as legal
and narrow non-aligned ones to 32 bits.
While we're here, also mark non-power-of-2 loads/stores as unsupported.
llvm-svn: 356872
Clement Courbet [Mon, 25 Mar 2019 08:18:00 +0000 (08:18 +0000)]
[clang-tidy] Fix more false positives for bugprone-string-integer-assignment
Summary:
And add various tests gleaned for our codebase.
See PR27723.
Reviewers: JonasToth, alexfh, xazax.hun
Subscribers: rnkovacs, jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59360
llvm-svn: 356871
Craig Topper [Mon, 25 Mar 2019 07:22:18 +0000 (07:22 +0000)]
[X86] Update some of the getMachineNode calls from X86ISelDAGToDAG to also include a VT for a EFLAGS result.
This makes the nodes consistent with how they would be emitted from the isel
table.
llvm-svn: 356870
Craig Topper [Mon, 25 Mar 2019 06:53:45 +0000 (06:53 +0000)]
[X86] When selecting (x << C1) op C2 as (x op (C2>>C1)) << C1, use the operation VT for the target constant.
Normally when the nodes we use here(AND32ri8 for example) are selected their
immediates are just converted from ConstantSDNode to TargetConstantSDNode
without changing VT from the original operation VT. So we should still be
emitting them with the operation VT.
Theoretically this could expose more accurate opportunities for CSE.
llvm-svn: 356869
Craig Topper [Mon, 25 Mar 2019 06:53:44 +0000 (06:53 +0000)]
[X86] Remove GetLo8XForm and use GetLo32XForm instead. NFCI
We were using this to create an AND32ri8 node from a 64-bit and, but that node
normally still uses a 32-bit immediate. So we should just truncate the existing
immediate to i32. We already verified it has the same value in bits 31:7.
llvm-svn: 356868
Craig Topper [Mon, 25 Mar 2019 06:53:43 +0000 (06:53 +0000)]
[X86] Remove a couple unused SDNodeXForms. NFC
llvm-svn: 356867
Craig Topper [Mon, 25 Mar 2019 01:25:32 +0000 (01:25 +0000)]
Revert r356688 "[X86] Don't avoid folding multiple use sign extended 8-bit immediate into instructions under optsize."
Looking back over how the one use optimization works, I don't think this is the right way to fix this.
llvm-svn: 356866
Brian Gesiak [Mon, 25 Mar 2019 00:53:10 +0000 (00:53 +0000)]
Un-revert "[coroutines][PR40978] Emit error for co_yield within catch block"
Summary:
https://reviews.llvm.org/D59076 added a new coroutine error that
prevented users from using 'co_await' or 'co_yield' within a exception
handler. However, it was reverted in https://reviews.llvm.org/rC356774
because it caused a regression in nested scopes in C++ catch statements,
as documented by https://bugs.llvm.org/show_bug.cgi?id=41171.
The issue was due to an incorrect use of a `clang::ParseScope`. To fix:
1. Add a regression test for catch statement parsing that mimics the bug
report from https://bugs.llvm.org/show_bug.cgi?id=41171.
2. Re-apply the coroutines error patch from
https://reviews.llvm.org/D59076, but this time with the correct
ParseScope behavior.
Reviewers: GorNishanov, tks2103, rsmith, riccibruno, jbulow
Reviewed By: riccibruno
Subscribers: EricWF, jdoerfert, lewissbaker, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59752
llvm-svn: 356865
Simon Pilgrim [Sun, 24 Mar 2019 19:06:35 +0000 (19:06 +0000)]
[X86][SSE41] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)
Enable SSE41 ZERO_EXTEND_VECTOR_INREG shuffle combines - for the PMOVZX(PSHUFD(V)) -> UNPCKH(V,0) pattern we reduce the shuffles (port5-bottleneck on Intel) at the expense of creating a zero (pxor v,v) and an extra register move - which is a good trade off as these are pretty cheap and in most cases it doesn't increase register pressure.
This also exposed a missed opportunity to use combine to ZERO_EXTEND_VECTOR_INREG with folded loads - even if we're in the float domain.
llvm-svn: 356864
Craig Topper [Sun, 24 Mar 2019 18:00:20 +0000 (18:00 +0000)]
[X86] Make _bswap intrinsic a function instead of a macro to hopefully fix the chromium build.
This intrinsic was added in r356848 but was implemented as a macro to match gcc.
llvm-svn: 356862
Heejin Ahn [Sun, 24 Mar 2019 17:34:40 +0000 (17:34 +0000)]
[WebAssembly] Rename a variable in CFGSort (NFC)
Class `RegionInfo` was `SortUnitInfo` before, so the variables were
named `SUI`. Now the class name is `RegionInfo`, so this renames `SUI`
to `RI`, matching the class name.
llvm-svn: 356861
Craig Topper [Sun, 24 Mar 2019 17:02:14 +0000 (17:02 +0000)]
[LegalizeDAG] Expand i16 bswap directly to a rotate by 8 instead of relying on DAG combine.
An i16 bswap can be implemented with an i16 rotate by 8. We previously emitted
a shift and OR sequence that DAG combine should be able to turn back into
rotate. But we might as well go there directly. If rotate isn't legal,
LegalizeDAG should further legalize it to either the opposite rotate, or the
shift and OR pattern.
I don't know of any way to get the existing DAG combine reliance to fail. So
I don't know any way to add new tests for this that wouldn't have worked
previously.
llvm-svn: 356860
Simon Pilgrim [Sun, 24 Mar 2019 17:02:08 +0000 (17:02 +0000)]
[X86] Remove icmp undef from reduced tests
Pre-commit for D59363 (Add icmp UNDEF handling to SelectionDAG::FoldSetCC)
Approved by @spatel (Sanjay Patel)
llvm-svn: 356859
Simon Pilgrim [Sun, 24 Mar 2019 16:30:35 +0000 (16:30 +0000)]
[X86][AVX] Start shuffle combining from ZERO_EXTEND_VECTOR_INREG (PR40685)
Just enable this for AVX for now as SSE41 introduces extra register moves for the PMOVZX(PSHUFD(V)) -> UNPCKH(V,0) pattern (but otherwise helps reduce port5 usage on Intel targets).
Only AVX support is required for PR40685 as the issue is due to 8i8->8i32 zext shuffle leftovers.
llvm-svn: 356858
Teresa Johnson [Sun, 24 Mar 2019 15:18:50 +0000 (15:18 +0000)]
[CGP] Make several static functions member functions (NFC)
This is extracted from D59696 as suggested in the review. It is
preparation for making the DominatorTree a member variable.
llvm-svn: 356857
George Rimar [Sun, 24 Mar 2019 14:41:45 +0000 (14:41 +0000)]
Recommit r356738 "[llvm-objcopy] - Implement replaceSectionReferences for GroupSection class."
Fix: r356853 + set AddressAlign to 4 in
Inputs/compress-debug-sections.yaml for the new group section introduced.
Original commit message:
Currently, llvm-objcopy incorrectly handles compression and decompression of the
sections from COMDAT groups, because we do not implement the
replaceSectionReferences for this type of the sections.
The patch does that.
Differential revision: https://reviews.llvm.org/D59638
llvm-svn: 356856
Sanjay Patel [Sun, 24 Mar 2019 13:55:54 +0000 (13:55 +0000)]
[x86] improve the default expansion of uaddsat/usubsat
This is yet another step towards solving PR14613:
https://bugs.llvm.org/show_bug.cgi?id=14613
uaddsat X, Y --> (X >u (X + Y)) ? -1 : X + Y
usubsat X, Y --> (X >u Y) ? X - Y : 0
We can't count on a sane vector ISA, so override the default (umin/umax)
expansion of unsigned add/sub saturate in cases where we do not have umin/umax.
Differential Revision: https://reviews.llvm.org/D59006
llvm-svn: 356855
Simon Pilgrim [Sun, 24 Mar 2019 13:36:32 +0000 (13:36 +0000)]
[SLPVectorizer] shouldReorderOperands - just check for reordering. NFCI.
Remove the I.getOperand() calls from inside shouldReorderOperands - reorderInputsAccordingToOpcode should handle the creation of the operand lists and shouldReorderOperands should just check to see whether the i'th element should be commuted.
llvm-svn: 356854
George Rimar [Sun, 24 Mar 2019 13:31:08 +0000 (13:31 +0000)]
[llvm-objcopy] - Report SHT_GROUP sections with invalid alignment.
This patch fixes the reason of ubsan failure (UB detected)
happened after landing the D59638 (I had to revert it).
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/11760/steps/check-llvm%20ubsan/logs/stdio)
Problem is the following. Our implementation of GroupSection assumes that
its address is 4 bytes aligned when writes it:
template <class ELFT>
void ELFSectionWriter<ELFT>::visit(const GroupSection &Sec) {
ELF::Elf32_Word *Buf =
reinterpret_cast<ELF::Elf32_Word *>(Out.getBufferStart() + Sec.Offset);
...
But the test case for D59638 did not set AddressAlign in YAML. So address was
not 4 bytes aligned since Sec.Offset was odd. That triggered the issue.
This patch teaches llvm-objcopy to report an error for such sections (which should
not met in reality), what is better than having UB.
Differential revision: https://reviews.llvm.org/D59695
llvm-svn: 356853
Nikita Popov [Sun, 24 Mar 2019 09:34:40 +0000 (09:34 +0000)]
[ConstantRange] Add getFull() + getEmpty() named constructors; NFC
This adds ConstantRange::getFull(BitWidth) and
ConstantRange::getEmpty(BitWidth) named constructors as more readable
alternatives to the current ConstantRange(BitWidth, /* full */ false)
and similar. Additionally private getFull() and getEmpty() member
functions are added which return a full/empty range with the same bit
width -- these are commonly needed inside ConstantRange.cpp.
The IsFullSet argument in the ConstantRange(BitWidth, IsFullSet)
constructor is now mandatory for the few usages that still make use of it.
Differential Revision: https://reviews.llvm.org/D59716
llvm-svn: 356852
Fangrui Song [Sun, 24 Mar 2019 07:31:21 +0000 (07:31 +0000)]
[pp-trace] Delete redundant clang::
And clarify command line options
llvm-svn: 356851
Fangrui Song [Sun, 24 Mar 2019 07:21:32 +0000 (07:21 +0000)]
[pp-trace] Wrap code in clang::pp_trace
llvm-svn: 356850
Fangrui Song [Sun, 24 Mar 2019 06:55:08 +0000 (06:55 +0000)]
[pp-trace] Modernize the code
Use InitLLVM and WithColor
Delete PPTraceConsumer, add the callback in PPTraceAction
Migrae to tooling::createExecutorFromCommandLineArgs
Don't specialize empty OutputFileName
llvm-svn: 356849
Craig Topper [Sun, 24 Mar 2019 00:56:52 +0000 (00:56 +0000)]
[X86] Add BSR/BSF/BSWAP intrinsics to ia32intrin.h to match gcc.
Summary:
These are all implemented by icc as well.
I made bit_scan_forward/reverse forward to the __bsfd/__bsrq since we also have
__bsfq/__bsrq.
Note, when lzcnt is enabled the bsr intrinsics generates lzcnt+xor instead of bsr.
Reviewers: RKSimon, spatel
Subscribers: cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59682
llvm-svn: 356848
Sam Clegg [Sun, 24 Mar 2019 00:03:41 +0000 (00:03 +0000)]
[WebAssembly] Fix test/Driver/wasm-toolchain.c in the presence of CLANG_DEFAULT_LINKER
This was broken in rL356817 (See https://reviews.llvm.org/D59721)
llvm-svn: 356847
Nico Weber [Sat, 23 Mar 2019 23:22:45 +0000 (23:22 +0000)]
gn build: Merge r356820
llvm-svn: 356846
Nico Weber [Sat, 23 Mar 2019 23:16:41 +0000 (23:16 +0000)]
gn build: Add build files for modularize and pp-trace
Differential Revision: https://reviews.llvm.org/D59701
llvm-svn: 356845
Hubert Tong [Sat, 23 Mar 2019 18:39:54 +0000 (18:39 +0000)]
Fix typos in compiler-rt/lib/builtins/atomic.c
Summary:
This patch fixes typos in file compiler-rt/lib/builtins/atomic.c.
Reviewers: jasonliu, hubert.reinterpretcast, jfb
Reviewed By: jfb
Subscribers: t.p.northover, theraven, dberris, jfb, jdoerfert, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D59228
Patch by Xing Xue.
llvm-svn: 356844
Hubert Tong [Sat, 23 Mar 2019 18:10:45 +0000 (18:10 +0000)]
libclang/CIndexer.cpp: Use loadquery() on AIX for path to library
Summary:
`dladdr` is not available on AIX. Similar functionality is presented
through `loadquery`. This patch replaces a use of `dladdr` with a
version based on `loadquery`.
Reviewers: sfertile, xingxue, jasonliu
Reviewed By: xingxue
Subscribers: jsji, lhames, majnemer, asb, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D59233
llvm-svn: 356843
Sylvestre Ledru [Sat, 23 Mar 2019 17:57:31 +0000 (17:57 +0000)]
Sync some doc changes ClangFormatStyleOptions.rst with doc comments in `Format.h`
Summary:
These changes were corrected directly in ClangFormatStyleOptions.rst (llvm-svn: 350192 and llvm-svn: 351976) but these sections can be produced automatically using `dump_format_style.py` so sync the corresponding doc comments in `Format.h` as well.
Patch by Ronald Wampler
Reviewers: eugene, sylvestre.ledru, djasper
Reviewed By: sylvestre.ledru
Subscribers: jdoerfert, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58186
llvm-svn: 356842
Simon Pilgrim [Sat, 23 Mar 2019 16:56:23 +0000 (16:56 +0000)]
Fix unused variable warning on non-asserts builds. NFCI.
llvm-svn: 356841
Simon Pilgrim [Sat, 23 Mar 2019 16:20:34 +0000 (16:20 +0000)]
Remove unused function argument. NFCI.
llvm-svn: 356840
Simon Pilgrim [Sat, 23 Mar 2019 16:16:46 +0000 (16:16 +0000)]
Fix unused variable warning. NFCI.
llvm-svn: 356839
Fangrui Song [Sat, 23 Mar 2019 16:15:40 +0000 (16:15 +0000)]
[DWARF] Delete a stray break and a stray comment. NFC
llvm-svn: 356838
Simon Pilgrim [Sat, 23 Mar 2019 16:14:04 +0000 (16:14 +0000)]
[X86][SLP] Show example of failure to uniformly commute splats for 'alt' shuffles.
If either the main/alt opcodes isn't commutable we may end up with the splats not correctly commuted to the same side.
llvm-svn: 356837
Sanjay Patel [Sat, 23 Mar 2019 15:00:52 +0000 (15:00 +0000)]
[x86] reduce code duplication; NFC
llvm-svn: 356836