Commit Graph

23624 Commits

Author SHA1 Message Date
Anton Korobeynikov 76b8828c25 Factor out stuff into helper function
llvm-svn: 52862
2008-06-28 11:09:01 +00:00
Anton Korobeynikov 7d345eb4b1 Cleanup
llvm-svn: 52861
2008-06-28 11:08:44 +00:00
Anton Korobeynikov 016d1d0470 Remove X86SharedAsmPrinter
llvm-svn: 52860
2008-06-28 11:08:27 +00:00
Anton Korobeynikov 5643cb7ecc whitespace cleanup
llvm-svn: 52859
2008-06-28 11:08:09 +00:00
Anton Korobeynikov 4e9dfe8391 Make intel asmprinter child of generic asmprinter, not x86 shared asm printer. This leads to some code duplication, which will be resolved later.
llvm-svn: 52858
2008-06-28 11:07:54 +00:00
Anton Korobeynikov bc7cce6b74 Cleanup
llvm-svn: 52857
2008-06-28 11:07:35 +00:00
Anton Korobeynikov 44e99f47ad Whitespace cleanup
llvm-svn: 52856
2008-06-28 11:07:18 +00:00
Chris Lattner 3cffa471d9 Really fix the bootstrap failure.
llvm-svn: 52854
2008-06-28 06:24:50 +00:00
Chris Lattner 1701328675 Add back the capability to include nul characters in strings with
GetConstantStringInfo.  This will hopefully restore llvm-gcc to 
happy bootstrap land.

llvm-svn: 52851
2008-06-28 05:33:32 +00:00
Chris Lattner ebf1f67193 Tighten up checking.
llvm-svn: 52850
2008-06-28 04:37:04 +00:00
Dan Gohman 6f7b5a6392 When folding a bitcast into a load or store, preserve the alignment
information of the original load or store, which is checked to be
at least as good, and possibly better.

llvm-svn: 52849
2008-06-28 00:45:22 +00:00
Seo Sanghyeon 8f7291387f Fix GetMainExecutable. Patch by Sam Bishop.
llvm-svn: 52847
2008-06-27 22:55:30 +00:00
Evan Cheng 9a357637ef Looks like this condition is inverted.
llvm-svn: 52841
2008-06-27 22:11:49 +00:00
Chris Lattner 36b4e8f2fe implement some fixme's by making "autorenaming" in the value symbol table not
thrash the heap with string stuff (e.g. utostr).

llvm-svn: 52838
2008-06-27 21:26:26 +00:00
Chris Lattner 42e983e5a9 simplify some code to avoid string thrashing.
llvm-svn: 52837
2008-06-27 21:25:24 +00:00
Anton Korobeynikov 266f1cc1e4 Use StringSet instead of std::set<std::string>
llvm-svn: 52836
2008-06-27 21:22:49 +00:00
Chris Lattner e43649fa62 Add a new version of Module::getFunction that takes a const char* instead
of a std::string.  This avoids copying the string to the heap in common
cases.  Patch by Pratik Solanki!

llvm-svn: 52834
2008-06-27 21:09:10 +00:00
Devang Patel abc6e6ab9f Add dominator info printer pass.
llvm-svn: 52829
2008-06-27 16:43:21 +00:00
Anton Korobeynikov c1e80a759f Provide correct encoding for PPC LWARX instructions.
Patch by Gary Benson!

llvm-svn: 52828
2008-06-27 16:10:20 +00:00
Bill Wendling 196c78f0be Reduce number of times .size() is called on a vector. Rename some variables to
match normal naming scheme.

llvm-svn: 52820
2008-06-27 07:13:44 +00:00
Owen Anderson 413f7d90db Use a SmallSet when we can to reduce memory allocations.
This speeds up a particular testcase from 0.0302s to 0.0222s in LiveVariables.

llvm-svn: 52819
2008-06-27 07:05:59 +00:00
Owen Anderson 4f024862f6 Cache subregister relationships in a set in TargetRegisterInfo to allow faster lookups.
This speeds up LiveVariables from 0.6279s to 0.6165s on kimwitu++.

llvm-svn: 52818
2008-06-27 06:56:04 +00:00
Chris Lattner dc3f946137 fix the regressions from Eric's patch by making GetConstantStringInfo
tolerate a non-nul-terminated string, and handling a direct global 
reference.

llvm-svn: 52813
2008-06-27 03:36:51 +00:00
Chris Lattner 735705bc3e simplify this check, GetConstantStringInfo validates that a
global is constant already.  No functionality change.

llvm-svn: 52812
2008-06-27 03:18:41 +00:00
Chris Lattner b32a9ef00f when linking globals, make sure to preserve the address space of the global.
llvm-svn: 52810
2008-06-27 03:10:24 +00:00
Bill Wendling 3d92cbffc6 Cruft left from patch revert...sorry. :-(
llvm-svn: 52808
2008-06-27 01:32:08 +00:00
Bill Wendling fcbb9525d0 Reverting broken patch r52803.
llvm-svn: 52806
2008-06-27 01:27:56 +00:00
Owen Anderson 21498f52b2 Don't perform expensive queries checking for super and sub registers when we know that there aren't any.
This speed up LiveVariables on instcombine at -O0 -g from 0.3855s to 0.3503s.  Look for more improvements in this area soon!

llvm-svn: 52804
2008-06-27 01:22:50 +00:00
Bill Wendling f96d046d7c - Remove a use of std::vector.
- Make sure that we're not recalculating the size of a vector
  that never changes.

llvm-svn: 52803
2008-06-27 00:56:36 +00:00
Bill Wendling c758698d2c Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean up
some uses of std::vector, where it's return std::vector by value. Yuck!

llvm-svn: 52800
2008-06-27 00:09:40 +00:00
Chris Lattner df1cbdd645 duncan points out that isOperationLegal includes a check for
type legality.  Thanks Duncan!

llvm-svn: 52786
2008-06-26 17:16:00 +00:00
Owen Anderson 7df0d58535 Don't create a whole new string just to copy the elements into it.
llvm-svn: 52785
2008-06-26 17:06:02 +00:00
Matthijs Kooijman f61fd54237 Make LLVM compile on DragonFly BSD (PR2499).
Patch by Hasso Tepper!

llvm-svn: 52781
2008-06-26 10:36:58 +00:00
Bill Wendling 3fdca23ee1 Cleanup for unitialized types. Patch by Jean-Daniel Dupas!
llvm-svn: 52775
2008-06-26 08:32:05 +00:00
Chris Lattner d4741e803f "An improved Mach-O file type detection for sys::IdentifyFileType()
This patch add supports for single architecture mach-o files (the current implementation only support Universal Binary), and solve the signature conflict between java class and Universal Binary magics.

Note that this function will always returned dynamic library for Universal Binaries (like the current implementation) because the binary type is not include in the file header."

Patch by Jean-Daniel Dupas!

llvm-svn: 52766
2008-06-26 05:17:18 +00:00
Owen Anderson db0a48b1a7 Reserve the size we'll need in advance.
llvm-svn: 52763
2008-06-26 04:47:41 +00:00
Dale Johannesen a2de8eab61 Fixes the last x86-64 test failure in compat.exp:
<16 x float> is 64-byte aligned (for some reason),
which gets us into the stack realignment code.  The
computation changing FP-relative offsets to SP-relative
was broken, assiging a spill temp to a location
also used for parameter passing.  This
fixes it by rounding up the stack frame to a multiple
of the largest alignment (I concluded it wasn't fixable
without doing this, but I'm not very sure.)

llvm-svn: 52750
2008-06-26 01:51:13 +00:00
Eric Christopher 3f1c75c4d8 Remove unused function.
llvm-svn: 52749
2008-06-26 01:19:35 +00:00
Eric Christopher d0ab9c47e6 Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.

llvm-svn: 52748
2008-06-26 00:31:12 +00:00
Chris Lattner b1e66ce3bb when we know the signbit of an input to uint_to_fp is zero,
change it to sint_to_fp on targets where that is cheaper (and
visaversa of course).  This allows us to compile uint_to_fp to:

_test:
	movl	4(%esp), %eax
	shrl	$23, %eax
	cvtsi2ss	%eax, %xmm0
	movl	8(%esp), %eax
	movss	%xmm0, (%eax)
	ret

instead of:

	.align	3
LCPI1_0:					##  double
	.long	0	## double least significant word 4.5036e+15
	.long	1127219200	## double most significant word 4.5036e+15
	.text
	.align	4,0x90
	.globl	_test
_test:
	subl	$12, %esp
	movl	16(%esp), %eax
	shrl	$23, %eax
	movl	%eax, (%esp)
	movl	$1127219200, 4(%esp)
	movsd	(%esp), %xmm0
	subsd	LCPI1_0, %xmm0
	cvtsd2ss	%xmm0, %xmm0
	movl	20(%esp), %eax
	movss	%xmm0, (%eax)
	addl	$12, %esp
	ret

llvm-svn: 52747
2008-06-26 00:16:49 +00:00
Owen Anderson b55675e1db Remember which MachineOperand we were processing, so we don't have to scan the list to find it again later.
This speeds up live intervals from 0.37s to 0.30s on instcombine.

llvm-svn: 52745
2008-06-25 23:39:39 +00:00
Dan Gohman 39b07db75a Fix the text in an assert string.
llvm-svn: 52744
2008-06-25 22:14:43 +00:00
Evan Cheng 3fc2372d3a - Fix a x86 vector isel bug: illegal transformation of a vector_shuffle into a
shift.
- Add a readme entry for a missing vector_shuffle optimization that results in
  awful codegen.

llvm-svn: 52740
2008-06-25 20:52:59 +00:00
Duncan Sands 33ff5c8d0d Add support for expanding PPC 128 bit floats.
For this it is convenient to permit floats to
be used with EXTRACT_ELEMENT, so I tweaked
things to allow that.  I also added libcalls
for ppcf128 to i32 forms of FP_TO_XINT, since
they exist in libgcc and this case can certainly
occur (and does occur in the testsuite) - before
the i64 libcall was being used.  Also, the
XINT_TO_FP result seemed to be wrong when
the argument is an i128: the wrong fudge
factor was added (the i32 and i64 cases were
handled directly, but the i128 code fell
through to some generic softening code which
seemed to think it was i64 to f32!).  So I
fixed it by adding a fudge factor that I
found in my breakfast cereal.

llvm-svn: 52739
2008-06-25 20:24:48 +00:00
Chris Lattner 58ecfbdad6 Implement JIT support for global aliases, patch by David Chisnall!
llvm-svn: 52738
2008-06-25 20:21:35 +00:00
Evan Cheng 88ca48b09d Restore DeadArgElim back to 52570. It's breaking 447.dealII.
llvm-svn: 52736
2008-06-25 18:10:09 +00:00
Chris Lattner d3406fc2a7 Switch the PPC backend and target-independent JIT to use the libsystem
InvalidateInstructionCache method instead of calling through
a hook on the JIT.  This is a host feature, not a target feature.

llvm-svn: 52734
2008-06-25 17:18:44 +00:00
Chris Lattner b4325a8316 fix compilation errors in my previous patch
llvm-svn: 52733
2008-06-25 17:17:53 +00:00
Chris Lattner 881d537d2c Add a new InvalidateInstructionCache method to sys::Memory.
llvm-svn: 52731
2008-06-25 17:14:10 +00:00
Dan Gohman 906b630f83 SimpleInstructionSelector is here no more.
llvm-svn: 52725
2008-06-25 16:38:59 +00:00
Duncan Sands 6920b254ad Add/complete support for integer and float
select_cc and friends.  This code could be
factorized a bit but I'm not sure that it's
worth it.

llvm-svn: 52724
2008-06-25 16:34:21 +00:00
Duncan Sands 1b03c2ac98 Pacify gcc-4.3.
llvm-svn: 52723
2008-06-25 16:31:18 +00:00
Dan Gohman aa01afd47c Remove the OrigVT member from AtomicSDNode, as it is redundant with
the base SDNode's VTList.

llvm-svn: 52722
2008-06-25 16:07:49 +00:00
Mon P Wang 6a490371c9 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub

llvm-svn: 52706
2008-06-25 08:15:39 +00:00
Matthijs Kooijman 2e2001d8b9 Fix a (false) warning on darwin.
llvm-svn: 52705
2008-06-25 08:12:16 +00:00
Matthijs Kooijman 4e1cf1e7d7 Fix some cosmetics in comments.
llvm-svn: 52704
2008-06-25 08:10:21 +00:00
Evan Cheng 5fd28b54c7 - Use O(1) check of basic block size limit.
- Avoid speculatively execute vector ops.

llvm-svn: 52703
2008-06-25 07:50:12 +00:00
Chris Lattner c9c81fb0df Fix PR2488, a case where we deleted stack restores too aggressively.
llvm-svn: 52702
2008-06-25 05:59:28 +00:00
Evan Cheng 73db52ebf8 Enable two-address remat by default.
llvm-svn: 52701
2008-06-25 01:16:38 +00:00
Owen Anderson ee9c30d435 Use push_back rather than operator[], which is incorrect in this cases. Unfortunately, this slow the testcase down a little bit,
but only marginally.

llvm-svn: 52700
2008-06-25 01:05:05 +00:00
Dan Gohman 5ceb8b676c Append to the ActiveTimers std::vector before looking at the timer instead
of after, so that any reallocation it does doesn't get counted for the pass
being timed.  This probably doesn't account for a timing discrepancy I was
looking into, but I'm fixing it anyway.

llvm-svn: 52693
2008-06-24 22:07:07 +00:00
Dale Johannesen e5f4ffbdf1 Add v2f32 (MMX) type to X86. Support is primitive:
load,store,call,return,bitcast.  This is enough to
make call and return work.

llvm-svn: 52691
2008-06-24 22:01:44 +00:00
Owen Anderson 79c69bc45f In ConstantArray::getAsString(), we know the size of the resultant string in advance so we can pre-allocate it and just fill in
the entries.  This improves the time for the AsmPrinter on InstructionCombining.cpp from 0.4248s to 0.3370s.

llvm-svn: 52690
2008-06-24 21:58:29 +00:00
Owen Anderson 230b3eb80c Use SmallVector instead of std::vector for a minor compile time improvement.
llvm-svn: 52689
2008-06-24 21:44:59 +00:00
Dan Gohman 04c8bd7e11 Revert 52645, the loop unroller changes. It caused a regression in 252.eon.
llvm-svn: 52688
2008-06-24 20:44:42 +00:00
Dan Gohman 4be44e62b3 Fix a typo in a comment.
llvm-svn: 52687
2008-06-24 18:00:21 +00:00
Dan Gohman 61163850af Use const_cast instead of a C-style cast.
llvm-svn: 52684
2008-06-24 17:47:37 +00:00
Matthijs Kooijman c702e1d32f Commit the new DeadArgElim pass again, this time with the gcc bootstrap failures fixed.
Also add a testcase to reproduce the gcc bootstrap failure in very much reduced form.

llvm-svn: 52677
2008-06-24 16:30:26 +00:00
Matthijs Kooijman 19a6469e1b Rename a few variables to be more consistent.
llvm-svn: 52672
2008-06-24 09:14:10 +00:00
Evan Cheng 3f2ceac565 If it's determined safe, remat MOV32r0 (i.e. xor r, r) and others as it is instead of using the longer MOV32ri instruction.
llvm-svn: 52670
2008-06-24 07:10:51 +00:00
Dan Gohman 4aef821183 Fix some signed vs. unsigned issues in array and vector handling.
llvm-svn: 52664
2008-06-24 01:17:52 +00:00
Dan Gohman 02a2aaf2e7 Add a note about a potential PIC optimization.
llvm-svn: 52663
2008-06-24 00:53:07 +00:00
Dan Gohman 76600aa35c Fixes for being compiled PIC on Linux. This isn't the most
general solution possible, but it's a fairly simple one.
Based on a patch from the OpenGTL project!

llvm-svn: 52662
2008-06-24 00:50:01 +00:00
Dan Gohman 9cc3f68ab1 A brief survey of priority_queue usage in the tree turned this up
as a questionable case, but the code isn't actually needed.

llvm-svn: 52657
2008-06-23 23:51:16 +00:00
Bill Wendling c44659b92a This situation can occur:
,------.
    |      |
    |      v
    |   t2 = phi ... t1 ...
    |      |
    |      v
    |   t1 = ...
    |  ... = ... t1 ...
    |      |
    `------'

where there is a use in a PHI node that's a predecessor to the defining
block. We don't want to mark all predecessors as having the value "alive" in
this case. Also, the assert was too restrictive and didn't handle this case.

llvm-svn: 52655
2008-06-23 23:41:14 +00:00
Dan Gohman 0d8a61eb60 Use the new PriorityQueue in ScheduleDAGList too, which also
needs arbitrary-element removal.

llvm-svn: 52654
2008-06-23 23:40:09 +00:00
Dan Gohman abd8f41c81 Use use_empty() instead of getNumUses(), avoiding a use list traversal.
llvm-svn: 52651
2008-06-23 23:23:49 +00:00
Owen Anderson 79d2fa52fa Use getMBBEndIdx rather than assuming that the end is right after the last instruction in the block.
llvm-svn: 52649
2008-06-23 22:12:23 +00:00
Dan Gohman ac563833ae Fix spelling and grammar in a comment.
llvm-svn: 52648
2008-06-23 22:11:52 +00:00
Dan Gohman 48c5c7e860 Revamp the loop unroller, extending it to correctly update PHI nodes
in the presence of out-of-loop users of in-loop values and the trip
count is not a known multiple of the unroll count, and to be a bit
simpler overall. This fixes PR2253.

llvm-svn: 52645
2008-06-23 21:29:41 +00:00
Evan Cheng 71013f8c78 Remove option used to debug stack coloring bugs. It's no longer needed since stack coloring is now bug free.
llvm-svn: 52644
2008-06-23 21:24:32 +00:00
Evan Cheng 403e567043 Disable PRE. It's breaking bootstrapping.
llvm-svn: 52643
2008-06-23 21:22:35 +00:00
Dan Gohman fa63cc4e91 Move a DenseMap's declaration outside of a loop, and just call
clear() on each iteration. This avoids allocating and deallocating
all of DenseMap's memory on each iteration.

llvm-svn: 52642
2008-06-23 21:15:00 +00:00
Evan Cheng c72dcd103c Instead of adding an isSS field to LiveInterval to denote stack slot. Use top bit of 'reg' instead. If the top bit is set, than the LiveInterval represents a stack slot live interval.
llvm-svn: 52639
2008-06-23 21:03:19 +00:00
Wojciech Matyjewicz 41b744dc51 First step to fix PR2088. Implement routine to compute the
multiplicative inverse of a given number. Modify udivrem to allow input and 
output pairs of arguments to overlap. Patch is based on the work by Chandler
Carruth.

llvm-svn: 52638
2008-06-23 19:39:50 +00:00
Dan Gohman b936ea7fc4 Update the .cvs files.
llvm-svn: 52637
2008-06-23 18:43:26 +00:00
Dan Gohman a7c3e0e120 Fix the types for NumElements variables, and add a comment
explaining why empty array constants use ValID::createUndef().

llvm-svn: 52636
2008-06-23 18:40:28 +00:00
Owen Anderson 54e02194a1 Tighten the conditions under which we do PRE, remove some unneeded code, and correct our preserved analyses list, since we
do now change the CFG by splitting critical edges during PRE.

llvm-svn: 52631
2008-06-23 17:49:45 +00:00
Chris Lattner 4d754bc97b minor tidying of comments.
llvm-svn: 52630
2008-06-23 17:11:23 +00:00
Dan Gohman 210e6c1876 Remove two convenience constructors because they're now private, and the
private implementation doesn't really need the convenience.

llvm-svn: 52629
2008-06-23 16:48:17 +00:00
Dan Gohman 031f0bba15 Use std::copy instead of a loop.
llvm-svn: 52628
2008-06-23 16:45:24 +00:00
Dan Gohman a469bdbcdf More changes from Chris' review: simplify getIndices and avoid
copying its return value.

llvm-svn: 52627
2008-06-23 16:39:44 +00:00
Dan Gohman b4e2637e9b Duncan pointed out this code could be tidied.
llvm-svn: 52624
2008-06-23 15:29:14 +00:00
Duncan Sands d803ce29a8 Port some integer multiplication fixes from LegalizeDAG.
Bail out with an error if there is no libcall available
for the given size of integer.

llvm-svn: 52622
2008-06-23 15:15:44 +00:00
Duncan Sands 73ceffa3df Support for expanding the result of EXTRACT_ELEMENT.
llvm-svn: 52621
2008-06-23 15:08:15 +00:00
Duncan Sands bc12dce8bb Cleanup up LegalizeTypes handling of loads and
stores.

llvm-svn: 52620
2008-06-23 14:19:45 +00:00
Owen Anderson 00fdbd01e5 At Chris' suggestion, move the liveness and worklist datastructures into
instance variables so they can be allocated just once, and reuse the worklist
as the dead list as well.

llvm-svn: 52618
2008-06-23 06:13:12 +00:00
Dan Gohman 5ca5e02480 Improve LSR's dead-phi detection to handle use-def cycles
with more than two nodes.

llvm-svn: 52617
2008-06-22 20:44:02 +00:00
Dan Gohman 90071075e2 Use Loop::block_iterator.
llvm-svn: 52616
2008-06-22 20:18:58 +00:00
Dan Gohman 05e8973559 Generalize createSCEV to be able to form SCEV expressions from
ConstantExprs.

llvm-svn: 52615
2008-06-22 19:56:46 +00:00