Commit Graph

26191 Commits

Author SHA1 Message Date
David Majnemer
3a1ed8c7cb Unbreak windows buildbots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 19:38:03 +00:00
David Majnemer
5c900cb299 [CodeView] Implement .cv_inline_linetable
This support is _very_ rudimentary, just enough to get some basic data
into the CodeView debug section.

Left to do is:
- Use the combined opcodes to save space.
- Do something about code offsets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 19:24:12 +00:00
Reid Kleckner
b5d1bc265b [codeview] Begin to add support for inlined call sites
Summary:
There are three parts to inlined call frames:
1. The inlinee line subsection
2. The inline site symbol record
3. The function ids referenced by both

This change starts by emitting function ids (3) for all subprograms and
emitting the base inline site symbol record (2). The actual line numbers
in (2) use an encoded format that will come next, along with the inlinee
line subsection.

Reviewers: majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 18:16:43 +00:00
Jonas Paulsson
c8d11e8593 Temporarily revert "[ScheduleDAGInstrs::buildSchedGraph()] Handling of memory dependecies rewritten."
Some buildbot failures needs to be debugged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 17:22:43 +00:00
Jonas Paulsson
72374d2610 [ScheduleDAGInstrs::buildSchedGraph()] Handling of memory dependecies rewritten.
The buildSchedGraph() was in need of reworking as the AA features had been
added on top of earlier code. It was very difficult to understand, and buggy.
There had been found cases where scheduling dependencies had actually been
missed (see r228686).

AliasChain, RejectMemNodes, adjustChainDeps() and iterateChainSucc() have
been removed. There are instead now just the four maps from Value to SUs, which
have been renamed to Stores, Loads, NonAliasStores and NonAliasLoads.

An unknown store used to become the AliasChain, but now becomes a store mapped
to 'unknownValue' (in Stores). What used to be PendingLoads is instead the
list of SUs mapped to 'unknownValue' in Loads.

RejectMemNodes and adjustChainDeps() used to be a safety-net for everything.
The SU maps were sometimes cleared and SUs were put in RejectMemNodes, where
adjustChainDeps() would look. Instead of this, a more straight forward approach
is used in maintaining the SU maps without clearing them and simply letting
them grow over time. Instead of the cutt-off in adjustChainDeps() search, a
reduction of maps will be done if needed (see below).

Each SUnit either becomes the BarrierChain, or is put into one of the maps. For
each SUnit encountered, all the information about previous ones are still
available until a new BarrierChain is set, at which point the maps are cleared.

For huge regions, the algorithm becomes slow, therefore the maps will get
reduced at a threshold (current default is 1000 nodes), by a fraction (default 1/2).
These values can be tuned by use of CL options in case some test case shows that
they need to be changed (-dag-maps-huge-region and -dag-maps-reduction-size).

There has not been any considerable change observed in output quality or compile
time. There may now be more DAG edges inserted than before (i.e. if A->B->C,
then A->C is not needed). However, in a comparison run there were fewer total
calls to AA, and a somewhat improved compile time, which means this seems to
be not a problem.

http://reviews.llvm.org/D8705
Reviewers: Hal Finkel, Andy Trick.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 16:11:18 +00:00
Benjamin Kramer
18481855bd [IR] Move definitions of users of Use::set to Value.h
Still ugly, but at least Use.h is self-contained again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 12:47:05 +00:00
Benjamin Kramer
9bffff5b5b [IR] Shuffle the code for getSequentialElementType to type.h to avoid circular header dependencies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 12:47:01 +00:00
George Burgess IV
ca9ee4390a Minor bugfix in AAResults::getModRefInfo.
Also removed a few redundant `else`s.

Bug was found by a test I wrote for MemorySSA (in review at
http://reviews.llvm.org/D7864; shiny update coming soon). So, assuming
that lands at some point, this should be covered by that. If anyone
feels this deserves its own explicit test case, please let me know.
I'll write one.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 07:51:15 +00:00
Akira Hatanaka
0dc389daac [llvm-bcanalyzer] Dump bitcode wrapper header
This patch enables llvm-bcanalyzer to print the bitcode wrapper header
if the file has one, which is needed to test the changes made in
r258627 (bitcode-wrapper-header-armv7m.ll is the test case for r258627).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 05:55:09 +00:00
Reid Kleckner
1689efb4d2 Reland "[CodeView] Use assembler directives for line tables"
This reverts commit r259126 and relands r259117.

This time with updated library dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259130 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 00:49:42 +00:00
Reid Kleckner
ae8e13919a Revert "[CodeView] Use assembler directives for line tables"
This reverts commit r259117.

The LineInfo constructor is defined in the codeview library and we have
to link against it now. Doing that isn't trivial, so reverting for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 00:13:28 +00:00
Reid Kleckner
778020bb36 Silence gcc warning about ternary and enumerations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259123 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 23:59:35 +00:00
Reid Kleckner
200dc330a0 [CodeView] Use assembler directives for line tables
Adds a new family of .cv_* directives to LLVM's variant of GAS syntax:

- .cv_file: Similar to DWARF .file directives

- .cv_loc: Similar to the DWARF .loc directive, but starts with a
  function id. CodeView line tables are emitted by function instead of
  by compilation unit, so we needed an extra field to communicate this.
  Rather than overloading the .loc direction further, we decided it was
  better to have our own directive.

- .cv_stringtable: Emits the codeview string table at the current
  position. Currently this just contains the filenames as
  null-terminated strings.

- .cv_filechecksums: Emits the file checksum table for all files used
  with .cv_file so far. There is currently no support for emitting
  actual checksums, just filenames.

This moves the line table emission code down into the assembler.  This
is in preparation for implementing the inlined call site line table
format. The inline line table format encoding algorithm requires knowing
the absolute code offsets, so it must run after the assembler has laid
out the code.

David Majnemer collaborated on this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259117 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 23:31:52 +00:00
Reid Kleckner
eac4c34846 Remove unused MC includes from LTOModule.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259115 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 23:21:12 +00:00
Benjamin Kramer
0eeb0b22bf Make header self-contained.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259060 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 17:48:29 +00:00
Oliver Stannard
b95072ef89 Revert r259035, it introduces a cyclic library dependency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 13:19:47 +00:00
Oliver Stannard
ef19a274ad Add backend dignostic printer for unsupported features
Re-commit of r258951 after fixing layering violation.

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259035 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 10:07:27 +00:00
Asaf Badouh
665e71adfd [X86][AVX512] small fix in ptestm intrinsics
move ptestm{q|d} intrinsics from patterns form (in td file) to the intrinsics table

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259029 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 08:33:22 +00:00
Matthias Braun
7f3c3c37bd SmallPtrSet: Add missing include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259021 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 05:09:01 +00:00
Matthias Braun
a1e9f2f407 SmallPtrSet: Make destructor available for inlining
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 04:49:14 +00:00
Matthias Braun
1732754567 SmallPtrSet: Share some code between copy/move constructor/assignment operator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 04:49:11 +00:00
Matthias Braun
ae4e8d2bfe SmallPtrSet: Remove trailing whitespace, fix indentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259017 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 04:49:07 +00:00
NAKAMURA Takumi
c1aeea845d Revert r258951 (and r258950), "Refactor backend diagnostics for unsupported features"
It broke layering violation in LLVMIR.

clang r258950 "Add backend dignostic printer for unsupported features"
llvm  r258951 "Refactor backend diagnostics for unsupported features"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259016 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 04:41:32 +00:00
Dan Gohman
dbc2732e36 [WebAssembly] Enhanced register stackification
This patch revamps the RegStackifier pass with a new tree traversal mechanism,
enabling three major new features:

 - Stackification of values with multiple uses, using the result value of set_local
 - More aggressive stackification of instructions with side effects
 - Reordering operands in commutative instructions to enable more stackification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 01:22:44 +00:00
George Burgess IV
134d29444d Minor style cleanup of CFLAA. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-28 00:54:01 +00:00
Adam Nemet
35ef8f155d [TTI] Add getPrefetchDistance from PPCLoopDataPrefetch, NFC
This patch is part of the work to make PPCLoopDataPrefetch
target-independent
(http://thread.gmane.org/gmane.comp.compilers.llvm.devel/92758).

As it was discussed in the above thread, getPrefetchDistance is
currently using instruction count which may change in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258995 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 22:21:25 +00:00
Tim Northover
8362c240ca ARMv7k: base ABI decision on v7k Arch rather than watchos OS.
Various bits we want to use the new ABI actually compile with "-arch armv7k
-miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how
slices work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258975 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 19:32:29 +00:00
Benjamin Kramer
b8c1bbf870 One more batch of self-containing headers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258974 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 19:29:56 +00:00
John McCall
5ee1f22ae3 Add support for objc_unsafeClaimAutoreleasedReturnValue to the
ObjC ARC Optimizer.

The main implication of this is:

1. Ensuring that we treat it conservatively in terms of optimization.
2. We put the ASM marker on it so that the runtime can recognize
objc_unsafeClaimAutoreleasedReturnValue from releaseRV.

<rdar://problem/21567064>

Patch by Michael Gottesman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258970 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 19:05:08 +00:00
Benjamin Kramer
06342012ac Make more headers self-contained.
A lot of this comes from the new complete type requirement of DenseMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258956 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 18:03:37 +00:00
Oliver Stannard
bf8415a84d Refactor backend diagnostics for unsupported features
The BPF and WebAssembly backends had identical code for emitting errors
for unsupported features, and AMDGPU had very similar code. This merges
them all into one DiagnosticInfo subclass, that can be used by any
backend.

There should be minimal functional changes here, but some AMDGPU tests
have been updated for the new format of errors (it used a slightly
different format to BPF and WebAssembly). The AMDGPU error messages will
now benefit from having precise source locations when debug info is
available.

The implementation of DiagnosticInfoUnsupported::print must be in
lib/Codegen rather than in the existing file in lib/IR/ to avoid
introducing a dependency from IR to CodeGen.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 17:30:33 +00:00
Benjamin Kramer
b714d34a7e Move SafeStack to CodeGen.
It depends on the target machinery, that's not available for
instrumentation passes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258942 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 16:53:42 +00:00
Benjamin Kramer
d254be2cd3 Rename TargetSelectionDAGInfo into SelectionDAGTargetInfo and move it to CodeGen/
It's a SelectionDAG thing, not a Target thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258939 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 16:32:26 +00:00
Benjamin Kramer
f80dcd65f5 Move passes that live in lib/CodeGen out of Scalar.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258938 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 16:05:42 +00:00
Benjamin Kramer
509a6e348c Make some headers self-contained, remove unused includes that violate layering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 16:05:37 +00:00
Benjamin Kramer
030c9dc308 Move MCTargetAsmParser.h to llvm/MC/MCParser where it belongs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 10:01:28 +00:00
Matthias Braun
903845e2b0 SmallPtrSet: Inline the part of insert_imp in the small case
Most of the time we only hit the small case, so it is beneficial to pull
it out of the insert_imp() implementation. This improves compile time
at least for non-LTO builds.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 04:20:24 +00:00
Matthias Braun
46cf99c555 Function: Slightly simplify code by using existing hasFnAttribute() convenience function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258907 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 03:45:25 +00:00
Reid Kleckner
fa21741f38 [llvm-tblgen] Avoid StringMatcher for GCC and MS builtin names
This brings the compile time of Function.cpp from ~40s down to ~4s for
me locally. It also shaves off about 400KB of object file size in a
release+asserts build.

I also realized that the AMDGPU backend does not have any GCC builtin
names to match, so the extra lookup was a no-op. I removed it to silence
a zero-length string table array warning. There should be no functional
change here.

This change really ends the story of PR11951.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258897 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 01:43:12 +00:00
Xinliang David Li
5b78a6e259 [PGO] Make header portable for C /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-27 00:13:39 +00:00
Xinliang David Li
5b815438f1 [PGO] allow pgo name collector to disable compression (for testing)/NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 23:13:00 +00:00
Reid Kleckner
dc8eb983e7 Handle more edge cases in intrinsic name binary search
I tried to make the AMDGPU intrinsic info table use this instead of
another StringMatcher, and some issues arose.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 22:33:19 +00:00
Eugene Zelenko
51ecde1f0a Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.
Differential revision: reviews.llvm.org/D16568


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258831 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:48:36 +00:00
Sanjay Patel
3d2f666944 don't repeat names in documentation comments; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 17:06:13 +00:00
Benjamin Kramer
b6242a88c2 Reflect the MC/MCDisassembler split on the include/ level.
No functional change, just moving code around.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 16:44:37 +00:00
Igor Laevsky
25574808dc Re-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame."
Originally this change was causing failures on windows buildbots.
But those problems were fixed in r258806.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258811 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 15:09:42 +00:00
Matt Arsenault
2aa06ab7ea AMDGPU: Add new amdgcn intrinsics for cube instructions
More cleanup to try to get all intrinsics using the correct
amdgcn prefix that are as close to the instruction as possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258786 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:29:56 +00:00
Matt Arsenault
ae4d40b742 AMDGPU: Restore AMDGPU prefixed rsq intrinsic for now
Also move into backend intrinsics to discourage use of the old name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 04:14:16 +00:00
Haicheng Wu
33a530fbed [LIR] Add support for structs and hand unrolled loops
This is a recommit of r258620 which causes PR26293.

The original message:

Now LIR can turn following codes into memset:

typedef struct foo {
  int a;
  int b;
} foo_t;

void bar(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; ++i) {
    f[i].a = 0;
    f[i].b = 0;
  }
}

void test(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; i += 2) {
    f[i] = 0;
    f[i+1] = 0;
  }
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258777 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 02:27:47 +00:00
Matthias Braun
632580f369 LiveIntervalAnalysis: Improve some comments
As recommended by Justin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258771 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 01:40:48 +00:00