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

24882 Commits

Author SHA1 Message Date
Tom Stellard
814127be3e AMDGPU: Fix typo
llvm-svn: 254120
2015-11-26 02:04:11 +00:00
Sanjoy Das
99ca015392 [OperandBundles] Treat "deopt" operand bundles specially
Teach LLVM optimize to more precisely in the presence of "deopt" operand
bundles.  "deopt" operand bundles imply that the call they're attached
to is at least `readonly` (i.e. they don't imply clobber semantics), and
they don't capture their bundle operands.

llvm-svn: 254118
2015-11-26 01:16:05 +00:00
Tom Stellard
eb7e999b29 AMDGPU: Add llvm.amdgcn.dispatch.ptr intrinsic
Summary:
This returns a pointer to the dispatch packet, which can be used to load
information about the kernel dispach.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 254116
2015-11-26 00:43:29 +00:00
Xinliang David Li
df875576b5 Fix a typo introduced in previous patches
llvm-svn: 254112
2015-11-26 00:02:23 +00:00
Xinliang David Li
739b63a55d [PGO] Implement ValueProfiling Closure interfaces for runtime value profile data
This is one of the many steps to commonize value profiling support between profile
runtime and compiler/llvm tools.

After this change, profiler runtime now can share the same C APIs to do VP
serialization/deseriazation with LLVM host tools (and produces value data
in identical format between indexed and raw profile).

It is not yet enabled in profiler runtime yet.

Also added a unit test case to test runtime profile data serialization/deserialization
interfaces implemented using common closure code.

llvm-svn: 254110
2015-11-25 23:31:18 +00:00
Artyom Skrobov
3803dae0a6 Expose isXxxConstant() functions from SelectionDAGNodes.h (NFC)
Summary:
Many target lowerings copy-paste the code to test SDValues for known constants.
This code can instead be shared in SelectionDAG.cpp, and reused in the targets.

Reviewers: MatzeB, andreadb, tstellarAMD

Subscribers: arsenm, jyknight, llvm-commits

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

llvm-svn: 254085
2015-11-25 19:41:11 +00:00
Eric Christopher
5f84aed4f6 Fix some places where we were assuming that memory type had been legalized
to a simple type when lowering a truncating store of a vector type. In this
case for an EVT we'll return Expand as we should in all of the cases anyhow.

The testcase triggered at the one in VectorLegalizer::LegalizeOp, inspection
found the rest.

llvm-svn: 254061
2015-11-25 09:11:53 +00:00
Xinliang David Li
29597bc958 [PGO] Convert InstrProfRecord based serialization methods to use common C methods
1. Convert serialization methods using InstrProfRecord as source into C (impl)
   interfaces using Closure.
2. Reimplement InstrProfRecord serialization method to use new C interface
   as dummy wrapper. 

Now it is ready to implement wrapper for runtime value profile data.

(The new code need better source location -- but not changed in this patch to
 minimize diffs. )

llvm-svn: 254057
2015-11-25 06:23:38 +00:00
Xinliang David Li
960920a165 [PGO] convert a subset of C++ interfaces into C (for sharing) (NFC)
llvm-svn: 254056
2015-11-25 04:29:24 +00:00
Xinliang David Li
03ec0b37d7 Add missing documentation. (NFC)
llvm-svn: 254051
2015-11-25 01:13:44 +00:00
Sanjoy Das
dcc5bddb02 [OperandBundles] Extract duplicated code into a helper function, NFC
llvm-svn: 254047
2015-11-25 00:42:24 +00:00
Sanjoy Das
d16b4e5c5e [InstCombine] Don't drop operand bundles
Reviewers: majnemer

Subscribers: llvm-commits

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

llvm-svn: 254046
2015-11-25 00:42:19 +00:00
Rong Xu
c4f897c441 [PGO] Revert revision r254021,r254028,r254035
Revert the above revision due to multiple issues.

llvm-svn: 254040
2015-11-24 23:49:08 +00:00
Xinliang David Li
ddeee8f963 [PGO] Add mapper callback to interfaces retrieving value data for site (NFC)
This allows cleaner implementation and merging retrieving/mapping in
one pass.

llvm-svn: 254038
2015-11-24 23:36:52 +00:00
Rong Xu
025bf7be0c [PGO] MST based PGO instrumentation infrastructure
This patch implements a minimum spanning tree (MST) based instrumentation for
PGO. The use of MST guarantees minimum number of CFG edges getting
instrumented. An addition optimization is to instrument the less executed
edges to further reduce the instrumentation overhead. The patch contains both the
instrumentation and the use of the profile to set the branch weights.

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

llvm-svn: 254021
2015-11-24 21:31:25 +00:00
Cong Hou
c0bb26286b [X86] Fix several issues related to X86's psadbw instruction.
This patch fixes the following issues:

1. Fix the return type of X86psadbw: it should not be the same type of inputs.
   For vNi8 inputs the output should be vMi64, where M = N/8.
2. Fix the return type of int_x86_avx512_psad_bw_512 accordingly.
3. Fix the definiton of PSADBW, VPSADBW, and VPSADBWY accordingly.
4. Adjust the return type when building a DAG node of X86ISD::PSADBW type.
5. Update related tests.


Differential revision: http://reviews.llvm.org/D14897

llvm-svn: 254010
2015-11-24 19:51:26 +00:00
Xinliang David Li
9766247b4e [PGO] Introduce value profile data closure type.
The closure is designed to abstact away two types of value profile
data:
  - InstrProfRecord which is the primary data structure used to
    represent profile data in host tools (reader, writer, and profile-use)
  - value profile runtime data structure suitable to be used by C
    runtime library.
Both sources of data need to serialize to disk/memory-buffer in common
format: ValueProfData.

The abstraction allows compiler-rt's raw profiler writer to share
the same code with indexed profile writer.

llvm-svn: 254008
2015-11-24 19:21:15 +00:00
Xinliang David Li
620aee58f0 [PGO] Small interface change to be profile rt ready
Convert two C++ static member functions to be C APIs. This
is one of the many steps to get ready to share VP writer code
with profiler runtime. 

llvm-svn: 253999
2015-11-24 18:15:46 +00:00
Xinliang David Li
57937fbcb6 Minor refactor to make VP writing more efficient
llvm-svn: 253994
2015-11-24 17:03:24 +00:00
Krzysztof Parzyszek
ce2383b240 Add vector types for intrinsics
Author: Ron Lieberman <ronl@codeaurora.org>
llvm-svn: 253992
2015-11-24 16:28:14 +00:00
Krzysztof Parzyszek
450319e8a0 Add new vector types for 512-, 1024- and 2048-bit vectors
Those types are needed to implement instructions for Hexagon Vector
Extensions (HVX): 16x32, 16x64, 32x16, 32x32, 32x64, 64x8, 64x16,
64x32, 128x8, 128x16, 256x8, 512x1, and 1024x1.

llvm-svn: 253978
2015-11-24 13:07:35 +00:00
Cong Hou
5747eb82f8 Let SelectionDAG start to use probability-based interface to add successors.
The patch in http://reviews.llvm.org/D13745 is broken into four parts:

1. New interfaces without functional changes.
2. Use new interfaces in SelectionDAG, while in other passes treat probabilities
as weights.
3. Use new interfaces in all other passes.
4. Remove old interfaces.

This the second patch above. In this patch SelectionDAG starts to use
probability-based interfaces in MBB to add successors but other MC passes are
still using weight-based interfaces. Therefore, we need to maintain correct
weight list in MBB even when probability-based interfaces are used. This is
done by updating weight list in probability-based interfaces by treating the
numerator of probabilities as weights. This change affects many test cases
that check successor weight values. I will update those test cases once this
patch looks good to you.


Differential revision: http://reviews.llvm.org/D14361

llvm-svn: 253965
2015-11-24 08:51:23 +00:00
Mehdi Amini
2fe02188ef Add a FunctionImporter helper to perform summary-based cross-module function importing
Summary:
This is a helper to perform cross-module import for ThinLTO. Right now
it is importing naively every possible called functions.

Reviewers: tejohnson

Subscribers: dexonsmith, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 253954
2015-11-24 06:07:49 +00:00
Mehdi Amini
53aa625845 Add findFunctionInfoList() accessor to FunctionInfoIndex.
Summary:
This allows to query for a function in the map without creating an
entry, allowing to use a const FunctionInfoIndex.

Reviewers: tejohnson

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 253953
2015-11-24 06:07:42 +00:00
Davide Italiano
44f68f6357 [DIE] Make DIE.h NDEBUG conditional-free.
Switch dump()/print() method definitions to LLVM_DUMP_METHOD instead.

llvm-svn: 253945
2015-11-24 02:21:43 +00:00
Xinliang David Li
baa2f77b42 Use make_unique [NFC]
llvm-svn: 253942
2015-11-24 00:32:00 +00:00
Xinliang David Li
02a0716447 Remove trailing space in comments
llvm-svn: 253941
2015-11-24 00:31:41 +00:00
Krzysztof Parzyszek
af76cac3cc Revert r253923.
Per Eric's request.

llvm-svn: 253928
2015-11-23 22:19:57 +00:00
Krzysztof Parzyszek
6c363eee43 Add new vector types for 512-, 1024- and 2048-bit vectors
Those types are needed to implement instructions for Hexagon Vector
Extensions (HVX): 16x32, 16x64, 32x16, 32x32, 32x64, 64x8, 64x16,
64x32, 128x8, 128x16, 256x8, 512x1, and 1024x1.

llvm-svn: 253923
2015-11-23 22:00:17 +00:00
Nathan Slingerland
a06290a805 [Support] Add optional argument to SaturatingAdd() and SaturatingMultiply() to indicate that overflow occurred
Summary: Adds the ability for callers to detect when saturation occurred on the result of saturating addition/multiplication.

Reviewers: davidxl, silvas, rsmith

Subscribers: llvm-commits

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

llvm-svn: 253921
2015-11-23 21:54:22 +00:00
Xinliang David Li
0f29a15199 [PGO] Add --text option for llvm-profdata show|merge commands
The new option is similar to the SampleProfile dump option.

- dump raw/indexed format into text profile format
- merge the profile and output into text profile format.

Note that Value Profiling data text format is not yet designed. 
That functionality will be added later.

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

llvm-svn: 253913
2015-11-23 20:47:38 +00:00
Teresa Johnson
c0ecb3ad3f [ThinLTO] Deduplicate function index loading into shared helper (NFC)
Add a shared helper routine to read the function index from a file
and create/return the function index object. Use it in llvm-link and
llvm-lto.

llvm-svn: 253903
2015-11-23 19:19:11 +00:00
Xinliang David Li
0b39dbc2f8 [PGO] Introduce alignment macro for instr-prof control data(NFC)
llvm-svn: 253893
2015-11-23 18:02:59 +00:00
Xinliang David Li
a6bd292bad Fix comment not allowed in C90
llvm-svn: 253880
2015-11-23 17:05:45 +00:00
Nathan Slingerland
3f093e190d [Support] Fix SaturatingMultiply<T>() to be correct (and fast), Re-enable Unit Tests
Summary:
This change fixes the SaturatingMultiply<T>() function template to not cause undefined behavior with T=uint16_t.
Thanks to Richard Smith's contribution, it also no longer requires an integer division.

Patch by Richard Smith.

Reviewers: silvas, davidxl

Subscribers: rsmith, davidxl, llvm-commits

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

llvm-svn: 253870
2015-11-23 15:33:43 +00:00
Xinliang David Li
4878e2f9f9 Move two Value Profiler data structs to InstrProfData.inc (NFC)
llvm-svn: 253848
2015-11-23 05:29:51 +00:00
Xinliang David Li
076c9c59a2 [PGO] Fix remaining bugs in ProfData template file (when used by compiler-rt)
1. move const qualifier out of raw header field type as runtime use of the header
   needs to initialze the fields
2. use C style casting for integer types.

llvm-svn: 253844
2015-11-23 03:49:07 +00:00
Mehdi Amini
b100a96489 Add const qualifier for FunctionInfoIndex in ModuleLinker and linkInModule() (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 253840
2015-11-23 01:59:16 +00:00
Mehdi Amini
60d59439ad Add const qualifier on FunctionInfoIndex::hasExportedFunctions() (NFC)
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 253839
2015-11-23 01:59:12 +00:00
Benjamin Kramer
ddaab51a02 [SCEV] Simplify code. NFC.
llvm-svn: 253825
2015-11-22 17:27:27 +00:00
Krzysztof Parzyszek
56c6ad68a8 Revert r253810. The builds should be fine now.
llvm-svn: 253822
2015-11-22 16:13:51 +00:00
Krzysztof Parzyszek
73d3ee06e8 Avoid dependency between TableGen and CodeGen
Duplicate a few common definitions between DFAPacketizer.cpp and
DFAPacketizerEmitter.cpp to avoid including files from CodeGen
in TableGen.

llvm-svn: 253820
2015-11-22 15:20:19 +00:00
Xinliang David Li
0a6ec9cd2c [PGO] move names of runtime sections definitions to InstrProfData.inc
In profile runtime implementation for Darwin, Linux and FreeBSD, the
names of sections holding profile control/counter/naming data need
to be known by the runtime in order to locate the start/end of the
data. Moving the name definitions to the common file to specify the
connection.

llvm-svn: 253814
2015-11-22 05:42:31 +00:00
NAKAMURA Takumi
c91f2dd88f Temporary fix broken build.ninja after r253790.
FIXME: This can be reverted several hours later.

r253790 introduced cyclic deps around llvm-tblgen and it was affecting after reverting.

  ninja: error: dependency cycle: include/llvm/IR/Attributes.inc -> include/llvm/IR/Attributes.inc.tmp -> bin/llvm-tblgen -> utils/TableGen/CMakeFiles/obj.llvm-tblgen.dir/DFAPacketizerEmitter.cpp.o -> include/llvm/IR/Attributes.inc

It may be a ninja's bug.

FYI, renaming DFAPacketizerEmitter.cpp would be useless.

llvm-svn: 253810
2015-11-22 02:32:49 +00:00
Xinliang David Li
fc1d455417 [PGO] move raw magic and version def to InstrProfData.inc
These are shared definitions too. (NFC)

llvm-svn: 253809
2015-11-22 02:05:50 +00:00
Xinliang David Li
dde2bc76c3 [PGO] InstrProf Template file documentation change
Add more complete description of the content and structure
of the template file. Made the comment in C style to be
shared by C runtime. Also enhance the file structure so
that it can included as standalone header for common 
definitions.

llvm-svn: 253807
2015-11-22 01:51:31 +00:00
Xinliang David Li
241cfd4800 [PGO] Move Value Profile Kind to InstrProfData.inc
ValueProfKind value affects runtime data structure and
definition is shared between compiler-rt and LLVM.

llvm-svn: 253806
2015-11-22 01:39:07 +00:00
Xinliang David Li
b823f0597b [PGO] Define value profiling updater API signature in InstrProfData.inc (NFC)
llvm-svn: 253805
2015-11-22 00:22:07 +00:00
Rafael Espindola
9cb8841b77 Have a single way for creating unique value names.
We had two code paths. One would create names like "foo.1" and the other
names like "foo1".

For globals it is important to use "foo.1" to help C++ name demangling.
For locals there is no strong reason to go one way or the other so I
kept the most common mangling (foo1).

llvm-svn: 253804
2015-11-22 00:16:24 +00:00
Xinliang David Li
64fc4b9d72 [PGO] Move Raw Header def into template file InstrProfData.inc
To enable code sharing with compiler-rt (NFC)

llvm-svn: 253803
2015-11-22 00:06:39 +00:00