Commit Graph

1757 Commits

Author SHA1 Message Date
Vikram S. Adve
a40cbb3b7e Bug fix in CreateCodeToLoadConst(): use sign of dest, not operand,
in choosing how to create int-set instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3248 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-04 20:55:37 +00:00
Vikram S. Adve
ed0030e2bc Bug fix in TargetData::getIndexedOffset(): handle struct offset
after array offset correctly.  The type was not being updated for
array offsets!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3246 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-04 20:52:39 +00:00
Vikram S. Adve
99d4a38c77 Bug fix in SetOperandsForMemInstr: handle leading zeros correctly
when folding or not folding GEPs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3245 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-04 20:51:05 +00:00
Vikram S. Adve
1b51b1b4f9 Add function GetConstantValueAsUnsignedInt.
Fix 2 bugs in FoldGetElemChain so index vector is not modified
when no GEPs are folded in, and so a hasLeadingZero is computed
only for the last folded GEP, not the one after that if any.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3244 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-04 20:49:49 +00:00
Chris Lattner
75ac4e511a Fix compilation problem. IsIndexZero doesn't exist, use IsZero instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3243 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-03 20:57:38 +00:00
Vikram S. Adve
ed3fefb34c Simplified handling of array indexes in SetMemOperands_Internal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3236 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-03 13:48:21 +00:00
Vikram S. Adve
900fd63d12 Eliminate cast instructions: use only GEPs in decomposed sequence.
Don't decompose if there are 2 indices with 0 as first index.
Compute Changed flag correctly in runOnBasicBlock().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3233 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-03 13:21:15 +00:00
Chris Lattner
69ab7a8ac6 Fix problem where lli would not print out a 64 bit value when the client code
uses the modifier "%ld".  Now lli passes off "%lld" to the underlying runtime
library in this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3230 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 23:08:32 +00:00
Chris Lattner
1bbd36156b Fix one real nasty bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3227 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 22:06:04 +00:00
Chris Lattner
b490c20b38 Fix lli with no arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3226 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 21:51:29 +00:00
Chris Lattner
8fd217cb29 Fix bug: test/Regression/Transforms/InstCombine/2002-08-02-CastTest.ll
Implement feature: Cast's can now be converted to bitwise AND expressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3225 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 20:00:25 +00:00
Chris Lattner
90ac28cf3e * Cleanups of instcombine
- Reenable gep (gep x) -> x
   - Make instcombine do dead instruction elimination where it's really
     easy.  Now visitors don't have to ensure they aren't not processing
     dead instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3222 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 19:29:35 +00:00
Chris Lattner
be1ecf6050 Fix bug: test/Regression/Transforms/GCSE/2002-05-21-NoSharedDominator.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3215 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 18:06:01 +00:00
Chris Lattner
9ce231f3ae Implement dominator checking in the verifier, so that we check that all
defintiions dominate their uses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3214 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 17:37:08 +00:00
Chris Lattner
a915ef0fc0 Fix bug: test/Regression/Other/2002-08-02-DomSetProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3213 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 16:51:27 +00:00
Chris Lattner
4c9df7c619 Split dominance calculation and post dominance calculation stuff
Dominance calculation goes to VMCore library to be used by Verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3210 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-02 16:43:03 +00:00
Chris Lattner
cc8d8fb676 Remove unneccesary #inlcude
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3200 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-01 20:01:02 +00:00
Chris Lattner
ca0a1f7d49 Enhance -time-passes to be more detailed and useful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3199 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-01 19:33:09 +00:00
Vikram S. Adve
a4704045e8 Bug fix: incorrect SAVE instruction when using register for stack size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3198 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-01 14:26:11 +00:00
Chris Lattner
fc94446777 Fix bug: test/Regression/Assembler/2002-07-31-SlashInString.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3195 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 23:56:44 +00:00
Chris Lattner
280b09b178 Implement the other half of a feature advertised by OperandConvertableToType.
This fixes bug: test/Regression/Transforms/LevelRaise/2002-07-31-AssertionFailure.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3193 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 22:31:34 +00:00
Vikram S. Adve
c190c01a9f Just improved comments and assertions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3191 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 21:13:31 +00:00
Vikram S. Adve
1e60669d3b Add a missing case: converting float/double to unsigned integer types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3188 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 21:01:34 +00:00
Chris Lattner
7541b89092 Changes to be GCC3.1 friendly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3186 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 19:32:12 +00:00
Chris Lattner
1b0a63fa64 *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3185 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 19:32:01 +00:00
Chris Lattner
7a40d6db08 We need iostream in PassManagerT.h to use cerr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3183 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 18:04:17 +00:00
Chris Lattner
dadd49bdb8 Add new -only-print-main-ds option that causes mains ds graph to be
printed, but no others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3178 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 17:15:40 +00:00
Chris Lattner
d16714b5ed Fix bug that was causing problems for lli
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3176 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-31 16:29:43 +00:00
Vikram S. Adve
358fc38d3b Add GlobalDSGraph -- a common graph that holds externally visible nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3173 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 22:08:08 +00:00
Vikram S. Adve
dfd2f32bf7 Print globals graph after either the BU or the TD pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3172 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 22:07:26 +00:00
Vikram S. Adve
aaeee75af8 This file implements the top-down propagation pass for data structure graphs.
Also, we now use a separate globals graph to hold externally visible nodes.
This changes both the bottom-up and top-down propagation so that
globals and other external objects do not have to appear in every
function, but only in functions in which they are referenced or
they can be used to access something else that is referenced.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3171 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 22:06:40 +00:00
Vikram S. Adve
355e2ca1f4 Use a separate globals graph to hold externally visible nodes.
This changes both the bottom-up and top-down propagation so that
globals and other external objects do not have to appear in every
function, but only in functions in which they are referenced or
they can be used to access something else that is referenced.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3170 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 22:05:22 +00:00
Chris Lattner
48c1bc7b3a Implement new -debug-pass=Arguments option that causes PassManager to
print out the command line options for the optimizations it is running.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3165 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 19:51:02 +00:00
Chris Lattner
55e41ba3d2 * Indent class into anonymous namespace, filling up the diff with garbage
* Internalize global variables with initializers
* Add new stat to track global variable internalization
* Only count functions that were not internal before in internalized function
  count


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3163 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 19:48:44 +00:00
Chris Lattner
c188eeb08c Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3161 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:25 +00:00
Chris Lattner
e8e4605021 Cleanup ConstantExpr handling:
* Correctly delete TypeHandles in AsmParser.  In addition to not leaking
   memory, this prevents a bug that could have occurred when a type got
   resolved that the constexpr was using
 * Check for errors in the AsmParser instead of hitting assertion failures
   deep in the code
 * Simplify the interface to the ConstantExpr class, removing unneccesary
   parameters to the ::get* methods.
 * Rename the 'getelementptr' version of ConstantExpr::get to
   ConstantExpr::getGetElementPtr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3160 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 18:54:22 +00:00
Chris Lattner
ad772a7188 Remove FIXME's that aren't really needed after all.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3158 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:38:54 +00:00
Chris Lattner
17689dfe24 Declare that these passes only depend on the CFG of the function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3157 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:27:52 +00:00
Chris Lattner
37d66c4dea * Move some code from Pass.cpp to PassManagerT.h
* Implement stuff so that code can declare that they only depend on the CFG of
  a function, not on anything else.  This speeds up GCCAS a lot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3155 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:27:02 +00:00
Chris Lattner
5fa829c54a Implement constant propogation of logical (and, or, xor) expressions.
Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3154 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:24:28 +00:00
Chris Lattner
e56096aa41 Implement constant propogation of logical (and, or, xor) expressions.
Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3153 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 16:24:25 +00:00
Chris Lattner
2e1749bbf8 * Move InstructionSelection Pass here instead of living in Sparc.cpp. It
is platform independant afterall.
* Object orientize the functions, cleanup code a bit.  Instead of static
  global functions, the helpers for instruction selection are now part of
  the InstructionSelection Pass class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 03:57:36 +00:00
Chris Lattner
057430d207 * Move InstructionSelection pass to lib/CodeGen/InstrSelection so it is
shared by backends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3146 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 03:56:16 +00:00
Chris Lattner
67fcce2b19 Remove unused vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3143 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 02:52:40 +00:00
Chris Lattner
e902bda4ce Fix bug with last patch which would occur when a call returned void and we
attempted to assign it a name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3142 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 02:42:49 +00:00
Chris Lattner
9cf307fdeb * Make sure the resolved function call instructions get the name from the
old call instruction
* Implement conversion of return values for calls.  This fixes bug:
   test/Regression/Transforms/FunctionResolve/retmismatch3.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3140 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 00:50:49 +00:00
Chris Lattner
446698b63d * Fix bug: test/Regression/Transforms/ADCE/2002-07-17-AssertionFailure.ll
which was caused by us not running the "drop references of dead
  instructions" code when there were no basic blocks that were dead.

  We still don't want to do some of the stuff we do if there are dead
  basic blocks, but we DO want to drop references of dead instructions,
  so we factor the common code out to a new method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3137 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 00:22:34 +00:00
Chris Lattner
a61fab8c6d Add code to ensure that no PHI nodes are left laying around with their
arguments dropped.  This fixes bug:
   test/Regression/Transforms/ADCE/2002-07-17-PHIAssertion.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3134 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 23:40:46 +00:00
Chris Lattner
b0f0ef8f26 Implement a new RemoveSuccessor function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3131 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 22:32:08 +00:00
Chris Lattner
011de07117 Fix bug: test/Regression/Transforms/ADCE/2002-07-29-Segfault.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3129 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-29 22:31:39 +00:00