Commit Graph

31500 Commits

Author SHA1 Message Date
Devang Patel 0939595711 Record variable debug info at ISel time directly.
llvm-svn: 79742
2009-08-22 17:12:53 +00:00
Anton Korobeynikov f0d31ab7b8 Some dummy cost model for s390x:
- Prefer short-imm instructions over ext-imm, when possible
 - Prefer Z10 instructions over Z9, when possible

This hopefully should fix some dejagnu test fails on solaris

llvm-svn: 79741
2009-08-22 11:46:16 +00:00
Daniel Dunbar d1859474a7 llvm-mc/Mach-O: Improve symbol table support:
- Honor .globl.

 - Set symbol type and section correctly ('nm' now works), and order symbols
   appropriately.

 - Take care to the string table so that the .o matches 'as' exactly (for ease
   of testing).

llvm-svn: 79740
2009-08-22 11:41:10 +00:00
Daniel Dunbar ff3eafd39d llvm-mc/Mach-O: Sketch symbol table support.
- The only .s syntax this honors right now is emitting labels, and some parts
   of the symbol table generation are wrong or faked.

 - This is enough to get nm to report such symbols... incorrectly, but still.

Also, fixed byte emission to extend the previous fragment if possible.

llvm-svn: 79739
2009-08-22 10:13:24 +00:00
Daniel Dunbar 38728fe481 llvm-mc/Mach-O: Move more logic for writing the Mach-O file into the writer
class, and kill off MCSectionData::FileOffset.

llvm-svn: 79735
2009-08-22 08:28:27 +00:00
Daniel Dunbar fef19ffe3a llvm-mc: Rename / redefine MCFragment::FileOffset to MCFragment::Offset (the
section offset).

llvm-svn: 79734
2009-08-22 08:27:54 +00:00
Daniel Dunbar 6860ac7375 llvm-mc: Clean up some handling of symbol/section association to be more correct
(external was really undefined and there wasn't an explicit representation for
absolute symbols).
 - This still needs some cleanup to how the absolute "pseudo" section is dealt
   with, but I haven't figured out the nicest approach yet.

llvm-svn: 79733
2009-08-22 07:22:36 +00:00
Owen Anderson 63010bb65a Reapply r79708 with the appropriate fix for the case that still requires locking.
llvm-svn: 79731
2009-08-22 06:32:36 +00:00
Chris Lattner 56d60eaa61 revert r79708 + r79711
llvm-svn: 79720
2009-08-22 04:07:34 +00:00
Eli Friedman 682d8c1881 Make x86 test actually test x86 code generation. Fix the
construct on ARM, which was breaking by coincidence, and add a similar 
testcase for ARM.

llvm-svn: 79719
2009-08-22 03:13:10 +00:00
Eric Christopher 677c2287da Actually remove unused static. Previous commit removed trailing
whitespace.

llvm-svn: 79711
2009-08-22 00:41:47 +00:00
Eric Christopher dfda92b76e Remove unused static.
llvm-svn: 79710
2009-08-22 00:40:45 +00:00
Owen Anderson 8e2456c254 Ease contention on this lock by noticing that all writes to the VTs array will
be of (dynamically) constant values, so races on it are immaterial.  We just need
to ensure that at least one write has completed before return the pointer into it.

With this change, parllc exhibits essentially no overhead on 403.gcc.

llvm-svn: 79708
2009-08-22 00:29:12 +00:00
Chris Lattner a7668ff636 Revert r79563
llvm-svn: 79691
2009-08-21 23:12:47 +00:00
Chris Lattner 773416e062 revert r79562 + r79563
llvm-svn: 79690
2009-08-21 23:12:15 +00:00
Anton Korobeynikov 876955cbb0 Fix typo.
llvm-svn: 79688
2009-08-21 23:09:47 +00:00
Chris Lattner f407dbbb1a revert r79631
llvm-svn: 79686
2009-08-21 23:08:45 +00:00
Chris Lattner 6af22f02ef revert 79631
llvm-svn: 79685
2009-08-21 23:08:09 +00:00
Daniel Dunbar b1068e4fe3 llvm-mc/Mach-O: Support .o emission for .org and .align.
llvm-svn: 79684
2009-08-21 23:07:38 +00:00
Anton Korobeynikov 13e8c7ef20 Implement APInt <-> APFloat conversion for IEEE 128-bit floats.
This fixes PR2555

llvm-svn: 79677
2009-08-21 22:10:30 +00:00
Bob Wilson ceffeb6abd Rename ARM "lane_cst" operands to "nohash_imm" since they are used for
several things other than Neon vector lane numbers.  For inline assembly
operands with a "c" print code, check that they really are immediates.

llvm-svn: 79676
2009-08-21 21:58:55 +00:00
Reid Kleckner 48ca915be9 Fix a bug where the DWARF emitter in the JIT was not initializing alignment
bytes.  libgcc doesn't seem to mind, but if you pass this DWARF to GDB, it
doesn't like it.  

Also make the JIT memory manager to initialize it's memory to garbage in debug
mode, so that it's easier to find bugs like these in the future.

llvm-svn: 79674
2009-08-21 21:03:57 +00:00
Bob Wilson a70623102e Match VTRN, VZIP, and VUZP shuffles. Restore the tests for these operations,
now using shuffles instead of intrinsics.

llvm-svn: 79673
2009-08-21 20:54:19 +00:00
Anton Korobeynikov f31a44ec01 Add fcopysign instructions
llvm-svn: 79664
2009-08-21 20:02:37 +00:00
Owen Anderson 2dd877d12a Try again at privatizing the layout info map, with a rewritten patch.
This preserves the existing behavior much more closely than my previous attempt.

llvm-svn: 79663
2009-08-21 19:59:12 +00:00
Anton Korobeynikov 47398930e4 Expand few nodes until someone will be crazy enough to implement them natively :)
llvm-svn: 79659
2009-08-21 18:52:42 +00:00
Anton Korobeynikov cb7444342b Typo :(
llvm-svn: 79657
2009-08-21 18:41:02 +00:00
Anton Korobeynikov 81be4b345a Correct instruction names for subtract-with-borrow
llvm-svn: 79656
2009-08-21 18:37:28 +00:00
Daniel Dunbar 4ef7fb9530 llvm-mc/Mach-O: Support byte and fill value emission.
llvm-svn: 79652
2009-08-21 18:29:01 +00:00
Dan Gohman c0b967dfb4 Don't assume that the operand of an inttoptr is an pointer-sized integer.
llvm-svn: 79651
2009-08-21 18:27:26 +00:00
Bill Wendling dff54eff8e Fix typo. Should check both values of RangeUse for 0. Patch by Marius Wachtler.
llvm-svn: 79649
2009-08-21 18:16:06 +00:00
Anton Korobeynikov a39f96c6ed Handle 'r' inline asm constraint
llvm-svn: 79648
2009-08-21 18:15:41 +00:00
Duncan Sands 08b437d600 Fix a problem noticed by gcc-4.4:
warning: comparison is always true due to limited range of data type.

llvm-svn: 79642
2009-08-21 17:16:10 +00:00
Dan Gohman 23e62c532c Change getelementptr folding to use APInt instead of uint64_t for
offset computations. This fixes a truncation bug on targets that
don't have 64-bit pointers.

llvm-svn: 79639
2009-08-21 16:52:54 +00:00
Daniel Dunbar 2f0e8f55f5 Fix -Asserts warning.
llvm-svn: 79636
2009-08-21 16:17:36 +00:00
Anton Korobeynikov 7950510b29 Fix a typo
llvm-svn: 79634
2009-08-21 15:41:56 +00:00
Sanjiv Gupta 9ae3bcb79e Add a pass to do call graph analyis to overlay the autos and frame sections of
leaf functions. This pass will be extended to color other nodes of the call tree 
as well in future.

llvm-svn: 79631
2009-08-21 15:22:33 +00:00
Anton Korobeynikov eaaca496c5 More cpp backend fixes. Now for FP stuff.
llvm-svn: 79626
2009-08-21 12:50:54 +00:00
Anton Korobeynikov 232b19c3d5 Fix some typos and use type-based isel for VZIP/VUZP/VTRN
llvm-svn: 79625
2009-08-21 12:41:42 +00:00
Anton Korobeynikov 9a232f46a8 Add lowering of ARM 4-element shuffles to multiple instructios via perfectshuffle-generated table.
llvm-svn: 79624
2009-08-21 12:41:24 +00:00
Anton Korobeynikov ce3ff1be8a Add nodes & dummy matchers for some v{zip,uzp,trn} instructions
llvm-svn: 79622
2009-08-21 12:40:50 +00:00
Anton Korobeynikov e3046618de Expand EXTRACT_SUBVECTOR
llvm-svn: 79621
2009-08-21 12:40:35 +00:00
Anton Korobeynikov 38f284f2ae Provide vext.{16,32}
llvm-svn: 79620
2009-08-21 12:40:21 +00:00
Anton Korobeynikov c32e99e3ed Use masks not nodes for vector shuffle predicates. Provide set of 'legal' masks, so legalizer won't infinite cycle
llvm-svn: 79619
2009-08-21 12:40:07 +00:00
Benjamin Kramer c20529945a Update CMakeLists.
llvm-svn: 79617
2009-08-21 11:28:56 +00:00
Richard Pennington 9e0c4f50ec bug 4530: Make debug information static to it is preservered during bitcode linking.
llvm-svn: 79616
2009-08-21 11:10:31 +00:00
Daniel Dunbar 3016db39dd llvm-mc: Start MCAssembler and MCMachOStreamer.
- Together these form the (Mach-O) back end of the assembler.

 - MCAssembler is the actual assembler backend, which is designed to have a
   reasonable API. This will eventually grow to support multiple object file
   implementations, but for now its Mach-O/i386 only.

 - MCMachOStreamer adapts the MCStreamer "actions" API to the MCAssembler API,
   e.g. converting the various directives into fragments, managing state like
   the current section, and so on.

 - llvm-mc will use the new backend via '-filetype=obj', which may eventually
   be, but is not yet, since I hear that people like assemblers which actually
   assemble.

 - The only thing that works at the moment is changing sections. For the time
   being I have a Python Mach-O dumping tool in test/scripts so this stuff can
   be easily tested, eventually I expect to replace this with a real LLVM tool.

 - More doxyments to come.

I assume that since this stuff doesn't touch any of the things which are part of
2.6 that it is ok to put this in not so long before the freeze, but if someone
objects let me know, I can pull it.

llvm-svn: 79612
2009-08-21 09:11:24 +00:00
Bill Wendling 64965aafe7 Remove #include <iostream>.
llvm-svn: 79603
2009-08-21 06:52:44 +00:00
Erick Tryzelaar 6096409238 Clean up the APInt function getDigit.
llvm-svn: 79602
2009-08-21 06:48:37 +00:00
Eric Christopher 43a1decc8c Update error messages for '+'. Fix grammar and make the two
negative checks resemble each other.

llvm-svn: 79595
2009-08-21 04:10:31 +00:00
Eric Christopher 820256bc99 Fix trailing whitespace and 80-col violation.
llvm-svn: 79594
2009-08-21 04:06:45 +00:00
Erick Tryzelaar dadb1571b7 Fix bug with APInt::getBitsNeeded with for base 10 numbers 0-9.
llvm-svn: 79593
2009-08-21 03:15:28 +00:00
Erick Tryzelaar 1264bcb4de Allow '+' to appear in APInt strings, and add more unit tests.
llvm-svn: 79592
2009-08-21 03:15:14 +00:00
Bob Wilson 51c7aa04ec Remove Neon intrinsics for VZIP, VUZP, and VTRN. We will represent these as
vector shuffles.  Temporarily remove the tests for these operations until the
new implementation is working.

llvm-svn: 79579
2009-08-21 00:01:42 +00:00
Owen Anderson baa922cf16 Re-revert r79555. Apparently it's not just buildbot weirdness.
llvm-svn: 79578
2009-08-20 23:51:44 +00:00
Erick Tryzelaar da666c801c Add support for including '+' in APFloat strings, more asserts,
and many new unit tests.

llvm-svn: 79574
2009-08-20 23:30:43 +00:00
Owen Anderson 9ca906e69d Reapply r79555 for testing. Daniel's trying to work out some buildbot weirdnesss.
llvm-svn: 79572
2009-08-20 23:14:20 +00:00
Bill Wendling e3836f99bf --- Reverse-merging r79555 into '.':
U    include/llvm/Target/TargetData.h
U    lib/Target/TargetData.cpp

Temporarily revert 79555. It was causing hangs and test failures.

llvm-svn: 79568
2009-08-20 22:04:42 +00:00
Bill Wendling 0e749fe36b Attempt to comment this code more.
llvm-svn: 79567
2009-08-20 22:02:24 +00:00
Daniel Dunbar e7e865cf0b Suppress build warning in -Asserts
llvm-svn: 79564
2009-08-20 20:01:34 +00:00
Sanjiv Gupta a874d82492 part of the previous commit for PIC16 ISR implementation.
llvm-svn: 79563
2009-08-20 19:34:18 +00:00
Sanjiv Gupta 686e9f55dc Implement support for ISRs.
Clone functions that are shared between the Main thread and Interrupt thread.
CallSites are changed in AsmPrinter currently. A better solution would have been to modify the legalizer (SoftenFloat) to allow targets to change the name of libcalls for float operations. But that currently breaks other targets.
Also, cloing of automatic variables is done AsmPrinter, a better approach would
be to use the ValueMap in CloneFunction itself.

llvm-svn: 79562
2009-08-20 19:28:24 +00:00
Owen Anderson c1a3a471c4 Reduce contention on the Attributes lock by using atomic operations for reference counting rather than locking.
llvm-svn: 79560
2009-08-20 19:03:20 +00:00
Owen Anderson d2354b8cc5 Make the StructType->StructLayout table private to TargetData, allowing us to avoid locking on it.
llvm-svn: 79555
2009-08-20 18:26:03 +00:00
Sean Callanan 46bb77f2cf Fixed PCMPESTRM128 to have opcode 0x60 instead of 0x62, as specified by the
Intel documentation.

llvm-svn: 79554
2009-08-20 18:24:27 +00:00
Dan Gohman 05046085b6 Fix an x86 code size regression: prefer RIP-relative addressing
over absolute addressing even in non-PIC mode (unless the address
has an index or something else incompatible), because it has a
smaller encoding.

llvm-svn: 79553
2009-08-20 18:23:44 +00:00
Dan Gohman e392e6236d Add a comment explaining why llvm_unreachable_internal doesn't call
the ErrorHandler callback.

llvm-svn: 79541
2009-08-20 17:15:19 +00:00
Daniel Dunbar bf5998edfb Fix two APFloat bugs in converting hexadecimal constants.
llvm-svn: 79540
2009-08-20 17:12:33 +00:00
Dan Gohman 16f5415f5b Rename hasNoUnsignedOverflow and hasNoSignedOverflow to hasNoUnsignedWrap
and hasNoSignedWrap, for consistency with the nuw and nsw properties.

llvm-svn: 79539
2009-08-20 17:11:38 +00:00
Evan Cheng 01de985ae6 Fix an obvious copy-n-paste bug.
llvm-svn: 79535
2009-08-20 17:01:04 +00:00
Dan Gohman 8a8ad7d8e8 Various comment and whitespace cleanups.
llvm-svn: 79533
2009-08-20 16:42:55 +00:00
Dan Gohman f91a992c30 Update and fix some comments.
llvm-svn: 79532
2009-08-20 16:27:10 +00:00
Jim Grosbach 8b4d51af58 Check for shared landing pads when assigning call site values. Invokes which
share a landing pad should also use the same call site value.

llvm-svn: 79501
2009-08-20 01:03:48 +00:00
Dale Johannesen aec3830ce7 Add an extra line to conform with preferred style.
llvm-svn: 79495
2009-08-19 23:44:01 +00:00
Reid Kleckner 5c51639e3e Modify an assert to avoid what looks like a GCC 4.2.4 signed-ness bug.
llvm-svn: 79494
2009-08-19 23:39:59 +00:00
Dan Gohman 7167f42769 Fix a few places to check if TargetData is available before using it.
llvm-svn: 79493
2009-08-19 23:38:22 +00:00
Daniel Dunbar cb13b48969 Add a fast path for setName("") on an unnamed value.
llvm-svn: 79492
2009-08-19 23:37:23 +00:00
Owen Anderson d6f7af652e AttrListPtr operations need to be atomic.
llvm-svn: 79486
2009-08-19 22:58:34 +00:00
Dan Gohman c59ba42b0f Fix a bug in the over-index constant folding. When over-indexing an
array member of a struct, it's possible to land in an arbitrary position
inside that struct, such that attempting to find further getelementptr
indices will fail. In such cases, folding cannot be done.

llvm-svn: 79485
2009-08-19 22:46:59 +00:00
Dale Johannesen 1d764f61ef Handle 'a' modifier in X86 asms. PR 4742.
llvm-svn: 79484
2009-08-19 22:44:41 +00:00
Reid Kleckner d72b091840 Fixed error in CPPBackend from a contextification API change.
llvm-svn: 79483
2009-08-19 22:38:37 +00:00
David Greene 15aafbbfa5 Add missing forward declaration.
llvm-svn: 79481
2009-08-19 22:19:44 +00:00
David Greene 8230a93ae2 Add missing includes.
llvm-svn: 79480
2009-08-19 22:16:11 +00:00
David Greene 2806a1e528 Add missing includes.
llvm-svn: 79479
2009-08-19 22:08:26 +00:00
David Greene ba540eb492 Add missing includes.
llvm-svn: 79478
2009-08-19 22:05:21 +00:00
David Greene 40a0fbc1d0 Add missing includes.
llvm-svn: 79476
2009-08-19 22:02:07 +00:00
David Greene 8704780390 Add missing includes.
llvm-svn: 79475
2009-08-19 21:59:18 +00:00
David Greene a5be1b174b Add missing includes.
llvm-svn: 79474
2009-08-19 21:55:33 +00:00
David Greene 829b3e8b14 Add missing includes.
llvm-svn: 79473
2009-08-19 21:52:55 +00:00
Owen Anderson a83e868078 Get rid of a helgrind warning. If this is _actually_ a performance problem,
we can find a way to cache the answer that isn't racy.

llvm-svn: 79472
2009-08-19 21:48:34 +00:00
Eli Friedman 28c7bbf515 Add triple parsing support for TCE.
llvm-svn: 79461
2009-08-19 20:46:03 +00:00
Daniel Dunbar 8b0b11582d Switch to SmallString::str from SmallString::c_str, and remove
SmallString::c_str.

llvm-svn: 79456
2009-08-19 20:07:03 +00:00
Daniel Dunbar 948f82b8e4 Change ValueSymbolTable to use raw_svector_ostream for string concatenation.
llvm-svn: 79449
2009-08-19 19:22:52 +00:00
Daniel Dunbar e813cbaa21 Change raw_svector_ostream to reserve the input buffer if necessary, Ted was
right.
 - This class turns out to be much more convenient to use if we do this; clients
   can make sure the buffer is always big enough if they care (since our current
   idiom tends to be to use a SmallString<256> for the input to this we should
   generally be avoiding an unnecessary malloc).

Also, add a convenience raw_svector_ostream::str method which flushes the buffer
and returns a StringRef for the vector contents.

llvm-svn: 79446
2009-08-19 18:40:58 +00:00
Dan Gohman de255fc8f6 Remove temporary testing code.
llvm-svn: 79443
2009-08-19 18:27:08 +00:00
Dan Gohman 915302c605 Make SROA and PredicateSimplifier cope if TargetData is not
available. This is very conservative for now.

llvm-svn: 79442
2009-08-19 18:22:18 +00:00
Dan Gohman 5d5bc6d000 Use hasDefinitiveInitializer() instead of testing the same thing
by hand, and fix a few places that were using hasInitializer() that
appear to depend on the initializer value.

llvm-svn: 79441
2009-08-19 18:20:44 +00:00
Dan Gohman 81ce842ecf Canonicalize indices in a constantexpr GEP. If Indices exceed the
static extents of the static array type, it causes GlobalOpt and
other passes to be more conservative. This canonicalization also
allows the constant folder to add "inbounds" to GEPs.

llvm-svn: 79440
2009-08-19 18:18:36 +00:00
Dan Gohman ac33a9061d Add an x86 peep that narrows TEST instructions to forms that use
a smaller encoding. These kinds of patterns are very frequent in
sqlite3, for example.

llvm-svn: 79439
2009-08-19 18:16:17 +00:00
Daniel Dunbar ea579e3d29 Switch Twine::str() to use toVector(), which is now efficient.
llvm-svn: 79437
2009-08-19 18:09:47 +00:00