Commit Graph

83444 Commits

Author SHA1 Message Date
Nuno Lopes
f1fb6c8369 instcombine: disable optimization of 'invoke null/undef'. I'll move this functionality to SimplifyCFG (since we cannot make changes to the CFG here).
Fixes the crashes with the attached test case

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158951 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 23:52:14 +00:00
Michael J. Spencer
55eda324c4 [docs] Sphinxify GettingStartedVS. Patch by Mikael Lyngvig!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158947 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 23:27:09 +00:00
Evan Cheng
2a5422b1a6 Look pass zext to strength reduce an udiv. Patch by David Majnemer. rdar://11721329
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158946 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 22:52:49 +00:00
Arnaud A. de Grandmaison
5791df830d Remove trailing whitespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158943 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 22:26:01 +00:00
NAKAMURA Takumi
f455101bad llvm/unittests: Simplify LINK_COMPONENTS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158942 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 22:17:51 +00:00
NAKAMURA Takumi
c2270a48e3 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
2012-06-21 22:17:39 +00:00
Jack Carter
4db98becf7 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
2012-06-21 21:37:54 +00:00
Nuno Lopes
2b3e958053 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
2012-06-21 21:25:05 +00:00
Akira Hatanaka
54c5bc8799 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
2012-06-21 20:39:10 +00:00
Akira Hatanaka
43d2ff1171 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
2012-06-21 20:23:32 +00:00
Hal Finkel
2bbc9193b4 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
2012-06-21 20:10:48 +00:00
Chandler Carruth
343c32a39c 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
2012-06-21 18:44:24 +00:00
Nuno Lopes
ef22f04bad 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
2012-06-21 18:38:26 +00:00
Pete Cooper
438c04027b 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
2012-06-21 18:00:39 +00:00
Jack Carter
d5e11ad51a 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
2012-06-21 17:14:46 +00:00
Nuno Lopes
10cefaab3f 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
2012-06-21 16:58:41 +00:00
Nuno Lopes
034dd6c6a1 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
2012-06-21 16:47:58 +00:00
Nuno Lopes
7f5847270a 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
2012-06-21 15:59:53 +00:00
Nuno Lopes
9e72a79ef4 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
2012-06-21 15:45:28 +00:00
Nadav Rotem
2114a8aaba 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
2012-06-21 13:44:31 +00:00
NAKAMURA Takumi
e42e9ce20f 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
2012-06-21 13:43:06 +00:00
NAKAMURA Takumi
31f97a322b 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
2012-06-21 12:44:58 +00:00
Chandler Carruth
bd9060c5c0 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
2012-06-21 10:02:41 +00:00
Chandler Carruth
53afd08bd1 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
2012-06-21 10:02:40 +00:00
Chandler Carruth
7c888eee47 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
2012-06-21 09:51:26 +00:00
Nadav Rotem
7060221ae2 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
2012-06-21 08:58:15 +00:00
Bill Wendling
09d3233c9e Cleanup some encoding mishaps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158904 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 07:01:02 +00:00
Bill Wendling
bd96e0de3f Sphinxify the tablegen document.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158903 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 06:58:24 +00:00
Lang Hames
dc13d2ed2f 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
2012-06-21 06:10:00 +00:00
Bill Wendling
1d4e62878e Sphinxify the outdated Packaging documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158901 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-21 06:09:37 +00:00
Evan Cheng
8ef0968dc2 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
2012-06-21 05:56:05 +00:00
Chandler Carruth
b60182e99b 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
2012-06-21 05:16:58 +00:00
Chandler Carruth
b1081af7a2 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
2012-06-21 02:02:48 +00:00
Chandler Carruth
45df6f9e04 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
2012-06-21 01:35:09 +00:00
Jakob Stoklund Olesen
71b49cb5c7 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
2012-06-21 00:09:15 +00:00
Meador Inge
e3c9ccd312 Put space after "code-block::".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158880 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 23:57:00 +00:00
Jakob Stoklund Olesen
895fe24557 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
2012-06-20 23:54:20 +00:00
Jakob Stoklund Olesen
0f3c892cde Remove spurious typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158878 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 23:54:18 +00:00
Meador Inge
d65ebceeba 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
2012-06-20 23:48:01 +00:00
Jakob Stoklund Olesen
312244747c 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
2012-06-20 23:47:58 +00:00
Jakob Stoklund Olesen
c4118452bc 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
2012-06-20 23:31:34 +00:00
Jakob Stoklund Olesen
12a7be9ba4 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
2012-06-20 23:23:59 +00:00
Jakob Stoklund Olesen
d4348a2dc2 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
2012-06-20 22:52:29 +00:00
Jakob Stoklund Olesen
042888db2b 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
2012-06-20 22:52:26 +00:00
Jakob Stoklund Olesen
812cda9a5c 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
2012-06-20 22:52:24 +00:00
Jakob Stoklund Olesen
797e9a7737 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
2012-06-20 22:52:22 +00:00
Jakob Stoklund Olesen
3b30bca16f 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
2012-06-20 22:32:05 +00:00
Andrew Trick
b9598e41bc 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
2012-06-20 22:18:33 +00:00
Bill Wendling
3950e9e650 Sphixify the GEP FAQ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158858 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-20 21:54:22 +00:00
Jakob Stoklund Olesen
d67582e276 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
2012-06-20 21:25:05 +00:00