Daniel Jasper [Tue, 7 Apr 2015 11:41:40 +0000 (11:41 +0000)]
Add test showing that MachineLICM is calculating register pressure wrong
More details: http://llvm.org/PR23143
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234309
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 7 Apr 2015 06:27:56 +0000 (06:27 +0000)]
[RuntimeDyld] Always allocate at least 1 byte for object sections in the JIT to
ensure that section addresses are distinct.
mapSectionAddress will fail if two sections are allocated the same address,
which can happen if any section has zero size (since malloc(0) is implementation
defined). Unfortunately I've been unable to repro this with a simple test case.
Fixes <rdar://problem/
20314015>.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234299
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Tue, 7 Apr 2015 06:12:21 +0000 (06:12 +0000)]
[Orc] Save all the x86-64 GPRs before re-entering the JIT.
The re-entry code should work for all calling conventions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234298
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 05:03:47 +0000 (05:03 +0000)]
Try a third time to fix MSVC build after r234290
I have no idea what MSVC means with its error text here :(.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2310
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234295
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:49:13 +0000 (04:49 +0000)]
Try again to fix MSVC build after r234290
Still failing:
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2309
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234294
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:33:42 +0000 (04:33 +0000)]
Try to fix MSVC build after r234290
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2308
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234292
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:14:33 +0000 (04:14 +0000)]
DebugInfo: Remove DITypedArray<>, replace with typedefs
Replace all uses of `DITypedArray<>` with `MDTupleTypedArrayWrapper<>`
and `MDTypeRefArray`. The APIs are completely different, but the
provided functionality is the same: treat an `MDTuple` as if it's an
array of a particular element type.
To simplify this patch a bit, I've temporarily typedef'ed
`DebugNodeArray` to `DIArray` and `MDTypeRefArray` to `DITypeArray`.
I've also temporarily conditionalized the accessors to check for null --
eventually these should be changed to asserts and the callers should
check for null themselves.
There's a tiny accompanying patch to clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234290
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:12:02 +0000 (04:12 +0000)]
DebugInfo: Remove DICompositeType mutation API
Change `DIBuilder` to mutate `MDCompositeTypeBase` directly, and remove
the wrapping API in `DICompositeType`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234289
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 04:07:31 +0000 (04:07 +0000)]
DebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity()
A quick cleanup to sue `DebugNodeRef` instead of `Metadata*` for
`MDImportedEntity::getEntity()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234288
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:55:30 +0000 (03:55 +0000)]
DebugInfo: Move DIFlag accessors from DIVariable to MDLocalVariable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234287
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:49:59 +0000 (03:49 +0000)]
DebugInfo: Move DIExpression bit-piece API to MDExpression
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234286
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:45:57 +0000 (03:45 +0000)]
DebugInfo: Remove special iterators from DIExpression
Remove special iterators from `DIExpression` in favour of same in
`MDExpression`. There should be no functionality change here.
Note that the APIs are slightly different: `getArg(unsigned)` counts
from 0, not 1, in the `MDExpression` version of the iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234285
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Tue, 7 Apr 2015 03:35:26 +0000 (03:35 +0000)]
[LoopAccesses] New API to query if memchecks are necessary after partitioning
This is used by Loop Distribution.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234283
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 03:33:57 +0000 (03:33 +0000)]
DebugInfo: Move DISubprogram::is*() queries to MDSubprogram
Move body of `DISubprogram::isPrivate()` (etc.) to `MDSubprogram`, and
change the versions in `DISubprogram` to forward there.
This is just like r234275, but for subprograms instead of types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234282
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 01:24:30 +0000 (01:24 +0000)]
DebugInfo: Move DIType::is*() queries to MDType
Move body of `DIType::isObjectPointer()` (etc.) to `MDType`, and change
the versions in `DIType` to forward there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234275
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 01:21:40 +0000 (01:21 +0000)]
DebugInfo: Move DIFlag-related API from DIDescriptor to DebugNode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234274
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:39:59 +0000 (00:39 +0000)]
IR: Rename MDSubrange::getLo() to getLowerBound()
During initial review, the `lo:` field was renamed to `lowerBound:`.
Make the same change to the C++ API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234267
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Tue, 7 Apr 2015 00:14:27 +0000 (00:14 +0000)]
Fix some minor abuse of C++ terminology in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234265
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:09:47 +0000 (00:09 +0000)]
DebugInfo: Drop dead code for loose DIDescriptor construction API
Delete `DIDescriptor::is*()` and the various constructors from `MDNode*`
in `DIDescriptor` subclasses.
If this just broke your out-of-tree code, you need to make updates along
the lines of r234255, r234256, r234257 and r234258:
- Generally, `DIX().isX()` => `isa<MDX>()`. So, `D.isCompileUnit()`
should just be `isa<MDCompileUnit>(D)`, modulo checks for null.
- Exception: `DILexicalBlock` => `MDLexicalBlockBase`.
- Exception: `DIDerivedType` => `MDDerivedTypeBase`.
- Exception: `DICompositeType` => `MDCompositeTypeBase`.
- Exception: `DIVariable` => `MDLocalVariable`.
- Note that (e.g.) `DICompileUnit` has an implicit constructor from
`MDCompileUnit*`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234263
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Tue, 7 Apr 2015 00:08:31 +0000 (00:08 +0000)]
bindings/go: Stop using DIDescriptor::is*() and auto-casting
Go bindings edition of r234255.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234262
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:34:41 +0000 (23:34 +0000)]
IR: Fix -Werror noasserts build after r234255
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234259
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:27:40 +0000 (23:27 +0000)]
CodeGen: Stop using DIDescriptor::is*() and auto-casting
Same as r234255, but for lib/CodeGen and lib/Target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234258
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:27:00 +0000 (23:27 +0000)]
Transforms: Stop using DIDescriptor::is*() and auto-casting
Same as r234255, but for lib/Analysis and lib/Transforms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234257
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 23:18:49 +0000 (23:18 +0000)]
IR: Stop using DIDescriptor::is*() and auto-casting
`DIDescriptor`'s subclasses allow construction from incompatible
pointers, and `DIDescriptor` defines a series of `isa<>`-like functions
(e.g., `isCompileUnit()` instead of `isa<MDCompileUnit>()`) that clients
tend to use like this:
if (DICompileUnit(N).isCompileUnit())
foo(DICompileUnit(N));
These construction patterns work together to make `DIDescriptor` behave
differently from normal pointers.
Instead, use built-in `isa<>`, `dyn_cast<>`, etc., and only build
`DIDescriptor`s from pointers that are valid for their type.
I've split this into a few commits for different parts of LLVM and clang
(to decrease the patch size and increase the chance of review).
Generally the changes I made were NFC, but in a few places I made things
stricter if it made sense from the surrounded code.
Eventually a follow-up commit will remove the API for the "old" way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234255
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Mon, 6 Apr 2015 22:33:43 +0000 (22:33 +0000)]
Fix failure on builder clang-cmake-mips where it was printing a 32-bit address
incorrectly because it came from an expression using S.getAddress() which always
returns a 64-bit value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234251
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 22:32:20 +0000 (22:32 +0000)]
DebugInfo: Allow isa<> on DIDescriptor and subclasses
Allow LLVM-style casting on `DIDescriptor` and its subclasses so they
can behave more like raw pointers. I haven't bothered with tests since
I have a follow-up commit coming shortly that uses them extensively in
tree, and I'm hoping to kill `DIDescriptor` entirely before too long (so
they won't have time to bitrot).
Usage examples:
DIDescriptor D = foo();
if (DICompileUnit CU = dyn_cast<MDCompileUnit>(D))
return bar(CU);
else if (auto *SP = dyn_cast<MDSubprogram>(D))
return baz(SP);
return other(D);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234250
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 22:29:07 +0000 (22:29 +0000)]
Use sext in fast isel.
Fast isel used to zero extends immediates to 64 bits. This normally goes
unnoticed because the value is truncated to 32 bits for output.
Two cases were it is noticed:
* We fail to use smaller encodings.
* If the original constant was smaller than i32.
In the tests using i1 constants, codegen would change to use -1, which is fine
(and matches what regular isel does) since only the lowest bit is then used.
Instead, this patch then changes the ir to use i8 constants, which looks more
like what clang produces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234249
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 22:27:37 +0000 (22:27 +0000)]
DebugInfo: Reimplement DIRef<>::resolve() using TypedDebugNodeRef<>
Gut `DIRef<>::resolve()`, reimplementing it using
`TypedDebugNodeRef<>::resolve()`. Use three separate functions rather
than some sort of type traits, since the latter (i.e., mapping `DIScope`
=> `MDScope`) seems heavy-handed. I don't expect `DIRef<>` to last much
longer in tree anyway.
As a drive-by fix, make `TypedDebugNodeRef<>::resolve()` do the right
thing with `nullptr`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234248
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 6 Apr 2015 22:16:58 +0000 (22:16 +0000)]
[lit] Skip gtest names starting with DISABLED_
The sanitizer test suite uses this idiom to disable a test. Now that we
actually check if a test ran after invoking it, we see that zero tests
ran, and complain.
Instead, ignore tests starting with DISABLED_ completely. Fixes the
sanitizer test suite failures on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234247
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 22:07:46 +0000 (22:07 +0000)]
DebugInfo: Drop confusing forwarding API from DILexicalBlockFile
Remove `DILexicalBlockFile::getScope()` (whose last use was removed from
clang in r234245), which illegally returned a `DILexicalBlock` despite
its scope sometimes being an `MDSubprogram`. Also remove the
`getLineNumber()` and `getColumnNumber()` methods that just forwarded to
`DILexicalBlock`'s versions, since there don't seem to be any callers.
Note that the block of code removed from `DebugInfo.cpp` was actually
dead code, since `isLexicalBlock()` (the previous branch) always returns
true when `isLexicalBlockFile()` returns true.
An earlier (broken and untested) version of this was squashed into
r234222 and reverted in r234225.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234246
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 6 Apr 2015 21:49:55 +0000 (21:49 +0000)]
[lit] Fix running gtest type-parameterized tests on Windows
The '/' character in the test name of a type-parameterized test is not a
path separator, and should not be '\' on Windows. We were passing a test
name to --gtest_filter which found no tests, so the exit code was zero,
indicating a passed test.
This bug has been here since r84387 in 2009, when Jeff Yasskin added the
original lit support for type-paratermized tests. Somewhere along the
line some of the ValueMapTests started failing, but we can fix those
separately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234242
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:46:46 +0000 (21:46 +0000)]
Reapply "DebugInfo: Loosen DILexicalBlock constructor"
This reverts commit r234225, reapplying r234222 in spirit.
This time, just include what the commit message actually describes:
loosen the `DILexicalBlock` constructor to require a
`MDLexicalBlockBase`, since that's what `DILexicalBlock` is wrapping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234241
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:30:23 +0000 (21:30 +0000)]
Revert "DebugInfo: Loosen DILexicalBlock constructor"
This reverts commit r234222, while I look into bot failures [1]. I'll
recommit soon.
[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/7117/
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234225
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 6 Apr 2015 21:27:31 +0000 (21:27 +0000)]
ArgPromo: Bail out earlier for varargs functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234224
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 21:16:11 +0000 (21:16 +0000)]
DebugInfo: Loosen DILexicalBlock constructor
This class wraps `MDLexicalBlockBase`, so allow construction from it!
Currently doesn't cause any problems because of the explicit `MNode*`
constructor, but I'll be removing that soon enough.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234222
91177308-0d34-0410-b5e6-
96231b3b80d8
Ismail Pazarbasi [Mon, 6 Apr 2015 21:09:08 +0000 (21:09 +0000)]
Move `checkInterfaceFunction` to ModuleUtils
Summary:
Instead of making a local copy of `checkInterfaceFunction` for each
sanitizer, move the function in a common place.
Reviewers: kcc, samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8775
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234220
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 6 Apr 2015 20:59:48 +0000 (20:59 +0000)]
[opaque pointer type] Avoid using PointerType::getElementType when parsing IR
A few calls are left in for error checking - but I'm commenting those
out & trying to build some IR tests (aiming for Argument Promotion to
start with). When I get any of these tests passing I may add flag to
disable the checking so I can add tests that pass with the assertion in
place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234206
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:49:39 +0000 (19:49 +0000)]
DebugInfo: Remove DIDescriptor::Verify()
Remove `DIDescriptor::Verify()` and the `Verify()`s from subclasses.
They had already been gutted, and just did an `isa<>` check.
In a couple of cases I've temporarily dropped the check entirely, but
subsequent commits are going to disallow conversions to the
`DIDescriptor`s directly from `MDNode`, so the checks will come back in
another form soon enough.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234201
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:48:50 +0000 (19:48 +0000)]
DebugInfo: Add MDTypeRefArray, to replace DITypeArray
This array-like wrapper adapts `MDTuple` to have elements of `MDTypeRef`
(whereas `MDTypeArray` has elements of `MDType`). This is necessary to
migrate code using `DITypeArray`. The only use of this is
`MDSubroutineType`'s `getTypeArray()` accessor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234200
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:23:22 +0000 (19:23 +0000)]
DebugInfo: Remove dead DIType::operator DITypeRef(), NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234198
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 19:03:45 +0000 (19:03 +0000)]
DebugInfo: Use MDTypeRef throughout the hierarchy
Use `MDTypeRef` (etc.) in the new debug info hierarchy rather than raw
`Metadata *` pointers.
I rolled in a change to `DIBuilder` that looks unrelated: take `DIType`
instead of `DITypeRef` as type arguments when creating variables.
However, this was the simplest way to use `MDTypeRef` within the
functions, and didn't require any cleanups from callers in clang (since
they were all passing in `DIType`s anyway, relying on their implicit
conversions to `DITypeRef`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234197
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 6 Apr 2015 18:50:38 +0000 (18:50 +0000)]
[WinEH] Don't sink allocas into child handlers
The uselist isn't enough to infer anything about the lifetime of such
allocas. If we want to re-add this optimization, we will need to
leverage lifetime markers to do it.
Fixes PR23122.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234196
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 6 Apr 2015 18:44:42 +0000 (18:44 +0000)]
ARM: do not relax Thumb1 -> Thumb2 if only Thumb1 is available.
After recognising that a certain narrow instruction might need a relocation to
be represented, we used to unconditionally relax it to a Thumb2 instruction to
permit this. Unfortunately, some CPUs (e.g. v6m) don't even have most Thumb2
instructions, so we end up emitting a completely invalid instruction.
Theoretically, ELF does have relocations for these situations; but they are
fairly unusable with such short ranges and the ABI document even says they're
documented "for completeness". So an error is probably better there too.
rdar://
20391953
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234195
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 6 Apr 2015 18:39:00 +0000 (18:39 +0000)]
[X86][SSE] Use (V)PINSRB for direct byte insertion in 16i8 buildvector on SSE4.1 targets
This patch allows SSE4.1 targets to use (V)PINSRB to create 16i8 vectors by inserting i8 scalars directly into a XMM register instead of merging pairs of i8 scalars into a i16 and using the SSE2 PINSRW instruction.
This allows folding of byte loads and reduces scalar register usage as well.
Differential Revision: http://reviews.llvm.org/D8839
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234193
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Mon, 6 Apr 2015 18:18:23 +0000 (18:18 +0000)]
Fix failure on builder llvm-clang-lld-x86_64-debian-fast as the
test macho-objc-meta-data.test had a line it shouldn't have had.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234190
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Mon, 6 Apr 2015 18:06:06 +0000 (18:06 +0000)]
Add some type safety to GlobalObject/GlobalValue - they're always PointerTypes so let's type them that way.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234189
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 18:02:43 +0000 (18:02 +0000)]
DebugInfo: Create MDTypeRef, etc., to replace DITypeRef
Create a string-based wrapper in the debug info hierarchy for type
references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234188
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:52:46 +0000 (17:52 +0000)]
DebugInfo: Remove dead DIRef::getName()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234186
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Enderby [Mon, 6 Apr 2015 17:47:03 +0000 (17:47 +0000)]
For llvm-objdump added support for printing Objc2 32-bit runtime meta data
with the existing -objc-meta-data and -macho options for Mach-O files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234185
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:45:07 +0000 (17:45 +0000)]
Metadata: Add typed array-like wrapper for MDTuple
Add `MDTupleTypedArrayWrapper`, a wrapper around `MDTuple` that adapts
it to look like an array and cast its operands to the given type. This
is designed to be a replacement for `DITypedArray<>`, which is in the
`DIDescriptor` hierarchy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234183
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:21:05 +0000 (17:21 +0000)]
DebugInfo: Remove dead code for accessing fields
Most fields are now accessed via the new debug info hierarchy. I'll
make the rest of this code dead soon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234182
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:17:47 +0000 (17:17 +0000)]
AutoUpgrade: Remove obsolete dbg.declare/value upgrade
This upgrade of `@llvm.dbg.declare` and `@llvm.dbg.value` isn't useful,
since it's for an old debug info version. The calls will get stripped
anyway by `UpgradeDebugInfo()`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234181
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Mon, 6 Apr 2015 17:15:48 +0000 (17:15 +0000)]
[SLSR] consider &B[S << i] as &B[(1 << i) * S]
Summary: This reduces handling &B[(1 << i) * s] to handling &B[i * S].
Test Plan: slsr-gep.ll
Reviewers: meheff
Subscribers: sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D8837
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234180
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 6 Apr 2015 17:15:41 +0000 (17:15 +0000)]
[DAGCombiner] Add support for FCEIL, FFLOOR and FTRUNC vector constant folding
Differential Revision: http://reviews.llvm.org/D8715
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234179
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 17:04:58 +0000 (17:04 +0000)]
Verifier: Check composite type template params
Add missing checks for `templateParams:` in `MDCompositeType`. Pull the
current check for `MDSubprogram` to reduce duplicated code and fix it up
to print a good message when the immediate operand isn't an `MDTuple`
(as a drive-by, make the same fix to `variables:` in `MDSubprogram`).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234177
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Mon, 6 Apr 2015 16:43:40 +0000 (16:43 +0000)]
DebugInfo: Use MDFile instead of accessing operands directly, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234175
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 16:34:41 +0000 (16:34 +0000)]
Use a comma after the unique keyword.
H.J. Lu noted that all .section options are separated by a comma.
This patch changes the syntax of unique to require one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234174
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 6 Apr 2015 16:21:12 +0000 (16:21 +0000)]
fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234171
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 16:10:05 +0000 (16:10 +0000)]
Remove unnecessary uses of AliasedSymbol.
As pr19627 points out, every use of AliasedSymbol is likely a bug.
The main use was to avoid the oddity of a variable showing up as undefined. That
was fixed in r233995, which made these calls nops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234169
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Mon, 6 Apr 2015 16:09:13 +0000 (16:09 +0000)]
Removing a spurious space; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234168
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 15:27:57 +0000 (15:27 +0000)]
Be consistent when deciding if a relocation is needed.
Before when deciding if we needed a relocation in A-B, we wore only checking
if A was weak.
This fixes the asymmetry.
The "InSet" argument should probably be renamed to "ForValue", since InSet is
very MachO specific, but doing so in this patch would make it hard to read.
This fixes PR22815.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234165
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 15:04:31 +0000 (15:04 +0000)]
Disable all link optimizations in a debug build.
This taking linking clang on my machine with gold from 16.
980257914 to
15.
933037649 seconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234161
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 14:51:01 +0000 (14:51 +0000)]
Don't pass -O3 to the linker in debug builds.
This takes linking clang in a debug build with gold form 19.
518925697 to
16.
406388685 seconds.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234160
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 14:34:43 +0000 (14:34 +0000)]
Don't use -ffunction-sections -fdata-sections on debug builds.
Unfortunately, on ELF there is not used attribute on the .o files,
so there is no easy way to keep the dump function alive.
If we are not gcing, we may as well produce non gcable files and
avoid the cost.
Linking a debug clang now takes 18.
856225992 seconds, before it
took 21.
206897447.
I will try avoiding --gc-sections -O3 on a followup patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234159
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Mon, 6 Apr 2015 13:31:39 +0000 (13:31 +0000)]
Test commit. Improve comments in APInt. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234158
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 04:25:18 +0000 (04:25 +0000)]
Store the sh_link of ARM_EXIDX directly in MCSectionELF.
This avoids some pretty horrible and broken name based section handling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234142
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 03:16:51 +0000 (03:16 +0000)]
Simplify this function a bit. NFC.
The case values are not a tidy enum we can fully cover. They even ovelap
over the various extension.
Just use a default:
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234140
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 6 Apr 2015 03:09:30 +0000 (03:09 +0000)]
Simplify mapping from relocation sections to relocated sections.
Just store the section in MCSectionELF. This avoids multiple hash lookups.
This will also be used by ARM_EXIDX.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234139
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 6 Apr 2015 03:01:29 +0000 (03:01 +0000)]
[Orc] Tidy up the assembly for the x86-64 resolver block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234138
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 5 Apr 2015 22:53:21 +0000 (22:53 +0000)]
[opaque pointer type] Remove some backwards compatible GEP APIs
Just doing the two-step so I don't get so much build-bot spam... (add
new API, migrate callers, remove old API)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234132
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 5 Apr 2015 22:44:57 +0000 (22:44 +0000)]
clang-format my last commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234127
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sun, 5 Apr 2015 22:41:44 +0000 (22:41 +0000)]
[opaque pointer type] The last of the GEP IRBuilder API migrations
There's still lots of callers passing nullptr, of course - some because
they'll never be migrated (InstCombines for bitcasts - well they don't
make any sense when the pointer type is opaque anyway, for example) and
others that will need more engineering to pass Types around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234126
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 5 Apr 2015 17:02:25 +0000 (17:02 +0000)]
Mark BumpPtrAllocator::Allocate as returning a noalias pointer.
The GCC attribute is curiously named 'malloc', but I think it's better
to use LLVM terminology for the wrapper macro.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234121
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 5 Apr 2015 14:30:37 +0000 (14:30 +0000)]
[DAGCombiner] Merge FMUL Scalar and Vector constant canonicalization to RHS. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234118
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 4 Apr 2015 21:07:10 +0000 (21:07 +0000)]
[opaque pointer type] More GEP API migrations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234108
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 4 Apr 2015 21:06:39 +0000 (21:06 +0000)]
remove function/variable names from comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234107
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 4 Apr 2015 21:05:52 +0000 (21:05 +0000)]
less space; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234106
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 4 Apr 2015 18:16:01 +0000 (18:16 +0000)]
Don't mix overload and default values.
It makes it hard to see which one is being called.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234100
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 4 Apr 2015 18:02:01 +0000 (18:02 +0000)]
Implement unique sections with an unique ID.
This allows the compiler/assembly programmer to switch back to a
section. This in turn fixes the bootstrap failure on powerpc (tested
on gcc110) without changing the ppc codegen at all.
I will try to cleanup the various getELFSection overloads in a followup patch.
Just using a default argument now would lead to ambiguities.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234099
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Sat, 4 Apr 2015 15:12:13 +0000 (15:12 +0000)]
[opaque pointer type] More (constant, in this instance) GEP API migrations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234096
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 4 Apr 2015 10:20:31 +0000 (10:20 +0000)]
[DAGCombiner] Canonicalize vector constants for ADD/MUL/AND/OR/XOR re-association
Scalar integers are commuted to move constants to the RHS for re-association - this ensures vectors do the same.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234092
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 4 Apr 2015 04:22:12 +0000 (04:22 +0000)]
[X86] Apply AddedComplexity consistently for similar patterns. This keeps them together in the DAGISel tables and reduces table size slightly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234086
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 4 Apr 2015 03:53:25 +0000 (03:53 +0000)]
Fix formatting and coding style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234084
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 4 Apr 2015 02:31:43 +0000 (02:31 +0000)]
[X86] Add a comment about the change in r234075.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234079
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Sat, 4 Apr 2015 02:26:47 +0000 (02:26 +0000)]
Strip trailing whitespace and reword explanatory comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234078
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 4 Apr 2015 02:08:20 +0000 (02:08 +0000)]
[X86] Don't use GR64 register 'and with immediate' instructions if the immediate is zero in the upper 33-bits or upper 57-bits. Use GR32 instructions instead.
Previously the patterns didn't have high enough priority and we would only use the GR32 form if the only the upper 32 or 56 bits were zero.
Fixes PR23100.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234075
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 23:37:34 +0000 (23:37 +0000)]
[WinEH] Fill out CatchHigh in the TryBlockMap
Now all fields in the WinEH xdata have been filled out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234067
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 23:03:54 +0000 (23:03 +0000)]
[opaque pointer type] More GEP IRBuilder API migrations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234064
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 22:49:05 +0000 (22:49 +0000)]
[WinEH] Fill out .xdata for catch objects
This add support for catching an exception such that an exception object
available to the catch handler will be initialized by the runtime.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234062
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 22:32:26 +0000 (22:32 +0000)]
[WinEH] Sink UnwindHelp completely out of IR
We don't need to represent UnwindHelp in IR. Instead, we can use the
knowledge that we are emitting the parent function to decide if we
should create the UnwindHelp stack object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234061
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 3 Apr 2015 21:44:17 +0000 (21:44 +0000)]
Fixing a memory leak in WinEHPrepare
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234059
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 21:33:42 +0000 (21:33 +0000)]
[opaque pointer type] More GEP IRBuilder API migrations...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234058
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 21:32:06 +0000 (21:32 +0000)]
Use early returns to reduce indentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234057
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 20:56:24 +0000 (20:56 +0000)]
Fix a typo
CHECK-LABEL had the wrong function name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234051
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 3 Apr 2015 20:18:40 +0000 (20:18 +0000)]
[InstCombine] Use DataLayout to determine vector element width
InstCombine didn't realize that it needs to use DataLayout to determine
how wide pointers are. This lead to assertion failures.
This fixes PR23113.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234046
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 3 Apr 2015 19:55:30 +0000 (19:55 +0000)]
Fixing a build error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234045
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 3 Apr 2015 19:45:32 +0000 (19:45 +0000)]
Fixing build warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234043
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 3 Apr 2015 19:41:44 +0000 (19:41 +0000)]
[opaque pointer type] More GEP API migrations in IRBuilder uses
The plan here is to push the API changes out from the common components
(like Constant::getGetElementPtr and IRBuilder::CreateGEP related
functions) and just update callers to either pass the type if it's
obvious, or pass null.
Do this with LoadInst as well and anything else that comes up, then to
start porting specific uses to not pass null anymore - this may require
some refactoring in each case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234042
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 3 Apr 2015 19:37:50 +0000 (19:37 +0000)]
[WinEH] Handle nested landing pads in outlined catch handlers
Differential Revision: http://reviews.llvm.org/D8596
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234041
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 3 Apr 2015 19:20:26 +0000 (19:20 +0000)]
CodeGen: Assert that inlined-at locations agree
As a follow-up to r234021, assert that a debug info intrinsic variable's
`MDLocalVariable::getInlinedAt()` always matches the
`MDLocation::getInlinedAt()` of its `!dbg` attachment.
The goal here is to get rid of `MDLocalVariable::getInlinedAt()`
entirely (PR22778), but I'll let these assertions bake for a while
first.
If you have an out-of-tree backend that just broke, you're probably
attaching the wrong `DebugLoc` to a `DBG_VALUE` instruction. The one
you want is the location that was attached to the corresponding
`@llvm.dbg.declare` or `@llvm.dbg.value` call that you started with.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234038
91177308-0d34-0410-b5e6-
96231b3b80d8