1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00
Commit Graph

114390 Commits

Author SHA1 Message Date
Sanjay Patel
efccc5f4a5 use bool operator shortcut; NFC
llvm-svn: 231123
2015-03-03 20:41:27 +00:00
Andrew Kaylor
b825507df8 Fixing problem with field initialization order
llvm-svn: 231122
2015-03-03 20:22:09 +00:00
Adrian Prantl
fadb9a888c Fix PR22762. When emitting a DWARF expression check whether this is the
frame register before checking if there is a DWARF register number for it.

Thanks to H.J. Lu for diagnosing this and providing the testcase!

llvm-svn: 231121
2015-03-03 20:12:52 +00:00
Andrew Kaylor
6232795e40 Outline cleanup handlers for native Windows C++ exception handling
Differential Revision: http://reviews.llvm.org/D7865

llvm-svn: 231117
2015-03-03 20:00:16 +00:00
Kit Barton
2e98937142 Add the following 64-bit vector integer arithmetic instructions added in POWER8:
vaddudm
vsubudm
vmulesw
vmulosw
vmuleuw
vmulouw
vmuluwm
vmaxsd
vmaxud
vminsd
vminud
vcmpequd
vcmpequd.
vcmpgtsd
vcmpgtsd.
vcmpgtud
vcmpgtud.
vrld
vsld
vsrd
vsrad

Phabricator review: http://reviews.llvm.org/D7959

llvm-svn: 231115
2015-03-03 19:55:45 +00:00
David Blaikie
0dc6751111 DeltaAlgorithm: Provide protected default copy ctor for use by test derived class.
Without this, use of this copy ctor is deprecated in C++11 due to the
presence of a user-declared dtor.

Marking the class final is just a little extra security that there are
no further derived classes that may then end up using the intermediate
base class's copy assignment operator and cause slicing to occur.

I didn't bother marking the other (non-test) base class final, since it
has reference members so it won't have any implicit assignment operators
anyway. Open to ideas on that, though.

We probably want a warning about use of a slicing assignment operator,
then I wouldn't worry so much about marking the class as final.

llvm-svn: 231114
2015-03-03 19:53:04 +00:00
David Blaikie
757418c592 Remove explicit no-op dtor in favor of the implicit dtor so as not to disable/deprecate the copy operations.
llvm-svn: 231113
2015-03-03 19:53:02 +00:00
David Blaikie
3c0760986b Remove no-op dtor so that use of the implicit copy ctor/assignment operator are not deprecated.
llvm-svn: 231112
2015-03-03 19:52:59 +00:00
Eric Christopher
cb31f7b7b3 Add a comment above findRepresentativeClass explaining why it's
where it is so that future generations can understand.

llvm-svn: 231111
2015-03-03 19:47:14 +00:00
David Blaikie
45de056bab Remove explicit copy ctor in favor of the implicit one so that the use of the copy assignment operator is not deprecated.
llvm-svn: 231110
2015-03-03 19:29:14 +00:00
David Blaikie
b00aeb2651 Remove explicit copy assignment operator in favor of the implicit/default to avoid disabling/deprecating the implicit copy ctor.
llvm-svn: 231109
2015-03-03 19:29:13 +00:00
David Blaikie
b91a23cd9c Remove explicit copy ctor in favor of the default so as not to disable/deprecate the implicit copy assignment operator
llvm-svn: 231108
2015-03-03 19:29:11 +00:00
David Blaikie
f31ea4e48b unique_ptrify FullDependenceAnalysis::DV
Making this type a little harder to abuse (see workaround relating to
use of the implicit copy ctor in the prior commit)

llvm-svn: 231104
2015-03-03 19:20:18 +00:00
David Blaikie
202b6bec64 FullDependenceAnalysis: Avoid using the (deprecated in C++11) copy ctor
llvm-svn: 231103
2015-03-03 19:20:16 +00:00
David Blaikie
ad269f6b2c Remove some explicit copy assignment operators is favor of implicit ones, as their presence makes the use of the implicit copy ctor deprecated in C++11
llvm-svn: 231102
2015-03-03 19:20:13 +00:00
Dario Domizioli
ef32d033a1 Fix PR22750: non-determinism causes assertion failure in DWARF generation
The cause of the issue is the interaction of two factors:
1) When generating a DW_TAG_imported_declaration DIE which imports another 
   imported declaration, the code in AsmPrinter/DwarfCompileUnit.cpp 
   asserts that the second imported declaration must already have a DIE.
2) There is a non-determinism in the order in which imported declarations
   within the same scope are processed.
Because of the non-determinism (2), it is possible that an imported 
declaration is processed before another one it depends on, breaking the 
assumption in (1).

The source of the non-determinism is that the imported declaration 
DIDescriptors are sorted by scope in DwarfDebug::beginModule(); however that
sort is not a stable_sort, therefore the order of the declarations within 
the same scope is not preserved. The attached patch changes the std::sort to
a std::stable_sort and it fixes the problem.

Test omitted due to it being non-deterministic and depending on the
implementation of std::sort.

llvm-svn: 231100
2015-03-03 18:40:53 +00:00
David Blaikie
d215bbe13e [Small]BitVector::reference: Explicitly default copy construction as it is deprecated in C++11 in the presence of explicit copy assignment.
I tried making these private & friended to the BitVector, but that
didn't work - there's one use of BitVector::reference in Clang that
actually copies it into a local variable & uses it from there, rather
than just using the result of op[] in a temporary expression.

Whether or not this is desired is debatable (we could just fix that one
use in Clang) & it's not clear which way the C++ standard falls on this
for std::bitset's reference type (it has the same bug at least in
libstdc++, but Clang's -Wdeprecated doesn't flag it, because it's in a
standard header)

While it was only BitVector::reference's copy ctor that was referenced
by user code, I made SmallBitVector::reference's copy ctor public too,
for consistency.

llvm-svn: 231099
2015-03-03 18:39:00 +00:00
David Blaikie
53212311bb Avoid explicitly declaring the copy assignment operator, as this unnecessarily makes the copy ctor deprecated in C++11
llvm-svn: 231095
2015-03-03 18:29:27 +00:00
David Blaikie
8df4a6e33e Twine: Explicitly default the copy ctor as it's otherwise deprecated in C++11 by the presence of a user-declared copy assignment operator.
llvm-svn: 231094
2015-03-03 18:29:25 +00:00
David Blaikie
6e52863d6d DenseMapIterator: Avoid explicitly declaring the copy ctor as this makes the copy assignment operator deprecated in C++11
llvm-svn: 231093
2015-03-03 18:29:23 +00:00
Dan Albert
d16b58773b Make Triple::getOSVersion make sense for Android.
Reviewers: srhines

Reviewed By: srhines

Subscribers: llvm-commits

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

llvm-svn: 231090
2015-03-03 18:23:51 +00:00
Eric Christopher
3126a12618 80-column fixup.
llvm-svn: 231088
2015-03-03 17:54:39 +00:00
Reid Kleckner
34a636c32a Make llvm.eh.begincatch use an outparam
Ultimately, __CxxFrameHandler3 needs us to put a stack offset in a
table, and it will take responsibility for copying the exception object
into that slot. Modelling the exception object as an SSA value returned
by begincatch isn't going to work in general, so make it use an output
parameter.

Reviewers: andrew.w.kaylor

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

llvm-svn: 231086
2015-03-03 17:41:09 +00:00
Chad Rosier
c6fa32cc2a [AArch64] When combining constant mul of -3, prefer (sub x, (shl x, N)).
This change only effects codegen when the constant is -3.

llvm-svn: 231085
2015-03-03 17:31:01 +00:00
Duncan P. N. Exon Smith
8d1b74869c DebugInfo: Move new hierarchy into place
Move the specialized metadata nodes for the new debug info hierarchy
into place, finishing off PR22464.  I've done bootstraps (and all that)
and I'm confident this commit is NFC as far as DWARF output is
concerned.  Let me know if I'm wrong :).

The code changes are fairly mechanical:

  - Bumped the "Debug Info Version".
  - `DIBuilder` now creates the appropriate subclass of `MDNode`.
  - Subclasses of DIDescriptor now expect to hold their "MD"
    counterparts (e.g., `DIBasicType` expects `MDBasicType`).
  - Deleted a ton of dead code in `AsmWriter.cpp` and `DebugInfo.cpp`
    for printing comments.
  - Big update to LangRef to describe the nodes in the new hierarchy.
    Feel free to make it better.

Testcase changes are enormous.  There's an accompanying clang commit on
its way.

If you have out-of-tree debug info testcases, I just broke your build.

  - `upgrade-specialized-nodes.sh` is attached to PR22564.  I used it to
    update all the IR testcases.
  - Unfortunately I failed to find way to script the updates to CHECK
    lines, so I updated all of these by hand.  This was fairly painful,
    since the old CHECKs are difficult to reason about.  That's one of
    the benefits of the new hierarchy.

This work isn't quite finished, BTW.  The `DIDescriptor` subclasses are
almost empty wrappers, but not quite: they still have loose casting
checks (see the `RETURN_FROM_RAW()` macro).  Once they're completely
gutted, I'll rename the "MD" classes to "DI" and kill the wrappers.  I
also expect to make a few schema changes now that it's easier to reason
about everything.

llvm-svn: 231082
2015-03-03 17:24:31 +00:00
Duncan P. N. Exon Smith
9f33848921 IR: Add missing API to specialized metadata nodes
Add the final bits of API that `DIBuilder` needs before the new nodes
can be moved into place.

  - Add `MDType::clone()` and `MDType::setFlags()` to support
    `DIBuilder::createTypeWithFlags()`.
  - Add `MDBasicType::get()` overload that just requires a tag and a
    name, as a convenience for `DIBuilder::createUnspecifiedType()`.
  - Add `MDLocalVariable::withInline()` and
    `MDLocalVariable::withoutInline()` to support
    `llvm::createInlinedVariable()` and
    `llvm::cleanseInlinedVariable()`.

(Somehow these got lost inside the "move into place" patch I'm about to
commit -- better to commit separately!)

llvm-svn: 231079
2015-03-03 16:45:34 +00:00
NAKAMURA Takumi
76110bc083 Make llvm/test/Object/archive-format.test CRLF-tolerant.
llvm-svn: 231074
2015-03-03 15:54:48 +00:00
Michael Kuperstein
f22ea25e15 [X86][Haswell][SchedModel] Fix patterns for scalar FMA3 variants.
llvm-svn: 231073
2015-03-03 15:47:02 +00:00
Elena Demikhovsky
04be7be81d AVX-512: Moved patterns for masked load/store under avx_store, avx_load classes.
No functional changes.

llvm-svn: 231069
2015-03-03 15:03:35 +00:00
Daniel Jasper
5816fc16b8 During PHI elimination, split critical edges that move copies out of loops.
This prevents the behavior observed in llvm.org/PR22369. I am not sure
whether I am reading the code correctly, but the early exit based on
isLiveOutPastPHIs() seems to make the wrong assumption that
RegisterCoalescer won't be able to coalesce those copies later.

This change hides the new behavior behind -no-phi-elim-live-out-early-exit
as it currently breaks four tests:
 * Assertion in:
     CodeGen/Hexagon/hwloop-cleanup.ll
 * Worse code in:
     CodeGen/X86/coalescer-commute4.ll
     CodeGen/X86/phys_subreg_coalesce-2.ll
     CodeGen/X86/zlib-longest-match.ll
   The root cause here seems to be that the heuristic that determines
   the visitation order in RegisterCoalescer gets less lucky.

llvm-svn: 231064
2015-03-03 10:23:11 +00:00
Daniel Berlin
ff008384da Add range iterators to Extract/InsertValueInst indices
llvm-svn: 231062
2015-03-03 09:31:01 +00:00
Nick Lewycky
e0f770e573 Switch up whitespace with better whitespace.
llvm-svn: 231059
2015-03-03 07:59:45 +00:00
Nick Lewycky
29e592e429 Revert the non-cleanup part of r230769 because it introduced a non-determinism found only in the names of symbols.
llvm-svn: 231058
2015-03-03 07:57:45 +00:00
Owen Anderson
f9f1328955 Cleanup after r230934 per Dave's suggestions.
llvm-svn: 231056
2015-03-03 05:39:27 +00:00
Craig Topper
526ab94856 [X86] Remove some unused code from disassembler.
llvm-svn: 231055
2015-03-03 05:24:03 +00:00
Sanjoy Das
511422c328 Revert "[ADT] fail-fast iterators for DenseMap"
This reverts commit r231035.  It breaks clang.

llvm-svn: 231050
2015-03-03 01:59:38 +00:00
Peter Collingbourne
a2227f309c Add explicit type to empty std::set initializer to fix the libc++ build.
llvm-svn: 231047
2015-03-03 01:39:13 +00:00
Ahmed Bougacha
d8b9ab0f6c [X86] Special-case 2x CMOV when custom-inserting.
This lets us avoid a few copies that are otherwise hard to get rid of.
The way this is done is, the custom-inserter looks at the following
instruction for another CMOV, and replaces both at the same time.
A previous version used a new CMOV2 opcode, but the custom inserter
is expected to be able to return a different basic block anyway, which
means it's OK - though far from ideal - to alter that block's contents.
Explicitly document that, in case it ever makes a difference.
Alternatives welcome!

Follow-up to r231045.

rdar://19767934
Closes http://reviews.llvm.org/D8019

llvm-svn: 231046
2015-03-03 01:21:16 +00:00
Ahmed Bougacha
10768a3027 [X86] Combine (cmov (and/or (setcc) (setcc))) into (cmov (cmov)).
Fold and/or of setcc's to double CMOV:

(CMOV F, T, ((cc1 | cc2) != 0)) -> (CMOV (CMOV F, T, cc1), T, cc2)
(CMOV F, T, ((cc1 & cc2) != 0)) -> (CMOV (CMOV T, F, !cc1), F, !cc2)

When we can't use the CMOV instruction, it might increase branch
mispredicts.  When we can, or when there is no mispredict, this
improves throughput and reduces register pressure.

These can't be catched by generic combines, because the pattern can
appear when legalizing some instructions (such as fcmp une).

rdar://19767934
http://reviews.llvm.org/D7634

llvm-svn: 231045
2015-03-03 01:09:14 +00:00
Reid Kleckner
a9f6fbee65 Fix cppeh breakage due to racing commits
llvm-svn: 231044
2015-03-03 01:04:39 +00:00
Peter Collingbourne
fca689c3d4 LowerBitSets: Use byte arrays instead of bit sets to represent in-memory bit sets.
By loading from indexed offsets into a byte array and applying a mask, a
program can test bits from the bit set with a relatively short instruction
sequence. For example, suppose we have 15 bit sets to lay out:

A (16 bits), B (15 bits), C (14 bits), D (13 bits), E (12 bits),
F (11 bits), G (10 bits), H (9 bits), I (7 bits), J (6 bits), K (5 bits),
L (4 bits), M (3 bits), N (2 bits), O (1 bit)

These bits can be laid out in a 16-byte array like this:

      Byte Offset
    0123456789ABCDEF
Bit
  7 HHHHHHHHHIIIIIII
  6 GGGGGGGGGGJJJJJJ
  5 FFFFFFFFFFFKKKKK
  4 EEEEEEEEEEEELLLL
  3 DDDDDDDDDDDDDMMM
  2 CCCCCCCCCCCCCCNN
  1 BBBBBBBBBBBBBBBO
  0 AAAAAAAAAAAAAAAA

For example, to test bit X of A, we evaluate ((bits[X] & 1) != 0), or to
test bit X of I, we evaluate ((bits[9 + X] & 0x80) != 0). This can be done
in 1-2 machine instructions on x86, or 4-6 instructions on ARM.

This uses the LPT multiprocessor scheduling algorithm to lay out the bits
efficiently.

Saves ~450KB of instructions in a recent build of Chromium.

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

llvm-svn: 231043
2015-03-03 00:49:28 +00:00
Andrew Kaylor
8cfaab59d9 Remap arguments and non-alloca values used by outlined C++ exception handlers.
Differential Revision: http://reviews.llvm.org/D7844

llvm-svn: 231042
2015-03-03 00:41:03 +00:00
Benjamin Kramer
11218d5663 LoopIdiom: Give globals for memset_pattern16 private linkage.
There's really no reason to have them have entries in the symbol table
anymore. Old versions of ld64 had some bugs in this area but those have
been fixed long ago.

llvm-svn: 231041
2015-03-03 00:17:09 +00:00
Reid Kleckner
8e7faa02a8 WinEH: Run opt -instnamer over some cppeh tests and update CHECKs
In the future, we should run the output of clang through instnamer to
make it easier to manually edit test cases.

No functionality change.

llvm-svn: 231037
2015-03-03 00:05:35 +00:00
Sanjoy Das
2f0e5ce88f [ADT] fail-fast iterators for DenseMap
Summary:
This patch is an attempt at making `DenseMapIterator`s "fail-fast".
Fail-fast iterators that have been invalidated due to insertion into
the host `DenseMap` deterministically trip an assert (in debug mode)
on access, instead of non-deterministically hitting memory corruption
issues.

Reviewers: dexonsmith, dberlin, ruiu, chandlerc

Reviewed By: chandlerc

Subscribers: yaron.keren, chandlerc, llvm-commits

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

llvm-svn: 231035
2015-03-02 23:29:37 +00:00
Michael Zolotukhin
979300007b TLI: Factor out sanitizeFunctionName. NFC.
llvm-svn: 231034
2015-03-02 23:24:40 +00:00
Benjamin Kramer
55ef0034fb IndexedMap: Document why SmallVector<T, 0> is preferable here.
llvm-svn: 231028
2015-03-02 22:20:22 +00:00
Adrian Prantl
807869b230 Revert "Revert "For the dwarf expression code get the subtarget off of the current""
This reapplies r230990 without modifications.

llvm-svn: 231024
2015-03-02 22:02:36 +00:00
Adrian Prantl
ebdf2406b7 Refactor DebugLocDWARFExpression so it doesn't require access to the
TargetRegisterInfo. DebugLocEntry now holds a buffer with the raw bytes
of the pre-calculated DWARF expression.

Ought to be NFC, but it does slightly alter the output format of the
textual assembly.

This reapplies 230930 without the assertion in DebugLocEntry::finalize()
because not all Machine registers can be lowered into DWARF register
numbers and floating point constants cannot be expressed.

llvm-svn: 231023
2015-03-02 22:02:33 +00:00
Reid Kleckner
0667f1b1dc cmake: Use MSVC atomics with clang-cl
llvm-svn: 231022
2015-03-02 22:00:23 +00:00