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

125005 Commits

Author SHA1 Message Date
Craig Topper
5aa701a422 [IR] Add classof for GetElementPtrConstantExpr, CompareConstantExpr, InsertValueConstantExpr, and ExtractValueConstantExpr. All but CompareConstantExpr were being used in casts that were erroneously using ConstantExpr::classof due to inheritance. While there use cast<CompareConstantExpr> to simplify code slightly.
I believe in one place we were always casting to ExtractValueConstantExpr when we were trying to choose between ExtractValueConstantExpr and InsertValueConstantExpr because of this. But since they have identical layouts this didn't cause any observable problems.

llvm-svn: 255624
2015-12-15 06:11:36 +00:00
Craig Topper
466a91c686 Use CmpInst::Predicate instead of 'unsigned short' in some places. NFC
llvm-svn: 255623
2015-12-15 06:11:33 +00:00
Mehdi Amini
24492edbe4 Fix MSVC build with LLVM_ENABLE_THREADS=OFF
Follow-up to the ThreadPool implementation.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255621
2015-12-15 05:53:41 +00:00
Justin Bogner
c058f3a850 LoopUtils: Remove defaults for arguments that are always specified. NFC
llvm-svn: 255620
2015-12-15 05:52:13 +00:00
Cong Hou
011b64311c Replace the unit test of BranchProbability::normalizeEdgeWeights() with BranchProbability::normalizeProbabilities().
BranchProbability::normalizeEdgeWeights() is going to be retired soon.

llvm-svn: 255618
2015-12-15 05:25:27 +00:00
Teresa Johnson
ff38b7b132 Fix template parameter pack handling in ThreadPool
Fixes passing of template parameter pack via std::forward and add
unittest.

llvm-svn: 255617
2015-12-15 04:44:02 +00:00
Weiming Zhao
348c97685c Bump up MAX_SUBTARGET_FEATURES
Summary:
Currently, ARMGenSubtargetInfo (from ARM.td) is reaching the limit of 96:
  enum : uint64_t {
       ...
       XScale = 95
  };
       
We need to bump the maximum value up to accommodate future changes and/or customized subtarget definitions. 

Reviewers: apazos, t.p.northover

Subscribers: llvm-commits, aemerson

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

llvm-svn: 255616
2015-12-15 04:42:49 +00:00
Vaivaswatha Nagaraj
e6c5ddb0c2 NFC: Fix typo in comment
llvm-svn: 255615
2015-12-15 04:41:10 +00:00
Quentin Colombet
f330db0411 [ShrinkWrapping] Do not choose restore point inside loops.
The post-dominance property is not sufficient to guarantee that a restore point
inside a loop is safe.
E.g.,
 while(1) {
   Save
   Restore
   if (...)
     break;
   use/def CSRs
 }
All the uses/defs of CSRs are dominated by Save and post-dominated
by Restore. However, the CSRs uses are still reachable after
Restore and before Save are executed.

This fixes PR25824

llvm-svn: 255613
2015-12-15 03:28:11 +00:00
Dan Gohman
e14d166c8c [WebAssembly] Use an immediate OperandType for offset operands.
llvm-svn: 255612
2015-12-15 03:21:48 +00:00
Nico Weber
630645d32a Try to let r255604 have an effect.
llvm-svn: 255611
2015-12-15 03:14:19 +00:00
Mehdi Amini
02dd190506 Add specific header for MSVC to be able to build with LLVM_ENABLE_THREADS=OFF
Follow-up to the ThreadPool library

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255604
2015-12-15 02:32:03 +00:00
Dan Gohman
e4d038595f [WebAssembly] Remove .import printing.
For now, LLVM doesn't know about wasm module imports, so it shouldn't
emit .import directives.

llvm-svn: 255602
2015-12-15 02:20:44 +00:00
JF Bastien
197f4baa5e WebAssembly: test global array indexing
This case was tested in the linker from code, but not from globals indexing into other globals. The linker currently barfs on this, ncbray volunteered to fix it.

llvm-svn: 255601
2015-12-15 02:02:51 +00:00
Mehdi Amini
b29b50a9dd Instcombine: destructor loads of structs that do not contains padding
For non padded structs, we can just proceed and deaggregate them.
We don't want ot do this when there is padding in the struct as to not
lose information about this padding (the subsequents passes would then
try hard to preserve the padding, which is undesirable).

Also update extractvalue.ll and cast.ll so that they use structs with padding.

Remove the FIXME in the extractvalue of laod case as the non padded case is
handled when processing the load, and we don't want to do it on the padded
case.

Patch by: Amaury SECHET <deadalnix@gmail.com>

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255600
2015-12-15 01:44:07 +00:00
Reid Kleckner
0c98151b50 [llvm-readobj] s/FunctionName/LinkageName/ for codeview dumping
The symbol being printed in this field comes from the main symbol table,
not 0xF1 subsection. Use LinkageName to make that a lot clearer.

llvm-svn: 255596
2015-12-15 01:23:55 +00:00
Cong Hou
8389268d7a Let operator/ with uint32_t rhs operand be a member of BranchProbability and add a new operator /=. NFC.
llvm-svn: 255595
2015-12-15 01:21:14 +00:00
Mehdi Amini
54fc055738 Add a C++11 ThreadPool implementation in LLVM
This is a very simple implementation of a thread pool using C++11
thread. It accepts any std::function<void()> for asynchronous
execution. Individual task can be synchronize using the returned
future, or the client can block on the full queue completion.

In case LLVM is configured with Threading disabled, it falls back
to sequential execution using std::async with launch:deferred.

This is intended to support parallelism for ThinLTO processing in
linker plugin, but is generic enough for any other uses.

This is a recommit of r255444 ; trying to workaround a bug in the
MSVC 2013 standard library. I think I was hit by:

 http://connect.microsoft.com/VisualStudio/feedbackdetail/view/791185/std-packaged-task-t-where-t-is-void-or-a-reference-class-are-not-movable

Recommit of r255589, trying to please g++ as well.

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

From: mehdi_amini <mehdi_amini@91177308-0d34-0410-b5e6-96231b3b80d8>
llvm-svn: 255593
2015-12-15 00:59:19 +00:00
Mehdi Amini
5acecbc1ec Revert "Add a C++11 ThreadPool implementation in LLVM"
This reverts commit r255589. Breaks g++

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255591
2015-12-15 00:42:44 +00:00
Mehdi Amini
dbdd929681 Add a C++11 ThreadPool implementation in LLVM
This is a very simple implementation of a thread pool using C++11
thread. It accepts any std::function<void()> for asynchronous
execution. Individual task can be synchronize using the returned
future, or the client can block on the full queue completion.

In case LLVM is configured with Threading disabled, it falls back
to sequential execution using std::async with launch:deferred.

This is intended to support parallelism for ThinLTO processing in
linker plugin, but is generic enough for any other uses.

This is a recommit of r255444 ; trying to workaround a bug in the
MSVC 2013 standard library. I think I was hit by:

 http://connect.microsoft.com/VisualStudio/feedbackdetail/view/791185/std-packaged-task-t-where-t-is-void-or-a-reference-class-are-not-movable

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 255589
2015-12-15 00:38:05 +00:00
Xinliang David Li
7640a69ad0 [PGO] make profile prefix even shorter and more readable
llvm-svn: 255586
2015-12-15 00:32:56 +00:00
Quentin Colombet
adff55a1d6 [X86] Add relaxtion logic for SBB instructions.
Prior to this patch, we would wrongly stick to the variant with imm8 encoding
even when the relocation could not fit that size.

rdar://problem/23785506

llvm-svn: 255583
2015-12-15 00:09:23 +00:00
Mike Aizatsky
4bb54a6d86 sancov: coverage can be reported by multiple functions.
Differential Revision: http://reviews.llvm.org/D15430

llvm-svn: 255582
2015-12-14 23:55:04 +00:00
Rafael Espindola
79cecc5f46 Yet another missing include.
llvm-svn: 255579
2015-12-14 23:39:05 +00:00
Rafael Espindola
2d1739bf50 A better attempt to add a missing include
llvm-svn: 255578
2015-12-14 23:34:35 +00:00
Rafael Espindola
5f225be291 Trying to fix the build in a bot.
llvm-svn: 255577
2015-12-14 23:31:08 +00:00
Xinliang David Li
10c9ed2b0f [PGO] Shorten profile symbol prefixes
Profile symbols have long prefixes which waste space and creating pressure for linker.
This patch shortens the prefixes to minimal length without losing verbosity.

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

llvm-svn: 255575
2015-12-14 23:26:27 +00:00
Justin Bogner
5881fcfc6b LoopRotate: Convert the methods of LoopRotate to utility functions. NFC
This moves the actual work to do loop rotation into standalone
functions with the analysis results they need passed in as arguments,
leaving the class itself as a relatively simple shim. This will make
the functions easy to reuse when we're ready to port this
transformation to the new pass manager.

llvm-svn: 255574
2015-12-14 23:22:48 +00:00
Justin Bogner
8f1642f744 LoopRotate: Reorder some method implementations. NFC
This just moves some callers after their callees. My next patch will
convert some of these methods to stand alone functions, and that diff
is more obviously NFC if I move these first. That change, in turn,
will make it much easier to port this pass to the new pass manager
once the loop pass manager is in place.

llvm-svn: 255573
2015-12-14 23:22:44 +00:00
Rafael Espindola
5b397256de Use diagnostic handler in the LLVMContext
This patch converts code that has access to a LLVMContext to not take a
diagnostic handler.

This has a few advantages

* It is easier to use a consistent diagnostic handler in a single program.
* Less clutter since we are not passing a handler around.

It does make it a bit awkward to implement some C APIs that return a
diagnostic string. I will propose new versions of these APIs and
deprecate the current ones.

llvm-svn: 255571
2015-12-14 23:17:03 +00:00
Quentin Colombet
d47bcd5f61 [X86] Add relaxtion logic for ADC instructions.
Prior to this patch, we would wrongly stick to the variant with imm8 encoding
even when the relocation could not fit that size.

rdar://problem/23785506

llvm-svn: 255570
2015-12-14 23:12:40 +00:00
Pete Cooper
77ebe023c7 Factor out some duplication. NFC.
llvm-svn: 255569
2015-12-14 23:10:52 +00:00
Dan Gohman
2f67df6acf [WebAssembly] Add type prefixes to call instructions
Add return type information to call and call_indirect instructions. This
allows them to be disambiguated without knowledge of the callee.

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

llvm-svn: 255565
2015-12-14 22:56:51 +00:00
Dan Gohman
49cc10581b [WebAssembly] Implement a new algorithm for placing BLOCK markers
Implement a new BLOCK scope placement algorithm which better handles
early-return blocks and early exists from nested scopes.

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

llvm-svn: 255564
2015-12-14 22:51:54 +00:00
Dan Gohman
bcdb4cbfb8 [WebAssembly] Avoid adding redundant EXPR_STACK uses.
llvm-svn: 255563
2015-12-14 22:37:23 +00:00
Reid Kleckner
a7d52d8543 Revert "Don't create unnecessary PHIs"
This reverts commit r255489.

It causes test failures in Chromium and does not appear to respect the
AlternativeV parameter.

llvm-svn: 255562
2015-12-14 22:36:57 +00:00
Chih-Hung Hsieh
bd51d0c9b1 [X86] Part 2 to fix x86-64 fp128 calling convention.
Part 1 was submitted in http://reviews.llvm.org/D15134.
Changes in this part:
* X86RegisterInfo.td, X86RecognizableInstr.cpp: Add FR128 register class.
* X86CallingConv.td: Pass f128 values in XMM registers or on stack.
* X86InstrCompiler.td, X86InstrInfo.td, X86InstrSSE.td:
  Add instruction selection patterns for f128.
* X86ISelLowering.cpp:
  When target has MMX registers, configure MVT::f128 in FR128RegClass,
  with TypeSoftenFloat action, and custom actions for some opcodes.
  Add missed cases of MVT::f128 in places that handle f32, f64, or vector types.
  Add TODO comment to support f128 type in inline assembly code.
* SelectionDAGBuilder.cpp:
  Fix infinite loop when f128 type can have
  VT == TLI.getTypeToTransformTo(Ctx, VT).
* Add unit tests for x86-64 fp128 type.

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

llvm-svn: 255558
2015-12-14 22:08:36 +00:00
Sanjay Patel
14a74b66f7 add fast-math-flags to 'call' instructions (PR21290)
This patch adds optional fast-math-flags (the same that apply to fmul/fadd/fsub/fdiv/frem/fcmp)
to call instructions in IR. Follow-up patches would use these flags in LibCallSimplifier, add 
support to clang, and extend FMF to the DAG for calls.

Motivating example:

%y = fmul fast float %x, %x
%z = tail call float @sqrtf(float %y)

We'd like to be able to optimize sqrt(x*x) into fabs(x). We do this today using a function-wide
attribute for unsafe-math, but we really want to trigger on the instructions themselves:

%z = tail call fast float @sqrtf(float %y)

because in an LTO build it's possible that calls with fast semantics have been inlined into a
function with non-fast semantics.

The code changes and tests are based on the recent commits that added "notail":
http://reviews.llvm.org/rL252368

and added FMF to fcmp:
http://reviews.llvm.org/rL241901

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

llvm-svn: 255555
2015-12-14 21:59:03 +00:00
Ben Craig
070547c587 Reordering fields to reduce padding in LLVM. NFC
llvm-svn: 255554
2015-12-14 21:57:05 +00:00
Dan Gohman
519f31480b [WebAssembly] Add an assert to sanity-check dead flags.
The WebAssemblyStoreResults pass runs before LiveVariables, so it doesn't
expect to have to keep dead flags up to date; check this with an assert.

llvm-svn: 255551
2015-12-14 21:53:54 +00:00
Pete Cooper
9826aaba7a Start implementing FDE dumping when printing the eh_frame.
This code adds some simple decoding of the FDE's in an eh_frame.

There's still more to be done in terms of error handling and verification.

Also, we need to be able to decode the CFI's.

llvm-svn: 255550
2015-12-14 21:49:49 +00:00
Pete Cooper
91dbcd5e25 Print the eh_frame section in MachoDump.
This is the start of work to dump the contents of the eh_frame section.

It currently emits CIE entries.  FDE entries will come later.

It also needs improved error checking which will follow soon.

http://reviews.llvm.org/D15502

Reviewed by Kevin Enderby and Lang Hames.

llvm-svn: 255546
2015-12-14 21:39:27 +00:00
Krzysztof Parzyszek
0ea913c715 [Hexagon] Add "const" to function parameters in HexagonInstrInfo
llvm-svn: 255544
2015-12-14 21:32:25 +00:00
Diego Novillo
c2f8d731bc Fix formatting. NFC.
llvm-svn: 255541
2015-12-14 20:37:15 +00:00
Krzysztof Parzyszek
0cb4e2fced [Packetizer] Add AliasAnalysis as a parameter to the packetizer
This will make the depedence graph more accurate if an alias analysis
is provided. If nullptr is specified in its place, the behavior will
remain as it is currently.

llvm-svn: 255540
2015-12-14 20:35:13 +00:00
Pete Cooper
183f136627 Add missing vtable anchor's.
The following description is from http://reviews.llvm.org/D15481:

ICmpInst, GetElementPtrInst and PHINode have no anchor functions. This causes the vtable and the type info (if RTTI is enabled in user code) to be emitted in multiple translation units.

Before 3.7, the destructors were the key functions for these nodes, but they have been removed.

There have been discussions about this here: http://lists.llvm.org/pipermail/llvm-dev/2015-August/089010.html and here: http://lists.llvm.org/pipermail/llvm-dev/2015-December/092921.html.

Patch by Visoiu Mistrih Francis

llvm-svn: 255538
2015-12-14 20:29:16 +00:00
Krzysztof Parzyszek
1c65753742 [Packetizer] Make endPacket virtual
This will allow custom handling of packet finalization. The current
definition of endPacket will still perform the default finalization.

llvm-svn: 255537
2015-12-14 20:12:24 +00:00
David Majnemer
d1ffa4dc99 [ConstantFold] Fix bitcast to gep constant folding transform.
Make sure to check that the destination type is sized.
A check was present but was incorrectly checking the source type
instead.

Patch by Amaury SECHET!

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

llvm-svn: 255536
2015-12-14 19:30:32 +00:00
Yaron Keren
7962cd5cdd Save several std::string constructions using llvm::Twine.
llvm-svn: 255535
2015-12-14 19:28:40 +00:00
Peter Collingbourne
3ad596a73f docs: Correct wording in LangRef relating to available_externally linkage.
Differential Revision: http://reviews.llvm.org/D15343

llvm-svn: 255534
2015-12-14 19:22:37 +00:00