- Nov 18, 2010
-
-
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
-
Chris Lattner authored
llvm-svn: 119681
-
- Nov 17, 2010
-
-
Benjamin Kramer authored
llvm-svn: 119538
-
- Nov 16, 2010
-
-
Duncan Sands authored
over a phi node by applying it to each operand may be wrong if the operation and the phi node are mutually interdependent (the testcase has a simple example of this). So only do this transform if it would be correct to perform the operation in each predecessor of the block containing the phi, i.e. if the other operands all dominate the phi. This should fix the FFMPEG snow.c regression reported by İsmail Dönmez. llvm-svn: 119347
-
- Nov 15, 2010
-
-
Duncan Sands authored
values that are equal to the phi itself. llvm-svn: 119161
-
Duncan Sands authored
llvm-svn: 119153
-
- Nov 14, 2010
-
-
Duncan Sands authored
offload the work to hasConstantValue rather than do something more complicated (such handling mutually recursive phis) because (1) it is not clear it is worth it; and (2) if it is worth it, maybe such logic would be better placed in hasConstantValue. Adjust some GVN tests which are now cleaned up much further (eg: all phi nodes are removed). llvm-svn: 119043
-
Chris Lattner authored
llvm-svn: 119033
-
Chris Lattner authored
llvm-svn: 119032
-
Chris Lattner authored
llvm-svn: 119031
-
- Nov 13, 2010
-
-
Duncan Sands authored
as it goes"). Before -std-compile-opts only got it down to %a = tail call i32 @foo(i32 0) readnone %x = tail call i32 @foo(i32 %a) readnone %y = tail call i32 @foo(i32 %a) readnone %z = icmp eq i32 %x, %y ret i1 %z while now -basicaa -gvn alone reduce it to %a = call i32 @foo(i32 0) readnone %x = call i32 @foo(i32 %a) readnone ret i1 true llvm-svn: 119009
-
Duncan Sands authored
SimplifyAssociativeOrCommutative) "(A op C1) op C2" -> "A op (C1 op C2)", which previously was only done if C1 and C2 were constants, to occur whenever "C1 op C2" simplifies (a la InstructionSimplify). Since the simplifying operand combination can no longer be assumed to be the right-hand terms, consider all of the possible permutations. When compiling "gcc as one big file", transform 2 (i.e. using right-hand operands) fires about 4000 times but it has to be said that most of the time the simplifying operands are both constants. Transforms 3, 4 and 5 each fired once. Transform 6, which is an existing transform that I didn't change, never fired. With this change, the testcase is now optimized perfectly with one run of instcombine (previously it required instcombine + reassociate + instcombine, and it may just have been luck that this worked). llvm-svn: 119002
-
- Nov 12, 2010
-
-
Dan Gohman authored
one store dead. This is especially noticeable in SingleSource/Benchmarks/Shootout/objinst. llvm-svn: 118875
-
Dan Gohman authored
llvm-svn: 118874
-
- Nov 11, 2010
-
-
Dan Gohman authored
testing for dereferenceable pointers into a helper function, isDereferenceablePointer. Teach it how to reason about GEPs with simple non-zero indices. Also eliminate ArgumentPromtion's IsAlwaysValidPointer, which didn't check for weak externals or out of range gep indices. llvm-svn: 118840
-
- Nov 10, 2010
-
-
Dan Gohman authored
references. For example, this allows gvn to eliminate the load in this example: void foo(int n, int* p, int *q) { p[0] = 0; p[1] = 1; if (n) { *q = p[0]; } } llvm-svn: 118714
-
Duncan Sands authored
nodes can be used in loops, this could result in infinite looping if there is no recursion limit, so add such a limit. It is also used for the SelectInst case because in theory there could be an infinite loop there too if the basic block is unreachable. llvm-svn: 118694
-
Dale Johannesen authored
order to reduce ((x<<30)>>24) to x<<6, check the correct bits. PR 8547. llvm-svn: 118665
-
Dan Gohman authored
chaining and simplify FunctionAttrs' GetModRefBehavior logic. llvm-svn: 118660
-
- Nov 08, 2010
-
-
Duncan Sands authored
llvm-svn: 118441
-
Dan Gohman authored
to optionally look for constant or local (alloca) memory. Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select and Phi nodes, and to support looking for local memory. Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that AliasAnalysis knows all the tricks that it knew. llvm-svn: 118412
-
Dan Gohman authored
knows about intrinsic functions. llvm-svn: 118410
-
- Nov 07, 2010
-
-
Duncan Sands authored
of a select instruction, the same as already exists for integer comparisons. llvm-svn: 118379
-
Duncan Sands authored
of a select instruction, see if doing the compare with the true and false values of the select gives the same result. If so, that can be used as the value of the comparison. llvm-svn: 118378
-
- Nov 01, 2010
-
-
Owen Anderson authored
bits are zero, not that the current low bits are zero. Fixes <rdar://problem/8606771>. llvm-svn: 117953
-
- Oct 30, 2010
-
-
Duncan Sands authored
consider it to be readonly. In fact, don't even consider it to be readonly if it does a volatile load from an AllocaInst either (it is debatable as to whether readonly would be correct or not in this case; play safe for the moment). This fixes PR8279. llvm-svn: 117783
-
Bob Wilson authored
This code had previously used 2*N, where N is the mask length, to represent undef. That is not safe because the shufflevector operands may have more than N elements -- they don't have to match the result type. llvm-svn: 117721
-
Bob Wilson authored
Allow splats even if they don't match either of the original shuffles, possibly due to undef entries in the shuffles masks. Radar 8597790. Also fix some 80-column violations. llvm-svn: 117719
-
- Oct 29, 2010
-
-
Owen Anderson authored
Update testcase since we're no longer doing the constant forwarding inline with correlated value propagation. llvm-svn: 117712
-
- Oct 28, 2010
-
-
NAKAMURA Takumi authored
test/Transforms/SimplifyLibCalls/floor.ll: Mark as XFAIL:win32 due to lack of nearbyintf on MSVC. [PR8466] llvm-svn: 117529
-
Dale Johannesen authored
llvm-svn: 117510
-
- Oct 25, 2010
-
-
Dan Gohman authored
from stores when folding in bitcasts. llvm-svn: 117265
-
- Oct 24, 2010
-
-
Duncan Sands authored
it isn't unreachable and should not be zapped. The check for the entry block was missing in one case: a block containing a unwind instruction. While there, do some small cleanups: "M" is not a great name for a Function* (it would be more appropriate for a Module*), change it to "Fn"; use Fn in more places. llvm-svn: 117224
-
- Oct 22, 2010
-
-
Bob Wilson authored
llvm-svn: 117154
-
- Oct 19, 2010
-
-
Mikhail Glushenkov authored
Fixes PR8389. llvm-svn: 116812
-
- Oct 18, 2010
-
-
Dan Gohman authored
does normal initialization and normal chaining. Change the default AliasAnalysis implementation to NoAlias. Update StandardCompileOpts.h and friends to explicitly request BasicAliasAnalysis. Update tests to explicitly request -basicaa. llvm-svn: 116720
-
- Oct 16, 2010
-
-
Owen Anderson authored
forwarding is implemented with a load/store pair rather than a memcpy. llvm-svn: 116637
-
- Oct 14, 2010
-
-
Chris Lattner authored
llvm-svn: 116462
-