Commit Graph

124378 Commits

Author SHA1 Message Date
Rong Xu
f52f1369a2 [PGO] Fix build errors in x86_64-darwin
Fix buildbot failure for x86_64-darwin due to r254021


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254028 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 21:55:50 +00:00
Evgeniy Stepanov
341bfd40b3 [msan] Relax origin-alignment test.
Change origin-alignment test to test only the alignment of the origin
store, and not the exact instruction sequence used to compute the
address. This makes the test less fragile and, in particular, lets it
pass both with the old and new MSan ABIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254027 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 21:44:16 +00:00
Rong Xu
24c623b4e4 [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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254021 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 21:31:25 +00:00
Teresa Johnson
c44b0f4b6b [ThinLTO] Refactor function body scan during importing into helper (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254020 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 21:15:19 +00:00
Xinliang David Li
0aa5b4b94e Fix sphinx-build error when building documentation.
Consolidate the description of -binary/-text option description
to avoid duplicate ID error by sphinux-build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254018 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 20:48:25 +00:00
Sanjoy Das
0a10aff3d9 [RuntimeDyld] Fix a class of arithmetic errors introduced in r253918
r253918 had refactored expressions like "A - B.Address + C" to "A -
B.getAddressWithOffset(C)".  This is incorrect, since the latter really
computes "A - B.Address - C".

None of the tests I can run locally on x86 broke due to this bug, but it
is the current suspect for breakage on the AArch64 buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254017 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 20:37:01 +00:00
Simon Pilgrim
24dc54c6a5 [X86][FMA] Optimize FNEG(FMA) Patterns
X86 needs to use its own FMA opcodes, preventing the standard FNEG(FMA) pattern table recognition method used by other platforms. This patch adds support for lowering FNEG(FMA(X,Y,Z)) into a single suitably negated FMA instruction.

Fix for PR24364

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254016 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 20:31:46 +00:00
Matthias Braun
1bb03c5884 LiveVariables should not clobber MachineOperand::IsDead, ::IsKill on reserved physical registers
Patch by Nick Johnson <Nicholas.Paul.Johnson@deshawresearch.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254012 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 20:06:56 +00:00
Teresa Johnson
cd753d0cf9 [ThinLTO] Enable iterative importing in FunctionImport pass
Analyze imported function bodies and add any new external calls to
the worklist for importing. Currently no controls on the importing
so this will end up importing everything possible in the call tree
below the importing module. Basic profitability checks coming next.

Update test to check for iteratively inlined functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254011 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 19:55:04 +00:00
Cong Hou
5c1d0fd204 [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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254010 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 19:51:26 +00:00
Teresa Johnson
f3b9cb324e [ThinLTO] Handle previously imported and promoted locals in module linker
The new function import pass exposed an issue when we import references
to local values on multiple importing passes. They are renamed on each
import pass, and we need to ensure that the already promoted and renamed
references existing in the dest module are correctly identified and
updated so that they aren't spuriously renamed again (due to a perceived
conflict with the newly linked reference).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254009 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 19:46:58 +00:00
Xinliang David Li
e8ec005f39 [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254008 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 19:21:15 +00:00
Weiming Zhao
a8a4b7cd81 [Utils] Put includes in correct order. NFC.
Summary:
    Followed the guidelines in:
    http://llvm.org/docs/CodingStandards.html#include-style
    
    However, I noticed that uppercase named headers come before lowercase ones
    throughout the codebase. So kept them as is.
    
    Patch by Mandeep Singh Grang <mgrang@codeaurora.org>

Reviewers: majnemer, davide, jmolloy, atrick

Subscribers: sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254005 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 18:57:06 +00:00
Xinliang David Li
1386907d27 [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. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253999 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 18:15:46 +00:00
Sanjay Patel
4da18f10ae [InstCombine] fix propagation of fast-math-flags
Noticed while working on D4583:
http://reviews.llvm.org/D4583



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253997 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 17:51:20 +00:00
Sanjay Patel
22b828d817 use convenience function for copying IR flags; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253996 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 17:16:33 +00:00
Xinliang David Li
019c78a994 Minor refactor to make VP writing more efficient
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253994 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 17:03:24 +00:00
Rafael Espindola
2195ce5049 Make this test a bit more strict.
It now tests with files in both orders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253993 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 16:43:53 +00:00
Krzysztof Parzyszek
05ee0ece0b Add vector types for intrinsics
Author: Ron Lieberman <ronl@codeaurora.org>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253992 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 16:28:14 +00:00
Teresa Johnson
24a3d0e0ad [ThinLTO] Fix FunctionImport alias checking and test
Skip imports for weak_any aliases as well. Fix the test to check
non-import of weak aliases and functions, and import of normal alias.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253991 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 16:10:43 +00:00
Krzysztof Parzyszek
d233ea2165 Add names for the new vector types in CodeGenTarget.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253989 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 15:50:22 +00:00
Sanjay Patel
5c2d0848ab [x86] remove duplicate movq instruction defs (PR25554)
We had duplicated definitions for the same hardware '[v]movq' instructions. For example with SSE:

  def MOVZQI2PQIrr : RS2I<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR64:$src),
                     "mov{d|q}\t{$src, $dst|$dst, $src}", // X86-64 only
                     [(set VR128:$dst, (v2i64 (X86vzmovl (v2i64 (scalar_to_vector GR64:$src)))))],
                     IIC_SSE_MOVDQ>;

  def MOV64toPQIrr : RS2I<0x6E, MRMSrcReg, (outs VR128:$dst), (ins GR64:$src),
                     "mov{d|q}\t{$src, $dst|$dst, $src}",
                     [(set VR128:$dst, (v2i64 (scalar_to_vector GR64:$src)))],
                     IIC_SSE_MOVDQ>, Sched<[WriteMove]>;

As shown in the test case and PR25554:
https://llvm.org/bugs/show_bug.cgi?id=25554

This causes us to miss reusing an operand because later passes don't know these 'movq' are the same instruction.
This patch deletes one pair of these defs.
Sadly, this won't fix the original test case in the bug report. Something else is still broken.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253988 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 15:44:35 +00:00
Krzysztof Parzyszek
1c9cdef8b9 [Hexagon] Add missing include of <cctype>
Lack thereof breaks Windows builds due to the use of std::isspace
in HexagonInstrInfo.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253987 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 15:11:13 +00:00
Krzysztof Parzyszek
8e716832ef [Hexagon] Bring HexagonInstrInfo up to date
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253986 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 14:55:26 +00:00
Rafael Espindola
42fec0866c Add an already passing test.
This tests that a declaration can resolve to an alias.

I broke this locally while prototyping a change and it looks like a nice
test to have.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253984 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 14:15:50 +00:00
Krzysztof Parzyszek
ed5c8866a9 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253978 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 13:07:35 +00:00
Matt Arsenault
25a68d8d25 AMDGPU: Split LDS vector loads
If properly aligned this could allow using ds_read_b64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253975 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 12:18:54 +00:00
Matt Arsenault
04abf1ee5f AMDGPU: Split x8 and x16 vector loads instead of scalarize
The one regression in the builtin tests is in the read2 test which now
(again) has many extra copies, but this should be solved once the pass
is replaced with a DAG combine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253974 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 12:05:03 +00:00
Ismail Donmez
25203ad3b3 Fix build after r253954
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253969 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 09:48:09 +00:00
Pavel Labath
1b6b889f9c Fix non-PIC build after 253959
CMAKE_EXE_LINKER_FLAGS is a string. Appending a flag using list(APPEND) introduces an extra
semicolon which breaks stuff. Change this to append the value in the same way that everyone else
seems to be doing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253968 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 09:46:01 +00:00
Cong Hou
fc33b8bb31 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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253965 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:51:23 +00:00
Craig Topper
20faa148c7 [TableGen] Use std::remove_if instead of manually coded loops that call erase multiple times. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253964 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:47 +00:00
Craig Topper
b5302cfc21 [TableGen] Use the other version of EnforceVectorEltTypeIs inside the TypeSet version of EnforceVectorEltTypeIs to reduce duplicated code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253963 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:45 +00:00
Craig Topper
3e9844b111 [TableGen] Fix formatting and use logical OR. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253962 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:44 +00:00
Craig Topper
194e5aef9c [TableGen] Use std::set_intersection to merge TypeSets. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253961 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:42 +00:00
Craig Topper
370a2fa0fc [TableGen] Use SmallVector::assign instead of a resize and replace element.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253960 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:20:41 +00:00
Chris Bieneman
f92fdc8e93 [CMake] When disabling PIC, also pass -fno-pie when linking if it is supported.
Building clang with -fno-pie generates slightly faster code. In my not-very-rigorous testing I saw about a 4% speed up using the clang test-suite sources.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253959 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 08:04:59 +00:00
Craig Topper
5fb978c885 Revert change that accidentally snuck into r253955.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253956 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 06:24:06 +00:00
Craig Topper
60338334fc [TableGen] Use array_pod_sort. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253955 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 06:22:43 +00:00
Mehdi Amini
a7649e87bb 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253954 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 06:07:49 +00:00
Mehdi Amini
4857f32de4 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>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253953 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 06:07:42 +00:00
Cong Hou
b5b07c3686 [X86][SSE] Detect AVG pattern during instruction combine for SSE2/AVX2/AVX512BW.
This patch detects the AVG pattern in vectorized code, which is simply
c = (a + b + 1) / 2, where a, b, and c have the same type which are vectors of
either unsigned i8 or unsigned i16. In the IR, i8/i16 will be promoted to
i32 before any arithmetic operations. The following IR shows such an example:

%1 = zext <N x i8> %a to <N x i32>
%2 = zext <N x i8> %b to <N x i32>
%3 = add nuw nsw <N x i32> %1, <i32 1 x N>
%4 = add nuw nsw <N x i32> %3, %2
%5 = lshr <N x i32> %N, <i32 1 x N>
%6 = trunc <N x i32> %5 to <N x i8>

and with this patch it will be converted to a X86ISD::AVG instruction.

The pattern recognition is done when combining instructions just before type
legalization during instruction selection. We do it here because after type
legalization, it is much more difficult to do pattern recognition based
on many instructions that are doing type conversions. Therefore, for
target-specific instructions (like X86ISD::AVG), we need to take care of type
legalization by ourselves. However, as X86ISD::AVG behaves similarly to
ISD::ADD, I am wondering if there is a way to legalize operands and result
types of X86ISD::AVG together with ISD::ADD. It seems that the current design
doesn't support this idea.

Tests are added for SSE2, AVX2, and AVX512BW and both i8 and i16 types of
variant vector sizes.


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




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253952 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 05:44:19 +00:00
Davide Italiano
505dc6c863 [DIE] Make DIE.h NDEBUG conditional-free.
Switch dump()/print() method definitions to LLVM_DUMP_METHOD instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253945 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 02:21:43 +00:00
Chris Bieneman
b856f91ff4 [CMake] export_executable_symbols also needs to add -rdynamic to the linker flags on Darwin
Without -rdynamic LLVM built with LTO fails to pass "check" due to loadable modules failing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253944 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 00:58:58 +00:00
Xinliang David Li
ef9dbc69b5 Use make_unique [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253942 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 00:32:00 +00:00
Xinliang David Li
490527320f Remove trailing space in comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253941 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 00:31:41 +00:00
Sanjay Patel
f90755b7fe minimize test case but still show the bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253940 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 00:11:48 +00:00
Chris Bieneman
16a72ba921 NFC. Fixing my consistently incorrect spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253936 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 23:34:09 +00:00
Sanjay Patel
4af22ef7d9 added comment (using freshly updated update_llc_test_checks.py)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253935 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 23:22:05 +00:00
Sanjay Patel
373a5678d3 [x86] add test to show suboptimal codegen (PR25554)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253934 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 23:18:20 +00:00