platform/upstream/llvm.git
4 years ago[llvm-profdata] Reinstate tools/llvm-profdata/malformed-ptr-to-counter-array.test
Vedant Kumar [Tue, 15 Oct 2019 17:53:48 +0000 (17:53 +0000)]
[llvm-profdata] Reinstate tools/llvm-profdata/malformed-ptr-to-counter-array.test

I removed this test to unblock the ARM bots while looking into failures
(r374915), and am reinstating it now with a fix.

I believe the problem was that counter ptr address I used,
'\0\0\6\0\1\0\0\1', set the high bits of the pointer, not the low bits
like I wanted. On x86_64 this superficially looks like it tests r370826,
but it doesn't, as it would have been caught before r370826. However, on
ARM (or, 32-bit hosts more generally), I suspect the high bits were
cleared, and you get a 'valid' profile.

I verified that setting the *low* bits of the pointer does trigger the
new condition:

-// Note: The CounterPtr here is off-by-one. This should trigger a malformed profile error.
-RUN: printf '\0\0\6\0\1\0\0\1' >> %t.profraw
+// Note: The CounterPtr here is off-by-one.
+//
+// Octal '\11' is 9 in decimal: this should push CounterOffset to 1. As there are two counters,
+// the profile reader should error out.
+RUN: printf '\11\0\6\0\1\0\0\0' >> %t.profraw

This reverts commit c7cf5b3e4b918c9769fd760f28485b8d943ed968.

llvm-svn: 374927

4 years agoReland [Driver] Fix -working-directory issues
Jan Korous [Tue, 15 Oct 2019 17:51:59 +0000 (17:51 +0000)]
Reland [Driver] Fix -working-directory issues

Don't change the default VFS in Driver, update tests & reland.

This reverts commit 999f8a7416f8edc54ef92e715fd23c532bcc74d4.

llvm-svn: 374926

4 years ago[libc] Do not add unittests if LLVM_INCLUDE_TESTS is OFF.
Siva Chandra [Tue, 15 Oct 2019 17:42:28 +0000 (17:42 +0000)]
[libc] Do not add unittests if LLVM_INCLUDE_TESTS is OFF.

Reviewers: nathanchance

Subscribers: mgorny, tschuett, libc-commits

Tags: #libc-project

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

llvm-svn: 374925

4 years agoremove FILE* usage from SBStream.i
Lawrence D'Anna [Tue, 15 Oct 2019 17:41:40 +0000 (17:41 +0000)]
remove FILE* usage from SBStream.i

Summary:
This patch removes FILE* and replaces it with SBFile and FileSP the
SWIG interface for `SBStream.i`.   And this is the last one.   With
this change, nothing in the python API will can access a FILE* method
on the C++ side.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374924

4 years ago[XCOFF] Output object text section header and symbol entry for program code.
Digger Lin [Tue, 15 Oct 2019 17:40:41 +0000 (17:40 +0000)]
[XCOFF] Output object text section header and symbol entry for program code.

This is remaining part of  rG41ca91f2995b: [AIX][XCOFF] Output XCOFF
object text section header and symbol entry for rogram code.

SUMMARY:
Original form of this patch is provided by Stefan Pintillie.

1. The patch try to output program code section header , symbol entry for
 program code (PR) and Instruction into the raw text section.
2. The patch include how to alignment and layout the CSection in the text
 section.
3. The patch also reorganize the code , put some codes into a function.
 (XCOFFObjectWriter::writeSymbolTableEntryForControlSection)

Additional: We can not add raw data of text section test in the patch, If want
 to output raw text section data,it need a function description patch first.

Reviewers: hubert.reinterpretcast, sfertile, jasonliu, xingxue.
Subscribers: wuzish, nemanjai, hiraditya, MaskRay, jsjji.

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

llvm-svn: 374923

4 years ago[X86] Make memcmp() use PTEST if possible and also enable AVX1
David Zarzycki [Tue, 15 Oct 2019 17:40:12 +0000 (17:40 +0000)]
[X86] Make memcmp() use PTEST if possible and also enable AVX1

llvm-svn: 374922

4 years agoAdd more information to JSON AST dumping of source locations.
Aaron Ballman [Tue, 15 Oct 2019 17:30:19 +0000 (17:30 +0000)]
Add more information to JSON AST dumping of source locations.

This adds information about the offset within the source file to the given source location as well as information about the include file a location is from. These pieces of information allow for more efficient post-processing of JSON AST dumps.

llvm-svn: 374921

4 years ago[NewGVN] Check that call has an access.
Alina Sbirlea [Tue, 15 Oct 2019 17:25:36 +0000 (17:25 +0000)]
[NewGVN] Check that call has an access.

Check that a call has an attached MemoryAccess before calling
getClobbering on the instruction.
If no access is attached, the instruction does not access memory.

Resolves PR43441.

llvm-svn: 374920

4 years ago[libomptarget][nfc] Make interface.h target independent
Jon Chesterfield [Tue, 15 Oct 2019 17:15:26 +0000 (17:15 +0000)]
[libomptarget][nfc] Make interface.h target independent

Summary:
[libomptarget][nfc] Make interface.h target independent

Move interface.h under a top level include directory.
Remove #includes to avoid the interface depending on the implementation.

Reviewers: ABataev, jdoerfert, grokos, ronlieb, RaviNarayanaswamy

Reviewed By: jdoerfert

Subscribers: mgorny, openmp-commits

Tags: #openmp

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

llvm-svn: 374919

4 years ago[MemorySSA] Update DomTree before applying MSSA updates.
Alina Sbirlea [Tue, 15 Oct 2019 17:15:19 +0000 (17:15 +0000)]
[MemorySSA] Update DomTree before applying MSSA updates.

Update on the fix in rL374850.

llvm-svn: 374918

4 years ago[VirtualFileSystem] Support virtual working directory in the RedirectingFS
Jonas Devlieghere [Tue, 15 Oct 2019 17:14:24 +0000 (17:14 +0000)]
[VirtualFileSystem] Support virtual working directory in the  RedirectingFS

Before this patch, changing the working directory of the RedirectingFS
would just forward to its external file system. This prevented us from
having a working directory that only existed in the VFS mapping.

This patch adds support for a virtual working directory in the
RedirectingFileSystem. It now keeps track of its own WD in addition to
updating the WD of the external file system. This ensures that we can
still fall through for relative paths.

This change was originally motivated by the reproducer infrastructure in
LLDB where we want to deal transparently with relative paths.

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

llvm-svn: 374917

4 years agoeliminate virtual methods from PythonDataObjects
Lawrence D'Anna [Tue, 15 Oct 2019 17:12:49 +0000 (17:12 +0000)]
eliminate virtual methods from PythonDataObjects

Summary:
This patch eliminates a bunch of boilerplate from
PythonDataObjects, as well as the use of virtual methods.
In my opinion it also makes the Reset logic a lot more
clear and easy to follow.   The price is yet another
template.   I think it's worth it.

Reviewers: JDevlieghere, jasonmolenda, labath, zturner

Reviewed By: JDevlieghere, labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374916

4 years ago[llvm-profdata] Remove tools/llvm-profdata/malformed-ptr-to-counter-array.test
Vedant Kumar [Tue, 15 Oct 2019 17:10:44 +0000 (17:10 +0000)]
[llvm-profdata] Remove tools/llvm-profdata/malformed-ptr-to-counter-array.test

This test is still failing on the ARM bots and I need time to
investigate.

llvm-svn: 374915

4 years ago[AIX][XCOFF] Output XCOFF object text section header and symbol entry for program...
Digger Lin [Tue, 15 Oct 2019 17:09:54 +0000 (17:09 +0000)]
[AIX][XCOFF] Output XCOFF object text section header and symbol entry for program code.

SUMMARY
Original form of this patch is provided by Stefan Pintillie.

The patch try to output program code section header , symbol entry for program code (PR) and Instruction into the raw text section.
The patch include how to alignment and layout the CSection in the text section.
The patch also reorganize the code , put some codes into a function(XCOFFObjectWriter::writeSymbolTableEntryForControlSection)
Additional: We can not add raw data of text section test in the patch, If want to output raw text section data,it need a function description patch first.

Reviewers: hubert.reinterpretcast, sfertile, jasonliu, xingxue.
Subscribers: wuzish, nemanjai, hiraditya, MaskRay, jsjji.

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

llvm-svn: 374914

4 years ago[lld][WebAssembly] Fix static linking of -fPIC code with external undefined data
James Clarke [Tue, 15 Oct 2019 17:05:42 +0000 (17:05 +0000)]
[lld][WebAssembly] Fix static linking of -fPIC code with external undefined data

Reviewers: ruiu, sbc100

Reviewed By: sbc100

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 374913

4 years agoconvert SBDebugger::***FileHandle() wrappers to native files.
Lawrence D'Anna [Tue, 15 Oct 2019 16:59:20 +0000 (16:59 +0000)]
convert SBDebugger::***FileHandle() wrappers to native files.

Summary:
This patch converts the swig wrappers for SetInputFileHandle() and friends
to emulate the old behavior using SetInputFile().

This will clear the way for deleting the FILE* typemaps altogether.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: mehdi_amini, dexonsmith, lldb-commits

Tags: #lldb

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

llvm-svn: 374912

4 years agoSBFile::GetFile: convert SBFile back into python native files.
Lawrence D'Anna [Tue, 15 Oct 2019 16:46:27 +0000 (16:46 +0000)]
SBFile::GetFile: convert SBFile back into python native files.

Summary:
This makes SBFile::GetFile public and adds a SWIG typemap to convert
the result back into a python native file.

If the underlying File itself came from a python file, it is returned
identically.   Otherwise a new python file object is created using
the file descriptor.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374911

4 years ago[AMDGPU] Support mov dpp with 64 bit operands
Stanislav Mekhanoshin [Tue, 15 Oct 2019 16:41:15 +0000 (16:41 +0000)]
[AMDGPU] Support mov dpp with 64 bit operands

We define mov/update dpp intrinsics as overloaded but do not
support i64, which is a practically useful type. Fix the
selection and lowering.

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

llvm-svn: 374910

4 years agoCFI: wrong type passed to llvm.type.test with multiple inheritance devirtualization.
Dmitry Mikulin [Tue, 15 Oct 2019 16:32:50 +0000 (16:32 +0000)]
CFI: wrong type passed to llvm.type.test with multiple inheritance devirtualization.

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

llvm-svn: 374909

4 years ago[AMDGPU] Allow DPP combiner to work with REG_SEQUENCE
Stanislav Mekhanoshin [Tue, 15 Oct 2019 16:17:50 +0000 (16:17 +0000)]
[AMDGPU] Allow DPP combiner to work with REG_SEQUENCE

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

llvm-svn: 374908

4 years ago[Concepts] Remove unused and illegal Sema includes from ExprCXX.cpp
Saar Raz [Tue, 15 Oct 2019 15:49:29 +0000 (15:49 +0000)]
[Concepts] Remove unused and illegal Sema includes from ExprCXX.cpp

Fixing accidental includes introduced in 374903

llvm-svn: 374907

4 years agoIncrease gdbremote_testcase timeouts when running under ASAN.
Adrian Prantl [Tue, 15 Oct 2019 15:46:17 +0000 (15:46 +0000)]
Increase gdbremote_testcase timeouts when running under ASAN.

llvm-svn: 374906

4 years agoSkip PExpect tests under ASAN, I can't get them to work reliably.
Adrian Prantl [Tue, 15 Oct 2019 15:38:49 +0000 (15:38 +0000)]
Skip PExpect tests under ASAN, I can't get them to work reliably.

llvm-svn: 374905

4 years agogn build: Merge r374903
GN Sync Bot [Tue, 15 Oct 2019 15:33:04 +0000 (15:33 +0000)]
gn build: Merge r374903

llvm-svn: 374904

4 years ago[Concepts] Concept Specialization Expressions
Saar Raz [Tue, 15 Oct 2019 15:24:26 +0000 (15:24 +0000)]
[Concepts] Concept Specialization Expressions

Part of C++20 Concepts implementation effort. Added Concept Specialization Expressions that are created when a concept is refe$

D41217 on Phabricator.

(recommit after fixing failing Parser test on windows)

llvm-svn: 374903

4 years ago[DAGCombiner] fold select-of-constants based on sign-bit test
Sanjay Patel [Tue, 15 Oct 2019 15:23:57 +0000 (15:23 +0000)]
[DAGCombiner] fold select-of-constants based on sign-bit test

Examples:
  i32 X > -1 ? C1 : -1 --> (X >>s 31) | C1
  i8 X < 0 ? C1 : 0 --> (X >>s 7) & C1

This is a small generalization of a fold requested in PR43650:
https://bugs.llvm.org/show_bug.cgi?id=43650

The sign-bit of the condition operand can be used as a mask for the true operand:
https://rise4fun.com/Alive/paT

Note that we already handle some of the patterns (isNegative + scalar) because
there's an over-specialized, yet over-reaching fold for that in foldSelectCCToShiftAnd().
It doesn't use any TLI hooks, so I can't easily rip out that code even though we're
duplicating part of it here. This fold is guarded by TLI.convertSelectOfConstantsToMath(),
so it should not cause problems for targets that prefer select over shift.

Also worth noting: I thought we could generalize this further to include the case where
the true operand of the select is not constant, but Alive says that may allow poison to
pass through where it does not in the original select form of the code.

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

llvm-svn: 374902

4 years ago[clangd][NFC] Update comments to use triple-slashes
Kadir Cetinkaya [Tue, 15 Oct 2019 14:59:08 +0000 (14:59 +0000)]
[clangd][NFC] Update comments to use triple-slashes

llvm-svn: 374901

4 years agogn build: Merge r374899
GN Sync Bot [Tue, 15 Oct 2019 14:53:40 +0000 (14:53 +0000)]
gn build: Merge r374899

llvm-svn: 374900

4 years agoRevert 374882 "[Concepts] Concept Specialization Expressions"
Nico Weber [Tue, 15 Oct 2019 14:46:39 +0000 (14:46 +0000)]
Revert 374882 "[Concepts] Concept Specialization Expressions"

This reverts commit ec87b003823d63f3342cf648f55a134c1522e612.
The test fails on Windows, see e.g.
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/11533/steps/stage%201%20check/logs/stdio

Also revert follow-up r374893.

llvm-svn: 374899

4 years agorevert git test commit
Digger Lin [Tue, 15 Oct 2019 14:44:06 +0000 (14:44 +0000)]
revert git test commit

llvm-svn: 374898

4 years agoa test commit access
Digger Lin [Tue, 15 Oct 2019 14:39:29 +0000 (14:39 +0000)]
a test commit access

llvm-svn: 374897

4 years agoReapply: [Modules][PCH] Hash input files content
Bruno Cardoso Lopes [Tue, 15 Oct 2019 14:23:55 +0000 (14:23 +0000)]
Reapply: [Modules][PCH] Hash input files content

Summary:
When files often get touched during builds, the mtime based validation
leads to different problems in implicit modules builds, even when the
content doesn't actually change:

- Modules only: module invalidation due to out of date files. Usually causing rebuild traffic.
- Modules + PCH: build failures because clang cannot rebuild a module if it comes from building a PCH.
- PCH: build failures because clang cannot rebuild a PCH in case one of the input headers has different mtime.

This patch proposes hashing the content of input files (headers and
module maps), which is performed during serialization time. When looking
at input files for validation, clang only computes the hash in case
there's a mtime mismatch.

I've tested a couple of different hash algorithms availble in LLVM in
face of building modules+pch for `#import <Cocoa/Cocoa.h>`:
- `hash_code`: performace diff within the noise, total module cache increased by 0.07%.
- `SHA1`: 5% slowdown. Haven't done real size measurements, but it'd be BLOCK_ID+20 bytes per input file, instead of BLOCK_ID+8 bytes from `hash_code`.
- `MD5`: 3% slowdown. Like above, but BLOCK_ID+16 bytes per input file.

Given the numbers above, the patch uses `hash_code`. The patch also
improves invalidation error msgs to point out which type of problem the
user is facing: "mtime", "size" or "content".

rdar://problem/29320105

Reviewers: dexonsmith, arphaman, rsmith, aprantl

Subscribers: jkorous, cfe-commits, ributzka

Tags: #clang

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

> llvm-svn: 374841

llvm-svn: 374895

4 years ago[AsmPrinter] Fix unused variable warning in Release builds. NFC.
Benjamin Kramer [Tue, 15 Oct 2019 14:23:11 +0000 (14:23 +0000)]
[AsmPrinter] Fix unused variable warning in Release builds. NFC.

llvm-svn: 374894

4 years ago[AST] Remove unused Sema includes to fix a cyclic dependency from Sema to AST
Benjamin Kramer [Tue, 15 Oct 2019 14:23:05 +0000 (14:23 +0000)]
[AST] Remove unused Sema includes to fix a cyclic dependency from Sema to AST

llvm-svn: 374893

4 years ago[clangd] Propagate main context into ClangdServer
Kadir Cetinkaya [Tue, 15 Oct 2019 14:20:52 +0000 (14:20 +0000)]
[clangd] Propagate main context into ClangdServer

Summary:
Currently clangd initializes the ClangdServer lazily during
onInitialize request, and it results in propagation of caller's context rather
than the main context created ClangdLSPServer.

This patch changes the logic to store main context that created ClangdLSPServer
and pass it onto to ClangdServer and other objects like CDBs.

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

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

llvm-svn: 374892

4 years ago[lld] Check for branch range overflows.
Sid Manning [Tue, 15 Oct 2019 14:12:54 +0000 (14:12 +0000)]
[lld] Check for branch range overflows.

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

llvm-svn: 374891

4 years ago[Alignment][NFC] Value::getPointerAlignment returns MaybeAlign
Guillaume Chatelet [Tue, 15 Oct 2019 13:58:22 +0000 (13:58 +0000)]
[Alignment][NFC] Value::getPointerAlignment returns MaybeAlign

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 374889

4 years ago[Windows][NFC] Fix tests after r374528.
Aleksandr Urakov [Tue, 15 Oct 2019 13:52:27 +0000 (13:52 +0000)]
[Windows][NFC] Fix tests after r374528.

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

llvm-svn: 374888

4 years ago[ARM][MVE] validForTailPredication insts
Sam Parker [Tue, 15 Oct 2019 13:12:51 +0000 (13:12 +0000)]
[ARM][MVE] validForTailPredication insts

Reverse the logic for valid tail predication instructions and create
a whitelist instead. Added other instruction groups that aren't
obviously safe:
- instructions that 'narrow' their result.
- lane moves.
- byte swapping instructions.
- interleaving loads and stores.
- cross-beat carries.
- top/bottom instructions.
- complex operations.

Hopefully we should be able to add more of these instructions to the
whitelist, once we have a more concrete idea of the transform.

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

llvm-svn: 374887

4 years ago[InstCombine] fold a shifted bool zext to a select (2nd try)
Sanjay Patel [Tue, 15 Oct 2019 13:12:44 +0000 (13:12 +0000)]
[InstCombine] fold a shifted bool zext to a select (2nd try)

The 1st attempt at rL374828 inserted the code
at the wrong position (outside of the constant-shift-amount
block). Trying again with an additional test to verify
const-ness.

For a constant shift amount, add the following fold.
shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0)

https://rise4fun.com/Alive/IZ9

Fixes PR42257.

Based on original patch by @zvi (Zvi Rackover)

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

llvm-svn: 374886

4 years ago[clang-tools-extra] Fix overzealous linking of dylib to clangTidy
Michal Gorny [Tue, 15 Oct 2019 13:05:38 +0000 (13:05 +0000)]
[clang-tools-extra] Fix overzealous linking of dylib to clangTidy

Fix accidentally making clangTidy library link to dylib.  This causes
libclang.so to also link to dylib which results in duplicate symbols
from shared and static libraries, and effectively to registering
command-line options twice.

Thanks to Sylvestre Ledru for noticing this and tracking it down
to r373786.  Fixes PR#43589.

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

llvm-svn: 374885

4 years ago[Alignment] Migrate Attribute::getWith(Stack)Alignment
Guillaume Chatelet [Tue, 15 Oct 2019 12:56:24 +0000 (12:56 +0000)]
[Alignment] Migrate Attribute::getWith(Stack)Alignment

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet, jdoerfert

Reviewed By: courbet

Subscribers: arsenm, jvesely, nhaehnle, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 374884

4 years agogn build: Merge r374882
GN Sync Bot [Tue, 15 Oct 2019 11:55:38 +0000 (11:55 +0000)]
gn build: Merge r374882

llvm-svn: 374883

4 years ago[Concepts] Concept Specialization Expressions
Saar Raz [Tue, 15 Oct 2019 11:48:58 +0000 (11:48 +0000)]
[Concepts] Concept Specialization Expressions

Part of C++20 Concepts implementation effort. Added Concept Specialization Expressions that are created when a concept is referenced with arguments, and tests thereof.

llvm-svn: 374882

4 years ago[DebugInfo] Add a DW_OP_LLVM_entry_value operation
David Stenberg [Tue, 15 Oct 2019 11:31:21 +0000 (11:31 +0000)]
[DebugInfo] Add a DW_OP_LLVM_entry_value operation

Summary:
Internally in LLVM's metadata we use DW_OP_entry_value operations with
the same semantics as DWARF; that is, its operand specifies the number
of bytes that the entry value covers.

At the time of emitting entry values we don't know the emitted size of
the DWARF expression that the entry value will cover. Currently the size
is hardcoded to 1 in DIExpression, and other values causes the verifier
to fail. As the size is 1, that effectively means that we can only have
valid entry values for registers that can be encoded in one byte, which
are the registers with DWARF numbers 0 to 31 (as they can be encoded as
single-byte DW_OP_reg0..DW_OP_reg31 rather than a multi-byte
DW_OP_regx). It is a bit confusing, but it seems like llvm-dwarfdump
will print an operation "correctly", even if the byte size is less than
that, which may make it seem that we emit correct DWARF for registers
with DWARF numbers > 31. If you instead use readelf for such cases, it
will interpret the number of specified bytes as a DWARF expression. This
seems like a limitation in llvm-dwarfdump.

As suggested in D66746, a way forward would be to add an internal
variant of DW_OP_entry_value, DW_OP_LLVM_entry_value, whose operand
instead specifies the number of operations that the entry value covers,
and we then translate that into the byte size at the time of emission.

In this patch that internal operation is added. This patch keeps the
limitation that a entry value can only be applied to simple register
locations, but it will fix the issue with the size operand being
incorrect for DWARF numbers > 31.

Reviewers: aprantl, vsk, djtodoro, NikolaPrica

Reviewed By: aprantl

Subscribers: jyknight, fedor.sergeev, hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

llvm-svn: 374881

4 years ago[Alignment][NFC] Remove dependency on GlobalObject::setAlignment(unsigned)
Guillaume Chatelet [Tue, 15 Oct 2019 11:24:36 +0000 (11:24 +0000)]
[Alignment][NFC] Remove dependency on GlobalObject::setAlignment(unsigned)

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: arsenm, mehdi_amini, jvesely, nhaehnle, hiraditya, steven_wu, dexonsmith, dang, llvm-commits

Tags: #llvm

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

llvm-svn: 374880

4 years ago[DebugInfo] Add interface for pre-calculating the size of emitted DWARF
David Stenberg [Tue, 15 Oct 2019 11:14:35 +0000 (11:14 +0000)]
[DebugInfo] Add interface for pre-calculating the size of emitted DWARF

Summary:
DWARF's DW_OP_entry_value operation has two operands; the first is a
ULEB128 operand that specifies the size of the second operand, which is
a DWARF block. This means that we need to be able to pre-calculate and
emit the size of DWARF expressions before emitting them. There is
currently no interface for doing this in DwarfExpression, so this patch
introduces that.

When implementing this I initially thought about running through
DwarfExpression's emission two times; first with a temporary buffer to
emit the expression, in order to being able to calculate the size of
that emitted data. However, DwarfExpression is a quite complex state
machine, so I decided against that, as it seemed like the two runs could
get out of sync, resulting in incorrect size operands. Therefore I have
implemented this in a way that we only have to run DwarfExpression once.
The idea is to emit DWARF to a temporary buffer, for which it is
possible to query the size. The data in the temporary buffer can then be
emitted to DwarfExpression's main output.

In the case of DIEDwarfExpression, a temporary DIE is used. The values
are all allocated using the same BumpPtrAllocator as for all other DIEs,
and the values are then transferred to the real value list. In the case
of DebugLocDwarfExpression, the temporary buffer is implemented using a
BufferByteStreamer which emits to a buffer in the DwarfExpression
object.

Reviewers: aprantl, vsk, NikolaPrica, djtodoro

Reviewed By: aprantl

Subscribers: hiraditya, llvm-commits

Tags: #debug-info, #llvm

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

llvm-svn: 374879

4 years ago[X86] Resolve KnownUndef/KnownZero bits into target shuffle masks in helper. NFCI.
Simon Pilgrim [Tue, 15 Oct 2019 11:13:51 +0000 (11:13 +0000)]
[X86] Resolve KnownUndef/KnownZero bits into target shuffle masks in helper. NFCI.

llvm-svn: 374878

4 years ago[DebugInfo] Remove some users of DBG_VALUEs IsIndirect field
Jeremy Morse [Tue, 15 Oct 2019 10:46:24 +0000 (10:46 +0000)]
[DebugInfo] Remove some users of DBG_VALUEs IsIndirect field

This patch kills off a significant user of the "IsIndirect" field of
DBG_VALUE machine insts. Brought up in in PR41675, IsIndirect is
techncally redundant as it can be expressed by the DIExpression of a
DBG_VALUE inst, and it isn't helpful to have two ways of expressing
things.

Rather than setting IsIndirect, have DBG_VALUE creators add an extra deref
to the insts DIExpression. There should now be no appearences of
IsIndirect=True from isel down to LiveDebugVariables / VirtRegRewriter,
which is ensured by an assertion in LDVImpl::handleDebugValue. This means
we also get to delete the IsIndirect handling in LiveDebugVariables. Tests
can be upgraded by for example swapping the following IsIndirect=True
DBG_VALUE:

  DBG_VALUE $somereg, 0, !123, !DIExpression(DW_OP_foo)

With one where the indirection is in the DIExpression, by _appending_
a deref:

  DBG_VALUE $somereg, $noreg, !123, !DIExpression(DW_OP_foo, DW_OP_deref)

Which both mean the same thing.

Most of the test changes in this patch are updates of that form; also some
changes in how the textual assembly printer handles these insts.

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

llvm-svn: 374877

4 years agoFix uninitialized variable warnings. NFCI.
Simon Pilgrim [Tue, 15 Oct 2019 10:23:05 +0000 (10:23 +0000)]
Fix uninitialized variable warnings. NFCI.

llvm-svn: 374876

4 years ago[llvm-locstats] Fix 'only params' no entry value stats
Djordje Todorovic [Tue, 15 Oct 2019 10:12:14 +0000 (10:12 +0000)]
[llvm-locstats] Fix 'only params' no entry value stats

Adding the missing line.

llvm-svn: 374875

4 years ago[LLD] [COFF] Update a leftover comment after SVN r374869. NFC.
Martin Storsjo [Tue, 15 Oct 2019 09:46:33 +0000 (09:46 +0000)]
[LLD] [COFF] Update a leftover comment after SVN r374869. NFC.

llvm-svn: 374874

4 years ago[LLD] [COFF] Fix -Wmissing-field-initializers warnings. NFC.
Martin Storsjo [Tue, 15 Oct 2019 09:33:14 +0000 (09:33 +0000)]
[LLD] [COFF] Fix -Wmissing-field-initializers warnings. NFC.

llvm-svn: 374873

4 years ago[MIPS GlobalISel] Add MSA registers to fprb. Select vector load, store
Petar Avramovic [Tue, 15 Oct 2019 09:30:08 +0000 (09:30 +0000)]
[MIPS GlobalISel] Add MSA registers to fprb. Select vector load, store

Add vector MSA register classes to fprb, they are 128 bit wide.
MSA instructions use the same registers for both integer and floating
point operations. Therefore we only need to check for vector element
size during legalization or instruction selection.

Add helper function in MipsLegalizerInfo and switch to legalIf
LegalizeRuleSet to keep legalization rules compact since they depend
on MipsSubtarget and presence of MSA.
fprb is assigned to all vector operands.
Move selectLoadStoreOpCode to MipsInstructionSelector in order to
reduce number of arguments.

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

llvm-svn: 374872

4 years agoChange Comments SmallVector to std::vector in DebugLocStream [NFC]
David Stenberg [Tue, 15 Oct 2019 09:21:09 +0000 (09:21 +0000)]
Change Comments SmallVector to std::vector in DebugLocStream [NFC]

This changes the 32-element SmallVector to a std::vector. When building
a RelWithDebInfo clang-8 binary, the average size of the vector was
~10000, so it does not seem very beneficial or practical to use a small
vector for that.

The DWARFBytes SmallVector grows in the same way as Comments, so perhaps
that also should be changed to a purely dynamically allocated structure,
but that requires some more code changes, so I let that remain as a
SmallVector for now.

llvm-svn: 374871

4 years ago[MIPS GlobalISel] Refactor MipsRegisterBankInfo [NFC]
Petar Avramovic [Tue, 15 Oct 2019 09:18:42 +0000 (09:18 +0000)]
[MIPS GlobalISel] Refactor MipsRegisterBankInfo [NFC]

Check if size of operand LLT matches sizes of available register banks
before inspecting the opcode in order to reduce number of checks.
Factor commonly used pieces of code into functions.

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

llvm-svn: 374870

4 years ago[LLD] [COFF] Wrap file location pair<StringRef,int> in Optional<>. NFC.
Martin Storsjo [Tue, 15 Oct 2019 09:18:18 +0000 (09:18 +0000)]
[LLD] [COFF] Wrap file location pair<StringRef,int> in Optional<>. NFC.

This makes use of it slightly clearer, and makes it match the
same construct in the lld ELF linker.

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

llvm-svn: 374869

4 years agotsan: fix Go ppc64le build
Dmitry Vyukov [Tue, 15 Oct 2019 08:38:58 +0000 (08:38 +0000)]
tsan: fix Go ppc64le build

This #define is in the non-Go ppc64le build but not in the Go build.

Reviewed-in: https://reviews.llvm.org/D68046
Author: randall77 (Keith Randall)
llvm-svn: 374868

4 years ago[LLDB]Ā [PECOFF] Use a "pc" vendor name in aarch64 triples
Martin Storsjo [Tue, 15 Oct 2019 08:32:46 +0000 (08:32 +0000)]
[LLDB]Ā [PECOFF] Use a "pc" vendor name in aarch64 triples

This matches all other architectures listed in the same file.

This fixes debugging aarch64 executables with lldb-server, which
otherwise fails, with log messages like these:

Target::SetArchitecture changing architecture to aarch64 (aarch64-pc-windows-msvc)
Target::SetArchitecture Trying to select executable file architecture aarch64 (aarch64-pc-windows-msvc)

ArchSpec::SetArchitecture sets the vendor to llvm::Triple::PC
for any coff/win32 combination, and if this doesn't match the triple
set by the PECOFF module, things doesn't seem to work with when
using lldb-server.

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

llvm-svn: 374867

4 years ago[LLDB] [Windows] Initial support for ARM64 register contexts
Martin Storsjo [Tue, 15 Oct 2019 08:31:52 +0000 (08:31 +0000)]
[LLDB] [Windows] Initial support for ARM64 register contexts

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

llvm-svn: 374866

4 years ago[Demangle] Add a few more options to the microsoft demangler
Martin Storsjo [Tue, 15 Oct 2019 08:29:56 +0000 (08:29 +0000)]
[Demangle] Add a few more options to the microsoft demangler

This corresponds to commonly used options to UnDecorateSymbolName
within llvm.

Add them as hidden options in llvm-undname. MS undname.exe takes
numeric flags, corresponding to the UNDNAME_* constants, but instead
of hardcoding in mappings for those numbers, just add textual
options instead, as it the use of them here is primarily intended
for testing.

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

llvm-svn: 374865

4 years ago[Format] Add machine-readable SPDX license ID to clang-format.el
Sam McCall [Tue, 15 Oct 2019 07:25:18 +0000 (07:25 +0000)]
[Format] Add machine-readable SPDX license ID to clang-format.el

llvm-svn: 374864

4 years agoFix TestDisassemble_VST1_64
Pavel Labath [Tue, 15 Oct 2019 07:20:01 +0000 (07:20 +0000)]
Fix TestDisassemble_VST1_64

- use a full triple instead of just the architecture (makes the test
  pass on non-apple hosts)
- skip the test if the ARM llvm target is not built

llvm-svn: 374863

4 years ago[X86] Don't check for VBROADCAST_LOAD being a user of the source of a VBROADCAST...
Craig Topper [Tue, 15 Oct 2019 06:10:11 +0000 (06:10 +0000)]
[X86] Don't check for VBROADCAST_LOAD being a user of the source of a VBROADCAST when trying to share broadcasts.

The only things VBROADCAST_LOAD uses is an address and a chain
node. It has no vector inputs.

So if its a user of the source of another broadcast that could
only mean one of two things. The other broadcast is broadcasting
the address of the broadcast_load. Or the source is a load and
the use we're seeing is the chain result from that load. Neither
of these cases make sense to combine here.

This issue was reported post-commit r373871. Test case has not
been reduced yet.

llvm-svn: 374862

4 years agoRevert [SROA] Reuse existing lifetime markers if possible
David L. Jones [Tue, 15 Oct 2019 04:32:07 +0000 (04:32 +0000)]
Revert [SROA] Reuse existing lifetime markers if possible

This reverts r374692 (git commit 92694eba933ef4ea0b1b6377809ff266df37d61b)

Reproducer sent to commit thread on llvm-commits.

llvm-svn: 374859

4 years ago[RISCV] Support fast calling convention
Shiva Chen [Tue, 15 Oct 2019 02:04:29 +0000 (02:04 +0000)]
[RISCV] Support fast calling convention

LLVM may annotate the function with fastcc if there has only one caller
and there're no other caller out of the module and the function is not
naked or contain variable arguments.

The fastcc functions could pass the arguments by the caller saved registers.

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

llvm-svn: 374857

4 years ago[WebAssembly] Trapping fptoint builtins and intrinsics
Thomas Lively [Tue, 15 Oct 2019 01:11:51 +0000 (01:11 +0000)]
[WebAssembly] Trapping fptoint builtins and intrinsics

Summary:
The WebAssembly backend lowers fptoint instructions to a code sequence
that checks for overflow to avoid traps because fptoint is supposed to
be speculatable. These new builtins and intrinsics give users a way to
depend on the trapping semantics of the underlying instructions and
avoid the extra code generated normally.

Patch by coffee and tlively.

Reviewers: aheejin

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

Tags: #clang, #llvm

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

llvm-svn: 374856

4 years ago[libc++][test] Use <version> to get config on MSVC
Casey Carter [Tue, 15 Oct 2019 00:22:38 +0000 (00:22 +0000)]
[libc++][test] Use <version> to get config on MSVC

...instead of `<ciso646>`.

Also includes some NFC comment changes.

llvm-svn: 374854

4 years ago[lldb-server/android] Show more processes by relaxing some checks
Walter Erquinigo [Tue, 15 Oct 2019 00:00:05 +0000 (00:00 +0000)]
[lldb-server/android] Show more processes by relaxing some checks

By default `platform process list` only shows the processes of the current user that lldb-server can parse.
There are several problems:
- apk programs don't have an executable file. They instead use a package name as identifier. We should show them instead.
- each apk also runs under a different user. That's how android works
- because of the user permission, some files like /proc/<pid>/{environ,exe} can't be read.

This results in a very small process list.

This is a local run on my machine
```
(lldb) platform process list
2 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
23291  3177              aarch64-unknown-linux-android sh
23301  23291            aarch64-unknown-linux-android lldb-server
```
However, I have 700 processes running at this time.

By implementing a few fallbacks for android, I've expanded this list to 202, filtering out kernel processes, which would presumably appear in this list if the device was rooted.

```
(lldb) platform process list
202 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
...
12647  3208              aarch64-unknown-linux-android sh
12649  12647             aarch64-unknown-linux-android lldb-server
12653  982                                        com.samsung.faceservice
13185  982                                        com.samsung.vvm
15899  982                                        com.samsung.android.spay
16220  982                                        com.sec.spp.push
17126  982                                        com.sec.spp.push:RemoteDlcProcess
19772  983                                        com.android.chrome
20209  982                                        com.samsung.cmh:CMH
20380  982                                        com.google.android.inputmethod.latin
20879  982                                        com.samsung.android.oneconnect:Receiver
21212  983                                        com.tencent.mm
24459  1                 aarch64-unknown-linux-android wpa_supplicant
25974  982                                        com.samsung.android.contacts
26293  982                                        com.samsung.android.messaging
28714  982                                        com.samsung.android.dialer
31605  982                                        com.samsung.android.MtpApplication
32256  982                                        com.bezobidny
```

Something to notice is that the architecture is unkonwn for all apks. And that's fine, because run-as would be required to gather this information and that would make this entire functionality massively slow.

There are still several improvements to make here, like displaying actual user names, which I'll try to do in a following diff.

Note: Regarding overall apk debugging support from lldb. I'm planning on having lldb spawn lldb-server by itself with the correct user, so that everything works well. The initial lldb-server used for connecting to the remote platform can be reused for such purpose. Furthermore, eventually lldb could also launch that initial lldb-server on its own.

Differential Revision: D68289

llvm-svn: 374853

4 years agoRevert "fix"
Walter Erquinigo [Mon, 14 Oct 2019 23:56:54 +0000 (23:56 +0000)]
Revert "fix"

This reverts commit d8af64c9a0228301f6fd0e1c841e4abe0b6f4801.

llvm-svn: 374852

4 years agoRevert [InstCombine] fold a shifted bool zext to a select
Sanjay Patel [Mon, 14 Oct 2019 23:55:39 +0000 (23:55 +0000)]
Revert [InstCombine] fold a shifted bool zext to a select

This reverts r374828 (git commit 1f40f15d54aac06421448b6de131231d2d78bc75) due to bot breakage

llvm-svn: 374851

4 years ago[MemorySSA] Update for partial unswitch.
Alina Sbirlea [Mon, 14 Oct 2019 23:52:39 +0000 (23:52 +0000)]
[MemorySSA] Update for partial unswitch.

Update MSSA for blocks cloned when doing partial unswitching.
Enable additional testing with MSSA.
Resolves PR43641.

llvm-svn: 374850

4 years ago[X86] Teach X86MCodeEmitter to properly encode zmm16-zmm31 as index register to vgath...
Craig Topper [Mon, 14 Oct 2019 23:48:24 +0000 (23:48 +0000)]
[X86] Teach X86MCodeEmitter to properly encode zmm16-zmm31 as index register to vgatherpf/vscatterpf.

We need to encode bit 4 into the EVEX.V' bit. We do this right
for regular gather/scatter which use either MRMSrcMem or MRMDestMem
formats.  The prefetches use MRM*m formats.

Fixes an issue recently added to PR36202.

llvm-svn: 374849

4 years ago[X86] Add encoding tests for avx512pf vgatherpf/vscatterpf instructions.
Craig Topper [Mon, 14 Oct 2019 23:48:12 +0000 (23:48 +0000)]
[X86] Add encoding tests for avx512pf vgatherpf/vscatterpf instructions.

llvm-svn: 374848

4 years ago[lit] Add argument check: --timeout must be non-negative integer
Julian Lettner [Mon, 14 Oct 2019 23:43:18 +0000 (23:43 +0000)]
[lit] Add argument check: --timeout must be non-negative integer

llvm-svn: 374847

4 years agofix
Walter Erquinigo [Mon, 14 Oct 2019 23:32:46 +0000 (23:32 +0000)]
fix

llvm-svn: 374846

4 years agoRevert "Dead Virtual Function Elimination"
Jorge Gorbe Moya [Mon, 14 Oct 2019 23:25:25 +0000 (23:25 +0000)]
Revert "Dead Virtual Function Elimination"

This reverts commit 9f6a873268e1ad9855873d9d8007086c0d01cf4f.

llvm-svn: 374844

4 years agoTemporarily Revert [Modules][PCH] Hash input files content
Eric Christopher [Mon, 14 Oct 2019 23:14:24 +0000 (23:14 +0000)]
Temporarily Revert [Modules][PCH] Hash input files content
as it's breaking a few bots.

This reverts r374841 (git commit 2a1386c81de504b5bda44fbecf3f7b4cdfd748fc)

llvm-svn: 374842

4 years ago[Modules][PCH] Hash input files content
Bruno Cardoso Lopes [Mon, 14 Oct 2019 23:02:03 +0000 (23:02 +0000)]
[Modules][PCH] Hash input files content

Summary:
When files often get touched during builds, the mtime based validation
leads to different problems in implicit modules builds, even when the
content doesn't actually change:

- Modules only: module invalidation due to out of date files. Usually causing rebuild traffic.
- Modules + PCH: build failures because clang cannot rebuild a module if it comes from building a PCH.
- PCH: build failures because clang cannot rebuild a PCH in case one of the input headers has different mtime.

This patch proposes hashing the content of input files (headers and
module maps), which is performed during serialization time. When looking
at input files for validation, clang only computes the hash in case
there's a mtime mismatch.

I've tested a couple of different hash algorithms availble in LLVM in
face of building modules+pch for `#import <Cocoa/Cocoa.h>`:
- `hash_code`: performace diff within the noise, total module cache increased by 0.07%.
- `SHA1`: 5% slowdown. Haven't done real size measurements, but it'd be BLOCK_ID+20 bytes per input file, instead of BLOCK_ID+8 bytes from `hash_code`.
- `MD5`: 3% slowdown. Like above, but BLOCK_ID+16 bytes per input file.

Given the numbers above, the patch uses `hash_code`. The patch also
improves invalidation error msgs to point out which type of problem the
user is facing: "mtime", "size" or "content".

rdar://problem/29320105

Reviewers: dexonsmith, arphaman, rsmith, aprantl

Subscribers: jkorous, cfe-commits, ributzka

Tags: #clang

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

llvm-svn: 374841

4 years agoAdd -fno-experimental-pass-manager to make clear which pass manager
Eric Christopher [Mon, 14 Oct 2019 23:01:48 +0000 (23:01 +0000)]
Add -fno-experimental-pass-manager to make clear which pass manager
we're running and to make flipping the default not regress testing.

llvm-svn: 374840

4 years agoIn the new pass manager use PTO.LoopUnrolling to determine when and how
Eric Christopher [Mon, 14 Oct 2019 22:56:07 +0000 (22:56 +0000)]
In the new pass manager use PTO.LoopUnrolling to determine when and how
we will unroll loops. Also comment a few occasions where we need to
know whether or not we're forcing the unwinder or not.

The default before and after this patch is for LoopUnroll to be enabled,
and for it to use a cost model to determine whether to unroll the loop
(`OnlyWhenForced = false`). Before this patch, disabling loop unroll
would not run the LoopUnroll pass. After this patch, the LoopUnroll pass
is being run, but it restricts unrolling to only the loops marked by a
pragma (`OnlyWhenForced = true`).

In addition, this patch disables the UnrollAndJam pass when disabling unrolling.

Testcase is in clang because it's controlling how the loop optimizer
is being set up and there's no other way to trigger the behavior.

llvm-svn: 374838

4 years ago[clang] add requirements to -Wa,-W test cases.
Jian Cai [Mon, 14 Oct 2019 22:51:12 +0000 (22:51 +0000)]
[clang] add requirements to -Wa,-W test cases.

Include linux as a test requirement.

llvm-svn: 374837

4 years ago[test] Fix test failure
Eli Friedman [Mon, 14 Oct 2019 22:44:42 +0000 (22:44 +0000)]
[test] Fix test failure

The version mismatch symbol is version 9 on 32 bit android. Since
this test isn't actually testing any android specific functionality,
we force the target triple to x86_64-unknown-unknown in order to have
a consistent version number. It seems the test was already trying to
do this, just not doing it right

Patch by Christopher Tetrault

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

llvm-svn: 374836

4 years ago[Tests] Add a SCEV analysis test for llvm.widenable.condition
Philip Reames [Mon, 14 Oct 2019 22:42:35 +0000 (22:42 +0000)]
[Tests] Add a SCEV analysis test for llvm.widenable.condition

Mostly because we don't appear to have one and a prototype patch I just saw would have broken the example committed.

llvm-svn: 374835

4 years agoAdd support to -Wa,-W in clang
Jian Cai [Mon, 14 Oct 2019 22:28:03 +0000 (22:28 +0000)]
Add support to -Wa,-W in clang

Summary:
Currently clang does not support -Wa,-W, which suppresses warning
messages in GNU assembler. Add this option for gcc compatibility.
https://bugs.llvm.org/show_bug.cgi?id=43651. Reland with differential
information.

Reviewers: bcain

Reviewed By: bcain

Subscribers: george.burgess.iv, gbiv, llozano, manojgupta, nickdesaulniers, cfe-commits

Tags: #clang

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

llvm-svn: 374834

4 years agoRevert "Add support to -Wa,-W in clang"
Jian Cai [Mon, 14 Oct 2019 22:28:01 +0000 (22:28 +0000)]
Revert "Add support to -Wa,-W in clang"

This reverts commit e72eeca43b9577be2aae55f7603febbf223a6ab3.

llvm-svn: 374833

4 years ago[ARM][AsmParser] handles offset expression in parentheses
Jian Cai [Mon, 14 Oct 2019 22:22:26 +0000 (22:22 +0000)]
[ARM][AsmParser] handles offset expression in parentheses

Summary:
Integrated assembler does not accept offset expressions surrounded by
parenthesis. Handle this case for GAS compability.
https://bugs.llvm.org/show_bug.cgi?id=43631

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 374832

4 years agoDebugInfo: Remove unnecessary/mistaken inclusion of Bitcode/BitcodeAnalyzer.h
David Blaikie [Mon, 14 Oct 2019 22:12:45 +0000 (22:12 +0000)]
DebugInfo: Remove unnecessary/mistaken inclusion of Bitcode/BitcodeAnalyzer.h

Introduced in r374582, Michael Spencer pointed out this broke the
modules build due to a missing tblgen dependency on
llvm/IR/Attributes.inc.

Michael fixed the dependency in r374827.

So this removes the inclusion and the new dependency (effectively
reverting r374827 and including the alternative fix of removing rather
than supporting the new dependency).

Thanks for the quick fix/notice, Michael!

llvm-svn: 374831

4 years ago[update_mir_test_checks] Handle MI flags properly
Roman Tereshin [Mon, 14 Oct 2019 22:01:58 +0000 (22:01 +0000)]
[update_mir_test_checks] Handle MI flags properly

previously we would generate literal check lines w/ no reg-exps for
vregs as MI flags (nsw, ninf, etc.) won't be recognized as a part of MI.

Fixing that. Includes updating the MIR tests that suffered from the
problem.

Reviewed By: bogner

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

llvm-svn: 374829

4 years ago[InstCombine] fold a shifted bool zext to a select
Sanjay Patel [Mon, 14 Oct 2019 21:56:40 +0000 (21:56 +0000)]
[InstCombine] fold a shifted bool zext to a select

For a constant shift amount, add the following fold.
shl (zext (i1 X)), ShAmt --> select (X, 1 << ShAmt, 0)

https://rise4fun.com/Alive/IZ9

Fixes PR42257.

Based on original patch by @zvi (Zvi Rackover)

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

llvm-svn: 374828

4 years ago[Modules Build] Add missing dependency.
Michael J. Spencer [Mon, 14 Oct 2019 21:53:51 +0000 (21:53 +0000)]
[Modules Build] Add missing dependency.

A previous commit made libLLVMDebugInfoDWARF depend on the LLVM_Bitcode module which depends on the LLVM_intrinsic_gen module which depends onĀ "llvm/IR/Attributes.inc" which is a generated header not depended on by libLLVMDebugInfo. Add that dependency.

llvm-svn: 374827

4 years agoPR43080: Do not build context-sensitive expressions during name classification.
Richard Smith [Mon, 14 Oct 2019 21:53:03 +0000 (21:53 +0000)]
PR43080: Do not build context-sensitive expressions during name classification.

Summary:
We don't know what context to use until the classification result is
consumed by the parser, which could happen in a different semantic
context. So don't build the expression that results from name
classification until we get to that point and can handle it properly.

This covers everything except C++ implicit class member access, which
is a little awkward to handle properly in the face of the protected
member access check. But it at least fixes all the currently-filed
instances of PR43080.

Reviewers: efriedma

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 374826

4 years agobuild fix for SBInstruction.
Lawrence D'Anna [Mon, 14 Oct 2019 21:51:02 +0000 (21:51 +0000)]
build fix for SBInstruction.

oops!  I cherry-picked  rL374820 thinking it was completely
independent of D68737, but it wasn't.  It makes an incidental
use of SBFile::GetFile, which is introduced there, so I broke the
build.

The docs say you can commit without review for "obvious".   I think
this qualifies.   If this kind of fix isn't considered obvious, let
me know and I'll revert instead.

Fixes: rL374820
llvm-svn: 374825

4 years ago[lit] Create Run object later and only when it is needed
Julian Lettner [Mon, 14 Oct 2019 21:23:40 +0000 (21:23 +0000)]
[lit] Create Run object later and only when it is needed

Reviewed By: rnk

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

llvm-svn: 374823

4 years agoAdd support to -Wa,-W in clang
Jian Cai [Mon, 14 Oct 2019 21:21:39 +0000 (21:21 +0000)]
Add support to -Wa,-W in clang

Currently clang does not support -Wa,-W, which suppresses warning
messages in GNU assembler. Add this option for gcc compatibility.
https://bugs.llvm.org/show_bug.cgi?id=43651

llvm-svn: 374822

4 years ago[NFC] Fix ClangScanDeps/static-analyzer.c test on Windows
Jan Korous [Mon, 14 Oct 2019 21:06:11 +0000 (21:06 +0000)]
[NFC] Fix ClangScanDeps/static-analyzer.c test on Windows

Follow-up to c5d14b5c6fa

llvm-svn: 374821

4 years agoremove FILE* bindings from SBInstruction.
Lawrence D'Anna [Mon, 14 Oct 2019 20:59:57 +0000 (20:59 +0000)]
remove FILE* bindings from SBInstruction.

Summary:
This patch replaces the FILE* python bindings for SBInstruction and
SBInstructionList and replaces them with the new, safe SBFile and FileSP
bindings.

I also re-enable `Test_Disassemble_VST1_64`, because now we can use
the file bindings as an additional test of the disassembler, and we
can use the disassembler test as a test of the file bindings.

The bugs referred to in the comments appear to have been fixed.   The
radar is closed now and the bugzilla bug does not reproduce with the
instructions given.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374820

4 years ago[OPNEMP]Allow num_tasks clause in combined task-based directives.
Alexey Bataev [Mon, 14 Oct 2019 20:44:34 +0000 (20:44 +0000)]
[OPNEMP]Allow num_tasks clause in combined task-based directives.

The expression of the num_tasks clause must be captured in the combined
task-based directives, like 'parallel master taskloop' directive.

llvm-svn: 374819

4 years ago[InstCombine] add tests for select/shift transforms; NFC
Sanjay Patel [Mon, 14 Oct 2019 20:28:03 +0000 (20:28 +0000)]
[InstCombine] add tests for select/shift transforms; NFC

A transform proposal for the shift form is in D63382.

llvm-svn: 374818

4 years agouint32_t options -> File::OpenOptions options
Lawrence D'Anna [Mon, 14 Oct 2019 20:15:34 +0000 (20:15 +0000)]
uint32_t options -> File::OpenOptions options

Summary:
This patch re-types everywhere that passes a File::OpenOptions
as a uint32_t so it actually uses File::OpenOptions.

It also converts some OpenOptions related functions that fail
by returning 0 or NULL into llvm::Expected

split off from https://reviews.llvm.org/D68737

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374817