Chris Lattner
c81be8ddba
add comment.
...
llvm-svn: 90002
2009-11-27 08:40:14 +00:00
Chris Lattner
af321b5729
reduce nesting, no functionality change.
...
llvm-svn: 90001
2009-11-27 08:37:22 +00:00
Chris Lattner
e7056c8cde
limit the recursion depth of GetLinearExpression. This
...
fixes a crash analyzing consumer-lame, which had an "%X = add %X, 1"
in unreachable code.
llvm-svn: 90000
2009-11-27 08:32:52 +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
Chris Lattner
16ee3226ce
redisable this, my bootstrap worked because it wasn't an optimized build, whoops.
...
llvm-svn: 89991
2009-11-27 05:53:01 +00:00
Chris Lattner
ea3b1f2186
try again.
...
llvm-svn: 89990
2009-11-27 05:19:56 +00:00
Chris Lattner
895214c65e
this is causing buildbot failures, disable for now.
...
llvm-svn: 89985
2009-11-27 01:52:22 +00:00
Chris Lattner
225a88f4ab
this (and probably several others) are now done.
...
llvm-svn: 89982
2009-11-27 00:35:04 +00:00
Chris Lattner
02ffb0a608
teach phi translation of GEPs to simplify geps like 'gep x, 0'.
...
This allows us to compile the example from PR5313 into:
LBB1_2: ## %bb
incl %ecx
movb %al, (%rsi)
movslq %ecx, %rax
movb (%rdi,%rax), %al
testb %al, %al
jne LBB1_2
instead of:
LBB1_2: ## %bb
movslq %eax, %rcx
incl %eax
movb (%rdi,%rcx), %cl
movb %cl, (%rsi)
movslq %eax, %rcx
cmpb $0, (%rdi,%rcx)
jne LBB1_2
llvm-svn: 89981
2009-11-27 00:34:38 +00:00
Chris Lattner
6611a6f733
factor some instcombine simplifications for getelementptr out to a new
...
SimplifyGEPInst method in InstructionSimplify.h. No functionality change.
llvm-svn: 89980
2009-11-27 00:29:05 +00:00
Chris Lattner
4810fa619f
teach memdep to do trivial PHI translation of GEPs. More to
...
come.
llvm-svn: 89979
2009-11-27 00:07:37 +00:00
Chris Lattner
4824ebfded
Teach memdep to phi translate bitcasts. This allows us to compile
...
the example in GCC PR16799 to:
LBB1_2: ## %bb1
movl %eax, %eax
subq %rax, %rdi
movq %rdi, (%rcx)
movl (%rdi), %eax
testl %eax, %eax
je LBB1_2
instead of:
LBB1_2: ## %bb1
movl (%rdi), %ecx
subq %rcx, %rdi
movq %rdi, (%rax)
cmpl $0, (%rdi)
je LBB1_2
llvm-svn: 89978
2009-11-26 23:41:07 +00:00
Nick Lewycky
c0a516186a
Fix typo spotted by Gabor Greif.
...
llvm-svn: 89976
2009-11-26 23:19:05 +00:00
Chris Lattner
5020bb83d7
factor some code out into some helper functions.
...
llvm-svn: 89975
2009-11-26 23:18:49 +00:00
Nick Lewycky
07c3eb54a4
Clean up file, no functionality change.
...
llvm-svn: 89974
2009-11-26 22:54:26 +00:00
Chris Lattner
15482aa384
Add a hack for PR5601, a crash on obsolete syntax that we plan to
...
remove in LLVM 3.0
llvm-svn: 89973
2009-11-26 22:48:23 +00:00
Chris Lattner
e949f49b23
fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970
...
llvm-svn: 89972
2009-11-26 22:08:06 +00:00
Chris Lattner
cf7665b0c8
Fix PR5471 by removing an instcombine xform. Some pieces of the code
...
generates store to undef and some generates store to null as the idiom
for undefined behavior. Since simplifycfg zaps both, don't remove the
undefined behavior in instcombine.
llvm-svn: 89971
2009-11-26 22:04:42 +00:00
Chris Lattner
08e20f453d
implement a bunch of xforms for overflow intrinsics, based on a patch
...
by Alastair Lynn.
llvm-svn: 89970
2009-11-26 21:42:47 +00:00
Bob Wilson
c029183683
Rename new TailDuplicationPass to avoid name conflict with the old one.
...
llvm-svn: 89968
2009-11-26 21:38:41 +00:00
Chris Lattner
ce573daf09
Implement PR1143 (at -m64) by making basicaa look through extensions. We
...
previously already handled it at -m32 because there were no i32->i64
extensions for addressing.
llvm-svn: 89959
2009-11-26 18:53:33 +00:00
Chris Lattner
a403a7eddc
fix two transposed lines duncan caught and add an explanatory comment.
...
llvm-svn: 89958
2009-11-26 18:35:46 +00:00
Chris Lattner
f7a0da351e
this todo is resolved.
...
llvm-svn: 89957
2009-11-26 17:14:10 +00:00
Chris Lattner
2178a80b90
move DecomposeGEPExpression out into ValueTracking.cpp
...
llvm-svn: 89956
2009-11-26 17:12:50 +00:00
Chris Lattner
d86a693b70
teach GetLinearExpression to be a bit more aggressive.
...
llvm-svn: 89955
2009-11-26 17:00:01 +00:00
Chris Lattner
62a36a703c
resolve a fixme. I haven't figured out how to write a testcase
...
to exercise this though.
llvm-svn: 89954
2009-11-26 16:52:32 +00:00
Chris Lattner
9c88c96b3f
Teach basicaa that x|c == x+c when the c bits of x are clear. This
...
allows us to compile the example in readme.txt into:
LBB1_1: ## %bb
movl 4(%rdx,%rax), %ecx
movl %ecx, %esi
imull (%rdx,%rax), %esi
imull %esi, %ecx
movl %esi, 8(%rdx,%rax)
imull %ecx, %esi
movl %ecx, 12(%rdx,%rax)
movl %esi, 16(%rdx,%rax)
imull %ecx, %esi
movl %esi, 20(%rdx,%rax)
addq $16, %rax
cmpq $4000, %rax
jne LBB1_1
instead of:
LBB1_1:
movl (%rdx,%rax), %ecx
imull 4(%rdx,%rax), %ecx
movl %ecx, 8(%rdx,%rax)
imull 4(%rdx,%rax), %ecx
movl %ecx, 12(%rdx,%rax)
imull 8(%rdx,%rax), %ecx
movl %ecx, 16(%rdx,%rax)
imull 12(%rdx,%rax), %ecx
movl %ecx, 20(%rdx,%rax)
addq $16, %rax
cmpq $4000, %rax
jne LBB1_1
GCC (4.2) doesn't seem to be able to eliminate the loads in this
testcase either, it generates:
L2:
movl (%rdx), %eax
imull 4(%rdx), %eax
movl %eax, 8(%rdx)
imull 4(%rdx), %eax
movl %eax, 12(%rdx)
imull 8(%rdx), %eax
movl %eax, 16(%rdx)
imull 12(%rdx), %eax
movl %eax, 20(%rdx)
addl $4, %ecx
addq $16, %rdx
cmpl $1002, %ecx
jne L2
llvm-svn: 89952
2009-11-26 16:26:43 +00:00
Chris Lattner
677b93d4c8
teach basicaa that A[i] != A[i+1].
...
llvm-svn: 89951
2009-11-26 16:18:10 +00:00
Chris Lattner
69e59e50f3
Change the other half of aliasGEP (which handles GEP differencing) to use DecomposeGEPExpression. This dramatically simplifies and shrinks the code by eliminating the horrible CheckGEPInstructions method, fixes a miscompilation (@test3) and makes the code more aggressive. In particular, we now handle the @test4 case, which is reduced from the SmallPtrSet constructor. Missing this caused us to emit a variable length memset instead of a fixed size one.
...
llvm-svn: 89922
2009-11-26 02:17:34 +00:00
Chris Lattner
bd90980add
Generalize DecomposeGEPExpression to exactly handle what Value::getUnderlyingObject does (when TD is around). This allows us to avoid calling DecomposeGEPExpression unless the ultimate alias check we care about passes, speedup up BasicAA a bit.
...
llvm-svn: 89920
2009-11-26 02:14:59 +00:00
Chris Lattner
57bca7101d
Implement a new DecomposeGEPExpression method, which decomposes a GEP into a list of scaled offsets. Use this to eliminate some previous ad-hoc code which was subtly broken (it assumed all Constant*'s were non-zero, but strange constant express could be zero).
...
llvm-svn: 89915
2009-11-26 02:13:03 +00:00
Chris Lattner
260350330e
Use GEPOperator more pervasively to simplify code.
...
llvm-svn: 89914
2009-11-26 02:11:08 +00:00
Chris Lattner
0b862edca3
update some notes slightly
...
llvm-svn: 89913
2009-11-26 01:51:18 +00:00
Chris Lattner
9646ffc9a2
remove some redundant braces
...
llvm-svn: 89912
2009-11-26 01:50:12 +00:00
Evan Cheng
82b29e816e
When all defs of a vr are implicit_def, delete all of the defs.
...
llvm-svn: 89905
2009-11-26 00:32:36 +00:00
Bob Wilson
de012efdba
Split tail duplication into a separate pass. This is needed to avoid
...
running tail duplication when doing branch folding for if-conversion, and
we also want to be able to run tail duplication earlier to fix some
reg alloc problems. Move the CanFallThrough function from BranchFolding
to MachineBasicBlock so that it can be shared by TailDuplication.
llvm-svn: 89904
2009-11-26 00:32:21 +00:00
Viktor Kutuzov
c0799914a1
Rollback changes r89516: Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.
...
llvm-svn: 89893
2009-11-25 22:44:18 +00:00
Evan Cheng
bdedf32e51
ProcessImplicitDefs should watch out for invalidated iterator and extra implicit operands on copies.
...
llvm-svn: 89880
2009-11-25 21:13:39 +00:00
Bob Wilson
b1cce5329e
Tail duplicate indirect branches for PowerPC, too.
...
With the testcase for pr3120, the "threaded interpreter" runtime decreases
from 1788 to 1413 with this change.
llvm-svn: 89877
2009-11-25 19:57:14 +00:00
Benjamin Kramer
fbac37018a
Avoid some possibly unsafe uses of StringRef::data().
...
llvm-svn: 89873
2009-11-25 18:26:09 +00:00
Devang Patel
d50fc13c19
Use StringRef (again) in DebugInfo interface.
...
llvm-svn: 89866
2009-11-25 17:36:49 +00:00
Bob Wilson
aee7a9e676
Based on the testcase for pr3120, running on my MacPro with Xeon processors,
...
it is definitely profitable to tail duplicate indirect branches for x86.
This is likely to be true to various degrees for all modern x86 processors.
llvm-svn: 89865
2009-11-25 17:27:53 +00:00
Bruno Cardoso Lopes
038281c523
Support PIC loading of constant pool entries
...
llvm-svn: 89863
2009-11-25 12:17:58 +00:00
Daniel Dunbar
ffe6484b7c
Sketch structure for X86 disassembler.
...
llvm-svn: 89850
2009-11-25 06:53:08 +00:00
Edward O'Callaghan
43864a3136
API change Path::isSpecialFile to Path::isRegularFile, improve semantics in regards to comments from 89765 post review.
...
llvm-svn: 89848
2009-11-25 06:32:19 +00:00
Douglas Gregor
2cb3662a53
Perform explicit instantiations in the proper namespace, since Clang diagnoses this ill-formity.
...
llvm-svn: 89846
2009-11-25 06:04:18 +00:00
Edward O'Callaghan
4b197b8908
Reverting patch in revision 89758, initial attempt at fixing PR5373 has proven to be bogus.
...
llvm-svn: 89844
2009-11-25 05:38:41 +00:00
Bruno Cardoso Lopes
974ab18d0e
Use endianess dependent offsets for load/store of doubles when
...
using two swc/lwc instead of sdc/ldc.
llvm-svn: 89826
2009-11-25 01:05:25 +00:00
Dale Johannesen
916d90c926
Fix compiler warnings.
...
llvm-svn: 89824
2009-11-25 00:58:21 +00:00