Commit Graph

221913 Commits

Author SHA1 Message Date
Amaury Sechet e8ea7d8b1d Improve testing for the C API
Summary:
This basically add an echo test case in C. The support is limited right now, but full support would just be too much to review at once.

The echo test case simply get a module as input and try to output the same exact module. This allow to check the both reading and writing API are working as expected.

I want to improve this test over time to support more and more of the API, in order to improve coverage (coverage is quite poor right now).

Test Plan: Run the test.

Reviewers: chandlerc, bogner

Subscribers: llvm-commits

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

llvm-svn: 259844
2016-02-04 23:26:19 +00:00
Rui Ueyama f9cec37880 Merge conditions of two nested `if`s.
llvm-svn: 259843
2016-02-04 23:18:22 +00:00
Niels Ole Salscheider ff56c1c6a0 Fix the search path for CMake files
This allows to find the LLVM's CMake files after moving them in
r259821.

llvm-svn: 259842
2016-02-04 23:17:20 +00:00
Niels Ole Salscheider c656363533 Fix the libdir suffix for LLVM_CMAKE_PATH
llvm-svn: 259841
2016-02-04 23:15:29 +00:00
Nemanja Ivanovic b6fdce4ca0 Fix for PR 26356
Using the load immediate only when the immediate (whether signed or unsigned)
can fit in a 16-bit signed field. Namely, from -32768 to 32767 for signed and
0 to 65535 for unsigned. This patch also ensures that we sign-extend under the
right conditions.

llvm-svn: 259840
2016-02-04 23:14:42 +00:00
Evandro Menezes 898acf9db8 Fix typo and test commit
llvm-svn: 259839
2016-02-04 23:07:57 +00:00
Zachary Turner 9a1a2946af Move the rest of the tests over to using the new decorator module.
llvm-svn: 259838
2016-02-04 23:04:17 +00:00
Richard Smith 3d98703523 PR25271: When attaching default template arguments to redeclarations of a
template, keep looking for default arguments if we see a template parameter
pack. There may be default arguments preceding a pack with no default argument.

Patch by Jannis Harder!

llvm-svn: 259836
2016-02-04 22:54:41 +00:00
Nemanja Ivanovic 220b4fe4a9 Provide a test case for rl259798
llvm-svn: 259835
2016-02-04 22:36:10 +00:00
Adrian McCarthy 510ca1b0b7 Replace tabs with spaces for consistent indentation. No actual text changes.
llvm-svn: 259834
2016-02-04 22:20:30 +00:00
Niels Ole Salscheider bd2515461a Fix the search path for CMake files
This fixes the build after moving LLVM's CMake files in r259821.

llvm-svn: 259832
2016-02-04 21:45:02 +00:00
Sean Silva 09247f8955 Don't push relocation sections onto InputSection<ELFT>::Discarded.RelocSections
Summary:
LLVM3.3 (and earlier) would fail to include a relocation section in
the group that the section it was relocating is in. Object files
affected by this issue have been encountered in the wild when using LLD.

This would result in a siutation like:

  Section {
    Index: 5
    Name: .text._Z3fooIiEvv (6)
    Type: SHT_PROGBITS (0x1)
    Flags [ (0x206)
      SHF_ALLOC (0x2)
      SHF_EXECINSTR (0x4)
      SHF_GROUP (0x200)
    ]
    Address: 0x0
    Offset: 0x48
    Size: 5
    Link: 0
    Info: 0
    AddressAlignment: 1
    EntrySize: 0
  }
  Section {
    Index: 6
    Name: .rela.text._Z3fooIiEvv (1)
    Type: SHT_RELA (0x4)
    Flags [ (0x0)
    ]
    Address: 0x0
    Offset: 0x3F0
    Size: 24
    Link: 8
    Info: 5
    AddressAlignment: 8
    EntrySize: 24
  }

In LLD, during symbol resolution, we discard the section containing the
weak symbol, but this amounts to replacing it with
InputSection<ELFT>::Discarded.
When we later saw the corresponding relocation section, we would then
end up pusing onto InputSection<ELFT>::Discarded.RelocSections, which is
bogus.

Reviewers: ruiu, rafael

Subscribers: llvm-commits, Bigcheese

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

llvm-svn: 259831
2016-02-04 21:41:07 +00:00
Rafael Espindola de9857e3c1 Avoid code duplication when creating dynamic relocations.
Another case where we currently have almost duplicated code is the
creation of dynamic relocations. First to decide if we need one, then to
decide what to write.

This patch fixes it by passing more information from the relocation scan
to the section writing code. This is the same idea used for r258723.

I actually think it should be possible to simplify this further by
reordering things a bit in the writer. For example, we should be able to
represent almost every position in the file with an OutputSeciton and
offset. When writing it out we then just need to add the offset to the
OutputSection VA.

llvm-svn: 259829
2016-02-04 21:33:05 +00:00
Chad Rosier 35706ad6bb [AArch64] Bound the number of instructions we scan when searching for updates.
This only impacts the creation of pre-/post-index instructions.  The bound was
set high enough such that it did not change code generation for SPEC200X.

llvm-svn: 259828
2016-02-04 21:26:02 +00:00
Pete Cooper 8563e5a362 Set CPU_SUBTYPE_LIB64 in mach_header.
On Mac OS 10.5 and later, with X86_64 and outputting a dynamic executable,
ld64 set the CPU_SUBTYPE_LIB64 mask on the cpusubtype in the mach_header.

This adds the same functionality to lld.

rdar://problem/24507177

llvm-svn: 259826
2016-02-04 20:43:43 +00:00
Vedant Kumar 4de5cb8aef [docs] Fix typo in YamlIO.rst
Patch by Mario Lang!

llvm-svn: 259825
2016-02-04 20:42:43 +00:00
Chih-Hung Hsieh c2fab48145 builtins: Fix struct __emutls_control to match GCC
The type of size and align in struct __emutls_control must be
  typedef unsigned int gcc_word __attribute__((mode(word)));
to match GCC. When gcc_word is larger than size_t, which is the case
for x32, the upper extra bits are all zeros. We can use variables of
size_t to operate on size and align.

Fix one trivial C99 warning about mixed declaration and code.

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

llvm-svn: 259824
2016-02-04 20:26:00 +00:00
Siva Chandra 77b326f39d Revert "Use an artifical namespace so that member vars do not hide local vars."
Summary:
This reverts commit 8af14b5f9af68c31ac80945e5b5d56f0a14b38e4.
Reverting as it breaks a few tests on Mac.

Reviewers: spyffe

Subscribers: lldb-commits

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

llvm-svn: 259823
2016-02-04 20:08:40 +00:00
Niels Ole Salscheider 6ecf633f99 Install cmake files to lib/cmake/clang
This is the right location for platform-specific files.

Also, search for LLVM's CMake files in this directory.

llvm-svn: 259822
2016-02-04 20:08:27 +00:00
Niels Ole Salscheider fc81413531 Install cmake files to lib/cmake/llvm
This is the right location for platform-specific files.

On some distributions (e. g. Exherbo), a package can be installed for several
architectures in parallel, but the architecture-independent files are shared.
Therefore, we must not install architecture-dependent files (like the CMake
config and export files) to share/.

llvm-svn: 259821
2016-02-04 20:08:19 +00:00
Manman Ren b4e8a1b308 Fix a crash when there is a typo in the return statement.
If the typo happens after a successful deduction for an earlier
return statement, we should check if the deduced type is null
before using it.

The typo correction happens after we try to deduce the return
type and we ignore the deduction from the typo and continue
to typo correction.

rdar://24342247

llvm-svn: 259820
2016-02-04 20:05:40 +00:00
Xinliang David Li 5527a9dd42 [PGO] code simplification: use existing VP annotation API /NFC
llvm-svn: 259819
2016-02-04 19:54:17 +00:00
Jim Ingham 97c2868362 Make HostThread SetName work on OS X. GetName doesn't currently work, the code that was in
GetName actually got the queue name not the thread name and anyway didn't actually work to do
that.  So I just deleted it with a fixme.

<rdar://problem/24487554>

llvm-svn: 259818
2016-02-04 19:42:32 +00:00
Jonathan Peyton fd74f90072 Add LIBOMP_ENABLE_SHARED option for CMake
When building executables for Cray supercomputers, statically-linked executables
are preferred. This patch makes it possible to build the OpenMP runtime as an
archive for building statically-linked executables.  The patch adds the flag
LIBOMP_ENABLE_SHARED, which defaults to true. When true, a build of the OpenMP
runtime yields dynamic libraries. When false, a build of the OpenMP runtime
yields static libraries. There is no setting that allows both kinds of libraries
to be built.

Patch by John Mellor-Crummey

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

llvm-svn: 259817
2016-02-04 19:29:35 +00:00
Simon Pilgrim 7823fd2535 [X86][SSE] Select domain for 32/64-bit partial loads for EltsFromConsecutiveLoads
Choose between MOVD/MOVSS and MOVQ/MOVSD depending on the target vector type.

This has a lot fewer test changes than trying to add this to X86InstrInfo::setExecutionDomain.....

llvm-svn: 259816
2016-02-04 19:27:51 +00:00
Wei Mi 33e7bc0029 Fix a regression for r259736.
When SCEV expansion tries to reuse an existing value, it is needed to ensure
that using the Value at the InsertPt will not break LCSSA. The fix adds a
check that InsertPt is either inside the candidate Value's parent loop, or
the candidate Value's parent loop is nullptr.

llvm-svn: 259815
2016-02-04 19:17:33 +00:00
Xinliang David Li b56be389c8 Fix format in comment
llvm-svn: 259814
2016-02-04 19:14:10 +00:00
Xinliang David Li 402477d2ba [PGO] Add interfaces to annotate instr with VP data
Add interfaces to do value profile data IR annnotation
  and read. Needed by both FE and IR based PGO.

llvm-svn: 259813
2016-02-04 19:11:43 +00:00
Chad Rosier 05f8020cdf [AArch64] Improve load/store optimizer to handle LDUR + LDR (take 3).
This patch allows the mixing of scaled and unscaled load/stores to form
load/store pairs.

PR24465
http://reviews.llvm.org/D12116
Many thanks to Ahmed and Michael for fixes and code review.

This is a reapplication of r246769 and r259790.  The tramp3d failure was caused
by an incorrect refactoring in the patch.  Specifically, we weren't always
properly clearing the SExtIdx flag.

llvm-svn: 259812
2016-02-04 18:59:49 +00:00
Rong Xu 9837ef56b4 [PGO] cc1 option name change for profile instrumentation
This patch changes cc1 option -fprofile-instr-generate to an enum option
-fprofile-instrument={clang|none}. It also changes cc1 options
-fprofile-instr-generate= to -fprofile-instrument-path=.
The driver level option -fprofile-instr-generate and -fprofile-instr-generate=
remain intact. This change will pave the way to integrate new PGO
instrumentation in IR level.

Review: http://reviews.llvm.org/D16730
llvm-svn: 259811
2016-02-04 18:39:09 +00:00
Siva Chandra 375882dddb Use an artifical namespace so that member vars do not hide local vars.
Summary:
While evaluating expressions when stopped in a class method, there was a
problem of member variables hiding local variables. This was happening
because, in the context of a method, clang already knew about member
variables with their name and assumed that they were the only variables
with those names in scope. Consequently, clang never checks with LLDB
about the possibility of local variables with the same name and goes
wrong. This change addresses the problem by using an artificial
namespace "$__lldb_local_vars". All local variables in scope are
declared in the "$__lldb_expr" method as follows:

    using $__lldb_local_vars::<local var 1>;
    using $__lldb_local_vars::<local var 2>;
    ...

This hides the member variables with the same name and forces clang to
enquire about the variables which it thinks are declared in
$__lldb_local_vars. When LLDB notices that clang is enquiring about
variables in $__lldb_local_vars, it looks up local vars and conveys
their information if found. This way, member variables do not hide local
variables, leading to correct evaluation of expressions.

A point to keep in mind is that the above solution does not solve the
problem for one specific case:

    namespace N
    {
        int a;
    }

    class A
    {
    public:
        void Method();
        int a;
    };

    void
    A::Method()
    {
        using N::a;
        ...

        // Since the above solution only touches locals, it does not
        // force clang to enquire about "a" coming from namespace N.
    }

Reviewers: clayborg, spyffe

Subscribers: lldb-commits

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

llvm-svn: 259810
2016-02-04 18:38:35 +00:00
Sanjoy Das 76c48e0e70 [SCEV] Add boolean accessors for NSW, NUW and NW; NFC
llvm-svn: 259809
2016-02-04 18:21:54 +00:00
Zachary Turner 7a5382de82 Move some of the common decorators to decorators.py.
This doesn't attempt to move every decorator.  The reason for
this is that it requires touching every single test file to import
decorators.py.  I would like to do this in a followup patch, but
in the interest of keeping the patches as bite-sized as possible,
I've only attempted to move the underlying common decorators first.
A few tests call these directly, so those tests are updated as part
of this patch.

llvm-svn: 259807
2016-02-04 18:03:01 +00:00
David Majnemer a4859dfa46 Correctly handle {Always,Never}StepIntoLine
llvm-svn: 259806
2016-02-04 17:57:12 +00:00
David Majnemer 4d123512a2 Add support for S_DEFRANGE and S_DEFRANGE_SUBFIELD
llvm-svn: 259805
2016-02-04 17:37:30 +00:00
David Majnemer 6f01e05d7e Make the dumper's output for variable ranges easier to read
llvm-svn: 259804
2016-02-04 17:29:13 +00:00
Sanjay Patel 5f4cc6fbd9 use 'auto' for iterators; NFCI
llvm-svn: 259802
2016-02-04 17:00:35 +00:00
Silviu Baranga 33b3bd17dd [AArch64] Multiply extended 32-bit ints with `[U|S]MADDL'
During instruction selection, the AArch64 backend can recognise the
following pattern and generate an [U|S]MADDL instruction, i.e. a
multiply of two 32-bit operands with a 64-bit result:

(mul (sext i32), (sext i32))
However, when one of the operands is constant, the sign extension
gets folded into the constant in SelectionDAG::getNode(). This means
that the instruction selection sees this:

(mul (sext i32), i64)
...which doesn't match the pattern. Sign-extension and 64-bit
multiply instructions are generated, which are slower than one 32-bit
multiply.

Add a pattern to match this and generate the correct instruction, for
both signed and unsigned multiplies.

Patch by Chris Diamand!

llvm-svn: 259800
2016-02-04 16:47:09 +00:00
Benjamin Kramer e4dff62f64 The canonical way to XFAIL a test for all targets is XFAIL: *, not XFAIL:
Fix the lit bug that enabled this "feature" (empty triple is substring
of all possible target triples) and change the two outliers to use the
documented * syntax.

llvm-svn: 259799
2016-02-04 16:21:38 +00:00
Nemanja Ivanovic e8cbae32e9 Enable the %s modifier in inline asm template string
This patch corresponds to review:
http://reviews.llvm.org/D16847

There are some files in glibc that use the output operand modifier even though
it was deprecated in GCC. This patch just adds support for it to prevent issues
with such files.

llvm-svn: 259798
2016-02-04 16:18:08 +00:00
Renato Golin c455e2f441 [PPC] Move PPC test to a PPC-specific dir
llvm-svn: 259797
2016-02-04 16:14:59 +00:00
Simon Pilgrim 6788f33cf2 [X86][SSE] Add general 32-bit LOAD + VZEXT_MOVL support to EltsFromConsecutiveLoads
This patch adds support for consecutive (load/undef elements) 32-bit loads, followed by trailing undef/zero elements to be combined to a single MOVD load.

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

llvm-svn: 259796
2016-02-04 16:12:56 +00:00
Chad Rosier 18896c0f5e Revert "[AArch64] Improve load/store optimizer to handle LDUR + LDR."
This reverts commit r259790. tramp3d-v4 is still having problems.

llvm-svn: 259795
2016-02-04 16:01:40 +00:00
Simon Pilgrim 528e94e9a2 [X86][SSE] Added i686 target tests to make sure we are correctly loading consecutive entries as 64-bit integers
llvm-svn: 259794
2016-02-04 15:51:55 +00:00
Adrian McCarthy 25bfa7859c Provide arguments for all the format string placeholders!
Log message was wrong because an argument was missing.

llvm-svn: 259793
2016-02-04 15:35:55 +00:00
Elena Demikhovsky 86528270b9 AVX-512: Fixed a bug in FMA instruction selection on KNL
The FMA instruction was selected from AVX2 set instead of AVX-512

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

llvm-svn: 259792
2016-02-04 15:11:11 +00:00
Petar Jovanovic 23e44f5e39 [Power PC] softening long double type
This patch implements softening of long double type (ppcf128) on ppc32
architecture and enables operations for this type for soft float.

Patch by Strahinja Petrovic.

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

llvm-svn: 259791
2016-02-04 14:43:50 +00:00
Chad Rosier feec2aeb0f [AArch64] Improve load/store optimizer to handle LDUR + LDR.
This patch allows the mixing of scaled and unscaled load/stores to form
load/store pairs.

PR24465
http://reviews.llvm.org/D12116
Many thanks to Ahmed and Michael for fixes and code review.

This is a reapplication of r246769, which was reverted in r246782 due to a
test-suite failure.  I'm unable to reproduce the issue at this time.

llvm-svn: 259790
2016-02-04 14:42:55 +00:00
Michael Zuckerman 7d73360479 [AVX512] add vfmadd132ss and vfmadd132sd Intrinsic
Differential Revision: http://reviews.llvm.org/D16589

llvm-svn: 259789
2016-02-04 14:41:08 +00:00
Haojian Wu 4d67ec3f8c [clang-tidy] More friendly warning in "google-runtime-references" when meeting an unnamed function parameter.
Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 259787
2016-02-04 14:06:49 +00:00