Commit Graph

124485 Commits

Author SHA1 Message Date
Xinliang David Li
feed6dbc9f [PGO] Add return code for vp rt record init routine to indicate error condition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254220 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-28 05:47:34 +00:00
Xinliang David Li
9bee4a8249 [PGO] Allow value profile writer interface to allocated target buffer
Raw profile writer needs to write all data of one kind in one continuous block,
so the buffer needs to be pre-allocated and passed to the writer method in
pieces for function profile data. The change adds the support for raw value data
writing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254219 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-28 05:37:01 +00:00
Xinliang David Li
52a156fb30 Function name cleanup (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254218 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-28 05:06:00 +00:00
Xinliang David Li
170357c9b7 [PGO] Extract VP data integrity check code into a helper function (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254217 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-28 04:56:07 +00:00
Keno Fischer
66f5f81e89 [autoconf] Fix MinGW build
This is the autoconf analog of r251201. I realize autoconf is
deprecated, but while it's in tree, it should at least be kept working.

Also add the deprecation message to configure.ac such that AutoRegen
actually picks ip up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254215 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-28 00:54:12 +00:00
Rafael Espindola
e29bf07833 Pass .ll directly to llvm-link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254214 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 23:47:15 +00:00
Rafael Espindola
f37c401c5f Pass .ll directly to llvm-link
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254213 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 23:21:45 +00:00
Diego Novillo
c738af5a7f SamplePGO - Add initial support for inliner annotations.
This adds two thresholds to the sample profiler to affect inlining
decisions: the concept of global hotness and coldness.

Functions that have accumulated more than a certain fraction of samples at
runtime, are annotated with the InlineHint attribute. Conversely,
functions that accumulate less than a certain fraction of samples, are
annotated with the Cold attribute.

This is very similar to the hints emitted by Clang when using
instrumentation profiles.

Notice that this is a very blunt instrument. A function may have
globally collected a significant fraction of samples, but that does not
necessarily mean that every callsite for that function is hot.

Ideally, we would annotate each callsite with the samples collected at
that callsite. This way, the inliner can incorporate all these weights
into its cost model.

Once the inliner offers this functionality, we can change the hints
emitted here to a more precise per-callsite annotation. For now, this is
providing some measure of speedups with our internal benchmarks. I've
observed speedups of up to 23% (though the geo mean is about 3%). I expect
these numbers to improve as the inliner gets better annotations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254212 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 23:14:51 +00:00
Diego Novillo
2badfee8a8 SamplePGO - Fix default threshold for hot callsites.
Based on testing of internal benchmarks, I'm lowering this threshold to
a value of 0.1%.  This means that SamplePGO will respect 99.9% of the
original inline decisions when following a profile.

The performance difference is noticeable in some tests. With the
previous threshold, the speedups over baseline -O2 was about 0.63%. With
the new default, the speedups are around 3% on average.

The point of this threshold is not to do more aggressive inlining. When
an inlined callsite crosses this threshold, SamplePGO will redo the
inline decision so that it can better apply the input profile.

By respecting most original inline decisions, we can apply more of the
input profile because the shape of the code follows the profile more
closely.

In the next series, I'll be looking at adding some inline hints for the
cold callsites and for toplevel functions that are hot/cold as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254211 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 23:14:49 +00:00
Rafael Espindola
13318e52ce Modernize the test a bit
Remove out of date comment.
Pass .ll files to llvm-link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254210 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 23:13:17 +00:00
Rafael Espindola
66bd82e422 Simplify the linking of recursive data.
Now the ValueMapper has two callbacks. The first one maps the
declaration. The ValueMapper records the mapping and then materializes
the body/initializer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254209 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 20:28:19 +00:00
Artyom Skrobov
1a4a4976d2 Follow-up fix for r254201
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254202 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 16:20:34 +00:00
Artyom Skrobov
44d5618b02 [ARM] Generate ABI_optimization_goals build attribute, as described in the ARM ARM.
Summary:
Since this build attribute corresponds to a whole module, and
different functions in a module may differ in the optimizations
enabled for them, this attribute is emitted after all functions,
and only in the case that the optimization goals for all
functions match.

Reviewers: logan, hans

Subscribers: aemerson, rengolin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 15:30:51 +00:00
Oliver Stannard
67e4e5d0d5 [AArch64] Add ARMv8.2-A FP16 scalar instructions
ARMv8.2-A adds 16-bit floating point versions of all existing VFP
floating-point instructions. This is an optional extension, so all of
these instructions require the FeatureFullFP16 subtarget feature.

Most of these instructions are the same as the 32- and 64-bit versions,
but with the type field (bits 23-22) set to 0b11. Previously the top bit
of the size field was always 0, so the instruction classes only provided
a 1-bit size field, which I have widened to 2 bits.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254198 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 13:04:48 +00:00
Adhemerval Zanella
7fe6532539 [sanitizer] [dfsan] Unify aarch64 mapping
This patch changes the DFSan instrumentation for aarch64 to instead
of using fixes application mask defined by SANITIZER_AARCH64_VMA
to read the application shadow mask value from compiler-rt. The value
is initialized based on runtime VAM detection.

Along with this patch a compiler-rt one will also be added to export
the shadow mask variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 12:42:39 +00:00
Davide Italiano
2748acd415 [SimplifyLibCalls] Use range-based loop. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254193 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 08:05:40 +00:00
Craig Topper
5476e4426e [TableGen] Sort pattern predicates before concatenating into a string so that different orders of the same set will produce the same string. This can reduce the number of unique predicates in the isel tables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254192 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 05:44:04 +00:00
Craig Topper
de7ba30566 [X86] Pair a NoVLX with HasAVX512 to match the others and remove a unique predicate check in the isel tables. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254191 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 05:44:02 +00:00
Andrew Wilkins
7fa4b3b2aa test: bail early if tool_path is None
tool_path will be None for llvm-go if Go cannot be found



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 05:07:26 +00:00
Andrew Wilkins
bbe6debd7a test: check if go_executable is set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 04:51:13 +00:00
Andrew Wilkins
b6bbdc0193 Use $GO_EXECUTABLE in Go-based lit tests
Summary:
When running tests, pass the GO_EXECUTABLE CMake
cache variable to llvm-go. The "go" binary may
not be in $PATH, or may be different to the one
passed to CMake.

Reviewers: pcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254187 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 04:44:51 +00:00
Rafael Espindola
39066cae68 Test both input file orders.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254186 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 03:50:34 +00:00
Rafael Espindola
d2a2e5d4e8 Add missing file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 03:47:29 +00:00
Rafael Espindola
9e7173acbb Make the test a bit more interesting.
It now covers a regular function replacing an available_externally one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254184 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 02:07:37 +00:00
Peter Collingbourne
41984d3288 MC: Simplify handling of temporary symbols in COFF writer.
The COFF object writer was previously adding unnecessary symbols to its
temporary data structures and cleaning them up later. This made the code
harder to understand and caused a bug (aliases classed as temporary symbols
would cause an assertion failure). A much simpler way of handling such
symbols is to ask the layout for their section-relative position when needed.

Tested with a bootstrap on Windows and by building Chrome.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254183 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 23:29:27 +00:00
Simon Pilgrim
d87d4991ce [X86][FMA] Begun adding AVX512 FMA tests
As discussed on D14909

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254180 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 20:53:28 +00:00
Charlie Turner
c8dc70b584 [LoopVectorize] Use MapVector rather than DenseMap for MinBWs.
The order in which instructions are truncated in truncateToMinimalBitwidths
effects code generation. Switch to a map with a determinisic order, since the
iteration order over a DenseMap is not defined.

This code is not hot, so the difference in container performance isn't
interesting.

Many thanks to David Blaikie for making me aware of MapVector!

Fixes PR25490.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254179 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 20:39:51 +00:00
Craig Topper
d647d4ba0f [X86] Now that X86VPermt2 is used in all the avx512_perm_t_sizes just hardcode it into the patterns instead of passing as an argument. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254177 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 20:21:29 +00:00
Craig Topper
1c01e6cc5c [X86] Merge X86VPermt2Fp and X86VPermt2Int back together by weakening them just enough. The SDTCisSameSizeAs introduced in r254138 helps here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254176 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 20:02:01 +00:00
Rafael Espindola
30e6c88594 Add a few passing lto tests.
I found these while trying to get a prototype to bootstrap.

They cover things like
* Handling of non linker visible stuff (append, available_externally)
* Type merging
* Alias to dropped globals
* Dropping linkage when converting to a declaration.

These should hopefully be generally useful for anyone refactoring the
plugin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254174 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 19:53:12 +00:00
Craig Topper
7df7870c48 [X86] Split ISD node for Vfpclass and Vfpclasss so that we can write strong type constraints for each that don't cause ambiguous isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 19:41:34 +00:00
Hal Finkel
c818be073d [bugpoint] Fix "Alias must point to a definition" problems
GlobalAliases may reference function definitions, but not function declarations.

bugpoint would sometimes create invalid IR by deleting a function's body (thus
mutating a function definition into a declaration) without first 'fixing' any
GlobalAliases that reference that function definition.

This change iteratively prevents that issue. Before deleting a function's body,
it scans the module for GlobalAliases which reference that function. When
found, it eliminates them using replaceAllUsesWith.

Fixes PR20788.

Patch by Nick Johnson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254171 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 19:23:49 +00:00
Rafael Espindola
58019e7bea Disallow aliases to available_externally.
They are as much trouble as aliases to declarations. They are requiring
the code generator to define a symbol with the same value as another
symbol, but the second symbol is undefined.

If representing this is important for some optimization, we could add
support for available_externally aliases. They would be *required* to
point to a declaration (or available_externally definition).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254170 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 19:22:59 +00:00
Craig Topper
9f7045b0a6 [X86] Revert part of r254167 to recover bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 19:13:05 +00:00
Krzysztof Parzyszek
de8494c2f2 [Hexagon] Lowering of V60/HVX vector types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254168 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 18:38:27 +00:00
Craig Topper
942f8d8237 [X86] Strengthen more type constraints to reduce isel table size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 18:31:19 +00:00
Krzysztof Parzyszek
9a525442d8 [Hexagon] Hexagon V60 HVX intrinsic defintions
Author: Ron Lieberman <ronl@codeaurora.org>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254165 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 16:54:33 +00:00
Daniel Sanders
9edb4236cc [mips][ias] Range check uimm5 operands and fix several bugs this revealed.
Summary:
The bugs were:
* append, prepend, and balign were not tested
* balign takes a uimm2 not a uimm5.
* drotr32 was correctly implemented with a uimm5 but the tests expected
  '52' to be valid.
* li/la were implemented with a uimm5 instead of simm32. simm32 isn't
  completely correct either but I'll fix that when I get to simm32.

A notable omission are some of the shift instructions. Several of these
have been implemented using a single uimm6 instruction (rather than two
uimm5 instructions and a CodeGen-only uimm6 pseudo). These will be updated
in the uimm6 patch.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254164 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 16:35:41 +00:00
Oliver Stannard
a890b48abb [AArch64] Add ARMv8.2-A new AT instruction variants
ARMv8.2-A adds new variants of the "at" (address translate) system
instruction, which take the PSTATE.PAN bit (added in ARMv8.1-A). These
are a required part of ARMv8.2-A, so no additional subtarget features
are required.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254159 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 15:34:44 +00:00
Martell Malone
937e2d588c ARM: address WOA unsigned division overflow crash
Building on r253865 the crash is not limited to signed overflows.

Disable custom handling of unsigned 32-bit and 64-bit integer divide.
Add test cases for both 32-bit and 64-bit unsigned integer overflow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254158 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 15:34:03 +00:00
Oliver Stannard
0981e5a6ce [AArch64] Add ARMv8.2-A UAO PSTATE bit
ARMv8.2-A adds a new PSTATE bit, PSTATE.UAO, which allows the LDTR/STTR
instructions to behave the same as LDR/STR with respect to execute-only
pages at higher privilege levels. New variants of the MSR/MRS
instructions are added to allow reading and writing this bit. It is a
required part of ARMv8.2-A, so no additional subtarget features are
required.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254157 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 15:32:30 +00:00
Oliver Stannard
df55505b87 [AArch64] Add ARMv8.2-A persistent memory instruction
ARMv8.2-A adds the "dc cvap" instruction, which is a system instruction
that cleans caches to the point of persistence (for systems that have
persistent memory). It is a required part of ARMv8.2-A, so no additional
subtarget features are required.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254156 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 15:28:47 +00:00
Oliver Stannard
c9ad981477 [AArch64] Add ARMv8.2-A ID_A64MMFR2_EL1 register
ARMv8.2-A adds a new ID register, ID_A64MMFR2_EL1, which behaves in the
same way as ID_A64MMFR0_EL1 and ID_A64MMFR1_EL1. It is a required part
of ARMv8.2-A, so no additional subtarget features are required.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254155 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 15:26:10 +00:00
Oliver Stannard
e6988659c9 [AArch64] Add subtarget features for ARMv8.2-A
This adds subtarget features for ARMv8.2-A, which builds on (and
requires the features from) ARMv8.1-A. Most assembler-visible features
of ARMv8.2-A are system instructions, and are all required parts of the
architecture, so just depend on the HasV8_2aOps subtarget feature. There
is also one large, optional feature, which adds 16-bit floating point
versions of all existing floating-point instructions (VFP and SIMD),
this is represented by the FeatureFullFP16 subtarget feature.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254154 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 15:23:32 +00:00
Daniel Sanders
bedb5c9946 [mips][ias] Explicitly disable IAS on tests that depend on not assembling.
Summary:
no-odd-spreg-msa.ll: This test deliberately uses an odd-numbered register
in inline assembly and expects the compiler to insert a move to an
even-numbered register.

inlineasm-operand-code.ll and inlineasm_constraint.ll:
Checks for IAS's output will be added once a matcher bug is resolved. This bug
causes the canonical output emitted by IAS to be incorrect for uimm16 constants
with the MSB set. We will still need the non-IAS checks at this point since
these tests primarily test formatting of operands.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254148 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 11:23:03 +00:00
Daniel Sanders
6bd5df3900 [mips][ias] Replace anchor comments with anchor instructions in tests.
Summary:
This is because IAS will delete the comments. NFC at the moment but it will
prevent a failure once IAS is the default.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254147 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 10:26:18 +00:00
Benjamin Kramer
7c7d1ee4c2 [SimplifyLibCalls] Don't depend on a called function having a name, it might be an indirect call.
Fixes the crasher in PR25651 and related crashers using the same pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 09:51:17 +00:00
Craig Topper
2e77264e42 [X86] Strengthen more type constraints to reduce isel table size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254142 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 07:58:20 +00:00
Vyacheslav Klochkov
d9357adaa7 X86-FMA3: Improved/enabled the memory folding optimization for scalar loads
generated for _mm_losd_s{s,d}() intrinsics and used in scalar FMAs generated 
for FMA intrinsics _mm_f{madd,msub,nmadd,nmsub}_s{s,d}().

Reviewer: David Kreitzer
Differential Revision: http://reviews.llvm.org/D14762



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254140 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 07:45:30 +00:00
Craig Topper
c11aea8b65 [X86] Strengthen the type constraints on X86psadbw and X86dbpsadbw to reduce some of the type checks in the isel matching tables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@254139 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-26 07:02:21 +00:00