Commit Graph

329682 Commits

Author SHA1 Message Date
Reid Kleckner 215a8d948d Fix as-w-option.c on Windows where no assembler exists
llvm-svn: 374936
2019-10-15 18:39:41 +00:00
Jonas Devlieghere 409b4b5fb3 Revert "[VirtualFileSystem] Support virtual working directory in the RedirectingFS"
This reverts the original commit and the follow up:

Revert "[VirtualFileSystem] Support virtual working directory in the  RedirectingFS"
Revert "[test] Update YAML mapping in VirtualFileSystemTest"

llvm-svn: 374935
2019-10-15 18:37:00 +00:00
Dmitry Mikulin f14642f2f1 Added support for "#pragma clang section relro=<name>"
Differential Revision: https://reviews.llvm.org/D68806

llvm-svn: 374934
2019-10-15 18:31:10 +00:00
Thomas Lively 2cb27072ce [WebAssembly] Allow multivalue types in block signature operands
Summary:
Renames `ExprType` to the more apt `BlockType` and adds a variant for
multivalue blocks. Currently non-void blocks are only generated at the
end of functions where the block return type needs to agree with the
function return type, and that remains true for multivalue
blocks. That invariant means that the actual signature does not need
to be stored in the block signature `MachineOperand` because it can be
inferred by `WebAssemblyMCInstLower` from the return type of the
parent function. `WebAssemblyMCInstLower` continues to lower block
signature operands to immediates when possible but lowers multivalue
signatures to function type symbols. The AsmParser and Disassembler
are updated to handle multivalue block types as well.

Reviewers: aheejin, dschuff, aardappel

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

Tags: #llvm

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

llvm-svn: 374933
2019-10-15 18:28:22 +00:00
Jian Cai 0650355c09 [clang] refactor -Wa,-W test cases.
Remove REQUIRES and only keep the clang driver tests, since the
assembler are already tested with -Wa,--no-warn. This way we could run
the test on non-linux platforms and catch breaks on them.

llvm-svn: 374932
2019-10-15 18:17:08 +00:00
Jordan Rupprecht eb501b1fc1 [llvm-objdump] Use a counter for llvm-objdump -h instead of the section index.
Summary:
When listing the index in `llvm-objdump -h`, use a zero-based counter instead of the actual section index (e.g. shdr->sh_index for ELF).

While this is effectively a noop for now (except one unit test for XCOFF), the index values will change in a future patch that filters certain sections out (e.g. symbol tables). See D68669 for more context. Note: the test case in `test/tools/llvm-objdump/X86/section-index.s` already covers the case of incrementing the section index counter when sections are skipped.

Reviewers: grimar, jhenderson, espindola

Reviewed By: grimar

Subscribers: emaste, sbc100, arichardson, aheejin, arphaman, seiya, llvm-commits, MaskRay

Tags: #llvm

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

llvm-svn: 374931
2019-10-15 18:13:20 +00:00
Jonas Devlieghere 621ce3790b [test] Update YAML mapping in VirtualFileSystemTest
The 'bar' directory should be part of the root rather than the file
itself.

llvm-svn: 374930
2019-10-15 18:05:44 +00:00
Jan Korous 9e49adc975 Fix Driver/working-directory.c test
Accidentally committed debug print.

llvm-svn: 374929
2019-10-15 18:04:18 +00:00
Simon Pilgrim 50dc09dd16 [X86] combineX86ShufflesRecursively - split the getTargetShuffleInputs call from the resolveTargetShuffleAndZeroables call.
Exposes an issue in getFauxShuffleMask where the OR(SHUFFLE,SHUFFLE) decode should always resolve zero/undef elements.

Part of the fix for PR43024 where ideally we shouldn't call resolveTargetShuffleAndZeroables for Depth == 0

llvm-svn: 374928
2019-10-15 17:59:13 +00:00
Vedant Kumar c7ec51a7c3 [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
2019-10-15 17:53:48 +00:00
Jan Korous f8907fa6f4 Reland [Driver] Fix -working-directory issues
Don't change the default VFS in Driver, update tests & reland.

This reverts commit 999f8a7416.

llvm-svn: 374926
2019-10-15 17:51:59 +00:00
Siva Chandra c1157d1e77 [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
2019-10-15 17:42:28 +00:00
Lawrence D'Anna 30cf609548 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
2019-10-15 17:41:40 +00:00
Digger Lin fdfd6ab12e [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
2019-10-15 17:40:41 +00:00
David Zarzycki 59390efef2 [X86] Make memcmp() use PTEST if possible and also enable AVX1
llvm-svn: 374922
2019-10-15 17:40:12 +00:00
Aaron Ballman 27c7a9b157 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
2019-10-15 17:30:19 +00:00
Alina Sbirlea 3de89f3416 [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
2019-10-15 17:25:36 +00:00
Jon Chesterfield d69d1aa131 [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
2019-10-15 17:15:26 +00:00
Alina Sbirlea 35c8af1850 [MemorySSA] Update DomTree before applying MSSA updates.
Update on the fix in rL374850.

llvm-svn: 374918
2019-10-15 17:15:19 +00:00
Jonas Devlieghere 0b9981b180 [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
2019-10-15 17:14:24 +00:00
Lawrence D'Anna d3bd5b3d71 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
2019-10-15 17:12:49 +00:00
Vedant Kumar e409f12131 [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
2019-10-15 17:10:44 +00:00
Digger Lin 41ca91f299 [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
2019-10-15 17:09:54 +00:00
James Clarke 1ab27c74d4 [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
2019-10-15 17:05:42 +00:00
Lawrence D'Anna 311dbb1bd7 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
2019-10-15 16:59:20 +00:00
Lawrence D'Anna d9b553ec99 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
2019-10-15 16:46:27 +00:00
Stanislav Mekhanoshin 1184c27fa5 [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
2019-10-15 16:41:15 +00:00
Dmitry Mikulin 034badb312 CFI: wrong type passed to llvm.type.test with multiple inheritance devirtualization.
Differential Revision: https://reviews.llvm.org/D67985

llvm-svn: 374909
2019-10-15 16:32:50 +00:00
Stanislav Mekhanoshin 6e8599d939 [AMDGPU] Allow DPP combiner to work with REG_SEQUENCE
Differential Revision: https://reviews.llvm.org/D68828

llvm-svn: 374908
2019-10-15 16:17:50 +00:00
Saar Raz 84423bd439 [Concepts] Remove unused and illegal Sema includes from ExprCXX.cpp
Fixing accidental includes introduced in 374903

llvm-svn: 374907
2019-10-15 15:49:29 +00:00
Adrian Prantl b459be1025 Increase gdbremote_testcase timeouts when running under ASAN.
llvm-svn: 374906
2019-10-15 15:46:17 +00:00
Adrian Prantl 263eb36869 Skip PExpect tests under ASAN, I can't get them to work reliably.
llvm-svn: 374905
2019-10-15 15:38:49 +00:00
GN Sync Bot 0cdf478955 gn build: Merge r374903
llvm-svn: 374904
2019-10-15 15:33:04 +00:00
Saar Raz 5d98ba6077 [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
2019-10-15 15:24:26 +00:00
Sanjay Patel d545c9056e [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
2019-10-15 15:23:57 +00:00
Kadir Cetinkaya b18170660e [clangd][NFC] Update comments to use triple-slashes
llvm-svn: 374901
2019-10-15 14:59:08 +00:00
GN Sync Bot ae8e69ecd0 gn build: Merge r374899
llvm-svn: 374900
2019-10-15 14:53:40 +00:00
Nico Weber b4638f9ff0 Revert 374882 "[Concepts] Concept Specialization Expressions"
This reverts commit ec87b00382.
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
2019-10-15 14:46:39 +00:00
Digger Lin 52d2a567b5 revert git test commit
llvm-svn: 374898
2019-10-15 14:44:06 +00:00
Digger Lin defaea0b6c a test commit access
llvm-svn: 374897
2019-10-15 14:39:29 +00:00
Bruno Cardoso Lopes 1731fc88d1 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
2019-10-15 14:23:55 +00:00
Benjamin Kramer ce00cd6ae8 [AsmPrinter] Fix unused variable warning in Release builds. NFC.
llvm-svn: 374894
2019-10-15 14:23:11 +00:00
Benjamin Kramer dfb7a73601 [AST] Remove unused Sema includes to fix a cyclic dependency from Sema to AST
llvm-svn: 374893
2019-10-15 14:23:05 +00:00
Kadir Cetinkaya 9d66247e9b [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
2019-10-15 14:20:52 +00:00
Sid Manning ab50256544 [lld] Check for branch range overflows.
Differential Revision: https://reviews.llvm.org/D68875

llvm-svn: 374891
2019-10-15 14:12:54 +00:00
Guillaume Chatelet bae629b966 [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
2019-10-15 13:58:22 +00:00
Aleksandr Urakov 86d0f8b148 [Windows][NFC] Fix tests after r374528.
Differential Revision: https://reviews.llvm.org/D67347

llvm-svn: 374888
2019-10-15 13:52:27 +00:00
Sam Parker ce39278f25 [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
2019-10-15 13:12:51 +00:00
Sanjay Patel 455ce7816c [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
2019-10-15 13:12:44 +00:00
Michal Gorny 9c9bd1657c [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
2019-10-15 13:05:38 +00:00