platform/upstream/llvm.git
8 years ago[ThinLTO] Remove post-pass metadata linking support
Teresa Johnson [Tue, 29 Mar 2016 18:24:19 +0000 (18:24 +0000)]
[ThinLTO] Remove post-pass metadata linking support

Since we have moved to a model where functions are imported in bulk from
each source module after making summary-based importing decisions, there
is no longer a need to link metadata as a postpass, and all users have
been removed.

This essentially reverts r255909 and follow-on fixes.

llvm-svn: 264763

8 years agoWhen creating typedefs, don't call Type::GetName() since that might recursively call...
Greg Clayton [Tue, 29 Mar 2016 18:22:07 +0000 (18:22 +0000)]
When creating typedefs, don't call Type::GetName() since that might recursively call "lldb_private::Type::ResolveClangType(lldb_private::Type::ResolveStateTag)" and cause a crash. A lldb_private::Type should have a valid name if it is created without a backing CompilerType. Also provide a name that we can recognize so if we see it in a as the typename of a variable, we will know to check it out. This crash is happening quite a bit and we need to determine if this is due to incorrect debug info, or just due to some bug in LLDBD.

<rdar://problem/25192037>

llvm-svn: 264762

8 years agoChange how we handle R_MIPS_LO16.
Rafael Espindola [Tue, 29 Mar 2016 18:18:19 +0000 (18:18 +0000)]
Change how we handle R_MIPS_LO16.

Mips aligns PT_LOAD to 16 bits (0x10000). That means that the lower 16
bits are always the same, so we can, effectively, say that the
relocation is relative.

llvm-svn: 264761

8 years agoRemoved class FormatStyle, which is a struct, forward declaration from Refactoring...
Eric Liu [Tue, 29 Mar 2016 18:17:11 +0000 (18:17 +0000)]
Removed class FormatStyle, which is a struct, forward declaration from Refactoring.h to avoid compilation error.

llvm-svn: 264760

8 years ago[clang-tidy] Add check to detect dangling references in value handlers.
Samuel Benzaquen [Tue, 29 Mar 2016 18:02:26 +0000 (18:02 +0000)]
[clang-tidy] Add check to detect dangling references in value handlers.

Summary:
Add check misc-dangling-handle to detect dangling references in value
handlers like std::experimental::string_view.
It provides a configuration option to specify other handle types that
should also be checked.

Right now it detects:
 - Construction from temporaries.
 - Assignment from temporaries.
 - Return statements from temporaries or locals.
 - Insertion into containers from temporaries.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 264759

8 years ago[asan] Make the global_metadata_darwin.ll test require El Capitan or newer
Ryan Govostes [Tue, 29 Mar 2016 17:58:49 +0000 (17:58 +0000)]
[asan] Make the global_metadata_darwin.ll test require El Capitan or newer

llvm-svn: 264758

8 years ago[Order Files] Fix order file usage
Chris Bieneman [Tue, 29 Mar 2016 17:51:08 +0000 (17:51 +0000)]
[Order Files] Fix order file usage

The CMake EXISTS operator needs to have the variable expanded. Not expanding this was causing the if statement to always be false, which made it impossible to pass linker order files in.

llvm-svn: 264757

8 years agoAdd support for no-jump-tables
Nirav Dave [Tue, 29 Mar 2016 17:46:23 +0000 (17:46 +0000)]
Add support for no-jump-tables

Add function soft attribute to the generation of Jump Tables in CodeGen
as initial step towards clang support of gcc's no-jump-table support

Reviewers: hans, echristo

Subscribers: llvm-commits

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

llvm-svn: 264756

8 years agoAdd MachineVerifier check for AllVRegsAllocated MachineFunctionProperty
Derek Schuff [Tue, 29 Mar 2016 17:40:22 +0000 (17:40 +0000)]
Add MachineVerifier check for AllVRegsAllocated MachineFunctionProperty

Summary:
Check that any function that has the property set is free of virtual
register operands.

Also, it is actually VirtRegMap (and not the register allocators) that
acutally remove the VReg operands (except for RegAllocFast).

Reviewers: qcolombet

Subscribers: MatzeB, llvm-commits, qcolombet

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

llvm-svn: 264755

8 years agoSwift Calling Convention: add swiftself attribute.
Manman Ren [Tue, 29 Mar 2016 17:37:21 +0000 (17:37 +0000)]
Swift Calling Convention: add swiftself attribute.

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

llvm-svn: 264754

8 years agoDon't try to call getTypeSize() on a class if it isn't complete as clang will assert...
Greg Clayton [Tue, 29 Mar 2016 17:36:38 +0000 (17:36 +0000)]
Don't try to call getTypeSize() on a class if it isn't complete as clang will assert and kill the process.

llvm-svn: 264753

8 years ago[Sema] Handle UTF-8 invalid format string specifiers
Bruno Cardoso Lopes [Tue, 29 Mar 2016 17:35:02 +0000 (17:35 +0000)]
[Sema] Handle UTF-8 invalid format string specifiers

Improve invalid format string specifier handling by printing out
invalid specifiers characters with \x, \u and \U. Previously clang
would print gargabe whenever the character is unprintable.

Example, before:
  NSLog(@"%\u25B9"); => warning: invalid conversion specifier ' [-Wformat-invalid-specifier]
after:
  NSLog(@"%\u25B9"); => warning: invalid conversion specifier '\u25b9' [-Wformat-invalid-specifier]

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

rdar://problem/24672159

llvm-svn: 264752

8 years ago[Darwin] [Builtins] Cleaning up OS X exclude lists. NFC.
Chris Bieneman [Tue, 29 Mar 2016 17:34:13 +0000 (17:34 +0000)]
[Darwin] [Builtins] Cleaning up OS X exclude lists. NFC.

This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives.

llvm-svn: 264751

8 years ago[Darwin] [Builtins] Remove multi3 from the exclude list.
Chris Bieneman [Tue, 29 Mar 2016 17:24:23 +0000 (17:24 +0000)]
[Darwin] [Builtins] Remove multi3 from the exclude list.

This addresses PR27077. For some historical reason Darwin wasn't shipping multi3 in the compiler builtin library or in the OS builtin library. This caused building ffmpeg to fail because Polly was generating calls to multi3. It is easy enough to just add the builtin.

llvm-svn: 264750

8 years ago[Darwin] [Builtins] Cleaning up 10.4 exclude lists NFC
Chris Bieneman [Tue, 29 Mar 2016 17:24:21 +0000 (17:24 +0000)]
[Darwin] [Builtins] Cleaning up 10.4 exclude lists NFC

This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives.

llvm-svn: 264749

8 years ago[x86] add tests to show current memset codegen
Sanjay Patel [Tue, 29 Mar 2016 17:09:27 +0000 (17:09 +0000)]
[x86] add tests to show current memset codegen

llvm-svn: 264748

8 years ago[SCEV] Extract out a MatchBinaryOp; NFCI
Sanjoy Das [Tue, 29 Mar 2016 16:40:44 +0000 (16:40 +0000)]
[SCEV] Extract out a MatchBinaryOp; NFCI

MatchBinaryOp abstracts out the IR instructions from the operations they
represent.  While this change is NFC, we will use this factoring later
to map things like `(extractvalue 0 (sadd.with.overflow X Y))` to `(add
X Y)`.

llvm-svn: 264747

8 years ago[SCEV] Use Operator::getOpcode instead of manual dispatch; NFC
Sanjoy Das [Tue, 29 Mar 2016 16:40:39 +0000 (16:40 +0000)]
[SCEV] Use Operator::getOpcode instead of manual dispatch; NFC

llvm-svn: 264746

8 years agoAdded formatAndApplyAllReplacements that works on multiple files in libTooling.
Eric Liu [Tue, 29 Mar 2016 16:31:53 +0000 (16:31 +0000)]
Added formatAndApplyAllReplacements that works on multiple files in libTooling.

Summary:
formatAndApplyAllReplacements takes a set of Replacements, applies them on a
Rewriter, and reformats the changed code.

Reviewers: klimek, djasper

Subscribers: ioeric, klimek, cfe-commits

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

llvm-svn: 264745

8 years agoMake InlineSimple's one-arg constructor explicit. NFC
Justin Lebar [Tue, 29 Mar 2016 16:26:06 +0000 (16:26 +0000)]
Make InlineSimple's one-arg constructor explicit. NFC

llvm-svn: 264744

8 years agoReformat a comment in InlineSimple.cpp. NFC
Justin Lebar [Tue, 29 Mar 2016 16:26:03 +0000 (16:26 +0000)]
Reformat a comment in InlineSimple.cpp. NFC

llvm-svn: 264743

8 years ago[CUDA] Add missing #undef __DEVICE__ to CUDA shim header.
Justin Lebar [Tue, 29 Mar 2016 16:24:23 +0000 (16:24 +0000)]
[CUDA] Add missing #undef __DEVICE__ to CUDA shim header.

llvm-svn: 264742

8 years ago[CUDA] Fix order of overloading preferences in comment.
Justin Lebar [Tue, 29 Mar 2016 16:24:22 +0000 (16:24 +0000)]
[CUDA] Fix order of overloading preferences in comment.

llvm-svn: 264741

8 years ago[CUDA] Make CUDA description strings in langopts into noun phrases. NFC
Justin Lebar [Tue, 29 Mar 2016 16:24:20 +0000 (16:24 +0000)]
[CUDA] Make CUDA description strings in langopts into noun phrases.  NFC

rsmith quoth in D18380:

> This should be a noun phrase -- this string appears in contexts like
> "support for %0 is enabled" -- so this should be "treating
> unattributed [...]".

llvm-svn: 264740

8 years ago[CUDA] Remove three obsolete CUDA cc1 flags.
Justin Lebar [Tue, 29 Mar 2016 16:24:16 +0000 (16:24 +0000)]
[CUDA] Remove three obsolete CUDA cc1 flags.

Summary:
* -fcuda-target-overloads

  Previously unconditionally set to true by the driver.  Necessary for
  correct functioning of the compiler -- our CUDA headers wrapper won't
  compile without this.

* -fcuda-disable-target-call-checks

  Previously unconditionally set to true by the driver.  Necessary to
  compile almost any external CUDA code -- almost all libraries assume
  that host+device code can call host or device functions.

* -fcuda-allow-host-calls-from-host-device

  No effect when target overloading is enabled.

Reviewers: tra

Subscribers: rsmith, cfe-commits

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

llvm-svn: 264739

8 years agoregenerate checks
Sanjay Patel [Tue, 29 Mar 2016 16:11:29 +0000 (16:11 +0000)]
regenerate checks

llvm-svn: 264738

8 years ago[AMDGPU] Switch linker to amdphdrs + update test
Konstantin Zhuravlyov [Tue, 29 Mar 2016 15:54:09 +0000 (15:54 +0000)]
[AMDGPU] Switch linker to amdphdrs + update test

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

llvm-svn: 264737

8 years agoTest commit access
Konstantin Zhuravlyov [Tue, 29 Mar 2016 15:15:44 +0000 (15:15 +0000)]
Test commit access

llvm-svn: 264736

8 years agoMove DynamicLoader plugins to SystemInitializerFull
Pavel Labath [Tue, 29 Mar 2016 15:00:26 +0000 (15:00 +0000)]
Move DynamicLoader plugins to SystemInitializerFull

Summary: These are not needed by lldb-server. Removing them shrinks the server by about 0.5%.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 264735

8 years ago[ThinLTO] Use new GlobalValue::getGUID helper (NFC)
Teresa Johnson [Tue, 29 Mar 2016 14:49:26 +0000 (14:49 +0000)]
[ThinLTO] Use new GlobalValue::getGUID helper (NFC)

This was already being used for functions and aliases, was missed when
handling global variables.

llvm-svn: 264734

8 years agoRevert the "build fix" in r264104
Pavel Labath [Tue, 29 Mar 2016 14:39:10 +0000 (14:39 +0000)]
Revert the "build fix" in r264104

this was needed because lldb-mi temporarily contained references to private lldb symbols
(lldb_private namespace), which it shouldn't have. The situation has since been rectified and
this wasn't the right fix anyway, since it can lead to funny ODR violations.

llvm-svn: 264733

8 years ago[ELF][MIPS] Remove redundant comments from the test. NFC.
Simon Atanasyan [Tue, 29 Mar 2016 14:26:24 +0000 (14:26 +0000)]
[ELF][MIPS] Remove redundant comments from the test. NFC.

Now llvm-objdump prints target function name for `jal` instruction by itself.

llvm-svn: 264732

8 years ago[llvm-readobj] NFC: Remove unneeded parenthesis
Hemant Kulkarni [Tue, 29 Mar 2016 14:20:20 +0000 (14:20 +0000)]
[llvm-readobj] NFC: Remove unneeded parenthesis

llvm-svn: 264731

8 years ago[ELF][MIPS] Reduce number of redundant entries in the local part of MIPS GOT
Simon Atanasyan [Tue, 29 Mar 2016 14:07:22 +0000 (14:07 +0000)]
[ELF][MIPS] Reduce number of redundant entries in the local part of MIPS GOT

Local symbol which requires GOT entry initialized by "page" address.
This address is high 16 bits of sum of the symbol value and the relocation
addend. In the relocation scanning phase final values of symbols are unknown
so to reduce number of allocated GOT entries do the following trick. Save
all output sections referenced by GOT relocations during the relocation
scanning phase. Then later in the `GotSection::finalize` method calculate
number of "pages" required to cover all saved output sections and allocate
appropriate number of GOT entries. We assume the worst case - each 64kb
page of the output section has at least one GOT relocation against it.

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

llvm-svn: 264730

8 years agoFix infinite recursion in DWO file parsing
Pavel Labath [Tue, 29 Mar 2016 13:42:02 +0000 (13:42 +0000)]
Fix infinite recursion in DWO file parsing

Summary:
Since r264316, clang started adding DW_AT_GNU_dwo_name attribute to dwo files (previously, this
attribute was only present in main object files), breaking pretty much every dwo test. The
problem was that we were treating the presence of said attribute as a signal that we should look
for information in an external object file, and caused us to enter an infinite loop. I fix this
by making sure we do not go looking for an external dwo file if we already *are* parsing a dwo
file.

Reviewers: tberghammer, clayborg

Subscribers: lldb-commits

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

llvm-svn: 264729

8 years ago[mips] Test commit: Mark insertNoop as dead code (NFC)
Simon Dardis [Tue, 29 Mar 2016 13:02:19 +0000 (13:02 +0000)]
[mips] Test commit: Mark insertNoop as dead code (NFC)

llvm-svn: 264728

8 years agoAdd additional Hi/Lo registers to Clang MipsTargetInfoBase
Hrvoje Varga [Tue, 29 Mar 2016 12:46:16 +0000 (12:46 +0000)]
Add additional Hi/Lo registers to Clang MipsTargetInfoBase
Differential Revision: http://reviews.llvm.org/D17378

llvm-svn: 264727

8 years agoAdd ClangUtil.cpp to the xcode project
Pavel Labath [Tue, 29 Mar 2016 12:06:37 +0000 (12:06 +0000)]
Add ClangUtil.cpp to the xcode project

llvm-svn: 264721

8 years ago[OPENMP 4.5] Allow data members in 'aligned' clause.
Alexey Bataev [Tue, 29 Mar 2016 10:59:56 +0000 (10:59 +0000)]
[OPENMP 4.5] Allow data members in 'aligned' clause.

OpenMP 4.5 allows privatization of data members OpenMP clauses. Patch
adds support for data members in 'aligned' clause.

llvm-svn: 264715

8 years agoVisual Studio native visualization for TemplateParameterList and TemplateTypeParmDecl
Mike Spertus [Tue, 29 Mar 2016 10:57:24 +0000 (10:57 +0000)]
Visual Studio native visualization for TemplateParameterList and TemplateTypeParmDecl

With this change, a TemplateParameterList will suggestively display in the locals window something like:
  <typename T, int i>

llvm-svn: 264714

8 years agoAdd missing swig wrappers for r264662
Pavel Labath [Tue, 29 Mar 2016 10:41:40 +0000 (10:41 +0000)]
Add missing swig wrappers for r264662

llvm-svn: 264713

8 years ago[mips] Correct MIPS16 jal/jalx to have uimm26 offsets and add MC layer range checks...
Daniel Sanders [Tue, 29 Mar 2016 09:40:38 +0000 (09:40 +0000)]
[mips] Correct MIPS16 jal/jalx to have uimm26 offsets and add MC layer range checks. NFC.

Summary:
However, this has no effect at this time because the instructions affected
are marked 'isCodeGenOnly=1' and have no alternative for the MC layer.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 264712

8 years agoForgot to address last minor review comment in r264708. Doing that now.
George Rimar [Tue, 29 Mar 2016 09:37:17 +0000 (09:37 +0000)]
Forgot to address last minor review comment in r264708. Doing that now.

llvm-svn: 264711

8 years agoVisual Studio native visualizer for InjectedClassNameType
Mike Spertus [Tue, 29 Mar 2016 09:24:45 +0000 (09:24 +0000)]
Visual Studio native visualizer for InjectedClassNameType

Also fixes some omissions for TemplateSpecializationType

llvm-svn: 264710

8 years ago[OPENMP] Remove extra code transformation.
Alexey Bataev [Tue, 29 Mar 2016 08:58:54 +0000 (08:58 +0000)]
[OPENMP] Remove extra code transformation.

For better support of some specific GNU extensions some extra
transformation of AST nodes were introduced. These transformations are
very hard to handle. The code is improved in handling of these
extensions by using captured expressions construct.

llvm-svn: 264709

8 years ago[ELF, PR27091] - Implemented -t/--trace option
George Rimar [Tue, 29 Mar 2016 08:45:40 +0000 (08:45 +0000)]
[ELF, PR27091] - Implemented -t/--trace option

-t/--trace
Print the names of the input files as ld processes them.
This fixes https://llvm.org/bugs/show_bug.cgi?id=27091.

Differential revision: http://reviews.llvm.org/D18517

llvm-svn: 264708

8 years ago[ELF] - Error out when R_X86_64_PC32/R_X86_64_32 are used against preemptible symbol...
George Rimar [Tue, 29 Mar 2016 08:35:42 +0000 (08:35 +0000)]
[ELF] - Error out when R_X86_64_PC32/R_X86_64_32 are used against preemptible symbol when linking shared object.

When R_X86_64_PC32/R_X86_64_32 relocations are
used against preemptible symbol and output is position independent,
error should be generated.

Differential revision: http://reviews.llvm.org/D18190

llvm-svn: 264707

8 years agofix CHECK_NOT -> CHECK-NOT
Junmo Park [Tue, 29 Mar 2016 07:53:07 +0000 (07:53 +0000)]
fix CHECK_NOT -> CHECK-NOT

llvm-svn: 264706

8 years agoRevert "[ScopInfo] Fix domains after loops."
Michael Kruse [Tue, 29 Mar 2016 07:50:52 +0000 (07:50 +0000)]
Revert "[ScopInfo] Fix domains after loops."

This reverts commit r264118. The approach is still under discussion.

llvm-svn: 264705

8 years agofixed typo - CHECK-LABEL
Junmo Park [Tue, 29 Mar 2016 07:03:27 +0000 (07:03 +0000)]
fixed typo - CHECK-LABEL

llvm-svn: 264704

8 years agoAdded 2 notes
Elena Demikhovsky [Tue, 29 Mar 2016 06:55:56 +0000 (06:55 +0000)]
Added 2 notes
1) Skylake and KNL support for X86
2) masked intrinsics load/store/gather/scatter

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

llvm-svn: 264703

8 years agofixed typo - CHECK-LABEL
Elena Demikhovsky [Tue, 29 Mar 2016 06:49:38 +0000 (06:49 +0000)]
fixed typo - CHECK-LABEL

llvm-svn: 264702

8 years agoAVX-512: fixed a bug in fp_to_uint pattern on KNL
Elena Demikhovsky [Tue, 29 Mar 2016 06:33:41 +0000 (06:33 +0000)]
AVX-512: fixed a bug in fp_to_uint pattern on KNL

Fixed fp_to_uint instruction selection on KNL.
One pattern was missing for <4 x double> to <4 x i32>

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

llvm-svn: 264701

8 years ago[OPENMP] Allow runtime insert its own code inside OpenMP regions.
Alexey Bataev [Tue, 29 Mar 2016 05:34:15 +0000 (05:34 +0000)]
[OPENMP] Allow runtime insert its own code inside OpenMP regions.

Solution unifies interface of RegionCodeGenTy type to allow insert
runtime-specific code before/after main codegen action defined in
CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy
for general OpenMP directives, but must be allowed to insert its own
 (required) code to support target specific codegen.

llvm-svn: 264700

8 years agoBitcodeReader: Allow METADATA_STRINGS to only have !""
Duncan P. N. Exon Smith [Tue, 29 Mar 2016 05:25:17 +0000 (05:25 +0000)]
BitcodeReader: Allow METADATA_STRINGS to only have !""

Support parsing a METADATA_STRINGS record that only has a single piece
of metadata, !"".  Fixes a corner case in r264551.

llvm-svn: 264699

8 years ago[LTO] Don't internalize if --export-dynamic is passed.
Davide Italiano [Tue, 29 Mar 2016 04:34:09 +0000 (04:34 +0000)]
[LTO] Don't internalize if --export-dynamic is passed.

We treat that in the same way we treat shared libraries.

llvm-svn: 264698

8 years ago[SimlifyCFG] Prevent passes from destroying canonical loop structure, especially...
Hyojin Sung [Tue, 29 Mar 2016 04:08:57 +0000 (04:08 +0000)]
[SimlifyCFG] Prevent passes from destroying canonical loop structure, especially for nested loops

When eliminating or merging almost empty basic blocks, the existence of non-trivial PHI nodes
is currently used to recognize potential loops of which the block is the header and keep the block.
However, the current algorithm fails if the loops' exit condition is evaluated only with volatile
values hence no PHI nodes in the header. Especially when such a loop is an outer loop of a nested
loop, the loop is collapsed into a single loop which prevent later optimizations from being
applied (e.g., transforming nested loops into simplified forms and loop vectorization).

The patch augments the existing PHI node-based check by adding a pre-test if the BB actually
belongs to a set of loop headers and not eliminating it if yes.

llvm-svn: 264697

8 years agoRegisterPressure: Simplify liveness tracking when lanemasks are not checked.
Matthias Braun [Tue, 29 Mar 2016 03:54:22 +0000 (03:54 +0000)]
RegisterPressure: Simplify liveness tracking when lanemasks are not checked.

Split RegisterOperands code that collects defs/uses into a variant with
and without lanemask tracking. This is a bit of code duplication, but
there are enough subtle differences between the two variants that this
seems cleaner (and potentially faster).

This also fixes a problem where lanes where tracked even though
TrackLaneMasks was false. This is part of the fix for
http://llvm.org/PR27106. I will commit the testcase when it is
completely fixed.

llvm-svn: 264696

8 years agoLiveVariables: Do not remove dead flags from vreg operands
Matthias Braun [Tue, 29 Mar 2016 03:08:18 +0000 (03:08 +0000)]
LiveVariables: Do not remove dead flags from vreg operands

Also add a FIXME comment on why Mips RDDSP causes bogus dead flags to be
added which LiveVariables cleans up by accident.

llvm-svn: 264695

8 years ago[clang-tidy] Add performance check to flag function parameters of expensive to copy...
Felix Berger [Tue, 29 Mar 2016 02:42:38 +0000 (02:42 +0000)]
[clang-tidy] Add performance check to flag function parameters of expensive to copy types that can be safely converted to const references.

Reviewers: alexfh

Subscribers: fowles, cfe-commits

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

llvm-svn: 264694

8 years ago[llvm-readobj] Support GNU style dyn-relocations
Hemant Kulkarni [Tue, 29 Mar 2016 02:41:49 +0000 (02:41 +0000)]
[llvm-readobj] Support GNU style dyn-relocations

http://reviews.llvm.org/D18534

llvm-svn: 264693

8 years agoRevert r264961. I didn't have asserts enable when testing.
Davide Italiano [Tue, 29 Mar 2016 02:20:10 +0000 (02:20 +0000)]
Revert r264961. I didn't have asserts enable when testing.

llvm-svn: 264692

8 years ago[LTO] Include bitcode symbol name in unreachable messages.
Davide Italiano [Tue, 29 Mar 2016 01:40:07 +0000 (01:40 +0000)]
[LTO] Include bitcode symbol name in unreachable messages.

llvm-svn: 264691

8 years ago[PowerPC] Refactor popcnt[dw] target features
Hal Finkel [Tue, 29 Mar 2016 01:36:01 +0000 (01:36 +0000)]
[PowerPC] Refactor popcnt[dw] target features

Instead of using two feature bits, one to indicate the availability of the
popcnt[dw] instructions, and another to indicate whether or not they're fast,
use a single enum. This allows more consistent control via target attribute
strings, and via Clang's command line.

llvm-svn: 264690

8 years ago[Codegen] Decrease minimum jump table density.
Kyle Butt [Tue, 29 Mar 2016 00:23:41 +0000 (00:23 +0000)]
[Codegen] Decrease minimum jump table density.

Minimum density for both optsize and non optsize are now options
-sparse-jump-table-density (default 10) for non optsize functions
-dense-jump-table-density (default 40) for optsize functions, which
matches the current default. This improves several benchmarks at google
at the cost of a small codesize increase. For code compiled with -Os,
the old behavior continues

llvm-svn: 264689

8 years ago[LTO] Include in .symtab/.dynsym symbols introduced by optimizations.
Davide Italiano [Tue, 29 Mar 2016 00:15:52 +0000 (00:15 +0000)]
[LTO] Include in .symtab/.dynsym symbols introduced by optimizations.

Some optimizations, e.g. SimplifyLibCalls, can replace functions with
others as part of the lowering, e.g. printf => puts.
The new symbols don't have the isUsedInRegularObj flag set so they
don't get included in the final symbol table (and dynamic symbol
table), and the dynamic linker gets confused. Include  them as a fix.

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

llvm-svn: 264688

8 years ago[analyzer] Use BodyFarm-synthesized body even when actual body available.
Devin Coughlin [Mon, 28 Mar 2016 23:55:58 +0000 (23:55 +0000)]
[analyzer] Use BodyFarm-synthesized body even when actual body available.

Change body autosynthesis to use the BodyFarm-synthesized body even when
an actual body exists. This enables the analyzer to use the simpler,
analyzer-provided body to model the behavior of the function rather than trying
to understand the actual body. Further, this makes the analyzer robust against
changes in headers that expose the implementations of those bodies.

rdar://problem/25145950

llvm-svn: 264687

8 years agoSample profile summary cleanup
Easwaran Raman [Mon, 28 Mar 2016 23:14:29 +0000 (23:14 +0000)]
Sample profile summary cleanup

Replace references to MaxHeadSamples with MaxFunctionCount

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

llvm-svn: 264686

8 years agoMove some functions from DWARFASTParserClang to ClangASTImporter.
Zachary Turner [Mon, 28 Mar 2016 22:53:41 +0000 (22:53 +0000)]
Move some functions from DWARFASTParserClang to ClangASTImporter.

This allows these functions to be re-used by a forthcoming
PDBASTParser.  The functions in question are CanCompleteType,
CompleteType, and CanImport.  Conceptually, these functions belong
on ClangASTImporter anyway, and previously they were just ping
ponging around through a few levels of indirection to end up there
as well, so this patch actually makes the code somewhat simpler.

A few methods were moved to a new file called ClangUtil, so that
they can be shared between ClangASTImporter and ClangASTContext
without creating a circular dependency between those two cpp
files.

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

llvm-svn: 264685

8 years ago[WebAssembly] Remove duplicate disabling of passes
Derek Schuff [Mon, 28 Mar 2016 22:52:20 +0000 (22:52 +0000)]
[WebAssembly] Remove duplicate disabling of passes

Also put all the disabled passes together

llvm-svn: 264684

8 years ago[PowerPC] Clarify a comment in PPCTTI about vector loads
Hal Finkel [Mon, 28 Mar 2016 22:39:35 +0000 (22:39 +0000)]
[PowerPC] Clarify a comment in PPCTTI about vector loads

This should say that we could do unaligned vector loads on the P7 using VSX
instructions, not that we should.

llvm-svn: 264683

8 years ago[libprofile] Use one fewer -mllvm option in this test.
Sean Silva [Mon, 28 Mar 2016 22:23:03 +0000 (22:23 +0000)]
[libprofile] Use one fewer -mllvm option in this test.

AFAIK there is still no way to avoid `-mllvm -disable-vp=false`
currently.

llvm-svn: 264682

8 years ago[PGO] More comments how function pointers for indirect calls are mapped
Adam Nemet [Mon, 28 Mar 2016 22:18:53 +0000 (22:18 +0000)]
[PGO] More comments how function pointers for indirect calls are mapped
to function names

Summary:
Hopefully this will make it easier for the next person to figure all
this out...

Reviewers: bogner, davidxl

Subscribers: davidxl, cfe-commits

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

llvm-svn: 264681

8 years ago[PGO] More comments how function pointers for indirect calls are mapped
Adam Nemet [Mon, 28 Mar 2016 22:16:29 +0000 (22:16 +0000)]
[PGO] More comments how function pointers for indirect calls are mapped
to function names

Summary:
Hopefully this will make it easier for the next person to figure all
this out...

Reviewers: bogner, davidxl

Subscribers: davidxl, cfe-commits

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

llvm-svn: 264680

8 years ago[docs] Corrections w.r.t V2 of the coverage mapping format
Vedant Kumar [Mon, 28 Mar 2016 22:16:01 +0000 (22:16 +0000)]
[docs] Corrections w.r.t V2 of the coverage mapping format

llvm-svn: 264679

8 years ago[PGO] More comments how function pointers for indirect calls are mapped
Adam Nemet [Mon, 28 Mar 2016 22:15:15 +0000 (22:15 +0000)]
[PGO] More comments how function pointers for indirect calls are mapped
to function names

Summary:
Hopefully this will make it easier for the next person to figure all
this out...

Reviewers: bogner, davidxl

Subscribers: davidxl, cfe-commits

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

llvm-svn: 264678

8 years agoregenerate checks
Sanjay Patel [Mon, 28 Mar 2016 22:12:21 +0000 (22:12 +0000)]
regenerate checks

llvm-svn: 264677

8 years agofix checks: *_DAG -> *-DAG
Sanjay Patel [Mon, 28 Mar 2016 22:11:06 +0000 (22:11 +0000)]
fix checks: *_DAG -> *-DAG

llvm-svn: 264676

8 years ago[Coverage] Fix the expected counts in instrprof-comdat.h
Vedant Kumar [Mon, 28 Mar 2016 22:10:40 +0000 (22:10 +0000)]
[Coverage] Fix the expected counts in instrprof-comdat.h

llvm-svn: 264675

8 years agofix CHECK_NEXT -> CHECK-NEXT
Sanjay Patel [Mon, 28 Mar 2016 22:03:07 +0000 (22:03 +0000)]
fix CHECK_NEXT -> CHECK-NEXT

llvm-svn: 264674

8 years agofix CHECK_DAG -> CHECK-DAG
Sanjay Patel [Mon, 28 Mar 2016 22:00:38 +0000 (22:00 +0000)]
fix CHECK_DAG -> CHECK-DAG

llvm-svn: 264673

8 years agofix CHECK_NEXT -> CHECK-NEXT
Sanjay Patel [Mon, 28 Mar 2016 21:58:27 +0000 (21:58 +0000)]
fix CHECK_NEXT -> CHECK-NEXT

llvm-svn: 264672

8 years agofix CHECK_LABEL -> CHECK-LABEL
Sanjay Patel [Mon, 28 Mar 2016 21:56:48 +0000 (21:56 +0000)]
fix CHECK_LABEL -> CHECK-LABEL

llvm-svn: 264671

8 years agotrailing whitespace
Sanjay Patel [Mon, 28 Mar 2016 21:52:53 +0000 (21:52 +0000)]
trailing whitespace

llvm-svn: 264670

8 years agoImprovements to the ASTImporter to support LLDB top-level Clang expressions.
Sean Callanan [Mon, 28 Mar 2016 21:43:01 +0000 (21:43 +0000)]
Improvements to the ASTImporter to support LLDB top-level Clang expressions.

The testcase for this is in LLDB, adeed by r264662.

This patch adds support for a variety of new expression types to the AST
importer, mostly related to C++.  It also adds support for importing lambdas
correctly, and adds support for importing the attributes attached to any Decl.

Finally, the patch adds a new templated function to ASTNodeImporter that imports
arbitrary arrays of importable things into a bump-allocated array attached to
getToContext().  This is a pattern we see at many places in ASTNodeImporter;
rather than do it slightly differently at each point, this function does it one
way.

<rdar://problem/22864976>

llvm-svn: 264669

8 years agoMove use of scoped enum in MachineFunctionProperties after its declaration
Derek Schuff [Mon, 28 Mar 2016 21:38:35 +0000 (21:38 +0000)]
Move use of scoped enum in MachineFunctionProperties after its declaration

This should fix the build with MSVC 2013

llvm-svn: 264668

8 years agoRemove personality for declarations in CloneModule.
Evgeniy Stepanov [Mon, 28 Mar 2016 21:37:02 +0000 (21:37 +0000)]
Remove personality for declarations in CloneModule.

Personality is copied as part of copyFunctionAttributes, but it is
invalid on a declaration. Remove the personality attribute it the
function body is not cloned.

Also add a verifier run over output modules in the llvm-split tool.

llvm-svn: 264667

8 years ago[X86][SSE] Vectorize a bit (AND/XOR/OR) op if a BUILD_VECTOR has the same op for...
Simon Pilgrim [Mon, 28 Mar 2016 21:33:52 +0000 (21:33 +0000)]
[X86][SSE] Vectorize a bit (AND/XOR/OR) op if a BUILD_VECTOR has the same op for all their scalar elements.

If all a BUILD_VECTOR's source elements are the same bit (AND/XOR/OR) operation type and each has one constant operand, lower to a pair of BUILD_VECTOR and just apply the bit operation to the vectors.

The constant operands will form a constant vector meaning that we still only have a single BUILD_VECTOR to lower and we will have replaced all the scalarized operations with a single SSE equivalent.

Its not in our interest to start make a general purpose vectorizer from this, but I'm seeing enough of these scalar bit operations from the later legalization/scalarization stages to support them at least.

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

llvm-svn: 264666

8 years ago[libprofile] Handle '\\' in __llvm_profile_recursive_mkdir
Sean Silva [Mon, 28 Mar 2016 21:32:46 +0000 (21:32 +0000)]
[libprofile] Handle '\\' in __llvm_profile_recursive_mkdir

This is implicitly needed at least by gcc-flag-compatibility.test

The thing that needs it is the `\` preceding the "default.profraw"
appended internally by clang when doing `-fprofile-use=`.

Clang uses `\` because is uses sys::path::append which will use `\` on a
Windows host. This is wrong, but I don't think there's an easy way to
solve it (maybe just always using `/` since places that accept `\` also
tend to accept `/`, but not the other way around).

llvm-svn: 264665

8 years ago[modules] If both a module file and a module map for the same module are
Richard Smith [Mon, 28 Mar 2016 21:31:09 +0000 (21:31 +0000)]
[modules] If both a module file and a module map for the same module are
explicitly provided, and the module map lists a header that does not exist,
unmark the module as 'unavailable' when loading its .pcm file. (Use of the
module might still fail if the relevant headers aren't embedded, but this
behavior is now consistent with how we behave if the module map is not
provided, and with the desired behavior for embedding headers in modules.)

llvm-svn: 264664

8 years agodocs: Fix footnote after r260042.
Nico Weber [Mon, 28 Mar 2016 21:24:46 +0000 (21:24 +0000)]
docs: Fix footnote after r260042.

r260042 removed a footnote referring to autoconf, but it left
around one item still referring to that footnote (libtool), and
it didn't renumber the later footnote reference.

llvm-svn: 264663

8 years agoExpose top-level Clang expressions via the command line and the API.
Sean Callanan [Mon, 28 Mar 2016 21:20:05 +0000 (21:20 +0000)]
Expose top-level Clang expressions via the command line and the API.

Top-level Clang expressions are expressions that act as new translation units,
and define their own symbols.  They do not have function wrappers like regular
expressions do, and declarations are persistent regardless of use of the dollar
sign in identifiers.  Names defined by these are given priority over all other
symbol lookups.

This patch adds a new expression option, '-p' or '--top-level,' which controls
whether the expression is treated this way.  It also adds a flag controlling
this to SBExpressionOptions so that this API is usable externally.  It also adds
a test that validates that this works.  (The test requires a fix to the Clang
AST importer which I will be committing shortly.)

<rdar://problem/22864976>

llvm-svn: 264662

8 years agofix CHECK_NEXT -> CHECK-NEXT
Sanjay Patel [Mon, 28 Mar 2016 21:14:24 +0000 (21:14 +0000)]
fix CHECK_NEXT -> CHECK-NEXT

llvm-svn: 264661

8 years agoDon't try to actually run code when the expression is top-level.
Sean Callanan [Mon, 28 Mar 2016 21:10:36 +0000 (21:10 +0000)]
Don't try to actually run code when the expression is top-level.

llvm-svn: 264660

8 years agoRemoved an override of LookupSymbol that mistakenly disabled it for Clang.
Sean Callanan [Mon, 28 Mar 2016 21:07:53 +0000 (21:07 +0000)]
Removed an override of LookupSymbol that mistakenly disabled it for Clang.

llvm-svn: 264659

8 years agoReapply (2x) "[PGO] Fix name encoding for ObjC-like functions"
Vedant Kumar [Mon, 28 Mar 2016 21:06:42 +0000 (21:06 +0000)]
Reapply (2x) "[PGO] Fix name encoding for ObjC-like functions"

Function names in ObjC can have spaces in them. This interacts poorly
with name compression, which uses spaces to separate PGO names. Fix the
issue by using a different separator and update a test.

I chose "\01" as the separator because 1) it's non-printable, 2) we
strip it from PGO names, and 3) it's the next natural choice once "\00"
is discarded (that one's overloaded).

What's changed since the original commit?

- I fixed up the covmap-V2 binary format tests using a linux VM.
- I weakened the CHECK lines in instrprof-comdat.h to account for the
  fact that there have been bugfixes to clang coverage. These will be
  fixed up in a follow-up.
- I added an assert to make sure we don't get bitten by this again.
- I constructed the c-general.profraw file without name compression
  enabled to appease some bots.

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

llvm-svn: 264658

8 years agoAdd an IR Verifier check for orphaned DICompileUnits.
Adrian Prantl [Mon, 28 Mar 2016 21:06:26 +0000 (21:06 +0000)]
Add an IR Verifier check for orphaned DICompileUnits.
A DICompileUnit that is not listed in llvm.dbg.cu will cause assertion
failures and/or crashes in the backend. The Verifier should reject this.

rdar://problem/25369499

llvm-svn: 264657

8 years ago[LVers] Change CHECK_LABEL to CHECK-LABEL (underscore->dash)
Adam Nemet [Mon, 28 Mar 2016 21:04:13 +0000 (21:04 +0000)]
[LVers] Change CHECK_LABEL to CHECK-LABEL (underscore->dash)

Thanks to Sanjoy for catching this.

llvm-svn: 264656

8 years ago[lanai] Add Lanai backend to clang driver.
Jacques Pienaar [Mon, 28 Mar 2016 21:02:54 +0000 (21:02 +0000)]
[lanai] Add Lanai backend to clang driver.

Changes to clang to add Lanai backend. Adds a new target, ABI and toolchain.

General Lanai backend discussion on llvm-dev thread "[RFC] Lanai backend" (http://lists.llvm.org/pipermail/llvm-dev/2016-February/095118.html).

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

llvm-svn: 264655

8 years agodocs: Try to remove weird linebreak from generated html.
Nico Weber [Mon, 28 Mar 2016 21:00:21 +0000 (21:00 +0000)]
docs: Try to remove weird linebreak from generated html.

llvm-svn: 264654