- Nov 30, 2010
-
-
Chris Lattner authored
llvm-svn: 120347
-
- Nov 29, 2010
-
-
Chris Lattner authored
llvm-svn: 120325
-
Frits van Bommel authored
Transform (extractvalue (load P), ...) to (load (gep P, 0, ...)) if the load has no other uses, shrinking the load. llvm-svn: 120323
-
- Nov 27, 2010
-
-
Owen Anderson authored
by my recent GVN improvement. Looking through a single layer of PHI nodes when attempting to sink GEPs, we need to iteratively look through arbitrary PHI nests. llvm-svn: 120202
-
- Nov 24, 2010
-
-
Nick Lewycky authored
whether the pointer can be replaced with the global variable it is a copy of. Fixes PR8680. llvm-svn: 120126
-
- Nov 23, 2010
-
-
Duncan Sands authored
llvm-svn: 120051
-
Benjamin Kramer authored
E.g. -5 % 5 is 0 with srem and 1 with urem. Also addresses Frits van Bommel's comments. llvm-svn: 120049
-
Duncan Sands authored
in two places that are really interested in simplified instructions, not constants. llvm-svn: 120044
-
Duncan Sands authored
(which does constant folding and more) is called a few lines later. llvm-svn: 120042
-
Benjamin Kramer authored
This allows to transform the rem in "1 << ((int)x % 8);" to an and. llvm-svn: 120028
-
Duncan Sands authored
Stylistic improvement suggested by Frits van Bommel. llvm-svn: 120026
-
Duncan Sands authored
llvm-svn: 120025
-
Duncan Sands authored
fairly systematic way in instcombine. Some of these cases were already dealt with, in which case I removed the existing code. The case of Add has a bunch of funky logic which covers some of this plus a few variants (considers shifts to be a form of multiplication), which I didn't touch. The simplification performed is: A*B+A*C -> A*(B+C). The improvement is to do this in cases that were not already handled [such as A*B-A*C -> A*(B-C), which was reported on the mailing list], and also to do it more often by not checking for "only one use" if "B+C" simplifies. llvm-svn: 120024
-
Chris Lattner authored
on this instcombine xform. This fixes a miscompilation of 403.gcc. llvm-svn: 119988
-
- Nov 22, 2010
-
-
Benjamin Kramer authored
llvm-svn: 119984
-
Duncan Sands authored
then replace the index with zero. llvm-svn: 119974
-
Duncan Sands authored
InstructionSimplify. llvm-svn: 119970
-
Duncan Sands authored
is never used. Patch by Cameron Zwarich. llvm-svn: 119963
-
- Nov 21, 2010
-
-
Chris Lattner authored
llvm-svn: 119948
-
Chris Lattner authored
method in MemDep instead of inserting an instruction, doing a query, then removing it. Neither operation is effectively cached. llvm-svn: 119930
-
Chris Lattner authored
llvm-svn: 119927
-
Chris Lattner authored
void a(int x) { if (((1<<x)&8)==0) b(); } into "x != 3", which occurs over 100 times in 403.gcc but in no other program in llvm-test. llvm-svn: 119922
-
Chris Lattner authored
allowing the memcpy to be eliminated. Unfortunately, the requirements on byval's without explicit alignment are really weak and impossible to predict in the mid-level optimizer, so this doesn't kick in much with current frontends. The fix is to change clang to set alignment on all byval arguments. llvm-svn: 119916
-
- Nov 20, 2010
-
-
Benjamin Kramer authored
llvm-svn: 119908
-
- Nov 19, 2010
-
-
Owen Anderson authored
llvm-svn: 119865
-
Owen Anderson authored
if all the operands of the PHI are equivalent. This allows CodeGenPrepare to undo unprofitable PRE transforms. llvm-svn: 119853
-
- Nov 18, 2010
-
-
Duncan Sands authored
preserves LCSSA form out of ScalarEvolution and into the LoopInfo class. Use it to check that SimplifyInstruction simplifications are not breaking LCSSA form. Fixes PR8622. llvm-svn: 119727
-
Owen Anderson authored
Completely rework the datastructure GVN uses to represent the value number to leader mapping. Previously, this was a tree of hashtables, and a query recursed into the table for the immediate dominator ad infinitum if the initial lookup failed. This led to really bad performance on tall, narrow CFGs. We can instead replace it with what is conceptually a multimap of value numbers to leaders (actually represented by a hashtable with a list of Value*'s as the value type), and then determine which leader from that set to use very cheaply thanks to the DFS numberings maintained by DominatorTree. Because there are typically few duplicates of a given value, this scan tends to be quite fast. Additionally, we use a custom linked list and BumpPtr allocation to avoid any unnecessary allocation in representing the value-side of the multimap. This change brings with it a 15% (!) improvement in the total running time of GVN on 403.gcc, which I think is pretty good considering that includes all the "real work" being done by MemDep as well. The one downside to this approach is that we can no longer use GVN to perform simple conditional progation, but that seems like an acceptable loss since we now have LVI and CorrelatedValuePropagation to pick up the slack. If you see conditional propagation that's not happening, please file bugs against LVI or CVP. llvm-svn: 119714
-
Chris Lattner authored
saying "it would be bad", give an example of what is going on. llvm-svn: 119695
-
Chris Lattner authored
refusing to optimize two memcpy's like this: copy A <- B copy C <- A if it couldn't prove that noalias(B,C). We can eliminate the copy by producing a memmove instead of memcpy. llvm-svn: 119694
-
Chris Lattner authored
source and dest are known to not overlap. llvm-svn: 119692
-
Chris Lattner authored
there is no need to check to see if the source and dest of a memcpy are noalias, behavior is undefined if not. llvm-svn: 119691
-
Chris Lattner authored
llvm-svn: 119690
-
Chris Lattner authored
out of processMemCpy into its own function. llvm-svn: 119687
-
Chris Lattner authored
if it is passed as a byval argument. The byval argument will just be a read, so it is safe to read from the original global instead. This allows us to promote away the %agg.tmp alloca in PR8582 llvm-svn: 119686
-
Chris Lattner authored
to ignore calls that obviously can't modify the alloca because they are readonly/readnone. llvm-svn: 119683
-
Chris Lattner authored
optimization. If the alloca that is "memcpy'd from constant" also has a memcpy from *it*, ignore it: it is a load. We now optimize the testcase to: define void @test2() { %B = alloca %T %a = bitcast %T* @G to i8* %b = bitcast %T* %B to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %b, i8* %a, i64 124, i32 4, i1 false) call void @bar(i8* %b) ret void } previously we would generate: define void @test() { %B = alloca %T %b = bitcast %T* %B to i8* %G.0 = getelementptr inbounds %T* @G, i32 0, i32 0 %tmp3 = load i8* %G.0, align 4 %G.1 = getelementptr inbounds %T* @G, i32 0, i32 1 %G.15 = bitcast [123 x i8]* %G.1 to i8* %1 = bitcast [123 x i8]* %G.1 to i984* %srcval = load i984* %1, align 1 %B.0 = getelementptr inbounds %T* %B, i32 0, i32 0 store i8 %tmp3, i8* %B.0, align 4 %B.1 = getelementptr inbounds %T* %B, i32 0, i32 1 %B.12 = bitcast [123 x i8]* %B.1 to i8* %2 = bitcast [123 x i8]* %B.1 to i984* store i984 %srcval, i984* %2, align 1 call void @bar(i8* %b) ret void } llvm-svn: 119682
-
- Nov 17, 2010
-
-
Dan Gohman authored
llvm-svn: 119570
-
Dan Gohman authored
functions of ScalarEvolution, in preparation for memoization and other optimizations. llvm-svn: 119562
-
Dan Gohman authored
to avoid an unneeded dependence. llvm-svn: 119557
-