Chris Lattner
daa012d1fb
Simplify SROA conversion to integer in some ways, make it more general in others.
...
We now tolerate small amounts of undefined behavior, better emulating what
would happen if the transaction actually occurred in memory. This fixes
SingleSource/UnitTests/2007-04-10-BitfieldTest.c on PPC, at least until
Devang gets a chance to fix the CFE from doing undefined things with bitfields :)
llvm-svn: 35875
2007-04-11 00:57:54 +00:00
Chris Lattner
467b69cabb
Strengthen the boundary conditions of this fold, implementing
...
InstCombine/set.ll:test25
llvm-svn: 35852
2007-04-09 23:52:13 +00:00
Owen Anderson
3c7867935e
Re-constify things that don't break the build. Last patch in this
...
series, I promise.
llvm-svn: 35848
2007-04-09 23:38:18 +00:00
Chris Lattner
3e9690f987
eliminate the last uses of some TLI methods.
...
llvm-svn: 35844
2007-04-09 23:29:07 +00:00
Owen Anderson
f1ca1376d3
Unconst-ify stuff that broke the build.
...
llvm-svn: 35843
2007-04-09 23:08:26 +00:00
Owen Anderson
5917716146
Const-ify some parameters, and some cosmetic cleanups. No functionality
...
change.
llvm-svn: 35842
2007-04-09 22:54:50 +00:00
Owen Anderson
e0ef5ac6bd
Tabs -> Spaces
...
llvm-svn: 35841
2007-04-09 22:31:43 +00:00
Owen Anderson
83efbc84f7
Improve some _slow_ behavior introduced in my patches the last few days.
...
llvm-svn: 35839
2007-04-09 22:25:09 +00:00
Chris Lattner
780c009756
switch LSR to use isLegalAddressingMode instead of other simpler hooks
...
llvm-svn: 35837
2007-04-09 22:20:14 +00:00
Devang Patel
bca0d57179
Check _all_ PHINodes.
...
llvm-svn: 35836
2007-04-09 22:20:10 +00:00
Devang Patel
8eb8eeada9
Insert new pre-header before new header. Original pre-header may
...
happen to be an entry, in such case, it is not a good idea to
insert new block before entry.
Also fix typo in assertion check.
llvm-svn: 35833
2007-04-09 21:40:43 +00:00
Devang Patel
854197884b
Preserve canonical loop form.
...
llvm-svn: 35829
2007-04-09 20:19:46 +00:00
Reid Spencer
8436cdfda2
Don't link against System or Support library. These things will already
...
be in the opt tool.
llvm-svn: 35827
2007-04-09 19:17:47 +00:00
Devang Patel
b9af5747a5
Do not create new pre-header. Reuse original pre-header.
...
llvm-svn: 35825
2007-04-09 19:04:21 +00:00
Devang Patel
03d7ae3a74
Simpler for() loops.
...
llvm-svn: 35822
2007-04-09 17:09:13 +00:00
Devang Patel
d6ba41e02d
Fix future bug. Of course, Chris spotted this.
...
Handle Argument or Undef as an incoming PHI value.
llvm-svn: 35821
2007-04-09 16:41:46 +00:00
Devang Patel
b28a391a8d
More cosmetic changes.
...
llvm-svn: 35820
2007-04-09 16:21:29 +00:00
Devang Patel
88bc2c6f82
Only cosmetic changes. Zero functionality Change.
...
llvm-svn: 35819
2007-04-09 16:11:48 +00:00
Chris Lattner
a87c9f6114
Fix PR1304 and Transforms/InstCombine/2007-04-08-SingleEltVectorCrash.ll
...
llvm-svn: 35792
2007-04-09 01:37:55 +00:00
Chris Lattner
4ca9cbb170
Eliminate useless insertelement instructions. This implements
...
Transforms/InstCombine/vec_insertelt.ll and fixes PR1286.
We now compile the code from that bug into:
_foo:
movl 4(%esp), %eax
movdqa (%eax), %xmm0
movl 8(%esp), %ecx
psllw (%ecx), %xmm0
movdqa %xmm0, (%eax)
ret
instead of:
_foo:
subl $4, %esp
movl %ebp, (%esp)
movl %esp, %ebp
movl 12(%ebp), %eax
movdqa (%eax), %xmm0
#IMPLICIT_DEF %eax
pinsrw $2, %eax, %xmm0
xorl %ecx, %ecx
pinsrw $3, %ecx, %xmm0
pinsrw $4, %eax, %xmm0
pinsrw $5, %ecx, %xmm0
pinsrw $6, %eax, %xmm0
pinsrw $7, %ecx, %xmm0
movl 8(%ebp), %eax
movdqa (%eax), %xmm1
psllw %xmm0, %xmm1
movdqa %xmm1, (%eax)
movl %ebp, %esp
popl %ebp
ret
woo :)
llvm-svn: 35788
2007-04-09 01:11:16 +00:00
Owen Anderson
ae39ca037a
Cleanup some from my DomSet-removal changes. Add a new
...
isReachableFromEntry
test to ETForest to factor a common test out of code.
llvm-svn: 35786
2007-04-09 00:52:49 +00:00
Chris Lattner
aa8ad10c2f
Fix a typo that broke SimplifyLibCalls/SPrintF.ll (pr1315)
...
llvm-svn: 35768
2007-04-08 18:11:26 +00:00
Chris Lattner
c8d3788f71
reenable this xform, whoops :)
...
llvm-svn: 35765
2007-04-08 08:01:49 +00:00
Chris Lattner
7621a031d8
Fix regression on Instcombine/apint-or2.ll
...
llvm-svn: 35763
2007-04-08 07:55:22 +00:00
Chris Lattner
1150df9cc4
Generalize the code that handles (A&B)|(A&C) to work where B/C are not constants.
...
Add a new xform to simplify (A&B)|(~A&C). THis implements InstCombine/or2.ll:test1
llvm-svn: 35760
2007-04-08 07:47:01 +00:00
Chris Lattner
5717981e5d
implement a fixme: move optimizations for fwrite out of fputs into a new
...
fwrite optimizer.
llvm-svn: 35758
2007-04-08 07:00:35 +00:00
Nick Lewycky
e6c64466c7
Remove DominatorSet usage from LoopSimplify. Patch from Owen Anderson.
...
llvm-svn: 35757
2007-04-08 01:04:30 +00:00
Chris Lattner
182a945fb5
Significantly simplify the clients of GetConstantStringInfo, by having it
...
just return the string itself.
llvm-svn: 35755
2007-04-07 21:58:02 +00:00
Chris Lattner
08c0b8b3c8
Fix problems in the sprintf optimizer
...
llvm-svn: 35754
2007-04-07 21:17:51 +00:00
Chris Lattner
bed184cbcf
Change CastToCStr to take a pointer instead of a reference.
...
Fix some miscompilations in fprintf optimizer.
llvm-svn: 35753
2007-04-07 21:04:50 +00:00
Chris Lattner
898d698d9f
Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86
...
and Prolangs-C/cdecl
llvm-svn: 35749
2007-04-07 20:19:08 +00:00
Owen Anderson
f7ebea1b9f
Add DomSet back, and revert the changes to LoopSimplify. Apparently the
...
ETForest updating mechanisms don't work as I thought they did. These changes
will be reapplied once the issue is worked out.
llvm-svn: 35741
2007-04-07 18:23:27 +00:00
Nick Lewycky
d4f51a8ae3
Add support for cast instructions.
...
llvm-svn: 35734
2007-04-07 15:48:32 +00:00
Owen Anderson
8763ba1b88
Completely purge DomSet. This is the (hopefully) final patch for PR1171.
...
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Owen Anderson
706e97049d
Completely purge DomSet from LoopSimplify. This is part of the
...
continuing work on PR1171.
llvm-svn: 35730
2007-04-07 06:56:47 +00:00
Owen Anderson
d03a646f06
BreakCriticalEdges does still preserve DominatorTree.
...
llvm-svn: 35729
2007-04-07 05:57:09 +00:00
Owen Anderson
b39d9ca902
Expunge DomSet from BreakCriticalEdges. This is part of the continuing
...
work for PR 1171.
llvm-svn: 35728
2007-04-07 05:49:29 +00:00
Owen Anderson
f095bf3ac4
Expunge DomSet from CodeExtractor. This is part of the continuing work
...
on PR1171.
llvm-svn: 35726
2007-04-07 05:31:27 +00:00
Nick Lewycky
93f541057b
Support NE inequality in ValueRanges.
...
llvm-svn: 35724
2007-04-07 04:49:12 +00:00
Owen Anderson
910419596e
Expunge a bunch of uses of DomSet from LoopSimplify. Many more remain.
...
This is the beginning of work for PR1171.
llvm-svn: 35720
2007-04-07 04:37:14 +00:00
Nick Lewycky
3bb6de85d1
Cleanup. Refactor out the applying of value ranges to its own method.
...
llvm-svn: 35719
2007-04-07 03:36:51 +00:00
Nick Lewycky
12d44abe0f
Use TargetData to find the size of a type.
...
llvm-svn: 35718
2007-04-07 03:16:12 +00:00
Nick Lewycky
eeb01b41ef
Strengthen icmp snuggling by doing 'compare-or-equal-to' to 'compare'
...
first and then range testing second.
llvm-svn: 35715
2007-04-07 02:30:14 +00:00
Devang Patel
f42389ffe5
Add loop rotation pass.
...
llvm-svn: 35714
2007-04-07 01:25:15 +00:00
Chris Lattner
0f1509511e
fix a miscompilation in printf optimizer.
...
llvm-svn: 35713
2007-04-07 01:18:36 +00:00
Chris Lattner
6a36d636e9
trunc to bool no longer compares against zero
...
llvm-svn: 35712
2007-04-07 01:03:46 +00:00
Chris Lattner
e8829aa9dd
cleanups for strlen optimizer
...
llvm-svn: 35711
2007-04-07 01:02:00 +00:00
Chris Lattner
485b6415b1
Introduce a new ReplaceCallWith method, which simplifies a lot of code.
...
llvm-svn: 35710
2007-04-07 00:42:32 +00:00
Chris Lattner
6a6c1f1c30
fixes for strcpy optimizer
...
llvm-svn: 35709
2007-04-07 00:26:18 +00:00
Chris Lattner
f9ee647e86
Fix bugs in strncmp.
...
llvm-svn: 35708
2007-04-07 00:06:57 +00:00