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

116066 Commits

Author SHA1 Message Date
Duncan P. N. Exon Smith
933300cefc DebugInfo: Remove DIGlobalVariable::getGlobal()
`DIGlobalVariable::getGlobal()` isn't really helpful, it just does a
`dyn_cast_or_null<>`.  Simplify its only user by doing the cast directly
and delete the code.

llvm-svn: 234796
2015-04-13 20:39:25 +00:00
Krzysztof Parzyszek
3ab4974861 Expand ADDO/SUBO on Hexagon
llvm-svn: 234795
2015-04-13 20:37:01 +00:00
Krzysztof Parzyszek
6d2e3b066b Add mtriple to test case to avoid problems with different naming schemes
llvm-svn: 234793
2015-04-13 20:24:40 +00:00
Duncan P. N. Exon Smith
d72f4d08c6 StripSymbols: Use DIGlobalVariable::getConstant() instead of getGlobal()
The only difference between the two is a `dyn_cast<>` to
`GlobalVariable`.  If optimizations have left anything behind when a
global gets replaced, then it doesn't seem like the debug info is dead.

I can't seem to find an optimization that would leave behind a
non-`GlobalVariable` without nulling the reference entirely, so I
haven't added a testcase (but I'll be deleting `getGlobal()` in a future
commit).

llvm-svn: 234792
2015-04-13 20:13:30 +00:00
Nick Lewycky
faeb8d6bf0 GCC complains thusly: "attributes at the beginning of statement are ignored [-Werror=attributes]". Very well then! NFC
llvm-svn: 234788
2015-04-13 20:03:08 +00:00
Philip Reames
df2ddd44c8 [RwriteStatepointsForGC] Minor indentation and naming [NFC]
Use early-return style that's preferred in LLVM and updating the naming in places I touched with other changes in the last few days.  Hopefully, NFC.

llvm-svn: 234785
2015-04-13 20:00:30 +00:00
Duncan P. N. Exon Smith
60cd6704e0 DebugInfo: Remove a few unnecessary wrappers
llvm-svn: 234783
2015-04-13 19:44:31 +00:00
Duncan P. N. Exon Smith
55aa9652c3 DebugInfo: Assume valid pointer in DISubprogram::replaceFunction()
Other accessors assume this already; not sure how `replaceFunction()`
got left behind.

llvm-svn: 234782
2015-04-13 19:41:30 +00:00
Nick Lewycky
e8c4d44b5f Subtraction is not commutative. Fixes PR23212!
llvm-svn: 234780
2015-04-13 19:17:37 +00:00
Philip Reames
e1fc0fc6fc [RewriteStatepointsForGC] Avoid inserting empty holder
We use dummy calls to adjust the liveness of values over statepoints in the midst of the insertion.  If there are no values which need held live, there's no point in actually inserting the holder.  

llvm-svn: 234779
2015-04-13 19:07:47 +00:00
Duncan P. N. Exon Smith
6ba180eadf DebugInfo: Migrate DISubprogram::describes() to new hierarchy, NFC
I don't really like this function at all -- I think it should be as
simple as `return getFunction() == F` -- but for now this seems like the
best we can do.

llvm-svn: 234778
2015-04-13 19:07:27 +00:00
Krzysztof Parzyszek
9a304a7909 Remove this test until I figure out why it fails
llvm-svn: 234777
2015-04-13 18:57:50 +00:00
Duncan P. N. Exon Smith
c107098997 Reapply "Verifier: Check for incompatible bit piece expressions"
This reverts commit r234717, reapplying r234698 (in spirit).

As described in r234717, the original `Verifier` check had a
use-after-free.  Instead of storing pointers to "interesting" debug info
intrinsics whose bit piece expressions should be verified once we have
typerefs, do a second traversal.  I've added a testcase to catch the
`llc` crasher.

Original commit message:

    Verifier: Check for incompatible bit piece expressions

    Convert an assertion into a `Verifier` check.  Bit piece expressions
    must fit inside the variable, and mustn't be the entire variable.
    Catching this in the verifier will help us find bugs sooner, and makes
    `DIVariable::getSizeInBits()` dead code.

llvm-svn: 234776
2015-04-13 18:53:11 +00:00
Matthias Braun
95c82f3445 Use FileCheck for test
llvm-svn: 234774
2015-04-13 18:47:19 +00:00
Akira Hatanaka
f59b15f57c [inliner] Don't inline a function if it doesn't have exactly the same
target-cpu and target-features attribute strings as the caller.

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

llvm-svn: 234773
2015-04-13 18:43:38 +00:00
Krzysztof Parzyszek
76aa51e92a Make the ARM testcase from r234764 also pass on Thumb
llvm-svn: 234772
2015-04-13 18:39:52 +00:00
Philip Reames
e39c40ef6f [RewriteStatepointsForGC] Fix a latent bug in normalization for invoke statepoint [NFC]
Since we're restructuring the CFG, we also need to make sure to update the analsis passes. While I'm touching the code, I dedicided to restructure it a bit.  The code involved here was very confusing.  This change moves the normalization to essentially being a pre-pass before the main insertion work and updates a few comments to actually say what is happening and *why*.

The restructuring should be covered by existing tests.  I couldn't easily see how to create a test for the invalidation bug.  Suggestions welcome.

llvm-svn: 234769
2015-04-13 18:07:21 +00:00
Jan Vesely
5d6ba23797 Revert revisions r234755, r234759, r234760
Revert "Remove default in fully-covered switch (to fix Clang -Werror -Wcovered-switch-default)"
Revert "R600: Add carry and borrow instructions. Use them to implement UADDO/USUBO"
Revert "LegalizeDAG: Try to use Overflow operations when expanding ADD/SUB"

Using overflow operations fails CodeGen/Generic/2011-07-07-ScheduleDAGCrash.ll
on hexagon, nvptx, and r600. Revert while I investigate.

llvm-svn: 234768
2015-04-13 17:47:15 +00:00
Philip Reames
9877caf968 [RewriteStatepointsForGC] Strengthen assertions around liveness
This is related to the issues addressed in 234651.  These assertions check the properties ensured by that change at the place of use.  Note that a similiar property is checked in checkBasicSSA, but without the reachability constraint.  Technically, the liveness would be correct to include unreachable values, but this would be problematic for actual relocation.

llvm-svn: 234766
2015-04-13 17:35:55 +00:00
Krzysztof Parzyszek
3efcf81e03 Allow memory intrinsics to be tail calls
llvm-svn: 234764
2015-04-13 17:16:45 +00:00
Matthias Braun
c3bb4fc289 DAGCombiner: Fix crash in select(select) opt.
In case of different types used for the condition of the selects the
select(select) -> select(and) normalisation cannot be performed.

See also: http://reviews.llvm.org/D7622

llvm-svn: 234763
2015-04-13 17:16:33 +00:00
Philip Reames
9edd4ded24 [RewriteStatepointsForGC] Move an expensive debugging check to XDEBUG
The check in question is attempting to help find cases where we haven't relocated a pointer at a safepoint we should have.  It does this by coercing the value to null at any safepoint which doesn't relocate it.  

Unfortunately, this turns out to be rather expensive in terms of memory usage and time.  The number of stores inserted can grow with O(number of values x number of statepoints).  On at least one example I looked at, over half of peak memory usage was coming from this check.  

With this change, the check is no longer enabled by default in Asserts builds.  It is enabled for expensive asserts builds and has a command line option to enable it in both Asserts and non-Asserts builds.  

llvm-svn: 234761
2015-04-13 16:41:32 +00:00
David Blaikie
d6556ea6e1 Remove default in fully-covered switch (to fix Clang -Werror -Wcovered-switch-default)
llvm-svn: 234760
2015-04-13 16:37:50 +00:00
Jan Vesely
2f77dad259 R600: Add carry and borrow instructions. Use them to implement UADDO/USUBO
v2: tighten the sub64 tests
v3: rename to CARRY/BORROW
v4: fixup test cmdline
    add known bits computation
    use sign extend instead of sub 0,x
    better add test
v5: remove redundant break
    move lowering to separate functions
    fix comments

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewers: arsenm
llvm-svn: 234759
2015-04-13 16:26:00 +00:00
David Blaikie
7ac8d214b5 llvm-readobj: teach it to handle MachO Universal Archive correctly
Patch by Chilledheart (rwindz0@gmail.com).

Reviewed By: rafael

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

llvm-svn: 234758
2015-04-13 16:05:49 +00:00
David Blaikie
ce0784d591 [docs] Update outdated ExtendingLLVM.rst
Summary:
The document is still incomplete in some degrees, but updated to reflect the
latest changes. Anyway we can detail it if any one think it is not enough. For
the sake of it, some useful examples are listed below:

Refer to r113618 "Add X86 MMX type to bitcode and Type" for how to add a new
type.

> One notable change from then is only one thing that ``lib/VMCore`` is renamed
to ``lib/IR``.

Refer to r194760 "Add addrspacecast instruction" for how to add a new
instruction.

Patch by Chilledheart (rwindz0@gmail.com).

Reviewed By: echristo

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

llvm-svn: 234757
2015-04-13 16:04:17 +00:00
Jan Vesely
f5fabb9a42 LegalizeDAG: Try to use Overflow operations when expanding ADD/SUB
v2: consider BooleanContents when processing overflow

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewers: resistor, jholewinsky (nvidia parts)
Differential Revision: http://reviews.llvm.org/D6340

llvm-svn: 234755
2015-04-13 15:32:01 +00:00
Rafael Espindola
f087ddcbc4 Fix SupportsSeeking detection on windows.
Will be tested by existing tests once used (soon).

llvm-svn: 234737
2015-04-13 11:09:48 +00:00
John Brawn
e206f50870 [ARM] Align global variables passed to memory intrinsics
Fill in the TODO in CodeGenPrepare::OptimizeCallInst so that global
variables that are passed to memory intrinsics are aligned in the same
way that allocas are.

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

llvm-svn: 234735
2015-04-13 10:47:39 +00:00
Rafael Espindola
cedb53e4f1 Add r234615 back, but make sure outs() is binary.
Original message.

Have one raw_fd_ostream constructor forward to the other.

This fixes some odd behaviour differences between the two. In particular,
the version that takes a FD no longer unconditionally sets stdout to binary.

llvm-svn: 234734
2015-04-13 10:28:56 +00:00
NAKAMURA Takumi
0e31718486 Revert r234615, "Have one raw_fd_ostream constructor forward to the other."
It broke MSVCRT hosts:

  LLVM :: Object/check_binary_output.ll
  LLVM :: Object/extract.ll

llvm-svn: 234721
2015-04-13 04:54:19 +00:00
NAKAMURA Takumi
bcb0a1f5fc [CMake] Uniquify LLVM_ABI_BREAKING_CHECKS. It reverts r233784, "[CMake] Cache in LLVMConfig.cmake."
llvm-svn: 234720
2015-04-13 04:54:12 +00:00
NAKAMURA Takumi
5c3cc5dcad llvm/test/CodeGen/R600/fminnum.ll: Relax an expression for NaN on MSVCRT like r204118.
<stdin>:202:2: note: possible intended match here
   2143289344(1.#QNAN0e+00), 2(2.802597e-45)

llvm-svn: 234719
2015-04-13 04:54:06 +00:00
Duncan P. N. Exon Smith
41e27d946d Revert "Verifier: Check for incompatible bit piece expressions"
This reverts commit r234698.

This caused a use-after-free: `QueuedBitPieceExpressions` holds onto
references to `DbgInfoIntrinsic`s and references them past where they're
deleted (this is because the verifier is run as a function pass, and
then `verifyTypeRefs()` is called during `doFinalization()`).

I'll include a reduced crasher for `llc` when I recommit the check.

llvm-svn: 234717
2015-04-13 00:06:28 +00:00
Jan Vesely
1ece4af5d6 R600: Make FMIN/MAXNUM legal on all asics
v2: Add tests

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
reviewer: arsenm
llvm-svn: 234716
2015-04-12 23:45:05 +00:00
Jan Vesely
72de192d73 R600: remove manual BFE optimization
Fixed since r233079

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
reviewer: arsenm
llvm-svn: 234715
2015-04-12 23:45:01 +00:00
Petr Hosek
bbb668b972 [MC] Write padding into fragments when -mc-relax-all flag is used
Summary:
When instruction bundling is enabled and the -mc-relax-all flag is
set, we can write bundle padding directly into fragments and avoid
creating large number of fragments significantly reducing LLVM MC
memory usage.

Test Plan: Regression test attached

Reviewers: eliben

Subscribers: jfb, mseaborn

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

llvm-svn: 234714
2015-04-12 23:42:25 +00:00
Lang Hames
2bf8a1716d [Orc] Remove duplicate "then" in comment.
llvm-svn: 234710
2015-04-12 22:23:57 +00:00
Lang Hames
521a759f11 [Orc] Fix out-of-date comment for the IRCompileLayer.
llvm-svn: 234709
2015-04-12 22:21:48 +00:00
Lang Hames
2846a6ae44 [Orc] During module partitioning, rename anonymous and asm-private globals.
If they're not (re)named, these globals will fail to resolve when the
partitioned modules are linked.

llvm-svn: 234707
2015-04-12 20:05:51 +00:00
Mark Lacey
149e2c7419 Fix typo.
llvm-svn: 234706
2015-04-12 18:18:51 +00:00
Hal Finkel
41bf2cfa3a [PowerPC] Really iterate over all loops in PPCLoopDataPrefetch/PPCLoopPreIncPrep
When I fixed these a couple of days ago to iterate over all loops, not just
depth == 1 loops, I inadvertently made it such that we'd only look at the first
top-level loop. Make sure that we really look at all of them.

llvm-svn: 234705
2015-04-12 17:18:56 +00:00
Sanjoy Das
880c33e480 [LoopUnrollRuntime] Clean up a predicate.
Clean up a predicate I added in r229731, fix the relevant comment and
add a test case.  The earlier version is confusing to read and was also
buggy (probably not a coincidence) till Alexey fixed it in r233881.

llvm-svn: 234701
2015-04-12 01:24:01 +00:00
Duncan P. N. Exon Smith
70f9252a1a DebugInfo: Make MDSubprogram::getFunction() return Constant
Change `MDSubprogram::getFunction()` and
`MDGlobalVariable::getConstant()` to return a `Constant`.  Previously,
both returned `ConstantAsMetadata`.

llvm-svn: 234699
2015-04-11 20:27:40 +00:00
Duncan P. N. Exon Smith
112124e807 Verifier: Check for incompatible bit piece expressions
Convert an assertion into a `Verifier` check.  Bit piece expressions
must fit inside the variable, and mustn't be the entire variable.
Catching this in the verifier will help us find bugs sooner, and makes
`DIVariable::getSizeInBits()` dead code.

llvm-svn: 234698
2015-04-11 19:58:35 +00:00
Duncan P. N. Exon Smith
50254bcfdc DebugInfo: Remove dead DIDescriptor::replaceAllUsesWith()
r234696 replaced the only use of `DIDescriptor::replaceAllUsesWith()`
with `DIBuilder::replaceTemporary()` (added in r234695).  Delete the
dead code.

llvm-svn: 234697
2015-04-11 19:29:09 +00:00
Duncan P. N. Exon Smith
c0c5b3d5ed DebugInfo: Introduce DIBuilder::replaceTemporary()
Add `DIBuilder::replaceTemporary()` as a replacement for
`DIDescriptor::replaceAllUsesWith()`.  I'll update clang to use the new
method, and then come back to delete the original.

This method dispatches to `replaceAllUsesWith()` or
`replaceWithUniqued()`, depending on whether the replacement is actually
a different node from the original.

llvm-svn: 234695
2015-04-11 19:04:09 +00:00
Benjamin Kramer
a304c427ee Mark empty default constructors as =default if it makes the type POD
NFC

llvm-svn: 234694
2015-04-11 18:57:14 +00:00
Duncan P. N. Exon Smith
00851732f5 DebugInfo: Assume a valid pointer for DISubprogram::getFunction()
llvm-svn: 234693
2015-04-11 18:15:48 +00:00
Benjamin Kramer
9ea802df93 Make OnDiskChainedHashTableGenerator's Bucket type a POD type and reorder fields to optimize padding
For the common case of offset_type=unsigned this brings Bucket from 24 to 16
bytes.

llvm-svn: 234692
2015-04-11 18:00:28 +00:00