oota-llvm.git
9 years agoSuppress llvm/test/tools/dsymutil/X86/basic-linking-x86.test for now. Will fix later.
NAKAMURA Takumi [Sun, 15 Mar 2015 23:07:16 +0000 (23:07 +0000)]
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

9 years agollvm/test/tools/dsymutil/X86/basic-lto-*-linking-x86.test: Relax expressions to meet...
NAKAMURA Takumi [Sun, 15 Mar 2015 23:07:05 +0000 (23:07 +0000)]
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

9 years ago[dsymutil] Add missing raw_svector_stream::resync() calls.
Frederic Riss [Sun, 15 Mar 2015 22:20:28 +0000 (22:20 +0000)]
[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

9 years agoAdding commit msg guidelines to dev policy
Renato Golin [Sun, 15 Mar 2015 21:15:48 +0000 (21:15 +0000)]
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

9 years ago[dsymutil] Add support for linking line tables.
Frederic Riss [Sun, 15 Mar 2015 20:45:43 +0000 (20:45 +0000)]
[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

9 years ago[MCDwarf] Do not emit useless line table opcode.
Frederic Riss [Sun, 15 Mar 2015 20:45:39 +0000 (20:45 +0000)]
[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

9 years agoUse SDValue bool check to tidyup some possible combines. NFC.
Simon Pilgrim [Sun, 15 Mar 2015 19:47:42 +0000 (19:47 +0000)]
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

9 years agoremove function names from comments; NFC
Sanjay Patel [Sun, 15 Mar 2015 18:16:04 +0000 (18:16 +0000)]
remove function names from comments; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232328 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agofix typo: NFC
Sanjay Patel [Sun, 15 Mar 2015 18:11:35 +0000 (18:11 +0000)]
fix typo: NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232327 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse SDValue bool check to tidyup some possible combines. NFC.
Simon Pilgrim [Sun, 15 Mar 2015 17:21:35 +0000 (17:21 +0000)]
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

9 years ago[SSE} Added tests for float4-float3 conversions (PR11580)
Simon Pilgrim [Sun, 15 Mar 2015 16:19:15 +0000 (16:19 +0000)]
[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

9 years agoFactor the iterators of ImmutableSet/ImmutableMap into a common base class
Benjamin Kramer [Sun, 15 Mar 2015 13:26:03 +0000 (13:26 +0000)]
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

9 years agoImmutableSet: Rename Self to SelfTy to make it more clear it is a type
David Majnemer [Sun, 15 Mar 2015 07:09:20 +0000 (07:09 +0000)]
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

9 years agoPostOrderIterator: Remove stray semicolon
David Majnemer [Sun, 15 Mar 2015 07:09:18 +0000 (07:09 +0000)]
PostOrderIterator: Remove stray semicolon

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232316 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIR: Default the Metadata::dump() argument "harder" after r232275
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 06:53:32 +0000 (06:53 +0000)]
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

9 years agoRestore the gcc build
David Majnemer [Sun, 15 Mar 2015 06:11:24 +0000 (06:11 +0000)]
Restore the gcc build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232314 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove iterator I accidentally left behind
David Blaikie [Sun, 15 Mar 2015 03:21:20 +0000 (03:21 +0000)]
Remove iterator I accidentally left behind

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232312 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove use of reserved identifier _Iterator
David Blaikie [Sun, 15 Mar 2015 03:18:21 +0000 (03:18 +0000)]
Remove use of reserved identifier _Iterator

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232311 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove use of reserved identifiers in Twine
David Blaikie [Sun, 15 Mar 2015 03:17:28 +0000 (03:17 +0000)]
Remove use of reserved identifiers in Twine

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232310 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove use of reserved identifier and some excess 'inline' usage
David Blaikie [Sun, 15 Mar 2015 03:11:26 +0000 (03:11 +0000)]
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

9 years agoRemove reserved identifier & some unnecessary 'inline'
David Blaikie [Sun, 15 Mar 2015 03:11:24 +0000 (03:11 +0000)]
Remove reserved identifier & some unnecessary 'inline'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232308 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRemove use of reserved identifier
David Blaikie [Sun, 15 Mar 2015 03:03:41 +0000 (03:03 +0000)]
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

9 years ago[dsymutil] Add an way to iterate over a DebugMapObject symbols.
Frederic Riss [Sun, 15 Mar 2015 02:02:53 +0000 (02:02 +0000)]
[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

9 years agoRemove use of unreserved identifier (_Self)
David Blaikie [Sun, 15 Mar 2015 01:42:28 +0000 (01:42 +0000)]
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

9 years agoRemove use of a reserved identifier
David Blaikie [Sun, 15 Mar 2015 01:40:42 +0000 (01:40 +0000)]
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

9 years agoRemove use of reserved identifier
David Blaikie [Sun, 15 Mar 2015 01:37:01 +0000 (01:37 +0000)]
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

9 years agollvm-cxxdump: Rename llvm-vtabledump to llvm-cxxdump
David Majnemer [Sun, 15 Mar 2015 01:30:58 +0000 (01:30 +0000)]
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

9 years ago[dsymutil] Add function size to the debug map.
Frederic Riss [Sun, 15 Mar 2015 01:29:30 +0000 (01:29 +0000)]
[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

9 years agoDbgIntrinsicInst: Downcast to specialized MDNodes in accessors
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 01:23:20 +0000 (01:23 +0000)]
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

9 years agoRemove some unnecessary 'inline' keywords
David Blaikie [Sun, 15 Mar 2015 01:21:37 +0000 (01:21 +0000)]
Remove some unnecessary 'inline' keywords

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232298 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoIntervalIterator: Add move semantics rather than relying on broken implicit copy...
David Blaikie [Sun, 15 Mar 2015 01:21:34 +0000 (01:21 +0000)]
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

9 years agoVerifier: Check debug info intrinsic arguments
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 01:21:30 +0000 (01:21 +0000)]
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

9 years ago[opaque pointer type] IRBuilder gep migration progress
David Blaikie [Sun, 15 Mar 2015 01:03:19 +0000 (01:03 +0000)]
[opaque pointer type] IRBuilder gep migration progress

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232294 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMade CFLAA agree with clang-format. NFC.
George Burgess IV [Sun, 15 Mar 2015 00:52:21 +0000 (00:52 +0000)]
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

9 years agoVerifier: Remove unnecessary null check
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:50:57 +0000 (00:50 +0000)]
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

9 years agoVerifier: Make the raw_ostream constructor argument required
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:46:57 +0000 (00:46 +0000)]
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

9 years agoAssembler: Rewrite test for function-local metadata
Duncan P. N. Exon Smith [Sun, 15 Mar 2015 00:45:51 +0000 (00:45 +0000)]
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

9 years agoSimplified some stack folding tests.
Simon Pilgrim [Sat, 14 Mar 2015 23:16:43 +0000 (23:16 +0000)]
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

9 years agoUpdate InstCombine to transform aggregate stores into scalar stores.
Mehdi Amini [Sat, 14 Mar 2015 22:19:33 +0000 (22:19 +0000)]
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

9 years agoUpdate LangRef now that a DataLayout is mandatory.
Mehdi Amini [Sat, 14 Mar 2015 22:04:06 +0000 (22:04 +0000)]
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

9 years agoAdd some missed formatting
David Blaikie [Sat, 14 Mar 2015 21:40:12 +0000 (21:40 +0000)]
Add some missed formatting

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232281 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] gep API migration
David Blaikie [Sat, 14 Mar 2015 21:40:10 +0000 (21:40 +0000)]
[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

9 years ago[opaque pointer type] gep API migration
David Blaikie [Sat, 14 Mar 2015 21:20:51 +0000 (21:20 +0000)]
[opaque pointer type] gep API migration

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232279 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoA few minor updates based on feedback from Justin and a few things I thought were...
Chris Bieneman [Sat, 14 Mar 2015 21:20:32 +0000 (21:20 +0000)]
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

9 years ago[opaque pointer type] gep API migration, ArgPromo
David Blaikie [Sat, 14 Mar 2015 21:11:26 +0000 (21:11 +0000)]
[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

9 years ago[opaque pointer type] more gep API migrations (AsmParser)
David Blaikie [Sat, 14 Mar 2015 21:11:24 +0000 (21:11 +0000)]
[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

9 years agoIR: Make Metadata::print() reliable and useful
Duncan P. N. Exon Smith [Sat, 14 Mar 2015 20:19:36 +0000 (20:19 +0000)]
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

9 years ago[opaque pointer type] more gep API migration
David Blaikie [Sat, 14 Mar 2015 19:53:33 +0000 (19:53 +0000)]
[opaque pointer type] more gep API migration

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232274 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAsmWriter: Split out SlotTracker::processInstructionMetadata(), NFC
Duncan P. N. Exon Smith [Sat, 14 Mar 2015 19:48:31 +0000 (19:48 +0000)]
AsmWriter: Split out SlotTracker::processInstructionMetadata(), NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232273 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAsmWriter: Use range-based for, NFC
Duncan P. N. Exon Smith [Sat, 14 Mar 2015 19:44:01 +0000 (19:44 +0000)]
AsmWriter: Use range-based for, NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232272 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] more gep API migrations
David Blaikie [Sat, 14 Mar 2015 19:24:04 +0000 (19:24 +0000)]
[opaque pointer type] more gep API migrations

Adding nullptr to all the IRBuilder stuff because it's the first thing
that fails to build when testing without the back-compat functions, so
I'll keep having to re-add these locally for each chunk of migration I
do. Might as well check them in to save me the churn. Eventually I'll
have to migrate these too, but I'm going breadth-first.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232270 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoNo need to prototype RtlCaptureContext with mingw-w64.
Yaron Keren [Sat, 14 Mar 2015 19:20:56 +0000 (19:20 +0000)]
No need to prototype RtlCaptureContext with mingw-w64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232269 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRecover the ability to 'b CheckFailed' after r231577
Duncan P. N. Exon Smith [Sat, 14 Mar 2015 16:47:37 +0000 (16:47 +0000)]
Recover the ability to 'b CheckFailed' after r231577

Given that the stated purpose of `CheckFailed()` is to provide a nice
spot for a breakpoint, it'd be nice not to have to use a regex to break
on it.  Recover the ability to simply use `b CheckFailed` by
specializing the message-only version, and by changing the variadic
version to call into the message-only version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232268 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Add support for debug_loc section.
Frederic Riss [Sat, 14 Mar 2015 15:49:07 +0000 (15:49 +0000)]
[dsymutil] Add support for debug_loc section.

There is no need to look into the location expressions to transfer them,
the only modification to apply is to patch their base address to reflect
the linked function address.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232267 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoarray_pod_sort: Since we're checking the length anyways also ignore one-element ranges
Benjamin Kramer [Sat, 14 Mar 2015 14:53:14 +0000 (14:53 +0000)]
array_pod_sort: Since we're checking the length anyways also ignore one-element ranges

Sorting them is obviously a noop and we can skip the libc call. This is
surprisingly common in clang. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232265 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MachineLICM] First steps of sinking GEPs near calls.
Daniel Jasper [Sat, 14 Mar 2015 10:58:38 +0000 (10:58 +0000)]
[MachineLICM] First steps of sinking GEPs near calls.

Specifically, if there are copy-like instructions in the loop header
they are moved into the loop close to their uses. This reduces the live
intervals of the values and can avoid register spills.

This is working towards a fix for http://llvm.org/PR22230.
Review: http://reviews.llvm.org/D7259

Next steps:
- Find a better cost model (which non-copy instructions should be sunk?)
- Make this dependent on register pressure

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232262 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove trivial header for the MipsModuleISelDAGToDAG pass. NFC.
Vasileios Kalintiris [Sat, 14 Mar 2015 09:20:52 +0000 (09:20 +0000)]
[mips] Remove trivial header for the MipsModuleISelDAGToDAG pass. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232260 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove trivial header for the Mips16HardFloat pass. NFC.
Vasileios Kalintiris [Sat, 14 Mar 2015 09:02:23 +0000 (09:02 +0000)]
[mips] Remove trivial header for the Mips16HardFloat pass. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232259 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[mips] Remove trivial header for the MipsOs16 pass. NFC.
Vasileios Kalintiris [Sat, 14 Mar 2015 08:34:25 +0000 (08:34 +0000)]
[mips] Remove trivial header for the MipsOs16 pass. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232258 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Generate debug_aranges section.
Frederic Riss [Sat, 14 Mar 2015 03:46:51 +0000 (03:46 +0000)]
[dsymutil] Generate debug_aranges section.

This actually shares most of its implementation with the  generation
of the debug_ranges (the absence of 'a' is not a typo) contribution
for the unit's DW_AT_ranges attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232246 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Identify each CompileUnit with a unique ID.
Frederic Riss [Sat, 14 Mar 2015 03:46:40 +0000 (03:46 +0000)]
[dsymutil] Identify each CompileUnit with a unique ID.

The ID can eg. de used in MCSymbol names to differentiate the ones
that need to be created for every unit.
The ID is a constructor parameter and not a static class member so
there is no issue with counter updates if we decide to thread that
code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232245 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Start migrating GEP creation to explicitly specify the pointee...
David Blaikie [Sat, 14 Mar 2015 01:53:18 +0000 (01:53 +0000)]
[opaque pointer type] Start migrating GEP creation to explicitly specify the pointee type

I'm just going to migrate these in a pretty ad-hoc & incremental way -
providing the backwards compatible API for now, then locally removing
it, fixing a few callers, adding it back in and commiting those callers.
Rinse, repeat.

The assertions should ensure that if I get this wrong we'll find out
about it and not just have one giant patch to revert, recommit, revert,
recommit, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232240 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a bunch of CHECK missing colons in tests. NFC.
Ahmed Bougacha [Sat, 14 Mar 2015 01:43:57 +0000 (01:43 +0000)]
Add a bunch of CHECK missing colons in tests.  NFC.

Some wouldn't pass;  fixed most, the rest will be fixed separately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232239 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCommandLine: Replace cold std::sort with array_pod_sort.
Benjamin Kramer [Sat, 14 Mar 2015 00:20:13 +0000 (00:20 +0000)]
CommandLine: Replace cold std::sort with array_pod_sort.

Also replace an old use of qsort with it. Compiles down to the same thing but
gives us some type safety. Safes a couple of kb on CommandLine.o.

NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232236 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLowerBitSets: Do not export symbols for bit set referenced globals on Darwin.
Peter Collingbourne [Sat, 14 Mar 2015 00:00:49 +0000 (00:00 +0000)]
LowerBitSets: Do not export symbols for bit set referenced globals on Darwin.

The linker on that platform may re-order symbols or strip dead symbols, which
will break bit set checks. Avoid this by hiding the symbols from the linker.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232235 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Fix typo in comment.
Frederic Riss [Fri, 13 Mar 2015 23:55:29 +0000 (23:55 +0000)]
[dsymutil] Fix typo in comment.

Next time, when I fix a typo, I'll take the time to reread the whole
comment instead of waiting for the commit email to realize that there
is another one two words later...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232234 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Fix typo in doxygen comment.
Frederic Riss [Fri, 13 Mar 2015 23:51:06 +0000 (23:51 +0000)]
[dsymutil] Fix typo in doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232233 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Implement DW_AT_ranges linking.
Frederic Riss [Fri, 13 Mar 2015 23:30:31 +0000 (23:30 +0000)]
[dsymutil] Implement DW_AT_ranges linking.

Nothing fancy, just a straightforward offset to apply to the original
debug_ranges entries to get them in line with the linked addresses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232232 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Move a function declaration closer to its peers.
Frederic Riss [Fri, 13 Mar 2015 23:30:27 +0000 (23:30 +0000)]
[dsymutil] Move a function declaration closer to its peers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232231 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDWARFDebugRangeList: make the list of entries available to clients.
Frederic Riss [Fri, 13 Mar 2015 23:30:07 +0000 (23:30 +0000)]
DWARFDebugRangeList: make the list of entries available to clients.

For users like llvm-dsymutil that want to have access to the encoded
debug_ranges entries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232230 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse add32ri8 and friends on fast isel.
Rafael Espindola [Fri, 13 Mar 2015 22:18:18 +0000 (22:18 +0000)]
Use add32ri8 and friends on fast isel.

This fixes pr22854.

The core issue on the bug is that there are multiple instructions that
print the same in assembly. In fact, there doesn't seem to be any
syntax for specifying that a constant that fits in 8 bits should use a 32 bit
immediate.

The attached patch changes fast isel to consider i16immSExt8,
i32immSExt8, and i64immSExt8. They were disabled because fastisel didn’t know
to call the predicate back in the day.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232223 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agobpf: turn on HasJIT flag in BPF backend
Alexei Starovoitov [Fri, 13 Mar 2015 22:03:25 +0000 (22:03 +0000)]
bpf: turn on HasJIT flag in BPF backend

basic tests that use BPF backend to produce code in memory are passing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232222 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoBe lazy about loading metadata in IRObjectFile.
Rafael Espindola [Fri, 13 Mar 2015 21:54:20 +0000 (21:54 +0000)]
Be lazy about loading metadata in IRObjectFile.

This speeds up llvm-ar building lib64/libclangSema.a with debug IR files
from 8.658015807 seconds to just 0.351036519 seconds :-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232221 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoBranchFolding: MergePotentialsElt has a total order, just call array_pod_sort.
Benjamin Kramer [Fri, 13 Mar 2015 21:17:02 +0000 (21:17 +0000)]
BranchFolding: MergePotentialsElt has a total order, just call array_pod_sort.

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232217 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Bitcode support for explicit type parameter on the gep operator
David Blaikie [Fri, 13 Mar 2015 21:03:36 +0000 (21:03 +0000)]
[opaque pointer type] Bitcode support for explicit type parameter on the gep operator

This happened to be fairly easy to support backwards compatibility based
on the number of operands (old format had an even number, new format has
one more operand so an odd number).

test/Bitcode/old-aliases.ll already appears to test old gep operators
(if I remove the backwards compatibility in the BitcodeReader, this and
another test fail) so I'm not adding extra test coverage here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232216 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTurn assertion into bitcode reading error
David Blaikie [Fri, 13 Mar 2015 21:03:34 +0000 (21:03 +0000)]
Turn assertion into bitcode reading error

I don't think we test invalid bitcode records in any detail, so no test
here - just a change for consistency with existing error checks in
surrounding code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232215 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSimplify expression
David Blaikie [Fri, 13 Mar 2015 21:03:30 +0000 (21:03 +0000)]
Simplify expression

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232214 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReapply "[Reassociate] Add initial support for vector instructions."
Robert Lougher [Fri, 13 Mar 2015 20:53:01 +0000 (20:53 +0000)]
Reapply "[Reassociate] Add initial support for vector instructions."

This reapplies the patch previously committed at revision 232190.  This was
reverted at revision 232196 as it caused test failures in tests that did not
expect operands to be commuted.  I have made the tests more resilient to
reassociation in revision 232206.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232209 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agobpf: fix build
Alexei Starovoitov [Fri, 13 Mar 2015 20:49:38 +0000 (20:49 +0000)]
bpf: fix build

fix missed bits which were left over after r231987

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232208 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoinstcombine: alloca: Canonicalize scalar allocation array size
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:42:09 +0000 (19:42 +0000)]
instcombine: alloca: Canonicalize scalar allocation array size

As a follow-up to r232200, add an `-instcombine` to canonicalize scalar
allocations to `i32 1`.  Since r232200, `iX 1` (for X != 32) are only
created by RAUWs, so this shouldn't fire too often.  Nevertheless, it's
a cheap check and a nice cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232202 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoinstcombine: alloca: Limit array size type promotion
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:34:55 +0000 (19:34 +0000)]
instcombine: alloca: Limit array size type promotion

Move type promotion of the size of the array allocation to the end of
`simplifyAllocaArraySize()`.  This avoids promoting the type of the
array size if it's a `ConstantInt`, since the next -instcombine
iteration will drop it to a scalar allocation anyway.  Similarly, this
avoids promoting the type if it's an `UndefValue`, in which case the
alloca gets RAUW'ed.

This is NFC when considered over the lifetime of -instcombine, since
it's just reducing the number of iterations needed to reach fixed point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232201 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAsmWriter: Write alloca array size explicitly (and -instcombine fixup)
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:30:44 +0000 (19:30 +0000)]
AsmWriter: Write alloca array size explicitly (and -instcombine fixup)

Write the `alloca` array size explicitly when it's non-canonical.
Previously, if the array size was `iX 1` (where X is not 32), the type
would mutate to `i32` when round-tripping through assembly.

The testcase I added fails in `verify-uselistorder` (as well as
`FileCheck`), since the use-lists for `i32 1` and `i64 1` change.
(Manman Ren came across this when running `verify-uselistorder` on some
non-trivial, optimized code as part of PR5680.)

The type mutation started with r104911, which allowed array sizes to be
something other than an `i32`.  Starting with r204945, we
"canonicalized" to `i64` on 64-bit platforms -- and then on every
round-trip through assembly, mutated back to `i32`.

I bundled a fixup for `-instcombine` to avoid r204945 on scalar
allocations.  (There wasn't a clean way to sequence this into two
commits, since the assembly change on its own caused testcase churn, and
the `-instcombine` change can't be tested without the assembly changes.)

An obvious alternative fix -- change `AllocaInst::AllocaInst()`,
`AsmWriter` and `LLParser` to treat `intptr_t` as the canonical type for
scalar allocations -- was rejected out of hand, since this required
teaching them each about the data layout.

A follow-up commit will add an `-instcombine` to canonicalize the scalar
allocation array size to `i32 1` rather than leaving `iX 1` alone.

rdar://problem/20075773

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232200 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoinstcombine: alloca: Remove nesting in simplifyAllocaArraySize(), NFC
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:26:33 +0000 (19:26 +0000)]
instcombine: alloca: Remove nesting in simplifyAllocaArraySize(), NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232199 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd a parameter for getLazyBitcodeModule to lazily load Metadata.
Manman Ren [Fri, 13 Mar 2015 19:24:30 +0000 (19:24 +0000)]
Add a parameter for getLazyBitcodeModule to lazily load Metadata.

We only defer loading metadata inside ParseModule when ShouldLazyLoadMetadata
is true and we have not loaded any Metadata block yet.

This commit implements all-or-nothing loading of Metadata. If there is a
request to load any metadata block, we will load all deferred metadata blocks.

We make sure the deferred metadata blocks are loaded before we materialize any
function or a module.

The default value of the added parameter ShouldLazyLoadMetadata for
getLazyBitcodeModule is false, so the default behavior stays the same.

We only set the parameter to true when creating LTOModule in local contexts.
These can only really be used for parsing symbols, so it's unnecessary to ever
load the metadata blocks.

If we are going to enable lazy-loading of Metadata for other usages of
getLazyBitcodeModule, where deferred metadata blocks need to be loaded, we can
expose BitcodeReader::materializeMetadata to Module, similar to
Module::materialize.

rdar://19804575

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232198 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoinstcombine: alloca: Split out simplifyAllocaArraySize(), NFC
Duncan P. N. Exon Smith [Fri, 13 Mar 2015 19:22:03 +0000 (19:22 +0000)]
instcombine: alloca: Split out simplifyAllocaArraySize(), NFC

Follow-up commits will change some of the logic here.  Splitting into a
separate function simplifies the logic by allowing early returns instead
of deeper nesting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232197 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert: "[Reassociate] Add initial support for vector instructions."
Robert Lougher [Fri, 13 Mar 2015 19:20:46 +0000 (19:20 +0000)]
Revert: "[Reassociate] Add initial support for vector instructions."

This reverts revision 232190 due to buildbot failure reported on clang-hexagon-elf
for test arm64_vtst.c.  To be investigated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232196 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImprove wording of newline handling.
Joerg Sonnenberger [Fri, 13 Mar 2015 19:05:24 +0000 (19:05 +0000)]
Improve wording of newline handling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232195 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Fix handling of cross-cu forward references.
Frederic Riss [Fri, 13 Mar 2015 18:35:57 +0000 (18:35 +0000)]
[dsymutil] Fix handling of cross-cu forward references.

We recorded the forward references in the CU that holds the referenced
DIE, but this is wrong as those will get resoled *after* the CU that
holds the reference. Record the references in their originating CU along
with a pointer to the remote CU to be able to compute the fixed up
offset at the right time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232193 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Add relocation of compile_units low_pc/high_pc.
Frederic Riss [Fri, 13 Mar 2015 18:35:54 +0000 (18:35 +0000)]
[dsymutil] Add relocation of compile_units low_pc/high_pc.

They need to be handled specifically as they could vary pretty
widely depending on how the linker moves functions around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232192 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[dsymutil] Fix location cloning for newer dwarf versions.
Frederic Riss [Fri, 13 Mar 2015 18:35:39 +0000 (18:35 +0000)]
[dsymutil] Fix location cloning for newer dwarf versions.

The typo got unnoticed because we were testing only on Dwarf 2. Add a
Dwarf4 test that exercises the code path, and also tests some newer
FORMs that the other test doesn't cover.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232191 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[Reassociate] Add initial support for vector instructions.
Robert Lougher [Fri, 13 Mar 2015 18:33:27 +0000 (18:33 +0000)]
[Reassociate] Add initial support for vector instructions.

This patch adds initial support for vector instructions to the reassociation
pass. It enables most parts of the pass to work with vectors but to keep the
size of the patch small, optimization of Xor trees, canonicalization of
negative constants and converting shifts to muls, etc., have been left out.
This will be handled in later patches.

The patch is based on an initial patch by Chad Rosier.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232190 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[SCEV] Fix PR22856.
Sanjoy Das [Fri, 13 Mar 2015 18:31:19 +0000 (18:31 +0000)]
[SCEV] Fix PR22856.

Summary:
ScalarEvolutionExpander assumes that the header block of a loop is a
legal place to have a use for a phi node.  This is true only for phis
that are either in the header or dominate the header block, but it is
not true for phi nodes that are strictly internal to the loop body.

This change teaches ScalarEvolutionExpander to place uses of PHI nodes
in the basic block the PHI nodes belong to.  This is always legal, and
`hoistIVInc` ensures that the said position dominates `IsomorphicInc`.

Reviewers: atrick

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232189 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[opaque pointer type] Add textual IR support for explicit type parameter to gep operator
David Blaikie [Fri, 13 Mar 2015 18:20:45 +0000 (18:20 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to gep operator

Similar to gep (r230786) and load (r230794) changes.

Similar migration script can be used to update test cases, which
successfully migrated all of LLVM and Polly, but about 4 test cases
needed manually changes in Clang.

(this script will read the contents of stdin and massage it into stdout
- wrap it in the 'apply.sh' script shown in previous commits + xargs to
apply it over a large set of test cases)

import fileinput
import sys
import re

rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL)

def conv(match):
  line = match.group(1)
  line += match.group(4)
  line += ", "
  line += match.group(2)
  return line

line = sys.stdin.read()
off = 0
for match in re.finditer(rep, line):
  sys.stdout.write(line[off:match.start()])
  sys.stdout.write(conv(match))
  off = match.end()
sys.stdout.write(line[off:])

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232184 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd the option, -non-verbose to llvm-objdump used with -macho to print things
Kevin Enderby [Fri, 13 Mar 2015 17:56:32 +0000 (17:56 +0000)]
Add the option, -non-verbose to llvm-objdump used with -macho to print things
using numeric values and not their symbolic constant names.

The routines that print Mach-O stuff already had a verbose parameter and this
change is just changing the passing true to passing !NonVerbose.  With just a
couple of fixes and a bunch of test case updates.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232182 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agor600: Clear visited structure before running.
Jan Vesely [Fri, 13 Mar 2015 17:32:46 +0000 (17:32 +0000)]
r600: Clear visited structure before running.

Fixes random crashes in for-loop piglit.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232181 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agor600: Use deque and simplify loops in AMDGPUCFGStructurizer
Jan Vesely [Fri, 13 Mar 2015 17:32:43 +0000 (17:32 +0000)]
r600: Use deque and simplify loops in AMDGPUCFGStructurizer

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Matt Arsenault <Matthew.Arsenault@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232180 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[X86][AVX] Fix wrong lowering of v4x64 shuffles into concat_vector plus extract_subve...
Andrea Di Biagio [Fri, 13 Mar 2015 17:29:49 +0000 (17:29 +0000)]
[X86][AVX] Fix wrong lowering of v4x64 shuffles into concat_vector plus extract_subvector nodes.

This patch fixes a bug in the shuffle lowering logic implemented by function
'lowerV2X128VectorShuffle'.

The are few cases where function 'lowerV2X128VectorShuffle' wrongly expands a
shuffle of two v4X64 vectors into a CONCAT_VECTORS of two EXTRACT_SUBVECTOR
nodes. The problematic expansion only occurs when the shuffle mask M has an
'undef' element at position 2, and M is equivalent to mask <0,1,4,5>.
In that case, the algorithm propagates the wrong vector to one of the two
new EXTRACT_SUBVECTOR nodes.

Example:
;;
define <4 x double> @test(<4 x double> %A, <4 x double> %B) {
entry:
  %0 = shufflevector <4 x double> %A, <4 x double> %B, <4 x i32><i32 undef, i32 1, i32 undef, i32 5>
  ret <4 x double> %0
}
;;

Before this patch, llc (-mattr=+avx) generated:
  vinsertf128 $1, %xmm0, %ymm0, %ymm0

With this patch, llc correctly generates:
  vinsertf128 $1, %xmm1, %ymm0, %ymm0

Added test lower-vec-shuffle-bug.ll

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232179 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agounique_ptrs are unique already, no need to unique them any further.
Benjamin Kramer [Fri, 13 Mar 2015 16:59:29 +0000 (16:59 +0000)]
unique_ptrs are unique already, no need to unique them any further.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232178 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoR600/SI: Add test for min / max with immediate
Matt Arsenault [Fri, 13 Mar 2015 16:43:48 +0000 (16:43 +0000)]
R600/SI: Add test for min / max with immediate

Make sure this isn't getting confused by canonicalizations
of comparisons with a constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232177 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoConstantFold: Fix big shift constant folding
David Majnemer [Fri, 13 Mar 2015 16:39:46 +0000 (16:39 +0000)]
ConstantFold: Fix big shift constant folding

Constant folding for shift IR instructions ignores all bits above 32 of
second argument (shift amount).
Because of that, some undef results are not recognized and APInt can
raise an assert failure if second argument has more than 64 bits.

Patch by Paweł Bylica!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232176 91177308-0d34-0410-b5e6-96231b3b80d8