oota-llvm.git
11 years agoRemove trailing whitespaces
Arnaud A. de Grandmaison [Thu, 21 Jun 2012 22:26:01 +0000 (22:26 +0000)]
Remove trailing whitespaces

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

11 years agollvm/unittests: Simplify LINK_COMPONENTS.
NAKAMURA Takumi [Thu, 21 Jun 2012 22:17:51 +0000 (22:17 +0000)]
llvm/unittests: Simplify LINK_COMPONENTS.

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

11 years agollvm/unittests/VMCore/CMakeLists.txt: Introduce LLVM_OPTIONAL_SOURCES here, too.
NAKAMURA Takumi [Thu, 21 Jun 2012 22:17:39 +0000 (22:17 +0000)]
llvm/unittests/VMCore/CMakeLists.txt: Introduce LLVM_OPTIONAL_SOURCES here, too.

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

11 years agoThe inline asm operand modifier 'n' is suppose
Jack Carter [Thu, 21 Jun 2012 21:37:54 +0000 (21:37 +0000)]
The inline asm operand modifier 'n' is suppose
to be generic across architectures. It has the
following description in the gnu sources:

    Negate the immediate constant

Several Architectures such as x86 have local implementations
of operand modifier 'n' which go beyond the above description
slightly. This won't affect them.

Affected files:

    lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
        Added 'n' to the switch cases.

    test/CodeGen/Generic/asm-large-immediate.ll
        Generic compiled test (x86 for me)

    test/CodeGen/Mips/asm-large-immediate.ll
        Mips compiled version of the generic one

Contributer: Jack Carter

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

11 years agoAdd support for invoke to the MemoryBuiltin analysid.
Nuno Lopes [Thu, 21 Jun 2012 21:25:05 +0000 (21:25 +0000)]
Add support for invoke to the MemoryBuiltin analysid.
Update comments accordingly.

Make instcombine remove useless invokes to C++'s 'new' allocation function (test attached).

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

11 years ago1. fix null program output after some other changes
Akira Hatanaka [Thu, 21 Jun 2012 20:39:10 +0000 (20:39 +0000)]
1. fix null program output after some other changes
2. re-enable null.ll test
3. fix some minor style violations

Patch by Reed Kotler.

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

11 years agoAdd Mips to the list of target architectures for the MCJIT tests.
Akira Hatanaka [Thu, 21 Jun 2012 20:23:32 +0000 (20:23 +0000)]
Add Mips to the list of target architectures for the MCJIT tests.

Patch by Reed Kotler.

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

11 years agoTreat TargetGlobalAddress as a constant for the purpose of matching pre-inc stores...
Hal Finkel [Thu, 21 Jun 2012 20:10:48 +0000 (20:10 +0000)]
Treat TargetGlobalAddress as a constant for the purpose of matching pre-inc stores on PPC.

Thanks to Tobias von Koch for pointing out this problem.

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

11 years agoAvoid using the recently added APPEND_STRING feature. This should
Chandler Carruth [Thu, 21 Jun 2012 18:44:24 +0000 (18:44 +0000)]
Avoid using the recently added APPEND_STRING feature. This should
restore support for CMake versions before 2.8.6 -- sorry for the
trouble!

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

11 years agofix build in C++11 mode.
Nuno Lopes [Thu, 21 Jun 2012 18:38:26 +0000 (18:38 +0000)]
fix build in C++11 mode.
Thanks to Chandler for pointing out the problem.

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

11 years agoFix potential crash if DAGCombine on stores sees a half type
Pete Cooper [Thu, 21 Jun 2012 18:00:39 +0000 (18:00 +0000)]
Fix potential crash if DAGCombine on stores sees a half type

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

11 years agoThe inline asm operand modifier 'c' is suppose
Jack Carter [Thu, 21 Jun 2012 17:14:46 +0000 (17:14 +0000)]
The inline asm operand modifier 'c' is suppose
to be generic across architectures. It has the
following description in the gnu sources:

    Substitute immediate value without immediate syntax

Several Architectures such as x86 have local implementations
of operand modifier 'c' which go beyond the above description
slightly. To make use of the generic modifiers without overriding
local implementation one can make a call to the base class method
for AsmPrinter::PrintAsmOperand() in the locally derived method's
"default" case in the switch statement. That way if it is already
defined locally the generic version will never get called.

This change is needed when test/CodeGen/generic/asm-large-immediate.ll
failed on a native Mips board. The test was assuming a generic
implementation was in place.

Affected files:

    lib/Target/Mips/MipsAsmPrinter.cpp:
        Changed the default case to call the base method.
    lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
        Added 'c' to the switch cases.
    test/CodeGen/Mips/asm-large-immediate.ll
        Mips compiled version of the generic one

Contributer: Jack Carter

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

11 years agomove some typedefs so that we don't polute the llvm namespace. this should appease...
Nuno Lopes [Thu, 21 Jun 2012 16:58:41 +0000 (16:58 +0000)]
move some typedefs so that we don't polute the llvm namespace. this should appease the GCC buildbots

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

11 years agohopefully fix the buildbots: some tests have wrong definitions of malloc and were...
Nuno Lopes [Thu, 21 Jun 2012 16:47:58 +0000 (16:47 +0000)]
hopefully fix the buildbots:  some tests have wrong definitions of malloc and were crashing this code on 64 bits machines

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

11 years agoport the BoundsChecking patch to the new MemoryBuiltin API (i.e., remove most of...
Nuno Lopes [Thu, 21 Jun 2012 15:59:53 +0000 (15:59 +0000)]
port the BoundsChecking patch to the new MemoryBuiltin API (i.e., remove most of the code from here).
Remove the alloc_size.ll test until we settle on a metadata format that makes everyone happy..

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

11 years agorefactor the MemoryBuiltin analysis:
Nuno Lopes [Thu, 21 Jun 2012 15:45:28 +0000 (15:45 +0000)]
refactor the MemoryBuiltin analysis:
 - provide more extensive set of functions to detect library allocation functions (e.g., malloc, calloc, strdup, etc)
 - provide an API to compute the size and offset of an object pointed by

Move a few clients (GVN, AA, instcombine, ...) to the new API.
This implementation is a lot more aggressive than each of the custom implementations being replaced.

Patch reviewed by Nick Lewycky and Chandler Carruth, thanks.

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

11 years agoAdd a number of threshold arguments to the SRA pass.
Nadav Rotem [Thu, 21 Jun 2012 13:44:31 +0000 (13:44 +0000)]
Add a number of threshold arguments to the SRA pass.

A patch by Tom Stellard with minor changes.

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

11 years agoRevert r158209, "test/CodeGen/Generic/APIntLoadStore.ll: Mark as XFAIL:ppc since...
NAKAMURA Takumi [Thu, 21 Jun 2012 13:43:06 +0000 (13:43 +0000)]
Revert r158209, "test/CodeGen/Generic/APIntLoadStore.ll: Mark as XFAIL:ppc since r157911."

It passes according to ppc changes.

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

11 years agollvm/unittests/ExecutionEngine/JIT/CMakeLists.txt: Unbreak build.
NAKAMURA Takumi [Thu, 21 Jun 2012 12:44:58 +0000 (12:44 +0000)]
llvm/unittests/ExecutionEngine/JIT/CMakeLists.txt: Unbreak build.

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

11 years agoAdd a pragma to supress an MSVC warning on some of the absurd code I'm
Chandler Carruth [Thu, 21 Jun 2012 10:02:41 +0000 (10:02 +0000)]
Add a pragma to supress an MSVC warning on some of the absurd code I'm
using to test the alignment support library.

Patch from Nikola on IRC.

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

11 years agoAdd some missing dependencies here that I missed in my first pass
Chandler Carruth [Thu, 21 Jun 2012 10:02:40 +0000 (10:02 +0000)]
Add some missing dependencies here that I missed in my first pass
through. Also sort them.

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

11 years agoCompletely refactor the structuring of unittest CMake files to match the
Chandler Carruth [Thu, 21 Jun 2012 09:51:26 +0000 (09:51 +0000)]
Completely refactor the structuring of unittest CMake files to match the
Makefiles, the CMake files in every other part of the LLVM tree, and
sanity.

This should also restore the output tree structure of all the unit
tests, sorry for breaking that, and thanks for letting me know.

The fundamental change is to put a CMakeLists.txt file in the unittest
directory, with a single test binary produced from it. This has several
advantages:

- No more weird directory stripping in the unittest macro, allowing it
  to be used more readily in other projects.
- No more directory prefixes on all the source files.
- Allows correct and precise use of LLVM's per-directory dependency
  system.
- Allows use of the checking logic for source files that have not been
  added to the CMake build. This uncovered a file being skipped with
  CMake in LLVM and one in Clang's unit tests.
- Makes Specifying conditional compilation or other custom logic for JIT
  tests easier.

It did require adding the concept of an explicit 'optional' source file
to the CMake build so that the missing-file check can skip cases where
the file is *supposed* to be missing. =]

This is another chunk of refactoring the CMake build in order to make it
usable for other clients like CompilerRT / ASan / TSan.

Note that this is interdependent with a Clang CMake change.

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

11 years agollvm-stress: Stabalize (by using an ordered container) and add randomness to the...
Nadav Rotem [Thu, 21 Jun 2012 08:58:15 +0000 (08:58 +0000)]
llvm-stress: Stabalize (by using an ordered container) and add randomness to the order in which loops are generated.

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

11 years agoCleanup some encoding mishaps.
Bill Wendling [Thu, 21 Jun 2012 07:01:02 +0000 (07:01 +0000)]
Cleanup some encoding mishaps.

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

11 years agoSphinxify the tablegen document.
Bill Wendling [Thu, 21 Jun 2012 06:58:24 +0000 (06:58 +0000)]
Sphinxify the tablegen document.

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

11 years agoAdd a missing llvm.fma -> VFNMS pattern to the ARM backend.
Lang Hames [Thu, 21 Jun 2012 06:10:00 +0000 (06:10 +0000)]
Add a missing llvm.fma -> VFNMS pattern to the ARM backend.

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

11 years agoSphinxify the outdated Packaging documentation.
Bill Wendling [Thu, 21 Jun 2012 06:09:37 +0000 (06:09 +0000)]
Sphinxify the outdated Packaging documentation.

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

11 years agoEmit a single _udivmodsi4 libcall instead of two separate _udivsi3 and
Evan Cheng [Thu, 21 Jun 2012 05:56:05 +0000 (05:56 +0000)]
Emit a single _udivmodsi4 libcall instead of two separate _udivsi3 and
_umodsi3 libcalls if they have the same arguments. This optimization
was apparently broken if one of the node was replaced in place.
rdar://11714607

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

11 years agoFactor the logic for setting up a GoogleTest unit test executable into
Chandler Carruth [Thu, 21 Jun 2012 05:16:58 +0000 (05:16 +0000)]
Factor the logic for setting up a GoogleTest unit test executable into
a helper function in CMake. This will allow us to share all of this
logic with Clang, and eventually CompilerRT.

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

11 years agoSimplify the naming pattern in the unittests' CMake file
Chandler Carruth [Thu, 21 Jun 2012 02:02:48 +0000 (02:02 +0000)]
Simplify the naming pattern in the unittests' CMake file

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

11 years agoRemove one of the LLVM-specific CMake hacks in favor of standard CMake
Chandler Carruth [Thu, 21 Jun 2012 01:35:09 +0000 (01:35 +0000)]
Remove one of the LLVM-specific CMake hacks in favor of standard CMake
facilities.

This was only used in one place in LLVM, and was used pervasively (but
with different code!) in Clang. It has no advantages over the standard
CMake facilities and in some cases disadvantages.

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

11 years agoUpdate regunits in RegisterCoalescer::reMaterializeTrivialDef.
Jakob Stoklund Olesen [Thu, 21 Jun 2012 00:09:15 +0000 (00:09 +0000)]
Update regunits in RegisterCoalescer::reMaterializeTrivialDef.

Old code would only update physreg live intervals.

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

11 years agoPut space after "code-block::".
Meador Inge [Wed, 20 Jun 2012 23:57:00 +0000 (23:57 +0000)]
Put space after "code-block::".

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

11 years agoRemove LiveIntervals::iterator.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 23:54:20 +0000 (23:54 +0000)]
Remove LiveIntervals::iterator.

Live intervals for regunits and virtual registers are stored separately,
and physreg live intervals are going away.

To visit the live ranges of all virtual registers, use this pattern
instead:

  for (unsigned i = 0, e = MRI->getNumVirtRegs(); i != e; ++i) {
    unsigned Reg = TargetRegisterInfo::index2VirtReg(i);
    if (MRI->reg_nodbg_empty(Reg))
      continue;

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

11 years agoRemove spurious typedefs.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 23:54:18 +0000 (23:54 +0000)]
Remove spurious typedefs.

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

11 years agoRemoved some left over HTML tags and a '}'.
Meador Inge [Wed, 20 Jun 2012 23:48:01 +0000 (23:48 +0000)]
Removed some left over HTML tags and a '}'.

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

11 years agoRemove the RenderMachineFunction HTML output pass.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 23:47:58 +0000 (23:47 +0000)]
Remove the RenderMachineFunction HTML output pass.

I don't think anyone has been using this functionality for a while, and
it is getting in the way of refactoring now.

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

11 years agoRemove the -live-regunits command line option.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 23:31:34 +0000 (23:31 +0000)]
Remove the -live-regunits command line option.

Register allocators depend on it being permanently enabled now.

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

11 years agoFix some more LiveInterval enumerations.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 23:23:59 +0000 (23:23 +0000)]
Fix some more LiveInterval enumerations.

Deterministically enumerate the virtual registers instead.

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

11 years agoRemove LiveIntervalUnions from RegAllocBase.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 22:52:29 +0000 (22:52 +0000)]
Remove LiveIntervalUnions from RegAllocBase.

They are living in LiveRegMatrix now.

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

11 years agoConvert RAGreedy to LiveRegMatrix interference checking.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 22:52:26 +0000 (22:52 +0000)]
Convert RAGreedy to LiveRegMatrix interference checking.

Stop depending on the LiveIntervalUnions in RegAllocBase, they are about
to be removed.

The changes are mostly replacing register alias iterators with regunit
iterators, and querying LiveRegMatrix instrad of RegAllocBase.

InterferenceCache is converted to work with per-regunit
LiveIntervalUnions, and it checks fixed regunit interference separately,
using the fixed live intervals provided by LiveIntervalAnalysis.

The local splitting helper calcGapWeights() is also considering fixed
regunit interference which is kept on the side now.

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

11 years agoConvert RABasic to using LiveRegMatrix interference checking.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 22:52:24 +0000 (22:52 +0000)]
Convert RABasic to using LiveRegMatrix interference checking.

Stop using the LiveIntervalUnions provided by RegAllocBase, they will be
removed soon.

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

11 years agoEnable register unit liveness by default.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 22:52:22 +0000 (22:52 +0000)]
Enable register unit liveness by default.

Soon we won't need to compute live intervals for physical registers.

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

11 years agoTeach PBQPBuilder::build() about regunit interference.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 22:32:05 +0000 (22:32 +0000)]
Teach PBQPBuilder::build() about regunit interference.

Filter out physreg candidates with regunit interferrence.
Also compute regmask interference more efficiently.

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

11 years agoRestructure PopulateLoopsDFS::insertIntoLoop.
Andrew Trick [Wed, 20 Jun 2012 22:18:33 +0000 (22:18 +0000)]
Restructure PopulateLoopsDFS::insertIntoLoop.

As Nadav pointed out the first implementation was obscure.

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

11 years agoSphixify the GEP FAQ.
Bill Wendling [Wed, 20 Jun 2012 21:54:22 +0000 (21:54 +0000)]
Sphixify the GEP FAQ.

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

11 years agoAvoid iterating with LiveIntervals::iterator.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 21:25:05 +0000 (21:25 +0000)]
Avoid iterating with LiveIntervals::iterator.

That is a DenseMap iterator keyed by pointers, so the iteration order is
nondeterministic.

I would like to replace the DenseMap with an IndexedMap which doesn't
allow iteration.

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

11 years agoRevert r158846.
Akira Hatanaka [Wed, 20 Jun 2012 21:19:39 +0000 (21:19 +0000)]
Revert r158846.

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

11 years agoIn MipsDisassembler.cpp, instead of defining register class tables, use the ones
Akira Hatanaka [Wed, 20 Jun 2012 20:39:23 +0000 (20:39 +0000)]
In MipsDisassembler.cpp, instead of defining register class tables, use the ones
that are generated by TableGen and are already available in
MipsGenRegisterInfo.inc. Suggested by Jakob Stoklund Olesen.

Also, fix bug in function DecodeAFGR64RegisterClass.

Patch by Vladimir Medic.

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

11 years agoRemove an "else" that snuck in after a "return" ;)
Kaelyn Uhrain [Wed, 20 Jun 2012 20:38:36 +0000 (20:38 +0000)]
Remove an "else" that snuck in after a "return" ;)

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

11 years agoCheck that a file is not a directory before reading it into a MemoryBuffer.
Kaelyn Uhrain [Wed, 20 Jun 2012 20:21:33 +0000 (20:21 +0000)]
Check that a file is not a directory before reading it into a MemoryBuffer.

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

11 years agoAdd "extern template" declarations now that we use explicit instantiation.
Andrew Trick [Wed, 20 Jun 2012 20:17:20 +0000 (20:17 +0000)]
Add "extern template" declarations now that we use explicit instantiation.

This is supported by gcc and clang, but guarded by a macro for MSVC 2008.

The extern template declaration is not necessary but generally good
form. It can avoid extra instantiations of the template methods
defined inline.

The EXTERN_TEMPLATE_INSTANTIATION macro could probably be generalized to
handle multiple template parameters if someone thinks it's worthwhile.

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

11 years agoAdd users of a MERGE_VALUE node to the worklist to process again when the node is...
Pete Cooper [Wed, 20 Jun 2012 19:35:43 +0000 (19:35 +0000)]
Add users of a MERGE_VALUE node to the worklist to process again when the node is removed.  Sorry, no test case.  Foudn it by inspection of the code

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

11 years agoOnly update regunit live ranges that have been precomputed.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 18:00:57 +0000 (18:00 +0000)]
Only update regunit live ranges that have been precomputed.

Regunit live ranges are computed on demand, so when mi-sched calls
handleMove, some regunits may not have live ranges yet.

That makes updating them easier: Just skip the non-existing ranges. They
will be computed correctly from the rescheduled machine code when they
are needed.

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

11 years agoreplace usage of EmitGEPOffset() with TargetData::getIndexedOffset() when the GEP...
Nuno Lopes [Wed, 20 Jun 2012 17:30:51 +0000 (17:30 +0000)]
replace usage of EmitGEPOffset() with TargetData::getIndexedOffset() when the GEP offset is known to be constant.
With this change, we avoid relying on the IR Builder to constant fold the operations.

No functionality change intended.

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

11 years agoDelete dead code.
Jakob Stoklund Olesen [Wed, 20 Jun 2012 16:38:50 +0000 (16:38 +0000)]
Delete dead code.

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

11 years agoAdd support for generating reg+reg (indexed) pre-inc loads on PPC.
Hal Finkel [Wed, 20 Jun 2012 15:43:03 +0000 (15:43 +0000)]
Add support for generating reg+reg (indexed) pre-inc loads on PPC.

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

11 years agoFix DAGCombine to deal with ext-conversion of pre/post_inc loads.
Hal Finkel [Wed, 20 Jun 2012 15:42:48 +0000 (15:42 +0000)]
Fix DAGCombine to deal with ext-conversion of pre/post_inc loads.

The test case for this will come with the PPC indexed preinc loads commit.

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

11 years agoFixing a compiler warning in MSVC 10.
Aaron Ballman [Wed, 20 Jun 2012 14:44:44 +0000 (14:44 +0000)]
Fixing a compiler warning in MSVC 10.

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

11 years agoSphinxify the SegmentedStack document.
Bill Wendling [Wed, 20 Jun 2012 12:05:05 +0000 (12:05 +0000)]
Sphinxify the SegmentedStack document.

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

11 years agoMove coding standards reference from development_process.rst to programming.rst.
Bill Wendling [Wed, 20 Jun 2012 11:56:24 +0000 (11:56 +0000)]
Move coding standards reference from development_process.rst to programming.rst.

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

11 years agoUnindent list.
Bill Wendling [Wed, 20 Jun 2012 11:55:22 +0000 (11:55 +0000)]
Unindent list.

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

11 years agoUn-indent list to remove ugly back-slash.
Bill Wendling [Wed, 20 Jun 2012 11:53:08 +0000 (11:53 +0000)]
Un-indent list to remove ugly back-slash.

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

11 years agoFix the formatting a bit.
Bill Wendling [Wed, 20 Jun 2012 11:25:11 +0000 (11:25 +0000)]
Fix the formatting a bit.

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

11 years agoSphinxify the developer policy document.
Bill Wendling [Wed, 20 Jun 2012 11:20:07 +0000 (11:20 +0000)]
Sphinxify the developer policy document.

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

11 years agoSphinxify the lexicon doc.
Bill Wendling [Wed, 20 Jun 2012 10:36:41 +0000 (10:36 +0000)]
Sphinxify the lexicon doc.

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

11 years agoSphinxify BranchWeightMetadata document.
Bill Wendling [Wed, 20 Jun 2012 10:17:46 +0000 (10:17 +0000)]
Sphinxify BranchWeightMetadata document.

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

11 years agoSphinxify the LTO document.
Bill Wendling [Wed, 20 Jun 2012 10:08:02 +0000 (10:08 +0000)]
Sphinxify the LTO document.

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

11 years agoUnindent list.
Bill Wendling [Wed, 20 Jun 2012 09:50:45 +0000 (09:50 +0000)]
Unindent list.

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

11 years agoSphinxify the AliasAnalysis document.
Bill Wendling [Wed, 20 Jun 2012 09:49:57 +0000 (09:49 +0000)]
Sphinxify the AliasAnalysis document.

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

11 years agoUnindent list.
Bill Wendling [Wed, 20 Jun 2012 09:49:06 +0000 (09:49 +0000)]
Unindent list.

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

11 years agoUn-indent the list and remove ugly back-slash.
Bill Wendling [Wed, 20 Jun 2012 09:48:38 +0000 (09:48 +0000)]
Un-indent the list and remove ugly back-slash.

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

11 years agoRemove 'static' from inline functions defined in header files.
Chandler Carruth [Wed, 20 Jun 2012 08:39:33 +0000 (08:39 +0000)]
Remove 'static' from inline functions defined in header files.

There is a pretty staggering amount of this in LLVM's header files, this
is not all of the instances I'm afraid. These include all of the
functions that (in my build) are used by a non-static inline (or
external) function. Specifically, these issues were caught by the new
'-Winternal-linkage-in-inline' warning.

I'll try to just clean up the remainder of the clearly redundant "static
inline" cases on functions (not methods!) defined within headers if
I can do so in a reliable way.

There were even several cases of a missing 'inline' altogether, or my
personal favorite "static bool inline". Go figure. ;]

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

11 years agoFix two rather subtle internal vs. external linker issues.
Chandler Carruth [Wed, 20 Jun 2012 08:39:30 +0000 (08:39 +0000)]
Fix two rather subtle internal vs. external linker issues.

I'll admit I'm not entirely satisfied with this change, but it seemed
the cleanest option. Other suggestions quite welcome

The issue is that the traits specializations have static methods which
return the typedef'ed PHI_iterator type. In both the IR and MI layers
this is typedef'ed to a custom iterator class defined in an anonymous
namespace giving the types and the functions returning them internal
linkage. However, because the traits specialization is defined in the
'llvm' namespace (where it has to be, specialized template lives there),
and is in turn used in the templated implementation of the SSAUpdater.
This led to the linkage conflict that Clang now warns about.

The simplest solution to me was just to define the PHI_iterator as
a nested class inside the trait specialization. That way it still
doesn't get scoped widely, it can't be accidentally reused somewhere,
etc. This is a little gross just because nested class definitions are
a little gross, but the alternatives seem more ad-hoc.

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

11 years agoFix inappropriate use of anonymous namespaces in unittests.
Chandler Carruth [Wed, 20 Jun 2012 08:39:27 +0000 (08:39 +0000)]
Fix inappropriate use of anonymous namespaces in unittests.

The TEST_F macros actually declare *subclasses* of the test fixtures.
Even if they didn't we don't want them to declare external functions.
The entire unit test, including both the fixture class and the fixture
test cases should be wrapped in the anonymous namespace.

This issue was caught by the new '-Winternal-linkage-in-inline' warning.

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

11 years agoAdd predicate check around some patterns.
Craig Topper [Wed, 20 Jun 2012 07:30:23 +0000 (07:30 +0000)]
Add predicate check around some patterns.

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

11 years agoAdd predicate check around some patterns.
Craig Topper [Wed, 20 Jun 2012 07:01:11 +0000 (07:01 +0000)]
Add predicate check around some patterns.

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

11 years agoDon't insert 128-bit UNDEF into 256-bit vectors. Just keep the 256-bit vector. Origin...
Craig Topper [Wed, 20 Jun 2012 05:39:26 +0000 (05:39 +0000)]
Don't insert 128-bit UNDEF into 256-bit vectors. Just keep the 256-bit vector. Original patch by Elena Demikhovsky. Tweaked by me to allow possibility of covering more cases.

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

11 years agoA new algorithm for computing LoopInfo. Temporarily disabled.
Andrew Trick [Wed, 20 Jun 2012 05:23:33 +0000 (05:23 +0000)]
A new algorithm for computing LoopInfo. Temporarily disabled.

-stable-loops enables a new algorithm for generating the Loop
forest. It differs from the original algorithm in a few respects:

- Not determined by use-list order.
- Initially guarantees RPO order of block and subloops.
- Linear in the number of CFG edges.
- Nonrecursive.

I didn't want to change the LoopInfo API yet, so the block lists are
still inclusive. This seems strange to me, and it means that building
LoopInfo is not strictly linear, but it may not be a problem in
practice. At least the block lists start out in RPO order now. In the
future we may add an attribute or wrapper analysis that allows other
passes to assume RPO order.

The primary motivation of this work was not to optimize LoopInfo, but
to allow reproducing performance issues by decomposing the compilation
stages. I'm often unable to do this with the current LoopInfo, because
the loop tree order determines Loop pass order. Serializing the IR
tends to invert the order, which reverses the optimization order. This
makes it nearly impossible to debug interdependent loop optimizations
such as LSR.

I also believe this will provide more stable performance results across time.

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

11 years agoSphinxify the MakefileGuide document.
Bill Wendling [Wed, 20 Jun 2012 04:20:39 +0000 (04:20 +0000)]
Sphinxify the MakefileGuide document.

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

11 years agoUnbreak the MSVC build: add return to unimplemented functions.
Francois Pichet [Wed, 20 Jun 2012 04:08:49 +0000 (04:08 +0000)]
Unbreak the MSVC build: add return to unimplemented functions.

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

11 years agoMove the implementation of LoopInfo into LoopInfoImpl.h.
Andrew Trick [Wed, 20 Jun 2012 03:42:09 +0000 (03:42 +0000)]
Move the implementation of LoopInfo into LoopInfoImpl.h.

The implementation only needs inclusion from LoopInfo.cpp and
MachineLoopInfo.cpp. Clients of the interface should only include the
interface. This makes the interface readable and speeds up rebuilds
after modifying the implementation.

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

11 years agoSphinxify the CodingStandard documentation.
Bill Wendling [Wed, 20 Jun 2012 02:57:56 +0000 (02:57 +0000)]
Sphinxify the CodingStandard documentation.

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

11 years agoAdd permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs and...
Nick Kledzik [Wed, 20 Jun 2012 00:28:54 +0000 (00:28 +0000)]
Add permissions(), map_file_pages(), and unmap_file_pages() to llvm::sys::fs and add unit test. Unix is implemented.  Windows side needs to be implemented.

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

11 years agoDon't assert when given an empty range.
Kaelyn Uhrain [Wed, 20 Jun 2012 00:16:40 +0000 (00:16 +0000)]
Don't assert when given an empty range.

llvm::RawMemoryObject handles empty ranges just fine, and the assert can
be triggered in the wild by e.g. invoking clang with a file that
included an empty pre-compiled header file when clang has been built
with assertions enabled. Without assertions enabled, clang will properly
report that the empty file is not a valid PCH.

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

11 years agoAdd regunit liveness support to LiveIntervals::handleMove().
Jakob Stoklund Olesen [Tue, 19 Jun 2012 23:50:18 +0000 (23:50 +0000)]
Add regunit liveness support to LiveIntervals::handleMove().

When LiveIntervals is tracking fixed interference in regunits, make sure
to update those intervals as well. Currently guarded by -live-regunits.

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

11 years agoAlphabetize.
Bill Wendling [Tue, 19 Jun 2012 23:47:58 +0000 (23:47 +0000)]
Alphabetize.

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

11 years agoTidy up.
Chad Rosier [Tue, 19 Jun 2012 23:37:57 +0000 (23:37 +0000)]
Tidy up.

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

11 years agoAdd an ensureMaxAlignment() function to MachineFrameInfo (analogous to
Chad Rosier [Tue, 19 Jun 2012 22:59:12 +0000 (22:59 +0000)]
Add an ensureMaxAlignment() function to MachineFrameInfo (analogous to
ensureAlignment() in MachineFunction).  Also, drop setMaxAlignment() in
favor of this new function.  This creates a main entry point to setting
MaxAlignment, which will be helpful for future work.  No functionality
change intended.

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

11 years agoAdd DAG-combines for aggressive FMA formation.
Lang Hames [Tue, 19 Jun 2012 22:51:23 +0000 (22:51 +0000)]
Add DAG-combines for aggressive FMA formation.

This patch adds DAG combines to form FMAs from pairs of FADD + FMUL or
FSUB + FMUL. The combines are performed when:
(a) Either
      AllowExcessFPPrecision option (-enable-excess-fp-precision for llc)
        OR
      UnsafeFPMath option (-enable-unsafe-fp-math)
    are set, and
(b) TargetLoweringInfo::isFMAFasterThanMulAndAdd(VT) is true for the type of
    the FADD/FSUB, and
(c) The FMUL only has one user (the FADD/FSUB).

If your target has fast FMA instructions you can make use of these combines by
overriding TargetLoweringInfo::isFMAFasterThanMulAndAdd(VT) to return true for
types supported by your FMA instruction, and adding patterns to match ISD::FMA
to your FMA instructions.

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

11 years ago80 col.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 22:50:53 +0000 (22:50 +0000)]
80 col.

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

11 years agoTypo. Patch by Cameron McInally <cameron.mcinally@nyu.edu>.
Chad Rosier [Tue, 19 Jun 2012 22:28:18 +0000 (22:28 +0000)]
Typo. Patch by Cameron McInally <cameron.mcinally@nyu.edu>.

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

11 years agoAdd Projects.rst to the toctree.
Bill Wendling [Tue, 19 Jun 2012 22:25:41 +0000 (22:25 +0000)]
Add Projects.rst to the toctree.

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

11 years agoUse correct capitalization.
Bill Wendling [Tue, 19 Jun 2012 22:25:17 +0000 (22:25 +0000)]
Use correct capitalization.

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

11 years agoAdd a triple.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:46:25 +0000 (21:46 +0000)]
Add a triple.

The test was failing on Linux because of asm syntax differences.

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

11 years agoImplement PPCInstrInfo::isCoalescableExtInstr().
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:14:34 +0000 (21:14 +0000)]
Implement PPCInstrInfo::isCoalescableExtInstr().

The PPC::EXTSW instruction preserves the low 32 bits of its input, just
like some of the x86 instructions. Use it to reduce register pressure
when the low 32 bits have multiple uses.

This requires a small change to PeepholeOptimizer since EXTSW takes a
64-bit input register.

This is related to PR5997.

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

11 years agoStyle: Don't reuse variables for multiple purposes.
Jakob Stoklund Olesen [Tue, 19 Jun 2012 21:10:18 +0000 (21:10 +0000)]
Style: Don't reuse variables for multiple purposes.

No functional change.

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

11 years agoNew test tool: obj2yaml
Marshall Clow [Tue, 19 Jun 2012 18:02:35 +0000 (18:02 +0000)]
New test tool: obj2yaml

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

11 years agoIndent coding examples.
Bill Wendling [Tue, 19 Jun 2012 17:48:06 +0000 (17:48 +0000)]
Indent coding examples.

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

11 years agoRemove bad HTML tags. Add missing :.
Bill Wendling [Tue, 19 Jun 2012 17:43:57 +0000 (17:43 +0000)]
Remove bad HTML tags. Add missing :.

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