Commit Graph

7941 Commits

Author SHA1 Message Date
Chris Lattner c7d5796af8 convert to filecheck format.
llvm-svn: 80518
2009-08-30 21:36:06 +00:00
Chris Lattner 9e371f4b8b suck a bunch more gep tests into getelementptr.ll and filecheckize them all.
llvm-svn: 80517
2009-08-30 21:31:34 +00:00
Chris Lattner 89a9bb77e2 consolodate various GEP tests into getelementptr.ll using filecheck.
llvm-svn: 80514
2009-08-30 21:02:36 +00:00
Chris Lattner 2708a312db another huge testcase, this time from 'gs' in llvm-test.
llvm-svn: 80513
2009-08-30 21:02:02 +00:00
Chris Lattner 3e1b67f62f remove another poorly-reduced testcase which came from ldecod in llvm-test.
llvm-svn: 80512
2009-08-30 21:01:14 +00:00
Chris Lattner 8a2905e132 this testcase is 500 lines long and is distilled from bzip2, just
remove it.

llvm-svn: 80511
2009-08-30 21:00:11 +00:00
Chris Lattner 4698e19cba convert to filecheck
llvm-svn: 80510
2009-08-30 20:48:15 +00:00
Chris Lattner 73913f4cd3 Fix PR4748: don't fold gep(bitcast(x)) into bitcast(gep) when x
is itself a bitcast.  Since we have gep(bitcast(bitcast(y))) in this
case, just wait for the two bitcasts to get zapped.  This prevents
instcombine from confusing some aliasing stuff, and allows it to
directly eliminate the load in the testcase.

llvm-svn: 80508
2009-08-30 20:38:21 +00:00
Anton Korobeynikov 3681144bd8 Add missed pattern
llvm-svn: 80502
2009-08-30 19:06:39 +00:00
Anton Korobeynikov eab572a8ff EXTRACT_VECTOR_ELEMENT can have result type different from element type.
Remove the assertion and generalize the code for ARM NEON stuff.

llvm-svn: 80498
2009-08-30 17:14:54 +00:00
Daniel Dunbar 03686805e8 Update test.
llvm-svn: 80490
2009-08-30 07:01:09 +00:00
Daniel Dunbar 6a715dccdf llvm-mc: MCStreamer cleanups. - Remove EmitLocalSymbol, this is unsupported for now.
- Switch Emit{CommonSymbol,Zerofill} to take alignment in bytes (for consistency).

llvm-svn: 80484
2009-08-30 06:17:16 +00:00
Dan Gohman ca73326f56 CMOV_GR8 clobbers EFLAGS when its expansion involves an xor to set
a register to 0. This fixes PR4814.

llvm-svn: 80445
2009-08-29 22:19:15 +00:00
Anton Korobeynikov ece642a54c Do not assert on too wide splats we don't support.
llvm-svn: 80409
2009-08-29 00:08:18 +00:00
Anton Korobeynikov cd41d07f29 Add missed extract_element pattern
llvm-svn: 80408
2009-08-28 23:41:26 +00:00
Devang Patel 80ae34974b Reapply 79977.
Use MDNodes to encode debug info in llvm IR.

llvm-svn: 80406
2009-08-28 23:24:31 +00:00
Evan Cheng 43b9ca6f42 Let Darwin linker auto-synthesize stubs and lazy-pointers. This deletes a bunch of nasty code in ARM asm printer.
llvm-svn: 80404
2009-08-28 23:18:09 +00:00
Torok Edwin e8a5863c3f rm needs -f
llvm-svn: 80363
2009-08-28 14:05:07 +00:00
Torok Edwin 483691a185 Remove the llvmprof.out from the test output, otherwise running
make check in a non-clean directory causes it to fail (for example when running
make check twice), since execution counts will differ.

llvm-svn: 80362
2009-08-28 13:35:44 +00:00
Andreas Neustifter ed3a6bedca Remove profiling output file because two consecutive runs of make check give
error.

llvm-svn: 80357
2009-08-28 10:38:26 +00:00
Andreas Neustifter d8e04ab883 Removed unnecessary file creation during test.
llvm-svn: 80356
2009-08-28 10:07:41 +00:00
Andreas Neustifter 52afe22566 Pulled all tests into one test. Removed some redundant tests. Rename.
llvm-svn: 80355
2009-08-28 10:00:28 +00:00
Daniel Dunbar 2701eee0ad llvm-mc: Support .comm emission.
llvm-svn: 80351
2009-08-28 07:08:35 +00:00
Andreas Neustifter d7f3569555 Readded test from r79615, this tests the complete profiling tool chain. Furhter
tests can test only parts of this system.

llvm-svn: 80348
2009-08-28 06:41:00 +00:00
Daniel Dunbar 42a39d038a llvm-mc: Support .zerofill emission.
- I'm still trying to figure out the cleanest way to implement this and match the assembler, currently there are some substantial differences.

llvm-svn: 80347
2009-08-28 05:49:21 +00:00
Daniel Dunbar 96abad185d llvm-mc: Emit .lcomm as .zerofill.
llvm-svn: 80343
2009-08-28 05:48:46 +00:00
Chris Lattner bda82c20f3 Fix PR3913, patch by Jakub Staszak!
llvm-svn: 80327
2009-08-28 00:43:14 +00:00
Evan Cheng 6da267de23 v4, v5 does not support sxtb / sxth.
llvm-svn: 80322
2009-08-28 00:31:43 +00:00
Anton Korobeynikov 205cac837f scalar_to_vector is fully legal now (implemented as subreg accesses)
llvm-svn: 80249
2009-08-27 16:04:47 +00:00
Anton Korobeynikov d0b0262edf Ok, sometimes it's profitable to turn scalar_to_vector stuff into subreg access.
Add a testcase.

llvm-svn: 80246
2009-08-27 14:51:42 +00:00
Chris Lattner d3374e8dfd Implement a new optimization in the inliner: if inlining multiple
calls into a function and if the calls bring in arrays, try to merge
them together to reduce stack size.  For example, in the testcase
we'd previously end up with 4 allocas, now we end up with 2 allocas.

As described in the comments, this is not really the ideal solution
to this problem, but it is surprisingly effective.  For example, on
176.gcc, we end up eliminating 67 arrays at "gccas" time and another
24 at "llvm-ld" time.

One piece of concern that I didn't look into: at -O0 -g with
forced inlining this will almost certainly result in worse debug
info.  I think this is acceptable though given that this is a case
of "debugging optimized code", and we don't want debug info to
prevent the optimizer from doing things anyway.

llvm-svn: 80215
2009-08-27 06:29:33 +00:00
Chris Lattner 6802a2056a the inliner shouldn't crash on this.
llvm-svn: 80214
2009-08-27 06:20:45 +00:00
Daniel Dunbar a1cb9ba541 For now, only run MC tests if X86 is configured.
llvm-svn: 80213
2009-08-27 06:11:15 +00:00
Bill Wendling 10cdbd3b73 This is passing for PPC on Mac OS X.
llvm-svn: 80210
2009-08-27 05:49:50 +00:00
Evan Cheng 7a37b1a2ca Fix PR4789. Teach eliminateFrameIndex how to handle VLDRQ and VSTRQ which cannot fold any immediate offset.
llvm-svn: 80191
2009-08-27 01:23:50 +00:00
Dan Gohman 7f0ca9a34c X86FastISel support for loading and storing values of type i1.
llvm-svn: 80186
2009-08-27 00:31:47 +00:00
Dan Gohman f1abb5511b Expand i8 selects into control flow instead of 16-bit conditional
moves. This avoids the need to promote the operands (or implicitly
extend them, a partial register update condition), and can reduce
i8 register pressure. This substantially speeds up code such as
write_hex in lib/Support/raw_ostream.cpp.

subclass-coalesce.ll is too trivial and no longer tests what it was
originally intended to test.

llvm-svn: 80184
2009-08-27 00:14:12 +00:00
Daniel Dunbar 4d7b2e3307 llvm-mc/Mach-O: Unique sections properly, so we don't get duplicate text
sections, etc.
 - The quick and dirty way, just clone the TargetLoweringObjectFile
   code. Eventually this should be shared... somehow.

llvm-svn: 80168
2009-08-26 22:49:51 +00:00
Daniel Dunbar e73b267301 llvm-mc/Mach-O: Don't put assembler temporary labels in the symbol table.
- I moved section creation back into AsmParser. I think policy decisions like
   this should be pushed higher, not lower, when possible (in addition the
   assembler has flags which change this behavior, for example).

llvm-svn: 80162
2009-08-26 22:13:22 +00:00
Daniel Dunbar e2697738a4 llvm-mc/Mach-O: Set .subsections_via_symbols flag properly.
llvm-svn: 80144
2009-08-26 21:22:22 +00:00
Bob Wilson faebdee4dd Convert some more Neon tests to FileCheck.
llvm-svn: 80120
2009-08-26 18:11:50 +00:00
Dale Johannesen f582ac7c11 Alter 79292 to produce output that actually assembles.
llvm-svn: 80119
2009-08-26 18:10:32 +00:00
Anton Korobeynikov 0f756b27ae Expand scalar_to_vector - we don't have any isel logic for it now
llvm-svn: 80107
2009-08-26 16:26:09 +00:00
Dan Gohman 6c23fa2442 Don't use INSERT_SUBREG to model anyext operations on x86-64, as it
leads to partial-register definitions. To help avoid redundant
zero-extensions, also teach the h-register matching patterns that
use movzbl to match anyext as well as zext.

llvm-svn: 80099
2009-08-26 14:59:13 +00:00
Dan Gohman d926b985df Create a ScalarEvolution-based AliasAnalysis implementation.
This is a simple AliasAnalysis implementation which works by making
ScalarEvolution queries. ScalarEvolution has a more complete understanding
of arithmetic than BasicAA's collection of ad-hoc checks, so it handles
some cases that BasicAA misses, for example p[i] and p[i+1] within the
same iteration of a loop.

This is currently experimental. It may be that the main use for this pass
will be to help find cases where BasicAA can be profitably extended, or
to help in the development of the overall AliasAnalysis infrastructure,
however it's also possible that it could grow up to become a directly
useful pass.

llvm-svn: 80098
2009-08-26 14:53:06 +00:00
Daniel Dunbar c4581eaca8 llvm-mc/Mach-O: Add support for relocations.
- I haven't really tried to find the "right" way to store the fixups or apply
   them, yet. This works, but isn't particularly elegant or fast.

 - Still no evaluation support, so we don't actually ever not turn a fixup into
   a relocation entry.

llvm-svn: 80089
2009-08-26 13:58:10 +00:00
Daniel Dunbar b40044444b llvm-mc/Mach-O: Dump relocations and section data (optionally) in my Mach-O dumper.
llvm-svn: 80087
2009-08-26 13:57:44 +00:00
Anton Korobeynikov a0e01bec87 Add dummy inline asm handling for 'r' constraint. This fixes PR4778
llvm-svn: 80085
2009-08-26 13:44:29 +00:00
Devang Patel f08e35d9dc Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.
llvm-svn: 80073
2009-08-26 05:01:18 +00:00
Daniel Dunbar bee148a185 llvm-mc: Fix tests for python variations in int printing, sigh.
llvm-svn: 80069
2009-08-26 04:28:45 +00:00
Daniel Dunbar 066d0f93bf llvm-mc/Mach-O: Add section padding where needed (to align the next section).
Also, simplify some of Mach-O writer code which can now use section addresses.

llvm-svn: 80067
2009-08-26 04:13:32 +00:00
Daniel Dunbar aef5317edd llvm-mc/Mach-O: Set addresses for symbols.
llvm-svn: 80065
2009-08-26 02:48:04 +00:00
Daniel Dunbar c2c0bf961f llvm-mc: Improve indirect symbol support (add the indirect index table).
llvm-svn: 80059
2009-08-26 00:18:21 +00:00
Scott Michel c5dd8bd8d2 Updated i128 sext support for CellSPU backend, contributed by Ken Werner (IBM)
llvm-svn: 80042
2009-08-25 22:37:34 +00:00
Chris Lattner 3e6c7946df remove some dead lines.
llvm-svn: 80031
2009-08-25 21:01:56 +00:00
Chris Lattner 88093c7594 convert to filecheck style
llvm-svn: 80029
2009-08-25 20:57:38 +00:00
Chris Lattner 6d9d5a9c94 convert to filecheck
llvm-svn: 80025
2009-08-25 20:49:04 +00:00
Daniel Dunbar 9cc4970ed3 Switch abi-isel.ll to FileCheck; it's not much faster, but it now tests a lot
more and is much nicer to the OS.
 - Dan, please check. If there are parts of the test you think I should strip
   out so it doesn't cause random failures let me know (there are still some PIC
   label numbers in it, for example).

llvm-svn: 80019
2009-08-25 18:45:03 +00:00
Dan Gohman 337d56110e Special-case static allocas in IndVarSimplify's loop invariant
sinking code, since they are special. If the loop preheader happens
to be the entry block of a function, don't sink static allocas
out of it. This fixes PR4775.

llvm-svn: 80010
2009-08-25 17:42:10 +00:00
David Goodwin ae6bc8214a Fixup register kills after scheduling.
llvm-svn: 80002
2009-08-25 17:03:05 +00:00
Anton Korobeynikov 271cdda8e1 Provide dynamic_stackalloc lowering for MSP430.
This fixes PR4769

llvm-svn: 80001
2009-08-25 17:00:23 +00:00
Torok Edwin 973bb97977 Remove target triple from this test, it fails on x86-64 with
--enable-targets=host-only otherwise.

llvm-svn: 80000
2009-08-25 16:53:15 +00:00
Dan Gohman bcca4084c8 Fix a few typos from the removal of -f.
llvm-svn: 79994
2009-08-25 15:45:44 +00:00
Dan Gohman 0d4bbf2c4a Remove obsolete -f flags.
llvm-svn: 79992
2009-08-25 15:38:29 +00:00
Devang Patel 02aac922b4 Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.
This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)

llvm-svn: 79977
2009-08-25 05:24:07 +00:00
Dale Johannesen f8d37c6b81 Fix PR 4751, another difficulty with %a modifier on x86.
llvm-svn: 79961
2009-08-25 00:16:14 +00:00
Scott Michel ec89f0c41a - Remove SelectSEXTi128 from SPUISelDAGToDAG.cpp, evidently, this is redundant
code, according to Anton (I'm not totally convinced, but we can always
  resurrect patches if we need to do so.)
- Start moving CellSPU's tests to prefer FileCheck.

llvm-svn: 79958
2009-08-24 23:57:35 +00:00
Scott Michel e208c9458d Prefer 'FileCheck' over 'grep'.
llvm-svn: 79953
2009-08-24 22:49:22 +00:00
Scott Michel 8d1602af86 128-bit sign extension and vector shift cleanups, contributed by Ken Werner
(IBM).

llvm-svn: 79949
2009-08-24 22:28:53 +00:00
Bob Wilson 9054d25808 Fix a typo. Somehow I thought this had passed before, but I guess not.
llvm-svn: 79937
2009-08-24 21:17:17 +00:00
Bob Wilson 5fe1d38607 Convert slow test to use FileCheck.
llvm-svn: 79935
2009-08-24 20:33:47 +00:00
Daniel Dunbar 6969df0fab Convert two gratuitous abuses of poor helpless CPU cycles to FileCheck.
llvm-svn: 79933
2009-08-24 20:08:27 +00:00
Dale Johannesen fbc9a2e33b Split test into 3.
llvm-svn: 79926
2009-08-24 17:51:19 +00:00
Daniel Dunbar 04a1158d13 llvm-mc/Mach-O: Support symbol attributes.
- This is mostly complete, the main thing missing is .indirect_symbol support
   (which would be straight-forward, except that the way it is implemented in
   'as' makes getting an exact .o match interesting).

llvm-svn: 79899
2009-08-24 08:40:12 +00:00
Chris Lattner eb72593558 Remove this test now that the interpreter doesn't support
interpreting the wrong endianness anymore.  This fixes a 
failure on clang-powerpc-darwin8

llvm-svn: 79880
2009-08-24 02:05:59 +00:00
Dale Johannesen 6bbeda41b9 Make linkerprivate work for ARM and PPC. Testcase covers
all Darwin targets; could be split into separate tests for
the chip subdirectories, but from Chris' last mail on testing
I assume he'd rather have only one test.  Generic seems to be
the best available, maybe there should be a Darwin subdirectory?

llvm-svn: 79877
2009-08-24 01:03:42 +00:00
Chris Lattner befdbd91cc remove this test: it is testing for a "feature" I just removed.
llvm-svn: 79874
2009-08-23 23:01:02 +00:00
Daniel Dunbar a9e1d3f065 Rerevert (r75663 and r76805), seems there is more non-determinism.
llvm-svn: 79856
2009-08-23 17:26:24 +00:00
Jakob Stoklund Olesen 972c8fab51 Fix PR4753.
When undoing a reuse in ReuseInfo::GetRegForReload, check if it was only a
sub-register being used. The MachineOperand::getSubReg() method is only valid
for virtual registers, so we have to recover the sub-register index manually.

llvm-svn: 79855
2009-08-23 13:01:45 +00:00
Daniel Dunbar 2982196fca Speculatively revert r76823 (i.e., reapply r75663 and r76805) to see if the real
problem is fixed by the TableGen determinism fix.

llvm-svn: 79851
2009-08-23 10:44:51 +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 db52f9c650 Fix typo.
llvm-svn: 79738
2009-08-22 10:09:17 +00:00
Daniel Dunbar 87671b7fdc Force triple for these tests.
llvm-svn: 79737
2009-08-22 09:45:43 +00:00
Daniel Dunbar 4bca5aef61 llvm-mc: Hopefully fix Mach-O tests on big-endian platforms, force values to be
converted to Python ints if possible.

llvm-svn: 79736
2009-08-22 09:28:33 +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
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
Chris Lattner f09250f1b1 rename test, make more specific.
llvm-svn: 79712
2009-08-22 00:44:24 +00:00
Anton Korobeynikov 48e4a6c739 Add missing RUN line
llvm-svn: 79707
2009-08-22 00:28:50 +00:00
Anton Korobeynikov 5f47ecb918 Reduce the test
llvm-svn: 79703
2009-08-22 00:18:11 +00:00
Bob Wilson 616335f6c1 Use CHECK-NEXT to make sure we're only getting one copy of each shuffle
instruction.

llvm-svn: 79702
2009-08-22 00:13:23 +00:00
Daniel Dunbar 67dfb1de23 llvm-mc: Improve handling of implicit alignment for magic section directives
(e.g., .objc_message_refs).
 - Just emit a .align when we see the directive; this isn't exactly what 'as'
   does but in practice it should be ok, at least for now. See FIXME.

llvm-svn: 79697
2009-08-21 23:30:15 +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
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
Daniel Dunbar 4ef7fb9530 llvm-mc/Mach-O: Support byte and fill value emission.
llvm-svn: 79652
2009-08-21 18:29:01 +00:00
Anton Korobeynikov a39f96c6ed Handle 'r' inline asm constraint
llvm-svn: 79648
2009-08-21 18:15:41 +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
Bob Wilson f73af72d30 Add some tests for vext.16 and vext.32.
llvm-svn: 79638
2009-08-21 16:35:24 +00:00
Daniel Dunbar 8e5edd81bb llvm-mc: Accept .fill size of 8.
llvm-svn: 79635
2009-08-21 15:43:35 +00:00
Andreas Neustifter 3fac9a4fc5 Removed profiling test, lli not available on all platforms.
llvm-svn: 79633
2009-08-21 15:27:35 +00:00
Andreas Neustifter f715778de9 Added tests for Profiling Infrastructure.
llvm-svn: 79615
2009-08-21 09:36:28 +00:00
Bill Wendling 2315a68054 Make for 32-bit only.
llvm-svn: 79614
2009-08-21 09:29:26 +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 84d3389d7d Probably should emit bitcode instead of text.
llvm-svn: 79607
2009-08-21 08:02:19 +00:00
Bill Wendling 19e4d6b33c Testcase for r79597.
llvm-svn: 79598
2009-08-21 06:12:30 +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
Dale Johannesen fa2b97e61a Use FileCheck even though this means testing for something
that has nothing to do with the point of the test, per Chris.

llvm-svn: 79569
2009-08-20 22:12:08 +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
Evan Cheng 01de985ae6 Fix an obvious copy-n-paste bug.
llvm-svn: 79535
2009-08-20 17:01:04 +00:00
Dale Johannesen d16abc09c4 Use FileCheck for the test run where it's appropriate.
llvm-svn: 79534
2009-08-20 16:58:04 +00:00
Dan Gohman 463d3407e2 Loosen up the regex for this test so that it doesn't implicitly
depend on TargetData information.

llvm-svn: 79491
2009-08-19 23:19:36 +00:00
Dan Gohman 6e32e5cf0c Add targetdata strings to these tests, since SimplifyLibCalls uses
TargetData to find the pointer size.

llvm-svn: 79490
2009-08-19 23:18:49 +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
Bill Wendling 6c528bc7ae Make this test platform neutral.
llvm-svn: 79447
2009-08-19 18:51:45 +00:00
Daniel Dunbar 45e5670ede Fix typo
llvm-svn: 79445
2009-08-19 18:35:54 +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
Erick Tryzelaar 8ce532bfea Convert the rest of the ocaml types and functions to use context.
llvm-svn: 79430
2009-08-19 17:32:24 +00:00
Bob Wilson 32cd8550ce Add support for Neon VEXT (vector extract) shuffles.
This is derived from a patch by Anton Korzh.  I modified it to recognize
the VEXT shuffles during legalization and lower them to a target-specific
DAG node.

llvm-svn: 79428
2009-08-19 17:03:43 +00:00
Eli Friedman 1e008c173a PR4737: Fix a nasty bug in load narrowing with non-power-of-two types.
llvm-svn: 79415
2009-08-19 08:46:10 +00:00
Nick Lewycky cbfe9b195c Fix up PHI nodes correctly in the presence of unreachable BBs, part two. Also
delete a newed pointer, and improve readability a little bit.

llvm-svn: 79411
2009-08-19 07:16:57 +00:00
Erick Tryzelaar 5c35b5cf91 Allow passing around LLVMContext in ocaml.
llvm-svn: 79410
2009-08-19 06:40:29 +00:00
Chris Lattner 78b23b0e3f fix asmstreaming of 2/4 byte elements with pow-2 alignments.
llvm-svn: 79408
2009-08-19 06:35:36 +00:00
Dan Gohman dea2358c68 Fix SimplifyLibcalls and ValueTracking to check mayBeOverridden
before performing optimizations based on constant string values.

llvm-svn: 79384
2009-08-19 00:11:12 +00:00
Dan Gohman 4906f73a9f Legalize the shift amount operand of SRL_PARTS, SHL_PARTS, and
SRA_PARTS, as is done for SRL, SHL, and SRA.

llvm-svn: 79380
2009-08-18 23:36:17 +00:00
Richard Osborne 2349fb4d45 Add support for mergeable sections back into the XCore backend.
llvm-svn: 79368
2009-08-18 21:14:31 +00:00
Richard Osborne 934d61648b Put data with relocations in the same sections as data without relocations.
llvm-svn: 79351
2009-08-18 17:58:17 +00:00
Daniel Dunbar d7f3433789 Attempt to normalize test results.
llvm-svn: 79350
2009-08-18 17:38:27 +00:00
Dan Gohman b85ad63727 Make this test less sensitive to assembler differences.
llvm-svn: 79348
2009-08-18 17:19:46 +00:00
Chris Lattner 8b0e164aa6 force a triple so this passes on darwin
llvm-svn: 79345
2009-08-18 16:55:45 +00:00
Dan Gohman bf2a9aedca Generalize ScalarEvolution to be able to analyze GEPs when
TargetData is not present. It still uses TargetData when available.
This generalization also fixed some limitations in the TargetData
case; the attached testcase covers this.

llvm-svn: 79344
2009-08-18 16:46:41 +00:00
Dan Gohman a41fa35992 Make tail merging handle blocks with repeated predecessors correctly, and
remove RemoveDuplicateSuccessor, as it is no longer necessary, and because
it breaks assumptions made in
MachineBasicBlock::isOnlyReachableByFallthrough.

Convert test/CodeGen/X86/omit-label.ll to FileCheck and add a testcase
for PR4732.

test/CodeGen/Thumb2/thumb2-ifcvt2.ll sees a diff with this commit due to
it being bugpoint-reduced to the point where it doesn't matter what the
condition for the branch is.

Add some more interesting code to
test/CodeGen/X86/2009-08-06-branchfolder-crash.ll, which is the testcase
that originally motivated the RemoveDuplicateSuccessor code, to help
verify that the original problem isn't being re-broken.

llvm-svn: 79338
2009-08-18 15:18:18 +00:00
Dan Gohman 82ac81b1cc Fix a bug that caused globalopt to miscompile tramp3d: don't miss
unruly indices for arrays that are members of structs.

llvm-svn: 79337
2009-08-18 14:58:19 +00:00
Evan Cheng dd406177de Fix revsh pattern.
llvm-svn: 79318
2009-08-18 05:43:23 +00:00
Anton Korobeynikov 90e17e787f The attached patches attempt to fix cross builds. For example, if you
try to use i686-darwin to build for arm-eabi, you'll quickly run into
several false assumptions that the target OS must be the same as the
host OS. These patches split $(OS) into $(HOST_OS) and $(TARGET_OS) to
help builds like "make check" and the test-suite able to cross
compile. Along the way a target of *-unknown-eabi is defined as
"Freestanding" so that TARGET_OS checks have something to work with.

Patch by Sandeep Patel!

llvm-svn: 79296
2009-08-18 00:40:33 +00:00
Dale Johannesen 4a50e68b65 PowerPC inline asm was emitting two output operands
for a single "m" constraint; this is wrong because the
opcode of a load or store would have to change in parallel.
This patch makes it always compute addresses into a register,
which is correct but not as efficient as possible.  7144566.

llvm-svn: 79292
2009-08-18 00:18:39 +00:00
Devang Patel c6faffde6c Add prefix only if it is needed.
llvm-svn: 79289
2009-08-17 23:17:17 +00:00
Nick Lewycky 3a6fbfa6a4 Test the pass the test is actually for, instead of one that doesn't exist.
llvm-svn: 79257
2009-08-17 17:41:29 +00:00
Nick Lewycky 4c737147e1 Don't crash on critical edge. Patch by Andre Tavares.
llvm-svn: 79252
2009-08-17 17:00:57 +00:00
Richard Osborne 94a2c1acae Update getSectionForConstant() to to allow mergable sections to be nulled out
if not supported by the ELF subtarget.

llvm-svn: 79249
2009-08-17 16:37:11 +00:00
Duncan Sands 5a70e1e37e XFAIL this test since the fix was reverted.
llvm-svn: 79235
2009-08-17 12:20:45 +00:00
Nick Lewycky d87648a850 Add a test that shows that SSI is working correctly.
llvm-svn: 79230
2009-08-17 07:32:08 +00:00
Nick Lewycky aa464002f0 Don't crash trying to promote VLAs.
llvm-svn: 79226
2009-08-17 05:37:31 +00:00
Erick Tryzelaar ba167da17a Expose creating constant ints and floats from strings to ocaml.
llvm-svn: 79214
2009-08-16 23:37:03 +00:00
Eli Friedman d56fca4708 Fix for PR3016: detect the tricky case, where there are
unfoldable references to a PHI node in the block being folded, and disable
the transformation in that case.  The correct transformation of such PHI
nodes depends on whether BB dominates Succ, and dominance is expensive 
to compute here.  (Alternatively, it's possible to check whether any 
uses are live, but that's also essentially a dominance calculation. 
Another alternative is to use reg2mem, but it probably isn't a good idea to
use that in simplifycfg.)

Also, remove some incorrect code from CanPropagatePredecessorsForPHIs 
which is made unnecessary with this patch: it didn't consider the case 
where a PHI node in BB has multiple uses.

llvm-svn: 79174
2009-08-16 04:23:49 +00:00
Eli Friedman b4d7312249 Fix test on Linux.
llvm-svn: 79140
2009-08-15 21:28:17 +00:00
Bill Wendling bae6b2cca3 Reapply r79127. It was fixed by d0k.
llvm-svn: 79136
2009-08-15 21:21:19 +00:00
Bill Wendling d3fade656f Revert r79127. It was causing compilation errors.
llvm-svn: 79135
2009-08-15 21:14:01 +00:00
Nick Lewycky dd0e74ceee SSI construction should just go ahead and ignore instructions in unreachable
blocks.

llvm-svn: 79132
2009-08-15 20:12:18 +00:00