Chris Lattner
bb4dd7ed34
Fix bug: TailDup/2003-08-23-InvalidatedPointers.ll
...
llvm-svn: 8078
2003-08-23 20:08:30 +00:00
Chris Lattner
6fc0ee9901
Fix bug: FunctionResolve/2003-08-23-ArgumentWarning.ll
...
llvm-svn: 8076
2003-08-23 20:03:05 +00:00
Chris Lattner
954a6095d7
Fix typeo
...
llvm-svn: 8059
2003-08-22 20:16:48 +00:00
Chris Lattner
1a8a45977a
The process of linking types can cause their addresses to become invalid. For this reason, we must use TypeHandles!
...
llvm-svn: 8057
2003-08-22 19:12:55 +00:00
Chris Lattner
f872d41f55
Implement Linker/2003-08-20-OpaqueTypeResolve.ll
...
Hopefully this will fix the 176.gcc spec test as well.
llvm-svn: 8051
2003-08-22 06:07:12 +00:00
Misha Brukman
be372b91e1
The word `dependent' has no `a'.
...
llvm-svn: 8030
2003-08-21 22:14:26 +00:00
Chris Lattner
015d98e940
Unless we CANNOT merge the arguments, do so
...
llvm-svn: 7999
2003-08-20 23:50:38 +00:00
Chris Lattner
a34c477b05
Fix grammar, add comment
...
llvm-svn: 7967
2003-08-18 22:54:06 +00:00
Misha Brukman
7eb05a170a
Spell `necessary' correctly.
...
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner
821deeeffa
Implement folding of switch instructions.
...
Implements SimplifyCFG/2003-08-17-FoldSwitch.ll
llvm-svn: 7923
2003-08-17 20:21:14 +00:00
Chris Lattner
031340a551
Fix bug: SimplifyCFG/2003-08-17-BranchFoldOrdering.ll
...
llvm-svn: 7921
2003-08-17 19:41:53 +00:00
Chris Lattner
4b7e3364c7
The fixme is irrelevant: if that happens, the LLVM bytecode is malformed.
...
This fixes testcase: SimplifyCFG/2003-08-17-BranchFold.ll
llvm-svn: 7919
2003-08-17 19:34:55 +00:00
Brian Gaeke
8c14ba96ca
Factory methods for function passes now return type FunctionPass *.
...
llvm-svn: 7839
2003-08-14 06:09:32 +00:00
Chris Lattner
cbf0839a03
Fix FIXME by removing FIXME
...
llvm-svn: 7832
2003-08-13 22:15:04 +00:00
Chris Lattner
3ac7c26a1c
Implement instcombine optimizations:
...
(A <setcc1> B) logicalop (A <setcc2> B) -> (A <setcc3> B) or true or false
Where setcc[123] is one of the 6 setcc instructions, and logicalop is one of: And, Or, Xor
llvm-svn: 7828
2003-08-13 20:16:26 +00:00
Chris Lattner
b8b97505ba
Generalize some of the add tests to allow for reassociation to take place
...
llvm-svn: 7825
2003-08-13 19:01:45 +00:00
Brian Gaeke
89207943a1
Factory methods for FunctionPasses now return type FunctionPass *.
...
llvm-svn: 7823
2003-08-13 18:18:15 +00:00
Chris Lattner
8ac196dd3b
Assign arguments different ranks so they get grouped together
...
llvm-svn: 7813
2003-08-13 16:16:26 +00:00
John Criswell
35364c8408
Removing the pool allocator from the main CVS tree.
...
Use the poolalloc module in CVS from now on.
llvm-svn: 7810
2003-08-13 15:36:15 +00:00
Chris Lattner
d07283a2ad
Implement InstCombine/2003-08-12-AllocaNonNull.ll
...
llvm-svn: 7807
2003-08-13 05:38:46 +00:00
Chris Lattner
c992add9fe
Do not cannonicalize (X != 0) into (cast X to bool)
...
llvm-svn: 7806
2003-08-13 05:33:12 +00:00
Chris Lattner
ede3fe05c5
Change cannonicalization rules: add X,X is represented as multiplies, multiplies
...
of a power of two are represented as a shift.
llvm-svn: 7803
2003-08-13 04:18:28 +00:00
Brian Gaeke
709a16a0bc
Give std::map<BasicBlock *, BasicBlock *> the short name BBMap, because
...
it's used 7 different times.
Rename `getBackEdges' to `findAndInstrumentBackEdges', for clarity.
Remove some excess whitespace and commented-out code.
Use shorter forms of CallInst ctors.
Do not make `reopt_threshold' visible to the LLVM program, and do not
pass it to the call to `reoptimizerInitialize'. Don't pass the
GlobalVariable representing it to any of our helper methods.
`reopt_threshold' is an internal parameter of the reoptimizer, which
InstLoops does not need to know about.
llvm-svn: 7794
2003-08-12 22:00:24 +00:00
Chris Lattner
deaa0dd71a
Allow pulling logical operations through shifts.
...
This implements InstCombine/shift.ll:test14*
llvm-svn: 7793
2003-08-12 21:53:41 +00:00
Chris Lattner
98b3ecddec
Fix bug: Reassociate/2003-08-12-InfiniteLoop.ll
...
llvm-svn: 7792
2003-08-12 21:45:24 +00:00
Chris Lattner
58c7eb60ec
Assign finer grained ranks, make sure to reassociate top-level after reassociating bottom level
...
llvm-svn: 7787
2003-08-12 20:14:27 +00:00
Chris Lattner
01d5639515
Simplify code
...
llvm-svn: 7783
2003-08-12 19:17:27 +00:00
Chris Lattner
812aab7727
Implement testcases InstCombine/or.ll:test16/test17
...
llvm-svn: 7782
2003-08-12 19:11:07 +00:00
Sumant Kowshik
46d9b22e90
Bug fix: Some nodes pointed to by globals may not be marked incomplete and need to be tracked to find pool arguments
...
llvm-svn: 7763
2003-08-12 00:45:13 +00:00
Chris Lattner
603e0076c0
Fix handling of 'free' if it has absolutely no prototype
...
llvm-svn: 7721
2003-08-11 15:05:08 +00:00
John Criswell
449670a8f7
Fixed a segfault in gccld.
...
The original code does not work because the value from WorkList.end() is
invalidated once WorkList.erase() is called. To ensure proper functionality,
we must ensure that WorkList.erase() is always called before WorkList.end().
llvm-svn: 7673
2003-08-07 14:43:13 +00:00
Sumant Kowshik
0b83080595
Added code for pool allocating only the pool-allocatable data structures in the presence of collapsed nodes + a couple of bug fixes
...
llvm-svn: 7662
2003-08-07 05:29:28 +00:00
Chris Lattner
c592c9f8a3
Remove unnecessary use of NonCopyable
...
llvm-svn: 7641
2003-08-06 17:16:24 +00:00
Tanya Lattner
dc3c9a8545
Fixed minor bug in SafeToHoist and made some changes suggested by Chris.
...
llvm-svn: 7614
2003-08-05 20:39:02 +00:00
Tanya Lattner
57c03df032
Fixed LICM bug that hoists trapping instructions that are not guaranteed to execute.
...
llvm-svn: 7612
2003-08-05 18:45:46 +00:00
Chris Lattner
adc5a89a3b
Minor changes:
...
* Expand most tabs into spaces
* Move #define DEBUG_TYPE to top of file to avoid warning
llvm-svn: 7611
2003-08-05 18:44:12 +00:00
Sumant Kowshik
0383a65103
Major bug fixes including a memory leak and tracking some exceptional conditions. Also added support for including global and indirect call information in the DS graphs used by the pool allocation
...
llvm-svn: 7605
2003-08-05 17:01:54 +00:00
Chris Lattner
edc8c54e16
Fix bug: SimplifyCFG/2003-08-05-InvokeCrash.ll
...
Fix bug: SimplifyCFG/2003-08-05-MishandleInvoke.ll
llvm-svn: 7599
2003-08-05 16:27:44 +00:00
Chris Lattner
8abcd56c74
DEBUG got moved to Support/Debug.h
...
llvm-svn: 7492
2003-08-01 22:15:03 +00:00
Chris Lattner
ab780dfab5
Instcombine: (A >> c1) << c2 for signed integers
...
llvm-svn: 7295
2003-07-24 18:38:56 +00:00
Chris Lattner
3204d4ed4e
Reorganization of code, no functional changes.
...
Now it shoudl be a bit more efficient
llvm-svn: 7292
2003-07-24 17:52:58 +00:00
Chris Lattner
dfae8be3c9
Allow folding several instructions into casts, which can simplify a lot
...
of codes. For example,
short kernel (short t1) {
t1 >>= 8; t1 <<= 8;
return t1;
}
became:
short %kernel(short %t1.1) {
%tmp.3 = shr short %t1.1, ubyte 8 ; <short> [#uses=1]
%tmp.5 = cast short %tmp.3 to int ; <int> [#uses=1]
%tmp.7 = shl int %tmp.5, ubyte 8 ; <int> [#uses=1]
%tmp.8 = cast int %tmp.7 to short ; <short> [#uses=1]
ret short %tmp.8
}
before, now it becomes:
short %kernel(short %t1.1) {
%tmp.3 = shr short %t1.1, ubyte 8 ; <short> [#uses=1]
%tmp.8 = shl short %tmp.3, ubyte 8 ; <short> [#uses=1]
ret short %tmp.8
}
which will become:
short %kernel(short %t1.1) {
%tmp.3 = and short %t1.1, 0xFF00
ret short %tmp.3
}
This implements cast-set.ll:test4 and test5
llvm-svn: 7290
2003-07-24 17:35:25 +00:00
Chris Lattner
727c03a665
Minor cleanups
...
llvm-svn: 7289
2003-07-24 17:31:56 +00:00
Chris Lattner
e9340228c9
Fix bug: FunctionResolve/2003-07-23-CPR-Reference.ll
...
This fixes a long time annoyance which caused prototypes for bzero, bcopy,
bcmp, fputs, and fputs_unlocked to never get deleted. Grr.
llvm-svn: 7285
2003-07-23 22:03:18 +00:00
Chris Lattner
bfb1d03159
Add comments
...
llvm-svn: 7283
2003-07-23 21:41:57 +00:00
Chris Lattner
9763859e8d
Remove explicit check for: not (not X) = X, it is already handled because xor is commutative
...
- InstCombine: (X & C1) ^ C2 --> (X & C1) | C2 iff (C1&C2) == 0
- InstCombine: (X | C1) ^ C2 --> (X | C1) & ~C2 iff (C1&C2) == C2
llvm-svn: 7282
2003-07-23 21:37:07 +00:00
Chris Lattner
33217db4d9
InstCombine: (X ^ C1) & C2 --> (X & C2) iff (C1&C2) == 0
...
llvm-svn: 7272
2003-07-23 19:36:21 +00:00
Chris Lattner
16464b36ff
- InstCombine: (X | C1) & C2 --> X & C2 iff C1 & C1 == 0
...
- InstCombine: (X | C) & C --> C
- InstCombine: (X | C1) & C2 --> (X | (C1&C2)) & C2
llvm-svn: 7269
2003-07-23 19:25:52 +00:00
Chris Lattner
8f0d15601a
IC: (X & C1) | C2 --> (X | C2) & (C1|C2)
...
IC: (X ^ C1) | C2 --> (X | C2) ^ (C1&~C2)
We are now guaranteed that all 'or's will be inside of 'and's, and all 'and's
will be inside of 'xor's, if the second operands are constants.
llvm-svn: 7264
2003-07-23 18:29:44 +00:00
Chris Lattner
49b47ae565
IC: (X ^ C1) & C2 --> (X & C2) ^ (C1&C2)
...
Minor code cleanup
llvm-svn: 7262
2003-07-23 17:57:01 +00:00