platform/upstream/llvm.git
9 years agoHide away implementation details of the ThreadSafetyAnalysis in anonymous namespaces
Benjamin Kramer [Mon, 9 Mar 2015 14:19:54 +0000 (14:19 +0000)]
Hide away implementation details of the ThreadSafetyAnalysis in anonymous namespaces

NFC.

llvm-svn: 231653

9 years agoUpdate PTX generator to latest LLVM changes
Tobias Grosser [Mon, 9 Mar 2015 13:35:19 +0000 (13:35 +0000)]
Update PTX generator to latest LLVM changes

llvm-svn: 231652

9 years agoFix AttachDeniedTestCase on android
Tamas Berghammer [Mon, 9 Mar 2015 13:11:42 +0000 (13:11 +0000)]
Fix AttachDeniedTestCase on android

Failure caused by a missing mkfifo command in the android OS. This fix
replace mkfifo with "mknode p" command on android.

llvm-svn: 231651

9 years ago[clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follo...
Alexander Kornienko [Mon, 9 Mar 2015 12:18:39 +0000 (12:18 +0000)]
[clang-tidy] Refactor: Rename clang-tidy readability check files and classes to follow naming conventions

Classes are named WhateverCheck, files are WhateverCheck.cpp and`
WhateverCheck.h`

http://reviews.llvm.org/D8144

Patch by Richard Thomson!

llvm-svn: 231650

9 years agoAdd CloudABI locale names to platform_support.h.
Ed Schouten [Mon, 9 Mar 2015 12:04:16 +0000 (12:04 +0000)]
Add CloudABI locale names to platform_support.h.

On CloudABI we should append the timezone name to the end of the locale
(e.g., nl_NL.UTF-8@Europe/Amsterdam). By fixing the locale names we can
already let a lot of locale related tests pass.

llvm-svn: 231649

9 years ago[clang-tidy] Refactor: Rename clang-tidy misc check files and classes to follow namin...
Alexander Kornienko [Mon, 9 Mar 2015 11:48:54 +0000 (11:48 +0000)]
[clang-tidy] Refactor: Rename clang-tidy misc check files and classes to follow naming conventions

Classes are named WhateverCheck, files are named WhateverCheck.cpp and
WhateverCheck.h.

http://reviews.llvm.org/D8145

Patch by Richard Thomson!

llvm-svn: 231648

9 years agoAt least on NetBSD, sys/errno.h and errno.h are different, so use the
Joerg Sonnenberger [Mon, 9 Mar 2015 11:23:29 +0000 (11:23 +0000)]
At least on NetBSD, sys/errno.h and errno.h are different, so use the
correct header to get errno.

llvm-svn: 231647

9 years ago[Mips] Remove unused include
Simon Atanasyan [Mon, 9 Mar 2015 10:54:11 +0000 (10:54 +0000)]
[Mips] Remove unused include

No functional changes.

llvm-svn: 231646

9 years ago[Mips] Remove redundant namespace qualifiers
Simon Atanasyan [Mon, 9 Mar 2015 10:54:05 +0000 (10:54 +0000)]
[Mips] Remove redundant namespace qualifiers

No functional changes.

llvm-svn: 231645

9 years ago[Mips] Rename local variables
Simon Atanasyan [Mon, 9 Mar 2015 10:53:58 +0000 (10:53 +0000)]
[Mips] Rename local variables

No functional changes.

llvm-svn: 231644

9 years ago[Mips] Implement R_MIPS_SUB relocation handling
Simon Atanasyan [Mon, 9 Mar 2015 10:53:50 +0000 (10:53 +0000)]
[Mips] Implement R_MIPS_SUB relocation handling

llvm-svn: 231643

9 years ago[Mips] Implement R_MIPS_64 relocation handling
Simon Atanasyan [Mon, 9 Mar 2015 10:53:41 +0000 (10:53 +0000)]
[Mips] Implement R_MIPS_64 relocation handling

llvm-svn: 231642

9 years ago[Mips] Refactoring of relocation handling functions
Simon Atanasyan [Mon, 9 Mar 2015 10:53:32 +0000 (10:53 +0000)]
[Mips] Refactoring of relocation handling functions

1. Move relocation addendum reading code to the MipsRelocationHandler
class to reduce code duplication.
2. Factor out the relocations calculation code into the separate
function to be ready to handle MIPS N64 ABI relocation chains.

No functional changes.

llvm-svn: 231641

9 years ago[Mips] Show error message and stop linking in case of cross mode jump errors
Simon Atanasyan [Mon, 9 Mar 2015 10:53:24 +0000 (10:53 +0000)]
[Mips] Show error message and stop linking in case of cross mode jump errors

llvm-svn: 231640

9 years ago[Mips] Fix incorrect handling of cross mode jumps
Simon Atanasyan [Mon, 9 Mar 2015 10:53:15 +0000 (10:53 +0000)]
[Mips] Fix incorrect handling of cross mode jumps

We should not take in account a type of "source" symbol. Cross mode jump
adjustment is requred when target symbol and relocation belong to
different (regular/microMIPS) instruction sets.

llvm-svn: 231639

9 years agoReport the actual user register count from NativeRegisterContextLinux_x86_64
Tamas Berghammer [Mon, 9 Mar 2015 10:48:23 +0000 (10:48 +0000)]
Report the actual user register count from NativeRegisterContextLinux_x86_64

Thic change have effect wehn the AVX registers aren't available with
reporting the count of user registers without them.

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

llvm-svn: 231638

9 years agoFix a menu issue. patch by Vassil Vassilev
Sylvestre Ledru [Mon, 9 Mar 2015 09:09:55 +0000 (09:09 +0000)]
Fix a menu issue. patch by Vassil Vassilev

llvm-svn: 231637

9 years agoclang-format: Don't remove newline if macro ends in access specifier.
Daniel Jasper [Mon, 9 Mar 2015 08:13:55 +0000 (08:13 +0000)]
clang-format: Don't remove newline if macro ends in access specifier.

I.e.:

  #define A public:

  // The new line before this line would be removed.
  int a;

llvm-svn: 231636

9 years agoRevert r231630 - Run LICM pass after loop unrolling pass.
Kevin Qin [Mon, 9 Mar 2015 07:26:37 +0000 (07:26 +0000)]
Revert r231630 - Run LICM pass after loop unrolling pass.

As it broke llvm bootstrap.

llvm-svn: 231635

9 years agoFix a bug in the LLParser where we failed to diagnose landingpads with non-constant...
Owen Anderson [Mon, 9 Mar 2015 07:13:42 +0000 (07:13 +0000)]
Fix a bug in the LLParser where we failed to diagnose landingpads with non-constant clause operands.

Fixing this also exposed a related issue where the landingpad under construction was not
cleaned up when an error was raised, which would cause bad reference errors before the
error could actually be printed.

llvm-svn: 231634

9 years agoShorten user report message slightly
Tobias Grosser [Mon, 9 Mar 2015 06:59:16 +0000 (06:59 +0000)]
Shorten user report message slightly

llvm-svn: 231633

9 years ago[AArch64] Enable partial & runtime unrolling on cortex-a57
Kevin Qin [Mon, 9 Mar 2015 06:14:28 +0000 (06:14 +0000)]
[AArch64] Enable partial & runtime unrolling on cortex-a57

For inner one of nested loops, it is more likely to be a hot loop,
and the runtime check can be promoted out from patch 0001, so the
overhead is less, we can try a doubled threshold to unroll more loops.

llvm-svn: 231632

9 years agoIntroduce runtime unrolling disable matadata and use it to mark the scalar loop from...
Kevin Qin [Mon, 9 Mar 2015 06:14:18 +0000 (06:14 +0000)]
Introduce runtime unrolling disable matadata and use it to mark the scalar loop from vectorization.

Runtime unrolling is an expensive optimization which can bring benefit
only if the loop is hot and iteration number is relatively large enough.
For some loops, we know they are not worth to be runtime unrolled.
The scalar loop from vectorization is one of the cases.

llvm-svn: 231631

9 years agoRun LICM pass after loop unrolling pass.
Kevin Qin [Mon, 9 Mar 2015 06:14:07 +0000 (06:14 +0000)]
Run LICM pass after loop unrolling pass.

Runtime unrollng will introduce a runtime check in loop prologue.
If the unrolled loop is a inner loop, then the proglogue will be inside
the outer loop. LICM pass can help to promote the runtime check out if
the checked value is loop invariant.

llvm-svn: 231630

9 years ago[MachO] Use setter for globalsAreDeadStripRoots. NFC intended.
Davide Italiano [Mon, 9 Mar 2015 06:05:42 +0000 (06:05 +0000)]
[MachO] Use setter for globalsAreDeadStripRoots. NFC intended.

llvm-svn: 231629

9 years agoWarn when jumping out of a __finally block via goto.
Nico Weber [Mon, 9 Mar 2015 04:27:56 +0000 (04:27 +0000)]
Warn when jumping out of a __finally block via goto.

This only warns on direct gotos and indirect gotos with a unique label
(`goto *&&label;`).  Jumping out ith a true indirect goto is already an error.

This isn't O(1), but goto statements are less common than continue, break, and
return.  Also, the GetDeepestCommonScope() call in the same function does the
same amount of work, so this isn't worse than what's there in a complexity
sense, and it should be pretty fast in practice.

This is the last piece that was missing in r231623.

llvm-svn: 231628

9 years agoTest: Use layout-after instead of layout-before.
Rui Ueyama [Mon, 9 Mar 2015 04:00:29 +0000 (04:00 +0000)]
Test: Use layout-after instead of layout-before.

Update the tests so that they use layout-after instead of layout-before.
In all other places, we use layout-afters as primary edges.

llvm-svn: 231627

9 years agoInstCombine: fix fold "fcmp x, undef" to account for NaN
Mehdi Amini [Mon, 9 Mar 2015 03:20:25 +0000 (03:20 +0000)]
InstCombine: fix fold "fcmp x, undef" to account for NaN

Summary:
See the two test cases.

; Can fold fcmp with undef on one side by choosing NaN for the undef

; Can fold fcmp with undef on both side
;   fcmp u_pred undef, undef -> true
;   fcmp o_pred undef, undef -> false
; because whatever you choose for the first undef
; you can choose NaN for the other undef

Reviewers: hfinkel, chandlerc, majnemer

Reviewed By: majnemer

Subscribers: majnemer, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231626

9 years agoFix a theoretical bug when ParseCompoundStatement() returns StmtError.
Nico Weber [Mon, 9 Mar 2015 03:17:15 +0000 (03:17 +0000)]
Fix a theoretical bug when ParseCompoundStatement() returns StmtError.

ParseCompoundStatement() currently never returns StmtError, but if it did,
Sema would keep the __finally scope on its stack indefinitely.  Explicitly
add an error callback that clears it.

llvm-svn: 231625

9 years agoDCE: isArrayMalloc() is not used neither in LLVM nor Clang
Mehdi Amini [Mon, 9 Mar 2015 02:57:32 +0000 (02:57 +0000)]
DCE: isArrayMalloc() is not used neither in LLVM nor Clang

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 231624

9 years agoWarn when jumping out of a __finally block via continue, break, return, __leave.
Nico Weber [Mon, 9 Mar 2015 02:47:59 +0000 (02:47 +0000)]
Warn when jumping out of a __finally block via continue, break, return, __leave.

Since continue, break, return are much more common than __finally, this tries
to keep the work for continue, break, return O(1).  Sema keeps a stack of active
__finally scopes (to do this, ActOnSEHFinally() is split into
ActOnStartSEHFinally() and ActOnFinishSEHFinally()), and the various jump
statements then check if the current __finally scope (if present) is deeper
than then destination scope of the jump.

The same warning for goto statements is still missing.

This is the moral equivalent of MSVC's C4532.

llvm-svn: 231623

9 years agoFix typo in comment.
Nico Weber [Mon, 9 Mar 2015 02:34:29 +0000 (02:34 +0000)]
Fix typo in comment.

llvm-svn: 231622

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Mon, 9 Mar 2015 02:33:32 +0000 (02:33 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 231621

9 years ago[clang-tidy] Fix assertion when a dependent expression is used in an assert.
Alexander Kornienko [Mon, 9 Mar 2015 02:27:57 +0000 (02:27 +0000)]
[clang-tidy] Fix assertion when a dependent expression is used in an assert.

llvm-svn: 231620

9 years agoSimplify boolean expressions in clang with clang-tidy
David Blaikie [Mon, 9 Mar 2015 02:02:07 +0000 (02:02 +0000)]
Simplify boolean expressions in clang with clang-tidy

Patch by Richard (legalize at xmission dot com).

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

llvm-svn: 231619

9 years agoResolver: Fix incorrect DenseMap mapping info.
Rui Ueyama [Mon, 9 Mar 2015 02:00:54 +0000 (02:00 +0000)]
Resolver: Fix incorrect DenseMap mapping info.

Previously, getEmptyKey and getTombstoneKey return the same value
in the sense of isEqual defined by the same class, although they
need to be distinct values. This could confuse DenseMap.

We didn't see any issue by this wrong code because we don't delete
elements from the symbol table. We only add or replace elements.
But this is a bug and needs to be fixed anyway.

llvm-svn: 231618

9 years agoSimplify expressions involving boolean constants with clang-tidy
David Blaikie [Mon, 9 Mar 2015 01:57:13 +0000 (01:57 +0000)]
Simplify expressions involving boolean constants with clang-tidy

Patch by Richard (legalize at xmission dot com).

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

llvm-svn: 231617

9 years agoRemove unused function.
Rui Ueyama [Mon, 9 Mar 2015 01:05:04 +0000 (01:05 +0000)]
Remove unused function.

llvm-svn: 231616

9 years agoPECOFF: Create layout-afters instead of layout-befores.
Rui Ueyama [Mon, 9 Mar 2015 00:06:07 +0000 (00:06 +0000)]
PECOFF: Create layout-afters instead of layout-befores.

All readers except PE/COFF reader create layout-after edges to preserve
the original symbol order. PE/COFF uses layout-before edges as primary
edges for no reason.

This patch makes PE/COFF reader to create layout-after edges.
Resolver is updated to recognize reverse edges of layout-after edges
in the garbage collection pass.

Now we can retire layout-before edges. I don't do that in this patch
because if I do, I would have updated many tests to replace all
occurrrences of "layout-before" with "layout-after". So that's a TODO.

llvm-svn: 231615

9 years agoPECOFF: Define and use BaseReloc type instead of std::pair.
Rui Ueyama [Sun, 8 Mar 2015 22:49:27 +0000 (22:49 +0000)]
PECOFF: Define and use BaseReloc type instead of std::pair.

"first" and "second" are not easy to memorize.
Define a type to use meaningful names.

llvm-svn: 231614

9 years agoTeach DataLayout to infer a plausible alignment for things even when nothing is speci...
Owen Anderson [Sun, 8 Mar 2015 21:53:59 +0000 (21:53 +0000)]
Teach DataLayout to infer a plausible alignment for things even when nothing is specified by the user.

llvm-svn: 231613

9 years ago[Formating] Fix formating
Johannes Doerfert [Sun, 8 Mar 2015 21:38:35 +0000 (21:38 +0000)]
[Formating] Fix formating

llvm-svn: 231612

9 years agoRevert r231552: Resolver: optimize fallback atoms.
Rui Ueyama [Sun, 8 Mar 2015 21:31:38 +0000 (21:31 +0000)]
Revert r231552: Resolver: optimize fallback atoms.

This patch broke a buildbot.

llvm-svn: 231611

9 years agoRe-commit r231545: PECOFF: Do not add extraneous symbols to the dead strip root
Rui Ueyama [Sun, 8 Mar 2015 21:31:36 +0000 (21:31 +0000)]
Re-commit r231545: PECOFF: Do not add extraneous symbols to the dead strip root

That commit was reverted in r231582 as it was a culprit for
buildbot breakage. Turned out it's not.

llvm-svn: 231610

9 years agoAvoid warnings on !PowerPC
Joerg Sonnenberger [Sun, 8 Mar 2015 21:08:39 +0000 (21:08 +0000)]
Avoid warnings on !PowerPC

llvm-svn: 231609

9 years agoDon't produce warnings on !PowerPC.
Joerg Sonnenberger [Sun, 8 Mar 2015 21:06:58 +0000 (21:06 +0000)]
Don't produce warnings on !PowerPC.

llvm-svn: 231608

9 years ago[FIX] Add and force initialization for Pass * member
Johannes Doerfert [Sun, 8 Mar 2015 20:14:34 +0000 (20:14 +0000)]
[FIX] Add and force initialization for Pass * member

  r231268 accidently dropped the initialization that is re-introduced
  here. The const will enforce initialization for the future.

llvm-svn: 231607

9 years ago[FIX] Use the correct functions to extract the LB/UB from a range
Johannes Doerfert [Sun, 8 Mar 2015 19:49:50 +0000 (19:49 +0000)]
[FIX] Use the correct functions to extract the LB/UB from a range

  The current tests will continue to cover this code and more will be
  added when non-affine loops are supported.

llvm-svn: 231606

9 years agoProperly initialize the parser_crash debug token.
Benjamin Kramer [Sun, 8 Mar 2015 19:28:24 +0000 (19:28 +0000)]
Properly initialize the parser_crash debug token.

Found by msan.

llvm-svn: 231605

9 years agoFix the MSVC build.
Benjamin Kramer [Sun, 8 Mar 2015 18:20:22 +0000 (18:20 +0000)]
Fix the MSVC build.

Type traits are hard.

llvm-svn: 231604

9 years agoMake Token a real POD type.
Benjamin Kramer [Sun, 8 Mar 2015 18:11:59 +0000 (18:11 +0000)]
Make Token a real POD type.

We copy them around a lot and skip construction in favor of startToken,
make the default construction trivial to reflect that.

llvm-svn: 231603

9 years agoSkip all lldb-mi tests on Linux
Vince Harron [Sun, 8 Mar 2015 17:28:08 +0000 (17:28 +0000)]
Skip all lldb-mi tests on Linux

lldb-mi tests have been failing for a while on the buildbots.
Disabling until someone has a chance to fix.

llvm-svn: 231602

9 years ago[X86][AVX] Fix wrong lowering of VPERM2X128 nodes
Andrea Di Biagio [Sun, 8 Mar 2015 16:28:47 +0000 (16:28 +0000)]
[X86][AVX] Fix wrong lowering of VPERM2X128 nodes

There were cases where the backend computed a wrong permute mask for a VPERM2X128 node.

Example:
\code
define <8 x float> @foo(<8 x float> %a, <8 x float> %b) {
  %shuffle = shufflevector <8 x float> %a, <8 x float> %b, <8 x i32> <i32 undef, i32 undef, i32 6, i32 7, i32 undef, i32 undef, i32 6, i32 7>
  ret <8 x float> %shuffle
}
\code end

Before this patch, llc (with -mattr=+avx) emitted the following vperm2f128:
  vperm2f128 $0, %ymm0, %ymm0, %ymm0  # ymm0 = ymm0[0,1,0,1]

With this patch, llc emits a vperm2f128 with a correct permute mask:
  vperm2f128 $17, %ymm0, %ymm0, %ymm0  # ymm0 = ymm0[2,3,2,3]

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

llvm-svn: 231601

9 years agoFix whitespace on Python SWIG wrapper
Ed Maste [Sun, 8 Mar 2015 16:24:30 +0000 (16:24 +0000)]
Fix whitespace on Python SWIG wrapper

llvm-svn: 231600

9 years agoDrop meaningless test case
Tobias Grosser [Sun, 8 Mar 2015 16:12:47 +0000 (16:12 +0000)]
Drop meaningless test case

This test case was supposed to test the range analysis but it became just
another delinearization test case after enabling delinearization.

Suggested-by: Johannes Doerfert
llvm-svn: 231599

9 years agoMake static variables const if possible. Makes them go into a read-only section.
Benjamin Kramer [Sun, 8 Mar 2015 16:07:39 +0000 (16:07 +0000)]
Make static variables const if possible. Makes them go into a read-only section.

Or fold them into a initializer list which has the same effect. NFC.

llvm-svn: 231598

9 years agoMake constant static variables const so they can go into a read-only section
Benjamin Kramer [Sun, 8 Mar 2015 16:06:46 +0000 (16:06 +0000)]
Make constant static variables const so they can go into a read-only section

NFC.

llvm-svn: 231597

9 years agoSmall change to create_ll.sh [NFC]
Johannes Doerfert [Sun, 8 Mar 2015 15:36:27 +0000 (15:36 +0000)]
Small change to create_ll.sh [NFC]

llvm-svn: 231596

9 years agoEnable delinearization by default - second try
Tobias Grosser [Sun, 8 Mar 2015 15:21:18 +0000 (15:21 +0000)]
Enable delinearization by default - second try

After having fixed the LNT bugs in the previous commits, lets reenable the
delinearization.

llvm-svn: 231595

9 years agoUpdate test cases to work independently of delinearization default
Tobias Grosser [Sun, 8 Mar 2015 15:21:15 +0000 (15:21 +0000)]
Update test cases to work independently of delinearization default

llvm-svn: 231594

9 years agoAdd end user report message for unprofitable regions [NFC]
Johannes Doerfert [Sun, 8 Mar 2015 15:11:50 +0000 (15:11 +0000)]
Add end user report message for unprofitable regions [NFC]

llvm-svn: 231593

9 years agoAdd sign-extension during codegen of index expressions
Tobias Grosser [Sun, 8 Mar 2015 15:08:32 +0000 (15:08 +0000)]
Add sign-extension during codegen of index expressions

When code generating array index expressions the types of the different
components of the index expressions may not always match. We extend the type of
the index expression (if possible) and assert otherwise.

llvm-svn: 231592

9 years agoRevert "Enable delinearization by default"
Tobias Grosser [Sun, 8 Mar 2015 12:57:31 +0000 (12:57 +0000)]
Revert "Enable delinearization by default"

This reverts commit 231590. Apparantly we have three more issues left
in oggenc, smg2000 and linpack.

llvm-svn: 231591

9 years agoEnable delinearization by default
Tobias Grosser [Sun, 8 Mar 2015 12:30:37 +0000 (12:30 +0000)]
Enable delinearization by default

The performance test case just committed was the last open issue I was aware of.
We enable this by default to increase test coverage and to possibly trigger
reports of issues yet unknown.

llvm-svn: 231590

9 years agoAdd delinearization test-case that timed out earlier
Tobias Grosser [Sun, 8 Mar 2015 12:07:02 +0000 (12:07 +0000)]
Add delinearization test-case that timed out earlier

llvm-svn: 231589

9 years ago[Rewrite] Make RewriteBuffer accessible on its own, and add a unit test for it.
Argyrios Kyrtzidis [Sun, 8 Mar 2015 04:00:33 +0000 (04:00 +0000)]
[Rewrite] Make RewriteBuffer accessible on its own, and add a unit test for it.

llvm-svn: 231588

9 years ago[Rewrite] Move RewriteBuffer into its own header.
Argyrios Kyrtzidis [Sun, 8 Mar 2015 04:00:28 +0000 (04:00 +0000)]
[Rewrite] Move RewriteBuffer into its own header.

llvm-svn: 231587

9 years agoPECOFF: Fix off-by-one error.
Rui Ueyama [Sun, 8 Mar 2015 03:23:43 +0000 (03:23 +0000)]
PECOFF: Fix off-by-one error.

We accidentally skipped the last base relocation entry for each block.

llvm-svn: 231586

9 years agoPECOFF: Parallelize base relocation creation.
Rui Ueyama [Sun, 8 Mar 2015 02:44:53 +0000 (02:44 +0000)]
PECOFF: Parallelize base relocation creation.

If an output is large, its base relocation section can be also large.
For example, chrome.dll is almost 300 MB, and it has about 9 million
base relocations. Creating the section took 1.5 seconds on my machine.

This patch changes the way to create the section so that we can use
parallel_sort to group base relocations by high bits. This change
makes the linker almost 4% faster for the above test case on my machine.
If I replace parallel_sort with std::sort, performance remains the same,
so single thread performance should remain the same.

This has no functionality change. The output should be identical as
before.

llvm-svn: 231585

9 years agoResolver: Use LLVM StringMap and DenseMap.
Rui Ueyama [Sun, 8 Mar 2015 02:44:51 +0000 (02:44 +0000)]
Resolver: Use LLVM StringMap and DenseMap.

All defined symbols from all archive files are inserted to _archiveMap,
so performance of hash table matters here (I'm not trying to convert
all std::maps with DenseMaps). This change seems to make the linker
0.5% - 1% faster for my test case.

llvm-svn: 231584

9 years agoRemove sectionPosition attribute.
Rui Ueyama [Sun, 8 Mar 2015 01:01:40 +0000 (01:01 +0000)]
Remove sectionPosition attribute.

This code is simply dead. No one is using it.

http://reviews.llvm.org/D8125

llvm-svn: 231583

9 years agoRevert r231545 to unbreak buildbot.
Rui Ueyama [Sun, 8 Mar 2015 00:26:53 +0000 (00:26 +0000)]
Revert r231545 to unbreak buildbot.

This patch reverts r231545 "PECOFF: Do not add extraneous symbols
to the dead strip root." CrWinClangLLD buildbot is currently broken.
Since I can't reproduce the issue locally, I'm reverting the most
relevant change.

llvm-svn: 231582

9 years ago[DAGCombiner] Add a shuffle mask commutation helper function. NFCI.
Simon Pilgrim [Sat, 7 Mar 2015 22:33:11 +0000 (22:33 +0000)]
[DAGCombiner] Add a shuffle mask commutation helper function. NFCI.

We have an increasing number of cases where we are creating commuted shuffle masks - all implementing nearly the same code.

This patch adds a static helper function - ShuffleVectorSDNode::commuteMask() and replaces a number of cases to use it.

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

llvm-svn: 231581

9 years agoUnwind: remove unnecessary check
Saleem Abdulrasool [Sat, 7 Mar 2015 22:21:31 +0000 (22:21 +0000)]
Unwind: remove unnecessary check

Linux/GNU on AArch64 EH ABI Level III is implemented using exception frame
tables as defined in LSB II.11.6.  The exception frame tables use the DWARF
Exception Header Encoding as described in LSB II.11.5.1.  We already defined the
appropriate definition _LIBUNWIND_SUPPORT_DWARF_UNWIND to enable this.

llvm-svn: 231580

9 years agoFix the autoconf build
David Majnemer [Sat, 7 Mar 2015 21:47:46 +0000 (21:47 +0000)]
Fix the autoconf build

lib/ExecutionEngine/Targets has no Makefile, causing the autoconf build
to fail.  Solve this by bringing the COFF implementation of RuntimeDyld
in line like the Mach-O and ELF implementations.

llvm-svn: 231579

9 years agoUnwind: tweak register handling for AArch64
Saleem Abdulrasool [Sat, 7 Mar 2015 21:36:08 +0000 (21:36 +0000)]
Unwind: tweak register handling for AArch64

AArch64 uses // as the comment character (although, Darwin uses ;).  However,
since we are using the C preprocessor on these files, // can be used as the
comment character across the board.

Tweak the platform guard to recognise __aarch64__ as well as __arm64__ for the
platform identifier.

llvm-svn: 231578

9 years agoMake the assertion macros in Verifier and Linter truly variadic.
Benjamin Kramer [Sat, 7 Mar 2015 21:15:40 +0000 (21:15 +0000)]
Make the assertion macros in Verifier and Linter truly variadic.

NFC.

llvm-svn: 231577

9 years agoFix unused variable/function warnings
David Majnemer [Sat, 7 Mar 2015 20:56:50 +0000 (20:56 +0000)]
Fix unused variable/function warnings

llvm-svn: 231576

9 years agoASTMatchers: Make AST_POLYMORPHIC_SUPPORTED_TYPES a variadic macro
Benjamin Kramer [Sat, 7 Mar 2015 20:38:15 +0000 (20:38 +0000)]
ASTMatchers: Make AST_POLYMORPHIC_SUPPORTED_TYPES a variadic macro

C++11 finally allows us to use this C99 feature.

llvm-svn: 231575

9 years agoExecutionEngine: Preliminary support for dynamically loadable coff objects
David Majnemer [Sat, 7 Mar 2015 20:21:27 +0000 (20:21 +0000)]
ExecutionEngine: Preliminary support for dynamically loadable coff objects

Provide basic support for dynamically loadable coff objects. Only handles a subset of x64 currently.

Patch by Andy Ayers!

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

llvm-svn: 231574

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Sat, 7 Mar 2015 19:52:39 +0000 (19:52 +0000)]
Wrap to 80 columns. No behavior change.

llvm-svn: 231573

9 years agoMake constant arrays that are passed to functions as const.
Benjamin Kramer [Sat, 7 Mar 2015 17:41:00 +0000 (17:41 +0000)]
Make constant arrays that are passed to functions as const.

In theory this allows the compiler to skip materializing the array on
the stack. In practice clang often fails to do that, but that's a
different story. NFC.

llvm-svn: 231571

9 years agoRemove duplicate code. NFC.
Rui Ueyama [Sat, 7 Mar 2015 16:49:14 +0000 (16:49 +0000)]
Remove duplicate code. NFC.

llvm-svn: 231570

9 years agoUse SDValue bool check to tidyup some possible combines. NFC.
Simon Pilgrim [Sat, 7 Mar 2015 16:34:55 +0000 (16:34 +0000)]
Use SDValue bool check to tidyup some possible combines. NFC.

llvm-svn: 231569

9 years agoRemove redundant empty destructors.
Rui Ueyama [Sat, 7 Mar 2015 16:01:13 +0000 (16:01 +0000)]
Remove redundant empty destructors.

Both File and Atom have virtual destructors. We don't need to repeat
that in derived classes.

llvm-svn: 231568

9 years agoAdding parenthesis around logical expressions to silence a -Wparentheses warning...
Aaron Ballman [Sat, 7 Mar 2015 15:16:27 +0000 (15:16 +0000)]
Adding parenthesis around logical expressions to silence a -Wparentheses warning; NFC.

llvm-svn: 231567

9 years agoRemoving spurious semi-colons; NFC
Aaron Ballman [Sat, 7 Mar 2015 15:10:32 +0000 (15:10 +0000)]
Removing spurious semi-colons; NFC

llvm-svn: 231566

9 years agoX86: Roll repetitive code into a loop. NFC.
Benjamin Kramer [Sat, 7 Mar 2015 15:06:16 +0000 (15:06 +0000)]
X86: Roll repetitive code into a loop. NFC.

llvm-svn: 231565

9 years agoReapply r231508 "CodeGen: Emit constant temporaries into read-only globals."
Benjamin Kramer [Sat, 7 Mar 2015 13:37:13 +0000 (13:37 +0000)]
Reapply r231508 "CodeGen: Emit constant temporaries into read-only globals."

I disabled putting the new global into the same COMDAT as the function for now.
There's a fundamental problem when we inline references to the global but still
have the global in a COMDAT linked to the inlined function. Since this is only
an optimization there may be other versions of the COMDAT around that are
missing the new global and hell breaks loose at link time.

I hope the chromium build doesn't break this time :)

llvm-svn: 231564

9 years ago[DAGCombiner] Fix wrong folding of AND dag nodes.
Andrea Di Biagio [Sat, 7 Mar 2015 12:24:55 +0000 (12:24 +0000)]
[DAGCombiner] Fix wrong folding of AND dag nodes.

This patch fixes the logic in the DAGCombiner that folds an AND node according
to rule: (and (X (load V)), C) -> (X (load V))

An AND between a vector load 'X' and a constant build_vector 'C' can be folded
into the load itself only if we can prove that the AND operation is redundant.
The algorithm implemented by 'visitAND' firstly computes the splat value 'S'
from C, and then checks if S has the lower 'B' bits set (where B is the size in
bits of the vector element type). The algorithm takes into account also the
'undef' bits in the splat mask.

Unfortunately, the algorithm only worked under the assumption that the size of S
is a multiple of the vector element type. With this patch, we conservatively
avoid folding the AND if the splat bits are not compatible with the vector
element type.

Added X86 test and-load-fold.ll

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

llvm-svn: 231563

9 years agoAdding sanitizer_symbolizer_win.h to CMakeLists.txt
Kuba Brecka [Sat, 7 Mar 2015 11:04:36 +0000 (11:04 +0000)]
Adding sanitizer_symbolizer_win.h to CMakeLists.txt

llvm-svn: 231562

9 years ago[Modules] Include the header needed for make_unique, otherwise we can't
Chandler Carruth [Sat, 7 Mar 2015 10:55:47 +0000 (10:55 +0000)]
[Modules] Include the header needed for make_unique, otherwise we can't
build this header in a module.

llvm-svn: 231561

9 years agoTeach the LLVM CMake build how to explicitly use libc++abi when using
Chandler Carruth [Sat, 7 Mar 2015 10:30:34 +0000 (10:30 +0000)]
Teach the LLVM CMake build how to explicitly use libc++abi when using
libc++. This lets me almost self-host on Linux with libc++ and libc++abi
very simply.

Currently, MCJIT and OrcJIT are failing due to uncaught exceptions, and
the Go binding tests are failing to build due to not linking in the
correct C++ standard library.

llvm-svn: 231560

9 years agoMuch like we silence warnings about -flto in many cases to facilitate
Chandler Carruth [Sat, 7 Mar 2015 10:01:29 +0000 (10:01 +0000)]
Much like we silence warnings about -flto in many cases to facilitate
simplicity in build systems, silence '-stdlib=libc++' when linking. Even
if we're not linking C++ code per-se, we may be passing this flag so
that when we are linking C++ code we pick up the desired standard
library. While most build systems already provide separate C and C++
compile flags, many conflate link flags. Sadly, CMake is among them
causing this warning in a libc++ selfhost.

llvm-svn: 231559

9 years ago[PM] Fixup for r231556 where I missed a dependency on intrinsics
Chandler Carruth [Sat, 7 Mar 2015 09:08:20 +0000 (09:08 +0000)]
[PM] Fixup for r231556 where I missed a dependency on intrinsics
generation.

llvm-svn: 231558

9 years agoUpdate makefile to reflect that the Passes directory is gone here.
Chandler Carruth [Sat, 7 Mar 2015 09:03:17 +0000 (09:03 +0000)]
Update makefile to reflect that the Passes directory is gone here.

llvm-svn: 231557

9 years ago[PM] Create a separate library for high-level pass management code.
Chandler Carruth [Sat, 7 Mar 2015 09:02:36 +0000 (09:02 +0000)]
[PM] Create a separate library for high-level pass management code.

This will provide the analogous replacements for the PassManagerBuilder
and other code long term. This code is extracted from the opt tool
currently, and I plan to extend it as I build up support for using the
new pass manager in Clang and other places.

Mailing this out for review in part to let folks comment on the terrible names
here. A brief word about why I chose the names I did.

The library is called "Passes" to try and make it clear that it is a high-level
utility and where *all* of the passes come together and are registered in
a common library. I didn't want it to be *limited* to a registry though, the
registry is just one component.

The class is a "PassBuilder" but this name I'm less happy with. It doesn't
build passes in any traditional sense and isn't a Builder-style API at all. The
class is a PassRegisterer or PassAdder, but neither of those really make a lot
of sense. This class is responsible for constructing passes for registry in an
analysis manager or for population of a pass pipeline. If anyone has a better
name, I would love to hear it. The other candidate I looked at was
PassRegistrar, but that doesn't really fit either. There is no register of all
the passes in use, and so I think continuing the "registry" analog outside of
the registry of pass *names* and *types* is a mistake. The objects themselves
are just objects with the new pass manager.

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

llvm-svn: 231556

9 years ago[DAGCombiner] SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT(V,C)) -> VECTOR_SHUFFLE
Simon Pilgrim [Sat, 7 Mar 2015 05:52:42 +0000 (05:52 +0000)]
[DAGCombiner] SCALAR_TO_VECTOR(EXTRACT_VECTOR_ELT(V,C)) -> VECTOR_SHUFFLE

This patch attempts to convert a SCALAR_TO_VECTOR using an operand from an EXTRACT_VECTOR_ELT into a VECTOR_SHUFFLE.

This prevents many cases of spilling scalar data between the gpr + simd registers.

At present the optimization only accepts cases where there is no TRUNC of the scalar type (i.e. all types must match).

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

llvm-svn: 231554

9 years ago[analyzer] RetainCountChecker: CF properties are always manually retain-counted.
Jordan Rose [Sat, 7 Mar 2015 05:47:24 +0000 (05:47 +0000)]
[analyzer] RetainCountChecker: CF properties are always manually retain-counted.

In theory we could assume a CF property is stored at +0 if there's not a custom
setter, but that's not really worth the complexity. What we do know is that a
CF property can't have ownership attributes, and so we shouldn't assume anything
about the ownership of the ivar.

rdar://problem/20076963

llvm-svn: 231553

9 years agoResolver: optimize fallback atoms.
Rui Ueyama [Sat, 7 Mar 2015 04:23:46 +0000 (04:23 +0000)]
Resolver: optimize fallback atoms.

Atoms with fallback atoms are never be added to the symbol table.
However, we added such atoms to _undefines array. We had to call
isCoalescedAway to identify and skip them. We should just stop
adding them in the first place.

This seems to make the linker ~1% faster in my test case.

llvm-svn: 231552