oota-llvm.git
13 years agobuild/Makefiles: Don't build unittests when ONLY_TOOLS is set.
Daniel Dunbar [Sat, 27 Nov 2010 06:59:16 +0000 (06:59 +0000)]
build/Makefiles: Don't build unittests when ONLY_TOOLS is set.

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

13 years agoObject/Mach-O: Validate Mach-O magic and initialize format info.
Daniel Dunbar [Sat, 27 Nov 2010 06:39:22 +0000 (06:39 +0000)]
Object/Mach-O: Validate Mach-O magic and initialize format info.

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

13 years agoAdd NEON VLD1-dup instructions (load 1 element to all lanes).
Bob Wilson [Sat, 27 Nov 2010 06:35:16 +0000 (06:35 +0000)]
Add NEON VLD1-dup instructions (load 1 element to all lanes).

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

13 years agoFix incorrect scheduling itineraries for NEON vld1/vst1 instructions.
Bob Wilson [Sat, 27 Nov 2010 06:35:09 +0000 (06:35 +0000)]
Fix incorrect scheduling itineraries for NEON vld1/vst1 instructions.
I added these instructions recently but I have no idea where these "1"
values in the NextCycles field came from.  As far as I can tell now,
these instruction stages are clearly intended to overlap.

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

13 years agomacho-dump: More sketching.
Daniel Dunbar [Sat, 27 Nov 2010 06:19:17 +0000 (06:19 +0000)]
macho-dump: More sketching.

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

13 years agomacho-dump: Stub out C++ macho-dump tool.
Daniel Dunbar [Sat, 27 Nov 2010 05:58:44 +0000 (05:58 +0000)]
macho-dump: Stub out C++ macho-dump tool.

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

13 years agoMC/Mach-O: Start stubbing out a Mach-O object file wrapper.
Daniel Dunbar [Sat, 27 Nov 2010 05:38:50 +0000 (05:38 +0000)]
MC/Mach-O: Start stubbing out a Mach-O object file wrapper.

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

13 years agoReduce nesting.
Daniel Dunbar [Sat, 27 Nov 2010 05:18:48 +0000 (05:18 +0000)]
Reduce nesting.

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

13 years agoMC/Mach-O: Migrate more constants into MachOFormat.h.
Daniel Dunbar [Sat, 27 Nov 2010 04:59:14 +0000 (04:59 +0000)]
MC/Mach-O: Migrate more constants into MachOFormat.h.

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

13 years agoMC/Mach-O: Switch to using MachOFormat.h.
Daniel Dunbar [Sat, 27 Nov 2010 04:38:36 +0000 (04:38 +0000)]
MC/Mach-O: Switch to using MachOFormat.h.
 - I'm leaving MachO.h, because I believe it has external consumers, but I would really like to eliminate it (we have stylistic disagreements with one another).

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

13 years agoMC/Mach-O: Introduce Object/MachOFormat for describing purely platform / machine
Daniel Dunbar [Sat, 27 Nov 2010 04:19:38 +0000 (04:19 +0000)]
MC/Mach-O: Introduce Object/MachOFormat for describing purely platform / machine
independent information on the Mach object format, and move some stuff from
MachObjectWriter.cpp there.

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

13 years agomacho-dump: Fix typo.
Daniel Dunbar [Sat, 27 Nov 2010 04:00:06 +0000 (04:00 +0000)]
macho-dump: Fix typo.

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

13 years agoBitVector tweaks.
Benjamin Kramer [Fri, 26 Nov 2010 18:25:20 +0000 (18:25 +0000)]
BitVector tweaks.

- Double the vector's capacity when growing to avoid unneeccesary reallocation.
- Do the reallocation with realloc(3) which can expand the memory in place.

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

13 years agoStringRefs are POD-like.
Benjamin Kramer [Fri, 26 Nov 2010 14:36:54 +0000 (14:36 +0000)]
StringRefs are POD-like.

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

13 years agounittests/JITTests: Don't use --export-dynamic but --export-all-symbols on cygming.
NAKAMURA Takumi [Fri, 26 Nov 2010 09:32:02 +0000 (09:32 +0000)]
unittests/JITTests: Don't use --export-dynamic but --export-all-symbols on cygming.

GNU ld/PECOFF accepts but ignores them below;
  --version-script
  --export-dynamic
  --rpath

FIXME: autoconf should be aware of them.

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

13 years agotest/site.exp.in: Add "emitir", for now, fixing up r120156. CMake depends on site...
NAKAMURA Takumi [Fri, 26 Nov 2010 08:30:15 +0000 (08:30 +0000)]
test/site.exp.in: Add "emitir", for now, fixing up r120156. CMake depends on site.exp.in, though, "emitir" might be unused.

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

13 years agoAdd B+-tree test case that creates a height 3 tree with a smaller root node.
Jakob Stoklund Olesen [Fri, 26 Nov 2010 06:54:20 +0000 (06:54 +0000)]
Add B+-tree test case that creates a height 3 tree with a smaller root node.

Change temporary debugging code to write a dot file directly.

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

13 years agoExtract template function adjustSiblingSizes(), allowing instances to be shared
Jakob Stoklund Olesen [Fri, 26 Nov 2010 06:54:17 +0000 (06:54 +0000)]
Extract template function adjustSiblingSizes(), allowing instances to be shared
between B+-trees using the same KeyT.

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

13 years agoRemove the unused TheTarget member.
Rafael Espindola [Fri, 26 Nov 2010 04:24:21 +0000 (04:24 +0000)]
Remove the unused TheTarget member.

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

13 years agoFix spelling!
Michael J. Spencer [Fri, 26 Nov 2010 04:16:20 +0000 (04:16 +0000)]
Fix spelling!

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

13 years agoFix Whitespace.
Michael J. Spencer [Fri, 26 Nov 2010 04:16:08 +0000 (04:16 +0000)]
Fix Whitespace.

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

13 years agoMove tree navigation to a new Path class that doesn't have to be a template.
Jakob Stoklund Olesen [Fri, 26 Nov 2010 01:39:40 +0000 (01:39 +0000)]
Move tree navigation to a new Path class that doesn't have to be a template.

The path also holds a reference to the root node, and that allows important
iterator accessors like start() and stop() to have no conditional code. (When
the compiler is clever enough to remove it.)

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

13 years agoRemove explicit uses of -emit-llvm, the test infrastructure adds it
Duncan Sands [Thu, 25 Nov 2010 21:48:20 +0000 (21:48 +0000)]
Remove explicit uses of -emit-llvm, the test infrastructure adds it
automatically.  Use -S with llvm-gcc rather than -c, so tests can
work when llvm-gcc is really dragonegg (which can output IR with -S
but not -c).  Yes, dragonegg supports objective-c++ (poorly though).

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

13 years agoRemove explicit uses of -emit-llvm, the test infrastructure adds it
Duncan Sands [Thu, 25 Nov 2010 21:46:07 +0000 (21:46 +0000)]
Remove explicit uses of -emit-llvm, the test infrastructure adds it
automatically.  Use -S with llvm-gcc rather than -c, so tests can
work when llvm-gcc is really dragonegg (which can output IR with -S
but not -c).  Yes, dragonegg supports objective-c (poorly though).

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

13 years agoBump required cmake version on CMake.html.
Oscar Fuentes [Thu, 25 Nov 2010 21:41:48 +0000 (21:41 +0000)]
Bump required cmake version on CMake.html.

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

13 years agoUse -S rather than -c for the benefit of dragonegg.
Duncan Sands [Thu, 25 Nov 2010 21:41:35 +0000 (21:41 +0000)]
Use -S rather than -c for the benefit of dragonegg.

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

13 years agoRemove explicit uses of -emit-llvm, the test infrastructure adds it
Duncan Sands [Thu, 25 Nov 2010 21:39:17 +0000 (21:39 +0000)]
Remove explicit uses of -emit-llvm, the test infrastructure adds it
automatically.  Use -S with llvm-gcc rather than -c, so tests can
work when llvm-gcc is really dragonegg (which can output IR with -S
but not -c).

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

13 years agoJudging from the comment, the system assembler is supposed to assemble
Duncan Sands [Thu, 25 Nov 2010 21:26:21 +0000 (21:26 +0000)]
Judging from the comment, the system assembler is supposed to assemble
the output of this test.  Since it was producing bitcode, that clearly
wasn't happening!  Have it produce target assembler and assemble that
instead.

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

13 years agoRemove explicit uses of -emit-llvm, the test infrastructure adds it
Duncan Sands [Thu, 25 Nov 2010 21:24:35 +0000 (21:24 +0000)]
Remove explicit uses of -emit-llvm, the test infrastructure adds it
automatically.  Use -S with llvm-gcc rather than -c, so tests can
work when llvm-gcc is really dragonegg (which can output IR with -S
but not -c).

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

13 years agoDragonegg cannot output bitcode, only human readable IR, so use -S rather
Duncan Sands [Thu, 25 Nov 2010 21:21:59 +0000 (21:21 +0000)]
Dragonegg cannot output bitcode, only human readable IR, so use -S rather
than -c.

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

13 years agoUse LLVMCC_EMITIR_FLAG rather than hard-coding "-emit-llvm".
Duncan Sands [Thu, 25 Nov 2010 21:19:52 +0000 (21:19 +0000)]
Use LLVMCC_EMITIR_FLAG rather than hard-coding "-emit-llvm".

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

13 years agoUsing LLVMCC_EMITIR_FLAG rather than hard-coding -emit-llvm
Duncan Sands [Thu, 25 Nov 2010 21:14:55 +0000 (21:14 +0000)]
Using LLVMCC_EMITIR_FLAG rather than hard-coding -emit-llvm
(dragonegg cannot use -emit-llvm so needs a different flag
to everyone else).

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

13 years agoIt seems inconsistent to have LLVMCC_EMITIR_FLAG and
Duncan Sands [Thu, 25 Nov 2010 17:57:43 +0000 (17:57 +0000)]
It seems inconsistent to have LLVMCC_EMITIR_FLAG and
LLVMGCC_DISABLEOPT_FLAGS, one with CC in it, the other
with GCC.  Rename LLVMGCC_DISABLEOPT_FLAGS to
LLVMCC_DISABLEOPT_FLAGS.

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

13 years agoSDep is POD-like. Shave off a few bytes from SUnit by moving a member around.
Benjamin Kramer [Thu, 25 Nov 2010 17:50:19 +0000 (17:50 +0000)]
SDep is POD-like. Shave off a few bytes from SUnit by moving a member around.

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

13 years agoInitial support for being able to specify the llvm-gcc to use like this:
Duncan Sands [Thu, 25 Nov 2010 17:47:42 +0000 (17:47 +0000)]
Initial support for being able to specify the llvm-gcc to use like this:
  --with-llvmgcc="gcc-4.5 -fplugin=dragonegg.so"

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

13 years agoUse multiple 0x66 prefixes so that all nops up to 15 bytes are a single instruction.
Rafael Espindola [Thu, 25 Nov 2010 17:14:16 +0000 (17:14 +0000)]
Use multiple 0x66 prefixes so that all nops up to 15 bytes are a single instruction.

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

13 years agoNamespacify.
Benjamin Kramer [Thu, 25 Nov 2010 16:42:51 +0000 (16:42 +0000)]
Namespacify.

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

13 years agoFactor some code to parseSectionFlags and fix the default type of a section.
Rafael Espindola [Thu, 25 Nov 2010 15:32:56 +0000 (15:32 +0000)]
Factor some code to parseSectionFlags and fix the default type of a section.

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

13 years agosystem_error: Even more unsupported error numbers :(.
Michael J. Spencer [Thu, 25 Nov 2010 01:53:59 +0000 (01:53 +0000)]
system_error: Even more unsupported error numbers :(.

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

13 years agoTreat a call of function pointer like a load of the pointer when considering
Nick Lewycky [Wed, 24 Nov 2010 22:04:20 +0000 (22:04 +0000)]
Treat a call of function pointer like a load of the pointer when considering
whether the pointer can be replaced with the global variable it is a copy of.
Fixes PR8680.

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

13 years agoBehave a bit more like gnu as and use the symbol (instead of the section)
Rafael Espindola [Wed, 24 Nov 2010 21:57:39 +0000 (21:57 +0000)]
Behave a bit more like gnu as and use the symbol (instead of the section)
for any relocation to a symbol defined in a tls section.

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

13 years ago80 col.
Michael J. Spencer [Wed, 24 Nov 2010 20:07:14 +0000 (20:07 +0000)]
80 col.

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

13 years agogoogle test depends on Support.
Michael J. Spencer [Wed, 24 Nov 2010 19:35:15 +0000 (19:35 +0000)]
google test depends on Support.

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

13 years agoRelocate with the symbol if the relocation is of kind NTPOFF.
Rafael Espindola [Wed, 24 Nov 2010 19:23:50 +0000 (19:23 +0000)]
Relocate with the symbol if the relocation is of kind NTPOFF.
Patch by David Meyer, I added the test.

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

13 years agounittests: Add initial Path-V2 test.
Michael J. Spencer [Wed, 24 Nov 2010 19:20:28 +0000 (19:20 +0000)]
unittests: Add initial Path-V2 test.

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

13 years agoPath Version 2.
Michael J. Spencer [Wed, 24 Nov 2010 19:20:19 +0000 (19:20 +0000)]
Path Version 2.

Based on TR2/boost filesystem (v3) API, but modified to remove exceptions.

Do not include this file directly, when it is ready, it will be included by
include/llvm/System/Path.h.

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

13 years agounittests: Add SystemTests.
Michael J. Spencer [Wed, 24 Nov 2010 19:20:05 +0000 (19:20 +0000)]
unittests: Add SystemTests.

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

13 years agoFix and add tests for all cases in x86 and x86_64 where gnu as implicitly
Rafael Espindola [Wed, 24 Nov 2010 18:51:21 +0000 (18:51 +0000)]
Fix and add tests for all cases in x86 and x86_64 where gnu as implicitly
sets the type of a symbol to STT_TLS.

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

13 years agoTestcase for r120017.
Rafael Espindola [Wed, 24 Nov 2010 18:03:57 +0000 (18:03 +0000)]
Testcase for r120017.

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

13 years agoUpdating MBlaze .mask and .frame directives to match GCC's output and fixing regressi...
Wesley Peck [Wed, 24 Nov 2010 16:32:35 +0000 (16:32 +0000)]
Updating MBlaze .mask and .frame directives to match GCC's output and fixing regression introduced in 120095 by checking MCStreamer::hasRawTextSupport.

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

13 years ago1. Fixing error where basic block labels were not being printed out when they need...
Wesley Peck [Wed, 24 Nov 2010 15:39:32 +0000 (15:39 +0000)]
1. Fixing error where basic block labels were not being printed out when they need to be for the MBlaze backend because AsmPrinter::isBlockOnlyReachableByFallthrough does not take into account delay slots.
2. Re-adding .mask and .frame directives in printed assembly.
3. Adding .ent and .end directives in printed assembly.
4. Minor cleanups to MBlaze backend.

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

13 years agoUse i8 as SETCC result type for i1 in SPU.
Kalle Raiskila [Wed, 24 Nov 2010 12:59:16 +0000 (12:59 +0000)]
Use i8 as SETCC result type for i1 in SPU.

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

13 years agoAllow for 'fcmp ogt' in SPU.
Kalle Raiskila [Wed, 24 Nov 2010 11:42:17 +0000 (11:42 +0000)]
Allow for 'fcmp ogt' in SPU.

Fix by Visa Putkinen!

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

13 years agoIf a symbol is used as tls, mark it as tls even if not declare as so. Probably
Rafael Espindola [Wed, 24 Nov 2010 02:19:40 +0000 (02:19 +0000)]
If a symbol is used as tls, mark it as tls even if not declare as so. Probably
fixes PR8659.

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

13 years agoinclude/llvm/System/system_error.h: ECANCELED is undefined on Cygwin-1.5.
NAKAMURA Takumi [Wed, 24 Nov 2010 01:29:45 +0000 (01:29 +0000)]
include/llvm/System/system_error.h: ECANCELED is undefined on Cygwin-1.5.

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

13 years agoTweak ImmutableMap/ImmutableSet/ImmutableList APIs
Ted Kremenek [Wed, 24 Nov 2010 00:54:28 +0000 (00:54 +0000)]
Tweak ImmutableMap/ImmutableSet/ImmutableList APIs
to use lowercase letters for the start of most
method names and to replace some method names
with more descriptive names (e.g., "getLeft()"
instead of "Left()").  No real functionality
change.

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

13 years agoGeneralize overflowLeaf to also handle overflows in branch nodes.
Jakob Stoklund Olesen [Wed, 24 Nov 2010 00:03:32 +0000 (00:03 +0000)]
Generalize overflowLeaf to also handle overflows in branch nodes.

This doesn't quite work yet because the calls to treeDecrement and treeIncrement
operate at the leaf level, not on pathNode(Level) as required.

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

13 years agoadd a MemoryBuffer::getOpenFile method, which turns an open
Chris Lattner [Tue, 23 Nov 2010 22:20:27 +0000 (22:20 +0000)]
add a MemoryBuffer::getOpenFile method, which turns an open
file descriptor into a MemoryBuffer (and closes the FD).

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

13 years agosystem_error: Add fixme.
Michael J. Spencer [Tue, 23 Nov 2010 21:09:11 +0000 (21:09 +0000)]
system_error: Add fixme.

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

13 years agoRename SimplifyDistributed to the more meaningfull name SimplifyByFactorizing.
Duncan Sands [Tue, 23 Nov 2010 20:42:39 +0000 (20:42 +0000)]
Rename SimplifyDistributed to the more meaningfull name SimplifyByFactorizing.

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

13 years agoThe srem -> urem transform is not safe for any divisor that's not a power of two.
Benjamin Kramer [Tue, 23 Nov 2010 20:33:57 +0000 (20:33 +0000)]
The srem -> urem transform is not safe for any divisor that's not a power of two.
E.g. -5 % 5 is 0 with srem and 1 with urem.

Also addresses Frits van Bommel's comments.

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

13 years agoReplace calls to ConstantFoldInstruction with calls to SimplifyInstruction
Duncan Sands [Tue, 23 Nov 2010 20:26:33 +0000 (20:26 +0000)]
Replace calls to ConstantFoldInstruction with calls to SimplifyInstruction
in two places that are really interested in simplified instructions, not
constants.

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

13 years agoConstant folding here is pointless, because InstructionSimplify
Duncan Sands [Tue, 23 Nov 2010 20:24:21 +0000 (20:24 +0000)]
Constant folding here is pointless, because InstructionSimplify
(which does constant folding and more) is called a few lines
later.

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

13 years agoMove the ARM reloc constants to Support/ELF.h
Jason W Kim [Tue, 23 Nov 2010 19:40:36 +0000 (19:40 +0000)]
Move the ARM reloc constants to Support/ELF.h

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

13 years agoRecognize sign/zero-extended constant BUILD_VECTORs for VMULL operations.
Bob Wilson [Tue, 23 Nov 2010 19:38:38 +0000 (19:38 +0000)]
Recognize sign/zero-extended constant BUILD_VECTORs for VMULL operations.
We need to check if the individual vector elements are sign/zero-extended
values.  For now this only handles constants values.  Radar 8687140.

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

13 years agoFix copy-and-paste error in exception message.
Bob Wilson [Tue, 23 Nov 2010 19:38:34 +0000 (19:38 +0000)]
Fix copy-and-paste error in exception message.

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

13 years agoInstCombine: Reduce "X shift (A srem B)" to "X shift (A urem B)" iff B is positive.
Benjamin Kramer [Tue, 23 Nov 2010 18:52:42 +0000 (18:52 +0000)]
InstCombine: Reduce "X shift (A srem B)" to "X shift (A urem B)" iff B is positive.

This allows to transform the rem in "1 << ((int)x % 8);" to an and.

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

13 years agoPropagate LeftDistributes and RightDistributes into their only uses.
Duncan Sands [Tue, 23 Nov 2010 15:28:14 +0000 (15:28 +0000)]
Propagate LeftDistributes and RightDistributes into their only uses.
Stylistic improvement suggested by Frits van Bommel.

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

13 years agoFix typo pointed out by Frits van Bommel and Marius Wachtler.
Duncan Sands [Tue, 23 Nov 2010 15:25:34 +0000 (15:25 +0000)]
Fix typo pointed out by Frits van Bommel and Marius Wachtler.

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

13 years agoExploit distributive laws (eg: And distributes over Or, Mul over Add, etc) in a
Duncan Sands [Tue, 23 Nov 2010 14:23:47 +0000 (14:23 +0000)]
Exploit distributive laws (eg: And distributes over Or, Mul over Add, etc) in a
fairly systematic way in instcombine.  Some of these cases were already dealt
with, in which case I removed the existing code.  The case of Add has a bunch of
funky logic which covers some of this plus a few variants (considers shifts to be
a form of multiplication), which I didn't touch.  The simplification performed is:
A*B+A*C -> A*(B+C).  The improvement is to do this in cases that were not already
handled [such as A*B-A*C -> A*(B-C), which was reported on the mailing list], and
also to do it more often by not checking for "only one use" if "B+C" simplifies.

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

13 years agoDivision by pow-of-2 is not cheap on SPU, do it with
Kalle Raiskila [Tue, 23 Nov 2010 13:27:59 +0000 (13:27 +0000)]
Division by pow-of-2 is not cheap on SPU, do it with
shifts.

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

13 years agoImplement the rex64 prefix.
Rafael Espindola [Tue, 23 Nov 2010 11:23:24 +0000 (11:23 +0000)]
Implement the rex64 prefix.

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

13 years agoExpand a little on the description of what InstructionSimplify does.
Duncan Sands [Tue, 23 Nov 2010 10:50:08 +0000 (10:50 +0000)]
Expand a little on the description of what InstructionSimplify does.

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

13 years agoClarify that constant folding of instructions applies when all operands
Duncan Sands [Tue, 23 Nov 2010 10:16:18 +0000 (10:16 +0000)]
Clarify that constant folding of instructions applies when all operands
are constant.  There was in fact one exception to this (phi nodes) - so
remove that exception (InstructionSimplify handles this so there should
be no loss).

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

13 years agoInvalidate the layout on any relaxation, not just Instructions. Bug found by David...
Rafael Espindola [Tue, 23 Nov 2010 08:08:33 +0000 (08:08 +0000)]
Invalidate the layout on any relaxation, not just Instructions. Bug found by David Meyer.
While here, remove unused argument and rename UpdateForSlide to Invalidate.

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

13 years agoProduce a relocation for pcrel absolute values. Based on a patch by David Meyer.
Rafael Espindola [Tue, 23 Nov 2010 07:20:12 +0000 (07:20 +0000)]
Produce a relocation for pcrel absolute values. Based on a patch by David Meyer.

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

13 years agoOptimize a common case in the Lengauer-Tarjan dominators algorithm. This gives a
Cameron Zwarich [Tue, 23 Nov 2010 06:32:37 +0000 (06:32 +0000)]
Optimize a common case in the Lengauer-Tarjan dominators algorithm. This gives a
9.7% speedup running domtree on test-suite.

Reviewed by Chris Lattner.

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

13 years agoRevert functionality doug added in r98575 that was never
Chris Lattner [Tue, 23 Nov 2010 06:09:51 +0000 (06:09 +0000)]
Revert functionality doug added in r98575 that was never
documented and only used by some clang stuff I just removed.

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

13 years agoReuse data fragments while lowering. Patch by David Meyer.
Rafael Espindola [Tue, 23 Nov 2010 05:49:35 +0000 (05:49 +0000)]
Reuse data fragments while lowering. Patch by David Meyer.

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

13 years agoFix formatting nits in the coding standards. Reviewed by clattner.
Zhanyong Wan [Tue, 23 Nov 2010 05:03:07 +0000 (05:03 +0000)]
Fix formatting nits in the coding standards.  Reviewed by clattner.

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

13 years agofix this harder.
Chris Lattner [Tue, 23 Nov 2010 04:26:12 +0000 (04:26 +0000)]
fix this harder.

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

13 years agofix a bug I introduced on the other side of the #ifdef
Chris Lattner [Tue, 23 Nov 2010 04:19:56 +0000 (04:19 +0000)]
fix a bug I introduced on the other side of the #ifdef

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

13 years agoreimplement SwapByteOrder.h in terms of overloading instead of
Chris Lattner [Tue, 23 Nov 2010 04:04:25 +0000 (04:04 +0000)]
reimplement SwapByteOrder.h in terms of overloading instead of
being in terms of excessively complex template logic.

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

13 years agoRenaming ISD::BIT_CONVERT to ISD::BITCAST to better reflect the LLVM IR concept.
Wesley Peck [Tue, 23 Nov 2010 03:31:01 +0000 (03:31 +0000)]
Renaming ISD::BIT_CONVERT to ISD::BITCAST to better reflect the LLVM IR concept.

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

13 years agoadd a 'LLVMConstIntOfArbitraryPrecision' api to the C api,
Chris Lattner [Tue, 23 Nov 2010 02:47:22 +0000 (02:47 +0000)]
add a 'LLVMConstIntOfArbitraryPrecision' api to the C api,
patch by Greg Pfeil!

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

13 years agoduncan's spider sense was right, I completely reversed the condition
Chris Lattner [Tue, 23 Nov 2010 02:42:04 +0000 (02:42 +0000)]
duncan's spider sense was right, I completely reversed the condition
on this instcombine xform.  This fixes a miscompilation of 403.gcc.

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

13 years agofilecheckize
Chris Lattner [Tue, 23 Nov 2010 02:26:52 +0000 (02:26 +0000)]
filecheckize

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

13 years agoFixed some style issues (no _, no spc after !)
Jason W Kim [Mon, 22 Nov 2010 22:05:16 +0000 (22:05 +0000)]
Fixed some style issues (no _, no spc after !)

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

13 years agoRemove duplicated constants. Thanks to Jason for noticing it.
Rafael Espindola [Mon, 22 Nov 2010 21:49:05 +0000 (21:49 +0000)]
Remove duplicated constants. Thanks to Jason for noticing it.

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

13 years agoInstCombine: Implement X - A*-B -> X + A*B.
Benjamin Kramer [Mon, 22 Nov 2010 20:31:27 +0000 (20:31 +0000)]
InstCombine: Implement X - A*-B -> X + A*B.

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

13 years agoMake the <ARCH>ELFObjectWriter statics private
Jason W Kim [Mon, 22 Nov 2010 18:57:00 +0000 (18:57 +0000)]
Make the <ARCH>ELFObjectWriter statics private

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

13 years agoFix misplaced statics.
Jason W Kim [Mon, 22 Nov 2010 18:47:05 +0000 (18:47 +0000)]
Fix misplaced statics.

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

13 years agoKill trailing whitespace
Jason W Kim [Mon, 22 Nov 2010 18:42:07 +0000 (18:42 +0000)]
Kill trailing whitespace

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

13 years agoRefactor the ELFRelocationEntry (pull up) and move the arch-specific statics to insid...
Jason W Kim [Mon, 22 Nov 2010 18:41:13 +0000 (18:41 +0000)]
Refactor the ELFRelocationEntry (pull up) and move the arch-specific statics to inside the class where it belongs.

Next step is to rationally break apart the RecordRelocation()

Probably the step will be to have 1 member function for ech slot of the ELFRelocationEntry()

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

13 years agoFix epilogue codegen to avoid leaving the stack pointer in an invalid
Evan Cheng [Mon, 22 Nov 2010 18:12:04 +0000 (18:12 +0000)]
Fix epilogue codegen to avoid leaving the stack pointer in an invalid
state. Previously Thumb2 would restore sp from fp like this:
mov sp, r7
sub, sp, #4
If an interrupt is taken after the 'mov' but before the 'sub', callee-saved
registers might be clobbered by the interrupt handler. Instead, try
restoring directly from sp:
add sp, #4
Or, if necessary (with VLA, etc.) use a scratch register to compute sp and
then restore it:
sub.w r4, r7, #8
mov sp, r7
rdar://8465407

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

13 years agoAdd a newline.
Mikhail Glushenkov [Mon, 22 Nov 2010 17:10:20 +0000 (17:10 +0000)]
Add a newline.

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

13 years agollvmc: Make -march/-mcpu/-mtune behaviour more consistent with gcc.
Mikhail Glushenkov [Mon, 22 Nov 2010 17:10:09 +0000 (17:10 +0000)]
llvmc: Make -march/-mcpu/-mtune behaviour more consistent with gcc.

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

13 years agoIf a GEP index simply advances by multiples of a type of zero size,
Duncan Sands [Mon, 22 Nov 2010 16:32:50 +0000 (16:32 +0000)]
If a GEP index simply advances by multiples of a type of zero size,
then replace the index with zero.

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

13 years agoFix a bug with extractelement on SPU.
Kalle Raiskila [Mon, 22 Nov 2010 16:28:26 +0000 (16:28 +0000)]
Fix a bug with extractelement on SPU.
In the attached testcase, the element was
never extracted (missing rotate).

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

13 years agoAdd basic CFI methods to the streamer interface.
Rafael Espindola [Mon, 22 Nov 2010 14:27:24 +0000 (14:27 +0000)]
Add basic CFI methods to the streamer interface.

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