platform/upstream/llvm.git
7 years agoFix comment and remove incorrect linker flags in test configuration
Eric Fiselier [Thu, 20 Apr 2017 20:22:19 +0000 (20:22 +0000)]
Fix comment and remove incorrect linker flags in test configuration

llvm-svn: 300881

7 years agoRemove stray ^S. NFC.
Benjamin Kramer [Thu, 20 Apr 2017 20:03:36 +0000 (20:03 +0000)]
Remove stray ^S. NFC.

llvm-svn: 300880

7 years ago[DWARF] Fix a couple of typos
Paul Robinson [Thu, 20 Apr 2017 20:03:03 +0000 (20:03 +0000)]
[DWARF] Fix a couple of typos

llvm-svn: 300879

7 years agoARM: handle post-indexed NEON ops where the offset isn't the access width.
Tim Northover [Thu, 20 Apr 2017 19:54:02 +0000 (19:54 +0000)]
ARM: handle post-indexed NEON ops where the offset isn't the access width.

Before, we assumed that any ConstantInt offset was precisely the access width,
so we could use the "[rN]!" form. ISelLowering only ever created that kind, but
further simplification during combining could lead to unexpected constants and
incorrect codegen.

Should fix PR32658.

llvm-svn: 300878

7 years agoVarStreamArrayIterator needed non-const operator* overload.
Adrian McCarthy [Thu, 20 Apr 2017 19:34:06 +0000 (19:34 +0000)]
VarStreamArrayIterator needed non-const operator* overload.

Without this change, the operator-> provided by iterator_facade lost type
qualifiers.

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

llvm-svn: 300877

7 years ago[InstCombine] Remove redundant code from SimplifyDemandedBits handling for Or. The...
Craig Topper [Thu, 20 Apr 2017 19:31:22 +0000 (19:31 +0000)]
[InstCombine] Remove redundant code from SimplifyDemandedBits handling for Or. The code above it is equivalent if you work through the bitwise math.

llvm-svn: 300876

7 years ago[DWARF] Versioning for DWARF constants; verify FORMs
Paul Robinson [Thu, 20 Apr 2017 19:16:51 +0000 (19:16 +0000)]
[DWARF] Versioning for DWARF constants; verify FORMs

Associate the version-when-defined with definitions of standard DWARF
constants.  Identify the "vendor" for DWARF extensions.
Use this information to verify FORMs in .debug_abbrev are defined as
of the DWARF version specified in the associated unit.
Removed two tests that had specified DWARF v1 (which essentially does
not exist).

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

llvm-svn: 300875

7 years ago[DeLICM] Use Known information when comparing Existing.Written and Proposed.Written.
Michael Kruse [Thu, 20 Apr 2017 19:16:39 +0000 (19:16 +0000)]
[DeLICM] Use Known information when comparing Existing.Written and Proposed.Written.

This change only affects unit tests, but no functional changes are
expected on LLVM-IR, as no Known information is yet extracted and
consequently this functionality is only triggered through unit tests.

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

llvm-svn: 300874

7 years ago[Driver] Add a missing -no-canonical-prefixes to test.
Benjamin Kramer [Thu, 20 Apr 2017 19:06:24 +0000 (19:06 +0000)]
[Driver] Add a missing -no-canonical-prefixes to test.

llvm-svn: 300873

7 years ago[go bindings] Rmove duplicated conversion function definitions after r300843.
Benjamin Kramer [Thu, 20 Apr 2017 19:06:11 +0000 (19:06 +0000)]
[go bindings] Rmove duplicated conversion function definitions after r300843.

llvm-svn: 300872

7 years ago[AArch64] Improve scheduling of logical operations on Falkor.
Chad Rosier [Thu, 20 Apr 2017 18:50:21 +0000 (18:50 +0000)]
[AArch64] Improve scheduling of logical operations on Falkor.

llvm-svn: 300871

7 years ago[Thumb-1] Fix corner cases for compressed jump tables
Weiming Zhao [Thu, 20 Apr 2017 18:37:14 +0000 (18:37 +0000)]
[Thumb-1] Fix corner cases for compressed jump tables

Summary:
When synthesized TBB/TBH is expanded, we need to avoid the case of:
   BaseReg is redefined after the load of branching target. E.g.:

    %R2 = tLEApcrelJT <jt#1>
    %R1 =  tLDRr %R1, %R2    ==> %R2 = tLEApcrelJT <jt#1>
    %R2 = tLDRspi %SP, 12        %R2 = tLDRspi %SP, 12
    tBR_JTr %R1                  tTBB_JT %R2, %R1
`
Reviewers: jmolloy

Reviewed By: jmolloy

Subscribers: llvm-commits, rengolin

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

llvm-svn: 300870

7 years ago[CodeExtractor] Remove a bunch of unneeded constructors.
Davide Italiano [Thu, 20 Apr 2017 18:33:40 +0000 (18:33 +0000)]
[CodeExtractor] Remove a bunch of unneeded constructors.

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

llvm-svn: 300869

7 years ago[Recycler] Add asan/msan annotations.
Benjamin Kramer [Thu, 20 Apr 2017 18:29:37 +0000 (18:29 +0000)]
[Recycler] Add asan/msan annotations.

This enables use after free and uninit memory checking for memory
returned by a recycler. SelectionDAG currently relies on the opcode of a
free'd node being ISD::DELETED_NODE, so poke a hole in the asan poison
for SDNode opcodes. This means that we won't find some issues, but only
in SDag.

llvm-svn: 300868

7 years agoFix use-after-frees on memory allocated in a Recycler.
Benjamin Kramer [Thu, 20 Apr 2017 18:29:14 +0000 (18:29 +0000)]
Fix use-after-frees on memory allocated in a Recycler.

This will become asan errors once the patch lands that poisons the
memory after free. The x86 change is a hack, but I don't see how to
solve this properly at the moment.

llvm-svn: 300867

7 years agoFixing outdated comment [NFC]
Artyom Skrobov [Thu, 20 Apr 2017 18:20:02 +0000 (18:20 +0000)]
Fixing outdated comment [NFC]

Since r32105 back in 2006, RegisterPass doesn't support
passes without a default constructor.

llvm-svn: 300866

7 years agoFix formatting of constrained FP intrinsic documentation
Andrew Kaylor [Thu, 20 Apr 2017 18:18:36 +0000 (18:18 +0000)]
Fix formatting of constrained FP intrinsic documentation

llvm-svn: 300865

7 years agoCodeGen: Let frame index value type match alloca addr space
Yaxun Liu [Thu, 20 Apr 2017 18:15:34 +0000 (18:15 +0000)]
CodeGen: Let frame index value type match alloca addr space

Recently alloca address space has been added to data layout. Due to this
change, pointer returned by alloca may have different size as pointer in
address space 0.

However, currently the value type of frame index is assumed to be of the
same size as pointer in address space 0.

This patch fixes that.

Most targets assume alloca returning pointer in address space 0, which
is the default alloca address space. Therefore it is NFC for them.

AMDGCN target with amdgiz environment requires this change since it
assumes alloca returning pointer to addr space 5 and its size is 32,
which is different from the size of pointer in addr space 0 which is 64.

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

llvm-svn: 300864

7 years agoRemove duplicate AttributeList::removeAttributes implementation
Reid Kleckner [Thu, 20 Apr 2017 18:08:36 +0000 (18:08 +0000)]
Remove duplicate AttributeList::removeAttributes implementation

Have the AttributeList overload delegate to the AttrBuilder one.
Simplify the AttrBuilder overload by avoiding getSlotAttributes, which
creates temporary AttributeLists.

Simplify `AttrBuilder::removeAttributes(AttributeList, unsigned)` by
using getAttributes instead of manually iterating over slots.

Extracted from https://reviews.llvm.org/D32262

NFC

llvm-svn: 300863

7 years agoChanged a use of APInt::getSignBit to APInt::getSignMask.
Sean Callanan [Thu, 20 Apr 2017 18:07:51 +0000 (18:07 +0000)]
Changed a use of APInt::getSignBit to APInt::getSignMask.

llvm-svn: 300862

7 years ago[scudo] Remove GetActuallyAllocatedSize calls from the fast path
Kostya Kortchinsky [Thu, 20 Apr 2017 18:07:17 +0000 (18:07 +0000)]
[scudo] Remove GetActuallyAllocatedSize calls from the fast path

Summary:
GetActuallyAllocatedSize is actually expensive. In order to avoid calling this
function in the malloc/free fast path, we change the Scudo chunk header to
store the size of the chunk, if from the Primary, or the amount of unused
bytes if from the Secondary. This way, we only have to call the culprit
function for Secondary backed allocations (and still in realloc).

The performance gain on a singly threaded pure malloc/free benchmark exercising
the Primary allocator is above 5%.

Reviewers: alekseyshl, kcc, dvyukov

Reviewed By: dvyukov

Subscribers: llvm-commits

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

llvm-svn: 300861

7 years ago[DAGCombiner] use more local variables in isAlias(); NFCI
Sanjay Patel [Thu, 20 Apr 2017 18:02:27 +0000 (18:02 +0000)]
[DAGCombiner] use more local variables in isAlias(); NFCI

llvm-svn: 300860

7 years ago[WebAssembly] Add known failures for wasm object file backend
Sam Clegg [Thu, 20 Apr 2017 17:18:15 +0000 (17:18 +0000)]
[WebAssembly] Add known failures for wasm object file backend

Subscribers: jfb, dschuff

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

llvm-svn: 300859

7 years agoDon't pass FPOpFusion::Strict to the backend
Adam Nemet [Thu, 20 Apr 2017 17:09:35 +0000 (17:09 +0000)]
Don't pass FPOpFusion::Strict to the backend

This restores the behavior prior to D31167 where the code-gen default was
FPC_On which mapped to FPOpFusion::Standard.  After merging the FE
state (on/off) and the code-gen state (on/fast/off), the default became off to
match the front-end.

In other words, the front-end controls when to fuse along the language
standards and the backend shouldn't override this by splitting fused
intrinsics as FPOpFusion::Strict would imply.

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

llvm-svn: 300858

7 years agoResubmit "[BitVector] Add operator<<= and operator>>=."
Zachary Turner [Thu, 20 Apr 2017 16:56:54 +0000 (16:56 +0000)]
Resubmit "[BitVector] Add operator<<= and operator>>=."

This was failing due to the use of assigning a Mask to an
unsigned, rather than to a BitWord.  But most systems do not
have sizeof(unsigned) == sizeof(unsigned long), so the mask
was getting truncated.

llvm-svn: 300857

7 years ago[APInt] Rename getSignBit to getSignMask
Craig Topper [Thu, 20 Apr 2017 16:56:25 +0000 (16:56 +0000)]
[APInt] Rename getSignBit to getSignMask

getSignBit is a static function that creates an APInt with only the sign bit set. getSignMask seems like a better name to convey its functionality. In fact several places use it and then store in an APInt named SignMask.

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

llvm-svn: 300856

7 years ago[SVE] Fix mismatched sign comparison warning in unit test from r300842.
Amara Emerson [Thu, 20 Apr 2017 16:54:49 +0000 (16:54 +0000)]
[SVE] Fix mismatched sign comparison warning in unit test from r300842.

llvm-svn: 300855

7 years ago[DAGCombiner] fix variable names in isAlias(); NFCI
Sanjay Patel [Thu, 20 Apr 2017 16:36:37 +0000 (16:36 +0000)]
[DAGCombiner] fix variable names in isAlias(); NFCI

We started with zero-based params and switched to one-based locals...
Also, variables start with a capital and functions do not.

llvm-svn: 300854

7 years agoResurrect LLDB Standalone build on NetBSD
Kamil Rytarowski [Thu, 20 Apr 2017 16:35:36 +0000 (16:35 +0000)]
Resurrect LLDB Standalone build on NetBSD

Include CheckIncludeFile for check_include_file() in CMake.

Detect <sys/event.h> in CMake.
This header is available on NetBSD.

llvm-svn: 300853

7 years agoRevert "[BitVector] Add operator<<= and operator>>=."
Zachary Turner [Thu, 20 Apr 2017 16:35:22 +0000 (16:35 +0000)]
Revert "[BitVector] Add operator<<= and operator>>=."

This is causing test failures on Linux / BSD systems.  Reverting
while I investigate.

llvm-svn: 300852

7 years ago[APInt] Add isSubsetOf method that can check if one APInt is a subset of another...
Craig Topper [Thu, 20 Apr 2017 16:17:13 +0000 (16:17 +0000)]
[APInt] Add isSubsetOf method that can check if one APInt is a subset of another without creating temporary APInts

This question comes up in many places in SimplifyDemandedBits. This makes it easy to ask without allocating additional temporary APInts.

The BitVector class provides a similar functionality through its (IMHO badly named) test(const BitVector&) method. Though its output polarity is reversed.

I've provided one example use case in this patch. I plan to do more as a follow up.

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

llvm-svn: 300851

7 years ago[DAGCombiner] give names to repeated calcs in isAlias(); NFCI
Sanjay Patel [Thu, 20 Apr 2017 16:15:08 +0000 (16:15 +0000)]
[DAGCombiner] give names to repeated calcs in isAlias(); NFCI

llvm-svn: 300850

7 years agoIn SimplifyDemandedUseBits, use computeKnownBits directly to handle Constants
Craig Topper [Thu, 20 Apr 2017 16:14:58 +0000 (16:14 +0000)]
In SimplifyDemandedUseBits, use computeKnownBits directly to handle Constants

Currently we don't explicitly process ConstantDataSequential, ConstantAggregateZero, or ConstantVector, or Undef before applying the Depth limit. Instead they occur after the depth check in the non-instruction path.

For the constant types that we do handle, the code is replicated from computeKnownBits.

This patch fixes the missing constant handling and the reduces the amount of code by just using computeKnownBits directly for any type of Constant.

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

llvm-svn: 300849

7 years ago[BitVector] Add operator<<= and operator>>=.
Zachary Turner [Thu, 20 Apr 2017 15:57:58 +0000 (15:57 +0000)]
[BitVector] Add operator<<= and operator>>=.

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

llvm-svn: 300848

7 years ago[globalisel] Enable tracing the legalizer with --debug-only=legalize-mir
Daniel Sanders [Thu, 20 Apr 2017 15:46:12 +0000 (15:46 +0000)]
[globalisel] Enable tracing the legalizer with --debug-only=legalize-mir

Reviewers: t.p.northover, ab, qcolombet, aditya_nandakumar, rovka, kristof.beyls

Reviewed By: kristof.beyls

Subscribers: dberris, igorb, llvm-commits

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

llvm-svn: 300847

7 years ago[scudo] Minor changes and refactoring
Kostya Kortchinsky [Thu, 20 Apr 2017 15:11:00 +0000 (15:11 +0000)]
[scudo] Minor changes and refactoring

Summary:
This is part of D31947 that is being split into several smaller changes.

This one deals with all the minor changes, more specifically:
- Rename some variables and functions to make their purpose clearer;
- Reorder some code;
- Mark the hot termination incurring checks as `UNLIKELY`; if they happen, the
  program will die anyway;
- Add a `getScudoChunk` method;
- Add an `eraseHeader` method to ScudoChunk that will clear a header with 0s;
- Add a parameter to `allocate` to know if the allocated chunk should be filled
  with zeros. This allows `calloc` to not have to call
  `GetActuallyAllocatedSize`; more changes to get rid of this function on the
  hot paths will follow;
- reallocate was missing a check to verify that the pointer is properly
  aligned on `MinAlignment`;
- The `Stats` in the secondary have to be protected by a mutex as the `Add`
  and `Sub` methods are actually not atomic;
- The software CRC32 function was moved to the header to allow for inlining.

Reviewers: dvyukov, alekseyshl, kcc

Reviewed By: dvyukov

Subscribers: llvm-commits

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

llvm-svn: 300846

7 years ago[Utility] Placate another GCC warning.
Davide Italiano [Thu, 20 Apr 2017 14:45:33 +0000 (14:45 +0000)]
[Utility] Placate another GCC warning.

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

llvm-svn: 300845

7 years agoIntroduce LLVMDIBuilderRef
Amaury Sechet [Thu, 20 Apr 2017 14:22:47 +0000 (14:22 +0000)]
Introduce LLVMDIBuilderRef

Summary:
This patch adds a definition of `LLVMDIBuilderRef` that represents an `llvm::DIBuilder`.

Authored by Harlan Haskins

Reviewers: deadalnix, aprantl, probinson, dblaikie, echristo, whitequark

Reviewed By: deadalnix, whitequark

Subscribers: CodaFi, loladiro

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

llvm-svn: 300843

7 years ago[MVT][SVE] Scalable vector MVTs (3/3)
Amara Emerson [Thu, 20 Apr 2017 13:54:09 +0000 (13:54 +0000)]
[MVT][SVE] Scalable vector MVTs (3/3)

Adds MVT::ElementCount to represent the length of a
vector which may be scalable, then adds helper functions
that work with it.

Patch by Graham Hunter.

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

llvm-svn: 300842

7 years agoDelete unused IncompleteFormat variable, NFCi.
Krasimir Georgiev [Thu, 20 Apr 2017 13:37:27 +0000 (13:37 +0000)]
Delete unused IncompleteFormat variable, NFCi.

llvm-svn: 300841

7 years ago[MVT][SVE] Scalable vector MVTs (2/3)
Amara Emerson [Thu, 20 Apr 2017 13:36:58 +0000 (13:36 +0000)]
[MVT][SVE] Scalable vector MVTs (2/3)
Adds scalable vector machine value types, and updates
the switch statements required for tablegen.

Patch by Graham Hunter.

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

llvm-svn: 300840

7 years ago[mips][msa] Mask vectors holding shift amounts
Petar Jovanovic [Thu, 20 Apr 2017 13:26:46 +0000 (13:26 +0000)]
[mips][msa] Mask vectors holding shift amounts

Masked vectors which hold shift amounts when creating the following nodes:
ISD::SHL, ISD::SRL or ISD::SRA.
Instructions that use said nodes, which have had their arguments altered are
sll, srl, sra, bneg, bclr and bset.

For said instructions, the shift amount or the bit position that is
specified in the corresponding vector elements will be interpreted as the
shift amount/bit position modulo the size of the element in bits.

The problem lies in compiling with -O2 enabled, where the instructions for
formats .w and .d are not generated, but are instead optimized away.
In this case, having shift amounts that are either negative or greater than
the element bit size results in generation of incorrect results when
constant folding.

We remedy this by masking the operands for the nodes mentioned above before
actually creating them, so that the final result is correct before placed
into the constant pool.

Patch by Stefan Maksimovic.

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

llvm-svn: 300839

7 years ago[MVT][SVE] Scalable vector MVTs (1/3)
Amara Emerson [Thu, 20 Apr 2017 13:08:17 +0000 (13:08 +0000)]
[MVT][SVE] Scalable vector MVTs (1/3)

This patch adds a few helper functions to obtain new vector
value types based on existing ones without needing to care
about whether they are scalable or not.

I've confined their use to a few common locations right now,
and targets that don't have scalable vectors should never
need to care about these.

Patch by Graham Hunter.

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

llvm-svn: 300838

7 years agoSkip TestLibCxxAtomic with gcc
Pavel Labath [Thu, 20 Apr 2017 12:30:30 +0000 (12:30 +0000)]
Skip TestLibCxxAtomic with gcc

older versions of libc++ (still used on some linux systems) are not
compatible with gcc.

llvm-svn: 300837

7 years agoRecompute ArchSpec core after MergeFrom
Pavel Labath [Thu, 20 Apr 2017 12:30:18 +0000 (12:30 +0000)]
Recompute ArchSpec core after MergeFrom

Summary:
MergeFrom was updating the architecture if the target triple did not
have it set. However, it was leaving the core field as invalid. This
resulted in assertion failures in core file tests as a missing core
meant we were unable to compute the address byte size properly.

Add a unit test for the new behaviour.

Reviewers: jingham, clayborg

Subscribers: lldb-commits

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

llvm-svn: 300836

7 years agoMake TestStaticVariables XFAIL more specific
Pavel Labath [Thu, 20 Apr 2017 11:28:07 +0000 (11:28 +0000)]
Make TestStaticVariables XFAIL more specific

The test fails because an older clang did not emit the required debug
info (I am not sure when this got added, but clang-3.7 certainly did not
work yet). The actual platform has nothing to do with this.

llvm-svn: 300834

7 years agoAdd libc++ category the three more tests
Pavel Labath [Thu, 20 Apr 2017 11:27:58 +0000 (11:27 +0000)]
Add libc++ category the three more tests

I thought my previous commit got the last ones but somehow I missed
these. This also resurrects TestDataFormatterLibcxxSet, which got
commented out in r263859 as a part of some seemingly unrelated change.

llvm-svn: 300833

7 years ago[index] Record class template specializations using a new 'SpecializationOf'
Alex Lorenz [Thu, 20 Apr 2017 10:43:22 +0000 (10:43 +0000)]
[index] Record class template specializations using a new 'SpecializationOf'
relationship

rdar://31603531

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

llvm-svn: 300832

7 years ago[ARM] Fix handling of mapping symbols when changing sections
John Brawn [Thu, 20 Apr 2017 10:18:13 +0000 (10:18 +0000)]
[ARM] Fix handling of mapping symbols when changing sections

ChangeSection incorrectly registers LastEMSInfo as belonging to the previous
section, not the current section. This happens to work when changing sections
using .section, as the previous section is set to the current section before
the call to ChangeSection, but not when using .popsection.

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

llvm-svn: 300831

7 years ago[AArch64] Fix handling of zero immediate in fmov instructions
John Brawn [Thu, 20 Apr 2017 10:13:54 +0000 (10:13 +0000)]
[AArch64] Fix handling of zero immediate in fmov instructions

Currently fmov #0 with a vector destination is handle incorrectly and results in
fmov #-1.9375 being emitted but should instead give an error. This is due to the
way we cope with fmov #0 with a scalar destination being an alias of fmov zr, so
fix this by actually doing it through an alias.

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

llvm-svn: 300830

7 years agoAdd Python 3 support to clang.cindex
Jonathan Coe [Thu, 20 Apr 2017 10:11:01 +0000 (10:11 +0000)]
Add Python 3 support to clang.cindex

Summary:
Introduce an interop string to convert from unicode to c-strings where needed.
Add missing conversions from _CXString to strings in function registrations.
Explicitly evaluate lists where Python 3's lazy iterators would not otherwise do so.

This is an improvement upon the reverted change proposed in https://reviews.llvm.org/D26082

Reviewers: compnerd, skalinichev, modocache, MathieuDuponchelle

Reviewed By: compnerd

Subscribers: cfe-commits

Tags: #clang-c

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

llvm-svn: 300829

7 years ago[AArch64] Fix handling of integer fp immediates
John Brawn [Thu, 20 Apr 2017 10:10:10 +0000 (10:10 +0000)]
[AArch64] Fix handling of integer fp immediates

When an integer is used as an fp immediate we're failing to check the return
value of getFP64Imm, so invalid values are silently permitted. Fix this by
merging together the integer and real handling.

llvm-svn: 300828

7 years ago[ARM] Rename HW div feature to HW div Thumb. NFCI.
Diana Picus [Thu, 20 Apr 2017 09:38:25 +0000 (09:38 +0000)]
[ARM] Rename HW div feature to HW div Thumb. NFCI.

The hardware div feature refers only to Thumb, but because of its name
it is tempting to use it to check for hardware division in general,
which may cause problems in ARM mode. See https://reviews.llvm.org/D32005.

This patch adds "Thumb" to its name, to make its scope clear. One
notable place where I haven't made the change is in the feature flag
(used with -mattr), which is still hwdiv. Changing it would also require
changes in a lot of tests, including clang tests, and it doesn't seem
like it's worth the effort.

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

llvm-svn: 300827

7 years agoAdd #pragma clang attribute support to the availability attribute
Alex Lorenz [Thu, 20 Apr 2017 09:35:02 +0000 (09:35 +0000)]
Add #pragma clang attribute support to the availability attribute

rdar://31707804

llvm-svn: 300826

7 years agoPR19260: Teach doxygen to spell correctly the include paths.
Vassil Vassilev [Thu, 20 Apr 2017 08:57:41 +0000 (08:57 +0000)]
PR19260: Teach doxygen to spell correctly the include paths.

Currently we have #include <Sema.h> in the doxygen page documenting Sema. The
patch changes it ot #include "clang/Sema/Sema.h" which is what we would spell if
we need to include it in a real codebase.

Patch by Yuka Takahashi (D32113)!

llvm-svn: 300825

7 years ago[APInt] In slt/sgt(uint64_t), only call getMinSignedBits if the APInt is not a single...
Craig Topper [Thu, 20 Apr 2017 06:04:03 +0000 (06:04 +0000)]
[APInt] In slt/sgt(uint64_t), only call getMinSignedBits if the APInt is not a single word.

llvm-svn: 300824

7 years ago[APInt] Call the slow case counting methods directly in isMask/isShiftedMask. We...
Craig Topper [Thu, 20 Apr 2017 06:04:01 +0000 (06:04 +0000)]
[APInt] Call the slow case counting methods directly in isMask/isShiftedMask. We already handled the single word case. NFC

llvm-svn: 300823

7 years ago[XRay] [compiler-rt] - Fix standalone and non-deterministic test issue
Keith Wyss [Thu, 20 Apr 2017 05:59:26 +0000 (05:59 +0000)]
[XRay] [compiler-rt] - Fix standalone and non-deterministic test issue

Summary:
The thread order test fails sometimes my machine independently of standalone
build.

From testing both standalone and in-tree build, I see I configured it wrong.

The other hypothesis for an issue is that cold starts can interfere with whether
record unwriting happens. Once this happens more than once, we can naively
FileCheck on the wrong test output, which compounds the issue.

While "rm blah.* || true" will print to stderr if the glob can't expand, this is
mostly harmless and makes sure earlier failing tests don't sabotage us.

Example failure:

---
header:
  version:         1
  type:            1
  constant-tsc:    true
  nonstop-tsc:     true
  cycle-frequency: 3800000000
records:
  - { type: 0, func-id: 1, function: 'f1()', cpu: 9, thread: 21377, kind: function-enter, tsc: 2413745203147228 }
  - { type: 0, func-id: 1, function: 'f1()', cpu: 9, thread: 21377, kind: function-exit, tsc: 2413745203304238 }
...

The CMAKE related change fixes the expectation that COMPILER_RT_STANDALONE_BUILD will be explicitly FALSE instead
of empty string when it is not "TRUE".

Reviewers: dberris

Subscribers: llvm-commits

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

llvm-svn: 300822

7 years ago[SelectionDAG] Fix another place that was passing a large value to APInt::lshrInPlace.
Craig Topper [Thu, 20 Apr 2017 04:55:01 +0000 (04:55 +0000)]
[SelectionDAG] Fix another place that was passing a large value to APInt::lshrInPlace.

llvm-svn: 300821

7 years agoDisable the filesystem library on Windows by default
Eric Fiselier [Thu, 20 Apr 2017 04:24:29 +0000 (04:24 +0000)]
Disable the filesystem library on Windows by default

llvm-svn: 300820

7 years ago[SelectionDAG] Use getActiveBits() and countTrailingZeros() to avoid creating tempora...
Craig Topper [Thu, 20 Apr 2017 04:23:43 +0000 (04:23 +0000)]
[SelectionDAG] Use getActiveBits() and countTrailingZeros() to avoid creating temporary APInts with lshr and trunc. NFCI

llvm-svn: 300819

7 years ago[AVR] Add -mmcu option to the driver
Leslie Zhai [Thu, 20 Apr 2017 04:23:24 +0000 (04:23 +0000)]
[AVR] Add -mmcu option to the driver

A patch by Peter Wu!

Reviewers: jroelofs, xiangzhai

Reviewed By: jroelofs, dylanmckay, xiangzhai

Subscribers: dlj, dylanmckay, cfe-commits

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

llvm-svn: 300818

7 years agoRename the static version of libc++ on Windows.
Eric Fiselier [Thu, 20 Apr 2017 04:19:02 +0000 (04:19 +0000)]
Rename the static version of libc++ on Windows.

Previously both the static version of libc++ and the
import library for the DLL had the same name, 'c++.lib'.

This patch renames the static library on Windows to be `libc++.lib`
so it no longer conflicts. This naming convention is consistent with
other windows libraries.

llvm-svn: 300817

7 years agoRecommit "[APInt] Add back the asserts that check that the APInt shift methods aren...
Craig Topper [Thu, 20 Apr 2017 03:49:18 +0000 (03:49 +0000)]
Recommit "[APInt] Add back the asserts that check that the APInt shift methods aren't called with values larger than BitWidth."

This includes a fix to clamp a right shift of larger than BitWidth in DAG combining.

llvm-svn: 300816

7 years ago[XRay][compiler-rt] Cleanup CFI/CFA annotations on trampolines
Dean Michael Berris [Thu, 20 Apr 2017 03:26:04 +0000 (03:26 +0000)]
[XRay][compiler-rt] Cleanup CFI/CFA annotations on trampolines

Summary:
This is a follow-up to D32202.

While the previous change (D32202) did fix the stack alignment issue, we
were still at a weird state in terms of the CFI/CFA directives (as the
offsets were wrong). This change cleans up the SAVE/RESTORE macros for
the trampoline, accounting the stack pointer adjustments with less
instructions and with some clearer math. We note that the offsets will
be different on the exit trampolines, because we don't typically 'call'
into this trampoline and we only ever jump into them (i.e. treated as a
tail call that's patched in at runtime).

Reviewers: eugenis, kpw, pelikan

Subscribers: llvm-commits

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

llvm-svn: 300815

7 years ago[ODRHash] clean up test and add new examples. NFC
Richard Trieu [Thu, 20 Apr 2017 02:53:53 +0000 (02:53 +0000)]
[ODRHash] clean up test and add new examples.  NFC

Use a macro to generate the struct with all decls.  Previously, four identical
changes would be needed to update this test.  This macro reduces that to one
location.  Added two other tests for issues that triggered false positives
during testing.

llvm-svn: 300814

7 years agoRevert r300811 "[APInt] Add back the asserts that check that the APInt shift methods...
Craig Topper [Thu, 20 Apr 2017 02:46:21 +0000 (02:46 +0000)]
Revert r300811 "[APInt] Add back the asserts that check that the APInt shift methods aren't called with values larger than BitWidth."

This is failing a self host debug build.

llvm-svn: 300813

7 years ago[APInt] Implement APInt::intersects without creating a temporary APInt in the multiwo...
Craig Topper [Thu, 20 Apr 2017 02:11:27 +0000 (02:11 +0000)]
[APInt] Implement APInt::intersects without creating a temporary APInt in the multiword case

Summary: This is a simple question we should be able to answer without creating a temporary to hold the AND result. We can also get an early out as soon as we find a word that intersects.

Reviewers: RKSimon, hans, spatel, davide

Reviewed By: hans, davide

Subscribers: llvm-commits

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

llvm-svn: 300812

7 years ago[APInt] Add back the asserts that check that the APInt shift methods aren't called...
Craig Topper [Thu, 20 Apr 2017 02:03:09 +0000 (02:03 +0000)]
[APInt] Add back the asserts that check that the APInt shift methods aren't called with values larger than BitWidth.

The underlying tcShiftRight/tcShiftLeft functions support the larger bit widths but the APInt interface shouldn't rely on that.

llvm-svn: 300811

7 years agoAdd extra logging for when lldb is looking for kernels and kexts.
Jason Molenda [Thu, 20 Apr 2017 02:02:25 +0000 (02:02 +0000)]
Add extra logging for when lldb is looking for kernels and kexts.
<rdar://problem/26863256>

llvm-svn: 300810

7 years agoMake linker errors verbose on Windows
Eric Fiselier [Thu, 20 Apr 2017 01:50:39 +0000 (01:50 +0000)]
Make linker errors verbose on Windows

llvm-svn: 300809

7 years agoFix dllimport on a class template
Eric Fiselier [Thu, 20 Apr 2017 01:45:15 +0000 (01:45 +0000)]
Fix dllimport on a class template

llvm-svn: 300808

7 years agoDo not run frame verification if target does not use frame instructions
Serge Pavlov [Thu, 20 Apr 2017 01:34:04 +0000 (01:34 +0000)]
Do not run frame verification if target does not use frame instructions

llvm-svn: 300807

7 years agoPR32673: Don't wrap parameter packs in SubstTemplateTypeParmPackType nodes when formi...
Richard Smith [Thu, 20 Apr 2017 01:15:31 +0000 (01:15 +0000)]
PR32673: Don't wrap parameter packs in SubstTemplateTypeParmPackType nodes when forming implicit deduction guides.

Doing so thwarts template type deduction. Instead, substitute the pack directly
by picking "slice 0" of the resulting expansion.

llvm-svn: 300805

7 years ago[Sema] Use MSVC inner class behavior on Itanium
Shoaib Meenai [Thu, 20 Apr 2017 01:11:42 +0000 (01:11 +0000)]
[Sema] Use MSVC inner class behavior on Itanium

Windows Itanium aims to use MSVC export and import semantics. Inner
class members shouldn't be exported on a dllexport explicit
instantiation definition of the outer class, and they shouldn't be
imported on a dllimport explicit instantiation declaration of the outer
class (instead a local copy should be emitted). We were doing the first
but not the second, and this mismatch can lead to link errors. Fix the
behavior and add tests for both.

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

llvm-svn: 300804

7 years agoAdd a triple to codegen test.
Richard Smith [Thu, 20 Apr 2017 01:02:29 +0000 (01:02 +0000)]
Add a triple to codegen test.

llvm-svn: 300803

7 years ago[OpenMP] Prepare sema to support combined constructs with omp distribute and omp for
Carlo Bertolli [Thu, 20 Apr 2017 00:39:39 +0000 (00:39 +0000)]
[OpenMP] Prepare sema to support combined constructs with omp distribute and omp for

https://reviews.llvm.org/D32237

This patch prepares sema with additional fields to support all those composite and combined constructs of OpenMP that include pragma 'distribute' and 'for', such as 'distribute parallel for'. It also extends the regression tests for 'distribute parallel for' and adds a new one.

llvm-svn: 300802

7 years agoRevert "[libFuzzer] XFAIL fuzzer-oom.test on Darwin."
Ahmed Bougacha [Thu, 20 Apr 2017 00:16:13 +0000 (00:16 +0000)]
Revert "[libFuzzer] XFAIL fuzzer-oom.test on Darwin."

This reverts commit r300127.

r300759 implemented StopTheWorld for Darwin, so the test passes again.

llvm-svn: 300801

7 years ago[libFuzzer] extend help for -minimize_crash to cover ASAN_OPTIONS=dedup_token_length=3
Kostya Serebryany [Wed, 19 Apr 2017 23:58:05 +0000 (23:58 +0000)]
[libFuzzer] extend help for -minimize_crash to cover ASAN_OPTIONS=dedup_token_length=3

llvm-svn: 300800

7 years ago[APInt] Implement operator==(uint64_t) similar to ugt/ult(uint64_t) to remove one...
Craig Topper [Wed, 19 Apr 2017 23:57:51 +0000 (23:57 +0000)]
[APInt] Implement operator==(uint64_t) similar to ugt/ult(uint64_t) to remove one of the out of line EqualsSlowCase methods.

llvm-svn: 300799

7 years ago[APInt] Don't call getActiveBits() in ult/ugt(uint64_t) if its a single word.
Craig Topper [Wed, 19 Apr 2017 23:55:48 +0000 (23:55 +0000)]
[APInt] Don't call getActiveBits() in ult/ugt(uint64_t) if its a single word.

The compiled code already needs to check single/multi word for the countLeadingZeros call inside of getActiveBits, but it isn't able to optimize out the leadingZeros call in the single word case that can't produce a value larger than 64.

This shrank the opt binary by about 5-6k on my local x86-64 build.

llvm-svn: 300798

7 years agoStatepoint Docs: fix incorrect uses of it's
Sanjoy Das [Wed, 19 Apr 2017 23:55:03 +0000 (23:55 +0000)]
Statepoint Docs: fix incorrect uses of it's

llvm-svn: 300797

7 years ago[APInt] Use ugt(uint64_t) for the compare in getLimitedValue(uint64_t) since the...
Craig Topper [Wed, 19 Apr 2017 23:52:59 +0000 (23:52 +0000)]
[APInt] Use ugt(uint64_t) for the compare in getLimitedValue(uint64_t) since the code is identical to it. NFC

llvm-svn: 300796

7 years ago[DAE] Simplify attribute list creation, NFC
Reid Kleckner [Wed, 19 Apr 2017 23:45:45 +0000 (23:45 +0000)]
[DAE] Simplify attribute list creation, NFC

Removes a use of getSlotAttributes, which I intend to change.

llvm-svn: 300795

7 years agoRevert r300789: There are Windows bot failures.
Kuba Mracek [Wed, 19 Apr 2017 23:44:33 +0000 (23:44 +0000)]
Revert r300789: There are Windows bot failures.

llvm-svn: 300794

7 years agoFix bug that caused DwarfExpression to drop DW_OP_deref from FI locations
Adrian Prantl [Wed, 19 Apr 2017 23:42:25 +0000 (23:42 +0000)]
Fix bug that caused DwarfExpression to drop DW_OP_deref from FI locations
- introduced in r300522 and found via the Swift LLDB testsuite.

The fix is to set the location kind to memory whenever an FrameIndex
location is emitted.

rdar://problem/31707602

llvm-svn: 300793

7 years agoRevert "Fix bug that caused DwarfExpression to drop DW_OP_deref from FI locations"
Adrian Prantl [Wed, 19 Apr 2017 23:42:17 +0000 (23:42 +0000)]
Revert "Fix bug that caused DwarfExpression to drop DW_OP_deref from FI locations"

This reverts commit r300790.

llvm-svn: 300792

7 years agoRevert earlier change. ds permute operations affect lgkm counter.
Kannan Narayanan [Wed, 19 Apr 2017 23:39:19 +0000 (23:39 +0000)]
Revert earlier change. ds permute operations affect lgkm counter.

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

llvm-svn: 300791

7 years agoFix bug that caused DwarfExpression to drop DW_OP_deref from FI locations
Adrian Prantl [Wed, 19 Apr 2017 23:34:14 +0000 (23:34 +0000)]
Fix bug that caused DwarfExpression to drop DW_OP_deref from FI locations
- introduced in r300522 and found via the Swift LLDB testsuite.

The fix is to set the location kind to memory whenever an FrameIndex
location is emitted.

rdar://problem/31707602

llvm-svn: 300790

7 years ago[libFuzzer] Always build libFuzzer
Kuba Mracek [Wed, 19 Apr 2017 23:34:08 +0000 (23:34 +0000)]
[libFuzzer] Always build libFuzzer

There are two reasons why users might want to build libfuzzer:
- To fuzz LLVM itself
- To get the libFuzzer.a archive file, so that they can attach it to their code
This change always builds libfuzzer, and supports the second use case if the specified flag is set.

The point of this patch is to have something that can potentially be shipped with the compiler, and this also ensures that the version of libFuzzer is correct to use with that compiler.

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

llvm-svn: 300789

7 years agochange what branches Appveyor builds
Eric Fiselier [Wed, 19 Apr 2017 23:27:48 +0000 (23:27 +0000)]
change what branches Appveyor builds

llvm-svn: 300788

7 years ago[GlobalOpt] Simplify attribute code stripping nest, NFC
Reid Kleckner [Wed, 19 Apr 2017 23:26:44 +0000 (23:26 +0000)]
[GlobalOpt] Simplify attribute code stripping nest, NFC

llvm-svn: 300787

7 years agoAdd appveyor.yml config for a future Windows bot.
Eric Fiselier [Wed, 19 Apr 2017 23:26:21 +0000 (23:26 +0000)]
Add appveyor.yml config for a future Windows bot.

I'm currently trying to get a libc++ Windows builder working on appveyor.
This patch adds the configuration file needed to build libc++ on Appveyor.
Details of where the buildbot can be found will come later

llvm-svn: 300786

7 years agoFix !N and !-N commands and add a test case.
Jim Ingham [Wed, 19 Apr 2017 23:21:04 +0000 (23:21 +0000)]
Fix !N and !-N commands and add a test case.

<rdar://problem/31713267>

llvm-svn: 300785

7 years agoSimplify test for sret attribute in instcombine
Reid Kleckner [Wed, 19 Apr 2017 23:17:47 +0000 (23:17 +0000)]
Simplify test for sret attribute in instcombine

This change is correct because the verifier requires that at most one
argument be marked 'sret'.

NFC, removes a use of AttributeList slot APIs.

llvm-svn: 300784

7 years agoTemporarily revert r299221 to fix nondeterminism in ThinLTO builder.
Galina Kistanova [Wed, 19 Apr 2017 23:16:14 +0000 (23:16 +0000)]
Temporarily revert r299221 to fix nondeterminism in ThinLTO builder.

llvm-svn: 300783

7 years agoRefresh the statepoint docs a bit
Philip Reames [Wed, 19 Apr 2017 23:16:13 +0000 (23:16 +0000)]
Refresh the statepoint docs a bit

The documentation had gotten a bit stale.  The revised one are by no means perfect, but I tried to remove the obvious incorrect or misleading statements.

llvm-svn: 300782

7 years agoX86FrameLowering: Fix getFrameIndexReference() for 'fixed' objects
Matthias Braun [Wed, 19 Apr 2017 23:10:43 +0000 (23:10 +0000)]
X86FrameLowering: Fix getFrameIndexReference() for 'fixed' objects

Debug information is calculated with getFrameIndexReference() which was
missing some logic for the fixed object cases (= parameters on the stack).

rdar://24557797

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

llvm-svn: 300781

7 years ago[sanitizer-coverage] remove more unused code
Kostya Serebryany [Wed, 19 Apr 2017 23:05:53 +0000 (23:05 +0000)]
[sanitizer-coverage] remove more unused code

llvm-svn: 300780

7 years ago[Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor...
Eugene Zelenko [Wed, 19 Apr 2017 23:02:10 +0000 (23:02 +0000)]
[Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).

llvm-svn: 300779