platform/upstream/llvm.git
7 years ago[clang-refactor] Apply source replacements
Alex Lorenz [Fri, 13 Oct 2017 19:42:05 +0000 (19:42 +0000)]
[clang-refactor] Apply source replacements

This commit actually brings clang-refactor to a usable state as it can now
apply the refactoring changes to source files.
The -selection option is now also fully supported.

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

llvm-svn: 315738

7 years ago[ELF] Recognize additional relocation types
Petr Hosek [Fri, 13 Oct 2017 19:30:00 +0000 (19:30 +0000)]
[ELF] Recognize additional relocation types

These are generated by the linker itself and it shouldn't treat
them as unrecognized. This was introduced in r315552 and is triggering
an error when building UBSan shared library for i386.

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

llvm-svn: 315737

7 years ago[analyzer] RetainCount: Ignore annotations on user-made CFRetain wrappers.
Artem Dergachev [Fri, 13 Oct 2017 19:10:42 +0000 (19:10 +0000)]
[analyzer] RetainCount: Ignore annotations on user-made CFRetain wrappers.

It is not uncommon for the users to make their own wrappers around
CoreFoundation's CFRetain and CFRelease functions that are defensive
against null references. In such cases CFRetain is often incorrectly
marked as CF_RETURNS_RETAINED. Ignore said annotation and treat such
wrappers similarly to the regular CFRetain.

rdar://problem/31699502
Differential Revision: https://reviews.llvm.org/D38877

llvm-svn: 315736

7 years ago[Hexagon] Minimize number of repeated constant extenders
Krzysztof Parzyszek [Fri, 13 Oct 2017 19:02:59 +0000 (19:02 +0000)]
[Hexagon] Minimize number of repeated constant extenders

Each constant extender requires an extra instruction, which adds to the
code size and also reduces the number of available slots in an instruction
packet. In most cases, the value of a repeated constant extender could be
loaded into a register, and the instructions using the extender could be
replaced with their counterparts that use that register instead.

This patch adds a pass that tries to reduce the number of constant
extenders, including extenders which differ only in an immediate offset
known at compile time, e.g. @global and @global+12.

llvm-svn: 315735

7 years agoSimplify. NFC.
Rafael Espindola [Fri, 13 Oct 2017 19:02:08 +0000 (19:02 +0000)]
Simplify. NFC.

llvm-svn: 315734

7 years agoRevert r315148 [TableGen] Avoid unnecessary std::string creations
Daniel Sanders [Fri, 13 Oct 2017 19:00:01 +0000 (19:00 +0000)]
Revert r315148 [TableGen] Avoid unnecessary std::string creations

I'm about to commit a patch that makes them necessary for getPredCode() and
it would be strange for getPredCode() and getImmCode() to require different
usage.

llvm-svn: 315733

7 years agoFix build.
Rafael Espindola [Fri, 13 Oct 2017 18:57:30 +0000 (18:57 +0000)]
Fix build.

llvm-svn: 315732

7 years ago[CodeGen] EmitPointerWithAlignment() to generate TBAA info along with LValue base...
Ivan A. Kosarev [Fri, 13 Oct 2017 18:40:18 +0000 (18:40 +0000)]
[CodeGen] EmitPointerWithAlignment() to generate TBAA info along with LValue base info

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

llvm-svn: 315731

7 years ago[Sanitizers] Add more details to ASan allocator stats report.
Alex Shlyapnikov [Fri, 13 Oct 2017 18:38:10 +0000 (18:38 +0000)]
[Sanitizers] Add more details to ASan allocator stats report.

Summary: .

Reviewers: cryptoad

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 315730

7 years ago[X86] Remove 'knm' defines from predefined-arch-macros.c test.
Craig Topper [Fri, 13 Oct 2017 18:38:10 +0000 (18:38 +0000)]
[X86] Remove 'knm' defines from predefined-arch-macros.c test.

Direction seems to be that we dont' want to keep adding these, but I forgot to remove it from the test before I committed r315723.

llvm-svn: 315729

7 years ago[InstCombine] use local var to reduce code duplication; NFCI
Sanjay Patel [Fri, 13 Oct 2017 18:32:53 +0000 (18:32 +0000)]
[InstCombine] use local var to reduce code duplication; NFCI

llvm-svn: 315728

7 years agoHandle shared symbols in --gc-sections.
Rafael Espindola [Fri, 13 Oct 2017 18:32:16 +0000 (18:32 +0000)]
Handle shared symbols in --gc-sections.

We don't want to gc a section if it is used via __start_*, but we were
doing that if the same symbol was visible in a shared library.

llvm-svn: 315727

7 years ago[LLVMCore] fix description for OverflowingBinaryOperator; NFC
Sanjay Patel [Fri, 13 Oct 2017 18:25:23 +0000 (18:25 +0000)]
[LLVMCore] fix description for OverflowingBinaryOperator; NFC

llvm-svn: 315726

7 years ago[lld] Move Threads to Common
Bob Haarman [Fri, 13 Oct 2017 18:22:55 +0000 (18:22 +0000)]
[lld] Move Threads to Common

Summary:
This will allow using the functionality from other linkers. It is also
a prerequisite for sharing the error logging code.

Reviewers: ruiu

Reviewed By: ruiu

Subscribers: emaste, mgorny, llvm-commits

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

llvm-svn: 315725

7 years agoSimplify. NFC.
Rafael Espindola [Fri, 13 Oct 2017 18:18:36 +0000 (18:18 +0000)]
Simplify. NFC.

llvm-svn: 315724

7 years ago[X86] Add skeleton support for knm cpu
Craig Topper [Fri, 13 Oct 2017 18:14:24 +0000 (18:14 +0000)]
[X86] Add skeleton support for knm cpu

This adds support Knights Mill CPU. Preprocessor defines match gcc's implementation.

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

llvm-svn: 315723

7 years ago[X86] Add initial skeleton support for knm cpu
Craig Topper [Fri, 13 Oct 2017 18:10:17 +0000 (18:10 +0000)]
[X86] Add initial skeleton support for knm cpu

This adds Intel's Knights Mill CPU to valid CPU names for the backend. For now its an alias of "knl", but ultimately we need to support AVX5124FMAPS and AVX5124VNNIW instruction sets for it.

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

llvm-svn: 315722

7 years agoHandle shared and lazy symbol in the gnu hash construction.
Rafael Espindola [Fri, 13 Oct 2017 18:07:11 +0000 (18:07 +0000)]
Handle shared and lazy symbol in the gnu hash construction.

We were not considering those symbols undefined and they could end up
in the end of the dynamic symbol table.

llvm-svn: 315721

7 years agoRelax test.
Rafael Espindola [Fri, 13 Oct 2017 18:03:11 +0000 (18:03 +0000)]
Relax test.

These value are irrelevant for the test.

llvm-svn: 315720

7 years ago[IPSCCP] Move common functions to ValueLatticeUtils (NFC)
Matthew Simpson [Fri, 13 Oct 2017 17:53:44 +0000 (17:53 +0000)]
[IPSCCP] Move common functions to ValueLatticeUtils (NFC)

This patch moves some common utility functions out of IPSCCP and makes them
available globally. The functions determine if interprocedural data-flow
analyses can propagate information through function returns, arguments, and
global variables.

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

llvm-svn: 315719

7 years ago[InstCombine] add hasOneUse check to add-zext-add fold to prevent increasing instructions
Sanjay Patel [Fri, 13 Oct 2017 17:47:25 +0000 (17:47 +0000)]
[InstCombine] add hasOneUse check to add-zext-add fold to prevent increasing instructions

llvm-svn: 315718

7 years ago[InstCombine] add tests for add (zext (add nuw X, C2)), C --> zext (add nuw X, C2...
Sanjay Patel [Fri, 13 Oct 2017 17:42:12 +0000 (17:42 +0000)]
[InstCombine] add tests for add (zext (add nuw X, C2)), C --> zext (add nuw X, C2 + C); NFC

llvm-svn: 315717

7 years ago[llvm-demangle-fuzzer] Add a fuzz target for ItaniumDemangler.
Matt Morehouse [Fri, 13 Oct 2017 17:35:37 +0000 (17:35 +0000)]
[llvm-demangle-fuzzer] Add a fuzz target for ItaniumDemangler.

Patch By: hctim

Reviewers: morehouse, bogner

Reviewed By: bogner

Subscribers: bogner, kcc, llvm-commits, mgorny

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

llvm-svn: 315716

7 years ago[CodeGen] emitOMPArraySectionBase() to generate TBAA info along with LValue base...
Ivan A. Kosarev [Fri, 13 Oct 2017 17:34:18 +0000 (17:34 +0000)]
[CodeGen] emitOMPArraySectionBase() to generate TBAA info along with LValue base info

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

llvm-svn: 315715

7 years ago[llvm-cov] Reland sources-specified.test with addition of "-path-equivalence".
Max Moroz [Fri, 13 Oct 2017 17:27:39 +0000 (17:27 +0000)]
[llvm-cov] Reland sources-specified.test with addition of "-path-equivalence".

Summary: This version of tests should be working properly.

Reviewers: vsk

Reviewed By: vsk

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

llvm-svn: 315714

7 years ago[SCEV] Maintain and use a loop->loop invalidation dependency
Sanjoy Das [Fri, 13 Oct 2017 17:13:44 +0000 (17:13 +0000)]
[SCEV] Maintain and use a loop->loop invalidation dependency

Summary:
This change uses the loop use list added in the previous change to remember the
loops that appear in the trip count expressions of other loops; and uses it in
forgetLoop.  This lets us not scan every loop in the function on a forgetLoop
call.

With this change we no longer invalidate clear out backedge taken counts on
forgetValue.  I think this is fine -- the contract is that SCEV users must call
forgetLoop(L) if their change to the IR could have changed the trip count of L;
solely calling forgetValue on a value feeding into the backedge condition of L
is not enough.  Moreover, I don't think we can strengthen forgetValue to be
sufficient for invalidating trip counts without significantly re-architecting
SCEV.  For instance, if we have the loop:

  I = *Ptr;
  E = I + 10;
  do {
    // ...
  } while (++I != E);

then the backedge taken count of the loop is 9, and it has no reference to
either I or E, i.e. there is no way in SCEV today to re-discover the dependency
of the loop's trip count on E or I.  So a SCEV client cannot change E to (say)
"I + 20", call forgetValue(E) and expect the loop's trip count to be updated.

Reviewers: atrick, sunfish, mkazantsev

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 315713

7 years agoRevert "[lit] Raise the logic for enabling clang & lld substitutions to llvm."
Bruno Cardoso Lopes [Fri, 13 Oct 2017 17:11:13 +0000 (17:11 +0000)]
Revert "[lit] Raise the logic for enabling clang & lld substitutions to llvm."

This reverts commit r315627, fixing bot failures:
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA

LIT is failing to properly apply substitution to debuginfo-tests
after this change.

rdar://problem/34979568

llvm-svn: 315712

7 years ago[X86] Test scalar integer absolutes on 32-bit targets with/without CMOV
Simon Pilgrim [Fri, 13 Oct 2017 17:09:20 +0000 (17:09 +0000)]
[X86] Test scalar integer absolutes on 32-bit targets with/without CMOV

llvm-svn: 315711

7 years agoNot all buildbots seem to dump the nuw flag in SDAG
Reid Kleckner [Fri, 13 Oct 2017 17:00:49 +0000 (17:00 +0000)]
Not all buildbots seem to dump the nuw flag in SDAG

llvm-svn: 315710

7 years ago[InstCombine] use AddOne helper to reduce code; NFC
Sanjay Patel [Fri, 13 Oct 2017 17:00:47 +0000 (17:00 +0000)]
[InstCombine] use AddOne helper to reduce code; NFC

llvm-svn: 315709

7 years ago[CodeGen] getNaturalTypeAlignment() to generate TBAA info along with LValue base...
Ivan A. Kosarev [Fri, 13 Oct 2017 16:58:30 +0000 (16:58 +0000)]
[CodeGen] getNaturalTypeAlignment() to generate TBAA info along with LValue base info

This patch should not bring in any functional changes.

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

llvm-svn: 315708

7 years ago[SEH] Use the SEH personality on frontend-outlined funclets
Reid Kleckner [Fri, 13 Oct 2017 16:55:14 +0000 (16:55 +0000)]
[SEH] Use the SEH personality on frontend-outlined funclets

This allows __try inside __finally to work.

Fixes PR34939

llvm-svn: 315707

7 years ago[X86] Updated scalar integer absolute tests to cover i8/i16/i32/i64
Simon Pilgrim [Fri, 13 Oct 2017 16:53:07 +0000 (16:53 +0000)]
[X86] Updated scalar integer absolute tests to cover i8/i16/i32/i64

llvm-svn: 315706

7 years ago[CodeGen] EmitLoadOfReference() to generate TBAA info along with LValue base info
Ivan A. Kosarev [Fri, 13 Oct 2017 16:50:50 +0000 (16:50 +0000)]
[CodeGen] EmitLoadOfReference() to generate TBAA info along with LValue base info

This patch should not bring in any functional changes.

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

llvm-svn: 315705

7 years ago[CodeGen] EmitLoadOfPointer() to generate TBAA info along with LValue base info
Ivan A. Kosarev [Fri, 13 Oct 2017 16:47:22 +0000 (16:47 +0000)]
[CodeGen] EmitLoadOfPointer() to generate TBAA info along with LValue base info

This patch should not bring in any functional changes.

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

llvm-svn: 315704

7 years ago[InstCombine] rearrange code to remove repeated constant check; NFCI
Sanjay Patel [Fri, 13 Oct 2017 16:43:58 +0000 (16:43 +0000)]
[InstCombine] rearrange code to remove repeated constant check; NFCI

llvm-svn: 315703

7 years ago[CodeGen] EmitCXXMemberDataPointerAddress() to generate TBAA info along with LValue...
Ivan A. Kosarev [Fri, 13 Oct 2017 16:38:32 +0000 (16:38 +0000)]
[CodeGen] EmitCXXMemberDataPointerAddress() to generate TBAA info along with LValue base info

This patch should not bring in any functional changes.

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

llvm-svn: 315702

7 years ago[InstCombine] allow zext(bool) + C --> select bool, C+1, C for vector types
Sanjay Patel [Fri, 13 Oct 2017 16:29:38 +0000 (16:29 +0000)]
[InstCombine] allow zext(bool) + C --> select bool, C+1, C for vector types

The backend should be prepared for this transform after:
https://reviews.llvm.org/rL311731

llvm-svn: 315701

7 years ago[TableGen] : Simplify RegisterInfoEmitter
Javed Absar [Fri, 13 Oct 2017 16:27:57 +0000 (16:27 +0000)]
[TableGen] : Simplify RegisterInfoEmitter

llvm-svn: 315700

7 years agoHide "#pragma optimize("", off)" from clang when it pretends to be MSVC 2017
Reid Kleckner [Fri, 13 Oct 2017 16:18:32 +0000 (16:18 +0000)]
Hide "#pragma optimize("", off)" from clang when it pretends to be MSVC 2017

These pragmas work around a bug in VC 1911 that isn't present in clang,
and clang warns about them.

llvm-svn: 315699

7 years agoUpdate test to expect nuw flag in SDAG dump, fixes test after r315690
Reid Kleckner [Fri, 13 Oct 2017 16:13:23 +0000 (16:13 +0000)]
Update test to expect nuw flag in SDAG dump, fixes test after r315690

llvm-svn: 315698

7 years agolit.py: Add new %{shared_output(LABEL)} substitution
Jordan Rose [Fri, 13 Oct 2017 16:12:23 +0000 (16:12 +0000)]
lit.py: Add new %{shared_output(LABEL)} substitution

This refers to a temporary path that can be shared across all tests,
identified by a particular label. This can be used for things like
caches.

At the moment, the character set for the LABEL is limited to C
identifier characters, plus '-', '+', '=', and '.'. This is the same
set of characters currently allowed in REQUIRES clause identifiers.

llvm-svn: 315697

7 years ago[X86] Fix some inconsistent formatting in the processor feature lists.
Craig Topper [Fri, 13 Oct 2017 16:06:06 +0000 (16:06 +0000)]
[X86] Fix some inconsistent formatting in the processor feature lists.

llvm-svn: 315696

7 years ago[X86] Add ProcIntelBDW to BroadwellProc class not BDWFeatures class.
Craig Topper [Fri, 13 Oct 2017 16:04:08 +0000 (16:04 +0000)]
[X86] Add ProcIntelBDW to BroadwellProc class not BDWFeatures class.

This isn't a property we want inherited.

llvm-svn: 315695

7 years ago[RS4GC] Look through vector bitcasts when looking for base pointer
Daniel Neilson [Fri, 13 Oct 2017 15:59:13 +0000 (15:59 +0000)]
[RS4GC] Look through vector bitcasts when looking for base pointer

Summary:
 In RS4GC it is possible that a base pointer is contained in a vector that
has undergone a bitcast from one element-pointertype to another. We teach
RS4GC how to look through bitcasts of vector types when looking for a base
pointer.

Reviewers: anna

Reviewed By: anna

Subscribers: llvm-commits

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

llvm-svn: 315694

7 years ago[llvm-cov] Temporary delete sources-specified.test, it is failing on some bots.
Max Moroz [Fri, 13 Oct 2017 15:58:58 +0000 (15:58 +0000)]
[llvm-cov] Temporary delete sources-specified.test, it is failing on some bots.

Summary: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/5950/steps/test-stage1-compiler/logs/stdio

Reviewers: vsk, Dor1s

Reviewed By: Dor1s

Subscribers: mehdi_amini

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

llvm-svn: 315693

7 years ago[Hexagon] Add patterns for cmpb/cmph with immediate arguments
Krzysztof Parzyszek [Fri, 13 Oct 2017 15:43:12 +0000 (15:43 +0000)]
[Hexagon] Add patterns for cmpb/cmph with immediate arguments

Patch by Sumanth Gundapaneni.

llvm-svn: 315692

7 years ago[llvm-cov] Fix sources-specified.test so it ignores the order of files printed.
Max Moroz [Fri, 13 Oct 2017 15:41:51 +0000 (15:41 +0000)]
[llvm-cov] Fix sources-specified.test so it ignores the order of files printed.

Summary: https://reviews.llvm.org/D38884#896964

Reviewers: vsk, Dor1s

Reviewed By: Dor1s

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

llvm-svn: 315691

7 years agoDAG: Add flags to dumps
Matt Arsenault [Fri, 13 Oct 2017 15:41:40 +0000 (15:41 +0000)]
DAG: Add flags to dumps

llvm-svn: 315690

7 years agoFix an unused-variable warning.
Haojian Wu [Fri, 13 Oct 2017 15:37:53 +0000 (15:37 +0000)]
Fix an unused-variable warning.

llvm-svn: 315689

7 years agoRemove an unused variable.
Haojian Wu [Fri, 13 Oct 2017 15:34:03 +0000 (15:34 +0000)]
Remove an unused variable.

Fix -Wunused-but-set-variable warning.

llvm-svn: 315688

7 years ago[llvm-cov] An attempt to fix sources_specified.test failing on some buildbots.
Max Moroz [Fri, 13 Oct 2017 15:30:24 +0000 (15:30 +0000)]
[llvm-cov] An attempt to fix sources_specified.test failing on some buildbots.

Summary: https://reviews.llvm.org/rL315685#115380

Reviewers: vsk, Dor1s

Reviewed By: Dor1s

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

llvm-svn: 315687

7 years ago[X86] Stop creating CMOV nodes with a second MVT::Glue result
Craig Topper [Fri, 13 Oct 2017 15:28:35 +0000 (15:28 +0000)]
[X86] Stop creating CMOV nodes with a second MVT::Glue result

Summary: We seem to inconsistently create CMOV nodes some with a Glue result and some without. But I can't find any cases that use the Glue result. So I've tried to remove all the place that did this.

Reviewers: RKSimon, spatel, zvi

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 315686

7 years ago[llvm-cov] Generate "report" for given source paths if sources are specified.
Max Moroz [Fri, 13 Oct 2017 14:44:51 +0000 (14:44 +0000)]
[llvm-cov] Generate "report" for given source paths if sources are specified.

Summary:
Documentation says that user can specify sources for both "show" and
"report" commands. "Show" command respects specified sources, but "report" does
not. It is useful to have both "show" and "report" generated for specified
sources. Also added tests to for both commands with sources specified.

Reviewers: vsk, kcc

Reviewed By: vsk

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

llvm-svn: 315685

7 years agoRe-land "[dsymutil] Timestmap verification for __swift_ast"
Jonas Devlieghere [Fri, 13 Oct 2017 14:41:23 +0000 (14:41 +0000)]
Re-land "[dsymutil] Timestmap verification for __swift_ast"

This patch adds timestamp verification for swiftmodule files. A new flag
is provided to allows us to disable this check in order to allow testing
of this feature.

Differential revision: https://reviews.llvm.org/D38686

llvm-svn: 315684

7 years ago[SCEV] Teach SCEV to find maxBECount when loop endbound is variant
Anna Thomas [Fri, 13 Oct 2017 14:30:43 +0000 (14:30 +0000)]
[SCEV] Teach SCEV to find maxBECount when loop endbound is variant

Summary:
This patch teaches SCEV to calculate the maxBECount when the end bound
of the loop can vary. Note that we cannot calculate the exactBECount.

This will only be done when both conditions are satisfied:
1. the loop termination condition is strictly LT.
2. the IV is proven to not overflow.

This provides more information to users of SCEV and can be used to
improve identification of finite loops.

Reviewers: sanjoy, mkazantsev, silviu.baranga, atrick

Reviewed by: mkazantsev

Subscribers: llvm-commits

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

llvm-svn: 315683

7 years ago[clang-tidy] Add a regression test for google-readability-namespace-comments
Alexander Kornienko [Fri, 13 Oct 2017 14:11:14 +0000 (14:11 +0000)]
[clang-tidy] Add a regression test for google-readability-namespace-comments

Add a regression test for the google-readability-namespace-comments bug
introduced in r315057 (reverted in r315580).

llvm-svn: 315682

7 years ago[InstCombine] add tests for boolean extend + add; NFC
Sanjay Patel [Fri, 13 Oct 2017 14:09:45 +0000 (14:09 +0000)]
[InstCombine] add tests for boolean extend + add; NFC

llvm-svn: 315681

7 years agoRevert r314923: "Recommit : Use the basic cost if a GEP is not used as addressing...
Daniel Jasper [Fri, 13 Oct 2017 14:04:21 +0000 (14:04 +0000)]
Revert r314923: "Recommit : Use the basic cost if a GEP is not used as addressing mode"

Significantly reduces performancei (~30%) of gipfeli
(https://github.com/google/gipfeli)

I have not yet managed to reproduce this regression with the open-source
version of the benchmark on github, but will work with others to get a
reproducer to you later today.

llvm-svn: 315680

7 years ago[FileCheck] regexp doc update/fix
Sjoerd Meijer [Fri, 13 Oct 2017 14:02:36 +0000 (14:02 +0000)]
[FileCheck] regexp doc update/fix

Minor doc update that the FileCheck matcher supports POSIX ERE.
It also fixes a minor issue in the regexp describing a variable
name: underscores are allowed too.

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

llvm-svn: 315679

7 years agoFix regression of test/CodeGenOpenCL/address-spaces.cl on ppc
Yaxun Liu [Fri, 13 Oct 2017 13:53:06 +0000 (13:53 +0000)]
Fix regression of test/CodeGenOpenCL/address-spaces.cl on ppc

llvm-svn: 315678

7 years agoDisable gcov instrumentation of functions using funclet-based exception handling
Marco Castelluccio [Fri, 13 Oct 2017 13:49:15 +0000 (13:49 +0000)]
Disable gcov instrumentation of functions using funclet-based exception handling

Summary: This patch fixes the crash from https://bugs.llvm.org/show_bug.cgi?id=34659 and https://bugs.llvm.org/show_bug.cgi?id=34833.

Reviewers: rnk, majnemer

Reviewed By: rnk, majnemer

Subscribers: majnemer, llvm-commits

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

llvm-svn: 315677

7 years agodocs: Improve wording on building for fuzzing
Justin Bogner [Fri, 13 Oct 2017 06:29:09 +0000 (06:29 +0000)]
docs: Improve wording on building for fuzzing

The original sentence didn't really make sense.

Patch by Vedant Kumar. Thanks!

llvm-svn: 315676

7 years ago[LLD] Fix typo. NFC
Shoaib Meenai [Fri, 13 Oct 2017 06:11:20 +0000 (06:11 +0000)]
[LLD] Fix typo. NFC

llvm-svn: 315675

7 years ago[X86] Remove patterns that select unmasked vbroadcastf2x32/vbroadcasti2x32. Prefer...
Craig Topper [Fri, 13 Oct 2017 06:07:10 +0000 (06:07 +0000)]
[X86] Remove patterns that select unmasked vbroadcastf2x32/vbroadcasti2x32. Prefer vbroadcastsd/vpbroadcastq instead.

There's no advantage to using these instructions when they aren't masked. This enables some additional execution domain switching without needing to update the table.

llvm-svn: 315674

7 years agoMake it explicit that we are writing addends to target sections if REL.
Rui Ueyama [Fri, 13 Oct 2017 05:58:54 +0000 (05:58 +0000)]
Make it explicit that we are writing addends to target sections if REL.

Relocations.cpp is still head-scratching. Even though relocations are
processed by multiple functions, the functions are effectively one
gigantic function with lots of local and global shared states, because
they are really tightly coupled. It is really hard to predict whether
a change to a function will or will not affect other functions behaviors.

What I'm trying to do is to rewrite the code without breaking the
existing tests so that the code can tolerate a more aggressive
refactoring (i.e. splitting it to logically separated steps).

llvm-svn: 315673

7 years ago[SCEV] Maintain loop use lists, and use them in forgetLoop
Sanjoy Das [Fri, 13 Oct 2017 05:50:52 +0000 (05:50 +0000)]
[SCEV] Maintain loop use lists, and use them in forgetLoop

Summary:
Currently we do not correctly invalidate memoized results for add recurrences
that were created directly (i.e. they were not created from a `Value`).  This
change fixes this by keeping loop use lists and using the loop use lists to
determine which SCEV expressions to invalidate.

Here are some statistics on the number of uses of in the use lists of all loops
on a clang bootstrap (config: release, no asserts):

     Count: 731310
       Min: 1
      Mean: 8.555150
50th %time: 4
95th %tile: 25
99th %tile: 53
       Max: 433

Reviewers: atrick, sunfish, mkazantsev

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 315672

7 years ago[SelectionDAG] Cleanup the SIGN_EXTEND_INREG handling in computeKnownBits. NFCI
Craig Topper [Fri, 13 Oct 2017 05:35:35 +0000 (05:35 +0000)]
[SelectionDAG] Cleanup the SIGN_EXTEND_INREG handling in computeKnownBits. NFCI

Use less temporary APInts. Use bit counting more. Don't call getScalarSizeInBits so many places, just capture it once.

llvm-svn: 315671

7 years ago[SelectionDAG] Fix typo in comment. NFC
Craig Topper [Fri, 13 Oct 2017 05:35:34 +0000 (05:35 +0000)]
[SelectionDAG] Fix typo in comment. NFC

llvm-svn: 315670

7 years agoDestructure a boolean expression and add comment.
Rui Ueyama [Fri, 13 Oct 2017 04:04:10 +0000 (04:04 +0000)]
Destructure a boolean expression and add comment.

"IsWrite" variable didn't make sense and was misleading because
it became true even if a section is not writable.

llvm-svn: 315669

7 years ago[OpenCL] Add LangAS::opencl_private to represent private address space in AST
Yaxun Liu [Fri, 13 Oct 2017 03:37:48 +0000 (03:37 +0000)]
[OpenCL] Add LangAS::opencl_private to represent private address space in AST

Currently Clang uses default address space (0) to represent private address space for OpenCL
in AST. There are two issues with this:

Multiple address spaces including private address space cannot be diagnosed.
There is no mangling for default address space. For example, if private int* is emitted as
i32 addrspace(5)* in IR. It is supposed to be mangled as PUAS5i but it is mangled as
Pi instead.

This patch attempts to represent OpenCL private address space explicitly in AST. It adds
a new enum LangAS::opencl_private and adds it to the variable types which are implicitly
private:

automatic variables without address space qualifier

function parameter

pointee type without address space qualifier (OpenCL 1.2 and below)

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

llvm-svn: 315668

7 years agoHide SymbolBody::IsLocal.
Rui Ueyama [Fri, 13 Oct 2017 03:37:26 +0000 (03:37 +0000)]
Hide SymbolBody::IsLocal.

IsLocal member is initialized by the constructor and will never change.
So we don't want to make it directly accessible.

llvm-svn: 315667

7 years agoMake a condition more explicit. NFC.
Rui Ueyama [Fri, 13 Oct 2017 03:37:11 +0000 (03:37 +0000)]
Make a condition more explicit. NFC.

llvm-svn: 315666

7 years ago[clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA
Alexander Shaposhnikov [Fri, 13 Oct 2017 03:21:39 +0000 (03:21 +0000)]
[clang] Enable clang build with LLVM_BUILD_INSTRUMENTED without setting LLVM_PROFTDATA

At the moment if LLVM_BUILD_INSTRUMENTED is set to True
one has to set LLVM_PROFTDATA even if it's not really used
(because of message(FATAL_ERROR ...)).
Building the instrumented version of Clang can be useful even if
one doesn't plan to build the target generate-profdata
(currently that target would only compile utils/perf-training/cxx/hello_world.cpp).
For example, one can run the instrumented version of Clang
via a separate build system against a different codebase,
collect/analyze the profiles and merge them by llvm-profdata later.

Differential revision: https://reviews.llvm.org/D38859

llvm-svn: 315665

7 years agoAdd comment.
Rui Ueyama [Fri, 13 Oct 2017 02:57:59 +0000 (02:57 +0000)]
Add comment.

llvm-svn: 315664

7 years agoSupport for destroying operator delete, per C++2a proposal P0722.
Richard Smith [Fri, 13 Oct 2017 01:55:36 +0000 (01:55 +0000)]
Support for destroying operator delete, per C++2a proposal P0722.

This feature is not (yet) approved by the C++ committee, so this is liable to
be reverted or significantly modified based on committee feedback.

No functionality change intended for existing code (a new type must be defined
in namespace std to take advantage of this feature).

llvm-svn: 315662

7 years agoRecommit r315087 "[refactor] add support for refactoring options"
Alex Lorenz [Fri, 13 Oct 2017 01:53:13 +0000 (01:53 +0000)]
Recommit r315087 "[refactor] add support for refactoring options"

The recommit fixes a UB bug that occurred only on a small number of bots.

Original message:

This commit adds initial support for refactoring options. One can now use
optional and required std::string options.

This commit also adds a NewNameOption for the local-rename refactoring action to
allow rename to work with custom names.

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

llvm-svn: 315661

7 years agoSimplify. NFCI.
Rui Ueyama [Fri, 13 Oct 2017 01:42:27 +0000 (01:42 +0000)]
Simplify. NFCI.

llvm-svn: 315659

7 years agoSlightly simplify code and add comment.
Rui Ueyama [Fri, 13 Oct 2017 01:19:10 +0000 (01:19 +0000)]
Slightly simplify code and add comment.

This is not a mechanical transformation. Even though I believe this
patch is correct, I'm not 100% sure if lld with this patch behaves
exactly the same way as before on all edge cases. At least all tests
still pass.

I'm submitting this patch because it took almost a day to understand
this function, and I don't want to lose it.

llvm-svn: 315658

7 years ago[libFuzzer] tweam use_feature_frequency to be less aggressive; run a dummy input...
Kostya Serebryany [Fri, 13 Oct 2017 01:12:23 +0000 (01:12 +0000)]
[libFuzzer] tweam use_feature_frequency to be less aggressive; run a dummy input before the seed corpus

llvm-svn: 315657

7 years ago[MS] Don't bail on replacing dllimport vbase dtors with base dtors
Reid Kleckner [Fri, 13 Oct 2017 00:53:02 +0000 (00:53 +0000)]
[MS] Don't bail on replacing dllimport vbase dtors with base dtors

Fix PR32990 by effectively reverting r283063 and solving it a different
way.

We want to limit the hack to not replace equivalent available_externally
dtors specifically to libc++, which uses always_inline. It seems certain
versions of libc++ do not provide all the symbols that an explicit
template instantiation is expected to provide.

If we get to the code that forms a real alias, only *then* check if this
is available_externally, and do that by asking a better question, which
is "is this a declaration for the linker?", because *that's* what means
we can't form an alias to it.

As a follow-on simplification, remove the InEveryTU parameter. Its last
use guarded this code for forming aliases, but we should never form
aliases to declarations, regardless of what we know about every TU.

llvm-svn: 315656

7 years ago[Analyzer] Assume that CFBooleanRef const globals are non-null
George Karpenkov [Fri, 13 Oct 2017 00:51:41 +0000 (00:51 +0000)]
[Analyzer] Assume that CFBooleanRef const globals are non-null

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

llvm-svn: 315655

7 years agoUse existing helper. NFC.
Rafael Espindola [Fri, 13 Oct 2017 00:44:33 +0000 (00:44 +0000)]
Use existing helper. NFC.

llvm-svn: 315654

7 years agoSimplify a boolean expression by the De Morgan's laws.
Rui Ueyama [Fri, 13 Oct 2017 00:35:44 +0000 (00:35 +0000)]
Simplify a boolean expression by the De Morgan's laws.

I don't really understand what exactly this expression means,
but at least I can mechanically transform it.

llvm-svn: 315653

7 years agoTypos in tutorial
Jan Korous [Fri, 13 Oct 2017 00:31:07 +0000 (00:31 +0000)]
Typos in tutorial

llvm-svn: 315652

7 years agodocs: Improve the docs about llvm-isel-fuzzer on OSS Fuzz
Justin Bogner [Fri, 13 Oct 2017 00:27:35 +0000 (00:27 +0000)]
docs: Improve the docs about llvm-isel-fuzzer on OSS Fuzz

llvm-svn: 315651

7 years agoConvert a few cases of isUndefined to isInCurrentDSO.
Rafael Espindola [Fri, 13 Oct 2017 00:23:35 +0000 (00:23 +0000)]
Convert a few cases of isUndefined to isInCurrentDSO.

I don't think there is an observable difference. We now just avoid
doing silly things like setting versions in lazy symbols.

llvm-svn: 315650

7 years ago[X86] Add the test case for r315613 that I forgot to 'git add'.
Craig Topper [Fri, 13 Oct 2017 00:20:47 +0000 (00:20 +0000)]
[X86] Add the test case for r315613 that I forgot to 'git add'.

llvm-svn: 315649

7 years ago[SelectionDAG] Correct the early out in SelectionDAG::getZeroExtendInReg to work...
Craig Topper [Fri, 13 Oct 2017 00:18:58 +0000 (00:18 +0000)]
[SelectionDAG] Correct the early out in SelectionDAG::getZeroExtendInReg to work properly for vector types.

I don't know if we ever hit this case or not. Turning it into an assert only fired on expanding some atomic operation in a SystemZ lit test.

llvm-svn: 315648

7 years ago[llvm-isel-fuzzer] Use "--" as separator rather than '='.
Matt Morehouse [Fri, 13 Oct 2017 00:18:32 +0000 (00:18 +0000)]
[llvm-isel-fuzzer] Use "--" as separator rather than '='.

Summary: OSS-Fuzz doesn't support '=' in filenames.

Reviewers: bogner, kcc

Reviewed By: kcc

Subscribers: javed.absar, hiraditya, llvm-commits

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

llvm-svn: 315647

7 years agollvm-isel-fuzzer: Use the right REQUIRES line for r315599
Justin Bogner [Fri, 13 Oct 2017 00:17:54 +0000 (00:17 +0000)]
llvm-isel-fuzzer: Use the right REQUIRES line for r315599

I'd mixed up ENABLE_SHARED and BUILD_SHARED_LIBS before, so these
tests were being disabled in too many places.

llvm-svn: 315646

7 years agoCorrectly handle shared and lazy symbols.
Rafael Espindola [Fri, 13 Oct 2017 00:06:38 +0000 (00:06 +0000)]
Correctly handle shared and lazy symbols.

I will try to make this API a bit less error prone, but for now just
get another test passing.

llvm-svn: 315645

7 years agoRemoving default case statement from covered switch.
Keith Wyss [Fri, 13 Oct 2017 00:06:35 +0000 (00:06 +0000)]
Removing default case statement from covered switch.

Previous patch did not count on the llvm command line parser to restrict the
inputs, but it is safe to do so.

Fix forward for patch with details:
-- https://reviews.llvm.org/D38650 and
-- https://llvm.org/svn/llvm-project/llvm/trunk@315635 91177308-0d34-0410-b5e6-96231b3b80d8

llvm-svn: 315644

7 years agoHandle/assert on DK_Remark
Adam Nemet [Thu, 12 Oct 2017 23:56:54 +0000 (23:56 +0000)]
Handle/assert on DK_Remark

We don't generate remarks during inline assembly parsing so no need to handle
these for now.

llvm-svn: 315643

7 years agoAdd DK_Remark to SMDiagnostic
Adam Nemet [Thu, 12 Oct 2017 23:56:02 +0000 (23:56 +0000)]
Add DK_Remark to SMDiagnostic

Swift uses SMDiagnostic for diagnostic messages. For
https://github.com/apple/swift/pull/12294, we need remark support.

I picked the color that clang uses to display them.

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

llvm-svn: 315642

7 years ago[SelectionDAG] Const-correct the DemandedMask argument to one of the overloads of...
Craig Topper [Thu, 12 Oct 2017 23:46:05 +0000 (23:46 +0000)]
[SelectionDAG] Const-correct the DemandedMask argument to one of the overloads of SimplifyDemandedBits. NFC

llvm-svn: 315641

7 years ago[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other...
Eugene Zelenko [Thu, 12 Oct 2017 23:30:03 +0000 (23:30 +0000)]
[Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 315640

7 years ago[Sema][ObjC] Complete merging ObjC methods before checking their
Akira Hatanaka [Thu, 12 Oct 2017 23:24:38 +0000 (23:24 +0000)]
[Sema][ObjC] Complete merging ObjC methods before checking their
overriding methods.

This should fix test case Analysis/retain-release.m that was failing on
the reverse iteration bot:

http://lab.llvm.org:8011/builders/reverse-iteration

The test used to fail because the loop in CheckObjCMethodOverrides would
merge attribute ns_returns_retained on methods while checking whether
the overriding methods were compatible. Since OverrideSearch::Overridden
is a SmallPtrSet and the order in which the elements of the set are
visited is non-deterministic, the test would fail when method 'clone' of
the protocol 'F18P' was visited before F18(Cat)'s method 'clone' was
visited.

llvm-svn: 315639

7 years ago[Sema][Crash] Correctly handle an non-dependent noexcept expr in function template
Erich Keane [Thu, 12 Oct 2017 23:01:53 +0000 (23:01 +0000)]
[Sema][Crash] Correctly handle an non-dependent noexcept expr in function template

It seems that all of the other templated cases are handled correctly,
however the function template case was not correctly handled. This
patch recovers from this condition by setting the function to noexcept
after diagnosing. Previously it simply set NoexceptExpr to null,
which caused an Assert when this was evaluated during substitution.

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

llvm-svn: 315638

7 years agoRevert "TargetMachine: Merge TargetMachine and LLVMTargetMachine"
Matthias Braun [Thu, 12 Oct 2017 22:57:28 +0000 (22:57 +0000)]
Revert "TargetMachine: Merge TargetMachine and LLVMTargetMachine"

Reverting to investigate layering effects of MCJIT not linking
libCodeGen but using TargetMachine::getNameWithPrefix() breaking the
lldb bots.

This reverts commit r315633.

llvm-svn: 315637