Commit Graph

67633 Commits

Author SHA1 Message Date
Bob Wilson 04b2c94205 Another minor refactoring for VLD1DUP instructions.
The op11_8 field is the same for all of them so put it in the instruction
classes instead of specifying it separately for each instruction.

llvm-svn: 120234
2010-11-28 06:51:15 +00:00
Bob Wilson 62a6f7eda6 Add entry in getTargetNodeName() for ARMISD::VBICIMM.
llvm-svn: 120233
2010-11-28 06:51:11 +00:00
Jakob Stoklund Olesen 67d1a71aa4 Speed up simple insertions into an unbranched tree by not creating an iterator.
llvm-svn: 120232
2010-11-28 06:14:33 +00:00
Mikhail Glushenkov c5d7ae4d64 llvmc: First stab at better -march handling.
llvm-svn: 120230
2010-11-28 00:31:13 +00:00
Anton Korobeynikov 7283b8d18c Move more PEI-related hooks to TFI
llvm-svn: 120229
2010-11-27 23:05:25 +00:00
Anton Korobeynikov d08fbd19f5 Move callee-saved regs spills / reloads to TFI
llvm-svn: 120228
2010-11-27 23:05:03 +00:00
Jakob Stoklund Olesen 056356d502 Add more tests for erase(). Fix a few exposed bugs.
llvm-svn: 120227
2010-11-27 22:56:53 +00:00
Jakob Stoklund Olesen bb4bece211 Add test case with randomly ordered insertions, massive coalescing.
Implement iterator::erase() in a simple version that erases nodes when they
become empty, but doesn't try to redistribute elements among siblings for better
packing.

Handle coalescing across leaf nodes which may require erasing entries.

llvm-svn: 120226
2010-11-27 21:12:36 +00:00
Rafael Espindola 5d882894d8 Lower TLS_addr32 and TLS_addr64.
llvm-svn: 120225
2010-11-27 20:43:02 +00:00
Rafael Espindola eab0800695 Implement the data16 prefix.
llvm-svn: 120224
2010-11-27 20:29:45 +00:00
Benjamin Kramer f2d08136bf Remove PIC16 remnants.
llvm-svn: 120223
2010-11-27 18:20:30 +00:00
Daniel Dunbar e308b8edab macho-dump: Add support for --dump-section-data and tweak a few format strings.
llvm-svn: 120219
2010-11-27 13:58:16 +00:00
Daniel Dunbar 83224fc391 macho-dump: Add support for dumping symbol table entries.
llvm-svn: 120218
2010-11-27 13:52:53 +00:00
Daniel Dunbar 8680ce6ffc macho-dump: Add support for dumping string table data.
llvm-svn: 120217
2010-11-27 13:46:11 +00:00
Daniel Dunbar 0ac77d526d macho-dump: Add support for dumping relocation entries.
llvm-svn: 120216
2010-11-27 13:39:48 +00:00
Daniel Dunbar 5867690cfa macho-dump: Add support for dumping sections.
llvm-svn: 120215
2010-11-27 13:33:15 +00:00
Daniel Dunbar c983afc5a1 macho-dump: Add support for dumping dysymtab indirect symbol table.
llvm-svn: 120214
2010-11-27 13:26:12 +00:00
Daniel Dunbar f9c900d3c9 Add an optional LowerCase argument to hexdigit().
llvm-svn: 120213
2010-11-27 13:19:46 +00:00
NAKAMURA Takumi f80507c28c CMake: lit(check.vcproj) can run with multiple configurations on Visual Studio.
Unittests need LLVM_BUILD_MODE to pick up each test.

Confirmed on CentOS5, Mingw, MSYS, and with possible configurations on VS8 and VS10.

llvm-svn: 120212
2010-11-27 13:10:11 +00:00
Benjamin Kramer 032f08b556 Unbreak build for newer GCCs.
llvm-svn: 120205
2010-11-27 09:08:25 +00:00
Daniel Dunbar 33dab2a6ee macho-dump: Add support for dumping symtab and dysymtab commands.
llvm-svn: 120204
2010-11-27 08:33:44 +00:00
Daniel Dunbar a8070e0284 macho-dump: Add support for dumping segment load commands.
llvm-svn: 120203
2010-11-27 08:22:29 +00:00
Owen Anderson 8ba5f39f70 Second attempt at fixing the performance regressions introduced
by my recent GVN improvement.  Looking through a single layer of
PHI nodes when attempting to sink GEPs, we need to iteratively
look through arbitrary PHI nests.

llvm-svn: 120202
2010-11-27 08:15:55 +00:00
Daniel Dunbar 762bf86919 ADT/InMemoryStruct: Add an experimental helper class intended for use in
situations where on the common path an API can return a pointer to some direct
memory, but which on an exceptional path may need to return a pointer to a
temporary struct.

llvm-svn: 120201
2010-11-27 08:11:02 +00:00
Daniel Dunbar 65dc891942 raw_ostream::write_escaped: Add a UseHexEscapes argument.
llvm-svn: 120200
2010-11-27 07:59:50 +00:00
Daniel Dunbar 768a5e8004 Fix a comment.
llvm-svn: 120199
2010-11-27 07:39:37 +00:00
Daniel Dunbar 3977e7d22c Object/Mach-O: Add header and load command information.
llvm-svn: 120198
2010-11-27 07:19:41 +00:00
Bob Wilson d74cf2c8f6 Refactor. Set alignment bit in VLD1-dup instruction classes.
llvm-svn: 120197
2010-11-27 07:12:02 +00:00
Daniel Dunbar 795ab9b06d build/Makefiles: Don't build unittests when ONLY_TOOLS is set.
llvm-svn: 120196
2010-11-27 06:59:16 +00:00
Daniel Dunbar feb1c5d830 Object/Mach-O: Validate Mach-O magic and initialize format info.
llvm-svn: 120195
2010-11-27 06:39:22 +00:00
Bob Wilson c92eea0175 Add NEON VLD1-dup instructions (load 1 element to all lanes).
llvm-svn: 120194
2010-11-27 06:35:16 +00:00
Bob Wilson 3a63f9d852 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.

llvm-svn: 120193
2010-11-27 06:35:09 +00:00
Daniel Dunbar 9630fb3c10 macho-dump: More sketching.
llvm-svn: 120192
2010-11-27 06:19:17 +00:00
Daniel Dunbar fdfb635bff macho-dump: Stub out C++ macho-dump tool.
llvm-svn: 120191
2010-11-27 05:58:44 +00:00
Daniel Dunbar 1df8d83a55 MC/Mach-O: Start stubbing out a Mach-O object file wrapper.
llvm-svn: 120190
2010-11-27 05:38:50 +00:00
Daniel Dunbar 4b128a5d4f Reduce nesting.
llvm-svn: 120189
2010-11-27 05:18:48 +00:00
Daniel Dunbar eab6e401fe MC/Mach-O: Migrate more constants into MachOFormat.h.
llvm-svn: 120188
2010-11-27 04:59:14 +00:00
Daniel Dunbar a5f50c16f7 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).

llvm-svn: 120187
2010-11-27 04:38:36 +00:00
Daniel Dunbar 2263ca4834 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.

llvm-svn: 120186
2010-11-27 04:19:38 +00:00
Daniel Dunbar 1440fd3539 macho-dump: Fix typo.
llvm-svn: 120185
2010-11-27 04:00:06 +00:00
Benjamin Kramer 9610ea943c 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.

llvm-svn: 120183
2010-11-26 18:25:20 +00:00
Benjamin Kramer 4fcd9163fc StringRefs are POD-like.
llvm-svn: 120181
2010-11-26 14:36:54 +00:00
NAKAMURA Takumi 98fa0159fc 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.
llvm-svn: 120179
2010-11-26 09:32:02 +00:00
NAKAMURA Takumi c54a9692ce test/site.exp.in: Add "emitir", for now, fixing up r120156. CMake depends on site.exp.in, though, "emitir" might be unused.
llvm-svn: 120174
2010-11-26 08:30:15 +00:00
Jakob Stoklund Olesen 5e9c70ee57 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.

llvm-svn: 120171
2010-11-26 06:54:20 +00:00
Jakob Stoklund Olesen 90e6f41f69 Extract template function adjustSiblingSizes(), allowing instances to be shared
between B+-trees using the same KeyT.

llvm-svn: 120170
2010-11-26 06:54:17 +00:00
Rafael Espindola bf4a4e4ad9 Remove the unused TheTarget member.
llvm-svn: 120168
2010-11-26 04:24:21 +00:00
Michael J. Spencer 2eb0a6fafa Fix spelling!
llvm-svn: 120167
2010-11-26 04:16:20 +00:00
Michael J. Spencer f13f442b1a Fix Whitespace.
llvm-svn: 120166
2010-11-26 04:16:08 +00:00
Jakob Stoklund Olesen a12095d26d 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.)

llvm-svn: 120165
2010-11-26 01:39:40 +00:00
Duncan Sands 7904068186 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).

llvm-svn: 120164
2010-11-25 21:48:20 +00:00
Duncan Sands 8182ac6a05 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).

llvm-svn: 120163
2010-11-25 21:46:07 +00:00
Oscar Fuentes e1c6a67df6 Bump required cmake version on CMake.html.
llvm-svn: 120162
2010-11-25 21:41:48 +00:00
Duncan Sands e6c974b230 Use -S rather than -c for the benefit of dragonegg.
llvm-svn: 120161
2010-11-25 21:41:35 +00:00
Duncan Sands 5fe97a0490 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).

llvm-svn: 120160
2010-11-25 21:39:17 +00:00
Duncan Sands 0be0ae625d 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.

llvm-svn: 120159
2010-11-25 21:26:21 +00:00
Duncan Sands b32d19de6a 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).

llvm-svn: 120158
2010-11-25 21:24:35 +00:00
Duncan Sands 2b5243d096 Dragonegg cannot output bitcode, only human readable IR, so use -S rather
than -c.

llvm-svn: 120157
2010-11-25 21:21:59 +00:00
Duncan Sands c78fbf9877 Use LLVMCC_EMITIR_FLAG rather than hard-coding "-emit-llvm".
llvm-svn: 120156
2010-11-25 21:19:52 +00:00
Duncan Sands 1bc5303aed Using LLVMCC_EMITIR_FLAG rather than hard-coding -emit-llvm
(dragonegg cannot use -emit-llvm so needs a different flag
to everyone else).

llvm-svn: 120155
2010-11-25 21:14:55 +00:00
Duncan Sands 0787bc37c4 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.

llvm-svn: 120151
2010-11-25 17:57:43 +00:00
Benjamin Kramer 336e02e89b SDep is POD-like. Shave off a few bytes from SUnit by moving a member around.
llvm-svn: 120150
2010-11-25 17:50:19 +00:00
Duncan Sands 606d5c0424 Initial support for being able to specify the llvm-gcc to use like this:
--with-llvmgcc="gcc-4.5 -fplugin=dragonegg.so"

llvm-svn: 120149
2010-11-25 17:47:42 +00:00
Rafael Espindola 7c2acd022e Use multiple 0x66 prefixes so that all nops up to 15 bytes are a single instruction.
llvm-svn: 120147
2010-11-25 17:14:16 +00:00
Benjamin Kramer aef5bd049f Namespacify.
llvm-svn: 120146
2010-11-25 16:42:51 +00:00
Rafael Espindola f8e127eaf6 Factor some code to parseSectionFlags and fix the default type of a section.
llvm-svn: 120145
2010-11-25 15:32:56 +00:00
Michael J. Spencer d4a894d62f system_error: Even more unsupported error numbers :(.
llvm-svn: 120139
2010-11-25 01:53:59 +00:00
Nick Lewycky b8de00ee07 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.

llvm-svn: 120126
2010-11-24 22:04:20 +00:00
Rafael Espindola 9f75d5df0b 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.

llvm-svn: 120121
2010-11-24 21:57:39 +00:00
Michael J. Spencer 26f628d57f 80 col.
llvm-svn: 120111
2010-11-24 20:07:14 +00:00
Michael J. Spencer 02dd5544c4 google test depends on Support.
llvm-svn: 120105
2010-11-24 19:35:15 +00:00
Rafael Espindola 708ac4d6ad Relocate with the symbol if the relocation is of kind NTPOFF.
Patch by David Meyer, I added the test.

llvm-svn: 120104
2010-11-24 19:23:50 +00:00
Michael J. Spencer c33a41db85 unittests: Add initial Path-V2 test.
llvm-svn: 120103
2010-11-24 19:20:28 +00:00
Michael J. Spencer 96bcfcf2c2 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.

llvm-svn: 120102
2010-11-24 19:20:19 +00:00
Michael J. Spencer 98847783f2 unittests: Add SystemTests.
llvm-svn: 120101
2010-11-24 19:20:05 +00:00
Rafael Espindola e98d483b71 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.

llvm-svn: 120100
2010-11-24 18:51:21 +00:00
Rafael Espindola af9a7a3e92 Testcase for r120017.
llvm-svn: 120099
2010-11-24 18:03:57 +00:00
Wesley Peck 8ad3b25633 Updating MBlaze .mask and .frame directives to match GCC's output and fixing regression introduced in 120095 by checking MCStreamer::hasRawTextSupport.
llvm-svn: 120097
2010-11-24 16:32:35 +00:00
Wesley Peck 51917b868d 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.

llvm-svn: 120095
2010-11-24 15:39:32 +00:00
Kalle Raiskila e0a1d2b32c Use i8 as SETCC result type for i1 in SPU.
llvm-svn: 120092
2010-11-24 12:59:16 +00:00
Kalle Raiskila 97fc68774c Allow for 'fcmp ogt' in SPU.
Fix by Visa Putkinen!

llvm-svn: 120090
2010-11-24 11:42:17 +00:00
Rafael Espindola 4e70ac7b68 If a symbol is used as tls, mark it as tls even if not declare as so. Probably
fixes PR8659.

llvm-svn: 120076
2010-11-24 02:19:40 +00:00
NAKAMURA Takumi cf3475172f include/llvm/System/system_error.h: ECANCELED is undefined on Cygwin-1.5.
llvm-svn: 120072
2010-11-24 01:29:45 +00:00
Ted Kremenek 1ef52416c7 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.

llvm-svn: 120070
2010-11-24 00:54:28 +00:00
Jakob Stoklund Olesen 00430319a8 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.

llvm-svn: 120068
2010-11-24 00:03:32 +00:00
Chris Lattner 6bf4e6d8b2 add a MemoryBuffer::getOpenFile method, which turns an open
file descriptor into a MemoryBuffer (and closes the FD).

llvm-svn: 120065
2010-11-23 22:20:27 +00:00
Michael J. Spencer 5aef638057 system_error: Add fixme.
llvm-svn: 120059
2010-11-23 21:09:11 +00:00
Duncan Sands 0488d564e1 Rename SimplifyDistributed to the more meaningfull name SimplifyByFactorizing.
llvm-svn: 120051
2010-11-23 20:42:39 +00:00
Benjamin Kramer 94a622af4c 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.

llvm-svn: 120049
2010-11-23 20:33:57 +00:00
Duncan Sands 433c1679cf Replace calls to ConstantFoldInstruction with calls to SimplifyInstruction
in two places that are really interested in simplified instructions, not
constants.

llvm-svn: 120044
2010-11-23 20:26:33 +00:00
Duncan Sands bb2cd025a9 Constant folding here is pointless, because InstructionSimplify
(which does constant folding and more) is called a few lines
later.

llvm-svn: 120042
2010-11-23 20:24:21 +00:00
Jason W Kim 8e21bf84e8 Move the ARM reloc constants to Support/ELF.h
llvm-svn: 120035
2010-11-23 19:40:36 +00:00
Bob Wilson d7d2cf7842 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.

llvm-svn: 120034
2010-11-23 19:38:38 +00:00
Bob Wilson b91ae1ac52 Fix copy-and-paste error in exception message.
llvm-svn: 120033
2010-11-23 19:38:34 +00:00
Benjamin Kramer b5afa65b0a 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.

llvm-svn: 120028
2010-11-23 18:52:42 +00:00
Duncan Sands 60813f96e0 Propagate LeftDistributes and RightDistributes into their only uses.
Stylistic improvement suggested by Frits van Bommel.

llvm-svn: 120026
2010-11-23 15:28:14 +00:00
Duncan Sands 22df741687 Fix typo pointed out by Frits van Bommel and Marius Wachtler.
llvm-svn: 120025
2010-11-23 15:25:34 +00:00
Duncan Sands adc7771f18 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.

llvm-svn: 120024
2010-11-23 14:23:47 +00:00
Kalle Raiskila e1b6c273b8 Division by pow-of-2 is not cheap on SPU, do it with
shifts.

llvm-svn: 120022
2010-11-23 13:27:59 +00:00
Rafael Espindola f6c05b1d01 Implement the rex64 prefix.
llvm-svn: 120017
2010-11-23 11:23:24 +00:00
Duncan Sands a021988d64 Expand a little on the description of what InstructionSimplify does.
llvm-svn: 120016
2010-11-23 10:50:08 +00:00
Duncan Sands 763dec0ab8 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).

llvm-svn: 120015
2010-11-23 10:16:18 +00:00
Rafael Espindola 5c1d4e3b1e Invalidate the layout on any relaxation, not just Instructions. Bug found by David Meyer.
While here, remove unused argument and rename UpdateForSlide to Invalidate.

llvm-svn: 120009
2010-11-23 08:08:33 +00:00
Rafael Espindola 3c7cab1402 Produce a relocation for pcrel absolute values. Based on a patch by David Meyer.
llvm-svn: 120006
2010-11-23 07:20:12 +00:00
Cameron Zwarich 767a389fa5 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.

llvm-svn: 120003
2010-11-23 06:32:37 +00:00
Chris Lattner 2dd97d2d60 Revert functionality doug added in r98575 that was never
documented and only used by some clang stuff I just removed.

llvm-svn: 120002
2010-11-23 06:09:51 +00:00
Rafael Espindola 6e13aa1d3b Reuse data fragments while lowering. Patch by David Meyer.
llvm-svn: 119999
2010-11-23 05:49:35 +00:00
Zhanyong Wan 19b96fd4ee Fix formatting nits in the coding standards. Reviewed by clattner.
llvm-svn: 119998
2010-11-23 05:03:07 +00:00
Chris Lattner a5f868ce03 fix this harder.
llvm-svn: 119994
2010-11-23 04:26:12 +00:00
Chris Lattner 13b981b26f fix a bug I introduced on the other side of the #ifdef
llvm-svn: 119993
2010-11-23 04:19:56 +00:00
Chris Lattner 8bec7227d4 reimplement SwapByteOrder.h in terms of overloading instead of
being in terms of excessively complex template logic.

llvm-svn: 119992
2010-11-23 04:04:25 +00:00
Wesley Peck 527da1b6e2 Renaming ISD::BIT_CONVERT to ISD::BITCAST to better reflect the LLVM IR concept.
llvm-svn: 119990
2010-11-23 03:31:01 +00:00
Chris Lattner 4329e078ac add a 'LLVMConstIntOfArbitraryPrecision' api to the C api,
patch by Greg Pfeil!

llvm-svn: 119989
2010-11-23 02:47:22 +00:00
Chris Lattner e5afa15b77 duncan's spider sense was right, I completely reversed the condition
on this instcombine xform.  This fixes a miscompilation of 403.gcc.

llvm-svn: 119988
2010-11-23 02:42:04 +00:00
Chris Lattner adc29567fc filecheckize
llvm-svn: 119987
2010-11-23 02:26:52 +00:00
Jason W Kim 767a1e9adc Fixed some style issues (no _, no spc after !)
llvm-svn: 119986
2010-11-22 22:05:16 +00:00
Rafael Espindola 6e39a50fd5 Remove duplicated constants. Thanks to Jason for noticing it.
llvm-svn: 119985
2010-11-22 21:49:05 +00:00
Benjamin Kramer f1ebb63161 InstCombine: Implement X - A*-B -> X + A*B.
llvm-svn: 119984
2010-11-22 20:31:27 +00:00
Jason W Kim 16b75262c4 Make the <ARCH>ELFObjectWriter statics private
llvm-svn: 119982
2010-11-22 18:57:00 +00:00
Jason W Kim 84ffdd5cf1 Fix misplaced statics.
llvm-svn: 119981
2010-11-22 18:47:05 +00:00
Jason W Kim a262546df7 Kill trailing whitespace
llvm-svn: 119979
2010-11-22 18:42:07 +00:00
Jason W Kim 7c7d0ef287 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()

llvm-svn: 119978
2010-11-22 18:41:13 +00:00
Evan Cheng eb56dca4fd 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

llvm-svn: 119977
2010-11-22 18:12:04 +00:00
Mikhail Glushenkov abc0204bf6 Add a newline.
llvm-svn: 119976
2010-11-22 17:10:20 +00:00
Mikhail Glushenkov 3c60f755c3 llvmc: Make -march/-mcpu/-mtune behaviour more consistent with gcc.
llvm-svn: 119975
2010-11-22 17:10:09 +00:00
Duncan Sands c133c54426 If a GEP index simply advances by multiples of a type of zero size,
then replace the index with zero.

llvm-svn: 119974
2010-11-22 16:32:50 +00:00
Kalle Raiskila 77d11d054c Fix a bug with extractelement on SPU.
In the attached testcase, the element was
never extracted (missing rotate).

llvm-svn: 119973
2010-11-22 16:28:26 +00:00
Rafael Espindola 3c227b0b89 Add basic CFI methods to the streamer interface.
llvm-svn: 119972
2010-11-22 14:27:24 +00:00
Duncan Sands 8a0f486e36 Move the "gep undef" -> "undef" transform from instcombine to
InstructionSimplify.

llvm-svn: 119970
2010-11-22 13:42:49 +00:00
Rafael Espindola 556f203d64 Remove some #includes.
llvm-svn: 119967
2010-11-22 11:53:17 +00:00
Benjamin Kramer 24656c9583 Implement the "if (X == 6 || X == 4)" -> "if ((X|2) == 6)" optimization.
This currently only catches the most basic case, a two-case switch, but can be
extended later.

llvm-svn: 119964
2010-11-22 09:45:38 +00:00
Duncan Sands c6648eb4c3 Don't keep track of inserted phis in PromoteMemoryToRegister: the information
is never used.  Patch by Cameron Zwarich.

llvm-svn: 119963
2010-11-22 09:41:24 +00:00
Duncan Sands 5cadccc4ea Fix a compiler warning about Kind being used uninitialized
when assertions are disabled.

llvm-svn: 119962
2010-11-22 09:38:00 +00:00
Eric Christopher 37b0736bdc Pseudos default to 4byte size, let the instruction size field notice
that branch tables are special.

llvm-svn: 119954
2010-11-21 23:38:19 +00:00
Wesley Peck 7699d6cfe9 Implement ELF object file writing support for the MBlaze backend. Its not perfect yet, but it works for many tests.
llvm-svn: 119952
2010-11-21 22:06:28 +00:00
Wesley Peck f1d3800e65 Implement branch analysis in the MBlaze backend.
llvm-svn: 119951
2010-11-21 21:53:36 +00:00
Wesley Peck f4efd582ad Make it a little bit more explicit that the MBlaze backend only supports upto
32-bit immediate values.

llvm-svn: 119950
2010-11-21 21:39:46 +00:00
Wesley Peck 7493e30d42 Fix an error in the MBlaze delay slot filler where instructions that already
fill a delay slot are moved to fill a different delay slot.

llvm-svn: 119949
2010-11-21 21:36:12 +00:00
Chris Lattner fc9aead6fd fix comment
llvm-svn: 119948
2010-11-21 19:05:34 +00:00
Chris Lattner 5d2262dc76 apparently tailcalls are better on darwin/x86-64 than on linux?
llvm-svn: 119947
2010-11-21 18:59:20 +00:00
Benjamin Kramer 585dfa2b3d Initialize MemDep's TD member so buildbots don't trip over an uninitialized pointer (TD is passed to PHITransAddr).
I wonder why this didn't explode earlier.

llvm-svn: 119944
2010-11-21 15:21:46 +00:00
Duncan Sands cf4bceba49 Add a rather pointless InstructionSimplify transform, inspired by recent constant
folding improvements: if P points to a type of size zero, turn "gep P, N" into "P".
More generally, if a gep index type has size zero, instcombine could replace the
index with zero, but that is not done here.

llvm-svn: 119942
2010-11-21 13:53:09 +00:00
Duncan Sands 1f86be9164 Fix spelling.
llvm-svn: 119941
2010-11-21 12:43:13 +00:00
Bill Wendling 22db31305f More Thumb encodings.
llvm-svn: 119940
2010-11-21 11:49:36 +00:00
Bill Wendling c01d679928 Add encoding for ARM "trap" instruction.
llvm-svn: 119938
2010-11-21 11:05:29 +00:00
Bill Wendling 219dabdf68 The "trap" instruction is one of this which doesn't have a condition code. Hack
the code to not add a "condition code" if it's trap.

llvm-svn: 119937
2010-11-21 10:56:05 +00:00
Bill Wendling 3acd02706a - Give "trap" the correct encoding, at least according to Darwin's assembler.
- Add comments saying where the encodings for other instructions came from.

llvm-svn: 119936
2010-11-21 10:55:23 +00:00
Chris Lattner 6ce038082b apply Dan's fix for PR8268 which allows constant folding to handle indexes over
zero sized elements.  This allows us to compile:

  #include <string>
  void foo() { std::string s; }

into an empty function.

llvm-svn: 119933
2010-11-21 08:39:01 +00:00
Chris Lattner 526cce12f5 add some helper methods for asmprinter flags, from PR8417
llvm-svn: 119932
2010-11-21 08:30:55 +00:00
Chris Lattner b4cd1819fa implement PR8524, apparently mainline gas accepts movq as an alias for movd
when transfering between i64 gprs and mmx regs.

llvm-svn: 119931
2010-11-21 08:18:57 +00:00
Chris Lattner 5957229659 rework some DSE paths to use the newly-public "getPointerDependencyFrom"
method in MemDep instead of inserting an instruction, doing a query,
then removing it.  Neither operation is effectively cached.

llvm-svn: 119930
2010-11-21 08:06:10 +00:00
Chris Lattner e69672c44f the getLocationForSource/Dest methods can be static.
llvm-svn: 119929
2010-11-21 08:05:25 +00:00
Chris Lattner 663ba91cc6 add "getLocation" method to AliasAnalysis for getting the source and
destination location of a memcpy/memmove.  I'm not clear about whether
TBAA works on these, so I'm leaving it out for now.  Dan, please revisit
this when convenient.

llvm-svn: 119928
2010-11-21 07:51:27 +00:00
Chris Lattner e48c31ce33 implement PR8576, deleting dead stores with intervening may-alias stores.
llvm-svn: 119927
2010-11-21 07:34:32 +00:00
Chris Lattner 6e22221b37 file checkize
llvm-svn: 119926
2010-11-21 07:32:40 +00:00
Chris Lattner 9165d9d2ac add some random notes.
llvm-svn: 119925
2010-11-21 07:05:31 +00:00
Owen Anderson 7e484e0be7 Use by-name rather than by-order operand matching for some NEON encodings.
llvm-svn: 119923
2010-11-21 06:47:06 +00:00
Chris Lattner f7e896138e optimize:
void a(int x) { if (((1<<x)&8)==0) b(); }

into "x != 3", which occurs over 100 times in 403.gcc but in no
other program in llvm-test.

llvm-svn: 119922
2010-11-21 06:44:42 +00:00
Chris Lattner 9de0176ef8 tail calls on x86 are implemented.
llvm-svn: 119920
2010-11-21 06:10:27 +00:00
Jim Grosbach e040a46eb3 BR_JTadd is ARM-only, so use the proper pseudo class to get the predicate.
llvm-svn: 119918
2010-11-21 01:26:01 +00:00
Rafael Espindola 26cb15a549 Handle PCRel relocations with absolute values. Fixes PR8656.
llvm-svn: 119917
2010-11-21 00:48:25 +00:00
Chris Lattner 58f9f58716 Implement PR8644: forwarding a memcpy value to a byval,
allowing the memcpy to be eliminated.

Unfortunately, the requirements on byval's without explicit 
alignment are really weak and impossible to predict in the 
mid-level optimizer, so this doesn't kick in much with current
frontends.  The fix is to change clang to set alignment on all
byval arguments.

llvm-svn: 119916
2010-11-21 00:28:59 +00:00
Chris Lattner d78dbee431 a byval argument without an align can have an arbitrary alignment
requirement on the input pointer.

llvm-svn: 119914
2010-11-20 23:49:06 +00:00
Bill Wendling c31de25137 A few more thumb instruction MC encodings.
llvm-svn: 119913
2010-11-20 22:52:33 +00:00
Eric Christopher 0a3c28bd6b Rewrite address handling to use a structure with all the possible address
mode variables. Handle frame indexes in load/store and allocas again.

llvm-svn: 119912
2010-11-20 22:38:27 +00:00
Eric Christopher d0aec3bf64 STRH only needs the additional operand, not t2STRH. Also invert conditional
to match the one from the load emitter above.

llvm-svn: 119911
2010-11-20 22:01:38 +00:00
Benjamin Kramer ddd1b7b801 Simplify code. No change in functionality.
llvm-svn: 119908
2010-11-20 18:43:35 +00:00
Frits van Bommel da17c921ba Test commit: Fix two -Asserts mode warnings in StringMap.h.
llvm-svn: 119907
2010-11-20 18:37:24 +00:00
Anton Korobeynikov 36590fc72a Make this compile on case-sensitive file systemsw
llvm-svn: 119905
2010-11-20 16:14:57 +00:00
Anton Korobeynikov 4687778398 Move some more hooks to TargetFrameInfo
llvm-svn: 119904
2010-11-20 15:59:32 +00:00
Benjamin Kramer f6fb58a216 Silence Release build warnings about unused functions.
llvm-svn: 119903
2010-11-20 15:53:24 +00:00
Francois Pichet 4fd9b685ff Disable warning C4291 on MSVC. Caused because class AttributeList provides a non implemented operator delete without a corresponding new.
llvm-svn: 119902
2010-11-20 15:39:03 +00:00
Duncan Sands 7c601ded34 On X86, MEMBARRIER, MFENCE, SFENCE, LFENCE are not target memory intrinsics,
so don't claim they are.  They are allocated using DAG.getNode, so attempts
to access MemSDNode fields results in reading off the end of the allocated
memory.  This fixes crashes with "llc -debug" due to debug code trying to
print MemSDNode fields for these barrier nodes (since the crashes are not
deterministic, use valgrind to see this).  Add some nasty checking to try
to catch this kind of thing in the future.

llvm-svn: 119901
2010-11-20 11:25:00 +00:00
Andrew Trick cf7fefb25c Removing the useless test that I added recently. It was meant as an example, but not complicated enough to merit another test.
llvm-svn: 119898
2010-11-20 07:26:51 +00:00
Andrew Trick ada75c5ad1 RABasic fix. Regalloc is responsible for updating block live ins.
llvm-svn: 119896
2010-11-20 02:57:05 +00:00
Andrew Trick 799ec1c4d6 Whitespace.
llvm-svn: 119895
2010-11-20 02:43:55 +00:00
Jakob Stoklund Olesen 40e78b4da0 Fix old GCC build error.
llvm-svn: 119884
2010-11-20 01:24:43 +00:00
Bill Wendling 284326bd69 Add more Thumb add instruction encodings.
llvm-svn: 119883
2010-11-20 01:18:47 +00:00
Bill Wendling fe1de03629 Add Thumb encodings for some add instructions.
llvm-svn: 119882
2010-11-20 01:00:29 +00:00
Bill Wendling e60fd5a9db Add more encodings for Thumb instructions.
llvm-svn: 119881
2010-11-20 00:53:35 +00:00
Jakob Stoklund Olesen 8bf9e546d4 Detemplatize NodeRef.
It is now possible to navigate the B+-tree using NodeRef::subtree() and
NodeRef::size() without knowing the key and value template types used in the
tree.

llvm-svn: 119880
2010-11-20 00:49:00 +00:00
Jakob Stoklund Olesen 3864c518c2 Rename NodeBase::{key,val} as {first,second} and swap the BranchNode arrays such
that the noderefs are the first member in the object.

This is in preparation of detemplatization of tree navigation.

llvm-svn: 119879
2010-11-20 00:48:57 +00:00
Bill Wendling 0914d44fa4 Have the getAddrMode3OpValue() function in ARMCodeEmitter.cpp produce the same
value that the one in ARMMCCodeEmitter.cpp does.

llvm-svn: 119878
2010-11-20 00:26:37 +00:00
Bill Wendling 54df187f25 Check for _setjmp too, because it's also used.
llvm-svn: 119875
2010-11-20 00:03:09 +00:00
Jakob Stoklund Olesen 6ae70b2e0f Implement IntervalMap destructor.
Key and value objects may not be destructed instantly when they are erased from
the container, but they will be destructed eventually by the IntervalMap
destructor.

llvm-svn: 119873
2010-11-19 23:28:59 +00:00
Jakob Stoklund Olesen c041268c8c Implement IntervalMap::clear().
llvm-svn: 119872
2010-11-19 23:28:57 +00:00
Jakob Stoklund Olesen 46389fda3b Support backwards iteration starting from end().
llvm-svn: 119871
2010-11-19 23:28:53 +00:00
Dale Johannesen 87a98b57b8 Add test for PR 8111. By Frits van Bommel.
llvm-svn: 119870
2010-11-19 23:23:22 +00:00
Jim Grosbach 2aff392af9 Fix ARM LDR* post-indexed operand encoding.
llvm-svn: 119869
2010-11-19 23:14:43 +00:00
Bill Wendling 1825cc74f4 Encodings for the compare instructions.
llvm-svn: 119868
2010-11-19 23:14:32 +00:00
Owen Anderson b4fd2c90e9 The Vm and Vn register fields must be the same for a register-register vmov.
llvm-svn: 119867
2010-11-19 23:12:43 +00:00
Evan Cheng a5f048485f Fix a cut-n-paste-error.
llvm-svn: 119866
2010-11-19 23:01:16 +00:00
Owen Anderson ea326db47b Document the new GVN number table structure.
llvm-svn: 119865
2010-11-19 22:48:40 +00:00
Jim Grosbach 785952e5ac Operand names
llvm-svn: 119864
2010-11-19 22:43:08 +00:00
Jim Grosbach 5876e41c9f trailing whitespace
llvm-svn: 119863
2010-11-19 22:42:55 +00:00
Eric Christopher 35e2d7f610 Don't need to save piecemeal now.
llvm-svn: 119862
2010-11-19 22:39:56 +00:00
Eric Christopher cee83d6e6b Update comment.
llvm-svn: 119861
2010-11-19 22:37:58 +00:00
Bill Wendling a82fb71324 Add encodings for some of the thumb ADD instructions. Tests will come once the
asm parser can handle them.

llvm-svn: 119860
2010-11-19 22:37:33 +00:00
Eric Christopher 558b61e2d4 Update comment.
llvm-svn: 119859
2010-11-19 22:36:41 +00:00
Jim Grosbach 7d8df3185f Clarify operand names.
llvm-svn: 119858
2010-11-19 22:36:02 +00:00
Owen Anderson c0177aeb71 Add a test for CodeGenPrepare's ability to look through PHI nodes when performing
addressing mode folding, introduced in r119853.

llvm-svn: 119857
2010-11-19 22:34:53 +00:00
Eric Christopher fef5f315af Refactor address mode handling into a single struct (ala x86), this
should give allow a wider range of addressing modes.

No functional change.

llvm-svn: 119856
2010-11-19 22:30:02 +00:00
Jim Grosbach 48bf4f8e56 Fix encoding for ARM MLS instruction.
llvm-svn: 119855
2010-11-19 22:22:37 +00:00
Owen Anderson dfb8c3bbfc When folding addressing modes in CodeGenPrepare, attempt to look through PHI nodes
if all the operands of the PHI are equivalent.  This allows CodeGenPrepare to undo
unprofitable PRE transforms.

llvm-svn: 119853
2010-11-19 22:15:03 +00:00
Jim Grosbach 09d7bfd886 Add ARM encoding information for STRD.
llvm-svn: 119852
2010-11-19 22:14:31 +00:00
Jim Grosbach 5a77b8b5c4 Shuffle things around a bit to keep like things together. Tidy up formatting.
llvm-svn: 119851
2010-11-19 22:06:57 +00:00
Bill Wendling c92a5770df Revert accidental commit.
llvm-svn: 119850
2010-11-19 22:06:18 +00:00
Bill Wendling 49a2e2384b Change long binary encodings to use hex instead. It's more readable. Also
initialize missing bit.

llvm-svn: 119849
2010-11-19 22:02:18 +00:00
Dale Johannesen c9242c577e Prefetch has a MemOperand now. FileCheckize a test.
This finishes up 8460971.

llvm-svn: 119848
2010-11-19 21:49:38 +00:00
Jim Grosbach 6e9aace4f3 Factor out operand encoding bits for ARM addressing mode 2 store instructions.
llvm-svn: 119846
2010-11-19 21:35:06 +00:00
Jim Grosbach 09f6823eb6 Delete another dead class.
llvm-svn: 119844
2010-11-19 21:16:08 +00:00
Jim Grosbach e093e5f0dc whitespace tweak.
llvm-svn: 119843
2010-11-19 21:14:37 +00:00
Rafael Espindola cf14a382ec Fix a use after free. Patch by Frits van Bommel.
llvm-svn: 119842
2010-11-19 21:14:29 +00:00
Jim Grosbach d6e5c9f2fe Refactor PICSTR* instructions to really be pseudos. Nuke dead classes.
llvm-svn: 119841
2010-11-19 21:14:02 +00:00
Jim Grosbach 4a22eba616 Rename ARM .td class AIldst1 to AI2ldst for consistency with the other classes.
llvm-svn: 119840
2010-11-19 21:07:51 +00:00
Jim Grosbach 003c6e700b Add ARM binary encoding information for the rest of the indexed loads.
llvm-svn: 119821
2010-11-19 19:41:26 +00:00
Jakob Stoklund Olesen 8e0cc61f35 Rename methods for clarity instead of brevity. No functional changes.
llvm-svn: 119820
2010-11-19 19:10:39 +00:00
Mon P Wang 88ff56caa3 Make isScalarToVector to return false if the node is a scalar. This will prevent
DAGCombine from making an illegal transformation of bitcast of a scalar to a
vector into a scalar_to_vector.

llvm-svn: 119819
2010-11-19 19:08:12 +00:00
Jakob Stoklund Olesen 55964f6a75 Include raw_ostream.h unconditionally even if it is only used for debug code.
We don't want any clients acidentally depending on this and then failing in a
-Asserts build.

llvm-svn: 119818
2010-11-19 18:51:46 +00:00
Kevin Enderby 8be14414f6 Added support for the Mach-O .symbol_resolver directive. rdar://8673046
llvm-svn: 119816
2010-11-19 18:39:33 +00:00
Jim Grosbach c6ac246671 Remove dead code.
llvm-svn: 119815
2010-11-19 18:18:37 +00:00
Jim Grosbach 76aed40813 ARM LDRD binary encoding.
llvm-svn: 119812
2010-11-19 18:16:46 +00:00
Jim Grosbach d7a3550a5e Remove hard tabs.
llvm-svn: 119810
2010-11-19 18:01:37 +00:00
Jim Grosbach 2bb49e15a6 Remove trailing whitespace.
llvm-svn: 119806
2010-11-19 17:11:02 +00:00
Benjamin Kramer 2e49eaa92f Avoid release build warnings.
llvm-svn: 119804
2010-11-19 16:36:02 +00:00
Owen Anderson 336021f758 Fix decoding ambiguities of stdrex and ldrex.
llvm-svn: 119801
2010-11-19 13:11:50 +00:00
Benjamin Kramer c77ebcc9a5 Silence warning about an uninitialized variable.
llvm-svn: 119800
2010-11-19 11:37:26 +00:00
Duncan Sands b238de0415 Remove threading of Xor over selects and phis, with an explanation
of why such threading is pointless.

llvm-svn: 119798
2010-11-19 09:20:39 +00:00
Duncan Sands af4ad85160 Simplify, no functionality change.
llvm-svn: 119797
2010-11-19 08:33:20 +00:00
Rafael Espindola 9900b4802e Add a MCLineSectionOrder vector so that we produce the line tables in a
deterministic order.

llvm-svn: 119795
2010-11-19 07:41:23 +00:00
Evan Cheng 2debc86138 These instructions are thumb2 only.
llvm-svn: 119793
2010-11-19 06:28:11 +00:00
Evan Cheng 0eb2994626 Fix an obvious oversight.
llvm-svn: 119792
2010-11-19 06:15:10 +00:00
Jakob Stoklund Olesen 4031c5eb48 Don't attempt trivial coalescing for sub-register copies.
Patch by Krister Wombell!

llvm-svn: 119791
2010-11-19 05:45:24 +00:00
Jakob Stoklund Olesen df1c49c16f Work around GCC 4.0 build error:
llvm/include/llvm/ADT/IntervalMap.h:334: error: '((llvm::IntervalMapImpl::DesiredNodeBytes / static_cast<unsigned int>(((2 * sizeof (KeyT)) + sizeof (ValT)))) >? 3u)' is not a valid template argument for type 'unsigned int' because it is a non-constant expression

llvm-svn: 119790
2010-11-19 05:36:51 +00:00
Rafael Espindola 0b4c9aa9a9 Add an assert.
llvm-svn: 119788
2010-11-19 04:55:36 +00:00
Jakob Stoklund Olesen 345945e355 Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.

Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.

The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.

The IntervalMap is initially intended to be used with SlotIndex intervals for:

- Backing store for LiveIntervalUnion that is smaller and faster than std::set.

- Backing store for LiveInterval with less overhead than std::vector for typical
  intervals and O(N log N) merging of large intervals. 99% of virtual registers
  need 4 entries or less and would benefit from the small object optimization.

- Backing store for LiveDebugVariable which doesn't exist yet, but will track
  debug variables during register allocation.

This is a work in progress. Missing items are:

- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.

llvm-svn: 119787
2010-11-19 04:47:19 +00:00
Rafael Espindola 92ca933f6e Fix llvm-gcc boostrap on OS X by avoiding printing sleb and uleb when
possible.

llvm-svn: 119785
2010-11-19 04:10:13 +00:00
NAKAMURA Takumi 1818edb53f unittests/CMakeLists.txt: [PR8225] Tweak linking JITTests on MSVC to add JITTests.def.
CMake can pass *.def to link.exe.

llvm-svn: 119783
2010-11-19 03:19:42 +00:00
NAKAMURA Takumi 7a953baa1d unittests/CMakeLists.txt: Suppress building ValueMapTest on MSVC older than 10(VS2010).
MSVC9 and 8 cannot compile ValueMapTest.cpp due to their bug.
See issue#331418 in Visual Studio.

llvm-svn: 119782
2010-11-19 03:19:32 +00:00
NAKAMURA Takumi 1801996111 lit.GoogleTest: On case-insensitive filesystem, matching should be case-insensitive when directory name is checked with test_sub_dir.
On MSVS8, ${CMAKE_CFG_INTDIR}, aka $(OutDir), has capitalized name(eg. Debug), although $(OutDir) is made with lower case(eg. debug).

llvm-svn: 119781
2010-11-19 03:19:26 +00:00
NAKAMURA Takumi 148b62cca9 CMakeLists.txt: On MSVS10, touch LLVM.sln as workaround, w/e project files are changed, to avoid the Dialog Hell. Thanks to Oscar.
FIXME: This could be removed with future version of CMake.
llvm-svn: 119780
2010-11-19 03:19:18 +00:00
Rafael Espindola b58867ccba Change some methods in MCDwarf.cpp to be able to handle an arbitrary
MCStreamer instead of just MCObjectStreamer. Address changes cannot
be as efficient as we have to use DW_LNE_set_addres, but at least
most of the logic is shared.

This will be used so that, with CodeGen still using EmitDwarfLocDirective,
llvm-gcc is able to produce debug_line sections without needing an
assembler that supports .loc.

llvm-svn: 119777
2010-11-19 02:26:16 +00:00
Bill Wendling 945b776b6e Add MC encodings for some Thumb instructions. Test for a few of them. The "bx
lr" instruction cannot be tested just yet. It requires matching a "condition
code", but adding one of those makes things go south quickly...

llvm-svn: 119774
2010-11-19 01:33:10 +00:00
Jakob Stoklund Olesen 09770251f6 Revert "Add ADT/IntervalMap.", GCC doesn't like it.
This reverts r119772.

llvm-svn: 119773
2010-11-19 01:21:03 +00:00
Jakob Stoklund Olesen 6d89171dcc Add ADT/IntervalMap.
This is a sorted interval map data structure for small keys and values with
automatic coalescing and bidirectional iteration over coalesced intervals.

Except for coalescing intervals, it provides similar functionality to std::map.
It is however much more compact for small keys and values, and hopefully faster
too.

The container object itself can hold the first few intervals without any
allocations, then it switches to a cache conscious B+-tree representation. A
recycling allocator can be shared between many containers, even between
containers holding different types.

The IntervalMap is initially intended to be used with SlotIndex intervals for:

- Backing store for LiveIntervalUnion that is smaller and faster than std::set.

- Backing store for LiveInterval with less overhead than std::vector for typical
  intervals and O(N log N) merging of large intervals. 99% of virtual registers
  need 4 entries or less and would benefit from the small object optimization.

- Backing store for LiveDebugVariable which doesn't exist yet, but will track
  debug variables during register allocation.

This is a work in progress. Missing items are:

- Performance metrics.
- erase().
- insert() shrinkage.
- clear().
- More performance metrics.
- Simplification and detemplatization.

llvm-svn: 119772
2010-11-19 01:14:40 +00:00
Dale Johannesen 461e704a2c Aligned and unaligned copies of the same string
were not hashing to the same value.  Analysis
and patch by Frits van Bommel!

llvm-svn: 119770
2010-11-19 00:48:58 +00:00
Bill Wendling 20b5ea9858 Use array_pod_sort because the list is contiguous.
llvm-svn: 119769
2010-11-19 00:38:19 +00:00
Owen Anderson f53e4d9fd1 Provide Thumb2 encodings for strex and ldrex.
llvm-svn: 119768
2010-11-19 00:28:38 +00:00
Jim Grosbach 2aeb8b9361 Minor cleanups to a few llvm_unreachable() calls.
llvm-svn: 119767
2010-11-19 00:27:09 +00:00
Bill Wendling 2ecfcbd2aa An 'unreachable' shouldn't have a '0 &&' prefix.
llvm-svn: 119762
2010-11-19 00:05:15 +00:00