Commit Graph

179261 Commits

Author SHA1 Message Date
David Blaikie 29459ae83c Reapply "DebugInfo: Don't put fission type units in comdat sections."
This recommits r208930, r208933, and r208975 (by reverting r209338) and
reverts r209529 (the FIXME to readd this functionality once the tools
were fixed) now that DWP has been fixed to cope with a single section
for all fission type units.

Original commit message:

"Since type units in the dwo file are handled by a debug aware tool,
they don't need to leverage the ELF comdat grouping to implement
deduplication. Avoid creating all the .group sections for these as a
space optimization."

llvm-svn: 213956
2014-07-25 17:11:58 +00:00
Hal Finkel 869b0a1fd4 Claim AA generally as code owner
As per nominations from Chandler and Arnold.

llvm-svn: 213955
2014-07-25 16:45:10 +00:00
Hans Wennborg 82f490c0ba Fix MSVC2012 build error in UseListOrder.cpp
I think the compiler got confused by the nested DEBUG macros.
It was failing with:

  UseListOrder.cpp(80) : error C2059: syntax error : '}'

llvm-svn: 213954
2014-07-25 16:22:13 +00:00
Duncan P. N. Exon Smith 15eb0ab28d Bitcode: Don't optimize constants when preserving use-list order
`ValueEnumerator::OptimizeConstants()` creates forward references within
the constant pools, which makes predicting constants' use-list order
difficult.  For now, just disable the optimization.

This can be re-enabled in the future in one of two ways:

  - Enable a limited version of this optimization that doesn't create
    forward references.  One idea is to categorize constants by their
    "height" and make that the top-level sort.

  - Enable it entirely.  This requires predicting how may times each
    constant will be recreated as its operands' and operands' operands'
    (etc.) forward references get resolved.

This is part of PR5680.

llvm-svn: 213953
2014-07-25 16:13:16 +00:00
David Blaikie 2f04011435 Recommit r212203: Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information.
Reverted by Eric Christopher (Thanks!) in r212203 after Bob Wilson
reported LTO issues. Duncan Exon Smith and Aditya Nandakumar helped
provide a reduced reproduction, though the failure wasn't too hard to
guess, and even easier with the example to confirm.

The assertion that the subprogram metadata associated with an
llvm::Function matches the scope data referenced by the DbgLocs on the
instructions in that function is not valid under LTO. In LTO, a C++
inline function might exist in multiple CUs and the subprogram metadata
nodes will refer to the same llvm::Function. In this case, depending on
the order of the CUs, the first intance of the subprogram metadata may
not be the one referenced by the instructions in that function and the
assertion will fail.

A test case (test/DebugInfo/cross-cu-linkonce-distinct.ll) is added, the
assertion removed and a comment added to explain this situation.

This was then reverted again in r213581 as it caused PR20367. The root
cause of this was the early exit in LiveDebugVariables meant that
spurious DBG_VALUE intrinsics that referenced dead variables were not
removed, causing an assertion/crash later on. The fix is to have
LiveDebugVariables strip all DBG_VALUE intrinsics in functions without
debug info as they're not needed anyway. Test case added to cover this
situation (that occurs when a debug-having function is inlined into a
nodebug function) in test/DebugInfo/X86/nodebug_with_debug_loc.ll

Original commit message:

If a function isn't actually in a CU's subprogram list in the debug info
metadata, ignore all the DebugLocs and don't try to build scopes, track
variables, etc.

While this is possibly a minor optimization, it's also a correctness fix
for an incoming patch that will add assertions to LexicalScopes and the
debug info verifier to ensure that all scope chains lead to debug info
for the current function.

Fix up a few test cases that had broken/incomplete debug info that could
violate this constraint.

Add a test case where this occurs by design (inlining a
debug-info-having function in an attribute nodebug function - we want
this to work because /if/ the nodebug function is then inlined into a
debug-info-having function, it should be fine (and will work fine - we
just stitch the scopes up as usual), but should the inlining not happen
we need to not assert fail either).

llvm-svn: 213952
2014-07-25 16:10:16 +00:00
David Blaikie 48af9c3527 DebugInfo: Fix up some test cases to have more correct debug info metadata.
* Add CUs to the named CU node
* Add missing DW_TAG_subprogram nodes
* Add llvm::Functions to the DW_TAG_subprogram nodes

This cleans up the tests so that they don't break under a
soon-to-be-made change that is more strict about such things.

llvm-svn: 213951
2014-07-25 16:05:18 +00:00
Hal Finkel df14364f30 Add code owner of scoped-noalias metadata
Add myself as the code owner for the scoped-noalias metadata I've developed.

llvm-svn: 213950
2014-07-25 15:54:55 +00:00
Hal Finkel ff0bcb60c9 Convert noalias parameter attributes into noalias metadata during inlining
This functionality is currently turned off by default.

Part of the motivation for introducing scoped-noalias metadata is to enable the
preservation of noalias parameter attribute information after inlining.
Sometimes this can be inferred from the code in the caller after inlining, but
often we simply lose valuable information.

The overall process if fairly simple:
 1. Create a new unqiue scope domain.
 2. For each (used) noalias parameter, create a new alias scope.
 3. For each pointer, collect the underlying objects. Add a noalias scope for
    each noalias parameter from which we're not derived (and has not been
    captured prior to that point).
 4. Add an alias.scope for each noalias parameter from which we might be
    derived (or has been captured before that point).

Note that the capture checks apply only if one of the underlying objects is not
an identified function-local object.

llvm-svn: 213949
2014-07-25 15:50:08 +00:00
Hal Finkel 029cde639c Simplify and improve scoped-noalias metadata semantics
In the process of fixing the noalias parameter -> metadata conversion process
that will take place during inlining (which will be committed soon, but not
turned on by default), I have come to realize that the semantics provided by
yesterday's commit are not really what we want. Here's why:

void foo(noalias a, noalias b, noalias c, bool x) {
  *q = x ? a : b;
  *c = *q;
}

Generically, we know that *c does not alias with *a and with *b (so there is an
'and' in what we know we're not), and we know that *q might be derived from *a
or from *b (so there is an 'or' in what we know that we are). So we do not want
the semantics currently, where any noalias scope matching any alias.scope
causes a NoAlias return. What we want to know is that the noalias scopes form a
superset of the alias.scope list (meaning that all the things we know we're not
is a superset of all of things the other instruction might be).

Making that change, however, introduces a composibility problem. If we inline
once, adding the noalias metadata, and then inline again adding more, and we
append new scopes onto the noalias and alias.scope lists each time. But, this
means that we could change what was a NoAlias result previously into a MayAlias
result because we appended an additional scope onto one of the alias.scope
lists. So, instead of giving scopes the ability to have parents (which I had
borrowed from the TBAA implementation, but seems increasingly unlikely to be
useful in practice), I've given them domains. The subset/superset condition now
applies within each domain independently, and we only need it to hold in one
domain. Each time we inline, we add the new scopes in a new scope domain, and
everything now composes nicely. In addition, this simplifies the
implementation.

llvm-svn: 213948
2014-07-25 15:50:02 +00:00
Duncan P. N. Exon Smith 20a005f27a Try to fix a layering violation introduced by r213945
The dragonegg buildbot (and others?) started failing after
r213945/r213946 because `llvm-as` wasn't linking in the bitcode reader.
I think moving the verify functions to the same file as the verify pass
should fix the build.  Adding a command-line option for maintaining
use-list order in assembly as a drive-by to prevent warnings about
unused static functions.

llvm-svn: 213947
2014-07-25 15:41:49 +00:00
Duncan P. N. Exon Smith f62acab1c0 Fix -Werror build after r213945
llvm-svn: 213946
2014-07-25 15:00:02 +00:00
Duncan P. N. Exon Smith 6b6fdc992a IPO: Add use-list-order verifier
Add a -verify-use-list-order pass, which shuffles use-list order, writes
to bitcode, reads back, and verifies that the (shuffled) order matches.

  - The utility functions live in lib/IR/UseListOrder.cpp.

  - Moved (and renamed) the command-line option to enable writing
    use-lists, so that this pass can return early if the use-list orders
    aren't being serialized.

It's not clear that this pass is the right direction long-term (perhaps
a separate tool instead?), but short-term it's a great way to test the
use-list order prototype.  I've added an XFAIL-ed testcase that I'm
hoping to get working pretty quickly.

This is part of PR5680.

llvm-svn: 213945
2014-07-25 14:49:26 +00:00
Amara Emerson 115d2df8a4 [ARM] Emit ABI_PCS_R9_use build attribute.
Patch by Ben Foster!

Differential Revision: http://reviews.llvm.org/D4657

llvm-svn: 213944
2014-07-25 14:03:14 +00:00
Dmitry Vyukov 6819cf4974 tsan: query RSS every 100ms
Now that it become faster, it's OK to query it every 100ms again.

llvm-svn: 213943
2014-07-25 13:48:25 +00:00
Dmitry Vyukov fe17080c88 tsan: fix and make faster GetRSS
It is currently broken because it reads a wrong value from profile (heap instead of total).
Also make it faster by reading /proc/self/statm. Reading of /proc/self/smaps
can consume more than 50% of time on beefy apps if done every 100ms.

llvm-svn: 213942
2014-07-25 13:47:57 +00:00
Viktor Kutuzov d712403b98 Allow initialization of Asan interceptors before the general Asan initialization takes place on FreeBSD
Differential Revision: http://reviews.llvm.org/D4496

llvm-svn: 213941
2014-07-25 12:45:36 +00:00
Viktor Kutuzov 2fde54f48c Support traversing ELF objects for sanitizers needs on FreeBSD in 32-bit mode
Differential Revision: http://reviews.llvm.org/D4656

llvm-svn: 213940
2014-07-25 12:29:04 +00:00
Benjamin Kramer 1f8930e3d3 Run sort_includes.py on the AArch64 backend.
No functionality change.

llvm-svn: 213938
2014-07-25 11:42:14 +00:00
Simon Atanasyan 5116b4a9f9 [Driver][Mips] Remove "fp64" directories from the mips-mti-linux-gnu toolchain
directories description. Released version of this toolchain has not separate
libraries for -mfp64 command line option.

llvm-svn: 213937
2014-07-25 11:20:21 +00:00
Chandler Carruth da490d2ec1 [cmake] Use the external project machinery for libcxxabi so that it can
be disabled in CMake or relocated if desired.

llvm-svn: 213936
2014-07-25 10:27:40 +00:00
James Molloy 8a157bf8f2 Revert part of r206963
Specifically the part where we removed a warning to be compatible with GCC, which has been widely regarded as a bad idea.

I'm not quite happy with how obtuse this warning is, especially in the fairly common case of a 32-bit integer literal, so I've got another patch awaiting review that adds a fixit to reduce confusion.

llvm-svn: 213935
2014-07-25 10:19:47 +00:00
NAKAMURA Takumi b4553da481 llvm/test/CodeGen/ARM/inlineasm-global.ll: Add explicit triple to appease targeting *-win32.
llvm-svn: 213933
2014-07-25 09:55:01 +00:00
NAKAMURA Takumi dd620a242a llvm/test/CodeGen/ARM/inlineasm-global.ll: Avoid specifing source file on llc.
It sometimes confuses FileCheck. Consider the case that path contains 'stmib'. :)

llvm-svn: 213932
2014-07-25 09:54:49 +00:00
Chandler Carruth 3de980d2ff [SDAG] Enable the new assert for out-of-range result numbers in
SDValues, fixing the two bugs left in the regression suite.

The key for both of these was the use a single value type rather than
a VTList which caused an unintentionally single-result merge-value node.
Fix this by getting the appropriate VTList in place.

Doing this exposed that the comments in x86's code abouth how MUL_LOHI
operands are handle is wrong. The bug with the use of out-of-range
result numbers was hiding the bug about the order of operands here (as
best i can tell). There are more places where the code appears to get
this backwards still...

llvm-svn: 213931
2014-07-25 09:19:23 +00:00
Chandler Carruth eae2d28cc9 [SDAG] Don't insert the VRBase into a mapping from SDValues when the def
doesn't actually correspond to an SDValue at all. Fixes most of the
remaining asserts on out-of-range SDValue result numbers.

llvm-svn: 213930
2014-07-25 09:19:18 +00:00
Alexander Potapenko 08cfa79d87 [lsan] Follow-up for r213518: replace MAP_ANONYMOUS with MAP_ANON
(despite it's deprecated on Linux) to remove the ifdefs.

llvm-svn: 213929
2014-07-25 08:57:51 +00:00
Matt Arsenault 197a1e26e3 Store nodes only have 1 result.
llvm-svn: 213928
2014-07-25 07:56:42 +00:00
Alexey Bataev d6c57554f9 [OPENMP] Improved codegen for outlined functions for 'parallel' directives.
llvm-svn: 213927
2014-07-25 07:55:17 +00:00
Chandler Carruth 94bd553eb8 [SDAG] Start plumbing an assert into SDValues that we don't form one
with a result number outside the range of results for the node.

I don't know how we managed to not really check this very basic
invariant for so long, but the code is *very* broken at this point.
I have over 270 test failures with the assert enabled. I'm committing it
disabled so that others can join in the cleanup effort and reproduce the
issues. I've also included one of the obvious fixes that I already
found. More fixes to come.

llvm-svn: 213926
2014-07-25 07:23:23 +00:00
Alexey Bataev caf09b01fc [OPENMP] Improved DSA processing of the loop control variables for loop directives.
llvm-svn: 213925
2014-07-25 06:27:47 +00:00
Akira Hatanaka 16e47ff42e [ARM] In thumb mode, emit directive ".code 16" before file level inline
assembly instructions.

This is necessary to ensure ARM assembler switches to Thumb mode before it
starts assembling the file level inline assembly instructions at the beginning
of a .s file.

<rdar://problem/17757232>

llvm-svn: 213924
2014-07-25 05:12:49 +00:00
Lang Hames 98c3c0f38a [X86] Add comments to clarify some non-obvious lines in the stackmap-nops.ll
testcases.

Based on code review from Philip Reames. Thanks Philip!

llvm-svn: 213923
2014-07-25 04:50:08 +00:00
Richard Smith daa69e00f5 [modules] Substantially improve handling of #undef:
* Track override set across module load and save
 * Track originating module to allow proper re-export of #undef
 * Make override set properly transitive when it picks up a #undef

This fixes nearly all of the remaining macro issues with self-host.

llvm-svn: 213922
2014-07-25 04:40:03 +00:00
David Majnemer bf32f773cc llvm-vtabledump: use a std::map instead of a StringMap for VBTables
StringMap doesn't guarantee any particular iteration order,
this is suboptimal when comparing llvm-vtabledump's output for two
object files.

llvm-svn: 213921
2014-07-25 04:30:11 +00:00
Ehsan Akhgari 29b61ce770 Fix a warning in CoverageMappingReader.cpp
llvm-svn: 213920
2014-07-25 02:51:57 +00:00
Ehsan Akhgari 755597c83d Fix test/CodeGen/ms-inline-asm.c from r213916.
llvm-svn: 213919
2014-07-25 02:39:33 +00:00
Ehsan Akhgari fa2d9aa798 Fix test/CodeGen/ms-inline-asm.cpp from r213916.
llvm-svn: 213918
2014-07-25 02:35:50 +00:00
Lang Hames 5432649be7 [X86] Clarify some stackmap shadow optimization code as based on review
feedback from Eric Christopher.

No functional change.

llvm-svn: 213917
2014-07-25 02:29:19 +00:00
Ehsan Akhgari 2f93b448a8 clang-cl: Merge adjacent single-line __asm blocks
Summary:
This patch extends the __asm parser to make it keep parsing input tokens
as inline assembly if a single-line __asm line is followed by another line
starting with __asm too.  It also makes sure that we correctly keep
matching braces in such situations by separating the notions of how many
braces we are matching and whether we are in single-line asm block mode.

Reviewers: rnk

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4598

llvm-svn: 213916
2014-07-25 02:27:14 +00:00
Bill Schmidt c9fa5dd618 [PATCH][PPC64LE] Correct little-endian usage of vmrgh* and vmrgl*.
Because the PowerPC vmrgh* and vmrgl* instructions have a built-in
big-endian bias, it is necessary to swap their inputs in little-endian
mode when using them to implement a vector shuffle.  This was
previously missed in the vector LE implementation.

There was already logic to distinguish between unary and "normal"
vmrg* vector shuffles, so this patch extends that logic to use a third
option:  "swapped" vmrg* vector shuffles that are used for little
endian in place of the "normal" ones.

I've updated the vec-shuffle-le.ll test to check for the expected
register ordering on the generated instructions.

This bug was discovered when testing the LE and ELFv2 patches for
safety if they were backported to 3.4.  A different vectorization
decision was made in 3.4 than on mainline trunk, and that exposed the
problem.  I've verified this fix takes care of that issue.

llvm-svn: 213915
2014-07-25 01:55:55 +00:00
Todd Fiala d947406427 Fix an x86 assembler stack unwind calculation for non-volatile registers.
This change has the practical effect of fixing some backtrace
scenarios that would fail with inferiors running on the Android Art
host-side JVM under Linux x86_64 on Ubuntu 14.04.

See this lldb-commits thread for more details:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140721/011988.html

Change by Tong Shen.
Reviewed by Jason Molenda.

Tested:
Ubuntu 14.04 x86_64, clang-3.5-built lldb.
MacOSX 10.10 Preview 4, Xcode 6 Beta 4-built lldb.

llvm-svn: 213914
2014-07-25 01:15:34 +00:00
Richard Smith c6abd96bff PR20445: Properly transform the initializer in a CXXNewExpr rather than running
it through the normal TreeTransform logic for Exprs (which will strip off
implicit parts of the initialization and never re-create them).

llvm-svn: 213913
2014-07-25 01:12:44 +00:00
Richard Trieu d86c901f29 Pass the PrintingPolicy when converting types to strings in template type
diffing.  This removes extra "struct"/"class" in the type names and gives
"bool" instead of "_Bool" for booleans.

llvm-svn: 213912
2014-07-25 00:24:02 +00:00
Alex Lorenz a20a5d50ba Add code coverage mapping data, reader, and writer.
This patch implements the data structures, the reader and
the writers for the new code coverage mapping system. 
The new code coverage mapping system uses the instrumentation
based profiling to provide code coverage analysis.

llvm-svn: 213910
2014-07-24 23:57:54 +00:00
Alex Lorenz 817e485470 Add code coverage mapping data, reader, and writer.
This patch implements the data structures, the reader and
the writers for the new code coverage mapping system. 
The new code coverage mapping system uses the instrumentation
based profiling to provide code coverage analysis.

llvm-svn: 213909
2014-07-24 23:55:56 +00:00
Johannes Doerfert a014a98255 [Refactor] Expose the runtime debug builder
llvm-svn: 213908
2014-07-24 23:55:19 +00:00
Johannes Doerfert 79fc23f26b Make getIslCompatibleName globaly available
llvm-svn: 213907
2014-07-24 23:48:02 +00:00
Kevin Enderby 08e1bbd645 Add an implementation for llvm-nm’s -print-file-name option (aka -o and -A).
The -print-file-name option in llvm-nm is to precede each symbol
with the object file it came from.  While code for the parsing of this
option and its aliases existed there was no code to implement it.

llvm-svn: 213906
2014-07-24 23:31:52 +00:00
David Majnemer ab131e86ce Opportunistically fix the builders
A builder complained that it couldn't find llvm-vtabledump, this is
probably because it wasn't a dependency of the 'test' target.

llvm-svn: 213905
2014-07-24 23:26:54 +00:00
Todd Fiala e88aea3234 Fix configure/make builds on MacOSX.
Change by Keno Fischer.

llvm-svn: 213904
2014-07-24 23:22:58 +00:00