Hamza Sood [Fri, 7 Dec 2018 12:55:01 +0000 (12:55 +0000)]
[unittests] Merge the PrintedStmtCXX..Matches functions (NFC)
This was reviewed as part of https://reviews.llvm.org/D36527
llvm-svn: 348589
Aaron Ballman [Fri, 7 Dec 2018 12:35:15 +0000 (12:35 +0000)]
Adding tests for -ast-dump; NFC.
This adds tests for various statements in C.
llvm-svn: 348588
Gabor Marton [Fri, 7 Dec 2018 12:29:02 +0000 (12:29 +0000)]
[CTU] Eliminate race condition in CTU lit tests
Summary:
We plan to introduce additional CTU related lit test. Since lit may run the
tests in parallel, it is not safe to use the same directory (%T) for these
tests. It is safe to use however test case specific directories (%t).
Reviewers: xazax.hun, a_sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Differential Revision: https://reviews.llvm.org/D55129
llvm-svn: 348587
Gabor Marton [Fri, 7 Dec 2018 12:21:43 +0000 (12:21 +0000)]
[CTU] Add asserts to protect invariants
Reviewers: xazax.hun, a_sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Differential Revision: https://reviews.llvm.org/D55132
llvm-svn: 348586
David Green [Fri, 7 Dec 2018 12:10:23 +0000 (12:10 +0000)]
[Targets] Add errors for tiny and kernel codemodel on targets that don't support them
Adds fatal errors for any target that does not support the Tiny or Kernel
codemodels by rejigging the getEffectiveCodeModel calls.
Differential Revision: https://reviews.llvm.org/D50141
llvm-svn: 348585
Gabor Marton [Fri, 7 Dec 2018 11:55:22 +0000 (11:55 +0000)]
[CTU] Add statistics
Reviewers: xazax.hun, a_sidorin
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Differential Revision: https://reviews.llvm.org/D55133
llvm-svn: 348584
Haojian Wu [Fri, 7 Dec 2018 11:25:37 +0000 (11:25 +0000)]
[clang-tidy] Remove duplicated getText implementation, NFC
llvm-svn: 348583
David Green [Fri, 7 Dec 2018 11:16:03 +0000 (11:16 +0000)]
Add a AArch64 triple to tiny codemodel test.
Most other targets do not support the tiny code model.
llvm-svn: 348582
Simon Pilgrim [Fri, 7 Dec 2018 11:10:03 +0000 (11:10 +0000)]
Fix gcc7.3 -Wparentheses warning. NFCI.
llvm-svn: 348581
Xing GUO [Fri, 7 Dec 2018 11:04:22 +0000 (11:04 +0000)]
[yaml2obj] format some codes NFC.
Summary: This line is longer than 80 characters.
Subscribers: llvm-commits, jakehehrlich
Differential Revision: https://reviews.llvm.org/D55419
llvm-svn: 348580
Xing GUO [Fri, 7 Dec 2018 10:50:29 +0000 (10:50 +0000)]
[yaml2obj] revert bad change
llvm-svn: 348579
Xing GUO [Fri, 7 Dec 2018 10:31:34 +0000 (10:31 +0000)]
[yaml2obj] format some codes NFC.
Summary: This line is longer than 80 characters.
Subscribers: llvm-commits, jakehehrlich
Differential Revision: https://reviews.llvm.org/D55419
llvm-svn: 348578
Hans Wennborg [Fri, 7 Dec 2018 09:58:33 +0000 (09:58 +0000)]
Fix test/tools/llvm-mca/AArch64/Exynos/direct-branch.s on Mac
It was failing as below. Adding a triple seems to help.
--
: 'RUN: at line 2'; /work/llvm.combined/build.release/bin/llvm-mca -march=aarch64 -mcpu=exynos-m1 -resource-pressure=false < /work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s | /work/llvm.combined/build.release/bin/FileCheck /work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s -check-prefixes=ALL,M1
: 'RUN: at line 3'; /work/llvm.combined/build.release/bin/llvm-mca -march=aarch64 -mcpu=exynos-m3 -resource-pressure=false < /work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s | /work/llvm.combined/build.release/bin/FileCheck /work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s -check-prefixes=ALL,M3
--
Exit Code: 1
Command Output (stderr):
--
/work/llvm.combined/llvm/test/tools/llvm-mca/AArch64/Exynos/direct-branch.s:36:12: error: M1-NEXT: expected string not found in input
^
<stdin>:21:2: note: scanning from here
1 0 0.25 b Ltmp0
^
--
llvm-svn: 348577
Roger Ferrer Ibanez [Fri, 7 Dec 2018 09:49:21 +0000 (09:49 +0000)]
[utils] Use operator "in" instead of bound function "has_key"
has_key has been removed in Python 3. The in comparison operator can be used
instead.
Differential Revision: https://reviews.llvm.org/D55310
llvm-svn: 348576
Simon Pilgrim [Fri, 7 Dec 2018 09:27:35 +0000 (09:27 +0000)]
[X86] Add ivybridge to llvm-exegesis PFM counter mappings
llvm-svn: 348575
Simon Pilgrim [Fri, 7 Dec 2018 09:18:44 +0000 (09:18 +0000)]
[SelectionDAG] Don't pass on DemandedElts when handling SCALAR_TO_VECTOR
Fixes an assertion:
llc: lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2200: llvm::KnownBits llvm::SelectionDAG::computeKnownBits(llvm::SDValue, const llvm::APInt&, unsigned int) const: Assertion `(!Op.getValueType().isVector() || NumElts == Op.getValueType().getVectorNumElements()) && "Unexpected vector size"' failed.
Committed on behalf of: @pendingchaos (Rhys Perry)
Differential Revision: https://reviews.llvm.org/D55223
llvm-svn: 348574
Stefan Granitz [Fri, 7 Dec 2018 09:12:54 +0000 (09:12 +0000)]
[CMake] Add support for NO_INSTALL_RPATH argument in llvm_add_library()
Summary:
Allow clients to suppress setup of default RPATHs in designated library targets. This is used in LLDB when emitting liblldb as a framework bundle, which itself doesn't load further RPATH-dependent libraries.
This follows the approach in add_llvm_executable().
Reviewers: aprantl, JDevlieghere, davide, friss
Reviewed By: aprantl
Subscribers: mgorny, lldb-commits, llvm-commits, #lldb
Differential Revision: https://reviews.llvm.org/D55316
llvm-svn: 348573
Kang Zhang [Fri, 7 Dec 2018 08:58:12 +0000 (08:58 +0000)]
[PowerPC] VSX register support for inline assembly
Summary:
The patch is to add the VSX register support for inline assembly. After this
patch, we can use VSX register in inline assembly clobber list without error.
Reviewed By: jsji, nemanjai
Differential Revision: https://reviews.llvm.org/D55192
llvm-svn: 348572
Ranjeet Singh [Fri, 7 Dec 2018 08:34:59 +0000 (08:34 +0000)]
[IR] Don't assume all functions are 4 byte aligned
In some cases different alignments for function might be used to save
space e.g. thumb mode with -Oz will try to use 2 byte function
alignment. Similar patch that fixed this in other areas exists here
https://reviews.llvm.org/D46110
This was approved previously https://reviews.llvm.org/D55115 (r348215)
but when committed it caused failures on the sanitizer buildbots when
building llvm with clang (containing this patch). This is now fixed
because I've added a check to see if getting the parent module returns
null if it does then set the alignment to 0.
Differential Revision: https://reviews.llvm.org/D55115
llvm-svn: 348571
Markus Lavin [Fri, 7 Dec 2018 08:23:37 +0000 (08:23 +0000)]
[PM] Port LoadStoreVectorizer to the new pass manager.
Differential Revision: https://reviews.llvm.org/D54848
llvm-svn: 348570
Hans Wennborg [Fri, 7 Dec 2018 08:17:26 +0000 (08:17 +0000)]
Fix thunks returning memptrs via sret by emitting also scalar return values directly in sret slot (PR39901)
Thunks that return member pointers via sret are broken due to using temporary
storage for the return value on the stack and then passing that pointer to a
tail call, violating the rule that a tail call can't access allocas in the
caller (see bug).
Since r90526, we put aggregate return values directly in the sret slot, but
this doesn't apply to member pointers which are considered scalar.
Unless I'm missing something subtle, we should be able to always use the sret
slot directly for indirect return values.
Differential revision: https://reviews.llvm.org/D55371
llvm-svn: 348569
Dean Michael Berris [Fri, 7 Dec 2018 06:23:06 +0000 (06:23 +0000)]
[XRay] Use preallocated memory for XRay profiling
Summary:
This change builds upon D54989, which removes memory allocation from the
critical path of the profiling implementation. This also changes the API
for the profile collection service, to take ownership of the memory and
associated data structures per-thread.
The consolidation of the memory allocation allows us to do two things:
- Limits the amount of memory used by the profiling implementation,
associating preallocated buffers instead of allocating memory
on-demand.
- Consolidate the memory initialisation and cleanup by relying on the
buffer queue's reference counting implementation.
We find a number of places which also display some problematic
behaviour, including:
- Off-by-factor bug in the allocator implementation.
- Unrolling semantics in cases of "memory exhausted" situations, when
managing the state of the function call trie.
We also add a few test cases which verify our understanding of the
behaviour of the system, with important edge-cases (especially for
memory-exhausted cases) in the segmented array and profile collector
unit tests.
Depends on D54989.
Reviewers: mboerger
Subscribers: dschuff, mgorny, dmgreen, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D55249
llvm-svn: 348568
Max Kazantsev [Fri, 7 Dec 2018 05:44:45 +0000 (05:44 +0000)]
[LoopSimplifyCFG] Do not deal with loops with irreducible CFG inside
The current algorithm that collects live/dead/inloop blocks relies on some invariants
related to RPO and PO traversals. In particular, the important fact it requires is that
the only loop's latch is the first block in PO traversal. It also relies on fact that during
RPO we visit all prececessors of a block before we visit this block (backedges ignored).
If a loop has irreducible non-loop cycle inside, both these assumptions may break.
This patch adds detection for this situation and prohibits the terminator folding
for loops with irreducible CFG.
We can in theory support this later, for this some algorithmic changes are needed.
Besides, irreducible CFG is not a frequent situation and we can just don't bother.
Thanks @uabelho for finding this!
Differential Revision: https://reviews.llvm.org/D55357
Reviewed By: skatkov
llvm-svn: 348567
Zi Xuan Wu [Fri, 7 Dec 2018 05:25:16 +0000 (05:25 +0000)]
[PowerPC] Fix assert from machine verify pass that missing undef register flag
Fix assert about using an undefined physical register in machine instruction verify pass.
The reason is that register flag undef is missing when doing transformation from If Conversion Pass.
```
Bad machine code: Using an undefined physical register
- function: func_65
- basic block: %bb.0 entry (0x10024740738)
- instruction: BCLR killed $cr5lt, implicit $lr8, implicit $rm, implicit undef $x3
- operand 0: killed $cr5lt
LLVM ERROR: Found 1 machine code errors.
```
There are also other existing testcases with same issue. So I add -verify-machineinstrs option to open verifying.
Differential Revision: https://reviews.llvm.org/D55408
llvm-svn: 348566
Evandro Menezes [Fri, 7 Dec 2018 03:23:36 +0000 (03:23 +0000)]
[llvm-mca] Improve test (NFC)
Add more instructions to the test for Cortex.
llvm-svn: 348565
Evandro Menezes [Fri, 7 Dec 2018 03:23:14 +0000 (03:23 +0000)]
[llvm-mca] Improve test (NFC)
Add a label to make explicit that the branch is short for Exynos.
llvm-svn: 348564
Dean Michael Berris [Fri, 7 Dec 2018 03:19:13 +0000 (03:19 +0000)]
Re-land "[XRay] Move-only Allocator, FunctionCallTrie, and Array"
This reverts commit r348455, with some additional changes:
- Work-around deficiency of gcc-4.8 by duplicating the implementation of
`AppendEmplace` in `Append`, but instead of using brace-init for the
copy construction, use a placement new explicitly calling the copy
constructor.
llvm-svn: 348563
Vedant Kumar [Fri, 7 Dec 2018 03:01:54 +0000 (03:01 +0000)]
[CodeExtractor] Store outputs at the first valid insertion point
When CodeExtractor outlines values which are used by the original
function, it must store those values in some in-out parameter. This
store instruction must not be inserted in between a PHI and an EH pad
instruction, as that results in invalid IR.
This fixes the following verifier failure seen while outlining within
ObjC methods with live exit values:
The unwind destination does not have an exception handling instruction!
%call35 = invoke i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %exn.adjusted, i8* %1)
to label %invoke.cont34 unwind label %lpad33, !dbg !4183
The unwind destination does not have an exception handling instruction!
invoke void @objc_exception_throw(i8* %call35) #12
to label %invoke.cont36 unwind label %lpad33, !dbg !4184
LandingPadInst not the first non-PHI instruction in the block.
%3 = landingpad { i8*, i32 }
catch i8* null, !dbg !1411
rdar://
46540815
llvm-svn: 348562
Jim Ingham [Fri, 7 Dec 2018 02:28:04 +0000 (02:28 +0000)]
Add SBInitializerOptions.h to the Xcode project.
And mark it as a public header so it will get copied
into the LLDB.framework. A handful of "api" tests were
failing because they couldn't find this file.
llvm-svn: 348561
Armando Montanez [Fri, 7 Dec 2018 01:31:28 +0000 (01:31 +0000)]
Revert "[llvm-tapi] Don't override SequenceTraits for std::string"
Revert r348551 since it triggered some warnings that don't appear to have a quick fix.
llvm-svn: 348560
Jim Ingham [Fri, 7 Dec 2018 01:18:40 +0000 (01:18 +0000)]
Handle detecting exec for DynamicLoaderMacOS with older debugservers
that don't send reason:exec.
<rdar://problem/
43756823>
Differential Revision: https://reviews.llvm.org/D55399
llvm-svn: 348559
Nikita Popov [Fri, 7 Dec 2018 00:42:03 +0000 (00:42 +0000)]
Revert "[DemandedBits][BDCE] Support vectors of integers"
This reverts commit r348549. Causing assertion failures during
clang build.
llvm-svn: 348558
Jason Molenda [Fri, 7 Dec 2018 00:35:26 +0000 (00:35 +0000)]
Change the amount of data that Platform::PutFile will try to transfer
in one packet from 1k bytes to 16k bytes. Sending a large file to an
iOS device directly connected by USB cable, to lldb-server running in
platform mode, this speeds up the file xfer by 77%. Sending the file
in 32k blocks speeds up the file xfer by 80% versus 1k blocks, starting
with 16k to make sure we don't have any problems with android testing.
We may not have the same perf characteristics over ethernet, but with
USB it's faster to send fewer larger packets than many small packets.
llvm-svn: 348557
Saleem Abdulrasool [Fri, 7 Dec 2018 00:31:34 +0000 (00:31 +0000)]
Host: remove Yield on Windows
Windows provides a Yield function-like macro that allows a thread to
yield the CPU. However, this conflicts with `Yield` in swift. Undefine
`Yield` to allow building lldb with swift support.
llvm-svn: 348556
Stephen Kelly [Fri, 7 Dec 2018 00:08:14 +0000 (00:08 +0000)]
Add test for InitListExpr
llvm-svn: 348553
Sanjay Patel [Fri, 7 Dec 2018 00:01:57 +0000 (00:01 +0000)]
[DAGCombiner] use root SDLoc for all nodes created by logic fold
If this is not a valid way to assign an SDLoc, then we get this
wrong all over SDAG.
I don't know enough about the SDAG to explain this. IIUC, theoretically,
debug info is not supposed to affect codegen. But here it has clearly
affected 3 different targets, and the x86 change is an actual improvement.
llvm-svn: 348552
Armando Montanez [Thu, 6 Dec 2018 23:59:32 +0000 (23:59 +0000)]
[llvm-tapi] Don't override SequenceTraits for std::string
Change the ELF YAML implementation of TextAPI so NeededLibs uses flow
sequence vector correctly instead of overriding the YAML implementation
for std::vector<std::string>>.
This should fix the test failure with the LLVM_LINK_LLVM_DYLIB build mentioned in D55381.
Still passes existing tests that cover this.
Differential Revision: https://reviews.llvm.org/D55390
llvm-svn: 348551
Sanjay Patel [Thu, 6 Dec 2018 23:53:58 +0000 (23:53 +0000)]
[DAGCombiner] don't bother saving a SDLoc for a node that's dead; NFCI
We shouldn't care about the debug location for a node that
we're creating, but attaching the root of the pattern should
be the best effort. (If this is not true, then we are doing
it wrong all over the SDAG).
This is no-functional-change-intended, and there are no
regression test diffs...and that's what I expected. But
there's a similar line above this diff, where those
assumptions apparently do not hold.
llvm-svn: 348550
Nikita Popov [Thu, 6 Dec 2018 23:50:32 +0000 (23:50 +0000)]
[DemandedBits][BDCE] Support vectors of integers
DemandedBits and BDCE currently only support scalar integers. This
patch extends them to also handle vector integer operations. In this
case bits are not tracked for individual vector elements, instead a
bit is demanded if it is demanded for any of the elements. This matches
the behavior of computeKnownBits in ValueTracking and
SimplifyDemandedBits in InstCombine.
The getDemandedBits() method can now only be called on instructions that
have integer or vector of integer type. Previously it could be called on
any sized instruction (even if it was not particularly useful). The size
of the return value is now always the scalar size in bits (while
previously it was the type size in bits).
Differential Revision: https://reviews.llvm.org/D55297
llvm-svn: 348549
Nikita Popov [Thu, 6 Dec 2018 23:50:19 +0000 (23:50 +0000)]
[BDCE] Add tests for BDCE applied to vector instructions; NFC
These are baseline tests for D55297.
llvm-svn: 348548
Sanjay Patel [Thu, 6 Dec 2018 23:39:28 +0000 (23:39 +0000)]
[DAGCombiner] more clean up in hoistLogicOpWithSameOpcodeHands(); NFC
This code can still misbehave.
llvm-svn: 348547
Stephen Kelly [Thu, 6 Dec 2018 23:33:33 +0000 (23:33 +0000)]
NFC: Move VisitExpr code to dumpStmt
Summary:
The call is duplicated in the handlers of all Expr subclasses.
This change makes it easy to split statement handling out to
TextNodeDumper.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D55339
llvm-svn: 348546
Stephen Kelly [Thu, 6 Dec 2018 23:33:27 +0000 (23:33 +0000)]
NFC: Move VisitStmt code to dumpStmt
Summary: This call is duplicated in Visits of all direct subclasses of Stmt.
Reviewers: aaron.ballman
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D55338
llvm-svn: 348545
Stella Stamenova [Thu, 6 Dec 2018 23:25:37 +0000 (23:25 +0000)]
[lit] Use the build.py script in the case-insensitive test
This makes the test build correctly regardless of whether we use VS or ninja to run the tests
llvm-svn: 348544
Stephen Kelly [Thu, 6 Dec 2018 23:23:10 +0000 (23:23 +0000)]
Add more expected content to match in test
llvm-svn: 348543
Stella Stamenova [Thu, 6 Dec 2018 23:22:46 +0000 (23:22 +0000)]
[pecoff] Use PATH_MAX instead of MAX_PATH
PATH_MAX is defined on all platforms while MAX_PATH is Windows-specific
llvm-svn: 348542
Stephen Kelly [Thu, 6 Dec 2018 22:51:51 +0000 (22:51 +0000)]
Use relative line offsets in test
llvm-svn: 348541
Alex Lorenz [Thu, 6 Dec 2018 22:45:58 +0000 (22:45 +0000)]
[frontend][darwin] warn_stdlibcxx_not_found: supress warning for preprocessed input
Addresses second post-commit feedback for r335081 from Nico
llvm-svn: 348540
Nico Weber [Thu, 6 Dec 2018 22:40:05 +0000 (22:40 +0000)]
Run `git ls-files '*.gn' '*.gni' | xargs -n 1 gn format`.
llvm-svn: 348539
Nico Weber [Thu, 6 Dec 2018 22:36:16 +0000 (22:36 +0000)]
[gn build] merge r348505.
llvm-svn: 348537
Craig Topper [Thu, 6 Dec 2018 22:26:59 +0000 (22:26 +0000)]
[X86] Directly create ADC/SBB nodes instead of using ADD/SUB with (and SETCC_CARRY, 1)
This addresses a FIXME and avoids depending on an isel pattern match I think. I've remove the isel patterns too since he have no lit tests left that cover them. Hopefully that really means they are unused.
I'm trying to decide if we need SETCC_CARRY. This removes one of its usages.
Differential Revision: https://reviews.llvm.org/D55355
llvm-svn: 348536
Sanjay Patel [Thu, 6 Dec 2018 22:10:44 +0000 (22:10 +0000)]
[DAGCombiner] don't group bswap with casts in logic hoisting fold
This was probably organized as it was because bswap is a unary op.
But that's where the similarity to the other opcodes ends. We should
not limit this transform to scalars, and we should not try it if
either input has other uses. This is another step towards trying to
clean this whole function up to prevent it from causing infinite loops
and memory explosions.
Earlier commits in this series:
rL348501
rL348508
rL348518
llvm-svn: 348534
George Karpenkov [Thu, 6 Dec 2018 22:07:12 +0000 (22:07 +0000)]
[analyzer] Rely on os_consumes_this attribute to signify that the method call consumes a reference for "this"
Differential Revision: https://reviews.llvm.org/D55158
llvm-svn: 348533
George Karpenkov [Thu, 6 Dec 2018 22:06:59 +0000 (22:06 +0000)]
[attributes] Add an attribute os_consumes_this, with similar semantics to ns_consumes_self
The attribute specifies that the call of the C++ method consumes a
reference to "this".
Differential Revision: https://reviews.llvm.org/D55155
llvm-svn: 348532
George Karpenkov [Thu, 6 Dec 2018 22:06:44 +0000 (22:06 +0000)]
[analyzer] Fix an infinite recursion bug while checking parent methods in RetainCountChecker
Differential Revision: https://reviews.llvm.org/D55351
llvm-svn: 348531
Sanjay Patel [Thu, 6 Dec 2018 21:56:30 +0000 (21:56 +0000)]
[x86] add test for vector bitwise-logic-of-bswaps; NFC
llvm-svn: 348530
Louis Dionne [Thu, 6 Dec 2018 21:46:17 +0000 (21:46 +0000)]
[libc++] Improve diagnostics for non-const comparators and hashers in associative containers
Summary:
When providing a non-const-callable comparator in a map or set, the
warning diagnostic does not include the point of instantiation of
the container that triggered the warning, which makes it difficult
to track down the problem. This commit improves the diagnostic by
placing it directly in the body of the associative container.
The same change is applied to unordered associative containers, which
had a similar problem.
Finally, this commit cleans up the forward declarations of several
map and unordered_map helpers, which are not needed anymore.
<rdar://problem/
41370747>
Reviewers: EricWF, mclow.lists
Subscribers: christof, dexonsmith, llvm-commits
Differential Revision: https://reviews.llvm.org/D48955
llvm-svn: 348529
Aaron Smith [Thu, 6 Dec 2018 21:36:39 +0000 (21:36 +0000)]
[pecoff] Implement ObjectFilePECOFF::GetDependedModules()
Summary:
This parses entries in pecoff import tables for imported DLLs and
is intended as the first step to allow LLDB to load a PE's shared
modules when creating a target on the LLDB console.
Reviewers: rnk, zturner, aleksandr.urakov, lldb-commits, labath, asmith
Reviewed By: labath, asmith
Subscribers: labath, lemo, clayborg, Hui, mgorny, mgrang, teemperor
Differential Revision: https://reviews.llvm.org/D53094
llvm-svn: 348527
Nathan Lanza [Thu, 6 Dec 2018 21:13:03 +0000 (21:13 +0000)]
Implement WindowsDYLD::DidAttach for use with gdb-server attach
Summary:
Windows lldb debugging currently uses a process plugin to handle
launching and attaching to a process. Launching a process via a debug
server (e.g. ds2) and attaching to it with `gdb-remote port` currently
doesn't communicate address information of the executable properly.
Implement DynamicLoaderWindowsDYLD::DidAttach which allow us to
obtain the proper executable load address.
Differential Revision: https://reviews.llvm.org/D55383
llvm-svn: 348526
Louis Dionne [Thu, 6 Dec 2018 20:09:15 +0000 (20:09 +0000)]
[libcxx] Always convert 'use_system_cxx_lib' to an absolute path
Otherwise, some tests would fail when a relative path was passed,
because they'd use the relative path from a different directory
than the current working directory.
llvm-svn: 348525
Michal Gorny [Thu, 6 Dec 2018 20:04:08 +0000 (20:04 +0000)]
[test] Add missing cmake include for building libFuzzer alone
Include CompilerRTCompile in fuzzer tests explicitly. Otherwise, when
building only libFuzzer, CMake fails due to:
CMake Error at cmake/Modules/AddCompilerRT.cmake:395 (sanitizer_test_compile):
Unknown CMake command "sanitizer_test_compile".
Call Stack (most recent call first):
lib/fuzzer/tests/CMakeLists.txt:53 (generate_compiler_rt_tests)
Differential Revision: https://reviews.llvm.org/D55378
llvm-svn: 348524
Sanjay Patel [Thu, 6 Dec 2018 20:02:47 +0000 (20:02 +0000)]
[DAGCombiner] reduce indent; NFC
Unlike some of the folds in hoistLogicOpWithSameOpcodeHands()
above this shuffle transform, this has the expected hasOneUse()
checks in place.
llvm-svn: 348523
Andrea Di Biagio [Thu, 6 Dec 2018 19:55:38 +0000 (19:55 +0000)]
[DagCombiner][X86] Simplify a ConcatVectors of a scalar_to_vector with undef.
This patch introduces a new DAGCombiner rule to simplify concat_vectors nodes:
concat_vectors( bitcast (scalar_to_vector %A), UNDEF)
--> bitcast (scalar_to_vector %A)
This patch only partially addresses PR39257. In particular, it is enough to fix
one of the two problematic cases mentioned in PR39257. However, it is not enough
to fix the original test case posted by Craig; that particular case would
probably require a more complicated approach (and knowledge about used bits).
Before this patch, we used to generate the following code for function PR39257
(-mtriple=x86_64 , -mattr=+avx):
vmovsd (%rdi), %xmm0 # xmm0 = mem[0],zero
vxorps %xmm1, %xmm1, %xmm1
vblendps $3, %xmm0, %xmm1, %xmm0 # xmm0 = xmm0[0,1],xmm1[2,3]
vmovaps %ymm0, (%rsi)
vzeroupper
retq
Now we generate this:
vmovsd (%rdi), %xmm0 # xmm0 = mem[0],zero
vmovaps %ymm0, (%rsi)
vzeroupper
retq
As a side note: that VZEROUPPER is completely redundant...
I guess the vzeroupper insertion pass doesn't realize that the definition of
%xmm0 from vmovsd is already zeroing the upper half of %ymm0. Note that on
%-mcpu=btver2, we don't get that vzeroupper because pass vzeroupper insertion
%pass is disabled.
Differential Revision: https://reviews.llvm.org/D55274
llvm-svn: 348522
Alexey Bataev [Thu, 6 Dec 2018 19:45:48 +0000 (19:45 +0000)]
[OPENMP][NVPTX]Correct type casting for printf args + simplified shfl64 function.
Summary:
Explicitly casted printf's args to the required types + simplified
shfl64 function.
Reviewers: gtbercea, kkwli0
Subscribers: guansong, jfb, caomhin, openmp-commits
Differential Revision: https://reviews.llvm.org/D55379
llvm-svn: 348521
Louis Dionne [Thu, 6 Dec 2018 19:24:20 +0000 (19:24 +0000)]
[libcxx] Fix incorrect XFAILs for chrono tests on old macos deployment targets
The tests were marked to fail based on the 'availability' LIT feature.
However, those tests should really only be failing when we run them
against the dylibs that were deployed on macosx10.7 and macosx10.8,
which the deployment target has nothing to do with.
This caused the tests to unexpectedly pass when running the tests
with deployment target macosx10.{7,8} but running with a recent dylib.
llvm-svn: 348520
Jim Ingham [Thu, 6 Dec 2018 19:23:21 +0000 (19:23 +0000)]
Fix the Xcode project build for the addition of NativePDB/DWARFLocationExpression.{h,cpp}
llvm-svn: 348519
Sanjay Patel [Thu, 6 Dec 2018 19:18:56 +0000 (19:18 +0000)]
[DAGCombiner] don't hoist logic op if operands have other uses, part 2
The PPC test with 2 extra uses seems clearly better by avoiding this transform.
With 1 extra use, we also prevent an extra register move (although that might
be an RA problem). The general rule should be to only make a change here if
it is always profitable. The x86 diffs are all neutral.
llvm-svn: 348518
Simon Pilgrim [Thu, 6 Dec 2018 19:17:28 +0000 (19:17 +0000)]
Fix Wdocumentation warning. NFCI.
llvm-svn: 348517
Sanjay Patel [Thu, 6 Dec 2018 19:05:19 +0000 (19:05 +0000)]
[PowerPC] add tests for hoisting bitwise logic; NFC
llvm-svn: 348516
Nico Weber [Thu, 6 Dec 2018 18:50:39 +0000 (18:50 +0000)]
Allow forwarding -fdebug-compilation-dir to cc1as
The flag -fdebug-compilation-dir is useful to make generated .o files
independent of the path of the build directory, without making the compile
command-line dependent on the path of the build directory, like
-fdebug-prefix-map requires. This change makes it so that the driver can
forward the flag to -cc1as, like it already can for -cc1. We might want to
consider making -fdebug-compilation-dir a driver flag in a follow-up.
(Since -fdebug-compilation-dir defaults to PWD, it's already possible to get
this effect by setting PWD, but explicit compiler flags are better than env
vars, because e.g. ninja tracks command lines and reruns commands that change.)
Somewhat related to PR14625.
Differential Revision: https://reviews.llvm.org/D55377
llvm-svn: 348515
Zachary Turner [Thu, 6 Dec 2018 18:45:07 +0000 (18:45 +0000)]
Fix line endings in build.py
llvm-svn: 348514
Adrian Prantl [Thu, 6 Dec 2018 18:44:50 +0000 (18:44 +0000)]
Reapply "Avoid emitting redundant or unusable directories in DIFile metadata entries.""
This reverts commit r348280 and reapplies D55085 without modifications.
Original commit message:
Avoid emitting redundant or unusable directories in DIFile metadata entries.
As discussed on llvm-dev recently, Clang currently emits redundant
directories in DIFile entries, such as
.file 1 "/Volumes/Data/llvm" "/Volumes/Data/llvm/tools/clang/test/CodeGen/debug-info-abspath.c"
This patch looks at any common prefix between the compilation
directory and the (absolute) file path and strips the redundant
part. More importantly it leaves the compilation directory empty if
the two paths have no common prefix.
After this patch the above entry is (assuming a compilation dir of "/Volumes/Data/llvm/_build"):
.file 1 "/Volumes/Data/llvm" "tools/clang/test/CodeGen/debug-info-abspath.c"
When building the FileCheck binary with debug info, this patch makes
the build artifacts ~1kb smaller.
Differential Revision: https://reviews.llvm.org/D55085
llvm-svn: 348513
Adrian Prantl [Thu, 6 Dec 2018 18:44:48 +0000 (18:44 +0000)]
Reapply "Adapt gcov to changes in CFE."
This reverts commit r348203 and reapplies D55085 with an additional
GCOV bugfix to make the change NFC for relative file paths in .gcno files.
Thanks to Ilya Biryukov for additional testing!
Original commit message:
Update Diagnostic handling for changes in CFE.
The clang frontend no longer emits the current working directory for
DIFiles containing an absolute path in the filename: and will move the
common prefix between current working directory and the file into the
directory: component.
https://reviews.llvm.org/D55085
llvm-svn: 348512
Zachary Turner [Thu, 6 Dec 2018 18:39:58 +0000 (18:39 +0000)]
[build.py] Embed the output file name in generated object file names.
In compile-and-link mode, the user doesn't specify the name of the
object files to generate, because there could be multiple inputs
on a single command line and this would be hard to specify. So the
script just tries to be smart and figure out the best object file
names. However, if two build scripts are running in parallel and
using the same source files as input, they would previously race
to write the same object files, since the computed name only considered
the source file names when computing the object file names.
With this patch, we also consider the final executable name. In a
way, this "namespaces" the generated object files so that as long
as the final executable file names don't clash, the intermediate
object file names won't clash either.
llvm-svn: 348511
Evandro Menezes [Thu, 6 Dec 2018 18:25:37 +0000 (18:25 +0000)]
[AArch64] Fix Exynos predicate
Fix predicate for arithmetic instructions with shift and/or extend.
llvm-svn: 348510
Louis Dionne [Thu, 6 Dec 2018 18:24:39 +0000 (18:24 +0000)]
[libcxx] Add checks for unique value of array<T, 0>.begin() and array<T, 0>.end()
The standard section [array.zero] requires the return value of begin()
and end() methods of a zero-sized array to be unique. Eric Fiselier
clarifies: "That unique value cannot be null, and must be properly aligned".
This patch adds checks for the first part of this clarification: unique
value returned by these methods cannot be null.
Reviewed as https://reviews.llvm.org/D55366.
Thanks to Andrey Maksimov for the patch.
llvm-svn: 348509
Sanjay Patel [Thu, 6 Dec 2018 18:16:32 +0000 (18:16 +0000)]
[DAGCombiner] don't hoist logic op if operands have other uses
The AVX512 diffs are neutral, but the bswap test shows a clear overreach in
hoistLogicOpWithSameOpcodeHands(). If we don't check for other uses, we can
increase the instruction count.
This could also fight with transforms trying to go in the opposite direction
and possibly blow up/infinite loop. This might be enough to solve the bug
noted here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20181203/608593.html
I did not add the hasOneUse() checks to all opcodes because I see a perf
regression for at least one opcode. We may decide that's irrelevant in the
face of potential compiler crashing, but I'll see if I can salvage that first.
llvm-svn: 348508
Louis Dionne [Thu, 6 Dec 2018 18:06:47 +0000 (18:06 +0000)]
[libcxx] Add XFAILs for aligned allocation tests on AppleClang 9
Some people are still running the test suite using AppleClang 9.
llvm-svn: 348507
Sanjay Patel [Thu, 6 Dec 2018 18:06:10 +0000 (18:06 +0000)]
[x86] add test for hoistLogicOpWithSameOpcodeHands with extra uses; NFC
llvm-svn: 348506
Zachary Turner [Thu, 6 Dec 2018 17:49:15 +0000 (17:49 +0000)]
[PDB] Move some code around. NFC.
llvm-svn: 348505
Joel E. Denny [Thu, 6 Dec 2018 17:46:17 +0000 (17:46 +0000)]
[CUDA] Fix nvidia-cuda-toolkit detection on Ubuntu
This just extends D40453 (r319317) to Ubuntu.
Reviewed By: Hahnfeld, tra
Differential Revision: https://reviews.llvm.org/D55269
llvm-svn: 348504
Nico Weber [Thu, 6 Dec 2018 17:42:35 +0000 (17:42 +0000)]
[gn build] Process .def.in files in llvm/Config and add lib/Target/BUILD.gn
Tweak write_cmake_config.py to also handle variable references looking @FOO@
(matching CMake's configure_file() function), and make it replace '\' 'n' in
values with a newline literal since there's no good portable way of passing a
real newline literal on a command line.
Use that to process all the .def.in files in llvm/include/Config and add
llvm/lib/Target/BUILD.gn, which (indirectly, through llvm-c/Target.h) includes
them.
Differential Revision: https://reviews.llvm.org/D55184
llvm-svn: 348503
Adrian Prantl [Thu, 6 Dec 2018 17:11:45 +0000 (17:11 +0000)]
Add another ArchSpec unit test.
llvm-svn: 348502
Sanjay Patel [Thu, 6 Dec 2018 17:08:03 +0000 (17:08 +0000)]
[DAGCombiner] refactor function that hoists bitwise logic; NFCI
Added FIXME and TODO comments for lack of safety checks.
This function is a suspect in out-of-memory errors as discussed in
the follow-up thread to r347917:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-
20181203/608593.html
llvm-svn: 348501
David Carlier [Thu, 6 Dec 2018 17:04:18 +0000 (17:04 +0000)]
[Sanitizer] getmntinfo support in FreeBSD
Reviewers: krytarowski
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D55354
llvm-svn: 348500
Zachary Turner [Thu, 6 Dec 2018 16:55:00 +0000 (16:55 +0000)]
Support skewed stream arrays.
VarStreamArray was built on the assumption that it is backed by a
StreamRef, and offset 0 of that StreamRef is the first byte of the first
record in the array.
This is a logical and intuitive assumption, but unfortunately we have
use cases where it doesn't hold. Specifically, a PDB module's symbol
stream is prefixed by 4 bytes containing a magic value, and the first
byte of record data in the array is actually at offset 4 of this byte
sequence.
Previously, we would just truncate the first 4 bytes and then construct
the VarStreamArray with the resulting StreamRef, so that offset 0 of the
underlying stream did correspond to the first byte of the first record,
but this is problematic, because symbol records reference other symbol
records by the absolute offset including that initial magic 4 bytes. So
if another record wants to refer to the first record in the array, it
would say "the record at offset 4".
This led to extremely confusing hacks and semantics in loading code, and
after spending 30 minutes trying to get some math right and failing, I
decided to fix this in the underlying implementation of VarStreamArray.
Now, we can say that a stream is skewed by a particular amount. This
way, when we access a record by absolute offset, we can use the same
values that the records themselves contain, instead of having to do
fixups.
Differential Revision: https://reviews.llvm.org/D55344
llvm-svn: 348499
Simon Pilgrim [Thu, 6 Dec 2018 16:29:14 +0000 (16:29 +0000)]
[X86] Refactored IsSplatVector to use switch. NFCI.
Initial step towards making the function more generic (and probably move into SelectionDAG).
This is necessary to avoid massive codegen bloat for PR38243 (Add modulo rotate support to LowerRotate).
llvm-svn: 348498
Alexey Bataev [Thu, 6 Dec 2018 16:25:35 +0000 (16:25 +0000)]
[DEBUGINFO, NVPTX] Disable emission of ',debug' option if only debug directives are allowed.
Summary:
If the output of debug directives only is requested, we should drop
emission of ',debug' option from the target directive. Required for
supporting of nvprof profiler.
Reviewers: echristo
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D46061
llvm-svn: 348497
Alexandros Lamprineas [Thu, 6 Dec 2018 16:11:58 +0000 (16:11 +0000)]
[GVN] Don't perform scalar PRE on GEPs
Partial Redundancy Elimination of GEPs prevents CodeGenPrepare from
sinking the addressing mode computation of memory instructions back
to its uses. The problem comes from the insertion of PHIs, which
confuse CGP and make it bail.
I've autogenerated the check lines of an existing test and added a
store instruction to demonstrate the motivation behind this change.
The store is now using the gep instead of a phi.
Differential Revision: https://reviews.llvm.org/D55009
llvm-svn: 348496
Alexey Bataev [Thu, 6 Dec 2018 16:02:09 +0000 (16:02 +0000)]
[DEBUGINFO, NVPTX]Emit last debugging directives.
Summary:
We may end up with not emitted debug directives at the end of the module
emission. Patch fixes this problem emitting those last directives the
end of the module emission.
Reviewers: echristo
Subscribers: jholewinski, llvm-commits
Differential Revision: https://reviews.llvm.org/D54320
llvm-svn: 348495
Simon Pilgrim [Thu, 6 Dec 2018 15:39:25 +0000 (15:39 +0000)]
DAGCombiner::visitINSERT_VECTOR_ELT - pull out repeated VT.getVectorNumElements(). NFCI.
llvm-svn: 348494
Diogo N. Sampaio [Thu, 6 Dec 2018 15:39:17 +0000 (15:39 +0000)]
[NFC][AArch64] Split out backend features
This patch splits backend features currently
hidden behind architecture versions.
For example, currently the only way to activate
complex numbers extension is targeting an v8.3
architecture, where after the patch this extension
can be added separately.
This refactoring is required by the new command lines proposal:
http://lists.llvm.org/pipermail/llvm-dev/2018-September/126346.html
Reviewers: DavidSpickett, olista01, t.p.northover
Subscribers: kristof.beyls, bryanpkc, javed.absar, pbarrio
Differential revision: https://reviews.llvm.org/D54633
--
It was reverted in rL348249 due a build bot failure in one of the
regression tests:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14386
The problem seems to be that FileCheck behaves
different in windows and linux. This new patch
splits the test file in multiple,
and does more exact pattern matching attempting
to circumvent the issue.
llvm-svn: 348493
Alexey Bataev [Thu, 6 Dec 2018 15:35:13 +0000 (15:35 +0000)]
[OPENMP][NVPTX] Fix globalization of the mapped array sections.
If the array section is based on pointer and this sections is mapped in
target region + then it is used in the inner parallel region, it also
must be globalized as the pointer itself is passed by value, not by
reference.
llvm-svn: 348492
Alexey Bataev [Thu, 6 Dec 2018 15:27:58 +0000 (15:27 +0000)]
[OPENMP][NVPTX]Fix __kmpc_flush to flush the memory per system, not per block.
Summary:
According to the standard, after memory flushing the changes in the
memory must be visible to all the threads in all teams. Patch fixes
this.
Reviewers: gtbercea, kkwli0
Subscribers: guansong, jfb, caomhin, openmp-commits
Differential Revision: https://reviews.llvm.org/D55370
llvm-svn: 348491
Ilya Biryukov [Thu, 6 Dec 2018 15:14:11 +0000 (15:14 +0000)]
[clangd] Remove the test that sometimes deadlocks
Will figure out how to properly rewrite it and recommit.
llvm-svn: 348490
Sam Parker [Thu, 6 Dec 2018 15:13:44 +0000 (15:13 +0000)]
[ARM][NFC] Adding another test for armcgp
llvm-svn: 348489
Nicolai Haehnle [Thu, 6 Dec 2018 14:33:40 +0000 (14:33 +0000)]
AMDGPU: Generate VALU ThreeOp Integer instructions
Summary:
Original patch by: Fabian Wahlster <razor@singul4rity.com>
Change-Id: I148f692a88432541fad468963f58da9ddf79fac5
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, b-sumner, llvm-commits
Differential Revision: https://reviews.llvm.org/D51995
llvm-svn: 348488
Valery Pykhtin [Thu, 6 Dec 2018 14:20:02 +0000 (14:20 +0000)]
[AMDGPU] Partial revert of rL348371: Turn on the DPP combiner by default
Turn the combiner back off as there're failures until the issue is fixed.
Differential revision: https://reviews.llvm.org/D55314
llvm-svn: 348487
Simon Pilgrim [Thu, 6 Dec 2018 14:02:02 +0000 (14:02 +0000)]
Fix -Wcovered-switch-default warning. NFCI.
llvm-svn: 348486
Louis Dionne [Thu, 6 Dec 2018 13:52:20 +0000 (13:52 +0000)]
[libcxx] Make return value of array<T, 0>.data() checked only for libc++
The section array.zero says: "The return value of data() is unspecified".
This patch marks all checks of the array<T, 0>.data() return value as
libc++ specific.
Reviewed as https://reviews.llvm.org/D55364.
Thanks to Andrey Maksimov for the patch.
llvm-svn: 348485