LLVM/llvm 356937llvm/trunk/lib/CodeGen CodeGenPrepare.cpp

[CGP] Build the DominatorTree lazily

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

    [9 lines not shown]

LLVM/llvm 356936openmp/trunk/runtime/test/ompt/misc interoperability.cpp

Fix interoperability test compilation on FreeBSD

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/llvm 356935pstl/trunk/test test_partial_sort.cpp

[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/llvm 356934openmp/trunk/runtime/src kmp_wrapper_getpid.h

Fix gettid warnings on FreeBSD

[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

    [6 lines not shown]

LLVM/llvm 356933openmp/trunk/runtime/src kmp_runtime.cpp

[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/llvm 356932lld/trunk/test/wasm target-feature-required.yaml target-feature-used.yaml, lld/trunk/wasm Writer.cpp Driver.cpp

Revert "[WebAssembly] Add linker options to control feature checking"

This reverts commit 5991328c96b6146999cfa74ede42901f8c01f2fa.

LLVM/llvm 356931cfe/trunk/lib/Driver Driver.cpp, cfe/trunk/test/Driver immediate-options.c

clang -dumpversion returns 4.2.1 for legacy reason, update it

It has been introduced in 2011 for gcc compat:
it is probably time to remove it to remove the confusion.

reported: https://bugs.llvm.org/show_bug.cgi?id=38836

Reviewers: ddunbar, rnk

Reviewed By: rnk

Subscribers: jdoerfert, cfe-commits

Tags: #clang

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

LLVM/llvm 356930llvm/trunk/test/CodeGen/X86 vector-zext.ll

[x86] add another vector zext test; NFC

Goes with the proposal in D59777

LLVM/llvm 356929cfe/trunk/include/clang/StaticAnalyzer/Core/PathSensitive SMTAPI.h SMTConv.h, cfe/trunk/lib/StaticAnalyzer/Core Z3ConstraintManager.cpp

Moved everything SMT-related to LLVM and updated the cmake scripts.

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

LLVM/llvm 356928cfe/trunk/lib/Format TokenAnnotator.cpp, cfe/trunk/unittests/Format FormatTestObjC.cpp

[clang-format] Refine structured binding detection

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/llvm 356927lldb/trunk/source/Utility Args.cpp, lldb/trunk/unittests/Utility ArgsTest.cpp

[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/llvm 356926llvm/trunk/lib/CodeGen MachineScheduler.cpp, llvm/trunk/test/CodeGen/AMDGPU sched-assert-onlydbg-value-empty-region.mir

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/llvm 356925cfe/trunk/lib/Sema SemaDecl.cpp SemaExpr.cpp

[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

    [2 lines not shown]

LLVM/llvm 356924llvm/trunk/utils/release merge-request.sh

merge-request.sh: Update 8.0 metabug for 8.0.1

LLVM/llvm 356923clang-tools-extra/trunk/docs ReleaseNotes.rst

Attempt to fix sphinx bot after r356897

LLVM/llvm 356922llvm/trunk/lib/Target/AMDGPU SIWholeQuadMode.cpp

AMDGPU: Preserve LiveIntervals in WQM

This seems to already be done, but wasn't marked.

LLVM/llvm 356921pstl/trunk/test utils.h

[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.
+15-161 files

LLVM/llvm 356920cfe/trunk CMakeLists.txt

[clang] Remove cmake warning message (NFC)

Recognize an empty string for CLANG_DEFAULT_UNWINDLIB as a valid option.

LLVM/llvm 356919llvm/trunk/test/tools/llvm-objcopy/ELF preserve-segment-contents.test preserve-segment-contents-ehdr-phdrs.test, llvm/trunk/tools/llvm-objcopy/ELF Object.cpp Object.h

[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/llvm 356918libcxx/trunk/include optional, libcxx/trunk/test/std/utilities/optional/optional.object/optional.object.ctor ctor.fail.cpp

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/llvm 356917pstl/trunk/include/pstl/internal algorithm_impl.h

[PSTL][NFC] Add missing #include

LLVM/llvm 356916clang-tools-extra/trunk/clangd/clients/clangd-vscode/src extension.ts

[clangd] Add .cu files to VSCode extension

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/llvm 356915llvm/trunk/test/Transforms/SLPVectorizer/X86 alternate-int.ll

[SLPVectorizer] Update file missed in rL356913

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

LLVM/llvm 356914llvm/trunk/test/CodeGen/X86 vector-zext.ll

[x86] add tests for vector zext; NFC

The AVX1 lowering is poor.

LLVM/llvm 356913llvm/trunk/test/Transforms/LoopVectorize/X86 metadata-enable.ll, llvm/trunk/test/Transforms/SLPVectorizer/AArch64 getelementptr.ll

[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 
(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/llvm 356912cfe/trunk/lib/Format TokenAnnotator.cpp, cfe/trunk/unittests/Format FormatTestProto.cpp

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/llvm 356911lldb/trunk/lit/Driver TestRepl.test, lldb/trunk/tools/driver Driver.cpp

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

    [8 lines not shown]

LLVM/llvm 356910lldb/trunk/examples/customization/bin-utils binutils.py, lldb/trunk/examples/python mach_o.py

Python 2/3 compat: StringIO

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

LLVM/llvm 356909lldb/trunk/examples/python lldbtk.py

Python 2/3 compat: tkinter

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

LLVM/llvm 356908lldb/trunk/examples/summaries/cocoa CFArray.py CFBag.py

Python 2/3 compat: str vs basestring

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

LLVM/llvm 356907llvm/trunk/tools/llvm-config llvm-config.cpp

Revert 356905

Commited from wrong directory...

LLVM/llvm 356906lldb/trunk/utils/lui lui.py sandbox.py

Python 2/3 compat: queue vs Queue

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

LLVM/llvm 356905llvm/trunk/tools/llvm-config llvm-config.cpp

Python 2/3 compat: queue vs Queue

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

LLVM/llvm 356904lldb/trunk/examples/summaries/cocoa CFString.py

Python 2/3 compat: unichr vs chr

LLVM/llvm 356903libcxx/trunk CMakeLists.txt, libcxx/trunk/lib CMakeLists.txt

[libc++][CMake] Allow merging libc++abi.a into libc++ even on Apple platforms

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/llvm 356902clang-tools-extra/trunk/clang-tidy add_new_check.py

[clang-tidy] ClangTidy.h -> ClangTidyCheck.h

LLVM/llvm 356901llvm/trunk/lib/ObjectYAML MinidumpYAML.cpp

MinidumpYAML.cpp: Fix some code standard violations missed during review

functions should begin with lower case letters. NFC.

LLVM/llvm 356900pstl/trunk CMakeLists.txt

[pstl][CMake] Move include() closer to its point of use

LLVM/llvm 356899llvm/trunk/test/CodeGen/X86 regalloc-copy-hints.mir

[RegAlloc]  Simplify MIR test

Remove the IR part from test/CodeGen/X86/regalloc-copy-hints.mir (added by

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/llvm 356898lldb/trunk/lit/Minidump dump-all.test fb-dump.test, lldb/trunk/source/Plugins/Process/minidump MinidumpTypes.h MinidumpParser.cpp

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/llvm 356897clang-tools-extra/trunk/clang-include-fixer IncludeFixer.cpp, clang-tools-extra/trunk/clang-include-fixer/find-all-symbols STLPostfixHeaderMap.cpp

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/llvm 356896lldb/trunk/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new TestMiniDumpUUID.py linux-arm-uuids-elf-build-id-20.dmp, lldb/trunk/source/Plugins/Process/minidump MinidumpParser.cpp MinidumpTypes.cpp

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/llvm 356895llvm/trunk/lib/ExecutionEngine/IntelJITEvents IntelJITEventListener.cpp

[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/llvm 356894clang-tools-extra/trunk/clangd StdSymbolMap.inc, clang-tools-extra/trunk/clangd/include-mapping gen_std.py

[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/llvm 356893clang-tools-extra/trunk/pp-trace PPTrace.cpp

[pp-trace] Use ClangTool in pp-trace, NFC

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/llvm 356892clang-tools-extra/trunk/clang-tidy/bugprone UndefinedMemoryManipulationCheck.h UndelegatedConstructorCheck.h

[clang-tidy] Switch checks to #include "ClangTidyCheck.h"

LLVM/llvm 356891pstl/trunk/include/pstl/internal glue_algorithm_impl.h

[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/llvm 356890clang-tools-extra/trunk/clang-tidy ClangTidyCheck.h ClangTidy.h, clang-tools-extra/trunk/docs/clang-tidy Contributing.rst

[clang-tidy] Separate the check-facing interface

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, 

Tags: #clang, #llvm

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

LLVM/llvm 356889llvm/trunk/tools/llvm-objcopy/ELF ELFObjcopy.cpp

[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/llvm 356888cfe/trunk/include/clang/Basic TokenKinds.def, cfe/trunk/lib/Parse ParseDeclCXX.cpp ParseDecl.cpp

[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