1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
Commit Graph

23184 Commits

Author SHA1 Message Date
Rafael Espindola
f745768186 Delete unused constructor.
llvm-svn: 234459
2015-04-09 01:11:26 +00:00
Eric Christopher
30f86366b7 Update comment to refer to software floating point rather than
a local variable.

llvm-svn: 234457
2015-04-09 00:14:49 +00:00
Rafael Espindola
a9b13dc5bd Don't repeat names in comments.
llvm-svn: 234427
2015-04-08 20:16:23 +00:00
Adam Nemet
23b1ef3354 [LoopAccesses] Allow analysis to complete in the presence of uniform stores
(Re-apply r234361 with a fix and a testcase for PR23157)

Both run-time pointer checking and the dependence analysis are capable
of dealing with uniform addresses. I.e. it's really just an orthogonal
property of the loop that the analysis computes.

Run-time pointer checking will only try to reason about SCEVAddRec
pointers or else gives up. If the uniform pointer turns out the be a
SCEVAddRec in an outer loop, the run-time checks generated will be
correct (start and end bounds would be equal).

In case of the dependence analysis, we work again with SCEVs. When
compared against a loop-dependent address of the same underlying object,
the difference of the two SCEVs won't be constant. This will result in
returning an Unknown dependence for the pair.

When compared against another uniform access, the difference would be
constant and we should return the right type of dependence
(forward/backward/etc).

The changes also adds support to query this property of the loop and
modify the vectorizer to use this.

Patch by Ashutosh Nema!

llvm-svn: 234424
2015-04-08 17:48:40 +00:00
Rafael Espindola
61b1ed7ab9 Don't repeat names in comments.
llvm-svn: 234412
2015-04-08 16:33:46 +00:00
Simon Atanasyan
925707d8bb [mips] Update MIPS relocations list
No functional changes.

llvm-svn: 234408
2015-04-08 14:55:31 +00:00
Rafael Espindola
e9e9694283 Don't repeat names in comments. NFC.
llvm-svn: 234405
2015-04-08 13:52:09 +00:00
Adam Nemet
8c21d63b1f Revert "[LoopAccesses] Allow analysis to complete in the presence of uniform stores"
This reverts commit r234361.

It caused PR23157.

llvm-svn: 234387
2015-04-08 04:16:55 +00:00
Adam Nemet
2d24bce667 [LoopAccesses] Allow analysis to complete in the presence of uniform stores
Both run-time pointer checking and the dependence analysis are capable
of dealing with uniform addresses. I.e. it's really just an orthogonal
property of the loop that the analysis computes.

Run-time pointer checking will only try to reason about SCEVAddRec
pointers or else gives up. If the uniform pointer turns out the be a
SCEVAddRec in an outer loop, the run-time checks generated will be
correct (start and end bounds would be equal).

In case of the dependence analysis, we work again with SCEVs. When
compared against a loop-dependent address of the same underlying object,
the difference of the two SCEVs won't be constant. This will result in
returning an Unknown dependence for the pair.

When compared against another uniform access, the difference would be
constant and we should return the right type of dependence
(forward/backward/etc).

The changes also adds support to query this property of the loop and
modify the vectorizer to use this.

Patch by Ashutosh Nema!

llvm-svn: 234361
2015-04-07 21:46:16 +00:00
Rafael Espindola
ce18ca5d61 Use support::endian. NFC.
llvm-svn: 234359
2015-04-07 21:22:05 +00:00
Pete Cooper
8aef527f4f Add boolean to PrintStackTraceOnErrorSignal to disable crash reporting.
The current crash reporting on Mac OS is only disabled via an environment variable.
This adds a boolean (default false) which can also disable crash reporting.

The only client right now is the unittests which don't ever want crash reporting, but do want to detect killed programs.

Reduces the time to run the APFloat unittests on my machine from

[----------] 47 tests from APFloatTest (51250 ms total)

to

[----------] 47 tests from APFloatTest (765 ms total)

Reviewed by Reid Kleckner and Justin Bogner

llvm-svn: 234353
2015-04-07 20:43:23 +00:00
Rafael Espindola
8f03168a86 Remove dead code. NFC.
llvm-svn: 234352
2015-04-07 20:38:45 +00:00
Reid Kleckner
62be054366 [WinEH] Fix xdata generation when no catch object is present
The lack of a catch object is indicated by a frame escape index of -1.

Fixes PR23137.

llvm-svn: 234346
2015-04-07 19:46:38 +00:00
Sanjay Patel
25d45a2b18 move helper function closer to use; NFC
llvm-svn: 234344
2015-04-07 19:13:06 +00:00
Duncan P. N. Exon Smith
2a5f62fa5e DebugInfo: Remove constructors for DIRef<>
Remove all constructors for `DIRef<>` *except* the ones forwarding from
`TypedDebugNodeRef`.

llvm-svn: 234340
2015-04-07 18:41:54 +00:00
Sanjay Patel
3fce4cba3a add some const to FastMathFlags getters; NFC
llvm-svn: 234337
2015-04-07 18:38:35 +00:00
Duncan P. N. Exon Smith
131be0077e Workaround continued bot failures with MDTupleTypedArrayWrapper
Change the explicit constructor to be more specific.  I think this will
get us past the continued bot failures [1] with older clangs.

[1]: http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_build/8203

llvm-svn: 234331
2015-04-07 17:07:01 +00:00
Duncan P. N. Exon Smith
14d896c4af IR: Remove MDTupleTypedArrayWrapper::operator MDTuple*()
Remove `MDTupleTypedArrayWrapper::operator MDTuple*()`, since it causes
ambiguity (at least in some [1] compilers [2]) when using indexes to
`MDTupleTypedArrayWrapper::operator[](unsigned)` that are convertible to
(but not the same as) `unsigned`.

[1]: http://lab.llvm.org:8011/builders/sanitizer-windows/builds/2308
[2]: http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/4442

llvm-svn: 234326
2015-04-07 16:50:39 +00:00
Rafael Espindola
d00b8c898b Clear the stub map in getSortedStubs.
This makes sure they are only output once (and frees a bit of memory).

llvm-svn: 234313
2015-04-07 12:59:28 +00:00
Duncan P. N. Exon Smith
2f210ef9ab 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.

llvm-svn: 234290
2015-04-07 04:14:33 +00:00
Duncan P. N. Exon Smith
2126b90ed7 DebugInfo: Remove DICompositeType mutation API
Change `DIBuilder` to mutate `MDCompositeTypeBase` directly, and remove
the wrapping API in `DICompositeType`.

llvm-svn: 234289
2015-04-07 04:12:02 +00:00
Duncan P. N. Exon Smith
bce4acc3bd DebugInfo: Use DebugNodeRef in MDImportedEntity::getEntity()
A quick cleanup to sue `DebugNodeRef` instead of `Metadata*` for
`MDImportedEntity::getEntity()`.

llvm-svn: 234288
2015-04-07 04:07:31 +00:00
Duncan P. N. Exon Smith
c795576ec7 DebugInfo: Move DIFlag accessors from DIVariable to MDLocalVariable
llvm-svn: 234287
2015-04-07 03:55:30 +00:00
Duncan P. N. Exon Smith
9d8424840a DebugInfo: Move DIExpression bit-piece API to MDExpression
llvm-svn: 234286
2015-04-07 03:49:59 +00:00
Duncan P. N. Exon Smith
23edf4923f 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.

llvm-svn: 234285
2015-04-07 03:45:57 +00:00
Adam Nemet
c640b637f0 [LoopAccesses] New API to query if memchecks are necessary after partitioning
This is used by Loop Distribution.

llvm-svn: 234283
2015-04-07 03:35:26 +00:00
Duncan P. N. Exon Smith
d2bacc2836 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.

llvm-svn: 234282
2015-04-07 03:33:57 +00:00
Duncan P. N. Exon Smith
980e6b38da DebugInfo: Move DIType::is*() queries to MDType
Move body of `DIType::isObjectPointer()` (etc.) to `MDType`, and change
the versions in `DIType` to forward there.

llvm-svn: 234275
2015-04-07 01:24:30 +00:00
Duncan P. N. Exon Smith
b2adf2aa0c DebugInfo: Move DIFlag-related API from DIDescriptor to DebugNode
llvm-svn: 234274
2015-04-07 01:21:40 +00:00
Duncan P. N. Exon Smith
274931dd7e IR: Rename MDSubrange::getLo() to getLowerBound()
During initial review, the `lo:` field was renamed to `lowerBound:`.
Make the same change to the C++ API.

llvm-svn: 234267
2015-04-07 00:39:59 +00:00
Richard Smith
8121317c88 Fix some minor abuse of C++ terminology in comments.
llvm-svn: 234265
2015-04-07 00:14:27 +00:00
Duncan P. N. Exon Smith
3ba7d8c22b 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*`.

llvm-svn: 234263
2015-04-07 00:09:47 +00:00
Duncan P. N. Exon Smith
f41651ac8a CodeGen: Stop using DIDescriptor::is*() and auto-casting
Same as r234255, but for lib/CodeGen and lib/Target.

llvm-svn: 234258
2015-04-06 23:27:40 +00:00
Duncan P. N. Exon Smith
ba32e6fa81 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.

llvm-svn: 234255
2015-04-06 23:18:49 +00:00
Duncan P. N. Exon Smith
657d25b1ca 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);

llvm-svn: 234250
2015-04-06 22:32:20 +00:00
Duncan P. N. Exon Smith
c88dcc304e 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`.

llvm-svn: 234248
2015-04-06 22:27:37 +00:00
Duncan P. N. Exon Smith
2567b8e712 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.

llvm-svn: 234246
2015-04-06 22:07:46 +00:00
Duncan P. N. Exon Smith
6f6409ff5e 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.

llvm-svn: 234241
2015-04-06 21:46:46 +00:00
Duncan P. N. Exon Smith
ff5d299af6 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/

llvm-svn: 234225
2015-04-06 21:30:23 +00:00
Duncan P. N. Exon Smith
a5e3c1760f 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.

llvm-svn: 234222
2015-04-06 21:16:11 +00:00
Ismail Pazarbasi
7fbc7a6a77 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

llvm-svn: 234220
2015-04-06 21:09:08 +00:00
David Blaikie
1c84936605 [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.

llvm-svn: 234206
2015-04-06 20:59:48 +00:00
Duncan P. N. Exon Smith
ea3fb29a5a 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.

llvm-svn: 234201
2015-04-06 19:49:39 +00:00
Duncan P. N. Exon Smith
3b24416de4 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.

llvm-svn: 234200
2015-04-06 19:48:50 +00:00
Duncan P. N. Exon Smith
757f930dcb DebugInfo: Remove dead DIType::operator DITypeRef(), NFC
llvm-svn: 234198
2015-04-06 19:23:22 +00:00
Duncan P. N. Exon Smith
e2d414997c 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`).

llvm-svn: 234197
2015-04-06 19:03:45 +00:00
David Blaikie
5cf70c0e97 Add some type safety to GlobalObject/GlobalValue - they're always PointerTypes so let's type them that way.
llvm-svn: 234189
2015-04-06 18:06:06 +00:00
Duncan P. N. Exon Smith
446534adbc DebugInfo: Create MDTypeRef, etc., to replace DITypeRef
Create a string-based wrapper in the debug info hierarchy for type
references.

llvm-svn: 234188
2015-04-06 18:02:43 +00:00
Duncan P. N. Exon Smith
77af14bb29 DebugInfo: Remove dead DIRef::getName()
llvm-svn: 234186
2015-04-06 17:52:46 +00:00
Duncan P. N. Exon Smith
42f5bd3724 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.

llvm-svn: 234183
2015-04-06 17:45:07 +00:00