Commit Graph

270192 Commits

Author SHA1 Message Date
Simon Atanasyan 1998f859dc [MIPS] Merge multiple functions for writing relocation result into the single one. NFC
llvm-svn: 311712
2017-08-24 21:57:03 +00:00
Simon Atanasyan c5455e237f [MIPS] Keep all code read addends in the `getImplicitAddend` function
Currently LLD reads the R_MIPS_HI16's addends in the `computeMipsAddend`
function, the R_MIPS_LO16's addends in both `computeMipsAddend` and
`getImplicitAddend` functions. This patch moves reading all addends to
the `getImplicitAddend` function. As a side effect it fixes a "paired"
HI16/LO16 addend calculation if "LO16" part of a pair is not found.

llvm-svn: 311711
2017-08-24 21:56:58 +00:00
Simon Atanasyan 204cae99bb [MIPS] Remove redundant function getPcRelocAddend. NFC
llvm-svn: 311710
2017-08-24 21:56:52 +00:00
Dehao Chen 5e97f23441 Expose -mllvm -accurate-sample-profile to clang.
Summary: With accurate sample profile, we can do more aggressive size optimization. For some size-critical application, this can reduce the text size by 20%

Reviewers: davidxl, rsmith

Reviewed By: davidxl, rsmith

Subscribers: mehdi_amini, eraman, sanjoy, cfe-commits

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

llvm-svn: 311707
2017-08-24 21:37:33 +00:00
Dehao Chen f0e27e63e7 Move accurate-sample-profile into the function attribute.
Summary: We need to have accurate-sample-profile in function attribute so that it works with LTO.

Reviewers: davidxl, rsmith

Reviewed By: davidxl

Subscribers: sanjoy, mehdi_amini, javed.absar, llvm-commits, eraman

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

llvm-svn: 311706
2017-08-24 21:37:04 +00:00
Stephan T. Lavavej bc933768a6 [libcxx] [test] Update for C++17 feature removals.
test/std/containers/Emplaceable.h
test/std/containers/NotConstructible.h
test/support/counting_predicates.hpp
Replace unary_function/binary_function inheritance with typedefs.

test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp
test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp
test/std/utilities/function.objects/func.require/binary_function.pass.cpp
test/std/utilities/function.objects/func.require/unary_function.pass.cpp
Mark these tests as requiring 98/03/11/14 because 17 removed unary_function/binary_function.

test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp
Mark these tests as requiring 11/14 because 17 removed packaged_task allocator support.

test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
This test doesn't need to be skipped in C++17 mode. Only the construction of
std::function from an allocator needs to be skipped in C++17 mode.

test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp
When testing these reference_wrapper features, unary_function inheritance is totally irrelevant.

test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
Define and use my_unary_function/my_binary_function to test the weak result type machinery
(which is still present in C++17, although deprecated).

test/support/msvc_stdlib_force_include.hpp
Now we can test C++17 strictly, without enabling removed features.

Fixes D36503.

llvm-svn: 311705
2017-08-24 21:24:08 +00:00
Eugene Zelenko 9248fde53a [Polly] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 311704
2017-08-24 21:22:41 +00:00
Eugene Zelenko 5df3d89009 [CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 311703
2017-08-24 21:21:39 +00:00
Chad Rosier f98335e0b0 [PartialInlining] Formatting. NFC.
llvm-svn: 311702
2017-08-24 21:21:09 +00:00
Nathan Hawes 9b656ffbef test commit: fix typo in comment
llvm-svn: 311701
2017-08-24 21:20:41 +00:00
Rui Ueyama 8bee41e423 Simplify. NFC.
llvm-svn: 311700
2017-08-24 20:32:58 +00:00
Chad Rosier 4cb2e82774 [PartialInlining] Type. NFC.
llvm-svn: 311699
2017-08-24 20:29:02 +00:00
Rui Ueyama 9f7032aaf0 Minor refactoring. NFC.
llvm-svn: 311696
2017-08-24 20:26:54 +00:00
Richard Smith 376c28e296 [ubsan] PR34266: When sanitizing the 'this' value for a member function that happens to be a lambda call operator, use the lambda's 'this' pointer, not the captured enclosing 'this' pointer (if any).
Do not sanitize the 'this' pointer of a member call operator for a lambda with
no capture-default, since that call operator can legitimately be called with a
null this pointer from the static invoker function. Any actual call with a null
this pointer should still be caught in the caller (if it is being sanitized).

This reinstates r311589 (reverted in r311680) with the above fix.

llvm-svn: 311695
2017-08-24 20:10:33 +00:00
Konstantin Zhuravlyov 68107657d4 AMDGPU: Fix gfx801 features
gfx801 has 1/2 rate F64, Fast F32 FMA

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

llvm-svn: 311694
2017-08-24 20:03:07 +00:00
Jacob Gravelle 690b76e13d [WebAssembly] FastISel : Bail to SelectionDAG for constexpr calls
Summary: Currently FastISel lowers constexpr calls as indirect calls.
We'd like those to direct calls, and falling back to SelectionDAGISel
handles that.

Reviewers: dschuff, sunfish

Subscribers: jfb, sbc100, llvm-commits, aheejin

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

llvm-svn: 311693
2017-08-24 19:53:44 +00:00
Tobias Grosser 6d0970f64e Revert "[polly] Fix ScopDetectionDiagnostic test failure caused by r310940"
This reverts commit 950849ece9bb8fdd2b41e3ec348b9653b4e37df6.

This commit broke various buildbots.

llvm-svn: 311692
2017-08-24 19:47:15 +00:00
Heejin Ahn 34672faf49 [WebAssembly] Update GCC test suite failure expectations
Summary:
Update GCC test suite failure expectations as we add -O0 to the bare tests in
WebAssembly waterfall. There are still several untriaged lld failures.

Reviewers: sbc100, jgravelle-google, dschuff

Reviewed By: dschuff

Subscribers: jfb

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

llvm-svn: 311691
2017-08-24 19:43:09 +00:00
Krzysztof Parzyszek c802d27a93 [Hexagon] Set access size for vector pseudo loads/stores
llvm-svn: 311690
2017-08-24 19:19:24 +00:00
Daniel Sanders 069bb8d45f [globalisel][tablegen] Predicates should start from GIPFP_Invalid+1 not GIPFP_Invalid
This fixes a warning when there are zero defined predicates and also fixes an
unnoticed bug where the first predicate in the table was unusable.

llvm-svn: 311684
2017-08-24 18:54:16 +00:00
Erich Keane 5a2b322e0d [Preprocessor] Correct internal token parsing of newline characters in CRLF
Discovered due to a goofy git setup, the test system-headerline-directive.c 
(and a few others) failed because the token-consumption will consume only the 
'\r' in CRLF, making the preprocessor's printed value give the wrong line number 
when returning from an include. For example:

(line 1):#include <noline.h>\r\n

The "file exit" code causes the printer to try to print the 'returned to the 
main file' line. It looks up what the current line number is. However, since the 
current 'token' is the '\n' (since only the \r was consumed), it will give the 
line number as '1", not '2'. This results in a few failed tests, but more 
importantly, results in error messages being incorrect when compiling a 
previously preprocessed file.

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

llvm-svn: 311683
2017-08-24 18:36:07 +00:00
Rui Ueyama 5c19028cec Allow not only -O<number> but also -O <number>.
Fixes https://bugs.llvm.org/show_bug.cgi?id=34311

llvm-svn: 311682
2017-08-24 18:34:44 +00:00
Rui Ueyama 00cf731ecd Make empty arguments visible in error messages.
Before this patch, lld printed out something like

  error: -O: number expected, but got

After this patch, it prints out the same error message like this:

  error: -O: number expected, but got ''

Fixes https://bugs.llvm.org/show_bug.cgi?id=34311

llvm-svn: 311681
2017-08-24 18:34:32 +00:00
Adrian Prantl 1b6d8713e4 Revert "[ubsan] PR34266: When sanitizing the 'this' value for a member function that happens to be a lambda call operator, use the lambda's 'this' pointer, not the captured enclosing 'this' pointer (if any)."
This reverts commit r311589 because of bot breakage.
http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan_check/4115/consoleFull#15752874848254eaf0-7326-4999-85b0-388101f2d404.

llvm-svn: 311680
2017-08-24 18:18:24 +00:00
Jim Ingham 44ea319596 Fixed a typo in the example (getName -> GetName)
but while I was at it I converted the example to use
properties, since that's much nicer looking.

llvm-svn: 311679
2017-08-24 18:01:50 +00:00
Victor Leschuk 6aedf785c5 Remove duplicate code
llvm-svn: 311675
2017-08-24 17:02:38 +00:00
Hans Wennborg c7d8b01774 Mark allocator_oom_test.cc unsupported on arm & aarch64 (PR33972)
The buildbots don't seem to like it.

llvm-svn: 311674
2017-08-24 17:00:36 +00:00
Victor Leschuk 471579b52e Add missing break in switch
llvm-svn: 311673
2017-08-24 16:57:10 +00:00
Krasimir Georgiev 33bd852408 [clang-format] Emit absolute splits before lines for comments, try 2
Summary:
This recommits https://reviews.llvm.org/D36956 with an update to the added test
case to not use raw string literals, since this makes gcc unhappy.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits, klimek

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

llvm-svn: 311672
2017-08-24 16:41:10 +00:00
Petar Jovanovic 5076511ed6 [mips] Introducing option -mabs=[legacy/2008]
In patch r205628 using abs.[ds] instruction is forced, as they should behave
in accordance with flags Has2008 and ABS2008. Unfortunately for revisions
prior mips32r6 and mips64r6, abs.[ds] is not generating correct result when
working with NaNs. To generate a sequence which always produce a correct
result but also to allow user more control on how his code is compiled,
option -mabs is added where user can choose legacy or 2008.
By default legacy mode is used on revisions prior R6. Mips32r6 and mips64r6
use abs2008 mode by default.

Patch by Aleksandar Beserminji

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

llvm-svn: 311669
2017-08-24 16:06:30 +00:00
Pete Couperus 2d1f6d67c5 [ARC] Add ARC backend.
Add the ARC backend as an experimental target to lib/Target.
Reviewed at: https://reviews.llvm.org/D36331

llvm-svn: 311667
2017-08-24 15:40:33 +00:00
Krasimir Georgiev 719f97cf65 [X86AsmParser] Refactor AsmRewrite constructors, NFCI
Summary:
This is a follow-up of https://reviews.llvm.org/D37105, where a slight refactoring
of the constructors of AsmRewrite is proposed.

Reviewers: coby

Reviewed By: coby

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

llvm-svn: 311666
2017-08-24 15:03:18 +00:00
Sanjay Patel 1cc58ecc8a fix typo; NFC
llvm-svn: 311665
2017-08-24 15:00:13 +00:00
Alex Lorenz 39265ca89f Fix use-after-free in Clang's ASTSelection unittest
llvm-svn: 311664
2017-08-24 14:53:48 +00:00
Michael Kruse b795bfc0d4 [CodeGen] Detect impossible partial write conditions more reliably.
Whether a partial write is tautological/unsatisfiable not only
depends on the access domain, but also on the domain covered
by its node in the AST.

In the example below, there are two instances of Stmt_cond_false. It may have a partial write access that is not executed in instance Stmt_cond_false(0).

      for (int c0 = 0; c0 < tmp5; c0 += 1) {
        Stmt_for_body344(c0);
        if (tmp5 >= c0 + 2)
          Stmt_cond_false(c0);
        Stmt_cond_end(c0);
      }
      if (tmp5 <= 0) {
        Stmt_for_body344(0);
        Stmt_cond_false(0);
        Stmt_cond_end(0);
      }

Isl cannot derive a subscript for an array element that is never accessed.
This caused an error in that no subscript expression has been generated
in IslNodeBuilder::createNewAccesses, but BlockGenerator expected one
to exist because there is an execution of that write, just not in that
ast node.

Fixed by instead of determining whether the access domain is empty,
inspect whether isl generated a constant "false" ast expression in
the current ast node.

This should fix a compiler crash of the aosp buildbot.

llvm-svn: 311663
2017-08-24 14:51:35 +00:00
Sjoerd Meijer b0eb5fb317 [AArch64] Add FMOVH0: materialize 0 using zero register for f16 values
Instead of loading 0 from a constant pool, it's of course much better to
materialize it using an fmov and the zero register.

Thanks to Ahmed Bougacha for the suggestion.

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

llvm-svn: 311662
2017-08-24 14:47:06 +00:00
Sanjay Patel 5d67d8916e [BypassSlowDivision] move map helper code to header; NFC
We can reuse this code with other div/rem transforms as shown in:
https://reviews.llvm.org/D31037 
https://bugs.llvm.org/show_bug.cgi?id=31028

llvm-svn: 311661
2017-08-24 14:43:33 +00:00
Chad Rosier 38aa163611 [Driver][AArch64] Add tests for RDM feature.
Differential Revision: https://reviews.llvm.org/D37106

llvm-svn: 311660
2017-08-24 14:32:55 +00:00
Chad Rosier bfd4014304 [TargetParser][AArch64] Add support for RDM feature in the target parser.
Differential Revision: https://reviews.llvm.org/D37081

llvm-svn: 311659
2017-08-24 14:30:44 +00:00
Michael Zuckerman 9ee61d9b00 Adding base lit test for x86interleaved
llvm-svn: 311658
2017-08-24 14:11:28 +00:00
Coby Tayree ee1bc325c0 [fixup][rL311639]
rL311639 created X86AsmParser a dependency in X86AsmPrinter, which broke builds
this fix adds the necessary dep

llvm-svn: 311657
2017-08-24 14:10:50 +00:00
Alex Lorenz 0eaa48322e Add missing std::move call
This should fix
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_build/41578/

llvm-svn: 311656
2017-08-24 14:08:18 +00:00
Alex Lorenz a844f396ce [refactor] Add the AST source selection component
This commit adds the base AST source selection component to the refactoring
library. AST selection is represented using a tree of SelectedASTNode values.
Each selected node gets its own selection kind, which can actually be None even
in the middle of tree (e.g. statement in a macro whose child is in a macro
argument). The initial version constructs a "raw" selection tree, without
applying filters and canonicalisation operations to the nodes.

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

llvm-svn: 311655
2017-08-24 13:51:09 +00:00
Haojian Wu e928c2b67e [clang-tidy] Add missing IgnoreMacros doc for modernize-use-equals-default.
A followup of rL311136.

llvm-svn: 311654
2017-08-24 13:45:18 +00:00
Krasimir Georgiev 9ee966548e [X86AsmParser] Fix msan: use-of-uninitialized-value after r311639
Summary:
CodeGen/ms-inline-asm.c test triggers msan use-of-uninitialized-value here:
llvm/lib/MC/MCParser/AsmParser.cpp:5629:7

Reviewers: bkramer, coby

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

llvm-svn: 311653
2017-08-24 13:38:18 +00:00
Haojian Wu 3f495944de [clang-tidy] A follow-up fix of braced-init-list constructors in make-unique check.
Reviewers: alexfh

Reviewed By: alexfh

Subscribers: JDevlieghere, xazax.hun, cfe-commits

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

llvm-svn: 311652
2017-08-24 13:35:55 +00:00
Alexander Kornienko 15ea4ebbb2 [clang-tidy] bugprone-undefined-memory-manipulation: include type into the message
Having the actual type in the message helps a lot understanding warnings in templates ;)

+ fix a false negative for type aliases.

llvm-svn: 311651
2017-08-24 12:11:05 +00:00
Krzysztof Parzyszek c09a14eeb2 [Hexagon] Generate correct runtime check when recognizing memmove
The check (assuming positive stride) for validity of memmove should be
(a) the destination is at a lower address than the source, or
(b) the distance between the source and destination is greater than or
    equal the number of bytes copied.

For the second part it is sufficient to assume that the destination
is at a higher address, since the opposite case is covered by (a).
The distance calculation was previously done by subtracting the
pointers in the wrong order.

llvm-svn: 311650
2017-08-24 11:59:53 +00:00
Evgeny Astigeevich 540a39adf7 [ARM, Thumb1] Prevent ARMTargetLowering::isLegalAddressingMode from accepting illegal modes
ARMTargetLowering::isLegalAddressingMode can accept illegal addressing modes
for the Thumb1 target. This causes generation of redundant code and affects
performance.

This fixes PR34106: https://bugs.llvm.org/show_bug.cgi?id=34106

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

llvm-svn: 311649
2017-08-24 10:00:25 +00:00
Siddharth Bhat 78027437e6 [Polly] [PPCGCodeGeneration] Mild refactoring of checking validity of functions in a kernel.
This is a stylistic change to make the function a little more readable.
Also add a debug print to show what instruction contains a use of a
function we don't understand in the kernel.

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

llvm-svn: 311648
2017-08-24 09:54:15 +00:00