platform/upstream/llvm.git
5 years ago[ASTImporter] Fix inequivalence of unresolved exception spec
Gabor Marton [Wed, 8 May 2019 15:23:48 +0000 (15:23 +0000)]
[ASTImporter] Fix inequivalence of unresolved exception spec

Summary:
Structural equivalence of methods can falsely report false when the
exception specifier is unresolved (i.e unevaluated or not instantiated).

(This caused one assertion during bitcoin ctu-analysis.)

Reviewers: a_sidorin, shafik, a.sidorin

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

Tags: #clang

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

llvm-svn: 360261

5 years agoRevert "[ValueTracking] Improve isKnowNonZero for Ints"
Nikita Popov [Wed, 8 May 2019 14:50:01 +0000 (14:50 +0000)]
Revert "[ValueTracking] Improve isKnowNonZero for Ints"

This reverts commit 3b137a495686bd6018d115ea82fb8bb7718349fd.

As reported in https://reviews.llvm.org/D60846, this is causing
miscompiles.

llvm-svn: 360260

5 years ago[Support] Fix unit test for fs::is_local
Petar Jovanovic [Wed, 8 May 2019 14:42:13 +0000 (14:42 +0000)]
[Support] Fix unit test for fs::is_local

Close the temporary file after the test is done using it.
If it is not closed and the file was created on NFS, it will cause the test
to fail. The problem happens in the cleanup process afterwards. It first
tries to delete the file but it is not really deleted. Afterwards, the
program fails to delete the directory containing the file, causing the whole
test to fail.

Patch by Milos Stojanovic.

llvm-svn: 360259

5 years ago[Sema][OpenCL] Make address space conversions a bit stricter.
Anastasia Stulova [Wed, 8 May 2019 14:23:49 +0000 (14:23 +0000)]
[Sema][OpenCL] Make address space conversions a bit stricter.

The semantics for converting nested pointers between address
spaces are not very well defined. Some conversions which do not
really carry any meaning only produce warnings, and in some cases
warnings hide invalid conversions, such as 'global int*' to
'local float*'!

This patch changes the logic in checkPointerTypesForAssignment
and checkAddressSpaceCast to fail properly on implicit conversions
that should definitely not be permitted. We also dig deeper into the
pointer types and warn on explicit conversions where the address
space in a nested pointer changes, regardless of whether the address
space is compatible with the corresponding pointer nesting level
on the destination type.

Fixes PR39674!

Patch by ebevhan (Bevin Hansson)!

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

llvm-svn: 360258

5 years ago[clang-format] Fix the crash when formatting unsupported encodings
Owen Pan [Wed, 8 May 2019 14:11:12 +0000 (14:11 +0000)]
[clang-format] Fix the crash when formatting unsupported encodings

Fixes PR33946

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

llvm-svn: 360257

5 years ago[clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones
Owen Pan [Wed, 8 May 2019 13:49:17 +0000 (13:49 +0000)]
[clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) ones

Also fix a typo for the SCSU byte order mark.

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

llvm-svn: 360256

5 years ago[ADT] SmallVector::set_size - fix Wdocumentation. NFCI.
Simon Pilgrim [Wed, 8 May 2019 13:47:17 +0000 (13:47 +0000)]
[ADT] SmallVector::set_size - fix Wdocumentation. NFCI.

Also fixes a Wshadow warning on MSVC.

llvm-svn: 360255

5 years agoAllow test to pass after 2030.
Aaron Ballman [Wed, 8 May 2019 13:42:44 +0000 (13:42 +0000)]
Allow test to pass after 2030.

Patch by Bernhard M. Wiedemann.

llvm-svn: 360254

5 years agogn build: Merge r360151
Nico Weber [Wed, 8 May 2019 13:41:01 +0000 (13:41 +0000)]
gn build: Merge r360151

llvm-svn: 360253

5 years ago[NFC]Fix British English -> American English issues
James Henderson [Wed, 8 May 2019 13:30:48 +0000 (13:30 +0000)]
[NFC]Fix British English -> American English issues

llvm-svn: 360252

5 years ago[llvm-objcopy] Improve error message for unrecognised archive member
James Henderson [Wed, 8 May 2019 13:28:58 +0000 (13:28 +0000)]
[llvm-objcopy] Improve error message for unrecognised archive member

Prior to this patch, llvm-objcopy's error messages for archives with
unsupported members only mentioned the archive name, not the member
name, making them unhelpful. This change improves it by approximately
following GNU objcopy's error message syntax of
"<archive name>(<member name>): <problem>".

Reviewed by: grimar

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

llvm-svn: 360251

5 years agoAllow 'static' storage specifier on an out-of-line class member template declaration...
Aaron Ballman [Wed, 8 May 2019 13:24:36 +0000 (13:24 +0000)]
Allow 'static' storage specifier on an out-of-line class member template declaration in MSVCCompat mode.

Patch by Soumi Manna.

llvm-svn: 360250

5 years ago[libclang] PR41649: Remove pointless duplicate flag. NFC.
Nikolai Kosjar [Wed, 8 May 2019 13:19:29 +0000 (13:19 +0000)]
[libclang] PR41649: Remove pointless duplicate flag. NFC.

llvm-svn: 360249

5 years agoFix whitespace mismatches. NFCI.
Simon Pilgrim [Wed, 8 May 2019 13:02:32 +0000 (13:02 +0000)]
Fix whitespace mismatches. NFCI.

Tabs are not our friends.

llvm-svn: 360248

5 years agoDocumentation for bugprone-inaccurate-erase: added an example of a bug that this...
Dmitri Gribenko [Wed, 8 May 2019 12:02:31 +0000 (12:02 +0000)]
Documentation for bugprone-inaccurate-erase: added an example of a bug that this checker catches

Reviewers: alexfh

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 360247

5 years ago[DWARF] Centralize user_id <-> DWARFDIE conversions
Pavel Labath [Wed, 8 May 2019 11:43:05 +0000 (11:43 +0000)]
[DWARF] Centralize user_id <-> DWARFDIE conversions

Summary:
The logic for translating a user_id into a DWARFDIE was replicated in
several places. This removes that redundancy and settles on a single
implementation in SymbolFileDWARF.

The reason for choosing that instead of DIERef was that we were
always immediately converting the returned DIERef into a DWARFDIE
anyway, which meant that one had to specify the SymbolFileDWARF argument
twice (once to get the DIERef, and once to get the actual DIE). Also,
passing a higher-level object (SymbolFileDWARF) into a lower-level one
(DIERef) seemed like a less intuitive arrangement than doing things the
other way around.

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: tberghammer, jankratochvil, lldb-commits

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

llvm-svn: 360246

5 years ago[LegalizeDAG] Assert non-power-of-2 load/store op splits are in range. NFCI.
Simon Pilgrim [Wed, 8 May 2019 11:22:10 +0000 (11:22 +0000)]
[LegalizeDAG] Assert non-power-of-2 load/store op splits are in range. NFCI.

Fixes static analyzer undefined/out-of-range shift warnings.

llvm-svn: 360245

5 years ago[Hexagon] Fix cppcheck reduce variable scope warnings. NFCI.
Simon Pilgrim [Wed, 8 May 2019 11:02:46 +0000 (11:02 +0000)]
[Hexagon] Fix cppcheck reduce variable scope warnings. NFCI.

Also fixes a static analyzer "Value stored to 'S2' during its initialization is never read" warning.

llvm-svn: 360244

5 years ago[MCA] Don't add a name to the default code region.
Andrea Di Biagio [Wed, 8 May 2019 11:00:43 +0000 (11:00 +0000)]
[MCA] Don't add a name to the default code region.

This is done in preparation for a patch that fixes PR41523.

llvm-svn: 360243

5 years agoARM: disallow SP as Rn for Thumb2 TST & TEQ instructions
Tim Northover [Wed, 8 May 2019 10:59:08 +0000 (10:59 +0000)]
ARM: disallow SP as Rn for Thumb2 TST & TEQ instructions

Using SP in this position is unpredictable in ARMv7. CMP and CMN are not
affected, and of course v8 relaxes this requirement, but that's handled
elsewhere.

llvm-svn: 360242

5 years ago[VPlan] Fix "value never used" static analyzer warning. NFCI.
Simon Pilgrim [Wed, 8 May 2019 10:52:26 +0000 (10:52 +0000)]
[VPlan] Fix "value never used" static analyzer warning. NFCI.

llvm-svn: 360241

5 years ago[MCA] Slightly refactor CodeRegion.h. NFCI
Andrea Di Biagio [Wed, 8 May 2019 10:44:05 +0000 (10:44 +0000)]
[MCA] Slightly refactor CodeRegion.h. NFCI

Also, use a SmallVector instead of a std::vector for the code region.

llvm-svn: 360240

5 years agoR600InstrInfo.cpp - Add getTransSwizzle assert for the swizzle op index. NFCI.
Simon Pilgrim [Wed, 8 May 2019 10:39:56 +0000 (10:39 +0000)]
R600InstrInfo.cpp - Add getTransSwizzle assert for the swizzle op index. NFCI.

Fixes static analyzer undefined value warning.

llvm-svn: 360239

5 years ago[polly][SCEV] Expand SCEV matcher cases for new smin/umin ops
Keno Fischer [Wed, 8 May 2019 10:36:04 +0000 (10:36 +0000)]
[polly][SCEV] Expand SCEV matcher cases for new smin/umin ops

These were added in rL360159, but I neglected to update polly at the
same time.

llvm-svn: 360238

5 years ago[MCA] Remove dead assignment. NFC
Andrea Di Biagio [Wed, 8 May 2019 10:28:56 +0000 (10:28 +0000)]
[MCA] Remove dead assignment. NFC

llvm-svn: 360237

5 years ago[SIMode] Fix typo in Status constructor
Simon Pilgrim [Wed, 8 May 2019 10:24:22 +0000 (10:24 +0000)]
[SIMode] Fix typo in Status constructor

As noted in https://www.viva64.com/en/b/0629/ (Snippet No. 36) and the scan-build CI reports (https://llvm.org/reports/scan-build/report-SIModeRegister.cpp-Status-1-1.html#EndPath), rL348754 introduced a typo in the Status constructor due to argument variable names shadowing the member variable names.

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

llvm-svn: 360236

5 years ago[DebugInfo] Fix use-after-move warning. NFCI.
Simon Pilgrim [Wed, 8 May 2019 10:09:57 +0000 (10:09 +0000)]
[DebugInfo] Fix use-after-move warning. NFCI.

Don't rely on DWARFAbbreviationDeclarationSet::extract cleaning the struct up for reuse - the analyzers don't like it.

llvm-svn: 360235

5 years agoFix cppcheck operator precedence warning. NFCI.
Simon Pilgrim [Wed, 8 May 2019 10:07:34 +0000 (10:07 +0000)]
Fix cppcheck operator precedence warning. NFCI.

llvm-svn: 360234

5 years ago[llvm-objcopy] Add --prefix-alloc-sections
James Henderson [Wed, 8 May 2019 09:49:35 +0000 (09:49 +0000)]
[llvm-objcopy] Add --prefix-alloc-sections

This patch adds support for --prefix-alloc-sections, which adds a prefix
to every allocated section names.

It adds a prefix after renaming section names by --rename-section as GNU
objcopy does.

Fixes PR41266: https://bugs.llvm.org/show_bug.cgi?id=41266

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

Patch by Seiya Nuta.

llvm-svn: 360233

5 years ago[SCCP] Fix crash when trying to constant-fold terminators multiple times.
Florian Hahn [Wed, 8 May 2019 09:09:54 +0000 (09:09 +0000)]
[SCCP] Fix crash when trying to constant-fold terminators multiple times.

If we fold a branch/switch to an unconditional branch to another dead block we
replace the branch with unreachable, to avoid attempting to fold the
unconditional branch.

Reviewers: davide, efriedma, mssimpso, jdoerfert

Reviewed By: jdoerfert

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

llvm-svn: 360232

5 years ago[clang-tidy] Do not show incorrect fix in modernize-make-unique
Ilya Biryukov [Wed, 8 May 2019 08:52:18 +0000 (08:52 +0000)]
[clang-tidy] Do not show incorrect fix in modernize-make-unique

Summary:
The case when initialize_list hides behind an implicit case was not
handled before.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 360231

5 years ago[CMake] Install import libraries
Martin Storsjo [Wed, 8 May 2019 08:37:34 +0000 (08:37 +0000)]
[CMake] Install import libraries

Simplify the cmake logic to install both runtime and import
libraries (treated as ARCHIVE), as the later are needed to link
against llvm.

Patch by Julien Schueller!

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

llvm-svn: 360230

5 years ago[NFC][PowerPC] Add test for store combine optimization.
QingShan Zhang [Wed, 8 May 2019 07:56:59 +0000 (07:56 +0000)]
[NFC][PowerPC] Add test for store combine optimization.

llvm-svn: 360229

5 years ago[CodeGenPrepare] Don't split the store if it is volatile
QingShan Zhang [Wed, 8 May 2019 07:32:12 +0000 (07:32 +0000)]
[CodeGenPrepare] Don't split the store if it is volatile
We shouldn't split the store when it is volatile.

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

llvm-svn: 360228

5 years ago[llvm-objcopy] - Fix for "Bug 41775 - SymbolTableSection::addSymbol - shadow variable...
George Rimar [Wed, 8 May 2019 07:31:05 +0000 (07:31 +0000)]
[llvm-objcopy] - Fix for "Bug 41775 - SymbolTableSection::addSymbol - shadow variable names"

This is a fix for https://bugs.llvm.org/show_bug.cgi?id=41775,

Problem is in the final line:
Size += this->EntrySize;

I checked that we do not actually need it in this place,
since we always call removeSectionReferences which
calls removeSymbols which updates the Size.

But it worth to keep it, that allows to relax the dependencies.

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

llvm-svn: 360227

5 years ago[NFC] Add a static function to do the endian check
QingShan Zhang [Wed, 8 May 2019 07:21:37 +0000 (07:21 +0000)]
[NFC] Add a static function to do the endian check
Add a new function to do the endian check, as I will commit another patch later, which will also need the endian check.

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

llvm-svn: 360226

5 years agoFix for the greendragon bots.
Leonard Chan [Wed, 8 May 2019 05:59:25 +0000 (05:59 +0000)]
Fix for the greendragon bots.

Adds extra checks for ObjC GC and Ownership.

llvm-svn: 360225

5 years ago[Sema] Correct typos in return statements so the return types of 'auto' functions...
Sam McCall [Wed, 8 May 2019 05:49:42 +0000 (05:49 +0000)]
[Sema] Correct typos in return statements so the return types of 'auto' functions are always deduced.

Summary:
e.g.
  auto foo() {
    return no_such_thing; // Return value is a TypoExpr
  }
  using T = decltype(foo()); // Uh-oh, undeduced auto.

Reviewers: rsmith

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 360224

5 years ago[llvm] Avoid div by 0 when updating profile weights.
Mircea Trofin [Wed, 8 May 2019 03:57:25 +0000 (03:57 +0000)]
[llvm] Avoid div by 0 when updating profile weights.

Reviewers: davidxl

Reviewed By: davidxl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360223

5 years ago[ValueTracking] Improve isKnowNonZero for Ints
Dan Robertson [Wed, 8 May 2019 02:25:08 +0000 (02:25 +0000)]
[ValueTracking] Improve isKnowNonZero for Ints

Improve isKnownNonZero for integers in order to improve cttz
optimizations.

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

llvm-svn: 360222

5 years ago[Support] Add error handling to sys::Process::getPageSize().
Lang Hames [Wed, 8 May 2019 02:11:07 +0000 (02:11 +0000)]
[Support] Add error handling to sys::Process::getPageSize().

This patch changes the return type of sys::Process::getPageSize to
Expected<unsigned> to account for the fact that the underlying syscalls used to
obtain the page size may fail (see below).

For clients who use the page size as an optimization only this patch adds a new
method, getPageSizeEstimate, which calls through to getPageSize but discards
any error returned and substitues a "reasonable" page size estimate estimate
instead. All existing LLVM clients are updated to call getPageSizeEstimate
rather than getPageSize.

On Unix, sys::Process::getPageSize is implemented in terms of getpagesize or
sysconf, depending on which macros are set. The sysconf call is documented to
return -1 on failure. On Darwin getpagesize is implemented in terms of sysconf
and may also fail (though the manpage documentation does not mention this).
These failures have been observed in practice when highly restrictive sandbox
permissions have been applied. Without this patch, the result is that
getPageSize returns -1, which wreaks havoc on any subsequent code that was
assuming a sane page size value.

<rdar://problem/41654857>

Reviewers: dblaikie, echristo

Subscribers: kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 360221

5 years agoFix buildbot break after r360195
Nemanja Ivanovic [Wed, 8 May 2019 02:03:32 +0000 (02:03 +0000)]
Fix buildbot break after r360195

llvm-svn: 360220

5 years ago[Docs] Fix incorrect heading and update titles.
Jonas Devlieghere [Wed, 8 May 2019 01:51:26 +0000 (01:51 +0000)]
[Docs] Fix incorrect heading and update titles.

This patch fixes two incorrect headings in source.rst which caused it to
show up on the homepage. I also updated the titles to have more sensible
links there.

llvm-svn: 360219

5 years ago[Docs] Re-order homepage: Download -> Build -> Test
Jonas Devlieghere [Wed, 8 May 2019 01:38:12 +0000 (01:38 +0000)]
[Docs] Re-order homepage: Download -> Build -> Test

I also reformatted some paragraphs to 80 cols.

llvm-svn: 360218

5 years agoSplit ActOnCallExpr into an ActOnCallExpr to be called by the parser,
Richard Smith [Wed, 8 May 2019 01:36:36 +0000 (01:36 +0000)]
Split ActOnCallExpr into an ActOnCallExpr to be called by the parser,
and a BuildCallExpr to be called internally within Sema to build /
rebuild calls.

llvm-svn: 360217

5 years agoPropagate command interpreter errors from lldlbinit
Jonas Devlieghere [Wed, 8 May 2019 01:23:47 +0000 (01:23 +0000)]
Propagate command interpreter errors from lldlbinit

This patch ensures that we propagate errors coming from the lldbinit
file trough the command/script interpreter. Before, if you did something
like command script import syntax_error.py, and the python file
contained a syntax error, lldb wouldn't tell you about it. This changes
with the current patch: errors are now propagated by default.

PS: Jim authored this change and I added testing.

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

llvm-svn: 360216

5 years ago[libFuzzer] extend the test for data flow tracer and coverage; also hopefully fix...
Kostya Serebryany [Wed, 8 May 2019 01:03:05 +0000 (01:03 +0000)]
[libFuzzer] extend the test for data flow tracer and coverage; also hopefully fix it on the bot

llvm-svn: 360215

5 years ago[hip] Fix ambiguity from `>>>` of CUDA.
Michael Liao [Wed, 8 May 2019 00:52:33 +0000 (00:52 +0000)]
[hip] Fix ambiguity from `>>>` of CUDA.

Summary:
- For template arguments ending with `>>>`, we should cease lookahead
  and treat it as type-id firstly, so that deduction could work
  properly.

Reviewers: tra, yaxunl

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 360214

5 years ago[libFuzzer] extend the data flow tracer to also produce basic block coverage for...
Kostya Serebryany [Wed, 8 May 2019 00:51:15 +0000 (00:51 +0000)]
[libFuzzer] extend the data flow tracer to also produce basic block coverage for every input. An extended test coming in a separte change.

llvm-svn: 360213

5 years agoFix build on NetBSD 8.99.38
Kamil Rytarowski [Wed, 8 May 2019 00:44:41 +0000 (00:44 +0000)]
Fix build on NetBSD 8.99.38

With recent changes the dev/nvmm/nvmm_ioctl.h header is no longer
a standalone NVMM header. Disable it until the NVMM operations will
stabilize and be included in the ioctl(2) interceptors.

llvm-svn: 360212

5 years ago[libFuzzer] disable two tests on i386 that are causing timeouts on the bots
Kostya Serebryany [Wed, 8 May 2019 00:43:12 +0000 (00:43 +0000)]
[libFuzzer] disable two tests on i386 that are causing timeouts on the bots

llvm-svn: 360211

5 years ago[Tests] Expand coverage of small memset zero idioms
Philip Reames [Tue, 7 May 2019 23:48:42 +0000 (23:48 +0000)]
[Tests] Expand coverage of small memset zero idioms

llvm-svn: 360210

5 years ago[Docs] Add timestamp
Jonas Devlieghere [Tue, 7 May 2019 23:14:06 +0000 (23:14 +0000)]
[Docs] Add timestamp

llvm-svn: 360209

5 years ago[Expression] Remove unused dependency
Alex Langford [Tue, 7 May 2019 23:11:05 +0000 (23:11 +0000)]
[Expression] Remove unused dependency

lldbExpression was linking against lldbPluginExpressionParserClang, and
lldbPluginExpressionParserClang was linking against lldbExpression.
There's no reason lldbExpression should need anything from
lldbPluginExpressionParserClang, so let's remove that dependency.

llvm-svn: 360208

5 years ago[COFF] Use COFF stubs for extern_weak functions
Reid Kleckner [Tue, 7 May 2019 23:06:21 +0000 (23:06 +0000)]
[COFF] Use COFF stubs for extern_weak functions

Summary:
A COFF stub indirects the reference to a symbol through memory. A
.refptr.$sym global variable pointer is created to refer to $sym.
Typically mingw uses these for external global variable declarations,
but we can use them for weak function declarations as well.

Updates the dso_local classification to add a special case for
extern_weak symbols on COFF in both clang and LLVM.

Fixes PR37598

Reviewers: smeenai, mstorsjo

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 360207

5 years ago[ValueTracking] add logic for known-never-nan with minnum/maxnum
Sanjay Patel [Tue, 7 May 2019 22:58:31 +0000 (22:58 +0000)]
[ValueTracking] add logic for known-never-nan with minnum/maxnum

From the LangRef: "Returns NaN only if both operands are NaN."

llvm-svn: 360206

5 years agoReapply r360194 "[JITLink] Add support for MachO .alt_entry atoms." with fixes.
Lang Hames [Tue, 7 May 2019 22:56:40 +0000 (22:56 +0000)]
Reapply r360194 "[JITLink] Add support for MachO .alt_entry atoms." with fixes.

This patch modifies MachOAtomGraphBuilder to use setLayoutNext rather than
addEdge, and fixes a bug in the section layout algorithm that could result in
atoms appearing more than once in the section ordering (which resulted in those
atoms being assigned invalid addresses during layout).

llvm-svn: 360205

5 years agoRegenerate test case again after last revert
Reid Kleckner [Tue, 7 May 2019 22:40:40 +0000 (22:40 +0000)]
Regenerate test case again after last revert

llvm-svn: 360204

5 years agoDelete test cases added in r360162 that should have been deleted in r360190
Reid Kleckner [Tue, 7 May 2019 22:35:56 +0000 (22:35 +0000)]
Delete test cases added in r360162 that should have been deleted in r360190

llvm-svn: 360203

5 years ago[analyzer] Fix a crash when doing RVO from within blocks.
Artem Dergachev [Tue, 7 May 2019 22:33:13 +0000 (22:33 +0000)]
[analyzer] Fix a crash when doing RVO from within blocks.

When looking for the location context of the call site, unwrap block invocation
contexts because they are attached to the current AnalysisDeclContext
while what we need is the previous AnalysisDeclContext.

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

llvm-svn: 360202

5 years ago[MemorySSA] Fix CHECKs in test. [NFC]
Alina Sbirlea [Tue, 7 May 2019 22:26:52 +0000 (22:26 +0000)]
[MemorySSA] Fix CHECKs in test. [NFC]

llvm-svn: 360201

5 years agoRevert r360194 "[JITLink] Add support for MachO .alt_entry atoms."
Lang Hames [Tue, 7 May 2019 22:19:29 +0000 (22:19 +0000)]
Revert r360194 "[JITLink] Add support for MachO .alt_entry atoms."

The testcase is asserting on some bots - reverting while I investigate.

llvm-svn: 360200

5 years ago[AMDGPU] Check MI bundles for hazards
Austin Kerbow [Tue, 7 May 2019 22:12:15 +0000 (22:12 +0000)]
[AMDGPU] Check MI bundles for hazards

Summary: GCNHazardRecognizer fails to identify hazards that are in and around bundles. This patch allows the hazard recognizer to consider bundled instructions in both scheduler and hazard recognizer mode. We ignore “bundledness” for the purpose of detecting hazards and examine the instructions individually.

Reviewers: arsenm, msearles, rampitec

Reviewed By: rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360199

5 years ago[CodeGen] Rename DEBUG_TYPE for default hazard recognizer.
Austin Kerbow [Tue, 7 May 2019 22:09:04 +0000 (22:09 +0000)]
[CodeGen] Rename DEBUG_TYPE for default hazard recognizer.

Summary:
The DEBUG_TYPE of the default hazard recognizer should be updated to
match the DEBUG_TYPE of the machine-scheduler pass.

Reviewers: rampitec

Reviewed By: rampitec

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 360198

5 years ago[InstSimplify] add tests for minnum/maxnum and NaN; NFC
Sanjay Patel [Tue, 7 May 2019 21:50:09 +0000 (21:50 +0000)]
[InstSimplify] add tests for minnum/maxnum and NaN; NFC

llvm-svn: 360197

5 years ago[CMake] Detecting python modules should be cached
Chris Bieneman [Tue, 7 May 2019 21:46:55 +0000 (21:46 +0000)]
[CMake] Detecting python modules should be cached

Summary: This requres exec-ing python, which in a trace I ran of the CMake re-configure time took ~2% of the reconfigure time.

Reviewers: phosek, smeenai, compnerd

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 360196

5 years ago-frewrite-imports: Add support for wildcard rules in umbrella modules with
David Blaikie [Tue, 7 May 2019 21:38:51 +0000 (21:38 +0000)]
-frewrite-imports: Add support for wildcard rules in umbrella modules with

This trips over a few other limitations, but in the interests of incremental development I'm starting here & I'll look at the issues with -verify and filesystem checks (the fact that the behavior depends on the existence of a 'foo' directory even though it shouldn't need it), etc.

Reviewers: rsmith

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

llvm-svn: 360195

5 years ago[JITLink] Add support for MachO .alt_entry atoms.
Lang Hames [Tue, 7 May 2019 21:35:14 +0000 (21:35 +0000)]
[JITLink] Add support for MachO .alt_entry atoms.

The MachO .alt_entry directive is applied to a symbol to indicate that it is
locked (in terms of address layout and liveness) to its predecessor atom. I.e.
it is an alternate entry point, at a fixed offset, for the previous atom.

This patch updates MachOAtomGraphBuilder to check for the .alt_entry flag on
symbols and add a corresponding LayoutNext edge to the atom-graph. It also
updates MachOAtomGraphBuilder_x86_64 to generalize handling of the
X86_64_RELOC_SUBTRACTOR relocation: previously either the minuend or
subtrahend of the subtraction had to be the same as the atom being fixed up,
now it is only necessary for the minuend or subtrahend to be locked (via any
chain of alt_entry directives) to the atom being fixed up.

llvm-svn: 360194

5 years ago[Core] Remove unused dependencies
Alex Langford [Tue, 7 May 2019 21:34:44 +0000 (21:34 +0000)]
[Core] Remove unused dependencies

llvm-svn: 360193

5 years agoRevert "[OpenMP][Clang] Support for target math functions"
Jonas Devlieghere [Tue, 7 May 2019 21:08:15 +0000 (21:08 +0000)]
Revert "[OpenMP][Clang] Support for target math functions"

This commit appears to be breaking stage-2 builds on GreenDragon. The
OpenMP wrappers for cmath and math.h are copied into the root of the
resource directory and cause a cyclic dependency in module 'Darwin':
Darwin -> std -> Darwin. This blows up when CMake is testing for modules
support and breaks all stage 2 module builds, including the ThinLTO bot
and all LLDB bots.

CMake Error at cmake/modules/HandleLLVMOptions.cmake:497 (message):
  LLVM_ENABLE_MODULES is not supported by this compiler

llvm-svn: 360192

5 years agorevert r360162 as it breaks most of the buildbots
Kostya Serebryany [Tue, 7 May 2019 20:57:11 +0000 (20:57 +0000)]
revert r360162 as it breaks most of the buildbots

llvm-svn: 360190

5 years ago[ConstantRange] Simplify makeGNWR implementation; NFC
Nikita Popov [Tue, 7 May 2019 20:34:46 +0000 (20:34 +0000)]
[ConstantRange] Simplify makeGNWR implementation; NFC

Compute results in more direct ways, avoid subset intersect
operations. Extract the core code for computing mul nowrap ranges
into separate static functions, so they can be reused.

llvm-svn: 360189

5 years ago[COFF] Store Chunk RVAs and section offsets as uint32_t
Reid Kleckner [Tue, 7 May 2019 20:30:41 +0000 (20:30 +0000)]
[COFF] Store Chunk RVAs and section offsets as uint32_t

Saves 8 bytes on SectionChunk, one of the most commonly allocated data
structures.

llvm-svn: 360188

5 years ago[mips] Fix ld instruction in PLT entries on MIPS64
Simon Atanasyan [Tue, 7 May 2019 20:26:23 +0000 (20:26 +0000)]
[mips] Fix ld instruction in PLT entries on MIPS64

Use `ld` and `daddiu` instructions in MIPS64 PLT records. That fixes a
segmentation fault.

Patch by Qiao Pengcheng.

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

llvm-svn: 360187

5 years ago[mips] Rename test case. NFC
Simon Atanasyan [Tue, 7 May 2019 20:26:12 +0000 (20:26 +0000)]
[mips] Rename test case. NFC

This test case checks MIPS PLT records for N64 ABI. For the N32 ABI case
there is a separate test case `mips-plt-n32.s`.

llvm-svn: 360186

5 years ago[InstCombine] Add new combine to add folding
Robert Lougher [Tue, 7 May 2019 19:36:41 +0000 (19:36 +0000)]
[InstCombine] Add new combine to add folding

(X | C1) + C2 --> (X | C1) ^ C1 iff (C1 == -C2)

I verified the correctness using Alive:
https://rise4fun.com/Alive/YNV

This transform enables the following transform that already exists in
instcombine:

(X | Y) ^ Y --> X & ~Y

As a result, the full expected transform is:

(X | C1) + C2 --> X & ~C1 iff (C1 == -C2)

There already exists the transform in the sub case:

(X | Y) - Y --> X & ~Y

However this does not trigger in the case where Y is constant due to an earlier
transform:

X - (-C) --> X + C

With this new add fold, both the add and sub constant cases are handled.

Patch by Chris Dawson.

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

llvm-svn: 360185

5 years agoMake sure that the DAG combiner doesn't merge stores that we explicitly
Eric Christopher [Tue, 7 May 2019 19:25:34 +0000 (19:25 +0000)]
Make sure that the DAG combiner doesn't merge stores that we explicitly
asked not be greater than preferred vector width for the vectorizer.
Test for both 128 and 256 with a skylake architecture.

llvm-svn: 360183

5 years agoDisable eh-frame-dwarf-unwind.test on windows
Pavel Labath [Tue, 7 May 2019 19:24:28 +0000 (19:24 +0000)]
Disable eh-frame-dwarf-unwind.test on windows

It fails on the windows bot. Disable until I can figure out what's the
reason.

llvm-svn: 360182

5 years ago[compiler-rt] Create install targets for Darwin libraries
Shoaib Meenai [Tue, 7 May 2019 19:00:37 +0000 (19:00 +0000)]
[compiler-rt] Create install targets for Darwin libraries

Darwin targets were generating CMake install rules but not the
corresponding install targets. Centralize the existing install target
creation to a function and use that function for both Darwin and
non-Darwin builds.

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

llvm-svn: 360181

5 years ago[InstCombine] allow sinking fneg operands through an FP min/max
Sanjay Patel [Tue, 7 May 2019 18:58:07 +0000 (18:58 +0000)]
[InstCombine] allow sinking fneg operands through an FP min/max

Fundamentally/generally, we should not have to rely on bailouts/crippling of
folds. In this particular case, I think we always recognize the inverted
predicate min/max pattern, so there should not be any loss of optimization.
Codegen looks better because we are eliminating an fneg.

llvm-svn: 360180

5 years ago[CommandLine] Allow Options to specify multiple OptionCategory's.
Don Hinton [Tue, 7 May 2019 18:57:01 +0000 (18:57 +0000)]
[CommandLine] Allow Options to specify multiple OptionCategory's.

Summary:
It's not uncommon for separate components to share common
Options, e.g., it's common for related Passes to share Options in
addition to the Pass specific ones.

With this change, components can use OptionCategory's to simply help
output even if some of the options are shared.

Reviewed By: MaskRay

Tags: #llvm

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

llvm-svn: 360179

5 years ago[Host] Clean up dependencies of HostMacOSXObjCXX
Alex Langford [Tue, 7 May 2019 18:08:06 +0000 (18:08 +0000)]
[Host] Clean up dependencies of HostMacOSXObjCXX

llvm-svn: 360178

5 years ago[Tests] Yet more combination of tests for unordered.atomic memset
Philip Reames [Tue, 7 May 2019 17:45:52 +0000 (17:45 +0000)]
[Tests] Yet more combination of tests for unordered.atomic memset

llvm-svn: 360177

5 years agoDebug Info: Support address space attributes on rvalue references.
Adrian Prantl [Tue, 7 May 2019 17:42:38 +0000 (17:42 +0000)]
Debug Info: Support address space attributes on rvalue references.

DWARF5, 2.12 20ff says that

Any debugging information entry representing a pointer or reference
type [may have a DW_AT_address_class attribute].

The existing code (https://reviews.llvm.org/D29670) seems to take a
quite literal interpretation of that wording. I don't see a reason why
an rvalue reference isn't a reference type in the spirit of that
paragraph. This patch allows rvalue references to also have address
spaces.

rdar://problem/50511483

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

llvm-svn: 360176

5 years ago[PowerPC][NFC] Update build-vector-tests.ll using utils/update_llc_test_checks.py
Jinsong Ji [Tue, 7 May 2019 17:29:44 +0000 (17:29 +0000)]
[PowerPC][NFC] Update build-vector-tests.ll using utils/update_llc_test_checks.py

build-vector-tests.ll is a huge testcase, it is hard to maintain: eg:
any fundamental changes might need to update hundreds of lines. We should
leverage the script to maintain it.

This patch simply run utils/update_llc_test_checks.py on it. There
should be no missing test points.

llvm-svn: 360175

5 years agoGuard __builtin_available() with __has_builtin to support older host compilers.
Adrian Prantl [Tue, 7 May 2019 17:10:27 +0000 (17:10 +0000)]
Guard __builtin_available() with __has_builtin to support older host compilers.

llvm-svn: 360174

5 years agoRegenerate test to try and fix buildbots
Simon Pilgrim [Tue, 7 May 2019 17:10:10 +0000 (17:10 +0000)]
Regenerate test to try and fix buildbots

llvm-svn: 360173

5 years ago[Driver] Add command line option to allow loading local lldbinit file.
Jonas Devlieghere [Tue, 7 May 2019 16:57:17 +0000 (16:57 +0000)]
[Driver] Add command line option to allow loading local lldbinit file.

This patch adds a command line flag that allows lldb to load local
lldbinit files.

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

llvm-svn: 360172

5 years ago[DAGCombiner] Avoid creating large tokenfactors in visitTokenFactor
Florian Hahn [Tue, 7 May 2019 16:47:27 +0000 (16:47 +0000)]
[DAGCombiner] Avoid creating large tokenfactors in visitTokenFactor

When simplifying TokenFactors, we potentially iterate over all
operands of a large number of TokenFactors. This causes quadratic
compile times in some cases and the large token factors cause additional
scalability problems elsewhere.

This patch adds some limits to the number of nodes explored for the
cases mentioned above.

Reviewers: niravd, spatel, craig.topper

Reviewed By: niravd

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

llvm-svn: 360171

5 years ago[InstCombine] add tests for FP min/max with negated operands; NFC
Sanjay Patel [Tue, 7 May 2019 16:25:43 +0000 (16:25 +0000)]
[InstCombine] add tests for FP min/max with negated operands; NFC

llvm-svn: 360170

5 years agoFixup r360161
Pavel Labath [Tue, 7 May 2019 16:13:10 +0000 (16:13 +0000)]
Fixup r360161

Remove SymbolVendorMacOSX from the test, as this plugin is not available
on non-mac platforms, and it does not seem to be necessary anyway.

Declare inlined-functions.yaml as an input of the test in cmake.

llvm-svn: 360169

5 years agoMake eh-frame-dwarf-unwind.test run on non-linux platforms
Pavel Labath [Tue, 7 May 2019 16:13:05 +0000 (16:13 +0000)]
Make eh-frame-dwarf-unwind.test run on non-linux platforms

This was meant to be a part of r360158, but I forgot to squash the
commits before pushing.

llvm-svn: 360168

5 years agoMark private function __sign as constexpr.
Marshall Clow [Tue, 7 May 2019 16:07:24 +0000 (16:07 +0000)]
Mark private function __sign as constexpr.

llvm-svn: 360167

5 years agoPostfixExpression: Use signed integers in IntegerNode
Pavel Labath [Tue, 7 May 2019 15:58:20 +0000 (15:58 +0000)]
PostfixExpression: Use signed integers in IntegerNode

Summary:
This is necessary to support parsing expressions like ".cfa -16 + ^", as
that format is used in breakpad STACK CFI expressions.

Since the PDB expressions use the same parser, this change will affect
them too, but I don't believe that should be a problem in practice. If
PDBs do contain the negative values, it's very likely that they are
intended to be parsed the same way, and if they don't, then it doesn't
matter.

In case that we do ever need to handle this differently, we can always
make the parser behavior customizable, or just use a different parser.

To make sure that the integer size is big enough for everyone, I switch
from using a (unsigned) 32-bit integer to a 64-bit (signed) one.

Reviewers: amccarth, clayborg, aleksandr.urakov

Subscribers: markmentovai, lldb-commits

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

llvm-svn: 360166

5 years ago[WebAssembly] Don't generate unused table entries.
Sam Clegg [Tue, 7 May 2019 15:46:30 +0000 (15:46 +0000)]
[WebAssembly] Don't generate unused table entries.

When generating PIC output only relocations of type
R_WASM_TABLE_INDEX_REL_SLEB should generate table entries.

R_WASM_TABLE_INDEX_I32 get resolved at runtime via the auto-generated
__wasm_apply_relocs functions.

R_WASM_TABLE_INDEX_SLEB are not allowed in PIC code.

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

llvm-svn: 360165

5 years agoAvoid use-after-move warnings by using swap instead. NFCI.
Simon Pilgrim [Tue, 7 May 2019 15:45:00 +0000 (15:45 +0000)]
Avoid use-after-move warnings by using swap instead. NFCI.

Swap should be as quick in these cases, and leaves the original variables in a known (empty) state.

llvm-svn: 360164

5 years ago[scudo][standalone] Introduce the Quarantine
Kostya Kortchinsky [Tue, 7 May 2019 15:40:09 +0000 (15:40 +0000)]
[scudo][standalone] Introduce the Quarantine

Summary:
The Quarantine is used to hold chunks for a little while prior to
actually releasing them for potential reuse. The code is pretty much
the same as the sanitizer_common one, with additional shuffling of
the quarantine batches to decrease predictability of allocation
patterns when it is enabled.

Reviewers: vitalybuka, eugenis, hctim, morehouse

Reviewed By: morehouse

Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 360163

5 years ago[DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop...
Orlando Cazalet-Hyams [Tue, 7 May 2019 15:37:38 +0000 (15:37 +0000)]
[DebugInfo@O2][LoopVectorize] pr39024: Vectorized code linenos step through loop even after completion

Summary:
Bug: https://bugs.llvm.org/show_bug.cgi?id=39024

The bug reports that a vectorized loop is stepped through 4 times and each step through the loop seemed to show a different path. I found two problems here:

A) An incorrect line number on a preheader block (for.body.preheader) instruction causes a step into the loop before it begins.
B) Instructions in the middle block have different line numbers which give the impression of another iteration.

In this patch I give all of the middle block instructions the line number of the scalar loop latch terminator branch. This seems to provide the smoothest debugging experience because the vectorized loops will always end on this line before dropping into the scalar loop. To solve problem A I have altered llvm::SplitBlockPredecessors to accommodate loop header blocks.

Reviewers: samsonov, vsk, aprantl, probinson, anemet, hfinkel

Reviewed By: hfinkel

Subscribers: bjope, jmellorcrummey, hfinkel, gbedwell, hiraditya, zzheng, llvm-commits

Tags: #llvm, #debug-info

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

llvm-svn: 360162

5 years agoAdded missing files from 360071.
Greg Clayton [Tue, 7 May 2019 15:37:28 +0000 (15:37 +0000)]
Added missing files from 360071.

llvm-svn: 360161

5 years ago[JITLink] Fix some copy/paste related typos in a test case.
Lang Hames [Tue, 7 May 2019 15:35:43 +0000 (15:35 +0000)]
[JITLink] Fix some copy/paste related typos in a test case.

Several X86_64_RELOC_SUBTRACTOR tests for subtrahend handling were incorrectly
labeled as tests for kinds of minuend handling.

llvm-svn: 360160