Commit Graph

115036 Commits

Author SHA1 Message Date
Justin Bogner
5e4931b489 InstrProf: Do a better job of reading coverage mapping data.
This code was casting regions of a memory buffer to a couple of
different structs. This is wrong in a few ways:

1. It breaks aliasing rules.
2. If the buffer isn't aligned, it hits undefined behaviour.
3. It completely ignores endianness differences.
4. The structs being defined for this aren't specifying their padding
   properly, so this doesn't even represent the data properly on some
   platforms.

This commit is mostly NFC, except that it fixes reading coverage for
32 bit binaries as a side effect of getting rid of the mispadded
structs. I've included a test for that.

I've also baked in that we only handle little endian more explicitly,
since that was true in practice already. I'll fix this to handle
endianness properly in a followup commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232346 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 06:55:45 +00:00
Frederic Riss
991f3ead4e [dsymutil] Add support to generate .debug_pubnames and .debug_pubtypes
The information gathering part of the patch stores a bit more information
than what is strictly necessary for these 2 sections. The rest will
become useful when we start emitting __apple_* type accelerator tables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232342 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 02:05:10 +00:00
NAKAMURA Takumi
69daff35f2 Rework r232337. Let llvm/test/tools/dsymutil/X86/basic-linking-x86.test dospath-tolerant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232339 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-16 00:40:47 +00:00
NAKAMURA Takumi
18a1928081 Suppress llvm/test/tools/dsymutil/X86/basic-linking-x86.test for now. Will fix later.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232337 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 23:07:16 +00:00
NAKAMURA Takumi
ce4f7bdd19 llvm/test/tools/dsymutil/X86/basic-lto-*-linking-x86.test: Relax expressions to meet dos path.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232336 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 23:07:05 +00:00
Frederic Riss
e21a4196a1 [dsymutil] Add missing raw_svector_stream::resync() calls.
Also, after looking at the raw_svector_stream internals, increase the
size of the SmallString used with it to prevent heap allocation.

Issue found by the Asan bot.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 22:20:28 +00:00
Renato Golin
dca78825b7 Adding commit msg guidelines to dev policy
After much bike shed discussions, we seem to agree to a few loose
but relevant guidelines on how to prepare a commit message. It also
points the attribution section to the new commit messages section
to deduplicate information.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 21:15:48 +00:00
Frederic Riss
e6412a691d [dsymutil] Add support for linking line tables.
This code comes with a lot of cruft that is meant to mimic darwin's
dsymutil behavior. A much simpler approach (described in the numerous
FIXMEs that I put in there) gives the right output for the vast
majority of cases. The extra corner cases that are handled differently
need to be investigated: they seem to correctly handle debug info that
is in the input, but that info looks suspicious in the first place.

Anyway, the current code needs to handle this, but I plan to revisit it
as soon as the big round of validation against the classic dsymutil is
over.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 20:45:43 +00:00
Frederic Riss
02c39fa277 [MCDwarf] Do not emit useless line table opcode.
No need to emit a DW_LNS_advance_pc with a 0 increment. Found out while
comparing dsymutil's and LLVM's line table encoding. Not a correctenss
fix, just a small encoding size optimization.

I'm not sure how to generate a sequence that triggers this, and moreover
llvm-dwardump doesn't dump the line table program, thus the effort
involved in creating a testcase for this trivial patch seemed out of
proportion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 20:45:39 +00:00
Simon Pilgrim
d6c5465667 Use SDValue bool check to tidyup some possible combines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 19:47:42 +00:00
Sanjay Patel
044d1f10ac remove function names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 18:16:04 +00:00
Sanjay Patel
3445f7efbd fix typo: NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 18:11:35 +00:00
Simon Pilgrim
ec009464f2 Use SDValue bool check to tidyup some possible combines. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232325 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 17:21:35 +00:00
Simon Pilgrim
4f3864d05f [SSE} Added tests for float4-float3 conversions (PR11580)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232324 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 16:19:15 +00:00
Benjamin Kramer
81c1d4095f Factor the iterators of ImmutableSet/ImmutableMap into a common base class
This simplifies code quite a bit and brings the iterators closer to
C++'s iterator concept. No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232319 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 13:26:03 +00:00
David Majnemer
3d849bdb47 ImmutableSet: Rename Self to SelfTy to make it more clear it is a type
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232317 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 07:09:20 +00:00
David Majnemer
7a447391cc PostOrderIterator: Remove stray semicolon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232316 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 07:09:18 +00:00
Duncan P. N. Exon Smith
9ca358021c IR: Default the Metadata::dump() argument "harder" after r232275
Use an overload instead of a default argument for `Metadata::dump()`.
The latter seems to require calling `dump(nullptr)` explicitly when
using a debugger, where as the former doesn't.

Other than utility for debugging, there's NFC here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232315 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 06:53:32 +00:00
David Majnemer
f5cb5de29b Restore the gcc build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232314 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 06:11:24 +00:00
David Blaikie
bc5ada697f Remove iterator I accidentally left behind
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232312 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 03:21:20 +00:00
David Blaikie
afae7ef18d Remove use of reserved identifier _Iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232311 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 03:18:21 +00:00
David Blaikie
22536735d5 Remove use of reserved identifiers in Twine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232310 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 03:17:28 +00:00
David Blaikie
635114fece Remove use of reserved identifier and some excess 'inline' usage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232309 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 03:11:26 +00:00
David Blaikie
e2935ee61b Remove reserved identifier & some unnecessary 'inline'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232308 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 03:11:24 +00:00
David Blaikie
baddd24f31 Remove use of reserved identifier
& some unnecessary 'inline' keywords

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232307 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 03:03:41 +00:00
Frederic Riss
469f438d4d [dsymutil] Add an way to iterate over a DebugMapObject symbols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232305 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 02:02:53 +00:00
David Blaikie
3cfe5cb8b3 Remove use of unreserved identifier (_Self)
And some unnecessary inline keywords

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232304 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:42:28 +00:00
David Blaikie
00286ad35f Remove use of a reserved identifier
(& some unnecessary 'inline' keywords, too)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:40:42 +00:00
David Blaikie
b5d5a02ef2 Remove use of reserved identifier
The C++ standard reserves all identifiers starting with an underscore
followed by an uppercase letter for the implementation for any use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:37:01 +00:00
David Majnemer
c976146d31 llvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump
llvm-vtabledump has grown enough functionality not related to vtables
that it deserves a name which is more descriptive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232301 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:30:58 +00:00
Frederic Riss
e7a356409d [dsymutil] Add function size to the debug map.
The debug map embedded by ld64 in binaries conatins function sizes.
These sizes are less precise than the ones given by the debug information
(byte granularity vs linker atom granularity), but they might cover code
that is referenced in the line table but not in the DIE tree (that might
very well be a compiler bug that I need to investigate later).
Anyway, extracting that information is necessary to be able to mimic
dsymutil's behavior exactly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:29:30 +00:00
Duncan P. N. Exon Smith
40510a07cf DbgIntrinsicInst: Downcast to specialized MDNodes in accessors
Change accessors to downcast to `MDLocalVariable` and `MDExpression`,
now that we have -verify checks in place to confirm that it's safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232299 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:23:20 +00:00
David Blaikie
538fbf66f6 Remove some unnecessary 'inline' keywords
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232298 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:21:37 +00:00
David Blaikie
e99d82664a IntervalIterator: Add move semantics rather than relying on broken implicit copy ctor (found with -Wdeprecated)
We were just getting lucky because the copy ctor would be elided by RVO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232297 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:21:34 +00:00
Duncan P. N. Exon Smith
08e687e684 Verifier: Check debug info intrinsic arguments
Verify that debug info intrinsic arguments are valid.  (These checks
will not recurse through the full debug info graph, so they don't need
to be cordoned of in `DebugInfoVerifier`.)

With those checks in place, changing the `DbgIntrinsicInst` accessors to
downcast to `MDLocalVariable` and `MDExpression` is natural (added isa
specializations in `Metadata.h` to support this).

Added tests to `test/Verifier` for the new -verify checks, and fixed the
debug info in all the in-tree tests.

If you have out-of-tree testcases that have started to fail to -verify,
hopefully the verify checks are helpful.  The most likely problem is
that the expression argument is `!{}` (instead of `!MDExpression()`).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232296 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:21:30 +00:00
David Blaikie
48248ac8a0 [opaque pointer type] IRBuilder gep migration progress
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232294 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 01:03:19 +00:00
George Burgess IV
2546837621 Made CFLAA agree with clang-format. NFC.
So everyone's lives are easier in the future



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 00:52:21 +00:00
Duncan P. N. Exon Smith
ca7e7b0212 Verifier: Remove unnecessary null check
This is already assumed to be non-null above due to a dyn_cast<>.  Also
remove extraneous braces around statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232292 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 00:50:57 +00:00
Duncan P. N. Exon Smith
7c068cfe9a Verifier: Make the raw_ostream constructor argument required
This was passed inconsistently; seems clearer to make it required anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 00:46:57 +00:00
Duncan P. N. Exon Smith
f548941ee0 Assembler: Rewrite test for function-local metadata
This test for function-local metadata did strange things, and never
really sent in valid arguments for `llvm.dbg.declare` and
`llvm.dbg.value` intrinsics.  Those that might have once been valid have
bitrotted.

Rewrite it to be a targeted test for function-local metadata --
unrelated to debug info, which is tested elsewhere -- and rename it to
better match other metadata-related tests.

(Note: the scope of function-local metadata changed drastically during
the metadata/value split, but I didn't properly clean up this testcase.
Most of the IR in this file, while invalid for debug info intrinsics,
used to provide coverage for various (now illegal) forms of
function-local metadata.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232290 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-15 00:45:51 +00:00
Simon Pilgrim
54db4092c1 Simplified some stack folding tests.
Replaced explicit pmovzx* intrinsic tests with general shuffles

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232286 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 23:16:43 +00:00
Mehdi Amini
3af5418aa4 Update InstCombine to transform aggregate stores into scalar stores.
Summary: This is a first step toward getting proper support for aggregate loads and stores.

Test Plan: Added unittests

Reviewers: reames, chandlerc

Reviewed By: chandlerc

Subscribers: majnemer, joker.eph, chandlerc, llvm-commits

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

Patch by Amaury Sechet

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 22:19:33 +00:00
Mehdi Amini
18233dc596 Update LangRef now that a DataLayout is mandatory.
Reviewers: rafael, echristo

Reviewed By: rafael

Subscribers: rafael, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232283 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 22:04:06 +00:00
David Blaikie
cf4419f88b Add some missed formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232281 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 21:40:12 +00:00
David Blaikie
f0295e423c [opaque pointer type] gep API migration
This concludes the GetElementPtrInst::Create migration, thus marking the
beginning of the IRBuilder::CreateGEP* migration to come.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232280 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 21:40:10 +00:00
David Blaikie
e265afc254 [opaque pointer type] gep API migration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232279 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 21:20:51 +00:00
Chris Bieneman
67dcb7d7ca A few minor updates based on feedback from Justin and a few things I thought were missing.
* Moved autotools configure & build example out of "Getting Started Quickly (A Summary)" and into BuildingLLVMWithAutoTools.
* Removed the annotations that CMake is the recommended process and Autotools is alternate.
* Added brief documentation about build targets under "Getting Started Quickly..."
* Added Overview text to BuildingLLVMWithAutotools
* Fixed up a broken link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232278 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 21:20:32 +00:00
David Blaikie
2f69477cfd [opaque pointer type] gep API migration, ArgPromo
This involved threading the type-to-gep through a data structure, since
the code was relying on the pointer type to carry this information. I
imagine there will be a lot of this work across the project... slow
work chasing each use case, but the assertions will help keep me honest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232277 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 21:11:26 +00:00
David Blaikie
bb939f02b2 [opaque pointer type] more gep API migrations (AsmParser)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 21:11:24 +00:00
Duncan P. N. Exon Smith
f9f505e626 IR: Make Metadata::print() reliable and useful
Replumb the `AsmWriter` so that `Metadata::print()` is generally useful.
(Similarly change `Metadata::printAsOperand()`.)

- `SlotTracker` now has a mode where all metadata will be correctly
  numbered when initializing a `Module`.  Normally, `Metadata` only
  referenced from within `Function`s gets numbered when the `Function`
  is incorporated.
- `Metadata::print()` and `Metadata::printAsOperand()` (and
  `Metadata::dump()`) now take an optional `Module` argument.  When
  provided, `SlotTracker` is initialized with the new mode, and the
  numbering will be complete and consistent for all calls to `print()`.
- `Value::print()` uses the new `SlotTracker` mode when printing
  intrinsics with `MDNode` operands, `MetadataAsValue` operands, or the
  bodies of functions.  Thus, metadata numbering will be consistent
  between calls to `Metadata::print()` and `Value::print()`.
- `Metadata::print()` (and `Metadata::dump()`) now print the full
  definition of `MDNode`s:

    !5 = !{!6, !"abc", !7}

  This matches behaviour for `Value::print()`, which includes the name
  of instructions.
- Updated call sites in `Verifier` to call `print()` instead of
  `printAsOperand()`.

All this, so that `Verifier` can print out useful failure messages that
involve `Metadata` for PR22777.

Note that `Metadata::printAsOperand()` previously took an optional
`bool` and `Module` operand.  The former was cargo-culted from
`Value::printAsOperand()` and wasn't doing anything useful.  The latter
didn't give consistent results (without the new `SlotTracker` mode).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-03-14 20:19:36 +00:00