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

118011 Commits

Author SHA1 Message Date
Rafael Espindola
c34d08d085 Fix a regression in .pop_section.
It was calling ChangeSection with the wrong current section, eventually leading
to a crash.

llvm-svn: 239335
2015-06-08 20:08:55 +00:00
Simon Pilgrim
22832a2b81 [X86][SSE] Added lzcnt vector tests.
llvm-svn: 239333
2015-06-08 19:58:43 +00:00
Akira Hatanaka
bcc4af8eec Include header file <functional>.
This is a follow-up to r239325.

llvm-svn: 239329
2015-06-08 19:03:32 +00:00
Benjamin Kramer
74b3c476bd Prefer copy init over direct init. NFC.
llvm-svn: 239327
2015-06-08 18:58:57 +00:00
Akira Hatanaka
76bd57e472 [ARM] Pass a callback to FunctionPass constructors to enable skipping execution
on a per-function basis.

Previously some of the passes were conditionally added to ARM's pass pipeline
based on the target machine's subtarget. This patch makes changes to add those
passes unconditionally and execute them conditonally based on the predicate
functor passed to the pass constructors. This enables running different sets of
passes for different functions in the module.

rdar://problem/20542263

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

llvm-svn: 239325
2015-06-08 18:50:43 +00:00
Pete Cooper
54b42ad48b Use a PointerUnion in MCSymbol for Section and Fragment. NFC.
The Fragment and Section, and a bool for HasFragment were all used to create
a PointerUnion.  Just use a pointer union instead.

llvm-svn: 239324
2015-06-08 18:41:57 +00:00
Pete Cooper
226ceaabfc Remove includes of MCMachOSymbolFlags.h after it was deleted
llvm-svn: 239318
2015-06-08 17:25:57 +00:00
Pete Cooper
0be2ca565c Make flags get/set method protected so that all flags have to be managed by subclasses.
All of ELF, COFF and MachO now manipulate the flags in helpers so we don't need
anyone to read the flags directly, but instead via those helpers.

Reviewed by Rafael Espíndola.

llvm-svn: 239317
2015-06-08 17:17:30 +00:00
Pete Cooper
148cf86301 Move all flags logic to MCSymbolMachO.
Also delete the now unused MCMachOSymbolFlags.h header as the only enum in there was moved to MCSymbolMachO.

Similarly to ELF and COFF, manipulating the flags is now done via helpers instead of spread
throughout the codebase.

Reviewed by Rafael Espíndola.

llvm-svn: 239316
2015-06-08 17:17:28 +00:00
Pete Cooper
8f9b97685a Add MCSymbolMachO which will be used to hide the MCSymbolMachO flags.
Reviewed by Rafael Espíndola.

llvm-svn: 239315
2015-06-08 17:17:23 +00:00
Pete Cooper
97458cd6bb Move all of the MCSymbol COFF flags logic in to MCSymbolCOFF.
All flags setting/getting is now done in the class with helper methods instead
of users having to get the bits in the correct order.

Reviewed by Rafael Espíndola.

llvm-svn: 239314
2015-06-08 17:17:19 +00:00
Pete Cooper
ad147e1d08 Move COFF Type in to the MCSymbolCOFF class.
The flags field in MCSymbol only needs to be 16-bits on ELF and MachO.
This moves the 16-bit Type out of there so that it can be reduced in size in a future commit.

Reviewed by Rafael Espíndola.

llvm-svn: 239313
2015-06-08 17:17:16 +00:00
Pete Cooper
15314d5ace Add MCSymbolCOFF class and use it to get and set the COFF type field.
Reviewed by Rafael Espíndola.

llvm-svn: 239312
2015-06-08 17:17:12 +00:00
Pete Cooper
e257f209ee Change MCSymbol IsELF to an enum to support future MCSymbolCOFF and MCSymbolMachO.
Reviewed by Rafael Espíndola.

llvm-svn: 239311
2015-06-08 17:17:09 +00:00
Matthias Braun
2d0e1092b5 X86: Reject register operands with obvious type mismatches.
While we have some code to transform specification like {ax} into
{eax}/{rax} if the operand type isn't 16bit, we should reject cases
where there is no sane way to do this, like the i128 type in the
example.

Related to rdar://21042280

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

llvm-svn: 239309
2015-06-08 16:56:23 +00:00
Oliver Stannard
54cf2be082 Fix assertion failure in global-merge with unused ConstantExpr
The global-merge pass was crashing because it assumes that all ConstantExprs
(reached via the global variables that they use) have at least one user.

I haven't worked out a way to test this, as an unused ConstantExpr cannot be
represented by serialised IR, and global-merge can only be run in llc, which
does not run any passes which can make a ConstantExpr dead.

This (reduced to the point of silliness) C code triggers this bug when compiled
for arm-none-eabi at -O1:

  static a = 7;
  static volatile b[10] = {&a};

  c;
  main() {
    c = 0;
    for (; c < 10;)
      printf(b[c]);
  }

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

llvm-svn: 239308
2015-06-08 16:55:31 +00:00
Colin LeMahieu
e930f8c3f6 [Hexagon] Adding functionality for searching for compound instruction pairs. Compound instructions reduce slot resource requirements freeing those packet slots up for more instructions.
llvm-svn: 239307
2015-06-08 16:34:47 +00:00
Simon Pilgrim
4434fd1d6b [DAGCombiner] Added CTLZ vector constant folding support.
llvm-svn: 239305
2015-06-08 16:19:00 +00:00
Sanjay Patel
044a50e6ce fix typos; NFC
llvm-svn: 239303
2015-06-08 15:21:38 +00:00
Javed Absar
125fd5df95 ARM]: Add support for MMFR4_EL1 in assembler
This patch adds support for system register MMFR4_EL1 (memory model feature register) in the assembler.
This register provides information about the implemented memory model and memory management support.

llvm-svn: 239302
2015-06-08 15:01:11 +00:00
Petar Jovanovic
6ef784bc64 [Mips64][mcjit] Add R_MIPS_PC32 relocation
This patch adds R_MIPS_PC32 relocation for Mips64.

Patch by Vladimir Radosavljevic.

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

llvm-svn: 239301
2015-06-08 14:10:23 +00:00
Igor Breger
545f43a067 AVX-512: Implemented 256/128bit VALIGND/Q instructions for SKX and KNL
Implemented DAG lowering for all these forms.
Added tests for DAG lowering and encoding.

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

llvm-svn: 239300
2015-06-08 14:03:17 +00:00
Artur Pilipenko
c17a17c081 Minor refactoring of GEP handling in isDereferenceablePointer
For GEP instructions isDereferenceablePointer checks that all indices are constant and within bounds. Replace this index calculation logic to a call to accumulateConstantOffset. Separated from the http://reviews.llvm.org/D9791

Reviewed By: sanjoy

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

llvm-svn: 239299
2015-06-08 11:58:13 +00:00
Silviu Baranga
e570ae0867 [LAA] Fix estimation of number of memchecks
Summary:
We need to add a runtime memcheck for pair of accesses (x,y) where at least one of x and y
are writes.
 
Assuming we have w writes and r reads, currently this number is  estimated as being
w* (w+r-1). This estimation will count (write,write) pairs twice and will overestimate
the number of checks required.

This change adds a getNumberOfChecks method to RuntimePointerCheck, which
will count the number of runtime checks needed (similar in implementation to
needsAnyChecking) and uses it to produce the correct number of runtime checks.

Test Plan:
llvm test suite
spec2k
spec2k6

Performance results: no changes observed (not surprising since the formula for 1 writer is basically the same, which would covers most cases - at least with the current check limit).

Reviewers: anemet

Reviewed By: anemet

Subscribers: mzolotukhin, llvm-commits

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

llvm-svn: 239295
2015-06-08 10:27:06 +00:00
Simon Pilgrim
21da15a377 [DAGCombiner] Added CTTZ vector constant folding support.
llvm-svn: 239293
2015-06-08 09:57:09 +00:00
Hao Liu
d39edfda46 [LoopVectorize] Teach Loop Vectorizor about interleaved memory accesses.
Interleaved memory accesses are grouped and vectorized into vector load/store and shufflevector.
E.g. for (i = 0; i < N; i+=2) {
       a = A[i];         // load of even element
       b = A[i+1];       // load of odd element
       ...               // operations on a, b, c, d
       A[i] = c;         // store of even element
       A[i+1] = d;       // store of odd element
     }

  The loads of even and odd elements are identified as an interleave load group, which will be transfered into vectorized IRs like:
     %wide.vec = load <8 x i32>, <8 x i32>* %ptr
     %vec.even = shufflevector <8 x i32> %wide.vec, <8 x i32> undef, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
     %vec.odd = shufflevector <8 x i32> %wide.vec, <8 x i32> undef, <4 x i32> <i32 1, i32 3, i32 5, i32 7>

  The stores of even and odd elements are identified as an interleave store group, which will be transfered into vectorized IRs like:
     %interleaved.vec = shufflevector <4 x i32> %vec.even, %vec.odd, <8 x i32> <i32 0, i32 4, i32 1, i32 5, i32 2, i32 6, i32 3, i32 7> 
     store <8 x i32> %interleaved.vec, <8 x i32>* %ptr

This optimization is currently disabled by defaut. To try it by adding '-enable-interleaved-mem-accesses=true'. 

llvm-svn: 239291
2015-06-08 06:39:56 +00:00
Davide Italiano
046ff0975b [llvm-readobj] Use the new symbol API.
llvm-svn: 239286
2015-06-08 04:55:29 +00:00
Hao Liu
0ff9b2806d [LoopAccessAnalysis] Teach LAA to check the memory dependence between strided accesses.
Differential Revision: http://reviews.llvm.org/D9368

llvm-svn: 239285
2015-06-08 04:48:37 +00:00
Peter Collingbourne
3ab00fb7aa Do not build LLD from tools/Makefile, as LLD no longer has a Makefile build.
llvm-svn: 239283
2015-06-08 04:04:13 +00:00
Michael Zolotukhin
62674c27ed Remove SCEVCache and FindConstantPointers from complete loop unrolling heuristic.
Summary:
Using some SCEV functionality helped to entirely remove SCEVCache class and FindConstantPointers SCEV visitor.
Also, this makes the code more universal - I'll take advandate of it in next patches where I start handling additional types of instructions.

Test Plan: Tests would be submitted in subsequent patches.

Reviewers: atrick, chandlerc

Reviewed By: atrick, chandlerc

Subscribers: atrick, llvm-commits

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

llvm-svn: 239282
2015-06-08 03:28:06 +00:00
Peter Collingbourne
08d6c7d7dd Fix Windows build.
llvm-svn: 239279
2015-06-08 02:43:32 +00:00
Peter Collingbourne
2a2ba76ed8 llvm-ar: Move archive writer to Object.
No functional change intended, other than some minor changes to certain
diagnostics.

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

llvm-svn: 239278
2015-06-08 02:32:01 +00:00
Craig Topper
111f0bf996 [TableGen] Remove unnecessary default constructed SMLoc that just existed to return. Instead just call the default constructor in the return.
llvm-svn: 239277
2015-06-08 01:35:45 +00:00
Craig Topper
5179da4f2e [TableGen] Use range-based for loop. NFC
llvm-svn: 239276
2015-06-08 01:35:43 +00:00
Craig Topper
a01af2c306 [TableGen] Remove unnecessary extern declaration that's already in an included header file.
llvm-svn: 239275
2015-06-08 01:35:42 +00:00
Craig Topper
14be9a98ed [TableGen] Use the SMLoc header file instead of SourceMgr header file in a couple places. NFC
llvm-svn: 239274
2015-06-08 01:35:40 +00:00
Colin LeMahieu
fb88ee51e5 [objdump] Moving PrintImmHex out of MachODump and in to llvm-objdump and setting instprinter appropriately.
llvm-svn: 239265
2015-06-07 21:07:17 +00:00
Simon Pilgrim
a926353c50 [X86] Added tzcnt vector tests.
llvm-svn: 239264
2015-06-07 21:01:34 +00:00
Colin LeMahieu
c7f373cefc [MC] Function naming NFC.
llvm-svn: 239263
2015-06-07 20:29:37 +00:00
Matt Arsenault
68493112f0 SeparateConstOffsetFromGEP: Pass address space to isLegalAddressingMode
llvm-svn: 239262
2015-06-07 20:17:44 +00:00
Matt Arsenault
eee18a6222 Make NaryReassociate pass the address space to isLegalAddressingMode
No test since the kinds of transforms this prevents seem to not really
be relevant for SI's different addressing modes.

llvm-svn: 239261
2015-06-07 20:17:42 +00:00
Matt Arsenault
b88a683ecf Add isLegalAddressingMode address space argument to TTI
Update to match the TLI version, and remove the TLI version's
default argument.

llvm-svn: 239260
2015-06-07 20:12:03 +00:00
Peter Zotov
c1bd6359e1 [cmake] [OCaml] Make ocamldoc targets depend on output files
OCaml doc builds fail without .cmi files, and .cmi files are collected
in ocaml_outputs. Therefore, make doc targets depend on ocaml_outputs as
well.

Fixes: https://llvm.org/bugs/show_bug.cgi?id=23777

Patch by Michał Górny <mgorny@gentoo.org>

llvm-svn: 239259
2015-06-07 19:22:22 +00:00
Simon Pilgrim
9f0e1e3606 [X86] Added BitScanForward/BitScanReverse memory folding + tests
llvm-svn: 239257
2015-06-07 18:34:25 +00:00
Benjamin Kramer
7bfdd04272 Remove global std::string. NFC.
llvm-svn: 239254
2015-06-07 16:36:28 +00:00
Simon Pilgrim
1ba656a454 Fixed line endings
llvm-svn: 239253
2015-06-07 16:09:48 +00:00
Simon Pilgrim
8ea8a8c606 [DAGCombiner] Added CTPOP vector constant folding support.
Added tests to the existing SSE/AVX test files.

llvm-svn: 239252
2015-06-07 15:37:14 +00:00
Benjamin Kramer
44559ffece [AsmWriter] Rewrite module asm printing using StringRef::split.
No change in output intended.

llvm-svn: 239251
2015-06-07 13:59:33 +00:00
Filipe Cabecinhas
de0ff53626 Fix doxygen comments. NFC
llvm-svn: 239250
2015-06-07 06:40:24 +00:00
Craig Topper
fbba0828fb [TableGen] Remove unnecessary include. NFC.
llvm-svn: 239249
2015-06-07 06:01:22 +00:00