platform/upstream/llvm.git
8 years agoReland "[CodeView] Use assembler directives for line tables"
Reid Kleckner [Fri, 29 Jan 2016 00:49:42 +0000 (00:49 +0000)]
Reland "[CodeView] Use assembler directives for line tables"

This reverts commit r259126 and relands r259117.

This time with updated library dependencies.

llvm-svn: 259130

8 years ago[RS4GC] Clamp UseDeoptBundles to true and update tests
Sanjoy Das [Fri, 29 Jan 2016 00:28:57 +0000 (00:28 +0000)]
[RS4GC] Clamp UseDeoptBundles to true and update tests

The full diff for the test directory may be hard to read because of the
filename clash; so here's all that happened as far as the tests are
concerned:

```
cd test/Transforms/RewriteStatepointsForGC
git rm *ll
git mv deopt-bundles/* ./
rmdir deopt-bundles
find . -name '*.ll' | xargs gsed -i 's/-rs4gc-use-deopt-bundles //g'
```

llvm-svn: 259129

8 years agoRename isTlsOptimized -> canRelaxTls.
Rui Ueyama [Fri, 29 Jan 2016 00:20:12 +0000 (00:20 +0000)]
Rename isTlsOptimized -> canRelaxTls.

This function is a predicate that a given relocation can be relaxed.
The previous name implied that it returns true if a given relocation
has already been optimized away.

llvm-svn: 259128

8 years agoUpdate comments.
Rui Ueyama [Fri, 29 Jan 2016 00:20:09 +0000 (00:20 +0000)]
Update comments.

llvm-svn: 259127

8 years agoRevert "[CodeView] Use assembler directives for line tables"
Reid Kleckner [Fri, 29 Jan 2016 00:13:28 +0000 (00:13 +0000)]
Revert "[CodeView] Use assembler directives for line tables"

This reverts commit r259117.

The LineInfo constructor is defined in the codeview library and we have
to link against it now. Doing that isn't trivial, so reverting for now.

llvm-svn: 259126

8 years ago[RS4GC] Port three tests to the deopt bundles directory
Sanjoy Das [Fri, 29 Jan 2016 00:13:26 +0000 (00:13 +0000)]
[RS4GC] Port three tests to the deopt bundles directory

two-invokes-one-landingpad.ll was only moved (and not "ported"), but
having everything in the `deopt-bundles` directory will make later
changes more obvious.

llvm-svn: 259125

8 years agoAdd missing raw_ostream include
Reid Kleckner [Fri, 29 Jan 2016 00:03:34 +0000 (00:03 +0000)]
Add missing raw_ostream include

Prior to r259115 this was coming via LTOModule.h and MCContext.h.

Apparently this target is not built by 'check'. =(

llvm-svn: 259124

8 years agoSilence gcc warning about ternary and enumerations
Reid Kleckner [Thu, 28 Jan 2016 23:59:35 +0000 (23:59 +0000)]
Silence gcc warning about ternary and enumerations

llvm-svn: 259123

8 years ago[CUDA] Generate CUDA's printf alloca in its function's entry block.
Justin Lebar [Thu, 28 Jan 2016 23:58:28 +0000 (23:58 +0000)]
[CUDA] Generate CUDA's printf alloca in its function's entry block.

Summary:
This is necessary to prevent llvm from generating stacksave intrinsics
around this alloca.  NVVM doesn't have a stack, and we don't handle said
intrinsics.

Reviewers: rnk, echristo

Subscribers: cfe-commits, jhen, tra

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

llvm-svn: 259122

8 years ago[PlaceSafepoints] Use DEBUG() instead of TraceLSP
Sanjoy Das [Thu, 28 Jan 2016 23:49:27 +0000 (23:49 +0000)]
[PlaceSafepoints] Use DEBUG() instead of TraceLSP

DEBUG() is the more idiomatic LLVM style.

llvm-svn: 259121

8 years agoLower inlining threshold when the caller has minsize attribute.
Easwaran Raman [Thu, 28 Jan 2016 23:44:41 +0000 (23:44 +0000)]
Lower inlining threshold when the caller has minsize attribute.

When the caller has optsize attribute, we reduce the inlinining threshold
to OptSizeThreshold (=75) if it is not already lower than that. We don't do
the same for minsize and I suspect it was not intentional. This also addresses
a FIXME regarding checking optsize attribute explicitly instead of using the
right wrapper.

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

llvm-svn: 259120

8 years agoClass Property: change PropertyMap to include isClassProperty.
Manman Ren [Thu, 28 Jan 2016 23:36:05 +0000 (23:36 +0000)]
Class Property: change PropertyMap to include isClassProperty.

PropertyMap used to map IdentifierInfo (name of the property) to
ObjcPropertyDecl *. Now that a class property can have the same name as
an instance property, we change PropertyMap to map a pair <IdentifierInfo *,
unsigned> to ObjcPropertyDecl *.

Also update a few places from iterating over instance_properties to
iterating over all properties.

rdar://23891898

llvm-svn: 259119

8 years ago[analyzer] NullabilityChecker: Remove unused isReturnSelf() function.
Devin Coughlin [Thu, 28 Jan 2016 23:34:13 +0000 (23:34 +0000)]
[analyzer] NullabilityChecker: Remove unused isReturnSelf() function.

Remove the now-unused isReturnSelf() function so we don't get a compiler
warning. Apologies for not doing this in r259099.

llvm-svn: 259118

8 years ago[CodeView] Use assembler directives for line tables
Reid Kleckner [Thu, 28 Jan 2016 23:31:52 +0000 (23:31 +0000)]
[CodeView] Use assembler directives for line tables

Adds a new family of .cv_* directives to LLVM's variant of GAS syntax:

- .cv_file: Similar to DWARF .file directives

- .cv_loc: Similar to the DWARF .loc directive, but starts with a
  function id. CodeView line tables are emitted by function instead of
  by compilation unit, so we needed an extra field to communicate this.
  Rather than overloading the .loc direction further, we decided it was
  better to have our own directive.

- .cv_stringtable: Emits the codeview string table at the current
  position. Currently this just contains the filenames as
  null-terminated strings.

- .cv_filechecksums: Emits the file checksum table for all files used
  with .cv_file so far. There is currently no support for emitting
  actual checksums, just filenames.

This moves the line table emission code down into the assembler.  This
is in preparation for implementing the inlined call site line table
format. The inline line table format encoding algorithm requires knowing
the absolute code offsets, so it must run after the assembler has laid
out the code.

David Majnemer collaborated on this patch.

llvm-svn: 259117

8 years agoCheck for frontend errors after releasing the Builder.
Manman Ren [Thu, 28 Jan 2016 23:29:02 +0000 (23:29 +0000)]
Check for frontend errors after releasing the Builder.

Frontend can emit errors when releaseing the Builder. If there are errors before
or when releasing the Builder, we reset the module to stop here before invoking
the backend.

Before this commit, clang will continue to invoke the backend and backend can
crash.

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

llvm-svn: 259116

8 years agoRemove unused MC includes from LTOModule.h
Reid Kleckner [Thu, 28 Jan 2016 23:21:12 +0000 (23:21 +0000)]
Remove unused MC includes from LTOModule.h

llvm-svn: 259115

8 years agofix up missing header from change r259084.
Todd Fiala [Thu, 28 Jan 2016 23:17:53 +0000 (23:17 +0000)]
fix up missing header from change r259084.

llvm-svn: 259114

8 years agoFix task dependency performance problem
Jonathan Peyton [Thu, 28 Jan 2016 23:10:44 +0000 (23:10 +0000)]
Fix task dependency performance problem

In: http://lists.llvm.org/pipermail/openmp-dev/2015-August/000858.html, a
performance issue was found with libomp's task dependencies.  The task
dependencies hash table has an issue with collisions. The current table size is
a power of two. This combined with the current hash function causes a large
number of collisions to occurr. Also, the current size (64) is too small for
larger applications so the table size is increased.

This patch creates a two level hash table approach for task dependencies. The
implicit task is considered the "master" or "top-level" task which has a large
static sized hash table (997), and nested tasks will have smaller hash
tables (97). Prime numbers were chosen to help reduce collisions.

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

llvm-svn: 259113

8 years ago[PlaceSafepoints] Misc. minor cleanups; NFC
Sanjoy Das [Thu, 28 Jan 2016 23:03:19 +0000 (23:03 +0000)]
[PlaceSafepoints] Misc. minor cleanups; NFC

These changes are aimed at bringing PlaceSafepoints up to code with the
LLVM coding guidelines:

 - Fix variable naming
 - Use DenseSet instead of std::set
 - Remove dead code
 - Minor local code simplifications

llvm-svn: 259112

8 years ago[PlaceSafepoints] Remvoe unused headers, and sort #includes; NFC
Sanjoy Das [Thu, 28 Jan 2016 23:03:17 +0000 (23:03 +0000)]
[PlaceSafepoints] Remvoe unused headers, and sort #includes; NFC

llvm-svn: 259111

8 years ago[PlaceSafepoints] Eliminate dead code; NFC
Sanjoy Das [Thu, 28 Jan 2016 23:03:14 +0000 (23:03 +0000)]
[PlaceSafepoints] Eliminate dead code; NFC

Now that NoStatepoints is a constant `true`, we can get rid of a bunch
of dead code.

llvm-svn: 259110

8 years agoUpdate for llvm change.
Rafael Espindola [Thu, 28 Jan 2016 22:56:41 +0000 (22:56 +0000)]
Update for llvm change.

llvm-svn: 259108

8 years agoELF: Report more than one undefined symbols if exist.
Rui Ueyama [Thu, 28 Jan 2016 22:56:29 +0000 (22:56 +0000)]
ELF: Report more than one undefined symbols if exist.

http://reviews.llvm.org/D16643

llvm-svn: 259107

8 years agoDon't mention a command line option in an error.
Rafael Espindola [Thu, 28 Jan 2016 22:55:45 +0000 (22:55 +0000)]
Don't mention a command line option in an error.

The program using this code may not have it.

Patch by Wilfred Hughes.

llvm-svn: 259106

8 years ago[RuntimeDyld][MachO] Fix handling of empty eh-frame sections.
Lang Hames [Thu, 28 Jan 2016 22:35:48 +0000 (22:35 +0000)]
[RuntimeDyld][MachO] Fix handling of empty eh-frame sections.

This patch switches from an unguarded to a guarded loop for eh-frame record
fixups. In the unguarded version we would always make at least one call to
processFDE, which would then crash trying to fix up a frame that didn't exist.

Fixes <rdar://problem/24301582>

llvm-svn: 259103

8 years agoadd back an Xcode-specific Makefile for header installation
Todd Fiala [Thu, 28 Jan 2016 22:34:36 +0000 (22:34 +0000)]
add back an Xcode-specific Makefile for header installation

llvm-svn: 259102

8 years ago[X86][AVX] Added more thorough 256-bit vector consecutive load tests.
Simon Pilgrim [Thu, 28 Jan 2016 22:29:51 +0000 (22:29 +0000)]
[X86][AVX] Added more thorough 256-bit vector consecutive load tests.

llvm-svn: 259100

8 years ago[analyzer] Suppress nullability warnings in copy, mutableCopy, and init families.
Devin Coughlin [Thu, 28 Jan 2016 22:23:34 +0000 (22:23 +0000)]
[analyzer] Suppress nullability warnings in copy, mutableCopy, and init families.

There are multiple, common idioms of defensive nil-checks in copy,
mutableCopy, and init methods in ObjC. The analyzer doesn't currently have the
capability to distinguish these idioms from true positives, so suppress all
warnings about returns in those families. This is a pretty blunt suppression
that we should improve later.

rdar://problem/24395811

llvm-svn: 259099

8 years agoRemove autoconf support from source directories.
Eugene Zelenko [Thu, 28 Jan 2016 22:05:24 +0000 (22:05 +0000)]
Remove autoconf support from source directories.

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

llvm-svn: 259098

8 years ago[RS4GC] Change opt %s to opt < %s; NFC
Sanjoy Das [Thu, 28 Jan 2016 21:51:21 +0000 (21:51 +0000)]
[RS4GC] Change opt %s to opt < %s; NFC

This is as per http://llvm.org/docs/TestingGuide.html#fragile-tests.  I
didn't touch the tests outside deopt-bundles/ since they'll be gone
soon.

llvm-svn: 259097

8 years ago[PlaceSafepoints] Clamp NoStatepoints to true
Sanjoy Das [Thu, 28 Jan 2016 21:51:14 +0000 (21:51 +0000)]
[PlaceSafepoints] Clamp NoStatepoints to true

This change permanently clamps -spp-no-statepoints to true (the code
deletion will come later).  Tests that specifically tested
PlaceSafepoint's ability to wrap calls in gc.statepoint have been moved
to RS4GC's test suite.

llvm-svn: 259096

8 years agoImplementation of PS4 ABI, Round 1
Sunil Srivastava [Thu, 28 Jan 2016 21:36:31 +0000 (21:36 +0000)]
Implementation of PS4 ABI, Round 1
Added a test to safeguard linux ABI.

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

llvm-svn: 259095

8 years agoBring back the test-suite export in test-release without bringing back the build...
Daniel Sanders [Thu, 28 Jan 2016 21:09:50 +0000 (21:09 +0000)]
Bring back the test-suite export in test-release without bringing back the build failures.

Summary:
r257791 disabled the test-suite export since the addition of CMakeLists.txt was
causing build failures. This patch exports the test-suite again but does so
outside the source tree so that it isn't included in the Phase[123] builds.

Reviewers: hans

Subscribers: llvm-commits

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

llvm-svn: 259094

8 years agoRemove autoconf support.
Eugene Zelenko [Thu, 28 Jan 2016 21:00:21 +0000 (21:00 +0000)]
Remove autoconf support.

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

llvm-svn: 259091

8 years agoAMDGPU: Match fmed3 patterns with legacy fmin/fmax
Matt Arsenault [Thu, 28 Jan 2016 20:53:48 +0000 (20:53 +0000)]
AMDGPU: Match fmed3 patterns with legacy fmin/fmax

llvm-svn: 259090

8 years agoAMDGPU: Match some med3 patterns
Matt Arsenault [Thu, 28 Jan 2016 20:53:42 +0000 (20:53 +0000)]
AMDGPU: Match some med3 patterns

llvm-svn: 259089

8 years agoAMDGPU: Set DX10Clamp bit
Matt Arsenault [Thu, 28 Jan 2016 20:53:35 +0000 (20:53 +0000)]
AMDGPU: Set DX10Clamp bit

llvm-svn: 259088

8 years agoFixed compilation issue.
Elena Demikhovsky [Thu, 28 Jan 2016 20:36:46 +0000 (20:36 +0000)]
Fixed compilation issue.

llvm-svn: 259087

8 years agoFix build after rL259070.
Chaoren Lin [Thu, 28 Jan 2016 20:25:46 +0000 (20:25 +0000)]
Fix build after rL259070.

llvm-svn: 259086

8 years ago[cfi] Simplify the code in CfiSlowPathCommon.
Evgeniy Stepanov [Thu, 28 Jan 2016 19:58:26 +0000 (19:58 +0000)]
[cfi] Simplify the code in CfiSlowPathCommon.

llvm-svn: 259085

8 years agoUpdate lldb for API change in clang r259070.
Manman Ren [Thu, 28 Jan 2016 19:55:50 +0000 (19:55 +0000)]
Update lldb for API change in clang r259070.

llvm-svn: 259084

8 years agoadd masked intrinsic tests to show missed opportunities
Sanjay Patel [Thu, 28 Jan 2016 19:54:20 +0000 (19:54 +0000)]
add masked intrinsic tests to show missed opportunities

llvm-svn: 259083

8 years ago[cfi] Get rid of a fixed size buffer for the library path in test.
Evgeniy Stepanov [Thu, 28 Jan 2016 19:37:03 +0000 (19:37 +0000)]
[cfi] Get rid of a fixed size buffer for the library path in test.

llvm-svn: 259082

8 years agoInclude RecordDecls from anonymous unions in the AST.
Nico Weber [Thu, 28 Jan 2016 19:25:00 +0000 (19:25 +0000)]
Include RecordDecls from anonymous unions in the AST.

For

  void f() {
    union { int i; };
  }

clang used to omit the RecordDecl from the anonymous union from the AST.
That's because the code creating it only called PushOnScopeChains(), which adds
it to the current DeclContext, which here is the function's DeclContext. But
RecursiveASTVisitor doesn't descent into all decls in a FunctionDecl.

Instead, for DeclContexts that contain statements, return the RecordDecl so
that it can be included in the DeclStmt containing the VarDecl for the union.

Interesting bits from the AST before this change:

|-FunctionDecl
| `-CompoundStmt
|   |-DeclStmt
|   | `-VarDecl 0x589cd60 <col:3> col:3 implicit used 'union (anonymous at test.cc:3:3)' callinit

After this change:

-FunctionDecl
| `-CompoundStmt
|   |-DeclStmt
|   | |-CXXRecordDecl 0x4612e48 <col:3, col:18> col:3 union definition
|   | | |-FieldDecl 0x4612f70 <col:11, col:15> col:15 referenced i 'int'
|   | `-VarDecl 0x4613010 <col:3> col:3 implicit used 'union (anonymous at test.cc:3:3)' callinit

This is now closer to how anonymous struct and unions are represented as
members of structs.  It also enabled deleting some one-off code in the
template instantiation code.

Finally, it fixes a crash with ASTMatchers, see the included test case
(this fixes http://crbug.com/580749).

llvm-svn: 259079

8 years agoFix an issue where the type <formatter> list command would not accept a valid argumen...
Enrico Granata [Thu, 28 Jan 2016 19:21:38 +0000 (19:21 +0000)]
Fix an issue where the type <formatter> list command would not accept a valid argument and instead error out complaining about a malformed regex

rdar://problem/24380025

llvm-svn: 259078

8 years agoRemove unused parameter.
Nico Weber [Thu, 28 Jan 2016 19:12:32 +0000 (19:12 +0000)]
Remove unused parameter.

llvm-svn: 259077

8 years ago[SplitModule] In split module utility we should never separate alias with its aliasee.
Sergei Larin [Thu, 28 Jan 2016 18:59:28 +0000 (18:59 +0000)]
[SplitModule] In split module utility we should never separate alias with its aliasee.

Summary: When splitting module with preserving locals, we currently do not handle case of global alias being separated with its aliasee.

Subscribers: llvm-commits

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

llvm-svn: 259075

8 years agoAddress buildbot fallout from r259065
David Majnemer [Thu, 28 Jan 2016 18:59:04 +0000 (18:59 +0000)]
Address buildbot fallout from r259065

llvm-svn: 259074

8 years agoClass Property: class property and instance property can have the same name.
Manman Ren [Thu, 28 Jan 2016 18:49:28 +0000 (18:49 +0000)]
Class Property: class property and instance property can have the same name.

Add "enum ObjCPropertyQueryKind" to a few APIs that used to only take the name
of the property: ObjCPropertyDecl::findPropertyDecl,
ObjCContainerDecl::FindPropertyDeclaration,
ObjCInterfaceDecl::FindPropertyVisibleInPrimaryClass,
ObjCImplDecl::FindPropertyImplDecl, and Sema::ActOnPropertyImplDecl.

ObjCPropertyQueryKind currently has 3 values:
OBJC_PR_query_unknown, OBJC_PR_query_instance, OBJC_PR_query_class

This extra parameter specifies that we are looking for an instance property with
the given name, or a class property with the given name, or any property with
the given name (if both exist, the instance property will be returned).

rdar://23891898

llvm-svn: 259070

8 years agoELF: Rename error -> fatal and redefine error as a non-noreturn function.
Rui Ueyama [Thu, 28 Jan 2016 18:40:06 +0000 (18:40 +0000)]
ELF: Rename error -> fatal and redefine error as a non-noreturn function.

In many situations, we don't want to exit at the first error even in the
process model. For example, it is better to report all undefined symbols
rather than reporting the first one that the linker picked up randomly.

In order to handle such errors, we don't need to wrap everything with
ErrorOr (thanks for David Blaikie for pointing this out!) Instead, we
can set a flag to record the fact that we found an error and keep it
going until it reaches a reasonable checkpoint.

This idea should be applicable to other places. For example, we can
ignore broken relocations and check for errors after visiting all relocs.

In this patch, I rename error to fatal, and introduce another version of
error which doesn't call exit. That function instead sets HasError to true.
Once HasError becomes true, it stays true, so that we know that there
was an error if it is true.

I think introducing a non-noreturn error reporting function is by itself
a good idea, and it looks to me that this also provides a gradual path
towards lld-as-a-library (or at least embed-lld-to-your-program) without
sacrificing code readability with lots of ErrorOr's.

http://reviews.llvm.org/D16641

llvm-svn: 259069

8 years agoMinor cleanup /NFC
Xinliang David Li [Thu, 28 Jan 2016 18:37:43 +0000 (18:37 +0000)]
Minor cleanup /NFC

llvm-svn: 259068

8 years ago[PGO] test case cleanups
Xinliang David Li [Thu, 28 Jan 2016 18:25:53 +0000 (18:25 +0000)]
[PGO] test case cleanups

1. Make test case more focused and robust by focusing on what to be tested (linkage, icall) -- make it easier to validate
2. Testing linkages of data and counter variables instead of names. Counters and data are more relavant to be tested.

llvm-svn: 259067

8 years ago[X86] Don't transform X << 1 to X + X during type legalization
David Majnemer [Thu, 28 Jan 2016 18:20:05 +0000 (18:20 +0000)]
[X86] Don't transform X << 1 to X + X during type legalization

While legalizing a 64-bit shift left by 1, the following occurs:

We split the shift operand in half: a high half and a low half.
We then create an ADDC with the low half and a ADDE with the high half +
the carry bit from the ADDC.

This is problematic if X is any_ext'd because the high half computation
is now undef + undef + carry bit and there is no way to ensure that the
two undef values had the same bitwise representation.  This results in
the lowest bit in the high half turning into garbage.

Instead, do not try to turn shifts into arithmetic during type
legalization.

This fixes PR26350.

llvm-svn: 259065

8 years agoFix strange indent.
Nico Weber [Thu, 28 Jan 2016 18:06:31 +0000 (18:06 +0000)]
Fix strange indent.

llvm-svn: 259063

8 years ago[PlaceSafepoints] Clean up tests; NFC
Sanjoy Das [Thu, 28 Jan 2016 18:01:03 +0000 (18:01 +0000)]
[PlaceSafepoints] Clean up tests; NFC

Use `opt < %s` instead of `opt %s` as specified in
http://llvm.org/docs/TestingGuide.html#fragile-tests.

llvm-svn: 259062

8 years ago[Coverage] Use a set to track visited FileIDs (NFC)
Vedant Kumar [Thu, 28 Jan 2016 17:52:18 +0000 (17:52 +0000)]
[Coverage] Use a set to track visited FileIDs (NFC)

llvm-svn: 259061

8 years agoMake header self-contained.
Benjamin Kramer [Thu, 28 Jan 2016 17:48:29 +0000 (17:48 +0000)]
Make header self-contained.

llvm-svn: 259060

8 years agoAMDGPU: waitcnt operand fixes
Tom Stellard [Thu, 28 Jan 2016 17:13:44 +0000 (17:13 +0000)]
AMDGPU: waitcnt operand fixes

Summary:
Allow lgkmcnt up to 0xF (hardware allows that).
Fix mask for ExpCnt in AMDGPUInstPrinter.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

Patch by: Nikolay Haustov

llvm-svn: 259059

8 years ago[X86] Test commit, fixed typos in comments. NFC.
Mitch Bodart [Thu, 28 Jan 2016 16:40:51 +0000 (16:40 +0000)]
[X86] Test commit, fixed typos in comments.  NFC.

llvm-svn: 259057

8 years ago[Renderscript] Clang-format the renderscript plugin.
Aidan Dodds [Thu, 28 Jan 2016 16:39:44 +0000 (16:39 +0000)]
[Renderscript] Clang-format the renderscript plugin.

Run clang-format over the renderscript plugin and fix common formatting deviations.

llvm-svn: 259056

8 years ago[PlaceSafepoints] Minor test cleanup; NFC
Sanjoy Das [Thu, 28 Jan 2016 16:11:27 +0000 (16:11 +0000)]
[PlaceSafepoints] Minor test cleanup; NFC

There is no need to place quotes around some_call and
personality_function.

llvm-svn: 259055

8 years agoAMDGPU: Move subtarget specific code out of AMDGPUInstrInfo.cpp
Tom Stellard [Thu, 28 Jan 2016 16:04:37 +0000 (16:04 +0000)]
AMDGPU: Move subtarget specific code out of AMDGPUInstrInfo.cpp

Summary:
Also delete all the stub functions that are identical to the
implementations in TargetInstrInfo.cpp.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 259054

8 years ago[LICM] Keep metadata on control equivalent hoists
Sanjoy Das [Thu, 28 Jan 2016 15:51:58 +0000 (15:51 +0000)]
[LICM] Keep metadata on control equivalent hoists

Summary:
If the instruction we're hoisting out of a loop into its preheader is
guaranteed to have executed in the loop, then the metadata associated
with the instruction (e.g. !range or !dereferenceable) is valid in the
preheader.  This is because once we're in the preheader, we know we're
eventually going to reach the location the metadata was valid at.

This change makes LICM smarter around this, and helps it recognize cases
like these:

```
  do {
    int a = *ptr; !range !0
    ...
  } while (i++ < N);
```

to

```
  int a = *ptr; !range !0
  do {
    ...
  } while (i++ < N);
```

Earlier we'd drop the `!range` metadata after hoisting the load from
`ptr`.

Reviewers: igor-laevsky

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 259053

8 years ago[AArch64] Set MMOs on pre- and post-index instructions.
Chad Rosier [Thu, 28 Jan 2016 15:38:24 +0000 (15:38 +0000)]
[AArch64] Set MMOs on pre- and post-index instructions.

Without the MMOs the MI scheduler is unable to reason about the dependencies of
these instructions.

llvm-svn: 259052

8 years ago[x86] Merge multiple calls to DAG.getTargetLoweringInfo(). NFC.
Simon Pilgrim [Thu, 28 Jan 2016 15:29:11 +0000 (15:29 +0000)]
[x86] Merge multiple calls to DAG.getTargetLoweringInfo(). NFC.

llvm-svn: 259050

8 years agoImprove efficiency of handling unmapped subprogram metadata
Teresa Johnson [Thu, 28 Jan 2016 15:08:09 +0000 (15:08 +0000)]
Improve efficiency of handling unmapped subprogram metadata

The stripNullSubprograms function is very inefficient because
it walks all subprograms in all compile units in the dest module
any time a new module is linked in. For LTO in particular this will
get increasingly expensive as more modules are linked.

This patch improves the efficiency in several ways. The first is that
no scanning is necessary when there were no unneeded subprograms
identified in the first place. The second is that only the newly-linked
module's compile unit metadata should be examined.

Fixes PR26346.

llvm-svn: 259049

8 years ago[libcxx] Work around for clang calling GAS after having already failed.
Daniel Sanders [Thu, 28 Jan 2016 13:49:33 +0000 (13:49 +0000)]
[libcxx] Work around for clang calling GAS after having already failed.

Summary:
This is a workaround to a clang bug which causes libcxx tests to fail in the 3.8
release. The clang bug is currently being investigated. It seems that clang
does not stop after frontend errors when using -verify and -fno-integrated-as
(or when this is the default). This patch adds -fsyntax-only to prevent GAS
from being called, fixing the libcxx failures.

PR26277

Patch by Eric Fiselier

Reviewers: mclow.lists, hans, EricWF

Subscribers: cfe-commits

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

llvm-svn: 259046

8 years agoRevert r259035, it introduces a cyclic library dependency
Oliver Stannard [Thu, 28 Jan 2016 13:19:47 +0000 (13:19 +0000)]
Revert r259035, it introduces a cyclic library dependency

llvm-svn: 259045

8 years agoAVX512: Fix truncate v32i8 to v32i1 lowering implementation.
Igor Breger [Thu, 28 Jan 2016 13:19:25 +0000 (13:19 +0000)]
AVX512: Fix truncate v32i8 to v32i1 lowering implementation.
Enable truncate 128/256bit packed byte/word with AVX512BW but without AVX512VL, use 512bit instructions.

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

llvm-svn: 259044

8 years agoRevert r259036, it introduces a cyclic library dependency
Oliver Stannard [Thu, 28 Jan 2016 13:09:49 +0000 (13:09 +0000)]
Revert r259036, it introduces a cyclic library dependency

llvm-svn: 259043

8 years agoFix const cast error for MSVC2015 build.
Aidan Dodds [Thu, 28 Jan 2016 13:05:21 +0000 (13:05 +0000)]
Fix const cast error for MSVC2015 build.

The Visual Studio 2015 build was failing with the following error:
error C2440: 'initializing': cannot convert from 'const char [12]' to 'char *'

This should fix the problem by initializing a non const char array, instead of taking a pointer to const static data.

llvm-svn: 259042

8 years agoRemove autotools build system
Michael Kruse [Thu, 28 Jan 2016 12:00:33 +0000 (12:00 +0000)]
Remove autotools build system

The autotools build system is based on and requires LLVM's autotools
build system to work, which has been depricated and finally removed in
r258861. Consequently we also remove the autotools build system from
Polly.

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

llvm-svn: 259041

8 years agoUnbreak the wasm backend again after r259035.
Benjamin Kramer [Thu, 28 Jan 2016 11:26:34 +0000 (11:26 +0000)]
Unbreak the wasm backend again after r259035.

llvm-svn: 259040

8 years ago[mips][microMIPS] Disable FastISel for microMIPS
Zoran Jovanovic [Thu, 28 Jan 2016 11:08:03 +0000 (11:08 +0000)]
[mips][microMIPS] Disable FastISel for microMIPS

Author: milena.vujosevic.janicic
Reviewers: dsanders

FastIsel is not supported for microMIPS, thus it needs to be disabled.
Test micromips-zero-mat-uses.ll is deleted since the tested sequence of instructions is not generated for microMIPS without FastISel.
Differential Revision: http://reviews.llvm.org/D15892

llvm-svn: 259039

8 years ago[OMPT] Add support for ompt_event_task_dependences and ompt_event_task_dependence_pair
Jonas Hahnfeld [Thu, 28 Jan 2016 10:39:52 +0000 (10:39 +0000)]
[OMPT] Add support for ompt_event_task_dependences and ompt_event_task_dependence_pair

The attached patch adds support for ompt_event_task_dependences and
ompt_event_task_dependence_pair events from the OMPT specification [1]. These
events only apply to OpenMP 4.0 and 4.1 (aka 4.5) because task dependencies
were introduced in 4.0.

With respect to the changes:

ompt_event_task_dependences
According to the specification, this event is raised after the task has been
created, thefore this event needs to be raised after ompt_event_task_begin
(in __kmp_task_start). However, the dependencies are known at
__kmpc_omp_task_with_deps which occurs before __kmp_task_start. My modifications
extend the ompt_task_info_t struct in order to store the dependencies of the
task when _kmpc_omp_task_with_deps occurs and then they are emitted in
__kmp_task_start just after raising the ompt_event_task_begin. The deps field
is allocated and valid until the event is raised and it is freed and set
to null afterwards.

ompt_event_task_dependence_pair
The processing of the dependences (i.e. checking whenever a dependence is
already satisfied) is done within __kmp_process_deps. That function checks
every dependence and calls the __kmp_track_dependence routine which gives some
support for graphical output. I used that routine to emit the dependence pair
but I also needed to know the sink_task. Despite the fact that the code within
KMP_SUPPORT_GRAPH_OUTPUT refers to task_sink it may be null because
sink->dn.task (there's a comment regarding this) and in fact it does not point
to a proper pointer value because the value is set in node->dn.task = task;
after the __kmp_process_deps calls in __kmp_check_deps. I have extended the
__kmp_process_deps and __kmp_track_dependence parameter list to receive the
sink_task.

[1] https://github.com/OpenMPToolsInterface/OMPT-Technical-Report/blob/target/ompt-tr.pdf

Patch by Harald Servat
Differential Revision: http://reviews.llvm.org/D14746

llvm-svn: 259038

8 years ago[OMPT] Avoid SEGV when a worker thread needs its parallel id behind the barrier
Jonas Hahnfeld [Thu, 28 Jan 2016 10:39:45 +0000 (10:39 +0000)]
[OMPT] Avoid SEGV when a worker thread needs its parallel id behind the barrier

When the code behind the barrier is executed, the master thread may have
already resumed execution. That's why we cannot safely assume that *pteam
is not yet freed.

This has been introduced by r258866.

llvm-svn: 259037

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Thu, 28 Jan 2016 10:07:34 +0000 (10:07 +0000)]
Add backend dignostic printer for unsupported features

Re-commit of r258950 after fixing layering violation.

Add backend dignostic printer for unsupported features

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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

llvm-svn: 259036

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Thu, 28 Jan 2016 10:07:27 +0000 (10:07 +0000)]
Add backend dignostic printer for unsupported features

Re-commit of r258951 after fixing layering violation.

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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

llvm-svn: 259035

8 years ago[X86][SSE] Move setTargetShuffleZeroElements closer to getTargetShuffleMask. NFCI.
Simon Pilgrim [Thu, 28 Jan 2016 09:45:01 +0000 (09:45 +0000)]
[X86][SSE] Move setTargetShuffleZeroElements closer to getTargetShuffleMask. NFCI.

Keep target shuffle mask helper functions closer together.

llvm-svn: 259034

8 years agoMinor code cleanups. NFC.
Junmo Park [Thu, 28 Jan 2016 09:42:39 +0000 (09:42 +0000)]
Minor code cleanups. NFC.

llvm-svn: 259033

8 years agoFix isBeforeInTranslationUnit to not abort on macros defined in cmdline.
Yury Gribov [Thu, 28 Jan 2016 09:28:18 +0000 (09:28 +0000)]
Fix isBeforeInTranslationUnit to not abort on macros defined in cmdline.

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

llvm-svn: 259031

8 years agoSmall refactor in isBeforeInTranslationUnit.
Yury Gribov [Thu, 28 Jan 2016 09:27:46 +0000 (09:27 +0000)]
Small refactor in isBeforeInTranslationUnit.

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

llvm-svn: 259030

8 years ago[X86][AVX512] small fix in ptestm intrinsics
Asaf Badouh [Thu, 28 Jan 2016 08:33:22 +0000 (08:33 +0000)]
[X86][AVX512] small fix in ptestm intrinsics
move ptestm{q|d} intrinsics from patterns form (in td file) to the intrinsics table

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

llvm-svn: 259029

8 years agofixed Xcode gtest build failure
Todd Fiala [Thu, 28 Jan 2016 08:16:18 +0000 (08:16 +0000)]
fixed Xcode gtest build failure

llvm-svn: 259028

8 years agomodify Xcode build to use cmake/ninja for internal llvm/clang
Todd Fiala [Thu, 28 Jan 2016 07:36:44 +0000 (07:36 +0000)]
modify Xcode build to use cmake/ninja for internal llvm/clang

This change restores the Xcode build to working after Makefile support
was stripped from LLVM and clang recently.

With this change, the Xcode build now requires cmake (2.8.12.2+).
The cmake must either be on the path that Xcode sees, or it must
exist in one of the following locations:

* /usr/local/bin/cmake
* /opt/local/bin/cmake
* $HOME/bin/cmake

If the ninja build tool is present on the path, it will be used.
If not, ninja will be cloned (via git), bootstrap-built, and
used for the llvm/clang build.

LLDB now requires a minimum deployment target of OS X 10.9.  Prior
to this, it was 10.8.  The llvm/clang cmake build will not run
with Xcode 7.2 or Xcode 7.3 beta's compiler with the minimum
deployment target set to anything lower than 10.9.  This is
related to #include <atomic>.

When llvm or clang source code does not exist in the lldb tree,
it will be cloned via git using http://llvm.org/git/{project}.git.
Previously it used SVN.  If this causes any heartache, we can
make this smarter, autodetect an embedded svn and use svn instead.
(And/or use SVN if a git command is not available).

This change also fixes an lldb-mi linkage failure (needed
libncurses) as exposed by one of the LLVM libs.

llvm-svn: 259027

8 years ago[OMPT] Workaround clang failing with 'declare target'
Jonas Hahnfeld [Thu, 28 Jan 2016 07:14:44 +0000 (07:14 +0000)]
[OMPT] Workaround clang failing with 'declare target'

Current clang trunk reports _OPENMP to be 201307 = OpenMP 4.0. It doesn't
recognize '#pragma omp declare target' though (patch still pending) and
therefore fails compilation.

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

llvm-svn: 259026

8 years agoValueTracking: Use fixed array for assumption exclude set in Query.
Matthias Braun [Thu, 28 Jan 2016 06:29:33 +0000 (06:29 +0000)]
ValueTracking: Use fixed array for assumption exclude set in Query.

The Query structure is constructed often and is relevant for compiletime
performance. We can replace the SmallPtrSet for assumption exclusions in
this structure with a fixed size array because we know the maximum
number of elements.  This improves typical clang -O3 -emit-llvm compiletime
by 1.2% in my measurements.

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

llvm-svn: 259025

8 years ago[DAGCombiner] Don't add volatile or indexed stores to ChainedStores
Junmo Park [Thu, 28 Jan 2016 06:23:33 +0000 (06:23 +0000)]
[DAGCombiner] Don't add volatile or indexed stores to ChainedStores

Summary:
findBetterNeighborChains does not handle volatile or indexed stores.
However, it did not check when adding stores to ChainedStores.

Reviewers: arsenm

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

llvm-svn: 259024

8 years ago[libcxx] Remove pragmas that were needed to suppress warnings produced
Akira Hatanaka [Thu, 28 Jan 2016 06:13:36 +0000 (06:13 +0000)]
[libcxx] Remove pragmas that were needed to suppress warnings produced
by -Wpadded.

We don't need these pragmas anymore because -Wpadded was removed from
buildit in r258900.

llvm-svn: 259023

8 years ago[Lex] Share some common code between decimal and octal parsing in NumericLiteralParser.
Craig Topper [Thu, 28 Jan 2016 05:22:54 +0000 (05:22 +0000)]
[Lex] Share some common code between decimal and octal parsing in NumericLiteralParser.

There were a couple slight variations between the two copies that I don't believe were intentional. For example, only one of the paths checked for digit separations proceeding a '.', but I think the lexer itself splits the token if a digit separator proceeds a period.

llvm-svn: 259022

8 years agoSmallPtrSet: Add missing include
Matthias Braun [Thu, 28 Jan 2016 05:09:01 +0000 (05:09 +0000)]
SmallPtrSet: Add missing include

llvm-svn: 259021

8 years agoWebAssembly: fix build
JF Bastien [Thu, 28 Jan 2016 05:05:17 +0000 (05:05 +0000)]
WebAssembly: fix build

r259016 didn't also revert r258957 which broken the WebAssembly build.

llvm-svn: 259020

8 years agoSmallPtrSet: Make destructor available for inlining
Matthias Braun [Thu, 28 Jan 2016 04:49:14 +0000 (04:49 +0000)]
SmallPtrSet: Make destructor available for inlining

llvm-svn: 259019

8 years agoSmallPtrSet: Share some code between copy/move constructor/assignment operator
Matthias Braun [Thu, 28 Jan 2016 04:49:11 +0000 (04:49 +0000)]
SmallPtrSet: Share some code between copy/move constructor/assignment operator

llvm-svn: 259018

8 years agoSmallPtrSet: Remove trailing whitespace, fix indentation
Matthias Braun [Thu, 28 Jan 2016 04:49:07 +0000 (04:49 +0000)]
SmallPtrSet: Remove trailing whitespace, fix indentation

llvm-svn: 259017

8 years agoRevert r258951 (and r258950), "Refactor backend diagnostics for unsupported features"
NAKAMURA Takumi [Thu, 28 Jan 2016 04:41:32 +0000 (04:41 +0000)]
Revert r258951 (and r258950), "Refactor backend diagnostics for unsupported features"

It broke layering violation in LLVMIR.

clang r258950 "Add backend dignostic printer for unsupported features"
llvm  r258951 "Refactor backend diagnostics for unsupported features"

llvm-svn: 259016

8 years agoLeft a file out of r259014
Marshall Clow [Thu, 28 Jan 2016 04:15:35 +0000 (04:15 +0000)]
Left a file out of r259014

llvm-svn: 259015

8 years agoimplement ostream_joiner. Reviewed as http://reviews.llvm.org/D16605
Marshall Clow [Thu, 28 Jan 2016 04:14:56 +0000 (04:14 +0000)]
implement ostream_joiner. Reviewed as reviews.llvm.org/D16605

llvm-svn: 259014

8 years ago[WebAssembly] Don't stackify a register def past a get_local use in the same tree.
Dan Gohman [Thu, 28 Jan 2016 03:59:09 +0000 (03:59 +0000)]
[WebAssembly] Don't stackify a register def past a get_local use in the same tree.

llvm-svn: 259013

8 years agoputting requires on one line - ppc still executes my tests.
Mike Aizatsky [Thu, 28 Jan 2016 02:24:35 +0000 (02:24 +0000)]
putting requires on one line - ppc still executes my tests.

llvm-svn: 259012