Commit Graph

889 Commits

Author SHA1 Message Date
Chris Lattner
6a67393e19 Big diff for a small change: delete inlined functions if all callees have
inlined the function.
Implements: Inline/inline_dce.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8101 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 05:03:14 +00:00
Chris Lattner
7152c237b4 Implement: Inline/cfg_preserve_test.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8099 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-24 04:06:56 +00:00
Chris Lattner
7d6c24cdbf Implement SimplifyCFG/2003-08-17-FoldSwitch.ll:test5
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8093 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 23:18:19 +00:00
Chris Lattner
44bb541c01 Fix bug: LowerSwitch/2003-08-23-EmptySwitch.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8087 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 22:54:34 +00:00
Chris Lattner
f44c6051e0 Do not consider any types that exist in the global symbol table!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8084 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 21:32:24 +00:00
Chris Lattner
e3092c94ad Fix bug: Linker/2003-08-23-RecursiveOpaqueTypeResolve.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8083 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 21:25:54 +00:00
Chris Lattner
fcd0234de6 Implement Linker/2003-08-23-GlobalVarLinking.ll, which should fix 176.gcc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8080 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 20:31:10 +00:00
Chris Lattner
086cb002d2 Fix bug: TailDup/2003-08-23-InvalidatedPointers.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8078 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 20:08:30 +00:00
Chris Lattner
a0f85e56c9 Fix bug: FunctionResolve/2003-08-23-ArgumentWarning.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8076 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-23 20:03:05 +00:00
Chris Lattner
9732be769e Fix typeo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8059 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-22 20:16:48 +00:00
Chris Lattner
43f4ba8c7d The process of linking types can cause their addresses to become invalid. For this reason, we must use TypeHandles!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8057 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-22 19:12:55 +00:00
Chris Lattner
e76c57ad46 Implement Linker/2003-08-20-OpaqueTypeResolve.ll
Hopefully this will fix the 176.gcc spec test as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8051 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-22 06:07:12 +00:00
Misha Brukman
ef6a6a69ff The word dependent' has no a'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-21 22:14:26 +00:00
Chris Lattner
b29170fa40 Unless we CANNOT merge the arguments, do so
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7999 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-20 23:50:38 +00:00
Chris Lattner
e6f7f61cda Fix grammar, add comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7967 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 22:54:06 +00:00
Misha Brukman
5560c9d49c Spell `necessary' correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-18 14:43:39 +00:00
Chris Lattner
10b1f5a941 Implement folding of switch instructions.
Implements SimplifyCFG/2003-08-17-FoldSwitch.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7923 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-17 20:21:14 +00:00
Chris Lattner
694e37f08a Fix bug: SimplifyCFG/2003-08-17-BranchFoldOrdering.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7921 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-17 19:41:53 +00:00
Chris Lattner
342a9d1464 The fixme is irrelevant: if that happens, the LLVM bytecode is malformed.
This fixes testcase: SimplifyCFG/2003-08-17-BranchFold.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7919 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-17 19:34:55 +00:00
Brian Gaeke
bf3c4cfaad Factory methods for function passes now return type FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7839 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-14 06:09:32 +00:00
Chris Lattner
250d91b4bf Fix FIXME by removing FIXME
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7832 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 22:15:04 +00:00
Chris Lattner
aa9c1f13a1 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 20:16:26 +00:00
Chris Lattner
564a727969 Generalize some of the add tests to allow for reassociation to take place
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7825 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 19:01:45 +00:00
Brian Gaeke
19df3876e6 Factory methods for FunctionPasses now return type FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7823 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 18:18:15 +00:00
Chris Lattner
fb5be090f5 Assign arguments different ranks so they get grouped together
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7813 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 16:16:26 +00:00
John Criswell
478b3a9682 Removing the pool allocator from the main CVS tree.
Use the poolalloc module in CVS from now on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7810 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 15:36:15 +00:00
Chris Lattner
3ccd17ea2a Implement InstCombine/2003-08-12-AllocaNonNull.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7807 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 05:38:46 +00:00
Chris Lattner
934754bed6 Do not cannonicalize (X != 0) into (cast X to bool)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7806 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 05:33:12 +00:00
Chris Lattner
e92d2f450a Change cannonicalization rules: add X,X is represented as multiplies, multiplies
of a power of two are represented as a shift.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7803 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-13 04:18:28 +00:00
Brian Gaeke
aee2fdf069 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7794 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 22:00:24 +00:00
Chris Lattner
df17af1dc7 Allow pulling logical operations through shifts.
This implements InstCombine/shift.ll:test14*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7793 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 21:53:41 +00:00
Chris Lattner
e9608e37fc Fix bug: Reassociate/2003-08-12-InfiniteLoop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7792 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 21:45:24 +00:00
Chris Lattner
6007cb6c4d Assign finer grained ranks, make sure to reassociate top-level after reassociating bottom level
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7787 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 20:14:27 +00:00
Chris Lattner
e132d95b62 Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7783 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 19:17:27 +00:00
Chris Lattner
67ca768927 Implement testcases InstCombine/or.ll:test16/test17
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7782 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 19:11:07 +00:00
Sumant Kowshik
233d0758a1 Bug fix: Some nodes pointed to by globals may not be marked incomplete and need to be tracked to find pool arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7763 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-12 00:45:13 +00:00
Chris Lattner
1f28e8ce4d Fix handling of 'free' if it has absolutely no prototype
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7721 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-11 15:05:08 +00:00
John Criswell
7d3c5795f9 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7673 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 14:43:13 +00:00
Sumant Kowshik
8e37bd0330 Added code for pool allocating only the pool-allocatable data structures in the presence of collapsed nodes + a couple of bug fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7662 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-07 05:29:28 +00:00
Chris Lattner
8043127860 Remove unnecessary use of NonCopyable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 17:16:24 +00:00
Tanya Lattner
11a49a722f Fixed minor bug in SafeToHoist and made some changes suggested by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7614 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 20:39:02 +00:00
Tanya Lattner
9966c03aad Fixed LICM bug that hoists trapping instructions that are not guaranteed to execute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7612 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 18:45:46 +00:00
Chris Lattner
c8afdc150c Minor changes:
* Expand most tabs into spaces
  * Move #define DEBUG_TYPE to top of file to avoid warning


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7611 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 18:44:12 +00:00
Sumant Kowshik
f67e7fc7b1 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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7605 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 17:01:54 +00:00
Chris Lattner
122558b05b Fix bug: SimplifyCFG/2003-08-05-InvokeCrash.ll
Fix bug: SimplifyCFG/2003-08-05-MishandleInvoke.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7599 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 16:27:44 +00:00
Chris Lattner
6806f5614d DEBUG got moved to Support/Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7492 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:15:03 +00:00
Chris Lattner
943c713c65 Instcombine: (A >> c1) << c2 for signed integers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 18:38:56 +00:00
Chris Lattner
08fd7abb42 Reorganization of code, no functional changes.
Now it shoudl be a bit more efficient


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7292 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:52:58 +00:00
Chris Lattner
24c8e38455 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7290 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:35:25 +00:00
Chris Lattner
8baa92ef0b Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7289 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:31:56 +00:00