platform/upstream/llvm.git
5 years ago[BuildLibCalls] Noalias annotation
David Bolvansky [Wed, 14 Aug 2019 16:50:06 +0000 (16:50 +0000)]
[BuildLibCalls] Noalias annotation

Summary: I think this is better solution than annotating callsites in IC/SLC.

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 368875

5 years agoDocument clang-cpp in the release notes for clang
Chris Bieneman [Wed, 14 Aug 2019 16:49:52 +0000 (16:49 +0000)]
Document clang-cpp in the release notes for clang

This patch adds a line in the release notes about the new clang-cpp library and the CMake option to force clang to link against it.

llvm-svn: 368874

5 years agoIgnore indirect branches from callbr.
Bill Wendling [Wed, 14 Aug 2019 16:44:07 +0000 (16:44 +0000)]
Ignore indirect branches from callbr.

Summary:
We can't speculate around indirect branches: indirectbr and invoke. The
callbr instruction needs to be included here.

Reviewers: nickdesaulniers, manojgupta, chandlerc

Reviewed By: chandlerc

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 368873

5 years agoAdd missing NativeProcessFactory for lldb-server on Windows
Aaron Smith [Wed, 14 Aug 2019 16:39:41 +0000 (16:39 +0000)]
Add missing NativeProcessFactory for lldb-server on Windows

llvm-svn: 368872

5 years ago[LifetimeAnalysis] Fix false negatives of statement local lifetime analysis for some...
Gabor Horvath [Wed, 14 Aug 2019 16:34:56 +0000 (16:34 +0000)]
[LifetimeAnalysis] Fix false negatives of statement local lifetime analysis for some STL implementation

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

llvm-svn: 368871

5 years ago[mips] Remove redundant case in the test. NFC
Simon Atanasyan [Wed, 14 Aug 2019 16:27:07 +0000 (16:27 +0000)]
[mips] Remove redundant case in the test. NFC

llvm-svn: 368870

5 years ago[mips] Split long lines in the test case file. NFC
Simon Atanasyan [Wed, 14 Aug 2019 16:27:00 +0000 (16:27 +0000)]
[mips] Split long lines in the test case file. NFC

llvm-svn: 368869

5 years ago[WebAssembly] Stop unrolling SIMD shifts since they are fixed in V8
Thomas Lively [Wed, 14 Aug 2019 16:24:37 +0000 (16:24 +0000)]
[WebAssembly] Stop unrolling SIMD shifts since they are fixed in V8

Summary:
Fixes PR42973. Tests don't change because simd-arith.ll tests behavior
on unimplemented-simd128, which does not include any temporary
workarounds such as the one removed in this revision.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, dmgreen, llvm-commits

Tags: #llvm

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

llvm-svn: 368868

5 years agoRework recursive_timed_mutex so that it uses __thread_id instead of using the lower...
Marshall Clow [Wed, 14 Aug 2019 16:21:27 +0000 (16:21 +0000)]
Rework recursive_timed_mutex so that it uses __thread_id instead of using the lower-level __libcpp_thread_id. This is prep for fixing PR42918. Reviewed as https://reviews.llvm.org/D65895

llvm-svn: 368867

5 years ago[scudo][standalone] Add more stats to mallinfo
Kostya Kortchinsky [Wed, 14 Aug 2019 16:04:01 +0000 (16:04 +0000)]
[scudo][standalone] Add more stats to mallinfo

Summary:
Android requires additional stats in mallinfo. While we can provide
right away the number of bytes mapped (Primary+Secondary), there was
no way to get the number of free bytes (only makes sense for the
Primary since the Secondary unmaps everything on deallocation).

An approximation could be `StatMapped - StatAllocated`, but since we
are mapping in `1<<17` increments for the 64-bit Primary, it's fairly
inaccurate.

So we introduce `StatFree` (note it's `Free`, not `Freed`!), which
keeps track of the amount of Primary blocks currently unallocated.

Reviewers: cferris, eugenis, vitalybuka, hctim, morehouse

Reviewed By: morehouse

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 368866

5 years agoFix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 16:03:37 +0000 (16:03 +0000)]
Fix cppcheck + MSVC analyzer uninitialized member variable warning. NFCI.

llvm-svn: 368865

5 years ago[X86] Use PSADBW for v8i8 addition reductions.
Craig Topper [Wed, 14 Aug 2019 15:57:29 +0000 (15:57 +0000)]
[X86] Use PSADBW for v8i8 addition reductions.

Improves the 8 byte case from PR42674.

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

llvm-svn: 368864

5 years ago[NFC] Fix testcase for ARMs
David Bolvansky [Wed, 14 Aug 2019 15:35:40 +0000 (15:35 +0000)]
[NFC] Fix testcase for ARMs

llvm-svn: 368863

5 years ago[libTooling] Fix code to avoid unused-function warning after r368681.
Yitzhak Mandelbaum [Wed, 14 Aug 2019 15:20:06 +0000 (15:20 +0000)]
[libTooling] Fix code to avoid unused-function warning after r368681.

llvm-svn: 368862

5 years ago[LangRef] Remove opening [ that was missing a closing ] from call/callbr/invoke syntax.
Craig Topper [Wed, 14 Aug 2019 15:10:37 +0000 (15:10 +0000)]
[LangRef] Remove opening [ that was missing a closing ] from call/callbr/invoke syntax.

It looks like this bracket was added when the addrspace was added.
before it. So I think it can jut be removed.

llvm-svn: 368861

5 years ago[NFC][AIX] Change assertion
Xiangling Liao [Wed, 14 Aug 2019 14:57:25 +0000 (14:57 +0000)]
[NFC][AIX] Change assertion

Address one left comment on https://reviews.llvm.org/D63547. A minor
change for assertion.

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

llvm-svn: 368860

5 years ago[PowerPC][NFC] Add test for build all one vector with different types.
Jinsong Ji [Wed, 14 Aug 2019 14:53:05 +0000 (14:53 +0000)]
[PowerPC][NFC] Add test for build all one vector with different types.

build-vector-tests.ll is far too big, split such type tests for single
buildvector into new file.

llvm-svn: 368859

5 years ago[X86][CostModel] Adjust the costs of ZERO_EXTEND/SIGN_EXTEND with less than 128-bit...
Craig Topper [Wed, 14 Aug 2019 14:52:39 +0000 (14:52 +0000)]
[X86][CostModel] Adjust the costs of ZERO_EXTEND/SIGN_EXTEND with less than 128-bit inputs

Now that we legalize by widening, the element types here won't change. Previously these were modeled as the elements being widened and then the instruction might become an AND or SHL/ASHR pair. But now they'll become something like a ZERO_EXTEND_VECTOR_INREG/SIGN_EXTEND_VECTOR_INREG.

For AVX2, when the destination type is legal its clear the cost should be 1 since we have extend instructions that can produce 256 bit vectors from less than 128 bit vectors. I'm a little less sure about AVX1 costs, but I think the ones I changed were definitely too high, but they might still be too high.

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

llvm-svn: 368858

5 years ago[X86] Add llvm_unreachable to a switch that covers all expected values.
Craig Topper [Wed, 14 Aug 2019 14:51:19 +0000 (14:51 +0000)]
[X86] Add llvm_unreachable to a switch that covers all expected values.

llvm-svn: 368857

5 years ago[PowerPC][NFC] Consolidate duplicate XX3Form_SetZero and XX3Form_Zero.
Jinsong Ji [Wed, 14 Aug 2019 14:16:26 +0000 (14:16 +0000)]
[PowerPC][NFC] Consolidate duplicate XX3Form_SetZero and XX3Form_Zero.

Rename one to XX3Form_SameOp, remove the other one.

llvm-svn: 368856

5 years ago[AIX] Add call lowering for parameters that could pass onto FPRs
Jason Liu [Wed, 14 Aug 2019 14:13:11 +0000 (14:13 +0000)]
[AIX] Add call lowering for parameters that could pass onto FPRs

Summary:
This patch adds call lowering functionality to enable passing
parameters onto floating point registers when needed.

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

llvm-svn: 368855

5 years agoRevert "raw_ostream: add operator<< overload for std::error_code"
Pavel Labath [Wed, 14 Aug 2019 13:59:04 +0000 (13:59 +0000)]
Revert "raw_ostream: add operator<< overload for std::error_code"

This reverts commit r368849, because it breaks some bots (e.g.
llvm-clang-x86_64-win-fast).

It turns out this is not as NFC as we had hoped, because operator== will
consider two std::error_codes to be distinct even though they both hold
"success" values if they have different categories.

llvm-svn: 368854

5 years ago[analyzer][NFC] Prove that we only track the evaluated part of the condition
Kristof Umann [Wed, 14 Aug 2019 13:51:52 +0000 (13:51 +0000)]
[analyzer][NFC] Prove that we only track the evaluated part of the condition

...because we're working with a BugReporterVisitor, and the non-evaluated part
of the condition isn't in the bugpath.

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

llvm-svn: 368853

5 years agoAdd missing SetID method to fix Windows build
Aaron Smith [Wed, 14 Aug 2019 13:49:52 +0000 (13:49 +0000)]
Add missing SetID method to fix Windows build

llvm-svn: 368852

5 years ago[clangd][vscode] Surface the error when applying tweaks fails
Haojian Wu [Wed, 14 Aug 2019 13:38:52 +0000 (13:38 +0000)]
[clangd][vscode] Surface the error when applying tweaks fails

Summary:
The current behavior for a failed request is just to log it in the
output panel. When applyTweak fails for whatever reason, users usually don't get
informed (unless they open the output panel and dig the log).

this patch is to surface these errors by prompting up a message diag.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 368851

5 years ago[Tooling] Added DeclStmtClass to ExtractionSemicolonPolicy
Shaurya Gupta [Wed, 14 Aug 2019 13:37:39 +0000 (13:37 +0000)]
[Tooling] Added DeclStmtClass to ExtractionSemicolonPolicy

Since the DeclStmt range includes the semicolon, it doesn't need a
semicolon at the end during extraction

llvm-svn: 368850

5 years agoraw_ostream: add operator<< overload for std::error_code
Pavel Labath [Wed, 14 Aug 2019 13:33:28 +0000 (13:33 +0000)]
raw_ostream: add operator<< overload for std::error_code

Summary:
The main motivation for this is unit tests, which contain a large macro
for pretty-printing std::error_code, and this macro is duplicated in
every file that needs to do this. However, the functionality may be
useful elsewhere too.

In this patch I have reimplemented the existing ASSERT_NO_ERROR macros
to reuse the new functionality, but I have kept the macro (as a
one-liner) as it is slightly more readable than ASSERT_EQ(...,
std::error_code()).

Reviewers: sammccall, ilya-biryukov

Subscribers: zturner, llvm-commits

Tags: #llvm

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

llvm-svn: 368849

5 years ago[SimplifyCFG] Add "safe abs" test from CMSIS DSP 'abs_with_clamp()'
Roman Lebedev [Wed, 14 Aug 2019 13:10:59 +0000 (13:10 +0000)]
[SimplifyCFG] Add "safe abs" test from CMSIS DSP 'abs_with_clamp()'

With -phi-node-folding-threshold=3
this branch would get flattened into select.

See https://reviews.llvm.org/D65148#1629010

llvm-svn: 368847

5 years ago[ELF] --gdb-index: fix odd variable name cUs after r365730 and replace lower_bound...
Fangrui Song [Wed, 14 Aug 2019 12:56:30 +0000 (12:56 +0000)]
[ELF] --gdb-index: fix odd variable name cUs after r365730 and replace lower_bound with partition_point. NFC

llvm-svn: 368845

5 years ago[clangd] Print qualifiers of out-of-line definitions in document outline
Ilya Biryukov [Wed, 14 Aug 2019 12:51:04 +0000 (12:51 +0000)]
[clangd] Print qualifiers of out-of-line definitions in document outline

Summary: To improve the UX around navigating and searching through the results.

Reviewers: hokein

Reviewed By: hokein

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 368842

5 years ago[Clangd] NFC: Fixed comment typo
Shaurya Gupta [Wed, 14 Aug 2019 12:40:09 +0000 (12:40 +0000)]
[Clangd] NFC: Fixed comment typo

llvm-svn: 368841

5 years agogn build: Pre-merge https://reviews.llvm.org/D66195
Nico Weber [Wed, 14 Aug 2019 12:38:43 +0000 (12:38 +0000)]
gn build: Pre-merge https://reviews.llvm.org/D66195

llvm-svn: 368840

5 years ago[X86] Add missing regular 512-bit vXi8 extract subvector cost model tests
Simon Pilgrim [Wed, 14 Aug 2019 12:36:23 +0000 (12:36 +0000)]
[X86] Add missing regular 512-bit vXi8 extract subvector cost model tests

These tests don't cover many cases where the subvectors don't start on aligned indices, but that can be added later.

llvm-svn: 368839

5 years agoRevert "Minidump/Windows: Fix module lookup"
Pavel Labath [Wed, 14 Aug 2019 12:26:51 +0000 (12:26 +0000)]
Revert "Minidump/Windows: Fix module lookup"

Although there is nothing wrong with this patch, the test added here
uncovers a problem in other parts of the code which cause the test to
fail when running under asan. Reverting the patch until I can fix the
underlying issue(s).

This reverts commit r368416.

llvm-svn: 368838

5 years ago[ELF][test] Update silent-ignore.test
Fangrui Song [Wed, 14 Aug 2019 12:20:21 +0000 (12:20 +0000)]
[ELF][test] Update silent-ignore.test

Some options are implemented now:

--no-warn-common : r263413
--allow-shlib-undefined : r352826

Some are ignored but were not reflected in this test.

llvm-svn: 368837

5 years ago[analyzer][CFG] Don't track the condition of asserts
Kristof Umann [Wed, 14 Aug 2019 12:20:08 +0000 (12:20 +0000)]
[analyzer][CFG] Don't track the condition of asserts

Well, what is says on the tin I guess!

Some more changes:

* Move isInevitablySinking() from BugReporter.cpp to CFGBlock's interface
* Rename and move findBlockForNode() from BugReporter.cpp to
ExplodedNode::getCFGBlock()

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

llvm-svn: 368836

5 years ago[DebugInfo] MCP: collect and update DBG_VALUEs encountered in local block
Jeremy Morse [Wed, 14 Aug 2019 12:20:02 +0000 (12:20 +0000)]
[DebugInfo] MCP: collect and update DBG_VALUEs encountered in local block

MCP currently uses changeDebugValuesDefReg / collectDebugValues to find
debug users of a register, however those functions assume that all
DBG_VALUEs immediately follow the specified instruction, which isn't
necessarily true. This is going to become very often untrue when we turn
off CodeGenPrepare::placeDbgValues.

Instead of calling changeDebugValuesDefReg on an instruction to change its
debug users, in this patch we instead collect DBG_VALUEs of copies as we
iterate over insns, and update the debug users of copies that are made
dead. This isn't a non-functional change, because MCP will now update
DBG_VALUEs that aren't immediately after a copy, but refer to the same
register. I've hijacked the regression test for PR38773 to test for this
new behaviour, an entirely new test seemed overkill.

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

llvm-svn: 368835

5 years ago[clangd] Loading TokenColorRules as a class mapping the rules to their associated...
Johan Vikstrom [Wed, 14 Aug 2019 12:11:58 +0000 (12:11 +0000)]
[clangd] Loading TokenColorRules as a class mapping the rules to their associated clangd TextMate scope index.

Summary: Loads a mapping of the clangd scope lookup table scopes to the most specific rule with the highest "precedence" on initialize. Preprocesses into a class so it's simple/fast to access when doing the actual coloring later.

Reviewers: hokein, ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 368834

5 years ago[IR] Simplify removeDeadConstantUsers. NFC
Fangrui Song [Wed, 14 Aug 2019 11:38:45 +0000 (11:38 +0000)]
[IR] Simplify removeDeadConstantUsers. NFC

llvm-svn: 368833

5 years agoRemoved ToolExecutor::isSingleProcess, it is not used by anything
Dmitri Gribenko [Wed, 14 Aug 2019 11:35:04 +0000 (11:35 +0000)]
Removed ToolExecutor::isSingleProcess, it is not used by anything

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 368832

5 years agoFix "not all control paths return a value" MSVC warnings. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 11:31:05 +0000 (11:31 +0000)]
Fix "not all control paths return a value" MSVC warnings. NFCI.

llvm-svn: 368831

5 years agoFix "not all control paths return a value" MSVC warning. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 11:29:56 +0000 (11:29 +0000)]
Fix "not all control paths return a value" MSVC warning. NFCI.

llvm-svn: 368830

5 years agoFix "not all control paths return a value" MSVC warnings. NFCI.
Simon Pilgrim [Wed, 14 Aug 2019 11:29:16 +0000 (11:29 +0000)]
Fix "not all control paths return a value" MSVC warnings. NFCI.

llvm-svn: 368829

5 years ago[NFC] Make test more robust
David Bolvansky [Wed, 14 Aug 2019 11:13:10 +0000 (11:13 +0000)]
[NFC] Make test more robust

Currently fails on ARMs

llvm-svn: 368828

5 years agoImproved the doc comment for getCommentsInFile
Dmitri Gribenko [Wed, 14 Aug 2019 11:11:52 +0000 (11:11 +0000)]
Improved the doc comment for getCommentsInFile

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 368827

5 years agoRecommit r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"
George Rimar [Wed, 14 Aug 2019 11:10:11 +0000 (11:10 +0000)]
Recommit r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"

Changes: no changes. A fix for the clang code will be landed right on top.

Original commit message:

SectionRef::getName() returns std::error_code now.
Returning Expected<> instead has multiple benefits.

For example, it forces user to check the error returned.
Also Expected<> may keep a valuable string error message,
what is more useful than having a error code.
(Object\invalid.test was updated to show the new messages printed.)

This patch makes a change for all users to switch to Expected<> version.

Note: in a few places the error returned was ignored before my changes.
In such places I left them ignored. My intention was to convert the interface
used, and not to improve and/or the existent users in this patch.
(Though I think this is good idea for a follow-ups to revisit such places
and either remove consumeError calls or comment each of them to clarify why
it is OK to have them).

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

llvm-svn: 368826

5 years ago[clang] - An update after LLVM change.
George Rimar [Wed, 14 Aug 2019 11:10:01 +0000 (11:10 +0000)]
[clang] - An update after LLVM change.

SectionRef::getName() was changed to return Expected<> (D66089)

llvm-svn: 368825

5 years ago[clangd] Fix typos and grammar in a comment. NFC
Ilya Biryukov [Wed, 14 Aug 2019 10:49:32 +0000 (10:49 +0000)]
[clangd] Fix typos and grammar in a comment. NFC

llvm-svn: 368824

5 years ago[AsmPrinter] Delete redundant .type foo, @function when emitting an ifunc
Fangrui Song [Wed, 14 Aug 2019 10:30:27 +0000 (10:30 +0000)]
[AsmPrinter] Delete redundant .type foo, @function when emitting an ifunc

In MCAsmStreamer:

.type foo,@function   # <--- this is redundant
.type foo,@gnu_indirect_function

In MCELFStreamer, the latter STT_GNU_IFUNC overrides STT_FUNC.

llvm-svn: 368823

5 years agoFix _WIN32 / _WIN64 Wundef warnings
Sven van Haastregt [Wed, 14 Aug 2019 10:30:18 +0000 (10:30 +0000)]
Fix _WIN32 / _WIN64 Wundef warnings

For these macros it is the definedness that matters rather than
the value.  Make new uses of these macros consistent with existing
uses.

llvm-svn: 368822

5 years ago[llvm-size][test] Improve llvm-size testing
James Henderson [Wed, 14 Aug 2019 10:17:34 +0000 (10:17 +0000)]
[llvm-size][test] Improve llvm-size testing

This patch significantly improves the llvm-size testing. The changes
made are:

1) Change all tests to use yaml2obj instead of assembly or pre-canned
   inputs.
2) Move the tests out of the X86 directory, since they don't need to be
   there after 1).
3) Increased test coverage.
4) Added comments to explain purpose of tests.

I haven't attempted to add test coverage for all Mach-O related code, as
I am not familiar enough with that file format to be able to.

Reviewers: grimar, MaskRay

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

llvm-svn: 368821

5 years ago[InstCombine] Refactor getFlippedStrictnessPredicateAndConstant() out of canonicalize...
Roman Lebedev [Wed, 14 Aug 2019 09:57:20 +0000 (09:57 +0000)]
[InstCombine] Refactor getFlippedStrictnessPredicateAndConstant() out of canonicalizeCmpWithConstant(), NFCI

I'd like to use it elsewhere, hopefully without reinventing the wheel.
No functional change intended so far.

llvm-svn: 368820

5 years ago[ASTImporter] Import default expression of param before creating the param.
Balazs Keri [Wed, 14 Aug 2019 09:41:39 +0000 (09:41 +0000)]
[ASTImporter] Import default expression of param before creating the param.

Summary:
The default expression of a parameter variable should be imported before
the parameter variable object is created. Otherwise the function is created
with an incomplete parameter variable (default argument is nullptr) and in
this intermediary state the expression is imported. This import can have
a reference to the incomplete parameter variable that causes crash.

Reviewers: martong, a.sidorin, shafik

Reviewed By: martong

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 368818

5 years ago[analyzer] Note last writes to a condition only in a nested stackframe
Kristof Umann [Wed, 14 Aug 2019 09:39:38 +0000 (09:39 +0000)]
[analyzer] Note last writes to a condition only in a nested stackframe

Exactly what it says on the tin! The comments in the code detail this a
little more too.

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

llvm-svn: 368817

5 years ago[MinGW] Correct handling different forms of a few options
Martin Storsjo [Wed, 14 Aug 2019 09:35:44 +0000 (09:35 +0000)]
[MinGW] Correct handling different forms of a few options

Support the equals form of the long --entry=<symbol> option,
add a test for the -e<symbol> form.

Add tests for single dash forms of -exclude-all-symbols and
-export-all-symbols.

Support single-dash forms of -out-implib and -output-def, support
the equals form of --output-def=<file>. (We previously had a test
to explicitly disallow -out-implib, but it turns out that GNU ld
actually does support it just fine, despite also matching the
-o<file> option.)

Disallow the double-dashed --u form, add a test for -u<symbol>.

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

llvm-svn: 368816

5 years ago[MinGW] Restructure Options.td to use multiclass where sensible. NFC.
Martin Storsjo [Wed, 14 Aug 2019 09:35:40 +0000 (09:35 +0000)]
[MinGW] Restructure Options.td to use multiclass where sensible. NFC.

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

llvm-svn: 368815

5 years ago[MinGW] Remove stray/inconsistent comment chars in test file. NFC.
Martin Storsjo [Wed, 14 Aug 2019 09:35:36 +0000 (09:35 +0000)]
[MinGW] Remove stray/inconsistent comment chars in test file. NFC.

Test directives don't need to be in comments in this file.

llvm-svn: 368814

5 years agoRevert r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"
George Rimar [Wed, 14 Aug 2019 08:56:55 +0000 (08:56 +0000)]
Revert r368812 "[llvm/Object] - Convert SectionRef::getName() to return Expected<>"

It broke clang BB: http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/16455

llvm-svn: 368813

5 years ago[llvm/Object] - Convert SectionRef::getName() to return Expected<>
George Rimar [Wed, 14 Aug 2019 08:46:54 +0000 (08:46 +0000)]
[llvm/Object] - Convert SectionRef::getName() to return Expected<>

SectionRef::getName() returns std::error_code now.
Returning Expected<> instead has multiple benefits.

For example, it forces user to check the error returned.
Also Expected<> may keep a valuable string error message,
what is more useful than having a error code.
(Object\invalid.test was updated to show the new messages printed.)

This patch makes a change for all users to switch to Expected<> version.

Note: in a few places the error returned was ignored before my changes.
In such places I left them ignored. My intention was to convert the interface
used, and not to improve and/or the existent users in this patch.
(Though I think this is good idea for a follow-ups to revisit such places
and either remove consumeError calls or comment each of them to clarify why
it is OK to have them).

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

llvm-svn: 368812

5 years ago[llvm-objdump] - Add a relocation-xindex-symbol.test test case.
George Rimar [Wed, 14 Aug 2019 08:33:26 +0000 (08:33 +0000)]
[llvm-objdump] - Add a relocation-xindex-symbol.test test case.

This rewrites the exitent test case to use YAML instead of the precompiled object
and moves it from test/Object to an appropriate llvm-objdump tests folder.

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

llvm-svn: 368811

5 years ago[Intrinsics] Add a 'NoAlias' intrinsic property; annotate llvm.memcpy
David Bolvansky [Wed, 14 Aug 2019 08:33:07 +0000 (08:33 +0000)]
[Intrinsics] Add a 'NoAlias' intrinsic property; annotate llvm.memcpy

Reviewers: jdoerfert

Reviewed By: jdoerfert

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

llvm-svn: 368810

5 years ago[Codegen] Updated test for D66158
David Bolvansky [Wed, 14 Aug 2019 08:32:31 +0000 (08:32 +0000)]
[Codegen] Updated test for D66158

Reviewers: jdoerfert

Reviewed By: jdoerfert

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 368809

5 years agoFix the -Wunused-variable warning.
Haojian Wu [Wed, 14 Aug 2019 08:20:42 +0000 (08:20 +0000)]
Fix the -Wunused-variable warning.

llvm-svn: 368808

5 years ago[InstCombine][NFC] Autogenerate checks in adjust-for-minmax.ll
Roman Lebedev [Wed, 14 Aug 2019 08:12:20 +0000 (08:12 +0000)]
[InstCombine][NFC] Autogenerate checks in adjust-for-minmax.ll

Being affected by WIP patch.

llvm-svn: 368807

5 years ago[API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr
Pavel Labath [Wed, 14 Aug 2019 08:11:20 +0000 (08:11 +0000)]
[API] Have SBCommandReturnObject::GetOutput/Error return "" instead of nullptr

Summary:
It seems this was an unintended side-effect of D26698. AFAICT, these
functions did return an empty string before that patch, and the patch
contained code which attempted to ensure that, but those efforts were
negated by ConstString::AsCString, which by default returns a nullptr
even for empty strings.

This patch:
- fixes the GetOutput/Error methods to really return empty strings
- adds and explicit test for that
- removes a workaround in lldbtest.py, which was masking this problem
  from our other tests

Reviewers: jingham, clayborg

Subscribers: zturner, lldb-commits

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

llvm-svn: 368806

5 years agoRemoved dead code from clang/tools/libclang/CXIndexDataConsumer.{cpp,h}
Dmitri Gribenko [Wed, 14 Aug 2019 07:32:51 +0000 (07:32 +0000)]
Removed dead code from clang/tools/libclang/CXIndexDataConsumer.{cpp,h}

Reviewers: jkorous

Subscribers: dexonsmith, arphaman, cfe-commits

Tags: #clang

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

llvm-svn: 368805

5 years ago[NewPM][PassInstrumentation] IR printing support from clang driver
Taewook Oh [Wed, 14 Aug 2019 07:11:09 +0000 (07:11 +0000)]
[NewPM][PassInstrumentation] IR printing support from clang driver

Summary: https://reviews.llvm.org/D50923 enabled the IR printing support for the new pass manager, but only for the case when `opt` tool is used as a driver. This patch is to enable the IR printing when `clang` is used as a driver.

Reviewers: fedor.sergeev, philip.pfaffe

Subscribers: cfe-commits, yamauchi, llvm-commits

Tags: #clang

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

llvm-svn: 368804

5 years ago[lldb] Reinstate original guard variable check
Raphael Isemann [Wed, 14 Aug 2019 05:52:33 +0000 (05:52 +0000)]
[lldb] Reinstate original guard variable check

The isGuardVariableSymbol option for ignoring Microsoft's ABI
was originally added to get the bots green, but now that we found
the actual issue (that we checked for prefix instead of suffix
in the MS ABI check), we should be able to properly implement
the guard variable check without any strange Microsoft exceptions.

llvm-svn: 368802

5 years ago[LV] Fold-tail flag
Dorit Nuzman [Wed, 14 Aug 2019 05:22:20 +0000 (05:22 +0000)]
[LV] Fold-tail flag

This is the compiler-flag equivalent of the Predicate pragma
(https://reviews.llvm.org/D65197), to direct the vectorizer to fold the
remainder-loop into the main-loop using predication.

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

Reviewers: Ayal, hsaito, fhahn, SjoerdMeije
llvm-svn: 368801

5 years agoRevert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM'
David L. Jones [Wed, 14 Aug 2019 04:50:33 +0000 (04:50 +0000)]
Revert '[LICM] Make Loop ICM profile aware' and 'Fix pass dependency for LICM'

This reverts r368526 (git commit 7e71aa24bc0788690fea7f0d7eab400c6a784deb)
This reverts r368542 (git commit cb5a90fd314a7914cf293797bb4fd7a6841052cf)

llvm-svn: 368800

5 years agoRemove minimum toolchain soft-error
JF Bastien [Wed, 14 Aug 2019 04:30:51 +0000 (04:30 +0000)]
Remove minimum toolchain soft-error

Summary:
Back in January I changed the minimum toolchain version required to build clang
and LLVM: D57264. Since then we've release LLVM 8, following
[our process](http://llvm.org/docs/DeveloperPolicy.html#toolchain)
it's therefore now a good time to remove the soft-error and officially deprecate
older toolchains. I tried this out last Tursday night to see if any bots
complained, and I saw no complaints. I also manually audited bots and didn't see
any bot that should break, but their toolchain information is unreliable and
some bots are offline.

Once this patch stick we'll move to C++14 as we've
[already agreed](http://lists.llvm.org/pipermail/llvm-dev/2019-January/129452.html).

Subscribers: mgorny, jkorous, dexonsmith, llvm-commits, EricWF, thakis, chandlerc

Tags: #llvm

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

llvm-svn: 368799

5 years agoCoroutines: adjust for SVN r358739
John McCall [Wed, 14 Aug 2019 03:54:25 +0000 (03:54 +0000)]
Coroutines: adjust for SVN r358739

CallSite has been removed in favour of CallBase.  Adjust the coroutine split to
account for that.

llvm-svn: 368798

5 years agoDon't run a full verifier pass in coro-splitting's private pipeline.
John McCall [Wed, 14 Aug 2019 03:54:18 +0000 (03:54 +0000)]
Don't run a full verifier pass in coro-splitting's private pipeline.

Potentially addresses rdar://49022293.

llvm-svn: 368797

5 years agoRemove unreachable blocks before splitting a coroutine.
John McCall [Wed, 14 Aug 2019 03:54:13 +0000 (03:54 +0000)]
Remove unreachable blocks before splitting a coroutine.

The suspend-crossing algorithm is not correct in the presence of uses
that cannot be reached on some successor path from their defs.

llvm-svn: 368796

5 years agoSupport swifterror in coroutine lowering.
John McCall [Wed, 14 Aug 2019 03:54:05 +0000 (03:54 +0000)]
Support swifterror in coroutine lowering.

The support for swifterror allocas should work in all lowerings.
The support for swifterror arguments only really works in a lowering
with prototypes where you can ensure that the prototype also has a
swifterror argument; I'm not really sure how it could possibly be
made to work in the switch lowering.

llvm-svn: 368795

5 years agoUpdate for optimizer changes.
John McCall [Wed, 14 Aug 2019 03:53:58 +0000 (03:53 +0000)]
Update for optimizer changes.

rdar://37352868

llvm-svn: 368794

5 years agoIn coro.retcon lowering, don't explode if the optimizer messes around with the linkag...
John McCall [Wed, 14 Aug 2019 03:53:52 +0000 (03:53 +0000)]
In coro.retcon lowering, don't explode if the optimizer messes around with the linkage of the prototype or the exact types of the yielded values.

llvm-svn: 368793

5 years agoFix a use-after-free in the coro.alloca treatment.
John McCall [Wed, 14 Aug 2019 03:53:46 +0000 (03:53 +0000)]
Fix a use-after-free in the coro.alloca treatment.

llvm-svn: 368792

5 years agoAdd intrinsics for doing frame-bound dynamic allocations within a coroutine.
John McCall [Wed, 14 Aug 2019 03:53:40 +0000 (03:53 +0000)]
Add intrinsics for doing frame-bound dynamic allocations within a coroutine.

These rely on having an allocator provided to the coroutine and thus,
for now, only work in retcon lowerings.

llvm-svn: 368791

5 years agoGuard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is...
John McCall [Wed, 14 Aug 2019 03:53:31 +0000 (03:53 +0000)]
Guard dumps in the coro intrinsic validation logic behind NDEBUG checks. dump() is not guaranteed to be defined in all builds.

llvm-svn: 368790

5 years agoGeneralize llvm.coro.suspend.retcon to allow an arbitrary number of arguments to...
John McCall [Wed, 14 Aug 2019 03:53:26 +0000 (03:53 +0000)]
Generalize llvm.coro.suspend.retcon to allow an arbitrary number of arguments to be passed back to the continuation function.

llvm-svn: 368789

5 years agoExtend coroutines to support a "returned continuation" lowering.
John McCall [Wed, 14 Aug 2019 03:53:17 +0000 (03:53 +0000)]
Extend coroutines to support a "returned continuation" lowering.

A quick contrast of this ABI with the currently-implemented ABI:

- Allocation is implicitly managed by the lowering passes, which is fine
  for frontends that are fine with assuming that allocation cannot fail.
  This assumption is necessary to implement dynamic allocas anyway.

- The lowering attempts to fit the coroutine frame into an opaque,
  statically-sized buffer before falling back on allocation; the same
  buffer must be provided to every resume point.  A buffer must be at
  least pointer-sized.

- The resume and destroy functions have been combined; the continuation
  function takes a parameter indicating whether it has succeeded.

- Conversely, every suspend point begins its own continuation function.

- The continuation function pointer is directly returned to the caller
  instead of being stored in the frame.  The continuation can therefore
  directly destroy the frame when exiting the coroutine instead of having
  to leave it in a defunct state.

- Other values can be returned directly to the caller instead of going
  through a promise allocation.  The frontend provides a "prototype"
  function declaration from which the type, calling convention, and
  attributes of the continuation functions are taken.

- On the caller side, the frontend can generate natural IR that directly
  uses the continuation functions as long as it prevents IPO with the
  coroutine until lowering has happened.  In combination with the point
  above, the frontend is almost totally in charge of the ABI of the
  coroutine.

- Unique-yield coroutines are given some special treatment.

llvm-svn: 368788

5 years ago[FileCheck] Document FILECHECK_OPTS in -help
Joel E. Denny [Wed, 14 Aug 2019 02:56:20 +0000 (02:56 +0000)]
[FileCheck] Document FILECHECK_OPTS in -help

Reviewed By: thopre

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

llvm-svn: 368787

5 years ago[FileCheck] Move -dump-input diagnostic to first line
Joel E. Denny [Wed, 14 Aug 2019 02:56:09 +0000 (02:56 +0000)]
[FileCheck] Move -dump-input diagnostic to first line

Without this patch, `-dump-input` prints a diagnostic at the end of
its marker range.  For example:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~ error: no match found
```

This patch moves it to the beginning like this:

```
         1: Start.
check:1     ^~~~~~
         2: Bad.
next:2      X~~~ error: no match found
         3: Many lines
next:2      ~~~~~~~~~~
         4: of input.
next:2      ~~~~~~~~~
         5: End.
next:2      ~~~~
```

The former somehow looks nicer because the diagnostic doesn't appear
to be somewhere within the marker range.  However, the latter is more
practical, especially when the marker range includes the remainder of
a very long dump.  First, in the case of an error, this patch enables
me to search the dump for `error:` and usually immediately land where
the detected error began.  Second, when trying to follow FileCheck's
logic, it's best to read top down, so this patch enables me to see
each diagnostic as soon as I encounter its marker.

Reviewed By: thopre

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

llvm-svn: 368786

5 years agoAdd __has_builtin support for builtin function-like type traits.
Richard Smith [Wed, 14 Aug 2019 02:30:11 +0000 (02:30 +0000)]
Add __has_builtin support for builtin function-like type traits.

Summary:
Previously __has_builtin(__builtin_*) would return false for
__builtin_*s that we modeled as keywords rather than as functions
(because they take type arguments). With this patch, all builtins
that are called with function-call-like syntax return true from
__has_builtin (covering __builtin_* and also the __is_* and __has_* type
traits and the handful of similar builtins without such a prefix).

Update the documentation on __has_builtin and on type traits to match.
While doing this I noticed the type trait documentation was out of date
and incomplete; that's fixed here too.

Reviewers: aaron.ballman

Subscribers: jfb, kristina, cfe-commits

Tags: #clang

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

llvm-svn: 368785

5 years ago[ELF] Initialize 2 fields of Symbol in SymbolTable::insert
Fangrui Song [Wed, 14 Aug 2019 01:52:47 +0000 (01:52 +0000)]
[ELF] Initialize 2 fields of Symbol in SymbolTable::insert

A new symbol is added to elf::symtab in 3 steps:

1) SymbolTable::insert creates a placeholder.
2) Symbol::mergeProperties
3) Symbol::replace

Fields referenced by steps 2) and 3) should be initialized in
SymbolTable::insert.  `traced` and `referenced` were missed previously.
This did not cause problems because compilers generated code that
initialized them (bit fields) to 0.

Reviewed By: grimar

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

llvm-svn: 368784

5 years ago[libcxxabi] Define _LIBCXXABI_GUARD_ABI_ARM on WebAssembly
Sam Clegg [Wed, 14 Aug 2019 01:30:48 +0000 (01:30 +0000)]
[libcxxabi] Define _LIBCXXABI_GUARD_ABI_ARM on WebAssembly

This matches ItaniumCXXABI.cpp.

Fixes PR42680

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

llvm-svn: 368783

5 years agoFix warning: suggest braces around initialization of subobject
Jonas Devlieghere [Wed, 14 Aug 2019 01:25:10 +0000 (01:25 +0000)]
Fix warning: suggest braces around initialization of subobject

This patch adds braces to the DEFINE_XMM macro.

llvm-svn: 368782

5 years ago[GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source...
Aditya Nandakumar [Wed, 14 Aug 2019 01:23:33 +0000 (01:23 +0000)]
[GlobalISel]: Fix lowering of G_Shuffle_vector where we pick up the wrong source index

https://reviews.llvm.org/D66182

llvm-svn: 368781

5 years ago[analyzer] Don't delete TaintConfig copy constructor
Alex Langford [Wed, 14 Aug 2019 01:09:07 +0000 (01:09 +0000)]
[analyzer] Don't delete TaintConfig copy constructor

Summary:
Explicitly deleting the copy constructor makes compiling the function
`ento::registerGenericTaintChecker` difficult with some compilers. When we
construct an `llvm::Optional<TaintConfig>`, the optional is constructed with a
const TaintConfig reference which it then uses to invoke the deleted TaintConfig
copy constructor.

I've observered this failing with clang 3.8 on Ubuntu 16.04.

Reviewers: compnerd, Szelethus, boga95, NoQ, alexshap

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, llvm-commits, cfe-commits

Tags: #clang

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

llvm-svn: 368779

5 years ago[ORC] Fix clang-interpreter example code broken by r368707.
Douglas Yung [Wed, 14 Aug 2019 01:03:35 +0000 (01:03 +0000)]
[ORC] Fix clang-interpreter example code broken by r368707.

llvm-svn: 368778

5 years ago[analyzer][NFC] Prepare visitors for different tracking kinds
Kristof Umann [Wed, 14 Aug 2019 00:48:57 +0000 (00:48 +0000)]
[analyzer][NFC] Prepare visitors for different tracking kinds

When we're tracking a variable that is responsible for a null pointer
dereference or some other sinister programming error, we of course would like to
gather as much information why we think that the variable has that specific
value as possible. However, the newly introduced condition tracking shows that
tracking all values this thoroughly could easily cause an intolerable growth in
the bug report's length.

There are a variety of heuristics we discussed on the mailing list[1] to combat
this, all of them requiring to differentiate in between tracking a "regular
value" and a "condition".

This patch introduces the new `bugreporter::TrackingKind` enum, adds it to
several visitors as a non-optional argument, and moves some functions around to
make the code a little more coherent.

[1] http://lists.llvm.org/pipermail/cfe-dev/2019-June/062613.html

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

llvm-svn: 368777

5 years agoUpdate Python tests for lldb-server on Windows
Aaron Smith [Wed, 14 Aug 2019 00:14:15 +0000 (00:14 +0000)]
Update Python tests for lldb-server on Windows

Summary: Thanks to Hui Huang and reviewers for all the help with this patch!

Reviewers: labath, jfb, clayborg

Reviewed By: labath

Subscribers: Hui, clayborg, dexonsmith, lldb-commits

Tags: #lldb

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

llvm-svn: 368776

5 years ago[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.
Amara Emerson [Tue, 13 Aug 2019 23:51:20 +0000 (23:51 +0000)]
[AArch64][GlobalISel] RBS: Treat s128s like vectors when unmerging.

The destinations should be FPRs (for now).

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

llvm-svn: 368775

5 years agoEnable lldb-server on Windows
Aaron Smith [Tue, 13 Aug 2019 23:50:54 +0000 (23:50 +0000)]
Enable lldb-server on Windows

Summary:
This commit contains three small changes to enable lldb-server on Windows.

- Add lldb-server for Windows to the build
- Disable pty redirection on Windows for the initial lldb-server bring up
- Add a support to get the parent pid for a process on Windows
- Ifdef some signals which aren't supported on Windows

Thanks to Hui Huang for the help with this patch!

Reviewers: labath

Reviewed By: labath

Subscribers: JDevlieghere, compnerd, Hui, amccarth, xiaobai, srhines, mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 368774

5 years ago[analyzer] Track the right hand side of the last store regardless of its value
Kristof Umann [Tue, 13 Aug 2019 23:48:10 +0000 (23:48 +0000)]
[analyzer] Track the right hand side of the last store regardless of its value

Summary:
The following code snippet taken from D64271#1572188 has an issue: namely,
because `flag`'s value isn't undef or a concrete int, it isn't being tracked.

int flag;
bool coin();

void foo() {
  flag = coin();
}

void test() {
  int *x = 0;
  int local_flag;
  flag = 1;

  foo();
  local_flag = flag;
  if (local_flag)
    x = new int;

  foo();
  local_flag = flag;
  if (local_flag)
    *x = 5;
}

This, in my opinion, makes no sense, other values may be interesting too.
Originally added by rC185608.

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

llvm-svn: 368773

5 years ago[DebugLine] Be more robust in geussing the path style
Jonas Devlieghere [Tue, 13 Aug 2019 23:30:11 +0000 (23:30 +0000)]
[DebugLine] Be more robust in geussing the path style

My previous change didn't fix the Windows bot. This patch is an attempt
to make guessing the path style more robust by first looking at the
compile dir and falling back to the actual file if that's unsuccessful.

llvm-svn: 368772

5 years ago[analyzer] Prune calls to functions with linear CFGs that return a non-zero constrain...
Kristof Umann [Tue, 13 Aug 2019 23:22:33 +0000 (23:22 +0000)]
[analyzer] Prune calls to functions with linear CFGs that return a non-zero constrained value

During the evaluation of D62883, I noticed a bunch of totally
meaningless notes with the pattern of "Calling 'A'" -> "Returning value"
-> "Returning from 'A'", which added no value to the report at all.

This patch (not only affecting tracked conditions mind you) prunes
diagnostic messages to functions that return a value not constrained to
be 0, and are also linear.

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

llvm-svn: 368771

5 years ago[AArch64] Remove incorrect usage of MONonTemporal.
Eli Friedman [Tue, 13 Aug 2019 23:12:14 +0000 (23:12 +0000)]
[AArch64] Remove incorrect usage of MONonTemporal.

This has no effect at the moment, but might matter if we try to
implement non-temporal loads in the future.

llvm-svn: 368770

5 years ago[analyzer] exploded-graph-rewriter: Implement displaying Store pointers.
Artem Dergachev [Tue, 13 Aug 2019 23:04:56 +0000 (23:04 +0000)]
[analyzer] exploded-graph-rewriter: Implement displaying Store pointers.

They're useful when trying to understand what's going on
inside your LazyCompoundValues.

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

llvm-svn: 368769