1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

441 Commits

Author SHA1 Message Date
Dan Gohman
74d5144414 Use pre-increment instead of post-increment when the result is not used.
llvm-svn: 106542
2010-06-22 15:08:57 +00:00
Dan Gohman
0d7d3faf8e Move FindAvailableLoadedValue isSafeToLoadUnconditionally out of
lib/Transforms/Utils and into lib/Analysis so that Analysis passes
can use them.

llvm-svn: 104949
2010-05-28 16:19:17 +00:00
Chris Lattner
1037630863 Fix PR7052, patch by Jakub Staszak!
llvm-svn: 103347
2010-05-08 20:01:44 +00:00
Bob Wilson
e4555598a2 Use the right version of "append" to combine two SmallVectors.
This fixes the compile-time regressions seen in last night's tests.

llvm-svn: 103118
2010-05-05 20:44:15 +00:00
Bob Wilson
5576ed9c86 Defer adding critical edges to the "toSplit" list until after checking for
indirect branches in all the predecessors.  This avoids unnecessarily
splitting edges in cases where load PRE is not possible anyway.
Thanks to Jakub Staszak for pointing this out.

llvm-svn: 103034
2010-05-04 20:03:21 +00:00
Eric Christopher
e78496e5f1 Revert 101465, it broke internal OpenGL testing.
Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.

llvm-svn: 101579
2010-04-16 23:37:20 +00:00
Gabor Greif
e7d6812008 reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101465
2010-04-16 15:33:14 +00:00
Gabor Greif
cd116e8c6a back out r101423 and r101397, they break llvm-gcc self-host on darwin10
llvm-svn: 101434
2010-04-16 01:16:20 +00:00
Gabor Greif
2e18d34d80 reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101397
2010-04-15 20:51:13 +00:00
Dan Gohman
d48633d340 Fix a bunch of namespace polution.
llvm-svn: 101376
2010-04-15 17:08:50 +00:00
Gabor Greif
6022150477 back out r101364, as it trips the linux nightlybot on some clang C++ tests
llvm-svn: 101368
2010-04-15 12:46:56 +00:00
Gabor Greif
428ca23bbd rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary

llvm-svn: 101364
2010-04-15 10:49:53 +00:00
Gabor Greif
6f820a041f const-ize a predicate
llvm-svn: 100856
2010-04-09 10:57:00 +00:00
Chris Lattner
1d47291927 fix PR6642, GVN forwarding from memset to load of the base of the memset.
llvm-svn: 99488
2010-03-25 05:58:19 +00:00
Bob Wilson
12797a7a6c Don't attempt load PRE when there is no real redundancy (i.e., the load is in
a loop and is itself the only dependency).

llvm-svn: 97526
2010-03-02 00:09:29 +00:00
Bob Wilson
9207e3f81f When GVN needs to split critical edges for load PRE, check all of the
predecessors before returning.  Otherwise, if multiple predecessor edges need
splitting, we only get one of them per iteration.  This makes a small but
measurable compile time improvement with -enable-full-load-pre.

llvm-svn: 97521
2010-03-01 23:37:32 +00:00
Evan Cheng
c97b5fe4b9 MemoryDepAnalysis is not used if redundant load processing is disabled.
llvm-svn: 97512
2010-03-01 22:23:12 +00:00
Bob Wilson
6d8360b3d8 Revert r97245 which seems to be causing performance problems.
llvm-svn: 97366
2010-02-28 05:34:05 +00:00
Bob Wilson
139fdbd4d2 Move the EnableFullLoadPRE flag from a separate command-line option to an
argument of createGVNPass and set it automatically for -O3.

llvm-svn: 97245
2010-02-26 19:09:47 +00:00
Bob Wilson
cf20a07501 Remove unused "NoPRE" parameter in GVN and createGVNPass().
llvm-svn: 97235
2010-02-26 18:35:19 +00:00
Daniel Dunbar
8adb7774dc Reapply r97010, the speculative revert failed.
llvm-svn: 97036
2010-02-24 08:48:04 +00:00
Daniel Dunbar
8b33ce41d0 Speculatively revert r97010, "Add an argument to PHITranslateValue to specify
the DominatorTree. ...", in hopes of restoring poor old PPC bootstrap.

llvm-svn: 97027
2010-02-24 06:55:22 +00:00
Bob Wilson
437d85dd57 Add an argument to PHITranslateValue to specify the DominatorTree. If this
argument is non-null, pass it along to PHITranslateSubExpr so that it can
prefer using existing values that dominate the PredBB, instead of just
blindly picking the first equivalent value that it finds on a uselist.
Also when the DominatorTree is specified, have PHITranslateValue filter
out any result that does not dominate the PredBB.  This is basically just
refactoring the check that used to be in GetAvailablePHITranslatedSubExpr
and also in GVN.

Despite my initial expectations, this change does not affect the results
of GVN for any testcases that I could find, but it should help compile time.
Before this change, if PHITranslateSubExpr picked a value that does not
dominate, PHITranslateWithInsertion would then insert a new value, which GVN
would later determine to be redundant and would replace.  By picking a good
value to begin with, we save GVN the extra work of inserting and then
replacing a new value.

llvm-svn: 97010
2010-02-24 01:39:00 +00:00
Bob Wilson
b3640f8018 Update memdep when load PRE inserts a new load, and add some debug output.
I don't have a small testcase for this.

llvm-svn: 96890
2010-02-23 05:55:00 +00:00
Bob Wilson
e075edf725 Erase deleted instructions from GVN's ValueTable. This fixes assertion
failures from ValueTable::verifyRemoved() when using -debug.

llvm-svn: 96805
2010-02-22 21:39:41 +00:00
Bob Wilson
86dded571f Rename SuccessorNumber to GetSuccessorNumber.
llvm-svn: 96387
2010-02-16 21:06:42 +00:00
Bob Wilson
a866c660db Split critical edges as needed for load PRE.
llvm-svn: 96378
2010-02-16 19:51:59 +00:00
Bob Wilson
1115365fcf Refactor to share code to find the position of a basic block successor in the
terminator's list of successors.

llvm-svn: 96377
2010-02-16 19:49:17 +00:00
Duncan Sands
1b33dd3c83 There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.

llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Devang Patel
e87a8a944d Ignore dbg info intrinsics.
llvm-svn: 95828
2010-02-11 00:20:49 +00:00
Bob Wilson
cabb8bea4c Fix some comment typos.
llvm-svn: 95170
2010-02-03 00:33:21 +00:00
Bob Wilson
1f966e8ca6 Add an option to GVN to remove all partially redundant loads. This is currently
disabled by default.  This divides the existing load PRE code into 2 phases:
first it checks that it is safe to move the load to each of the predecessors
where it is unavailable, and then if it is safe, the code is changed to move
the load.  Radar 7571861.

llvm-svn: 95007
2010-02-01 21:17:14 +00:00
Bob Wilson
0f04082970 Check alignment of loads when deciding whether it is safe to execute them
unconditionally.  Besides checking the offset, also check that the underlying
object is aligned as much as the load itself.

llvm-svn: 94875
2010-01-30 04:42:39 +00:00
Bob Wilson
f897b7b37e Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the
underlying object.

llvm-svn: 94829
2010-01-29 19:19:08 +00:00
Bob Wilson
e3d00b2e56 Remove check for an impossible condition: the condition of the while loop has
already checked that TmpBB->getSinglePredecessor() is non-null.

llvm-svn: 94451
2010-01-25 21:28:05 +00:00
Owen Anderson
d73ce407a5 Convert some of the dynamic opcode lookups into static ones.
llvm-svn: 93693
2010-01-17 19:33:27 +00:00
Dan Gohman
e4a22bdd4a Use do+while instead of while for loops which obviously have a
non-zero trip count. Use SmallVector's pop_back_val().

llvm-svn: 92734
2010-01-05 16:27:25 +00:00
David Greene
9befdbf1a8 Change errs() to dbgs().
llvm-svn: 92613
2010-01-05 01:27:17 +00:00
Chris Lattner
e0b9847223 split code that doesn't need to be templated out of IRBuilder into a new
non-templated IRBuilderBase class.  Move that large CreateGlobalString
out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h

llvm-svn: 92227
2009-12-28 21:28:46 +00:00
Chris Lattner
cd79ebb23c The phi translated pointer can be computed when returning a partially cached result
instead of stored.  This reduces memdep memory usage, and also eliminates a bunch of
weakvh's.  This speeds up gvn on gcc.c-torture/20001226-1.c from 23.9s to 8.45s (2.8x)
on a different machine than earlier.

llvm-svn: 91885
2009-12-22 04:25:02 +00:00
Chris Lattner
8bd3f74d82 Add a fastpath to Load GVN to special case when we have exactly one dominating
load to avoid even messing around with SSAUpdate at all.  In this case (which
is very common, we can just use the input value directly).

This speeds up GVN time on gcc.c-torture/20001226-1.c from 36.4s to 16.3s,
which still isn't great, but substantially better and this is a simple speedup
that applies to lots of different cases.

llvm-svn: 91851
2009-12-21 23:15:48 +00:00
Chris Lattner
41cad2092d refactor some code out to a new helper method.
llvm-svn: 91849
2009-12-21 23:04:33 +00:00
Dan Gohman
87a4da3d59 Eliminte unnecessary uses of <cstdio>.
llvm-svn: 91666
2009-12-18 03:25:51 +00:00
Chris Lattner
587962c667 Remove isPod() from DenseMapInfo, splitting it out to its own
isPodLike type trait.  This is a generally useful type trait for
more than just DenseMap, and we really care about whether something
acts like a pod, not whether it really is a pod.

llvm-svn: 91421
2009-12-15 07:26:43 +00:00
Chris Lattner
ffedf37584 Fix PR5744, a case where we were getting the pointer size instead of the
value size.  This only manifested when memdep inprecisely returns clobber,
which is do to a caching issue in the PR5744 testcase.  We can 'efficiently
emulate' this by using '-no-aa'

llvm-svn: 91004
2009-12-10 00:11:45 +00:00
Chris Lattner
af8114cef6 allow this to build when the #if 0's are enabled. No functionality change.
llvm-svn: 90999
2009-12-10 00:04:46 +00:00
Chris Lattner
bf3d03b576 fix hte last remaining known (by me) phi translation bug. When we reanalyze
clobbers to forward pieces of large stores to small loads, we need to consider
the properly phi translated pointer in the store block.

llvm-svn: 90978
2009-12-09 18:21:46 +00:00
Chris Lattner
a97922837e change GetStoreValueForLoad to use IRBuilder, which is cleaner and
implicitly constant folds.

llvm-svn: 90977
2009-12-09 18:13:28 +00:00
Chris Lattner
db0baa713d change AnalyzeLoadFromClobberingMemInst/AnalyzeLoadFromClobberingStore
to require the load ty/ptr to be passed in, no functionality change.

llvm-svn: 90960
2009-12-09 07:37:07 +00:00
Chris Lattner
b3587059c8 change AnalyzeLoadFromClobberingWrite and clients to pass in type
and pointer instead of the load.  No functionality change.

llvm-svn: 90959
2009-12-09 07:34:10 +00:00
Chris Lattner
e0207b46d2 change NonLocalDepEntry from being a typedef for an std::pair to be its
own small class.  No functionality change.

llvm-svn: 90956
2009-12-09 07:08:01 +00:00
Chris Lattner
4645bb977a add some aborts to #if 0's.
llvm-svn: 90929
2009-12-09 02:41:54 +00:00
Chris Lattner
dda5ca59e2 Switch GVN and memdep to use PHITransAddr, which correctly handles
phi translation of complex expressions like &A[i+1].  This has the
following benefits:

1. The phi translation logic is all contained in its own class with
   a strong interface and verification that it is self consistent.

2. The logic is more correct than before.  Previously, if intermediate
   expressions got PHI translated, we'd miss the update and scan for
   the wrong pointers in predecessor blocks.  @phi_trans2 is a testcase
   for this.

3. We have a lot less code in memdep.

We can handle phi translation across blocks of things like @phi_trans3,
which is pretty insane :).

This patch should fix the miscompiles of 255.vortex, and I tested it 
with a bootstrap of llvm-gcc, llvm-test and dejagnu of course.

llvm-svn: 90926
2009-12-09 01:59:31 +00:00
Chris Lattner
ea3007ddb8 constant fold loads from memcpy's from global constants. This is important
because clang lowers nontrivial automatic struct/array inits to memcpy from
a global array.

llvm-svn: 90698
2009-12-06 05:29:56 +00:00
Chris Lattner
8885e71303 add support for forwarding mem intrinsic values to non-local loads.
llvm-svn: 90697
2009-12-06 04:54:31 +00:00
Chris Lattner
5eba6ee969 Handle forwarding local memsets to loads. For example, we optimize this:
short x(short *A) {
  memset(A, 1, sizeof(*A)*100);
  return A[42];
}

to 'return 257' instead of doing the load.  

llvm-svn: 90695
2009-12-06 01:57:02 +00:00
Owen Anderson
251cb28a25 Fix this crasher, and add a FIXME for a missed optimization.
llvm-svn: 90408
2009-12-03 03:43:29 +00:00
Owen Anderson
f47cde694f Cleanup/remove some parts of the lifetime region handling code in memdep and GVN,
per Chris' comments.  Adjust testcases to match.

llvm-svn: 90304
2009-12-02 07:35:19 +00:00
Chris Lattner
b541c63e60 factor some code better.
llvm-svn: 90299
2009-12-02 06:44:58 +00:00
Chris Lattner
83284453a1 reenable load address insertion in load pre. This allows us to
handle cases like this:
void test(int N, double* G) {
  long j;
  for (j = 1; j < N - 1; j++)
      G[j+1] = G[j] + G[j+1];
}

where G[1] isn't live into the loop.

llvm-svn: 90041
2009-11-28 16:08:18 +00:00
Chris Lattner
f8d8142a06 Enhance InsertPHITranslatedPointer to be able to return a list of newly
inserted instructions.  No functionality change until someone starts using it.

llvm-svn: 90039
2009-11-28 15:39:14 +00:00
Chris Lattner
f3e5cbfc99 disable value insertion for now, I need to figure out how
to inform GVN about the newly inserted values.  This fixes 
PR5631.

llvm-svn: 90022
2009-11-27 22:50:07 +00:00
Chris Lattner
73b425ba51 Rework InsertPHITranslatedPointer to handle the recursive case, this
fixes PR5630 and sets the stage for the next phase of goodness (testcase
pending).

llvm-svn: 90019
2009-11-27 22:05:15 +00:00
Chris Lattner
a466dbe80a teach GVN's load PRE to insert computations of the address in predecessors
where it is not available.  It's unclear how to get this inserted 
computation into GVN's scalar availability sets, Owen, help? :)

llvm-svn: 89997
2009-11-27 08:25:10 +00:00
Chris Lattner
0971e6da1f Fix phi translation in load PRE to agree with the phi
translation done by memdep, and reenable gep translation 
again.

llvm-svn: 89992
2009-11-27 06:31:14 +00:00
Dan Gohman
406baaac43 Add an option for running GVN with redundant load processing disabled.
llvm-svn: 88742
2009-11-14 02:27:51 +00:00
Jeffrey Yasskin
23ac706aab Fix DenseMap iterator constness.
This patch forbids implicit conversion of DenseMap::const_iterator to
DenseMap::iterator which was possible because DenseMapIterator inherited
(publicly) from DenseMapConstIterator. Conversion the other way around is now
allowed as one may expect.

The template DenseMapConstIterator is removed and the template parameter
IsConst which specifies whether the iterator is constant is added to
DenseMapIterator.

Actually IsConst parameter is not necessary since the constness can be
determined from KeyT but this is not relevant to the fix and can be addressed
later.

Patch by Victor Zverovich!

llvm-svn: 86636
2009-11-10 01:02:17 +00:00
Chris Lattner
1f101c7a1a Make sure PRE doesn't split crit edges from indirectbr.
llvm-svn: 85692
2009-10-31 22:11:15 +00:00
Evan Cheng
8db8f72185 Add option to createGVNPass to disable PRE.
llvm-svn: 85609
2009-10-30 20:12:24 +00:00
Owen Anderson
cfb2c9edeb Treat lifetime begin/end markers as allocations/frees respectively for the
purposes for GVN/DSE.

llvm-svn: 85383
2009-10-28 07:05:35 +00:00
Victor Hernandez
0f662a7acf Rename MallocFreeHelper as MemoryBuiltins
llvm-svn: 85286
2009-10-27 20:05:49 +00:00
Victor Hernandez
6c86b93663 Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()
llvm-svn: 85181
2009-10-26 23:58:56 +00:00
Victor Hernandez
8428eb5720 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Chris Lattner
82599d2b0e make GVN work better when TD is not around:
"In the existing code, if the load and the value to replace it with are
of different types *and* target data is available, it tries to use the
target data to coerce the replacement value to the type of the load.
Otherwise, it skips all effort to handle the type mismatch and just
feeds the wrongly-typed replacement value to replaceAllUsesWith, which
triggers an assertion.

The patch replaces it with an outer if checking for type mismatch, and
an inner if-else that checks whether target data is available and, if
not, returns false rather than trying to replace the load."

Patch by Kenneth Uildriks!

llvm-svn: 84739
2009-10-21 04:11:19 +00:00
Owen Anderson
06714a71a9 Refactor lookup_or_add to contain _MUCH_ less duplicated code. Add support for
numbering first class aggregate instructions while we're at it.

llvm-svn: 84547
2009-10-19 22:14:22 +00:00
Owen Anderson
4954f8ef02 Simplify some code.
llvm-svn: 84533
2009-10-19 21:14:57 +00:00
Devang Patel
89ef6dcb54 Use isVoidTy()
llvm-svn: 84118
2009-10-14 17:29:00 +00:00
Chris Lattner
37ff3c0ed1 switch GVN to use SSAUpdater. Besides removing a lot of complexity
from GVN, this also speeds it up, inserts fewer PHI nodes (see the
testcase) and allows it to remove more loads (due to fewer PHI nodes
standing in the way).

llvm-svn: 83746
2009-10-10 23:50:30 +00:00
Chris Lattner
31d3137c01 remove dead code
llvm-svn: 83742
2009-10-10 23:04:12 +00:00
Chris Lattner
317eb8ff20 random tidying
llvm-svn: 83701
2009-10-10 06:22:45 +00:00
Chris Lattner
2a85cfd972 simplify some code.
llvm-svn: 82936
2009-09-27 21:46:50 +00:00
Nick Lewycky
d21c325f09 Instruction::clone does not need to take an LLVMContext&. Remove that and
update all the callers.

llvm-svn: 82889
2009-09-27 07:38:41 +00:00
Chris Lattner
1d9ca20bf5 big endian systems shift by bits too, hopefully this will fix the ppc
bootstrap problems.

llvm-svn: 82464
2009-09-21 17:55:47 +00:00
Chris Lattner
b1c7502032 fix PR5016, a crash I introduced in GVN handing first class
arrays and structs, which cannot be bitcast to integers.

llvm-svn: 82460
2009-09-21 17:24:04 +00:00
Chris Lattner
45b58ae047 enable non-local analysis and PRE of large store -> little load.
This doesn't kick in too much because of phi translation issues,
but this can be resolved in the future.

llvm-svn: 82447
2009-09-21 06:48:08 +00:00
Chris Lattner
8debc9ab3e convert an std::pair to an explicit struct.
llvm-svn: 82446
2009-09-21 06:30:24 +00:00
Chris Lattner
71d74ff16b move some functions, add a comment.
llvm-svn: 82444
2009-09-21 06:24:16 +00:00
Chris Lattner
da0499f01e split HandleLoadFromClobberingStore in two pieces: one that does the
analysis, one that does the xform.

llvm-svn: 82443
2009-09-21 06:22:46 +00:00
Chris Lattner
97e1feed14 Improve GVN to be able to forward substitute a small load
from a piece of a large store when both are in the same block.

This allows clang to compile the testcase in PR4216 to this code:

_test_bitfield:
	movl	4(%esp), %eax
	movl	%eax, %ecx
	andl	$-65536, %ecx
	orl	$32962, %eax
	andl	$40186, %eax
	orl	%ecx, %eax
	ret

This is not ideal, but is a whole lot better than the code produced
by llvm-gcc:

_test_bitfield:
	movw	$-32574, %ax
	orw	4(%esp), %ax
	andw	$-25350, %ax
	movw	%ax, 4(%esp)
	movw	7(%esp), %cx
	shlw	$8, %cx
	movzbl	6(%esp), %edx
	orw	%cx, %dx
	movzwl	%dx, %ecx
	shll	$16, %ecx
	movzwl	%ax, %eax
	orl	%ecx, %eax
	ret

and dramatically better than that produced by gcc 4.2:

_test_bitfield:
	pushl	%ebx
	call	L3
"L00000000001$pb":
L3:
	popl	%ebx
	movl	8(%esp), %eax
	leal	0(,%eax,4), %edx
	sarb	$7, %dl
	movl	%eax, %ecx
	andl	$7168, %ecx
	andl	$-7201, %ebx
	movzbl	%dl, %edx
	andl	$1, %edx
	sall	$5, %edx
	orl	%ecx, %ebx
	orl	%edx, %ebx
	andl	$24, %eax
	andl	$-58336, %ebx
	orl	%eax, %ebx
	orl	$32962, %ebx
	movl	%ebx, %eax
	popl	%ebx
	ret

llvm-svn: 82439
2009-09-21 05:57:11 +00:00
Chris Lattner
50c869bb19 formatting cleanups, no functionality change.
llvm-svn: 82426
2009-09-21 02:42:51 +00:00
Chris Lattner
b7d34131d1 Move CoerceAvailableValueToLoadType earlier in GVN.cpp. Hook it up
so that nonlocal and partially redundant loads can use it as well.
The testcase shows examples of craziness this can handle.  This triggers
*many* times in 176.gcc.

llvm-svn: 82403
2009-09-20 20:09:34 +00:00
Chris Lattner
279ec561c6 change the interface to CoerceAvailableValueToLoadType to be
more generic.

llvm-svn: 82402
2009-09-20 19:31:14 +00:00
Chris Lattner
6bae20046f enhance GVN to forward substitute a stored value to a load
(and load -> load) when the base pointers must alias but when
they are different types.  This occurs very very frequently in
176.gcc and other code that uses bitfields a lot.

llvm-svn: 82399
2009-09-20 19:03:47 +00:00
Daniel Dunbar
378331a13d Tabs -> spaces, and remove trailing whitespace.
llvm-svn: 82355
2009-09-20 02:20:51 +00:00
Victor Hernandez
fe5347d782 Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.
Reviewed by Dan Gohman.

llvm-svn: 82300
2009-09-18 22:35:49 +00:00
Dan Gohman
66c853f17f Change PHINode::hasConstantValue to have a DominatorTree argument
instead of a bool argument, and to do the dominator check itself.
This makes it eaiser to use when DominatorTree information is
available.

llvm-svn: 80920
2009-09-03 15:34:35 +00:00
Chris Lattner
5f54c5bd1c eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861
llvm-svn: 80766
2009-09-02 06:11:42 +00:00
Owen Anderson
2ed352c8b6 Make this into a static method.
llvm-svn: 80170
2009-08-26 22:55:11 +00:00
Owen Anderson
9df206d02d Push LLVMContexts through the IntegerType APIs.
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Dan Gohman
0831bdef1d Fix GVN's debug output, now that operator<< on Value* doesn't print
a trailing newline.

llvm-svn: 77719
2009-07-31 20:24:18 +00:00
Owen Anderson
d0e6352c97 Move getTrue() and getFalse() to 2.5-like APIs.
llvm-svn: 77685
2009-07-31 17:39:07 +00:00
Owen Anderson
93ccaf5c60 Move more code back to 2.5 APIs.
llvm-svn: 77635
2009-07-30 23:03:37 +00:00
Dan Gohman
9a7deba67e Convert a few more things to use raw_ostream.
llvm-svn: 77039
2009-07-25 01:43:01 +00:00
Daniel Dunbar
8496064116 More migration to raw_ostream, the water has dried up around the iostream hole.
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
   "magic" DOUT behavior which avoided calling printing functions when the
   statement was disabled. In addition to being unnecessary magic, it had the
   downside of leaving code in -Asserts builds, and of hiding potentially
   unnecessary computations.

llvm-svn: 77019
2009-07-25 00:23:56 +00:00
Owen Anderson
cc287b28c9 Get rid of the Pass+Context magic.
llvm-svn: 76702
2009-07-22 00:24:57 +00:00
Owen Anderson
7f61f8dc30 Rename getConstantInt{True|False} to get{True|False} at Chris' behest.
llvm-svn: 76598
2009-07-21 18:03:38 +00:00
Torok Edwin
f955a6ef49 llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").

llvm-svn: 75640
2009-07-14 16:55:14 +00:00
Torok Edwin
ae8a3ff177 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.

llvm-svn: 75379
2009-07-11 20:10:48 +00:00
Owen Anderson
49226b1075 This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?
llvm-svn: 75200
2009-07-09 23:48:35 +00:00
Nick Lewycky
d46a7b2d22 Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.

llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Owen Anderson
7fb95ff5dd Convert the first batch of passes to use LLVMContext.
llvm-svn: 74748
2009-07-03 00:17:18 +00:00
Dale Johannesen
26f0dd9021 This fixes a bug introduced in 72661, which can
move loads back past a check that the load address
is valid, see new testcase.  The test that went
in with 72661 has exactly this case, except that
the conditional it's moving past is checking
something else; I've settled for changing that
test to reference a global, not a pointer.  It
may be possible to scan all the tests you pass and
make sure none of them are checking any component
of the address, but it's not trivial and I'm not
trying to do that here.

llvm-svn: 73632
2009-06-17 20:48:23 +00:00
Torok Edwin
09a9b85420 Add debug message about non-local loads being clobbered.
llvm-svn: 73625
2009-06-17 18:48:18 +00:00
Dan Gohman
59c4088e16 Make the EnableLoadPRE variable static.
llvm-svn: 73398
2009-06-15 18:30:15 +00:00
Dan Gohman
5f6f8101d5 Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt

llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Owen Anderson
928040c625 Be more aggressive in doing LoadPRE by tracing backwards when a block only has
a single predecessor.

Patch by Jakub Staszak.

llvm-svn: 72661
2009-05-31 09:03:40 +00:00
Bill Wendling
f26f8a579e Enable GVN Load PRE.
llvm-svn: 72589
2009-05-29 20:38:16 +00:00
Torok Edwin
845fc92978 just show the instruction, its not that slow.
llvm-svn: 72577
2009-05-29 16:58:36 +00:00
Torok Edwin
a4ebdef3e8 for instructions with void type we have no choice but print the instruction as
is, otherwise we get a <badref>.

llvm-svn: 72567
2009-05-29 10:28:44 +00:00
Torok Edwin
4a228edc3a Add a DEBUG() output to GVN that prints the instruction clobbering a load.
This is useful when trying to figure out why GVN didn't eliminate redundant
loads.

llvm-svn: 72565
2009-05-29 09:46:03 +00:00
Owen Anderson
09c469ec35 Fix an issue where phiMap was not being updated properly when doing load PRE.
Diagnosis and patch thanks to Jakub Staszak.

llvm-svn: 72562
2009-05-29 05:37:54 +00:00
Duncan Sands
880eaf5278 Allow readonly functions to unwind exceptions. Teach
the optimizers about this.  For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.

llvm-svn: 71071
2009-05-06 06:49:50 +00:00
Owen Anderson
851ce6d1d5 Reapply r68211, with the miscompilations it caused fixed.
llvm-svn: 68262
2009-04-01 23:53:49 +00:00
Dan Gohman
a134448980 Revert r68172. It caused regressions in
Applications/Burg/burg
  Applications/ClamAV/clamscan
and many other tests.

llvm-svn: 68211
2009-04-01 16:37:47 +00:00
Owen Anderson
d7c837bb4b Enhance GVN to propagate simple conditionals. This fixes PR3921.
llvm-svn: 68172
2009-04-01 01:20:45 +00:00
John Criswell
d1fd7b1f72 Do not attempt to do parial redundancy elimination on void values.
Also fixed a punctuation error in the header comment.
This fixes PR3775.

llvm-svn: 66542
2009-03-10 15:04:53 +00:00
Devang Patel
9abfbc2e14 Skip DbgInfoIntrinsic.
llvm-svn: 66244
2009-03-06 02:59:27 +00:00
Chris Lattner
d093b49b81 improve naming of values in GVN, patch by Jay Foad!
llvm-svn: 64363
2009-02-12 07:00:35 +00:00
Bill Wendling
22173be9c5 Mistakenly turned this on.
llvm-svn: 64065
2009-02-08 01:32:00 +00:00
Bill Wendling
4ed0306d6f Revert r63999. It was breaking self-hosting builds.
llvm-svn: 64062
2009-02-08 00:58:05 +00:00
Chris Lattner
45a7b5ce57 improve compatibility with cygwin, patch by Jay Foad!
llvm-svn: 62535
2009-01-19 22:00:18 +00:00
Owen Anderson
450f83fd54 Don't forget to remove phi nodes from the value numbering table after we collapse them.
llvm-svn: 61358
2008-12-23 00:49:51 +00:00
Bill Wendling
7c1a7f0c03 Comment clean-ups. No functionality change.
llvm-svn: 61354
2008-12-22 22:32:22 +00:00
Bill Wendling
ec7ce2e7f3 Check that the instruction isn't in the value numbering scope.
llvm-svn: 61353
2008-12-22 22:28:56 +00:00
Bill Wendling
a1d8e29851 Simplification: Negate the operator== method instead of implementing a full operator!= method.
llvm-svn: 61352
2008-12-22 22:16:31 +00:00
Bill Wendling
e42e5a263b Add verification that deleted instruction isn't hiding in the PHI map.
llvm-svn: 61350
2008-12-22 22:14:07 +00:00
Bill Wendling
ac1c0d7f13 Verify removed in a few more places.
llvm-svn: 61349
2008-12-22 21:57:30 +00:00
Bill Wendling
b8ecde3d78 Add verification functions to GVN which check to see that an instruction was
truely deleted. These will be expanded with further checks of all of the data
structures.

llvm-svn: 61347
2008-12-22 21:36:08 +00:00
Bill Wendling
4ca9e94f91 Didn't mean to commit this.
llvm-svn: 61222
2008-12-18 22:19:50 +00:00
Bill Wendling
5ec9cb2217 Re-XFAIL this test until debug stuff settles down.
llvm-svn: 61219
2008-12-18 22:13:31 +00:00
Chris Lattner
d159077cb9 reapply this hunk from Bill's reversion in r61169, it is conservative
and safe and orthogonal from turning off load pre.

llvm-svn: 61177
2008-12-18 00:51:32 +00:00
Bill Wendling
3eb7c0254b Temporarily revert r61027. It was causing a bootstrap failure in "release" mode
with everyone's favorite error messages:

Comparing stages 2 and 3
warning: ./cc1-checksum.o differs
warning: ./cc1plus-checksum.o differs
Bootstrap comparison failure!
./c-decl.o differs
./cp/decl.o differs
./df-core.o differs
./gcc.o differs
./i386.o differs
./stor-layout.o differs
./tree-pretty-print.o differs
./tree.o differs
make[2]: *** [compare] Error 1
make[1]: *** [stage3-bubble] Error 2

See PR3227.

llvm-svn: 61169
2008-12-17 23:31:20 +00:00
Chris Lattner
b467a5b4a5 Enable Load PRE. This teaches GVN to push partially redundant loads up the
CFG when there is exactly one predecessor where the load is not available.
This is designed to not increase code size but still eliminate partially
redundant loads.  This fires 1765 times on 403.gcc even though it doesn't
do critical edge splitting yet (the most common reason for it to fail).

llvm-svn: 61027
2008-12-15 05:28:29 +00:00
Owen Anderson
90af4c9640 Ifdef out some code that I didn't mean to enable by default yet.
llvm-svn: 61024
2008-12-15 03:52:17 +00:00
Chris Lattner
22cfa14eed make GVN try to rename inputs to the resultant replaced values, which
cleans up the generated code a bit.  This should have the added benefit of
not randomly renaming functions/globals like my previous patch did. :)

llvm-svn: 61023
2008-12-15 03:46:38 +00:00
Owen Anderson
c2d2c0bdf3 Add support for slow-path GVN with full phi construction for scalars. This is disabled for now, as it actually pessimizes code in the abscence
of phi translation for load elimination.  This slow down GVN a bit, by about 2% on 403.gcc.

llvm-svn: 61021
2008-12-15 02:03:00 +00:00
Owen Anderson
47efff5b14 Generalize GVN's phi construciton routine to work for things other than loads.
llvm-svn: 61009
2008-12-14 19:10:35 +00:00
Bill Wendling
34182ae3ae Temporarily revert r60973. It's inexplicably causing a failure when self-hosting LLVM:
llvm[2]: Linking Release executable opt (without symbols)
...
Undefined symbols:
  "llvm::APFloat::IEEEsingle", referenced from:
      __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(Constants.o)
      __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(AsmWriter.o)
      __ZN4llvm7APFloat10IEEEsingleE$non_lazy_ptr in libLLVMCore.a(ConstantFold.o)
  "llvm::APFloat::IEEEdouble", referenced from:
      __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(Constants.o)
      __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(AsmWriter.o)
      __ZN4llvm7APFloat10IEEEdoubleE$non_lazy_ptr in libLLVMCore.a(ConstantFold.o)
ld: symbol(s) not found

This is in release mode. To replicate, compile llvm and llvm-gcc in optimized
mode. Then build llvm, in optimized mode, with the newly created compiler.

llvm-svn: 60977
2008-12-13 09:28:44 +00:00
Chris Lattner
8753175cd6 make RLE preserve the name of the load that it replaces. This is just
a pretification of the IR.

llvm-svn: 60973
2008-12-13 07:22:47 +00:00
Chris Lattner
23369496bc Teach GVN to invalidate some memdep information when it does an RAUW
of a pointer.  This allows is to catch more equivalencies.  For example,
the type_lists_compatible_p function used to require two iterations of
the gvn pass (!) to delete its 18 redundant loads because the first pass
would CSE all the addressing computation cruft, which would unblock the
second memdep/gvn passes from recognizing them.  This change allows
memdep/gvn to catch all 18 when run just once on the function (as is 
typical :) instead of just 3.

On all of 403.gcc, this bumps up the # reundandancies found from:

     63 gvn    - Number of instructions PRE'd
 153991 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted
to:
     63 gvn    - Number of instructions PRE'd
 154137 gvn    - Number of instructions deleted
  50185 gvn    - Number of loads deleted

+120 loads deleted isn't bad.

llvm-svn: 60799
2008-12-09 22:06:23 +00:00
Chris Lattner
0dbe02a270 rename getNonLocalDependency -> getNonLocalCallDependency, and remove
pointer stuff from it, simplifying the code a bit.

llvm-svn: 60783
2008-12-09 19:38:05 +00:00
Chris Lattner
3768aeb290 Switch GVN::processNonLocalLoad to using the new
MemDep::getNonLocalPointerDependency method.  There are
some open issues with this (missed optimizations) and
plenty of future work, but this does allow GVN to eliminate
*slightly* more loads (49246 vs 49033).

Switching over now allows simplification of the other code
path in memdep.

llvm-svn: 60780
2008-12-09 19:25:07 +00:00
Chris Lattner
b0aa96c25d random cleanups, no functionality change.
llvm-svn: 60779
2008-12-09 19:21:47 +00:00
Chris Lattner
2b5e1b5263 Make a few major changes to memdep and its clients:
1. Merge the 'None' result into 'Normal', making loads
   and stores return their dependencies on allocations as Normal.
2. Split the 'Normal' result into 'Clobber' and 'Def' to
   distinguish between the cases when memdep knows the value is
   produced from when we just know if may be changed.
3. Move some of the logic for determining whether readonly calls
   are CSEs into memdep instead of it being in GVN.  This still
   leaves verification that the arguments are hte same to GVN to
   let it know about value equivalences in different contexts.
4. Change memdep's call/call dependency analysis to use 
   getModRefInfo(CallSite,CallSite) instead of doing something 
   very weak.  This only really matters for things like DSA, but
   someday maybe we'll have some other decent context sensitive
   analyses :)
5. This reimplements the guts of memdep to handle the new results.
6. This simplifies GVN significantly:
   a) readonly call CSE is slightly simpler
   b) I eliminated the "getDependencyFrom" chaining for load 
      elimination and load CSE doesn't have to worry about 
      volatile (they are always clobbers) anymore.
   c) GVN no longer does any 'lastLoad' caching, leaving it to 
      memdep.
7. The logic in DSE is simplified a bit and sped up.  A potentially
   unsafe case was eliminated.

llvm-svn: 60607
2008-12-05 21:04:20 +00:00
Anton Korobeynikov
30085a6f51 Revert invalid r60393. It causes llvm-gcc bootstrap fails in release builds.
See PR3160 for details

llvm-svn: 60604
2008-12-05 19:38:49 +00:00
Chris Lattner
211146e709 Fix test/Transforms/GVN/pre-load.ll
llvm-svn: 60594
2008-12-05 17:04:12 +00:00
Chris Lattner
35547ba5ca Make IsValueFullyAvailableInBlock safe.
llvm-svn: 60588
2008-12-05 07:49:08 +00:00
Chris Lattner
2a9747548e Implement PRE of loads in the GVN pass with a pretty cheap and
straight-forward implementation.  This does not require any extra
alias analysis queries beyond what we already do for non-local loads.

Some programs really really like load PRE.  For example, SPASS triggers
this ~1000 times, ~300 times in 255.vortex, and ~1500 times on 403.gcc.

The biggest limitation to the implementation is that it does not split
critical edges.  This is a huge killer on many programs and should be
addressed after the initial patch is enabled by default.

The implementation of this should incidentally speed up rejection of 
non-local loads because it avoids creating the repl densemap in cases 
when it won't be used for fully redundant loads.

This is currently disabled by default.
Before I turn this on, I need to fix a couple of miscompilations in
the testsuite, look at compile time performance numbers, and look at
perf impact.  This is pretty close to ready though.

llvm-svn: 60408
2008-12-02 08:16:11 +00:00
Owen Anderson
92e405b332 Fix an issue that Chris noticed, where local PRE was not properly instantiating
a new value numbering set after splitting a critical edge.  This increases
the number of instances of PRE on 403.gcc from ~60 to ~570.

llvm-svn: 60393
2008-12-02 04:09:22 +00:00
Chris Lattner
3b908483b7 Rename some variables, only increment BI once at the start of the loop instead of throughout it.
llvm-svn: 60339
2008-12-01 07:35:54 +00:00
Chris Lattner
c6e6eaf6d3 pull the predMap densemap out of the inner loop of performPRE, so
that it isn't reallocated all the time.  This is a tiny speedup for
GVN: 3.90->3.88s

llvm-svn: 60338
2008-12-01 07:29:03 +00:00
Chris Lattner
c1adf6fc51 Make GVN be more intelligent about redundant load
elimination: when finding dependent load/stores, realize that
they are the same if aliasing claims must alias instead of relying
on the pointers to be exactly equal.  This makes load elimination
more aggressive.  For example, on 403.gcc, we had:

<     68 gvn    - Number of instructions PRE'd
< 152718 gvn    - Number of instructions deleted
<  49699 gvn    - Number of loads deleted
<   6153 memdep - Number of dirty cached non-local responses
< 169336 memdep - Number of fully cached non-local responses
< 162428 memdep - Number of uncached non-local responses

now we have:

>     64 gvn    - Number of instructions PRE'd
> 153623 gvn    - Number of instructions deleted
>  49856 gvn    - Number of loads deleted
>   5022 memdep - Number of dirty cached non-local responses
> 159030 memdep - Number of fully cached non-local responses
> 162443 memdep - Number of uncached non-local responses

That's an extra 157 loads deleted and extra 905 other instructions nuked.

This slows down GVN very slightly, from 3.91 to 3.96s.

llvm-svn: 60314
2008-12-01 01:31:36 +00:00
Chris Lattner
bd1bc4a75e Reimplement the non-local dependency data structure in terms of a sorted
vector instead of a densemap.  This shrinks the memory usage of this thing
substantially (the high water mark) as well as making operations like
scanning it faster.  This speeds up memdep slightly, gvn goes from
3.9376 to 3.9118s on 403.gcc

This also splits out the statistics for the cached non-local case to
differentiate between the dirty and clean cached case.  Here's the stats
for 403.gcc:

  6153 memdep - Number of dirty cached non-local responses
169336 memdep - Number of fully cached non-local responses
162428 memdep - Number of uncached non-local responses

yay for caching :)

llvm-svn: 60313
2008-12-01 01:15:42 +00:00
Chris Lattner
1f8482ffc8 Cache analyses in ivars and add some useful DEBUG output.
This speeds up GVN from 4.0386s to 3.9376s.

llvm-svn: 60310
2008-12-01 00:40:32 +00:00
Chris Lattner
77908d9ccf improve indentation, do cheap checks before expensive ones,
remove some fixme's.  This speeds up GVN very slightly on 403.gcc 
(4.06->4.03s)

llvm-svn: 60309
2008-11-30 23:39:23 +00:00
Chris Lattner
2f7da36732 Fix a fixme by making memdep's handling of allocations more logical.
If we see that a load depends on the allocation of its memory with no
intervening stores, we now return a 'None' depedency instead of "Normal".
This tweaks GVN to do its optimization with the new result.

llvm-svn: 60267
2008-11-30 01:39:32 +00:00
Chris Lattner
3e86ec7289 Change MemDep::getNonLocalDependency to return its results as
a smallvector instead of a DenseMap.  This speeds up GVN by 5%
on 403.gcc.

llvm-svn: 60255
2008-11-29 21:33:22 +00:00
Chris Lattner
ffc1af1619 reimplement getNonLocalDependency with a simpler worklist
formulation that is faster and doesn't require nonLazyHelper.
Much less code.

llvm-svn: 60253
2008-11-29 21:22:42 +00:00
Chris Lattner
96c72eef4b Split getDependency into getDependency and getDependencyFrom, the
former does caching, the later doesn't.  This dramatically simplifies
the logic in getDependency and getDependencyFrom.

llvm-svn: 60234
2008-11-29 03:47:00 +00:00
Chris Lattner
6bf62f050c Introduce and use a new MemDepResult class to hold the results of a memdep
query.  This makes it crystal clear what cases can escape from MemDep that
the clients have to handle.  This also gives the clients a nice simplified
interface to it that is easy to poke at.

This patch also makes DepResultTy and MemoryDependenceAnalysis::DepType
private, yay.

llvm-svn: 60231
2008-11-29 02:29:27 +00:00
Chris Lattner
e9295510b5 Reimplement the internal abstraction used by MemDep in terms
of a pointer/int pair instead of a manually bitmangled pointer.
This forces clients to think a little more about checking the 
appropriate pieces and will be useful for internal 
implementation improvements later.

I'm not particularly happy with this.  After going through this
I don't think that the clients of memdep should be exposed to
the internal type at all.  I'll fix this in a subsequent commit.

This has no functionality change.

llvm-svn: 60230
2008-11-29 01:43:36 +00:00
Nuno Lopes
cc4f37aa68 fix memleak by cleaning the global sets on pass exit
llvm-svn: 57353
2008-10-10 16:25:50 +00:00
Duncan Sands
8f296a3788 Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.

llvm-svn: 57291
2008-10-08 07:23:46 +00:00
Duncan Sands
88d8323743 Factorize code: remove variants of "strip off
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject.  The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.

llvm-svn: 56922
2008-10-01 15:25:41 +00:00
Dan Gohman
e1f9be27bc Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Owen Anderson
94bd638e81 Fix a bug that prevented PRE from applying in some cases.
llvm-svn: 55744
2008-09-03 23:06:07 +00:00
Owen Anderson
14510f8fee Put a heuristic in place to prevent GVN from falling into bad cases with massively complicated CFGs.
This speeds up a particular testcase from 12+ hours to 5 seconds with little perceptible loss of quality.

llvm-svn: 55391
2008-08-26 22:07:42 +00:00
Chris Lattner
fd64cbf22d consolidate DenseMapInfo implementations, and add one for std::pair.
Patch contributed by m-s.

llvm-svn: 55167
2008-08-22 05:08:25 +00:00
Duncan Sands
b4646d7dbe Supress a gcc-4.3 warning.
llvm-svn: 53771
2008-07-18 21:06:02 +00:00
Owen Anderson
8500aba55a Make PRE actually handle critical edges (by splitting them). Confirmed that bootstrap passes with this change.
llvm-svn: 53762
2008-07-18 18:03:38 +00:00
Owen Anderson
5524271234 Enable PRE. My last batch of changes fixed the miscompile.
llvm-svn: 53730
2008-07-17 19:41:00 +00:00
Owen Anderson
7fb36c8bba Factor MergeBlockIntoPredecessor out into BasicBlockUtils.
llvm-svn: 53705
2008-07-17 00:01:40 +00:00
Owen Anderson
f91aa3b22f There's no need to iterate block merging and PRE. In fact, iterating the latter
could cause problems for memdep when it breaks critical edges.

llvm-svn: 53691
2008-07-16 17:52:31 +00:00
Owen Anderson
e12f7904ff Revert this, as it seems to still be broken.
llvm-svn: 53627
2008-07-15 17:59:02 +00:00
Owen Anderson
73bdb28e89 Enable local PRE by default.
llvm-svn: 53616
2008-07-15 16:28:23 +00:00
Owen Anderson
f1b3898e7f Have GVN do a pre-pass over the CFG that folds away unconditional branches where possible. This allows local PRE to be more aggressive.
llvm-svn: 53615
2008-07-15 16:28:06 +00:00
Owen Anderson
cc861329ee Don't call lookupNumber more than we have to.
llvm-svn: 53470
2008-07-11 20:05:13 +00:00
Owen Anderson
035bf4d2ca Use information already present in the ValueTable to fast-fail when we know there won't be a value number match. This speeds up GVN on a case where there are very few redundancies by ~25%.
llvm-svn: 53108
2008-07-03 17:44:33 +00:00
Owen Anderson
0b0017e514 Avoid a redundant call.
llvm-svn: 53040
2008-07-02 18:15:31 +00:00
Owen Anderson
5747d627e0 A better fix for PR2503 that doesn't pessimize GVN in the presence of unreachable blocks.
llvm-svn: 53032
2008-07-02 17:20:16 +00:00
Evan Cheng
174f11c202 Disable PRE. It's breaking bootstrapping.
llvm-svn: 52643
2008-06-23 21:22:35 +00:00
Owen Anderson
0dcae02ad4 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
Evan Cheng
2ff47edc37 Enable PRE.
llvm-svn: 52574
2008-06-21 07:26:53 +00:00
Owen Anderson
5213d215e0 Really disable PRE.
llvm-svn: 52531
2008-06-20 08:59:13 +00:00
Owen Anderson
3231e506cb 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
Evan Cheng
d4c055e1f8 Disable PRE for now. It seems to be breaking llvm-gcc bootstrapping.
llvm-svn: 52518
2008-06-20 01:01:07 +00:00
Owen Anderson
c979fcf8ff Add a hidden -disable-pre flag for testing purposes. This should be removed
once benchmarking is completed.

llvm-svn: 52506
2008-06-19 19:57:25 +00:00
Owen Anderson
35fb8dbfef PRE requires that critical edges be split.
llvm-svn: 52505
2008-06-19 19:54:19 +00:00
Owen Anderson
87d761460e Be sure to remove values from the value numbering table after we delete them.
This fixes a failure on povray.

llvm-svn: 52499
2008-06-19 17:53:26 +00:00
Owen Anderson
aa850d32db Revert support for insertvalue and extractvalue instructions for the moment.
GVN expects that all inputs which to an instruction fall somewhere in the value
hierarchy, which isn't true for these.

llvm-svn: 52496
2008-06-19 17:25:39 +00:00