Commit Graph

39783 Commits

Author SHA1 Message Date
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
Owen Anderson 05546f67cb Add a NextPowerOf2 function to calculate the next power of two greater than a given integer.
llvm-svn: 52839
2008-06-27 21:48:21 +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 7775588132 add a helper.
llvm-svn: 52835
2008-06-27 21:15:25 +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
Chris Lattner 5c91f4d7ba Tweak IRBuilder to explicitly call the setName(const char*) method on Value
instead of passing the name into the instruction ctors.  Since most 
instruction ctors take their name as an std::string, this avoids copying the
string to the heap and a malloc and free.

Patch by Pratik Solanki!

llvm-svn: 52832
2008-06-27 18:49:21 +00:00
Cedric Venet 69cb7be3b1 Add an include file needed for VS.
Add two new file to codegen project (VS).
This unbreak the build for VS.

llvm-svn: 52831
2008-06-27 18:00:09 +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
Argyrios Kyrtzidis 969cc2aea3 Since we are using GCC to assemble the program, make sure the assembly syntax is AT&T.
llvm-svn: 52827
2008-06-27 15:08:59 +00:00
Duncan Sands 0690fdbef2 Regression test for PR2443.
llvm-svn: 52826
2008-06-27 14:22:20 +00:00
Duncan Sands 8269d5ca0a Use the c modifier to tell llvm-ar not to issue a
warning when creating the archive (the warning
causes the test to fail).

llvm-svn: 52824
2008-06-27 10:52:12 +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 501c0b82d6 test doesn't need eh info
llvm-svn: 52811
2008-06-27 03:14:20 +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 54c3377d01 More cruft from revert...
llvm-svn: 52809
2008-06-27 01:37:37 +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
Gordon Henriksen 3b2e269475 Add a note for Thunderbird users to the Developer Policy.
llvm-svn: 52797
2008-06-26 22:58:37 +00:00
Chris Lattner 4ca6973589 allow updating the MPM, so that you can use one FunctionPAssManager with
multiple ModuleProviders, e.g. with the JIT.

llvm-svn: 52796
2008-06-26 22:26:45 +00:00
Evan Cheng f79a4a1f01 XFAIL for now.
llvm-svn: 52795
2008-06-26 22:09:29 +00:00
Bill Wendling 066eabb04d Remove warnings about shadowed and unused variables.
llvm-svn: 52791
2008-06-26 18:11:45 +00:00
Ted Kremenek 8ad5228225 Update VS project files. The clang executable now depends on the LLVM Analysis library.
llvm-svn: 52789
2008-06-26 17:53:12 +00:00
Owen Anderson 1aab7a5b2a Use a DenseMap instead of an std::map for mangled name lookup. This is
improves AsmPrinter runtime on instcombine from 0.3920s to 0.3836s.

llvm-svn: 52787
2008-06-26 17:20:16 +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
Owen Anderson 1fb47ad928 Use the -enable-pre flag so this test doesn't fail.
llvm-svn: 52784
2008-06-26 17:03:28 +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
Matthijs Kooijman b032fedf7d Add missing semicolumn in my last commit.
llvm-svn: 52780
2008-06-26 09:49:38 +00:00
Matthijs Kooijman 1b60621ac9 Improve comments wrt createInternalize.
llvm-svn: 52779
2008-06-26 09:48:11 +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 0e28b3b9ee Allow for rounding up of stack frame.
llvm-svn: 52751
2008-06-26 01:55:32 +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
Chris Lattner d95b74870e jump threading can introduce allocas, make sure we promote
them back to registers!

llvm-svn: 52729
2008-06-25 16:54:18 +00:00
Chris Lattner 0e06949726 run mem2reg after the second jump threading pass in llvm-ld.
llvm-svn: 52728
2008-06-25 16:51:55 +00:00
Chris Lattner 651e66d14c remove a bunch of dead options that never did anything.
llvm-svn: 52727
2008-06-25 16:44:52 +00:00
Chris Lattner 10d75bb88b remove some dead options.
llvm-svn: 52726
2008-06-25 16:44:08 +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
Chris Lattner 99fea6f405 simplify shell syntax to work better on solaris, patch by
Nathan Keynes!

llvm-svn: 52721
2008-06-25 16:03:42 +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
Gabor Greif 845eb8ea44 Use present tense when talking about User layout. It is implemented now.
llvm-svn: 52699
2008-06-25 00:10:22 +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 6316bc705e v2f32 is now a valid (MMX) type which breaks this
test (doesn't work for any MMX vector types, it's
not me).  Rewritten to use v2i16 which is generic
and going to stay that way; I think that preserves
the point of the test.

llvm-svn: 52692
2008-06-24 22:03:36 +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 9aaafadc60 Make Allocate<T>() return a T* instead of a void*. And use
static_cast instead of reinterpret_cast.

llvm-svn: 52686
2008-06-24 17:49:26 +00:00
Tanya Lattner 42ba346df6 Regenerate configure.
llvm-svn: 52685
2008-06-24 17:49:13 +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
Dan Gohman e1789e3783 Correct a comment.
llvm-svn: 52683
2008-06-24 17:46:48 +00:00
Chris Lattner 01602a18a9 Add support for building on solaris, working around namespace
polution problems from system headers.  Patch by Nathan Keynes!

llvm-svn: 52682
2008-06-24 17:44:42 +00:00
Dan Gohman d5cd61dca6 Pass std::string by reference. Thanks Chris!
llvm-svn: 52678
2008-06-24 16:40:22 +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 a2509a1a48 Allow the test suite to be checked out into projects/test-suite.
We will keep the old projects/llvm-test working for existing installs.

The changes to configure are made manually, since I lack autoconf-2.6. Someone
might want to run AutoGen.sh to see if that changes anything.

llvm-svn: 52675
2008-06-24 13:01:57 +00:00
Matthijs Kooijman 8fd284185c Update testing documentation with more consistent terminology.
All of LLVM's testing features are now referred to as the "Testing
infrastructure", the DejaGNU tests are just that, and the whole program tests
are referred to as the "test suite".

llvm-svn: 52674
2008-06-24 12:58:31 +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
Owen Anderson 04bbf4b5b7 Remove an incorrect comment.
llvm-svn: 52660
2008-06-24 00:15:10 +00:00
Owen Anderson c2ec2f20f9 Use InstrSlots::NUM rather than pre-dividing by four. Also, mark this const.
llvm-svn: 52659
2008-06-24 00:08:35 +00:00
Dan Gohman 6269cc1ced Comment fixes, and make Schedule() pure virtual.
llvm-svn: 52658
2008-06-24 00:02:44 +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
Dan Gohman cb236f7de9 Add a clear() method to PriorityQueue.
llvm-svn: 52656
2008-06-23 23:47:46 +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
Owen Anderson ba3e9de279 Add getScaledIntervalSize, which gives a measure of the size of an interval that is independent of the scaling of
the function due to empty index slots.  This is suitable for use in backend heuristics that need to reason about the density
of an interval.

llvm-svn: 52652
2008-06-23 23:25:37 +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
Bill Wendling e2af44d9c0 Extract the x86_64 part for the executables.
llvm-svn: 52647
2008-06-23 22:08:30 +00:00
Dan Gohman e7ccb2c8c1 Simplify erase_one slightly. It's not necessary to preserve
the value of the element to be erased while the heap is
being updated.

llvm-svn: 52646
2008-06-23 21:46:21 +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
Dan Gohman 29a8220501 Use StringMap instead of std::map<std::string, SDNode*>.
llvm-svn: 52641
2008-06-23 21:08:32 +00:00
Dan Gohman 54cf756621 Add methods to StringMap to erase entries by key.
llvm-svn: 52640
2008-06-23 21:07:03 +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 4193f34538 Remove an unnecessary cast.
llvm-svn: 52626
2008-06-23 16:38:10 +00:00
Dan Gohman b4e2637e9b Duncan pointed out this code could be tidied.
llvm-svn: 52624
2008-06-23 15:29:14 +00:00
Dan Gohman 88ce1a5b6b Fix the syntax of insertvalue in the example.
llvm-svn: 52623
2008-06-23 15:26:37 +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
Bill Wendling 559067c55c Make test work on non-x86 machines (like my G4 PPC).
llvm-svn: 52619
2008-06-23 06:16:31 +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
Dan Gohman 6829fffaee Use SCEVAddRecExpr::isAffine.
llvm-svn: 52614
2008-06-22 19:23:09 +00:00
Dan Gohman 1f2b2a4abe Remove unnecessary #includes.
llvm-svn: 52613
2008-06-22 19:21:26 +00:00
Dan Gohman 0e4cf89f1a Move a few more SCEVExpander methods out-of-line.
llvm-svn: 52612
2008-06-22 19:09:18 +00:00
Chris Lattner 6ff85681e4 Fix PR2369 by making scalarrepl more careful about promoting
structures.  Its default threshold is to promote things that are
smaller than 128 bytes, which is sane.  However, it is not sane
to do this for things that turn into 128 *registers*.  Add a cap
on the number of registers introduced, defaulting to 128/4=32.

llvm-svn: 52611
2008-06-22 17:46:21 +00:00
Duncan Sands 5fb92e58de Make custom lowering of ADD work correctly. This
fixes PR2476; patch by Richard Osborne.  The same
problem exists for a bunch of other operators, but
I'm ignoring this because they will be automagically
fixed when the new LegalizeTypes infrastructure lands,
since it already solves this problem centrally.

llvm-svn: 52610
2008-06-22 09:42:16 +00:00
Eli Friedman d3449df326 Fix for PR2479: correctly optimize expressions like (a > 13) & (a ==
15).

See also PR1800, which is about the signed case.

llvm-svn: 52608
2008-06-21 23:36:13 +00:00
Dan Gohman 158ff2c4a9 Use Instruction::eraseFromParent().
llvm-svn: 52606
2008-06-21 22:08:46 +00:00
Dan Gohman c7076914ac Use Function's arg_size() and size() methods.
llvm-svn: 52605
2008-06-21 22:06:54 +00:00
Dan Gohman 546505e7e1 Simplify some getNode calls.
llvm-svn: 52604
2008-06-21 22:06:07 +00:00
Dan Gohman ea0452016e canClobberPhysRegDefs shouldn't called without checking hasPhysRegDefs;
check this with an assert.

llvm-svn: 52603
2008-06-21 22:05:24 +00:00
Dan Gohman 33204b7c20 Avoid creating a redundant zero APInt.
llvm-svn: 52602
2008-06-21 22:03:12 +00:00
Dan Gohman 38c19aae38 Use clear() to zero an existing APInt.
llvm-svn: 52601
2008-06-21 22:02:15 +00:00
Dan Gohman 1ac5813726 Use back() instead of [size()-1].
llvm-svn: 52600
2008-06-21 22:00:54 +00:00
Duncan Sands c7ef3cb43f This file is empty.
llvm-svn: 52596
2008-06-21 20:26:50 +00:00
Duncan Sands 2649ff8672 Turn off llvm-gcc warnings when running "make check".
llvm-svn: 52595
2008-06-21 20:22:58 +00:00
Dan Gohman 55083d5dd3 Use MachineBasicBlock::transferSuccessors.
llvm-svn: 52594
2008-06-21 20:21:19 +00:00
Dan Gohman 1cf5af9e42 Use static_cast instead of reinterpret_cast for casting void*.
llvm-svn: 52592
2008-06-21 20:17:03 +00:00
Chris Lattner 8459e0bc59 Fix warning when assertions disabled.
llvm-svn: 52590
2008-06-21 19:49:01 +00:00
Chris Lattner e635acab67 fix warning when assertions disabled.
llvm-svn: 52589
2008-06-21 19:48:22 +00:00
Chris Lattner 18a3284a0a fix warning when assertion disabled.
llvm-svn: 52588
2008-06-21 19:47:44 +00:00
Chris Lattner 106b046d83 fix some warnings when assertions are disabled.
llvm-svn: 52587
2008-06-21 19:47:03 +00:00
Dan Gohman 14b911d929 Remove a redundant return.
llvm-svn: 52585
2008-06-21 19:34:57 +00:00
Dan Gohman b282cc6070 Reorder some fields in SDNode. This avoids padding,
reducings its size from 80 to 72 on 64-bit hosts.

llvm-svn: 52584
2008-06-21 19:26:15 +00:00
Dan Gohman 46520a25a4 Remove ScheduleDAG's SUnitMap altogether. Instead, use SDNode's NodeId
field, which is otherwise unused after instruction selection, as an index
into the SUnit array.

llvm-svn: 52583
2008-06-21 19:18:17 +00:00
Dan Gohman a4db3352f9 Add a priority queue class, which is a wrapper around std::priority_queue
and provides fairly efficient removal of arbitrary elements. Switch
ScheduleDAGRRList from std::set to this new priority queue.

llvm-svn: 52582
2008-06-21 18:35:25 +00:00
Duncan Sands 3bb8999719 Support for load/store of expanded float types. I
don't know if a truncating store is possible here,
but added support for it anyway.

llvm-svn: 52577
2008-06-21 17:00:47 +00:00
Dan Gohman e6e1348275 Change ScheduleDAG's SUnitMap from DenseMap<SDNode*, vector<SUnit*> >
to DenseMap<SDNode*, SUnit*>, and adjust the way cloned SUnit nodes are
handled so that only the original node needs to be in the map.
This speeds up llc on 447.dealII.llvm.bc by about 2%.

llvm-svn: 52576
2008-06-21 15:52:51 +00:00
Evan Cheng 42bbca11cc Enable PRE.
llvm-svn: 52574
2008-06-21 07:26:53 +00:00
Evan Cheng f593a65497 Undo spill weight tweak. Need to investigate the performance regressions.
llvm-svn: 52572
2008-06-21 06:45:54 +00:00
Dan Gohman 4b49be1cbe Simplify some template parameterization.
llvm-svn: 52571
2008-06-21 01:08:22 +00:00
Evan Cheng 33067210d1 Back out Matthijs' DAE patches. It's miscompiling gcc driver.
llvm-svn: 52570
2008-06-21 00:31:44 +00:00
Ted Kremenek 4c32155a0f Updated VS build system. Patch provided by Cedric Venet:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2008-June/015446.html

llvm-svn: 52564
2008-06-20 22:19:12 +00:00
Evan Cheng efc67e78d7 Enhanced heuristic to determine the *best* register to spill. Instead of picking the register with the lowest spill weight. Consider (up to) 2 additional registers with spill weights that are close to the lowest spill weight. The one with fewest defs and uses that conflicts with the current interval (weighted by loop depth) is the spill candidate.
This is not always a win, but there are much more wins than loses and wins tend to be more noticeable.

llvm-svn: 52554
2008-06-20 21:45:16 +00:00
Chris Lattner e4645615d3 integer types are not primitive, they are derived.
llvm-svn: 52551
2008-06-20 20:50:48 +00:00
Owen Anderson d1cb6e2466 llvmc doesn't exist anymore, and llvmc2 doesn't have a special license file.
llvm-svn: 52550
2008-06-20 20:05:57 +00:00
Duncan Sands f362183c24 Share some code that is common between integer and
float expansion (and sometimes vector splitting too).

llvm-svn: 52548
2008-06-20 18:40:50 +00:00
Duncan Sands b6a90ccaee Add some methods for querying the nature of a
store, like the methods for loads (and neaten
those up a bit while there).

llvm-svn: 52547
2008-06-20 18:34:30 +00:00
Duncan Sands 49295b48eb Rename the operation of turning a float type into an
integer of the same type.  Before it was "promotion",
but this is confusing because it is quite different
to promotion of integers.  Call it "softening" instead,
inspired by "soft float".

llvm-svn: 52546
2008-06-20 17:49:55 +00:00
Dan Gohman 3792c470d5 Clean up some uses of std::distance, now that we have allnodes_size.
llvm-svn: 52545
2008-06-20 17:15:19 +00:00
Dan Gohman 3ada1e118b Clean up a use of std::distance.
llvm-svn: 52544
2008-06-20 17:11:32 +00:00
Dan Gohman a5dd67f002 Tidy up some commments and use the getAggregateOperand and
getInsertedValueOperand accessors. Thanks Matthijs!

llvm-svn: 52543
2008-06-20 16:41:17 +00:00
Dan Gohman b5210efb31 Fix the conditions under which SCCP should examine insertvalue
instructions. Thanks to Matthijs Kooijman for pointing this out!

llvm-svn: 52542
2008-06-20 16:39:44 +00:00
Dan Gohman 795e2943a2 Add an allnodes_size method.
llvm-svn: 52541
2008-06-20 16:03:16 +00:00
Matthijs Kooijman 48b282f03b Add testcase that checks that DeadArgElim doesn't touch stuff it shouldn't touch.
llvm-svn: 52540
2008-06-20 15:38:22 +00:00
Matthijs Kooijman c456f9dfc6 80 column and trailing whitespace fixes.
llvm-svn: 52539
2008-06-20 15:34:07 +00:00
Matthijs Kooijman 0c50b953c5 Don't let DeadArgumentElimination attempt to update callers when the return
type wasn't changed.

llvm-svn: 52538
2008-06-20 15:25:43 +00:00
Matthijs Kooijman 9dc59b7666 Don't let DeadArgElimination change the return type ({} into void and {T}
into T) when no return values are actually dead.

llvm-svn: 52537
2008-06-20 15:16:45 +00:00
Matthijs Kooijman 013b6a9a42 Explicitely track if any arguments or return values were removed in
DeadArgumentElimination and assert that the function type does not change if
nothing was changed. This should catch subtle changes in function type that are
not intended.

llvm-svn: 52536
2008-06-20 14:28:52 +00:00
Matthijs Kooijman e91aed6ce1 Remove debug output.
llvm-svn: 52535
2008-06-20 14:03:35 +00:00
Matthijs Kooijman 8d32dee428 Recommit r52459, rewriting of the dead argument elimination pass.
This is a fixed version that no longer uses multimap::equal_range, which
resulted in a pointer invalidation problem.

Also, DAE::InspectedFunctions was not really necessary, so it got removed.

Lastly, this version no longer applies the extra arg hack on functions who did
not have any arguments to start with.

llvm-svn: 52532
2008-06-20 09:36:16 +00:00
Owen Anderson 78fbcafb53 Really disable PRE.
llvm-svn: 52531
2008-06-20 08:59:13 +00:00
Chris Lattner 2616a7e0f7 "Just a small update for the project files for adding a missing preprocessor
definition for VS2005 (without SP1). It suppress the (bogus) M$ deprecated
warning."

Patch by Cédric Venet!

llvm-svn: 52530
2008-06-20 05:35:58 +00:00
Chris Lattner 54d26c6b12 Fix a warning, closing PR2452
llvm-svn: 52529
2008-06-20 05:33:29 +00:00
Chris Lattner 65ee4e3a5c Fix a warning.
llvm-svn: 52528
2008-06-20 05:31:04 +00:00
Chris Lattner d53bd2da98 Fix an error handling redefinition of linkonce functions where the
types differ.  Patch by Nathan Keynes!

llvm-svn: 52527
2008-06-20 05:29:39 +00:00
Chris Lattner ba00c761b7 fix a warning.
llvm-svn: 52526
2008-06-20 05:28:56 +00:00
Chris Lattner f3ecd2d290 Fix PR2471, which is a bug involving an invalid promotion from a conditional load.
llvm-svn: 52525
2008-06-20 05:12:56 +00:00
Chris Lattner 643b00a3e6 Fix typo, fix suggested by Nicholas Olsen
llvm-svn: 52524
2008-06-20 05:03:17 +00:00
Gordon Henriksen 9f337549a7 Add C binding for ExecutionEngine::addGlobalMapping.
llvm-svn: 52523
2008-06-20 02:16:11 +00:00
Dan Gohman 593a010c56 Teach ReturnInst lowering about aggregate return values.
llvm-svn: 52522
2008-06-20 01:29:26 +00:00
Owen Anderson 1b3ea963f7 Change around the data structures used to store availability sets, resulting in a GVN+PRE that is faster that GVN alone was before.
llvm-svn: 52521
2008-06-20 01:15:47 +00:00
Dan Gohman 041f9d03ff Teach SCCP about insertvalue and extractvalue, and about
propagating constants across aggregate return values when
insertvalue and extractvalue are used.

llvm-svn: 52520
2008-06-20 01:15:44 +00:00
Dan Gohman 3b18fd7b02 Teach InlineFunction how to differentiate between multiple-value
return statements and aggregate returns so that it handles both
correctly.

llvm-svn: 52519
2008-06-20 01:03:44 +00:00
Evan Cheng 9598f930f3 Disable PRE for now. It seems to be breaking llvm-gcc bootstrapping.
llvm-svn: 52518
2008-06-20 01:01:07 +00:00