Craig Topper [Sun, 24 Apr 2016 04:38:34 +0000 (04:38 +0000)]
[X86] Remove isel patterns for selecting tzcnt/lzcnt from cmove/ne+cttz/ctlz. These are folded by DAG combine now.
llvm-svn: 267326
Craig Topper [Sun, 24 Apr 2016 04:38:32 +0000 (04:38 +0000)]
[CodeGen] Teach DAG combine to fold select_cc seteq X, 0, sizeof(X), ctlz_zero_undef(X) -> ctlz(X). InstCombine already does this for IR and X86 pattern matches this during isel.
A follow up commit will remove the X86 patterns to allow this to be tested.
llvm-svn: 267325
Craig Topper [Sun, 24 Apr 2016 04:38:29 +0000 (04:38 +0000)]
Fix an assertion that can never fire because the condition ANDed with the string is just true or 1.
llvm-svn: 267324
Peter Collingbourne [Sun, 24 Apr 2016 04:29:59 +0000 (04:29 +0000)]
ELF: Simplify preemption logic. Do not include weak undefined symbols in non-DSOs.
Add a test for -Bsymbolic + undefined symbols.
llvm-svn: 267323
Adrian Prantl [Sun, 24 Apr 2016 03:47:37 +0000 (03:47 +0000)]
Revert "Verifier: Verify that each inlinable callsite of a debug-info-bearing function"
This reverts commit r267320 while investigating an OpenMP buildbot failure.
llvm-svn: 267322
Mehdi Amini [Sun, 24 Apr 2016 03:44:55 +0000 (03:44 +0000)]
Make thinlto clang test more robust against LLVM changes.
We should just test the effect of the clang level option here, i.e.
that a summary is correctly emitted with -flto=thin
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267321
Adrian Prantl [Sun, 24 Apr 2016 03:23:02 +0000 (03:23 +0000)]
Verifier: Verify that each inlinable callsite of a debug-info-bearing function
in a debug-info-bearing function has a debug location attached to it. Failure to
do so causes an "!dbg attachment points at wrong subprogram for function"
assertion failure when the inliner sets up inline scope info.
rdar://problem/
25878916
llvm-svn: 267320
Mehdi Amini [Sun, 24 Apr 2016 03:18:18 +0000 (03:18 +0000)]
Reorganize GlobalValueSummary with a "Flags" bitfield.
Right now it only contains the LinkageType, but will be extended
with "hasSection", "isOptSize", "hasInlineAssembly", etc.
Differential Revision: http://reviews.llvm.org/D19404
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267319
Mehdi Amini [Sun, 24 Apr 2016 03:18:11 +0000 (03:18 +0000)]
Add a version field in the bitcode for the summary
Differential Revision: http://reviews.llvm.org/D19456
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267318
Mehdi Amini [Sun, 24 Apr 2016 03:18:01 +0000 (03:18 +0000)]
Add an internalization step to the ThinLTOCodeGenerator
Keeping as much as possible internal/private is
known to help the optimizer. Let's try to benefit from
this in ThinLTO.
Note: this is early work, but is enough to build clang (and
all the LLVM tools). I still need to write some lit-tests...
Differential Revision: http://reviews.llvm.org/D19103
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267317
Peter Collingbourne [Sun, 24 Apr 2016 02:42:34 +0000 (02:42 +0000)]
Test what I intended to test.
llvm-svn: 267316
Peter Collingbourne [Sun, 24 Apr 2016 02:31:04 +0000 (02:31 +0000)]
ELF: Forbid undefined symbols with non-default visibility in DSOs.
llvm-svn: 267315
Peter Collingbourne [Sun, 24 Apr 2016 02:31:02 +0000 (02:31 +0000)]
ELF: Always include undefined DSO symbols in the symbol table.
Fixes check-llvm when bootstrapping.
Also remove mostly dead and most likely incorrect logic regarding preemption
of weak undefined symbols.
llvm-svn: 267314
Craig Topper [Sun, 24 Apr 2016 02:08:22 +0000 (02:08 +0000)]
Fix a couple assertions that can never fire because the condition ANDed with the string is just true or 1.
llvm-svn: 267313
Craig Topper [Sun, 24 Apr 2016 02:01:25 +0000 (02:01 +0000)]
Fix a couple assertions that can never fire because they just contained the text string which always evaluates to true. Add a ! so they'll evaluate to false.
llvm-svn: 267312
Craig Topper [Sun, 24 Apr 2016 02:01:22 +0000 (02:01 +0000)]
[X86] Fix patterns that turn cmove/cmovne+ctlz/cttz into lzcnt/tzcnt instructions. Only one of the conditions should be valid for each pattern, not both. Update tests accordingly.
llvm-svn: 267311
Davide Italiano [Sun, 24 Apr 2016 01:56:02 +0000 (01:56 +0000)]
[ELF] Use llvm-mc rather than checking in a file.
Now that the support for the 'new' relocations is available.
llvm-svn: 267310
Davide Italiano [Sun, 24 Apr 2016 01:36:37 +0000 (01:36 +0000)]
[RuntimeDyldELF] Handle GOTPCRELX/REX_GOTPCRELX.
llvm-svn: 267309
Davide Italiano [Sun, 24 Apr 2016 01:08:35 +0000 (01:08 +0000)]
[MC/ELF] Make the relaxation test more interesting.
Add a case where we can't relax.
llvm-svn: 267308
Davide Italiano [Sun, 24 Apr 2016 01:03:57 +0000 (01:03 +0000)]
[MC/ELF] Implement support for GOTPCRELX/REX_GOTPCRELX.
The option to control the emission of the new relocations
is -relax-relocations (blatantly copied from GNU as).
It can't be enabled by default because it breaks relatively
recent versions of ld.bfd/ld.gold (late 2015).
llvm-svn: 267307
Mehdi Amini [Sun, 24 Apr 2016 00:25:15 +0000 (00:25 +0000)]
Relax test using CHECK-DAG instead of CHECK-NEXT
It seems we still have some ordering issue in the combined index
emission, but I can't figure out why right now.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267306
Mehdi Amini [Sun, 24 Apr 2016 00:03:57 +0000 (00:03 +0000)]
Fix test stability (was sensitive to the path)
This is a fixup for r267304.
The test was sensitive to the path in a subtle way:
the index in memory is sorted by GUID, which are hashes
that include the source filename for local globals.
Teresa recently added a directive at the IR level, so
we can specify it here to make the test independent of
the path.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267305
Mehdi Amini [Sat, 23 Apr 2016 23:38:17 +0000 (23:38 +0000)]
Store and emit original name in combined index
Summary:
As discussed in D18298, some local globals can't
be renamed/promoted (because they have a section, or because
they are referenced from inline assembly).
To be able to detect naming collision, we need to keep around
the "GUID" using their original name without taking the linkage
into account.
Reviewers: tejohnson
Subscribers: joker.eph, llvm-commits
Differential Revision: http://reviews.llvm.org/D19454
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267304
Mehdi Amini [Sat, 23 Apr 2016 23:29:24 +0000 (23:29 +0000)]
Always traverse GlobalVariable initializer when computing the export list
Summary:
We are always importing the initializer for a GlobalVariable.
So if a GlobalVariable is in the export-list, we pull in any
refs as well.
Reviewers: tejohnson
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19102
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267303
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 22:29:26 +0000 (22:29 +0000)]
DebugInfo: DIGlobalVariables became 'distinct' in LLVM r267301
Update testcases due to DIBuilder change.
llvm-svn: 267302
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 22:29:09 +0000 (22:29 +0000)]
DebugInfo: Change DIBuilder to make distinct DIGlobalVariables
A long overdue change to make DIGlobalVariable distinct. Much like
DISubprogram definitions (changed in r246098), it isn't logical to
unique DIGlobalVariable definitions from two different compile units.
(Longer-term, we should also find a way to reverse the link between
GlobalVariable and DIGlobalVariable, and between DIGlobalVariable and
DICompileUnit, so that debug info to do with optimized-out globals
disappears. Admittedly it's harder than with Function/DISubprogram,
since global variables may be constant-folded and the debug info should
still describe that somehow.)
llvm-svn: 267301
Davide Italiano [Sat, 23 Apr 2016 22:26:31 +0000 (22:26 +0000)]
[MC/ELF] Pass Fixup to getRelocType64.
In preparation for other changes.
llvm-svn: 267300
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:36:59 +0000 (21:36 +0000)]
BitcodeReader: Avoid std::vector with non-movable types from r267296
r267298 didn't quite fix the build errors. Use SmallVector instead of
std::vector, the latter of which I think is trying to maintain a strong
exception safety guarantee.
http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/6228
llvm-svn: 267299
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:23:41 +0000 (21:23 +0000)]
BitcodeReader: Avoid non-moving std::piecewise_construct from r267296
Not exactly sure why the host tries to use a copy constructor here, but
it's easy enough to work around it.
http://lab.llvm.org:8011/builders/lldb-amd64-ninja-freebsd11/builds/6227
llvm-svn: 267298
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:08:27 +0000 (21:08 +0000)]
DebugInfo: Adapt to loss of DITypeRef in LLVM r267296
LLVM stopped using MDString-based type references, and DIBuilder no
longer fills 'retainedTypes:' with every DICompositeType that has an
'identifier:' field. There are just minor changes to keep the same
behaviour in CFE.
Leaving 'retainedTypes:' unfilled has a dramatic impact on the output
order of the IR though. There are a huge number of testcase changes,
which were unfortunately not really scriptable.
llvm-svn: 267297
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 21:08:00 +0000 (21:08 +0000)]
DebugInfo: Remove MDString-based type references
Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around
DIType*. It is no longer legal to refer to a DICompositeType by its
'identifier:', and DIBuilder no longer retains all types with an
'identifier:' automatically.
Aside from the bitcode upgrade, this is mainly removing logic to resolve
an MDString-based reference to an actualy DIType. The commits leading
up to this have made the implicit type map in DICompileUnit's
'retainedTypes:' field superfluous.
This does not remove DITypeRef, DIScopeRef, DINodeRef, and
DITypeRefArray, or stop using them in DI-related metadata. Although as
of this commit they aren't serving a useful purpose, there are patchces
under review to reuse them for CodeView support.
The tests in LLVM were updated with deref-typerefs.sh, which is attached
to the thread "[RFC] Lazy-loading of debug info metadata":
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html
llvm-svn: 267296
Sanjay Patel [Sat, 23 Apr 2016 20:01:22 +0000 (20:01 +0000)]
replace duplicated static functions for profile metadata access with BranchInst member function; NFCI
llvm-svn: 267295
Renato Golin [Sat, 23 Apr 2016 19:30:52 +0000 (19:30 +0000)]
Revert "[AArch64] Fix optimizeCondBranch logic."
This reverts commit r267206, as it broke self-hosting on AArch64.
llvm-svn: 267294
Derek Bruening [Sat, 23 Apr 2016 16:41:24 +0000 (16:41 +0000)]
[esan] EfficiencySanitizer libc interceptors
Summary:
Adds libc interceptors to the runtime library for the new
EfficiencySanitizer ("esan") family of tools. The interceptors cover
the memory operations in most common library calls and will be shared
among all esan tools.
Reviewers: aizatsky
Subscribers: zhaoqin, tberghammer, danalbert, srhines, llvm-commits, vitalybuka, eugenis, kcc
Differential Revision: http://reviews.llvm.org/D19411
llvm-svn: 267293
Sanjay Patel [Sat, 23 Apr 2016 16:31:48 +0000 (16:31 +0000)]
improve documentation comments; NFC
llvm-svn: 267292
Saleem Abdulrasool [Sat, 23 Apr 2016 16:00:15 +0000 (16:00 +0000)]
ObjectFile: parse EABI Attributes
This adds basic parsing of the EABI attributes section. This section contains
additional information about the target for which the file was built. Attempt
to infer additional architecture information from that section.
llvm-svn: 267291
NAKAMURA Takumi [Sat, 23 Apr 2016 14:54:28 +0000 (14:54 +0000)]
clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp: Use raw_string_ostream::str() to flush the buffer explicitly.
llvm-svn: 267290
Johannes Doerfert [Sat, 23 Apr 2016 14:32:34 +0000 (14:32 +0000)]
Add an invalid domain to memory accesses
Memory accesses can have non-precisely modeled access functions that
would cause us to build incorrect execution context for hoisted loads.
This is the same issue that occurred during the domain construction for
statements and it is dealt with the same way.
llvm-svn: 267289
Johannes Doerfert [Sat, 23 Apr 2016 14:31:17 +0000 (14:31 +0000)]
Translate SCEVs to isl_pw_aff and their invalid domain
The SCEVAffinator will now produce not only the isl representaiton of
a SCEV but also the domain under which it is invalid. This is used to
record possible overflows that can happen in the statement domains in
the statements invalid domain. The result is that invalid loads have
an accurate execution contexts with regards to the validity of their
statements domain. While the SCEVAffinator currently is only taking
"no-wrapping" assumptions, we can add more withouth worrying about the
execution context of loads that are optimistically hoisted.
llvm-svn: 267288
Marshall Clow [Sat, 23 Apr 2016 14:31:00 +0000 (14:31 +0000)]
Rename a few tests that had typos in their names. No functional change. Thanks to STL for the catch
llvm-svn: 267287
Johannes Doerfert [Sat, 23 Apr 2016 13:02:23 +0000 (13:02 +0000)]
Track invalid domains not invalid contexts for statements
The invalid context is not enough to describe the parameter constraints under
which a statement is not modeled precisely. The reason is that during the
domain construction the bounds on the induction variables are not known but
needed to check if e.g., an overflow can actually happen. To this end we
replace the invalid context of a statement with an invalid domain. It is
initialized during domain construction and intersected with the domain once
it was completely build. Later this invalid domain allows to eliminate
falsely assumed wrapping cases and other falsely assumed mismatches in the
modeling.
llvm-svn: 267286
Johannes Doerfert [Sat, 23 Apr 2016 13:00:27 +0000 (13:00 +0000)]
Improve accuracy of Scop::hasFeasibleRuntimeContext
If the AssumptionContext is a subset of the InvalidContext the runtime
context is not feasible.
llvm-svn: 267285
Johannes Doerfert [Sat, 23 Apr 2016 12:59:18 +0000 (12:59 +0000)]
Simplify the execution context for dereferencable loads
If we know it is safe to execute a load we do not need an execution
context, however only if we are sure it was modeled correctly.
llvm-svn: 267284
Johannes Doerfert [Sat, 23 Apr 2016 12:56:58 +0000 (12:56 +0000)]
Remove simplification calls for the execution domain [NFC]
These calls were sometimes costly and do not show any improvements on our
small test cases.
llvm-svn: 267283
Simon Pilgrim [Sat, 23 Apr 2016 11:14:18 +0000 (11:14 +0000)]
[X86][XOP] Added VPPERM -> BLEND-WITH-ZERO Test
Currently failing due to poor blend matching, found whilst investigating PR27472
llvm-svn: 267282
Benjamin Kramer [Sat, 23 Apr 2016 11:01:36 +0000 (11:01 +0000)]
Use %T instead of cd'ing to Output directly.
%T expands to Output if not configured differently.
llvm-svn: 267281
Craig Topper [Sat, 23 Apr 2016 05:20:47 +0000 (05:20 +0000)]
[CodeGen] When promoting CTTZ operations to larger type, don't insert a select to detect if the input is zero to return the original size instead of the extended size. Instead just set the first bit in the zero extended part.
llvm-svn: 267280
Teresa Johnson [Sat, 23 Apr 2016 05:15:59 +0000 (05:15 +0000)]
[gold] Gate value name discarding under save-temps
Summary:
This removes a couple of flags added to control this behavior, and
simply keeps all value names when save-temps is specified.
Reviewers: rafael
Subscribers: llvm-commits, pcc, davide
Differential Revision: http://reviews.llvm.org/D19384
llvm-svn: 267279
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:59:22 +0000 (04:59 +0000)]
BitcodeWriter: Emit uniqued subgraphs after all distinct nodes
Since forward references for uniqued node operands are expensive (and
those for distinct node operands are cheap due to
DistinctMDOperandPlaceholder), minimize forward references in uniqued
node operands.
Moreover, guarantee that when a cycle is broken by a distinct node, none
of the uniqued nodes have any forward references. In
ValueEnumerator::EnumerateMetadata, enumerate uniqued node subgraphs
first, delaying distinct nodes until all uniqued nodes have been
handled. This guarantees that uniqued nodes only have forward
references when there is a uniquing cycle (since r267276 changed
ValueEnumerator::organizeMetadata to partition distinct nodes in front
of uniqued nodes as a post-pass).
Note that a single uniqued subgraph can hit multiple distinct nodes at
its leaves. Ideally these would themselves be emitted in post-order,
but this commit doesn't attempt that; I think it requires an extra pass
through the edges, which I'm not convinced is worth it (since
DistinctMDOperandPlaceholder makes forward references quite cheap
between distinct nodes).
I've added two testcases:
- test/Bitcode/mdnodes-distinct-in-post-order.ll is just like
test/Bitcode/mdnodes-in-post-order.ll, except with distinct nodes
instead of uniqued ones. This confirms that, in the absence of
uniqued nodes, distinct nodes are still emitted in post-order.
- test/Bitcode/mdnodes-distinct-nodes-break-cycles.ll is the minimal
example where a naive post-order traversal would cause one uniqued
node to forward-reference another. IOW, it's the motivating test.
llvm-svn: 267278
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:52:47 +0000 (04:52 +0000)]
Avoid MSVC failure with default arguments in lambdas from r267270
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/11700
llvm-svn: 267277
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:42:39 +0000 (04:42 +0000)]
BitcodeWriter: Emit distinct nodes before uniqued nodes
When an operand of a distinct node hasn't been read yet, the reader can
use a DistinctMDOperandPlaceholder. This is much cheaper than forward
referencing from a uniqued node. Change
ValueEnumerator::organizeMetadata to partition distinct nodes and
uniqued nodes to reduce the overhead of cycles broken by distinct nodes.
Mehdi measured this for me; this removes most of the RAUW from the
importing step of -flto=thin, even after a WIP patch that removes
string-based DITypeRefs (introducing many more cycles to the metadata
graph).
llvm-svn: 267276
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:34:11 +0000 (04:34 +0000)]
Add #ifndef NDEBUG markers around EXPECT_DEATH after r267270
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/36076
llvm-svn: 267275
Teresa Johnson [Sat, 23 Apr 2016 04:31:20 +0000 (04:31 +0000)]
Address comments.
llvm-svn: 267274
Teresa Johnson [Sat, 23 Apr 2016 04:30:47 +0000 (04:30 +0000)]
Refactor bitcode writer into classes (NFC)
Summary:
As discussed in on the mailing list yesterday, I have refactored
BitcodeWriter.cpp to use classes to manage the bitcode writing process,
instead of passing around long lists of parameters between static
functions. See:
http://lists.llvm.org/pipermail/llvm-dev/2016-April/098610.html
I created a parent BitcodeWriter class to own the BitstreamWriter,
write the header, and contain the main entry point into the writing
process. There are two derived classes, one for writing a module and one
for writing a combined index file (for ThinLTO), which manage the
writing process specific to those bitcode file types.
I also changed the functions to conform to LLVM coding standards
(lowercase function name first letter). The only two routines that still
start with an uppercase letter are the two external interfaces, which
can be fixed as a follow-on (I wanted to keep this round just within
BitcodeWriter.cpp).
Reviewers: dexonsmith, joker.eph
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19447
llvm-svn: 267273
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:23:57 +0000 (04:23 +0000)]
Avoid ternery statement to please g++ after r267270, NFC
http://bb.pgr.jp/builders/cmake-llvm-x86_64-linux/builds/36074
llvm-svn: 267272
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:22:38 +0000 (04:22 +0000)]
ValueEnumerator: Use std::find_if, NFC
Mehdi's pattern recognition pulled this one out. This is cleaner with
std::find_if than with the strange helper function that took an iterator
by reference and updated it.
llvm-svn: 267271
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:15:56 +0000 (04:15 +0000)]
BitcodeReader: Avoid referencing unresolved nodes from distinct ones
Each reference to an unresolved MDNode is expensive, since the RAUW
support in MDNode uses a separate allocation and side map. Since
a distinct MDNode doesn't require its operands on creation (unlike
uniuqed nodes, there's no need to check for structural equivalence),
use nullptr for any of its unresolved operands. Besides reducing the
burden on MDNode maps, this can avoid allocating temporary MDNodes in
the first place.
We need some way to track operands. Invent DistinctMDOperandPlaceholder
for this purpose, which is a Metadata subclass that holds an ID and
points at its single user. DistinctMDOperandPlaceholder::replaceUseWith
is just like RAUW, but its name highlights that there is only ever
exactly one use.
There is no support for moving (or, obviously, copying) these. Move
support would be possible but expensive; leaving it unimplemented
prevents user error. In the BitcodeReader I originally considered
allocating on a BumpPtrAllocator and keeping a vector of pointers to
them, and then I realized that std::deque implements exactly this.
A couple of obvious follow-ups:
- Change ValueEnumerator to emit distinct nodes first to take more
advantage of this optimization. (How convenient... I think I might
have a couple of patches for this.)
- Change DIBuilder and its consumers (like CGDebugInfo in clang) to
use something like this when constructing debug info in the first
place.
llvm-svn: 267270
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:02:39 +0000 (04:02 +0000)]
Tag the end of an anonymous namespace, NFC
Prevent clang-format from moving the closing branch.
llvm-svn: 267269
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 04:01:57 +0000 (04:01 +0000)]
BitcodeReader: Consistently use IsDistinct, NFC
Consistently use the IsDistinct variable and start relying on it in
GET_OR_DISTINCT. This change has NFC, but prepares for using IsDistinct
to optimize the behaviour of the getMD() and getMDOrNull() helpers.
llvm-svn: 267268
Duncan P. N. Exon Smith [Sat, 23 Apr 2016 03:55:14 +0000 (03:55 +0000)]
BitcodeReader: Use getMD/getMDOrNull helpers consistently, almost NFC
The only functionality change was removing an error check from the
BitcodeReader (and an assertion from DILocation::getImpl) that is
already caught by Verifier::visitDILocation. The Verifier is a better
place for this anyway, and being inconsistent with other subclasses of
MDNode isn't serving anyone.
llvm-svn: 267267
Craig Topper [Sat, 23 Apr 2016 02:49:31 +0000 (02:49 +0000)]
[Hexagon] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will convert them to ctlz/cttz. Remove the now unneccessary isel patterns. NFC
llvm-svn: 267266
Craig Topper [Sat, 23 Apr 2016 02:49:29 +0000 (02:49 +0000)]
[NVPTX] Set ctlz_zero_undef to Expand so LegalizeDAG will convert it to ctlz. Remove the now unneccessary isel patterns. NFC
llvm-svn: 267265
Craig Topper [Sat, 23 Apr 2016 02:49:25 +0000 (02:49 +0000)]
[WebAssembly] Set ctlz_zero_undef/cttz_zero_undef to Expand so LegalizeDAG will convert them to ctlz/cttz. Remove the now unneccessary isel patterns. NFC
llvm-svn: 267264
Sean Silva [Sat, 23 Apr 2016 02:13:48 +0000 (02:13 +0000)]
[profile] Fix another use of the driver.
Follow-on to r267262.
llvm-svn: 267263
Sean Silva [Sat, 23 Apr 2016 02:11:16 +0000 (02:11 +0000)]
[profile] Use cc1 in these tests instead of the driver.
I ran into this when seeing what tests would break if we make a
driver-level decision about whether FEPGO or IRPGO is the default.
llvm-svn: 267262
Rui Ueyama [Sat, 23 Apr 2016 01:10:15 +0000 (01:10 +0000)]
Add a file comment about the Ulrich's document and don't repeat it in other comments.
llvm-svn: 267261
Rui Ueyama [Sat, 23 Apr 2016 01:10:13 +0000 (01:10 +0000)]
Add more comment.
llvm-svn: 267260
Rui Ueyama [Sat, 23 Apr 2016 00:26:32 +0000 (00:26 +0000)]
Add comments.
llvm-svn: 267259
Amaury Sechet [Sat, 23 Apr 2016 00:12:45 +0000 (00:12 +0000)]
Style fix in Core.h / Core.cpp. NFC
llvm-svn: 267257
Kostya Serebryany [Sat, 23 Apr 2016 00:05:24 +0000 (00:05 +0000)]
[sanitizer] add a function MmapNoAccess that mmaps a protected region *somewhere*; use MmapNoAccess in the Allocator when SpaceBeg is not a constant. In this mode the allocator will be a bit more hardened
llvm-svn: 267256
Rui Ueyama [Sat, 23 Apr 2016 00:04:03 +0000 (00:04 +0000)]
Use ScriptParserBase features to parse linker script expressions.
Previously, we have re-implemented utility functions such as `expect`
or `next` in LinkerScript.cpp. This patch reuses the existing
implementation that is in ScriptParser.cpp.
llvm-svn: 267255
Alexander Kornienko [Sat, 23 Apr 2016 00:00:08 +0000 (00:00 +0000)]
[clang-tidy] Fix misc-macro-repeated-side-effects false positive with stringified arguments
llvm-svn: 267254
Kostya Serebryany [Fri, 22 Apr 2016 23:46:53 +0000 (23:46 +0000)]
[sanitizer] rename MmapNoAccess to MmapFixedNoAccess; NFC
llvm-svn: 267253
Kostya Serebryany [Fri, 22 Apr 2016 23:35:00 +0000 (23:35 +0000)]
[sanitizer] partially un-revert r267094: Allow the sanitizer allocator to use a non-fixed address range. An allocator with a non-fixed address range will be attack-resistan. NFC for the sanitizers at this point.
llvm-svn: 267252
Kostya Serebryany [Fri, 22 Apr 2016 23:27:15 +0000 (23:27 +0000)]
[sanitizer] revert r267203 as it breaks aarch64 bots
llvm-svn: 267251
Tim Northover [Fri, 22 Apr 2016 23:23:31 +0000 (23:23 +0000)]
llvm-objdump: deal with invalid ARM encodings slightly better.
Before we printed a warning to stderr and left the actual output stream in a
mess. This tries to print a .long or .short representation of what we saw (as
if there was a data-in-code directive).
This isn't guaranteed to restore synchronization in Thumb-mode (if the invalid
instruction was supposed to be 32-bits, we may be off-by-16 for the rest of the
function). But there's no certain way to deal with that, and it's invalid code
anyway (if the data really wasn't an instruction, the user can add proper
.data_in_code directives if they care)
llvm-svn: 267250
Tim Northover [Fri, 22 Apr 2016 23:21:13 +0000 (23:21 +0000)]
MachO: remove weird ARM/Thumb interface from MachOObjectFile
Only one consumer (llvm-objdump) actually cared about the fact that there were
two triples. Others were actively working around the fact that the Triple
returned by getArch might have been invalid. As for llvm-objdump, it needs to
be acutely aware of both Triples anyway, so being generic in the exposed API is
no benefit.
Also rename the version of getArch returning a Triple. Users were having to
pass an unwanted nullptr to disambiguate the two, which was nasty.
The only functional change here is that armv7m and armv7em object files no
longer crash llvm-objdump.
llvm-svn: 267249
Greg Clayton [Fri, 22 Apr 2016 23:14:35 +0000 (23:14 +0000)]
DWARF layout for bitfields is wrong when the bit offset is negative.
Some older versions of clang emitted bit offsets that were negative and these bitfields would have their bitfield-ness stripped off and it would cause a clang assertion in clang assertions were enabled. I updated the bitfield C test to make sure we don't regress.
<rdar://problem/
21082998>
llvm-svn: 267248
Saleem Abdulrasool [Fri, 22 Apr 2016 23:08:34 +0000 (23:08 +0000)]
Source: fix another -Wunused-variable warning
Conditionalise a variable definition which may be unused in certain compilations
due to the preprocessor. Protect the variable accordingly. NFC.
llvm-svn: 267247
Rui Ueyama [Fri, 22 Apr 2016 22:59:24 +0000 (22:59 +0000)]
Devirtualize ScriptParserBase. NFC.
ScriptParserBase class is a container of collection of various methods
to parse linker script-ish text. It had a virtual method `run` to run
the parser. But we don't have to enforce its descendents to implement
that. It's up to them.
This patch removes pure virtual function `run`.
llvm-svn: 267246
Rui Ueyama [Fri, 22 Apr 2016 22:59:22 +0000 (22:59 +0000)]
Fix link failure.
llvm-svn: 267245
Matt Arsenault [Fri, 22 Apr 2016 22:59:16 +0000 (22:59 +0000)]
AMDGPU: sext_inreg (srl x, K), vt -> bfe x, K, vt.Size
llvm-svn: 267244
NAKAMURA Takumi [Fri, 22 Apr 2016 22:51:48 +0000 (22:51 +0000)]
Fix llvm/test/CodeGen/ARM/Windows/dbzchk.ll not to check mixed output, take #2.
llvm-svn: 267242
David Blaikie [Fri, 22 Apr 2016 22:50:56 +0000 (22:50 +0000)]
llvm-symbolizer: Avoid infinite recursion walking dwos where the dwo contains a dwo_name attribute
The dwo_name was added to dwo files to improve diagnostics in dwp, but
it confuses tools that attempt to load any dwo named by a dwo_name, even
ones inside dwos. Avoid this by keeping track of whether a unit is
already a dwo unit, and if so, not loading further dwos.
llvm-svn: 267241
Matt Arsenault [Fri, 22 Apr 2016 22:48:38 +0000 (22:48 +0000)]
AMDGPU: Re-visit nodes in performAndCombine
This fixes test regressions when i64 loads/stores are made promote.
llvm-svn: 267240
Sanjoy Das [Fri, 22 Apr 2016 22:45:23 +0000 (22:45 +0000)]
Add some release notes about the fix for PR26774
As suggested by Chandler on the review thread for D18634.
llvm-svn: 267239
Nicolai Haehnle [Fri, 22 Apr 2016 22:37:58 +0000 (22:37 +0000)]
Fix comment about Intr*Mem properties
Summary:
Follow up to D19291: it now makes sense to use two Intr*Mem properties,
in particular IntrReadMem + IntrArgMemOnly is common.
Pointed out by Mikael Holmén.
Reviewers: uabelho, joker.eph, reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19418
llvm-svn: 267238
Greg Clayton [Fri, 22 Apr 2016 22:35:08 +0000 (22:35 +0000)]
Fixed in issue with ObjectFileMachO where it would add empty sections to the section list that was used to try and cap symbols to the max address of the section in which it is contained. The empty sections would make cap the symbols and make their sizes zero. Also fixed a few other things that could cause problems in the SymbolFileDWARFDebugMap when zero sized symbols were found and used to make OSO range map entries.
<rdar://problem/
25886773>
llvm-svn: 267237
Andrew Kaylor [Fri, 22 Apr 2016 22:24:20 +0000 (22:24 +0000)]
Removing unused function.
llvm-svn: 267236
Greg Clayton [Fri, 22 Apr 2016 22:15:59 +0000 (22:15 +0000)]
Fix a build-llvm.py crasher when we can't find cmake. Now it exits with a valid error that explains what went wrong.
llvm-svn: 267235
Richard Trieu [Fri, 22 Apr 2016 22:14:32 +0000 (22:14 +0000)]
Revert the bool portion of r267054
Remove the floating point to bool conversion warnings. Some of these
conversions will be caught by -Wliteral-conversion and -Wfloat-conversion
llvm-svn: 267234
Rafael Espindola [Fri, 22 Apr 2016 22:09:35 +0000 (22:09 +0000)]
Bring r267164 back with a fix.
The fix is to handle local symbols referring to SHF_MERGE sections.
Original message:
GC entries of SHF_MERGE sections.
It is a fairly direct extension of the gc algorithm. For merge sections
instead of remembering just a live bit, we remember which offsets
were used.
This reduces the .rodata sections in chromium from 9648861 to 9477472
bytes.
llvm-svn: 267233
Nico Weber [Fri, 22 Apr 2016 22:08:42 +0000 (22:08 +0000)]
Revert r267210, it makes clang assert (PR27490).
llvm-svn: 267232
Andrew Kaylor [Fri, 22 Apr 2016 22:06:11 +0000 (22:06 +0000)]
Re-commit optimization bisect support (r267022) without new pass manager support.
The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the OptBisect handling).
Differential Revision: http://reviews.llvm.org/D19172
llvm-svn: 267231
Rui Ueyama [Fri, 22 Apr 2016 21:43:10 +0000 (21:43 +0000)]
LTO: Merge -lto-no-discard-value-names with -save-temps.
This patch is to remove -lto-no-discard-value-names flag and
instead to use -save-temps as we discussed in the post-commit
review thread for r267020.
Differential Revision: http://reviews.llvm.org/D19437
llvm-svn: 267230
Sriraman Tallam [Fri, 22 Apr 2016 21:41:58 +0000 (21:41 +0000)]
Differential Revision: reviews.llvm.org/D19040
llvm-svn: 267229
Eugene Zelenko [Fri, 22 Apr 2016 21:33:33 +0000 (21:33 +0000)]
[Clang-tidy] Fix Clang warning in misc/StringConstructorCheck.h.
Using LLVM_ENABLE_WARNINGS=ON is good idea.
llvm-svn: 267228
David Blaikie [Fri, 22 Apr 2016 21:32:59 +0000 (21:32 +0000)]
llvm-symbolizer: prefer .dwo contents over fission-gmlt-like-data when .dwo file is present
Rather than relying on the gmlt-like data emitted into the .o/executable
which only contains the simple name of any inlined functions, use the
.dwo file if present.
Test symbolication with/without a .dwo, and the old test that was
testing behavior when no gmlt-like data was present. (I haven't included
a test of non-gmlt-like data + no .dwo (that would be akin to
symbolication with no debug info) but we could add one for completeness)
The test was simplified a bit to be a little clearer (unoptimized, force
inline, using a function call as the inlined entity) and regenerated
with ToT clang. For the no-gmlt-like-data case, I modified Clang back to
its old behavior temporarily & the .dwo file is identical so it is
shared between the two executables.
llvm-svn: 267227
Dehao Chen [Fri, 22 Apr 2016 21:31:18 +0000 (21:31 +0000)]
Update discriminator assignment algorithm in clang assembler.
Summary: The clang assembler assumes that the discriminator remains the same when there is source line change. The correct behavior is that when there is line change, discriminator will automatically reset to 0.
Reviewers: dnovillo, davidxl, echristo
Subscribers: echristo, llvm-commits
Differential Revision: http://reviews.llvm.org/D19436
llvm-svn: 267226
Matt Arsenault [Fri, 22 Apr 2016 21:23:41 +0000 (21:23 +0000)]
AMDGPU: Fix crash when dumping unknown opcode
I'm for some reason having a problem producing a test.
It should be the same as test/MC/X86/invalid_opcode.s,
but llvm-mc seems to ignore random bytes.
llvm-svn: 267225