Commit Graph

172542 Commits

Author SHA1 Message Date
Kevin Enderby b7e51f6af5 Change the ARM assembler to require a :lower16: or :upper16 on non-constant
expressions for mov instructions instead of silently truncating by default.

For the ARM assembler, we want to avoid misleadingly allowing something
like "mov r0, <symbol>" especially when we turn it into a movw and the
expression <symbol> does not have a :lower16: or :upper16" as part of the
expression.  We don't want the behavior of silently truncating, which can be
unexpected and lead to bugs that are difficult to find since this is an easy
mistake to make.

This does change the previous behavior of llvm but actually matches an
older gnu assembler that would not allow this but print less useful errors
of like “invalid constant (0x927c0) after fixup” and “unsupported relocation on
symbol foo”.  The error for llvm is "immediate expression for mov requires
:lower16: or :upper16" with correct location information on the operand
as shown in the added test cases.

rdar://12342160

llvm-svn: 206669
2014-04-18 23:06:39 +00:00
Justin Bogner 6bdea86cab test: Add extra run lines to investigate an error on the bots
llvm-svn: 206668
2014-04-18 23:05:31 +00:00
Justin Bogner 8776638235 CodeGen: Remove an unused include
llvm-svn: 206667
2014-04-18 22:31:07 +00:00
Duncan P. N. Exon Smith b3caf3646f Reapply "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)
This reverts commit r206628, reapplying r206622 (and r206626).

Two tests are failing only on buildbots [1][2]: i.e., I can't reproduce
on Darwin, and Chandler can't reproduce on Linux.  Asan and valgrind
don't tell us anything, but we're hoping the msan bot will catch it.

So, I'm applying this again to get more feedback from the bots.  I'll
leave it in long enough to trigger builds in at least the sanitizer
buildbots (it was failing for reasons unrelated to my commit last time
it was in), and hopefully a few others.... and then I expect to revert a
third time.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1816
[2]: http://llvm-amd64.freebsd.your.org/b/builders/clang-i386-freebsd/builds/18445

llvm-svn: 206666
2014-04-18 22:30:03 +00:00
Alexey Samsonov 5c39fdfb7b [llvm-symbolizer] Print file/line for a PC even if there is no DIE describing it.
This is important for symbolizing executables with debug info in
unavailable .dwo files. Even if all DIE entries are missing, we can
still symbolize an address: function name can be fetched from symbol table,
and file/line info can be fetched from line table.

llvm-svn: 206665
2014-04-18 22:22:44 +00:00
Ben Langmuir ec8c975214 Don't build modules with (submodules with) missing headers
Unless they are in submodules that aren't available anyway, due to
requirements not being met.  Also, mark children as unavailable when the
parent is.

llvm-svn: 206664
2014-04-18 22:07:31 +00:00
Justin Bogner b5d368e838 ProfileData: Don't forward declare ComputeHash and make it static inline
llvm-svn: 206663
2014-04-18 22:00:22 +00:00
Reid Kleckner f00daf15f0 Add support for building Sphinx documentation when being built inside LLVM source tree and using CMake.
Patch by Dan Liew <daniel.liew@imperial.ac.uk>!

llvm-svn: 206662
2014-04-18 21:59:05 +00:00
Reid Kleckner 230f662d12 Fix sphinx-build warnings in clang docs.
llvm-svn: 206661
2014-04-18 21:55:49 +00:00
Reid Kleckner 5d21c4990f Add support for building Sphinx documentation when being inside LLVM source tree and using CMake
Patch by Daniel Liew <daniel.liew@imperial.ac.uk>!

llvm-svn: 206660
2014-04-18 21:55:46 +00:00
David Blaikie 76d3a3cd35 Compress debug sections only when beneficial.
Both ZLIB and the debug info compressed section header ("ZLIB" + the
size of the uncompressed data) take some constant overhead so in some
cases the compressed data is actually larger than the uncompressed data.
In these cases, just don't compress or rename the section at all.

llvm-svn: 206659
2014-04-18 21:52:26 +00:00
Justin Bogner 837a6f6f79 CodeGen: Use LLVM's InstrProfReader in -fprofile-instr-use=
Update clang to use the InstrProfReader from LLVM to read
instrumentation based profile data. This also switches us from the
naive text format to the binary format, since that's what's
implemented in the reader.

llvm-svn: 206658
2014-04-18 21:52:00 +00:00
Justin Bogner fc83c1105c [Cleanup] Remove a trailing whitespace
llvm-svn: 206657
2014-04-18 21:51:09 +00:00
Justin Bogner b7aa26303b ProfileData: Add support for the indexed instrprof format
This adds support for an indexed instrumentation based profiling
format, which is just a small header and an on disk hash table.  This
format will be used by clang's -fprofile-instr-use= for PGO.

llvm-svn: 206656
2014-04-18 21:48:40 +00:00
Reid Kleckner 9f5eb637cb Added Sphinx documentation generation to CMake build system.
The option LLVM_ENABLE_SPHINX option enables the "docs-llvm-html",
"docs-llvm-man" targets but does not build them by default. The
following CMake options have been added that control what targets are
made available

SPHINX_OUTPUT_HTML
SPHINX_OUTPUT_MAN

If LLVM_BUILD_DOCS is enabled then the enabled docs-llvm-* targets will
be built by default and if ``make install`` is run then docs-llvm-html
and docs-llvm-man will be installed (tested on Linux only).

The add_sphinx_target function is in its own file so it can be included
by other projects that use Sphinx for their documentation.

Patch by Daniel Liew <daniel.liew@imperial.ac.uk>!

llvm-svn: 206655
2014-04-18 21:45:25 +00:00
Alexey Samsonov d010999abe [DWARF parser] Turn DILineInfo into a struct.
Immutable DILineInfo doesn't bring any benefits and complicates
code. Also, use std::string instead of SmallString<16> for file
and function names - their length can vary significantly.

No functionality change.

llvm-svn: 206654
2014-04-18 21:36:39 +00:00
David Blaikie c029ab430c Update the fragments of symbols in compressed sections.
While unnamed relocations are already cached in side tables in
ELFObjectWriter::RecordRelocation, symbols still need their fragments
updated to refer to the newly compressed fragment (even if that fragment
isn't big enough to fit the offset). Even though we only create
temporary symbols in debug info sections this comes up in 32 bit builds
where even temporary symbols in mergeable sections (such as debug_str)
have to be emitted as named symbols.

I tried a few other ways to do this but they all didn't work for various
reasons:

1) Canonicalize the MCSymbolData in RecordRelocation, nulling out the
Fragment (so it didn't have to be updated by CompressDebugSection). This
doesn't work because some code relies on symbols having fragments to
indicate that they're defined, I think.

2) Canonicalize the MCSymbolData in RecordRelocation to be "first
fragment + absolute offset" so it would be cheaper to just test and
update the fragment in CompressDebugSections. This doesn't work because
the offset computed in RecordRelocation isn't that of the symbol's
fragment, it's the passed in fragment (I haven't figured out what that
fragment is - perhaps it's the location where the relocation is to be
written). And if the fragment offset has to be computed only for this
use we might as well just do it when we need to, in
CompressDebugSection.

I also added an assert to help catch this a bit more clearly, even
though it is UB. The test case improvements would either assert fail
and/or valgrind vail without the fix, even if they wouldn't necessarily
fail the FileCheck output.

llvm-svn: 206653
2014-04-18 21:24:12 +00:00
Chad Rosier 9149acb053 [ARM64] Ports the Cortex-A53 Machine Model description from AArch64.
Summary:
This port includes the rudimentary latencies that were provided for
the Cortex-A53 Machine Model in the AArch64 backend. It also changes
the SchedAlias for COPY in the Cyclone model to an explicit
WriteRes mapping to avoid conflicts in other subtargets.

Differential Revision: http://reviews.llvm.org/D3427
Patch by Dave Estes <cestes@codeaurora.org>!

llvm-svn: 206652
2014-04-18 21:22:04 +00:00
Rui Ueyama e5097d0ed4 Fix broken test.
llvm-svn: 206651
2014-04-18 21:19:22 +00:00
Reid Kleckner 0177e18c51 Remove -simplify-libcalls pass form Passes documentation
This pass was removed in r184459.

Also added note that the InstCombine pass does library call
simplification.

Patch slightly modified from one by Daniel Liew
<daniel.liew@imperial.ac.uk>!

llvm-svn: 206650
2014-04-18 21:19:06 +00:00
Yaron Keren d0d38bf91e Expanded test for x86-pc-windows-gnu and x86_64-pc-windows-gnu environments.
llvm-svn: 206649
2014-04-18 21:10:11 +00:00
Rui Ueyama 311a162f26 [PECOFF] Win64 DLL entry function name is _DllMainCRTStartup.
Unlike Win32/x86, it has no "@12" suffix.

llvm-svn: 206648
2014-04-18 21:05:59 +00:00
Rui Ueyama 83743ccca4 [PECOFF] Support LIBRARY directive.
LIBRARY directive in a module definition file specifies the output
DLL file name. It also takes an optional value for the base address.

llvm-svn: 206647
2014-04-18 20:48:20 +00:00
Chandler Carruth 2174f44f61 [LCG] Fix the bugs that Ben pointed out in code review (and the MSan bot
caught). Sad that we don't have warnings for these things, but bleh, no
idea how to fix that.

llvm-svn: 206646
2014-04-18 20:44:16 +00:00
Rui Ueyama 4aaea17dc9 [PECOFF] Add one more test for r206633.
llvm-svn: 206645
2014-04-18 20:44:05 +00:00
Ben Langmuir 532fdc0d4f Don't read CompilerInstance fields that don't exist in ASTUnit
When transferring data from a CompilerInstance in an error path we need
to consider cases where the various fields are uninitialized.

llvm-svn: 206644
2014-04-18 20:39:48 +00:00
Justin Bogner 12d6c3b4d7 OnDiskHashTable: Expect the Info type to declare the offset type
This changes the on-disk hash to get the type to use for offsets from
the Info type, so that clients can be more flexible with the size of
table they support.

llvm-svn: 206643
2014-04-18 20:39:46 +00:00
Justin Bogner 8b56488749 OnDiskHashTable: Expect the Info type to declare the hash size
This changes the on-disk hash to get the size of a hash value from the
Info type, so that clients can be more flexible with the types of hash
they use.

llvm-svn: 206642
2014-04-18 20:39:43 +00:00
Alexey Samsonov 84e2423d34 [DWARF parser] Respect address ranges specified in compile unit DIE.
When address ranges for compile unit are specified in compile unit DIE
itself, there is no need to collect ranges from children subprogram DIEs.

This change speeds up llvm-symbolizer on Clang-produced binaries with
full debug info. For instance, symbolizing a first address in a 1Gb binary
is now 2x faster (1s vs. 2s).

llvm-svn: 206641
2014-04-18 20:30:27 +00:00
Justin Bogner 25463f1577 Teach users of OnDiskHashTable to define hash_value and offset types
This paves the way to making OnDiskHashTable work with hashes that are
not 32 bits wide and to making OnDiskHashTable work very large hash
tables. The LLVM change to use these types is upcoming.

llvm-svn: 206640
2014-04-18 20:27:24 +00:00
Rui Ueyama be0a7ac5e8 Remove redundant "explicit" keywords.
llvm-svn: 206639
2014-04-18 20:06:00 +00:00
Rui Ueyama a2b0334e93 Use switch for readability.
llvm-svn: 206638
2014-04-18 19:59:33 +00:00
Justin Bogner bb094f0669 Remove OnDiskHashTable.h, since it's been moved to llvm
llvm-svn: 206637
2014-04-18 19:57:06 +00:00
Rui Ueyama 28da676709 [PECOFF] Ignore /ignore option.
/ignore:<number> is a linker option to disable warning specified by
the number. We ignore the option because it does not make sense for
LLD.

llvm-svn: 206636
2014-04-18 19:49:24 +00:00
Benjamin Kramer 147644d400 Remove a couple of redundant copies of SmallVector::operator==.
No functionality change.

llvm-svn: 206635
2014-04-18 19:48:03 +00:00
Adam Nemet ee7a3e38c9 [X86] Improve buildFromShuffleMostly for AVX
For a 256-bit BUILD_VECTOR consisting mostly of shuffles of 256-bit vectors,
both the BUILD_VECTOR and its operands may need to be legalized in multiple
steps.  Consider:

(v8f32 (BUILD_VECTOR (extract_vector_elt (v8f32 %vreg0,) Constant<1>),
                     (extract_vector_elt %vreg0, Constant<2>),
                     (extract_vector_elt %vreg0, Constant<3>),
                     (extract_vector_elt %vreg0, Constant<4>),
                     (extract_vector_elt %vreg0, Constant<5>),
                     (extract_vector_elt %vreg0, Constant<6>),
                     (extract_vector_elt %vreg0, Constant<7>),
                     %vreg1))

a. We can't build a 256-bit vector efficiently so, we need to split it into
two 128-bit vecs and combine them with VINSERTX128.

b. Operands like (extract_vector_elt (v8f32 %vreg0), Constant<7>) needs to be
split into a VEXTRACTX128 and a further extract_vector_elt from the
resulting 128-bit vector.

c. The extract_vector_elt from b. is lowered into a shuffle to the first
element and a movss.

Depending on the order in which we legalize the BUILD_VECTOR and its
operands[1], buildFromShuffleMostly may be faced with:

(v4f32 (BUILD_VECTOR (extract_vector_elt
                      (vector_shuffle<1,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),
                      Constant<0>),
                     (extract_vector_elt
                      (vector_shuffle<2,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),
                      Constant<0>),
                     (extract_vector_elt
                      (vector_shuffle<3,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),
                      Constant<0>),
                     %vreg1))

In order to figure out the underlying vector and their identity we need to see
through the shuffles.

[1] Note that the order in which operations and their operands are legalized is
only guaranteed in the first iteration of LegalizeDAG.

Fixes <rdar://problem/16296956>

llvm-svn: 206634
2014-04-18 19:44:16 +00:00
Rui Ueyama 38cf6ddc30 [PECOFF] Support /manifestuac:NO.
If the value for /manifestuac is "NO", LLD will create a manifest XM
file but won't emit <trustinfo> element.

llvm-svn: 206633
2014-04-18 19:43:07 +00:00
Benjamin Kramer ee26b621f0 DebugInfo: Remove some initializer lists to make MSVC happy again.
llvm-svn: 206632
2014-04-18 19:01:53 +00:00
David Blaikie 583a31c976 Add range access to MCAssembler's symbol collection.
llvm-svn: 206631
2014-04-18 18:24:25 +00:00
Reid Kleckner d861811e46 Update comment in LLVMBitCodes.h to reflect the actual bitcode record
llvm-svn: 206630
2014-04-18 18:19:18 +00:00
Matt Arsenault 3add036dc7 Fix uint -> size_t conversion warning.
This warning is disabled for the LLVM build,
but external users of the header can still
run into this.

Patch by Ke Bai

llvm-svn: 206629
2014-04-18 18:08:31 +00:00
Duncan P. N. Exon Smith 0842ff36a6 Revert "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)
This reverts commit r206622 and the MSVC fixup in r206626.

Apparently the remotely failing tests are still failing, despite my
attempt to fix the nondeterminism in r206621.

llvm-svn: 206628
2014-04-18 17:56:08 +00:00
Greg Fitzgerald 986b407f31 Fixed llvm-build when no targets are enabled
llvm-svn: 206627
2014-04-18 17:39:50 +00:00
Duncan P. N. Exon Smith 38fe464df0 Fixing MSVC after r206622?
llvm-svn: 206626
2014-04-18 17:38:01 +00:00
Andrew Trick 1766f93b35 Better comments to explain buffered/unbuffered processor resources.
llvm-svn: 206625
2014-04-18 17:35:08 +00:00
Alexey Samsonov 762343da6c [DWARF parser] Refactor fetching DIE address ranges.
Add a helper method to get address ranges specified in a DIE
(either by DW_AT_low_pc/DW_AT_high_pc, or by DW_AT_ranges). Use it
to untangle and simplify the code.

No functionality change.

llvm-svn: 206624
2014-04-18 17:25:46 +00:00
Marshall Clow 5f7c2db2ce Bug #19473. If you pass an allocator to std::function, we should use that allocator, not construct one from scratch. Add a test to make sure
llvm-svn: 206623
2014-04-18 17:23:36 +00:00
Duncan P. N. Exon Smith f8361d127a Reapply "blockfreq: Rewrite BlockFrequencyInfoImpl"
This reverts commit r206556, effectively reapplying commit r206548 and
its fixups in r206549 and r206550.

In an intervening commit I've added target triples to the tests that
were failing remotely [1] (but passing locally).  I'm hoping the mystery
is solved?  I'll revert this again if the tests are still failing
remotely.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1816

llvm-svn: 206622
2014-04-18 17:22:25 +00:00
Duncan P. N. Exon Smith c812b5b33a Add some target triples for better determinism
These tests were failing on some buildbots after r206548 (reverted in
r206556), but passing locally.

They were missing target triples, so maybe that's the problem?

llvm-svn: 206621
2014-04-18 17:22:19 +00:00
Todd Fiala 31cb1b547d Marked TestAttachResume.process_attach_continue_interrupt_detach() as XFAIL on Linux per pr19478.
llvm-svn: 206620
2014-04-18 17:07:09 +00:00