oota-llvm.git
10 years agoCalcSpillWeights: Hack to prevent x87 nonsense
Duncan P. N. Exon Smith [Mon, 21 Apr 2014 17:57:01 +0000 (17:57 +0000)]
CalcSpillWeights: Hack to prevent x87 nonsense

This gross hack forces `hweight` into memory, preventing hidden
precision from making `1 > 1` occasionally equal `true`.

<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206765 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix the test: DCE optimized away everything.
Eli Bendersky [Mon, 21 Apr 2014 17:23:12 +0000 (17:23 +0000)]
Fix the test: DCE optimized away everything.

Use volatile store to protect the generated PTX from DCE.

Patch by Jingyue Wu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206763 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[msan] Enable out-of-line instrumentation for large functions by default.
Evgeniy Stepanov [Mon, 21 Apr 2014 15:04:05 +0000 (15:04 +0000)]
[msan] Enable out-of-line instrumentation for large functions by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206759 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAppease autoconf build since X86Disassembler.c has been disappeared in r206717.
NAKAMURA Takumi [Mon, 21 Apr 2014 14:59:11 +0000 (14:59 +0000)]
Appease autoconf build since X86Disassembler.c has been disappeared in r206717.

It can be reverted a few days later, after X86Disassembler.d is updated not to contain "X86Disassembler.c".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206758 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan] add a run-time flag detect_container_overflow=true/false
Kostya Serebryany [Mon, 21 Apr 2014 14:35:00 +0000 (14:35 +0000)]
[asan] add a run-time flag detect_container_overflow=true/false

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206756 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoConvert getFileOffset to getOffset and move it to its only user.
Rafael Espindola [Mon, 21 Apr 2014 13:45:32 +0000 (13:45 +0000)]
Convert getFileOffset to getOffset and move it to its only user.

We normally don't drop functions from the C API's, but in this case I think we
can:

* The old implementation of getFileOffset was fairly broken
* The introduction of LLVMGetSymbolFileOffset was itself a C api breaking
  change as it removed LLVMGetSymbolOffset.
* It is an incredibly specialized use case. The only reason MCJIT needs it is
  because of its odd position of being a dynamic linker of .o files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206750 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReapply r206732. This time without optimization of branches.
Michael Zolotukhin [Mon, 21 Apr 2014 12:01:33 +0000 (12:01 +0000)]
Reapply r206732. This time without optimization of branches.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206749 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan] add llvm-ish test for memset/etc instrumentation
Kostya Serebryany [Mon, 21 Apr 2014 11:57:43 +0000 (11:57 +0000)]
[asan] add llvm-ish test for memset/etc instrumentation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206747 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan] instead of inserting inline instrumentation around memset/memcpy/memmove,...
Kostya Serebryany [Mon, 21 Apr 2014 11:50:42 +0000 (11:50 +0000)]
[asan] instead of inserting inline instrumentation around memset/memcpy/memmove, replace the intrinsic with __asan_memset/etc. This makes the memset/etc handling more complete and consistent with what we do in msan. It may slowdown some cases (when the intrinsic was actually inlined) and speedup other cases (when it was not inlined)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206746 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Add a new-PM-style CGSCC pass manager using the newly added
Chandler Carruth [Mon, 21 Apr 2014 11:12:00 +0000 (11:12 +0000)]
[PM] Add a new-PM-style CGSCC pass manager using the newly added
LazyCallGraph analysis framework. Wire it up all the way through the opt
driver and add some very basic testing that we can build pass pipelines
including these components. Still a lot more to do in terms of testing
that all of this works, but the basic pieces are here.

There is a *lot* of boiler plate here. It's something I'm going to
actively look at reducing, but I don't have any immediate ideas that
don't end up making the code terribly complex in order to fold away the
boilerplate. Until I figure out something to minimize the boilerplate,
almost all of this is based on the code for the existing pass managers,
copied and heavily adjusted to suit the needs of the CGSCC pass
management layer.

The actual CG management still has a bunch of FIXMEs in it. Notably, we
don't do *any* updating of the CG as it is potentially invalidated.
I wanted to get this in place to motivate the new analysis, and add
update APIs to the analysis and the pass management layers in concert to
make sure that the *right* APIs are present.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206745 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Fix a bug where we didn't properly clear the list map when the list
Chandler Carruth [Mon, 21 Apr 2014 11:11:54 +0000 (11:11 +0000)]
[PM] Fix a bug where we didn't properly clear the list map when the list
became empty. This would manifest later as an assert failure due to
a non-empty list map but an empty result map. This doesn't easily
manifest with just the module pass manager and the function pass
manager, but the next commit will add the CGSCC pass manager that hits
this assert immediately.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206744 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm/test/CodeGen/X86/bmi.ll: Relax expressions for targeting win32.
NAKAMURA Takumi [Mon, 21 Apr 2014 11:01:46 +0000 (11:01 +0000)]
llvm/test/CodeGen/X86/bmi.ll: Relax expressions for targeting win32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206743 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan] temporary disable generating __asan_loadN/__asan_storeN
Kostya Serebryany [Mon, 21 Apr 2014 10:28:13 +0000 (10:28 +0000)]
[asan] temporary disable generating __asan_loadN/__asan_storeN

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206741 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Replace OwningPtr with std::unique_ptr in places where it doesn't break the...
Benjamin Kramer [Mon, 21 Apr 2014 09:34:48 +0000 (09:34 +0000)]
[C++11] Replace OwningPtr with std::unique_ptr in places where it doesn't break the API.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206740 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Wire the analysis passes (such as they are) into the registry, and
Chandler Carruth [Mon, 21 Apr 2014 08:20:10 +0000 (08:20 +0000)]
[PM] Wire the analysis passes (such as they are) into the registry, and
teach the opt driver to use it rather than a manual list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206739 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] ISEL (and X, <constant mask>) to BZHI when BMI2 is available.
Lang Hames [Mon, 21 Apr 2014 08:18:53 +0000 (08:18 +0000)]
[X86] ISEL (and X, <constant mask>) to BZHI when BMI2 is available.

Generating BZHI in the variable mask case, i.e. (and X, (sub (shl 1, N), 1)),
was already supported, but we were missing the constant-mask case. This patch
fixes that.

<rdar://problem/15480077>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206738 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[PM] Add a nice low-tech registry of passes as a boring macro expansion
Chandler Carruth [Mon, 21 Apr 2014 08:08:50 +0000 (08:08 +0000)]
[PM] Add a nice low-tech registry of passes as a boring macro expansion
file. This will make it easy to scale up the number of passes supported.
Currently, it just supports the function and module transformation
passes that were already supported in the opt tool explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206737 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert r206732 which is causing llc to crash on most of the build bots.
Chandler Carruth [Mon, 21 Apr 2014 07:11:15 +0000 (07:11 +0000)]
Revert r206732 which is causing llc to crash on most of the build bots.

Original commit message:
  Implement builtins for safe division: safe.sdiv.iN, safe.udiv.iN,
  safe.srem.iN, safe.urem.iN (iN = i8, i61, i32, or i64).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206735 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[asan] insert __asan_loadN/__asan_storeN as out-lined asan checks, llvm part
Kostya Serebryany [Mon, 21 Apr 2014 07:10:43 +0000 (07:10 +0000)]
[asan] insert __asan_loadN/__asan_storeN as out-lined asan checks, llvm part

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206734 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoImplement builtins for safe division: safe.sdiv.iN, safe.udiv.iN, safe.srem.iN,
Michael Zolotukhin [Mon, 21 Apr 2014 05:33:09 +0000 (05:33 +0000)]
Implement builtins for safe division: safe.sdiv.iN, safe.udiv.iN, safe.srem.iN,
safe.urem.iN (iN = i8, i16, i32, or i64).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206732 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[LCG] Add some basic debug output to the LCG pass.
Chandler Carruth [Mon, 21 Apr 2014 05:04:24 +0000 (05:04 +0000)]
[LCG] Add some basic debug output to the LCG pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206730 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoProtect the ArgList dtor
David Blaikie [Sun, 20 Apr 2014 23:59:00 +0000 (23:59 +0000)]
Protect the ArgList dtor

It could even be made non-virtual if it weren't for bad compiler
warnings.

This demonstrates that ArgList objects aren't destroyed polymorphically
and possibly that they aren't even used polymorphically. If that's the
case, it might be possible to refactor the two ArgList types more
separately and simplify the Arg ownership model. *continues
experimenting*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206727 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd missing #include found by modules build.
Richard Smith [Sun, 20 Apr 2014 23:39:19 +0000 (23:39 +0000)]
Add missing #include found by modules build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206726 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove comment that hasn't been true for 5 years
David Blaikie [Sun, 20 Apr 2014 22:40:43 +0000 (22:40 +0000)]
Remove comment that hasn't been true for 5 years

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206725 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUse unique_ptr to handle ownership of synthesized args in DerivedArgList
David Blaikie [Sun, 20 Apr 2014 22:37:46 +0000 (22:37 +0000)]
Use unique_ptr to handle ownership of synthesized args in DerivedArgList

This might be able to be simplified further by using Arg as a value type
in a linked list (to maintain pointer validity), but here's something
simple to start with.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206724 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoC++ has a bool type! (And C's had one too, for 15 years...)
Richard Smith [Sun, 20 Apr 2014 22:15:37 +0000 (22:15 +0000)]
C++ has a bool type! (And C's had one too, for 15 years...)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206723 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMore C++ification.
Richard Smith [Sun, 20 Apr 2014 22:10:16 +0000 (22:10 +0000)]
More C++ification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206722 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove some more C junk from these files.
Richard Smith [Sun, 20 Apr 2014 21:56:02 +0000 (21:56 +0000)]
Remove some more C junk from these files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206721 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't provide two different definitions of ModRMDecision, OpcodeDecision, and Context...
Richard Smith [Sun, 20 Apr 2014 21:52:16 +0000 (21:52 +0000)]
Don't provide two different definitions of ModRMDecision, OpcodeDecision, and ContextDecision in different source files (depending on #define magic).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206720 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDon't define llvm::X86Disassembler::InstructionSpecifier in different ways in
Richard Smith [Sun, 20 Apr 2014 21:35:26 +0000 (21:35 +0000)]
Don't define llvm::X86Disassembler::InstructionSpecifier in different ways in
different source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206719 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMaybe if I touch this file the buildbots will actually rerun configure like they...
Richard Smith [Sun, 20 Apr 2014 21:28:33 +0000 (21:28 +0000)]
Maybe if I touch this file the buildbots will actually rerun configure like they need to...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206718 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoWhat year is it! This file has no reason to be written in C, and has doubly no
Richard Smith [Sun, 20 Apr 2014 21:07:34 +0000 (21:07 +0000)]
What year is it! This file has no reason to be written in C, and has doubly no
reason to expose a global symbol 'decodeInstruction' nor to pollute the global
scope with a bunch of external linkage entities (some of which conflict with
others elsewhere in LLVM).

This is just the initial transition to C++; more cleanups to follow.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206717 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Mips] Add more special values for the st_other field in the symbol
Simon Atanasyan [Sun, 20 Apr 2014 21:05:36 +0000 (21:05 +0000)]
[Mips] Add more special values for the st_other field in the symbol
table entry for MIPS.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206716 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[C++11] Range-based loop simplification.
Simon Atanasyan [Sun, 20 Apr 2014 21:05:30 +0000 (21:05 +0000)]
[C++11] Range-based loop simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206715 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix redefinition of default argument, found by modules build. It's not
Richard Smith [Sun, 20 Apr 2014 20:26:39 +0000 (20:26 +0000)]
Fix redefinition of default argument, found by modules build.  It's not
entirely clear whether this should be valid with modules enabled, but the fixed
code is cleaner regardless.

Also fix a TU-local type that accidentally had external linkage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206714 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove some empty statements
Alp Toker [Sat, 19 Apr 2014 23:56:35 +0000 (23:56 +0000)]
Remove some empty statements

Cleanup only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206710 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoProfileData: Remove an extra semicolon
Justin Bogner [Sat, 19 Apr 2014 23:42:50 +0000 (23:42 +0000)]
ProfileData: Remove an extra semicolon

Spotted by Nick Lewycky in review, thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206708 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "blockfreq: Rewrite BlockFrequencyInfoImpl"
Duncan P. N. Exon Smith [Sat, 19 Apr 2014 22:46:00 +0000 (22:46 +0000)]
Revert "blockfreq: Rewrite BlockFrequencyInfoImpl"

This reverts commit r206704, as expected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206707 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "blockfreq: Temporarily turn on -debug-only=block-freq"
Duncan P. N. Exon Smith [Sat, 19 Apr 2014 22:45:44 +0000 (22:45 +0000)]
Revert "blockfreq: Temporarily turn on -debug-only=block-freq"

This reverts commit r206705, as planned.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206706 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoblockfreq: Temporarily turn on -debug-only=block-freq
Duncan P. N. Exon Smith [Sat, 19 Apr 2014 22:40:56 +0000 (22:40 +0000)]
blockfreq: Temporarily turn on -debug-only=block-freq

These tests fail after my BlockFrequencyInfo rewrite on two buildbots
[1][2].  I can't reproduce it locally, so I'm temporarily turning on
-debug-only=block-freq so I can find the problem.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1860
[2]: http://llvm-amd64.freebsd.your.org/b/builders/clang-i386-freebsd/builds/18477

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206705 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReapply "blockfreq: Rewrite BlockFrequencyInfoImpl"
Duncan P. N. Exon Smith [Sat, 19 Apr 2014 22:34:26 +0000 (22:34 +0000)]
Reapply "blockfreq: Rewrite BlockFrequencyInfoImpl"

This reverts commit r206677, reapplying my BlockFrequencyInfo rewrite.

I've done a careful audit, added some asserts, and fixed a couple of
bugs (unfortunately, they were in unlikely code paths).  There's a small
chance that this will appease the failing bots [1][2].  (If so, great!)

If not, I have a follow-up commit ready that will temporarily add
-debug-only=block-freq to the two failing tests, allowing me to compare
the code path between what the failing bots and what my machines (and
the rest of the bots) are doing.  Once I've triggered those builds, I'll
revert both commits so the bots go green again.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1816
[2]: http://llvm-amd64.freebsd.your.org/b/builders/clang-i386-freebsd/builds/18445

<rdar://problem/14292693>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206704 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPatch by Vadim Chugunov
Yaron Keren [Sat, 19 Apr 2014 13:47:43 +0000 (13:47 +0000)]
Patch by Vadim Chugunov

Win64 stack unwinder gets confused when execution flow "falls through" after
a call to 'noreturn' function. This fixes the "missing epilogue" problem by
emitting a trap instruction for IR 'unreachable' on x86_x64-pc-windows.

A secondary use for it would be for anyone wanting to make double-sure that
'noreturn' functions, indeed, do not return.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206684 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoPatch by Ray Donnelly to print register names instead of numbers.
Yaron Keren [Sat, 19 Apr 2014 05:40:09 +0000 (05:40 +0000)]
Patch by Ray Donnelly to print register names instead of numbers.

http://reviews.llvm.org/D3422

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206683 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd parens to appease GCC warning.
David Blaikie [Sat, 19 Apr 2014 00:50:15 +0000 (00:50 +0000)]
Add parens to appease GCC warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206678 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)
Duncan P. N. Exon Smith [Sat, 19 Apr 2014 00:42:46 +0000 (00:42 +0000)]
Revert "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)

This reverts commit r206666, as planned.

Still stumped on why the bots are failing.  Sanitizer bots haven't
turned anything up.  If anyone can help me debug either of the failures
(referenced in r206666) I'll owe them a beer.  (In the meantime, I'll be
auditing my patch for undefined behaviour.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206677 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoOnDiskHashTable: Audit types and use offset_type consistently
Justin Bogner [Sat, 19 Apr 2014 00:33:15 +0000 (00:33 +0000)]
OnDiskHashTable: Audit types and use offset_type consistently

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206675 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoProfileData: Avoid UB when reading
Justin Bogner [Sat, 19 Apr 2014 00:33:12 +0000 (00:33 +0000)]
ProfileData: Avoid UB when reading

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206674 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoOnDiskHashTable: Fix a think-o with offset_type
Justin Bogner [Fri, 18 Apr 2014 23:50:07 +0000 (23:50 +0000)]
OnDiskHashTable: Fix a think-o with offset_type

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206672 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCheck whether functions have any lines associated before emitting coverage info for...
Nick Lewycky [Fri, 18 Apr 2014 23:32:28 +0000 (23:32 +0000)]
Check whether functions have any lines associated before emitting coverage info for them. This isn't just a size/time saving, gcov may crash on these.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206671 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agollvm-profdata: Avoid writing to /dev/null in tests
Justin Bogner [Fri, 18 Apr 2014 23:25:35 +0000 (23:25 +0000)]
llvm-profdata: Avoid writing to /dev/null in tests

We fseek on our output file in llvm-profdata, which errors on some
systems. Avoid getting into the situation by writing to /dev/null

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206670 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoChange the ARM assembler to require a :lower16: or :upper16 on non-constant
Kevin Enderby [Fri, 18 Apr 2014 23:06:39 +0000 (23:06 +0000)]
Change the ARM assembler to require a :lower16: or :upper16 on non-constant
expressions for mov instructions instead of silently truncating by default.

For the ARM assembler, we want to avoid misleadingly allowing something
like "mov r0, <symbol>" especially when we turn it into a movw and the
expression <symbol> does not have a :lower16: or :upper16" as part of the
expression.  We don't want the behavior of silently truncating, which can be
unexpected and lead to bugs that are difficult to find since this is an easy
mistake to make.

This does change the previous behavior of llvm but actually matches an
older gnu assembler that would not allow this but print less useful errors
of like “invalid constant (0x927c0) after fixup” and “unsupported relocation on
symbol foo”.  The error for llvm is "immediate expression for mov requires
:lower16: or :upper16" with correct location information on the operand
as shown in the added test cases.

rdar://12342160

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206669 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agotest: Add extra run lines to investigate an error on the bots
Justin Bogner [Fri, 18 Apr 2014 23:05:31 +0000 (23:05 +0000)]
test: Add extra run lines to investigate an error on the bots

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206668 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReapply "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)
Duncan P. N. Exon Smith [Fri, 18 Apr 2014 22:30:03 +0000 (22:30 +0000)]
Reapply "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)

This reverts commit r206628, reapplying r206622 (and r206626).

Two tests are failing only on buildbots [1][2]: i.e., I can't reproduce
on Darwin, and Chandler can't reproduce on Linux.  Asan and valgrind
don't tell us anything, but we're hoping the msan bot will catch it.

So, I'm applying this again to get more feedback from the bots.  I'll
leave it in long enough to trigger builds in at least the sanitizer
buildbots (it was failing for reasons unrelated to my commit last time
it was in), and hopefully a few others.... and then I expect to revert a
third time.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1816
[2]: http://llvm-amd64.freebsd.your.org/b/builders/clang-i386-freebsd/builds/18445

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206666 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[llvm-symbolizer] Print file/line for a PC even if there is no DIE describing it.
Alexey Samsonov [Fri, 18 Apr 2014 22:22:44 +0000 (22:22 +0000)]
[llvm-symbolizer] Print file/line for a PC even if there is no DIE describing it.

This is important for symbolizing executables with debug info in
unavailable .dwo files. Even if all DIE entries are missing, we can
still symbolize an address: function name can be fetched from symbol table,
and file/line info can be fetched from line table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206665 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoProfileData: Don't forward declare ComputeHash and make it static inline
Justin Bogner [Fri, 18 Apr 2014 22:00:22 +0000 (22:00 +0000)]
ProfileData: Don't forward declare ComputeHash and make it static inline

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206663 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoCompress debug sections only when beneficial.
David Blaikie [Fri, 18 Apr 2014 21:52:26 +0000 (21:52 +0000)]
Compress debug sections only when beneficial.

Both ZLIB and the debug info compressed section header ("ZLIB" + the
size of the uncompressed data) take some constant overhead so in some
cases the compressed data is actually larger than the uncompressed data.
In these cases, just don't compress or rename the section at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206659 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoProfileData: Add support for the indexed instrprof format
Justin Bogner [Fri, 18 Apr 2014 21:48:40 +0000 (21:48 +0000)]
ProfileData: Add support for the indexed instrprof format

This adds support for an indexed instrumentation based profiling
format, which is just a small header and an on disk hash table.  This
format will be used by clang's -fprofile-instr-use= for PGO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206656 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdded Sphinx documentation generation to CMake build system.
Reid Kleckner [Fri, 18 Apr 2014 21:45:25 +0000 (21:45 +0000)]
Added Sphinx documentation generation to CMake build system.

The option LLVM_ENABLE_SPHINX option enables the "docs-llvm-html",
"docs-llvm-man" targets but does not build them by default. The
following CMake options have been added that control what targets are
made available

SPHINX_OUTPUT_HTML
SPHINX_OUTPUT_MAN

If LLVM_BUILD_DOCS is enabled then the enabled docs-llvm-* targets will
be built by default and if ``make install`` is run then docs-llvm-html
and docs-llvm-man will be installed (tested on Linux only).

The add_sphinx_target function is in its own file so it can be included
by other projects that use Sphinx for their documentation.

Patch by Daniel Liew <daniel.liew@imperial.ac.uk>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206655 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[DWARF parser] Turn DILineInfo into a struct.
Alexey Samsonov [Fri, 18 Apr 2014 21:36:39 +0000 (21:36 +0000)]
[DWARF parser] Turn DILineInfo into a struct.

Immutable DILineInfo doesn't bring any benefits and complicates
code. Also, use std::string instead of SmallString<16> for file
and function names - their length can vary significantly.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206654 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate the fragments of symbols in compressed sections.
David Blaikie [Fri, 18 Apr 2014 21:24:12 +0000 (21:24 +0000)]
Update the fragments of symbols in compressed sections.

While unnamed relocations are already cached in side tables in
ELFObjectWriter::RecordRelocation, symbols still need their fragments
updated to refer to the newly compressed fragment (even if that fragment
isn't big enough to fit the offset). Even though we only create
temporary symbols in debug info sections this comes up in 32 bit builds
where even temporary symbols in mergeable sections (such as debug_str)
have to be emitted as named symbols.

I tried a few other ways to do this but they all didn't work for various
reasons:

1) Canonicalize the MCSymbolData in RecordRelocation, nulling out the
Fragment (so it didn't have to be updated by CompressDebugSection). This
doesn't work because some code relies on symbols having fragments to
indicate that they're defined, I think.

2) Canonicalize the MCSymbolData in RecordRelocation to be "first
fragment + absolute offset" so it would be cheaper to just test and
update the fragment in CompressDebugSections. This doesn't work because
the offset computed in RecordRelocation isn't that of the symbol's
fragment, it's the passed in fragment (I haven't figured out what that
fragment is - perhaps it's the location where the relocation is to be
written). And if the fragment offset has to be computed only for this
use we might as well just do it when we need to, in
CompressDebugSection.

I also added an assert to help catch this a bit more clearly, even
though it is UB. The test case improvements would either assert fail
and/or valgrind vail without the fix, even if they wouldn't necessarily
fail the FileCheck output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206653 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[ARM64] Ports the Cortex-A53 Machine Model description from AArch64.
Chad Rosier [Fri, 18 Apr 2014 21:22:04 +0000 (21:22 +0000)]
[ARM64] Ports the Cortex-A53 Machine Model description from AArch64.

Summary:
This port includes the rudimentary latencies that were provided for
the Cortex-A53 Machine Model in the AArch64 backend. It also changes
the SchedAlias for COPY in the Cyclone model to an explicit
WriteRes mapping to avoid conflicts in other subtargets.

Differential Revision: http://reviews.llvm.org/D3427
Patch by Dave Estes <cestes@codeaurora.org>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206652 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove -simplify-libcalls pass form Passes documentation
Reid Kleckner [Fri, 18 Apr 2014 21:19:06 +0000 (21:19 +0000)]
Remove -simplify-libcalls pass form Passes documentation

This pass was removed in r184459.

Also added note that the InstCombine pass does library call
simplification.

Patch slightly modified from one by Daniel Liew
<daniel.liew@imperial.ac.uk>!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206650 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoExpanded test for x86-pc-windows-gnu and x86_64-pc-windows-gnu environments.
Yaron Keren [Fri, 18 Apr 2014 21:10:11 +0000 (21:10 +0000)]
Expanded test for x86-pc-windows-gnu and x86_64-pc-windows-gnu environments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206649 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[LCG] Fix the bugs that Ben pointed out in code review (and the MSan bot
Chandler Carruth [Fri, 18 Apr 2014 20:44:16 +0000 (20:44 +0000)]
[LCG] Fix the bugs that Ben pointed out in code review (and the MSan bot
caught). Sad that we don't have warnings for these things, but bleh, no
idea how to fix that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206646 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoOnDiskHashTable: Expect the Info type to declare the offset type
Justin Bogner [Fri, 18 Apr 2014 20:39:46 +0000 (20:39 +0000)]
OnDiskHashTable: Expect the Info type to declare the offset type

This changes the on-disk hash to get the type to use for offsets from
the Info type, so that clients can be more flexible with the size of
table they support.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206643 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoOnDiskHashTable: Expect the Info type to declare the hash size
Justin Bogner [Fri, 18 Apr 2014 20:39:43 +0000 (20:39 +0000)]
OnDiskHashTable: Expect the Info type to declare the hash size

This changes the on-disk hash to get the size of a hash value from the
Info type, so that clients can be more flexible with the types of hash
they use.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206642 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[DWARF parser] Respect address ranges specified in compile unit DIE.
Alexey Samsonov [Fri, 18 Apr 2014 20:30:27 +0000 (20:30 +0000)]
[DWARF parser] Respect address ranges specified in compile unit DIE.

When address ranges for compile unit are specified in compile unit DIE
itself, there is no need to collect ranges from children subprogram DIEs.

This change speeds up llvm-symbolizer on Clang-produced binaries with
full debug info. For instance, symbolizing a first address in a 1Gb binary
is now 2x faster (1s vs. 2s).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206641 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRemove a couple of redundant copies of SmallVector::operator==.
Benjamin Kramer [Fri, 18 Apr 2014 19:48:03 +0000 (19:48 +0000)]
Remove a couple of redundant copies of SmallVector::operator==.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206635 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[X86] Improve buildFromShuffleMostly for AVX
Adam Nemet [Fri, 18 Apr 2014 19:44:16 +0000 (19:44 +0000)]
[X86] Improve buildFromShuffleMostly for AVX

For a 256-bit BUILD_VECTOR consisting mostly of shuffles of 256-bit vectors,
both the BUILD_VECTOR and its operands may need to be legalized in multiple
steps.  Consider:

(v8f32 (BUILD_VECTOR (extract_vector_elt (v8f32 %vreg0,) Constant<1>),
                     (extract_vector_elt %vreg0, Constant<2>),
                     (extract_vector_elt %vreg0, Constant<3>),
                     (extract_vector_elt %vreg0, Constant<4>),
                     (extract_vector_elt %vreg0, Constant<5>),
                     (extract_vector_elt %vreg0, Constant<6>),
                     (extract_vector_elt %vreg0, Constant<7>),
                     %vreg1))

a. We can't build a 256-bit vector efficiently so, we need to split it into
two 128-bit vecs and combine them with VINSERTX128.

b. Operands like (extract_vector_elt (v8f32 %vreg0), Constant<7>) needs to be
split into a VEXTRACTX128 and a further extract_vector_elt from the
resulting 128-bit vector.

c. The extract_vector_elt from b. is lowered into a shuffle to the first
element and a movss.

Depending on the order in which we legalize the BUILD_VECTOR and its
operands[1], buildFromShuffleMostly may be faced with:

(v4f32 (BUILD_VECTOR (extract_vector_elt
                      (vector_shuffle<1,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),
                      Constant<0>),
                     (extract_vector_elt
                      (vector_shuffle<2,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),
                      Constant<0>),
                     (extract_vector_elt
                      (vector_shuffle<3,u,u,u> (extract_subvector %vreg0, Constant<4>), undef),
                      Constant<0>),
                     %vreg1))

In order to figure out the underlying vector and their identity we need to see
through the shuffles.

[1] Note that the order in which operations and their operands are legalized is
only guaranteed in the first iteration of LegalizeDAG.

Fixes <rdar://problem/16296956>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206634 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoDebugInfo: Remove some initializer lists to make MSVC happy again.
Benjamin Kramer [Fri, 18 Apr 2014 19:01:53 +0000 (19:01 +0000)]
DebugInfo: Remove some initializer lists to make MSVC happy again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206632 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd range access to MCAssembler's symbol collection.
David Blaikie [Fri, 18 Apr 2014 18:24:25 +0000 (18:24 +0000)]
Add range access to MCAssembler's symbol collection.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206631 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoUpdate comment in LLVMBitCodes.h to reflect the actual bitcode record
Reid Kleckner [Fri, 18 Apr 2014 18:19:18 +0000 (18:19 +0000)]
Update comment in LLVMBitCodes.h to reflect the actual bitcode record

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206630 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFix uint -> size_t conversion warning.
Matt Arsenault [Fri, 18 Apr 2014 18:08:31 +0000 (18:08 +0000)]
Fix uint -> size_t conversion warning.

This warning is disabled for the LLVM build,
but external users of the header can still
run into this.

Patch by Ke Bai

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206629 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)
Duncan P. N. Exon Smith [Fri, 18 Apr 2014 17:56:08 +0000 (17:56 +0000)]
Revert "blockfreq: Rewrite BlockFrequencyInfoImpl" (#2)

This reverts commit r206622 and the MSVC fixup in r206626.

Apparently the remotely failing tests are still failing, despite my
attempt to fix the nondeterminism in r206621.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206628 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFixed llvm-build when no targets are enabled
Greg Fitzgerald [Fri, 18 Apr 2014 17:39:50 +0000 (17:39 +0000)]
Fixed llvm-build when no targets are enabled

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206627 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoFixing MSVC after r206622?
Duncan P. N. Exon Smith [Fri, 18 Apr 2014 17:38:01 +0000 (17:38 +0000)]
Fixing MSVC after r206622?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206626 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoBetter comments to explain buffered/unbuffered processor resources.
Andrew Trick [Fri, 18 Apr 2014 17:35:08 +0000 (17:35 +0000)]
Better comments to explain buffered/unbuffered processor resources.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206625 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[DWARF parser] Refactor fetching DIE address ranges.
Alexey Samsonov [Fri, 18 Apr 2014 17:25:46 +0000 (17:25 +0000)]
[DWARF parser] Refactor fetching DIE address ranges.

Add a helper method to get address ranges specified in a DIE
(either by DW_AT_low_pc/DW_AT_high_pc, or by DW_AT_ranges). Use it
to untangle and simplify the code.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206624 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoReapply "blockfreq: Rewrite BlockFrequencyInfoImpl"
Duncan P. N. Exon Smith [Fri, 18 Apr 2014 17:22:25 +0000 (17:22 +0000)]
Reapply "blockfreq: Rewrite BlockFrequencyInfoImpl"

This reverts commit r206556, effectively reapplying commit r206548 and
its fixups in r206549 and r206550.

In an intervening commit I've added target triples to the tests that
were failing remotely [1] (but passing locally).  I'm hoping the mystery
is solved?  I'll revert this again if the tests are still failing
remotely.

[1]: http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/1816

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206622 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd some target triples for better determinism
Duncan P. N. Exon Smith [Fri, 18 Apr 2014 17:22:19 +0000 (17:22 +0000)]
Add some target triples for better determinism

These tests were failing on some buildbots after r206548 (reverted in
r206556), but passing locally.

They were missing target triples, so maybe that's the problem?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206621 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoLineIterator: Add DataTypes.h for int64_t on MSVC.
Benjamin Kramer [Fri, 18 Apr 2014 16:57:01 +0000 (16:57 +0000)]
LineIterator: Add DataTypes.h for int64_t on MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206617 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAdd some missing includes for various standard library implementations.
Benjamin Kramer [Fri, 18 Apr 2014 16:46:29 +0000 (16:46 +0000)]
Add some missing includes for various standard library implementations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206616 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoMake the copy member of StringRef/ArrayRef generic wrt allocators.
Benjamin Kramer [Fri, 18 Apr 2014 16:36:15 +0000 (16:36 +0000)]
Make the copy member of StringRef/ArrayRef generic wrt allocators.

Doesn't make sense to restrict this to BumpPtrAllocator. While there
replace an explicit loop with std::equal. Some standard libraries know
how to compile this down to a ::memcmp call if possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206615 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAArch64/ARM64: add more NEON tests.
Tim Northover [Fri, 18 Apr 2014 14:54:53 +0000 (14:54 +0000)]
AArch64/ARM64: add more NEON tests.

Mostly no testing this time, since they were just wrangling
target-specific intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206613 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAllocator: Remove ReferenceAdder hack.
Benjamin Kramer [Fri, 18 Apr 2014 14:54:51 +0000 (14:54 +0000)]
Allocator: Remove ReferenceAdder hack.

This was a workaround for compilers that had issues with reference
collapsing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206612 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM64: disable generation of .loh directives outside MachO.
Tim Northover [Fri, 18 Apr 2014 14:54:46 +0000 (14:54 +0000)]
ARM64: disable generation of .loh directives outside MachO.

Part of PR19455.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206611 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM64: don't emit .subsections_via_symbols on ELF.
Tim Northover [Fri, 18 Apr 2014 14:54:41 +0000 (14:54 +0000)]
ARM64: don't emit .subsections_via_symbols on ELF.

Part of PR19455.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206610 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM64: add extra NEG pattern.
Tim Northover [Fri, 18 Apr 2014 14:54:35 +0000 (14:54 +0000)]
ARM64: add extra NEG pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206609 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAArch64/ARM64: port more AArch64 tests to ARM64.
Tim Northover [Fri, 18 Apr 2014 13:16:55 +0000 (13:16 +0000)]
AArch64/ARM64: port more AArch64 tests to ARM64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206592 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAArch64/ARM64: add non-scalar lowering for more FCVT operations.
Tim Northover [Fri, 18 Apr 2014 13:16:42 +0000 (13:16 +0000)]
AArch64/ARM64: add non-scalar lowering for more FCVT operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206591 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAArch64/ARM64: improve spotting of EXT instructions from VECTOR_SHUFFLE.
Tim Northover [Fri, 18 Apr 2014 12:50:58 +0000 (12:50 +0000)]
AArch64/ARM64: improve spotting of EXT instructions from VECTOR_SHUFFLE.

We couldn't cope if the first mask element was UNDEF before, which
isn't ideal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206588 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[msan] Add -msan-instrumentation-with-call-threshold.
Evgeniy Stepanov [Fri, 18 Apr 2014 12:17:20 +0000 (12:17 +0000)]
[msan] Add -msan-instrumentation-with-call-threshold.

This flag replaces inline instrumentation for checks and origin stores with
calls into MSan runtime library. This is a workaround for PR17409.

Disabled by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206585 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[LCG] Remove all of the complexity stemming from supporting copying.
Chandler Carruth [Fri, 18 Apr 2014 11:02:33 +0000 (11:02 +0000)]
[LCG] Remove all of the complexity stemming from supporting copying.
Reality is that we're never going to copy one of these. Supporting this
was becoming a nightmare because nothing even causes it to compile most
of the time. Lots of subtle errors built up that wouldn't have been
caught by any "normal" testing.

Also, make the move assignment actually work rather than the bogus swap
implementation that would just infloop if used. As part of that, factor
out the graph pointer updates into a helper to share between move
construction and move assignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206583 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[Allocator] Fix an obvious think-o with the move assignment
Chandler Carruth [Fri, 18 Apr 2014 11:02:29 +0000 (11:02 +0000)]
[Allocator] Fix an obvious think-o with the move assignment
implementation of the SpecificBumpPtrAllocator -- we have to actually
move the subobject. =] Noticed when using this code more directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206582 91177308-0d34-0410-b5e6-96231b3b80d8

10 years ago[LCG] Add support for building persistent and connected SCCs to the
Chandler Carruth [Fri, 18 Apr 2014 10:50:32 +0000 (10:50 +0000)]
[LCG] Add support for building persistent and connected SCCs to the
LazyCallGraph. This is the start of the whole point of this different
abstraction, but it is just the initial bits. Here is a run-down of
what's going on here. I'm planning to incorporate some (or all) of this
into comments going forward, hopefully with better editing and wording.
=]

The crux of the problem with the traditional way of building SCCs is
that they are ephemeral. The new pass manager however really needs the
ability to associate analysis passes and results of analysis passes with
SCCs in order to expose these analysis passes to the SCC passes. Making
this work is kind-of the whole point of the new pass manager. =]

So, when we're building SCCs for the call graph, we actually want to
build persistent nodes that stick around and can be reasoned about
later. We'd also like the ability to walk the SCC graph in more complex
ways than just the traditional postorder traversal of the current CGSCC
walk. That means that in addition to being persistent, the SCCs need to
be connected into a useful graph structure.

However, we still want the SCCs to be formed lazily where possible.

These constraints are quite hard to satisfy with the SCC iterator. Also,
using that would bypass our ability to actually add data to the nodes of
the call graph to facilite implementing the Tarjan walk. So I've
re-implemented things in a more direct and embedded way. This
immediately makes it easy to get the persistence and connectivity
correct, and it also allows leveraging the existing nodes to simplify
the algorithm. I've worked somewhat to make this implementation more
closely follow the traditional paper's nomenclature and strategy,
although it is still a bit obtuse because it isn't recursive, using
an explicit stack and a tail call instead, and it is interruptable,
resuming each time we need another SCC.

The other tricky bit here, and what actually took almost all the time
and trials and errors I spent building this, is exactly *what* graph
structure to build for the SCCs. The naive thing to build is the call
graph in its newly acyclic form. I wrote about 4 versions of this which
did precisely this. Inevitably, when I experimented with them across
various use cases, they became incredibly awkward. It was all
implementable, but it felt like a complete wrong fit. Square peg, round
hole. There were two overriding aspects that pushed me in a different
direction:

1) We want to discover the SCC graph in a postorder fashion. That means
   the root node will be the *last* node we find. Using the call-SCC DAG
   as the graph structure of the SCCs results in an orphaned graph until
   we discover a root.

2) We will eventually want to walk the SCC graph in parallel, exploring
   distinct sub-graphs independently, and synchronizing at merge points.
   This again is not helped by the call-SCC DAG structure.

The structure which, quite surprisingly, ended up being completely
natural to use is the *inverse* of the call-SCC DAG. We add the leaf
SCCs to the graph as "roots", and have edges to the caller SCCs. Once
I switched to building this structure, everything just fell into place
elegantly.

Aside from general cleanups (there are FIXMEs and too few comments
overall) that are still needed, the other missing piece of this is
support for iterating across levels of the SCC graph. These will become
useful for implementing #2, but they aren't an immediate priority.

Once SCCs are in good shape, I'll be working on adding mutation support
for incremental updates and adding the pass manager that this analysis
enables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206581 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoX86: Pattern match scalar loads + vcvtph2ps into just vcvtph2ps.
Benjamin Kramer [Fri, 18 Apr 2014 10:45:33 +0000 (10:45 +0000)]
X86: Pattern match scalar loads + vcvtph2ps into just vcvtph2ps.

vcvtph2ps only reads the lower 64 bits of the address passed to the
intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206579 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoRevert r206565 (and r206566 which updated tests).
Chandler Carruth [Fri, 18 Apr 2014 09:35:51 +0000 (09:35 +0000)]
Revert r206565 (and r206566 which updated tests).

This commit was attributed to a different person from the person who
posted the patch to the list, and the person who posted it the list
claimed when they did that they were not the author, but that the author
was yet a third person. I don't know what is going on here, but
reverting until the attribution is clear and the author has explicitly
contributed the patch.

Also, the review hasn't really involved any of the MC maintainers and
that seems questionable too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206576 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAArch64/ARM64: port atomics test to ARM64.
Tim Northover [Fri, 18 Apr 2014 09:31:31 +0000 (09:31 +0000)]
AArch64/ARM64: port atomics test to ARM64.

Covers quite a few extra instructions (like any of the max/min ones
which were broken until recently on ARM64).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206575 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoAArch64/ARM64: spot a greater variety of concat_vector operations.
Tim Northover [Fri, 18 Apr 2014 09:31:27 +0000 (09:31 +0000)]
AArch64/ARM64: spot a greater variety of concat_vector operations.

Code mostly copied from AArch64, just tidied up a trifle and plumbed
into the ARM64 way of doing things.

This also enables the AArch64 tests which inspired the previous
untested commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206574 91177308-0d34-0410-b5e6-96231b3b80d8

10 years agoARM64: implement cunning optimisation from AArch64
Tim Northover [Fri, 18 Apr 2014 09:31:20 +0000 (09:31 +0000)]
ARM64: implement cunning optimisation from AArch64

A vector extract followed by a dup can become a single instruction even if the
types don't match. AArch64 handled this in ISelLowering, but a few reasonably
simple patterns can take care of it in TableGen, so that's where I've put it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206573 91177308-0d34-0410-b5e6-96231b3b80d8