Commit Graph

236903 Commits

Author SHA1 Message Date
Simon Pilgrim d1e941ae85 [X86] Regenerated ctlz/cttz scalar tests for 32/64-bit targets with/without LZCNT/TZCNT support
llvm-svn: 275710
2016-07-17 16:15:51 +00:00
Simon Pilgrim 0bf66c9d62 [X86] Regenerated popcnt scalar tests for 32/64-bit targets with/without POPCNT support
llvm-svn: 275709
2016-07-17 16:04:19 +00:00
Simon Pilgrim 1be1222293 [X86][SSE] lowerVectorShuffleAsPermuteAndUnpack tidyup. NFCI.
Moved unpack type determination into TryUnpack lambda.

Added missing comment describing lowerVectorShuffleAsPermuteAndUnpack call.

llvm-svn: 275708
2016-07-17 15:48:25 +00:00
Teresa Johnson cd21a646f6 [ThinLTO] Perform profile-guided indirect call promotion
Summary:
To enable profile-guided indirect call promotion in ThinLTO mode, we
simply add call graph edges for each profitable target from the profile
to the summaries, then the summary-guided importing will consider the
callee for importing as usual.

Also we need to enable the indirect call promotion pass creation in the
PassManagerBuilder when PerformThinLTO=true (we are in the ThinLTO
backend), so that the newly imported functions are considered for
promotion in the backends.

The IC promotion profiles refer to callees by GUID, which required
adding GUIDs to the per-module VST in bitcode (and assigning them
valueIds similar to how they are assigned valueIds in the combined
index).

Reviewers: mehdi_amini, xur

Subscribers: mehdi_amini, davidxl, llvm-commits

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

llvm-svn: 275707
2016-07-17 14:47:01 +00:00
Teresa Johnson ce7de9b6fb Address review comments.
llvm-svn: 275706
2016-07-17 14:46:58 +00:00
Teresa Johnson 3f42198652 Refactor indirect call promotion profitability analysis (NFC)
Summary:
Refactored the profitability analysis out of the IC promotion pass and
into lib/Analysis so that it can be accessed by the summary index
builder in a follow-on patch to enable IC promotion in ThinLTO (D21932).

Reviewers: davidxl, xur

Subscribers: llvm-commits

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

llvm-svn: 275705
2016-07-17 14:46:54 +00:00
Guy Blank 3357ba36e2 test commit
llvm-svn: 275703
2016-07-17 12:10:35 +00:00
Elena Demikhovsky eaa356501d X86: Updated a test file. NFC.
This test shows subotimal code generated for AVX-512 vs PENTIUM4.
The issue will be fixed in an upcomming commit.

llvm-svn: 275702
2016-07-17 07:03:13 +00:00
Rui Ueyama 434b56179e Add a pointer to a source file to SymbolBody.
Previously, each subclass of SymbolBody had a pointer to a source
file from which it was created. So, there was no single way to get
a source file for a symbol. We had getSourceFile<ELFT>(), but the
function was a bit inconvenient as it's a template.

This patch makes SymbolBody have a pointer to a source file.
If a symbol is not created from a file, the pointer has a nullptr.

llvm-svn: 275701
2016-07-17 03:11:46 +00:00
Rui Ueyama 7a7a96e199 Do not invoke FileCheck with `not` command.
We should use CHECK-NOT instead.

llvm-svn: 275700
2016-07-17 01:34:39 +00:00
David Majnemer 58ed0f3a5c [CodeGen] Some assorted cleanups
No functional change, just some cleanups:
- Use auto when it is appropriate.
- There were some strange static_casts which were superfluous.
- Use range-based for loops when appropriate.
- The dyn_cast_or_null construct was used when null was impossible.

llvm-svn: 275699
2016-07-17 00:39:12 +00:00
Dehao Chen 1a44452b11 [PM] Convert IVUsers analysis to new pass manager.
Summary: Convert IVUsers analysis to new pass manager.

Reviewers: davidxl, silvas

Subscribers: junbuml, sanjoy, llvm-commits, mzolotukhin

Differential Revision: https://reviews.llvm.org/D22434

llvm-svn: 275698
2016-07-16 22:51:33 +00:00
Saleem Abdulrasool 10fd1ff56a CodeGen: use StringRefs more in ObjC class generation, NFC
Rather than building up a number of SmallString-s in order to construct a
std::string, use more StringRefs and construct the string once before use.  This
avoids unnecessary string constructions.  NFC.

llvm-svn: 275697
2016-07-16 22:42:06 +00:00
Saleem Abdulrasool bc2d9998ea CodeGen: simplify using a local variable, NFC
Add a couple of local variables for the class interface and the super class
interface.  This allows for the repeated access of the information to be cached
and makes the code simpler to understand.  NFC.

llvm-svn: 275696
2016-07-16 22:42:04 +00:00
Rui Ueyama 3ec5c84606 Attempt to unbreak Windows bot.
llvm-svn: 275695
2016-07-16 19:16:15 +00:00
Rui Ueyama 818bb2f8dc Remove redundant namespace specifiers.
llvm-svn: 275694
2016-07-16 18:55:47 +00:00
Rui Ueyama 962b277d2d Resurrect code that was lost in conflicting commits.
llvm-svn: 275693
2016-07-16 18:45:25 +00:00
Rui Ueyama f953a8ac17 Use skip() instead of peek() and expect().
llvm-svn: 275692
2016-07-16 18:45:23 +00:00
Sanjay Patel 79acd2a96b [InstCombine] allow X + signbit --> X ^ signbit for vector splats
llvm-svn: 275691
2016-07-16 18:29:26 +00:00
Sanjay Patel 040bd16e56 add vector test to show missing transform
llvm-svn: 275690
2016-07-16 18:24:18 +00:00
Mehdi Amini e203b610fa IPRA: avoid double query to the map (NFC)
llvm-svn: 275689
2016-07-16 18:20:26 +00:00
Sanjay Patel eb50476f77 update tests to use FileCheck, consolidate tests, fix comments
llvm-svn: 275688
2016-07-16 18:08:22 +00:00
Sanjay Patel e540a31f59 update test to use FileCheck
llvm-svn: 275687
2016-07-16 16:31:58 +00:00
Sanjay Patel 972a53fb42 auto-generate checks
llvm-svn: 275686
2016-07-16 16:27:58 +00:00
Sanjay Patel 309f98ef3a auto-ggenerate checks
llvm-svn: 275685
2016-07-16 16:24:06 +00:00
Sanjay Patel f9d2b20daf [InstCombine] reassociate logic ops with constants separated by a zext
This is a partial implementation of a general fold for associative+commutative operators:
(op (cast (op X, C2)), C1) --> (cast (op X, op (C1, C2)))
(op (cast (op X, C2)), C1) --> (op (cast X), op (C1, C2))

There are 7 associative operators and 13 cast types, so this could potentially go a lot further.

Differential Revision: https://reviews.llvm.org/D22421

llvm-svn: 275684
2016-07-16 15:20:19 +00:00
George Rimar ee0e63804f Update for r275682:
I think 
# REQUIRES: shell 
is required instead of 
# XFAIL: win32

llvm-svn: 275683
2016-07-16 12:34:06 +00:00
George Rimar 50dcece2a0 Recommit r275257 "[ELF] - Implement extern "c++" version script tag"
BSD toolchain contains a bug:
https://sourceforge.net/p/elftoolchain/tickets/491/

In short demangler works differently, fix was to update the testcase.
It should fix the FreeBSD bot failture:
http://lab.llvm.org:8011/builders/lld-x86_64-freebsd/builds/19432/steps/test_lld/logs/stdio

Original commit message was:
[ELF] - Implement extern "c++" version script tag

Patch implements 'extern' version script tag.
Currently only values in quotes(") are supported.

Matching of externs is performed in the same pass as exact match of globals.

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

llvm-svn: 275682
2016-07-16 12:26:39 +00:00
Kirill Bobyrev 1114048ac8 [clang-rename] remove obsolete tests and apply fixes to existing
Few tests introduced by previous patch had obsolete counterparts.

Applied fixes to {Dynamic|Static}CastExpr.cpp

llvm-svn: 275681
2016-07-16 08:55:01 +00:00
Tobias Grosser cda19c230c GPGPU: Abort if any dummy function is called
This ensures that accidental calls to these functions will break loadly instead
of corrupting the stack with invalid return values.

These functions have been introduced earlier as replacement of pet and parts of
ppcg which we will never use and consequently have not been imported or compiled
into Polly.

llvm-svn: 275680
2016-07-16 07:30:27 +00:00
Hal Finkel 81cdef31e6 Revert "Revert r275029 - Update Clang tests after adding inference for the returned argument attribute"
This reverts commit r275043 after reapplying the underlying LLVM commit.

llvm-svn: 275679
2016-07-16 07:22:09 +00:00
Hal Finkel 660096b260 Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute"
This reverts commit r275042; the initial commit triggered self-hosting failures
on ARM/AArch64. James Molloy identified the problematic backend code, which has
been disabled in r275677. Trying again...

Original commit message:

Let FuncAttrs infer the 'returned' argument attribute

A function can have one argument with the 'returned' attribute, indicating that
the associated argument is always the return value of the function. Add
FuncAttrs inference logic.

llvm-svn: 275678
2016-07-16 07:21:28 +00:00
Hal Finkel 04b5330ccd Disable this-return argument forwarding on ARM/AArch64
r275042 reverted function-attribute inference for the 'returned' attribute
because the feature triggered self-hosting failures on ARM and AArch64. James
Molloy determined that the this-return argument forwarding feature, which
directly ties the returned input argument to the returned value, was the cause.
It seems likely that this forwarding code contains, or triggers, a subtle bug.
Disabling for now until we can track that down.

llvm-svn: 275677
2016-07-16 07:07:29 +00:00
Yaxun Liu a711cc7951 Re-commit [AMDGPU] Add metadata for runtime
Attempting to fix lit test failure on ppc.

llvm-svn: 275676
2016-07-16 05:09:21 +00:00
Rui Ueyama c755599997 Simplify. NFC.
llvm-svn: 275675
2016-07-16 04:19:29 +00:00
Rui Ueyama af469d47e9 Rename SymbolVersions VersionDefinitions.
SymbolVersions sounds like it had versions for a symbol, so rename it.

llvm-svn: 275674
2016-07-16 04:09:27 +00:00
Rui Ueyama bc94dd9b28 Rename Version VersionDefinition.
The identifier `Version` was used too often in the code to handle
symbol versions. The struct that contains version definitions is
named `Version`. Local variables for version ID are named `Version`.
Local varaible for version string are named `Version`.

This patch give them different names.

llvm-svn: 275673
2016-07-16 04:02:00 +00:00
Rui Ueyama 52654ebb12 Use ScriptParserBase::skip() instead of peek() and next().
skip(S) consumes a token if the next token is S,
so it can be used instead of peek() & next().

llvm-svn: 275672
2016-07-16 03:45:59 +00:00
Craig Topper 8093437f2e [AVX512] Remove CodeGenOnly VBROADCAST m_Int instructions. They can be implemented with patterns selecting existing instructions. NFC
llvm-svn: 275671
2016-07-16 03:42:59 +00:00
Rui Ueyama c9b4c073b2 Simplify. NFC.
llvm-svn: 275670
2016-07-16 03:12:16 +00:00
Rui Ueyama 2506866ff6 Simplify default symbol version management. NFC.
llvm-svn: 275669
2016-07-16 03:08:26 +00:00
Sean Silva a834ff260a [Driver] Add flags for enabling both types of PGO Instrumentation
The flags:
Enable IR-level instrumentation -fprofile-generate or -fprofile-generate=
When applying profile data: -fprofile-use=/path/to/profdata

Patch by Jake VanAdrighem!

Differential Revision: https://reviews.llvm.org/D21823

llvm-svn: 275668
2016-07-16 02:54:58 +00:00
Rui Ueyama e9381bd2d8 Remove redundant variable.
llvm-svn: 275667
2016-07-16 02:47:42 +00:00
Rui Ueyama f524464e2f Set sh_addralign in the constructor for consistency. NFC.
llvm-svn: 275666
2016-07-16 02:36:00 +00:00
Rui Ueyama 9f61964769 Make Verdef and Verdaux adjacent in the version definition section.
Previously, Verdefs and Verdauxs are separated in the section.
The new layout is easier to write as we do not have to maintain
two pointers and can avoid passing a reference to a pointer.

llvm-svn: 275665
2016-07-16 02:29:45 +00:00
Matthias Braun 538859cca3 llc: Add support for -run-pass none
This does not schedule any passes besides the ones necessary to
construct and print the machine function. This is useful to test .mir
file reading and printing.

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

llvm-svn: 275664
2016-07-16 02:24:59 +00:00
Matthias Braun c0d2a617f7 llc: Move pass query/add code into an own function; NFC
llvm-svn: 275663
2016-07-16 02:24:15 +00:00
Matthias Braun c92a5fc9f6 ARM/MIR: Move test from MIR to CodeGen/ARM directory
test/CodeGen/MIR/ARM/ARMLoadStoreDBG.mir is an actual test for the ARM
load store optimization pass and not a test of the mir parser/printer.

It belongs to test/CodeGen/ARM; This also updates the test to use the
new -run-pass llc syntax.

llvm-svn: 275662
2016-07-16 02:24:13 +00:00
Matthias Braun 8f456fb18f ARM: Initialize LoadStore passes in TargetMachine
Initializing them in LLVMInitializeARMTarget() makes them visible early
enough for "llc -run-pass usage".

This required the pass to be renamed from "arm-load-store-opt" to
"arm-ldst-opt", because there already exists an arm-load-store-opt
cl::opt switch which would now clash with the passname getting added as
a switch in opt. On the bright side the pass name now matches the
DEBUG_TYPE name. Renamed "arm-prera-load-store-opt" to
"arm-repra-ldst-opt" as well for consistency.

llvm-svn: 275661
2016-07-16 02:24:10 +00:00
Rui Ueyama 0ff953e811 Use SymbolVersion::Id instead of a hard-coded local variable.
llvm-svn: 275660
2016-07-16 02:00:43 +00:00