1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-25 05:52:53 +02:00
Commit Graph

165 Commits

Author SHA1 Message Date
Reid Spencer
1abf69e923 For PR950:
Replace the REM instruction with UREM, SREM and FREM.

llvm-svn: 31369
2006-11-02 01:53:59 +00:00
Reid Spencer
6833ffe8b8 For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Reid Spencer
d414793dbc For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
2118062b9c Fix Transforms/Reassociate/2006-04-27-ReassociateVector.ll
llvm-svn: 28007
2006-04-28 04:14:49 +00:00
Chris Lattner
92090188c3 Implement a FIXME, recusively reassociating
A*A*B + A*A*C   -->   A*(A*B+A*C)   -->   A*(A*(B+C))

This implements Reassociate/mul-factor3.ll

llvm-svn: 26757
2006-03-14 16:04:29 +00:00
Chris Lattner
9ccb2201b8 extract some code into a method, no functionality change
llvm-svn: 26755
2006-03-14 07:11:11 +00:00
Chris Lattner
0e3d81d8ff Promote shifts by a constant to multiplies so that we can reassociate
(x<<1)+(y<<1) -> (X+Y)<<1.  This implements
Transforms/Reassociate/shift-factor.ll

llvm-svn: 26753
2006-03-14 06:55:18 +00:00
Chris Lattner
7694fbc4bb Add factoring of multiplications, e.g. turning A*A+A*B into A*(A+B).
Testcase here: Transforms/Reassociate/mulfactor.ll

llvm-svn: 26524
2006-03-04 09:31:13 +00:00
Chris Lattner
2588f0eb8f Make iostream #inclusion explicit
llvm-svn: 25514
2006-01-22 23:32:06 +00:00
Chris Lattner
371f542759 Fix a problem that Dan Berlin noticed, where reassociation would not succeed
in building maximal expressions before simplifying them.  In particular, i
cases like this:

X-(A+B+X)

the code would consider A+B+X to be a maximal expression (not understanding
that the single use '-' would be turned into a + later), simplify it (a noop)
then later get simplified again.

Each of these simplify steps is where the cost of reassociation comes from,
so this patch should speed up the already fast pass a bit.

Thanks to Dan for noticing this!

llvm-svn: 23214
2005-09-02 07:07:58 +00:00
Chris Lattner
4cade5915d Avoid creating garbage instructions, just move the old add instruction
to where we need it when converting -(A+B+C) -> -A + -B + -C.

llvm-svn: 23213
2005-09-02 06:38:04 +00:00
Chris Lattner
dfba6f5029 add some assertions and fix problems where reassociate could access the
Ops vector out of range

llvm-svn: 23211
2005-09-02 05:23:22 +00:00
Chris Lattner
efc5937add Fix Regression/Transforms/Reassociate/2005-08-24-Crash.ll
llvm-svn: 23019
2005-08-24 17:55:32 +00:00
Chris Lattner
c6571e5c64 Use the new 'moveBefore' method to simplify some code. Really, which is
easier to understand?  :)

llvm-svn: 22706
2005-08-08 19:11:57 +00:00
Jeff Cohen
bd51ec7461 Eliminate all remaining tabs and trailing spaces.
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Chris Lattner
758f2fe1a3 Fix Reassociate/shifttest.ll
llvm-svn: 21839
2005-05-10 03:39:25 +00:00
Chris Lattner
d5a353a675 Implement Reassociate/mul-neg-add.ll
llvm-svn: 21788
2005-05-08 21:41:35 +00:00
Chris Lattner
f535f6e808 Bail out earlier
llvm-svn: 21786
2005-05-08 21:33:47 +00:00
Chris Lattner
39f74def7f Teach reassociate that 0-X === X*-1
llvm-svn: 21785
2005-05-08 21:28:52 +00:00
Chris Lattner
319ac8f822 Fix PR557 and basictest[34].ll.
This makes reassociate realize that loads should be treated as unmovable, and
gives distinct ranks to distinct values defined in the same basic block, allowing
reassociate to do its thing.

llvm-svn: 21783
2005-05-08 20:57:04 +00:00
Chris Lattner
b5de308c5f Add debugging information
llvm-svn: 21781
2005-05-08 20:09:57 +00:00
Chris Lattner
e74082156b eliminate gotos
llvm-svn: 21780
2005-05-08 19:48:43 +00:00
Chris Lattner
a9d5fdd4fd Improve reassociation handling of inverses, implementing inverses.ll.
llvm-svn: 21778
2005-05-08 18:59:37 +00:00
Chris Lattner
c2670a0da6 Refactor some code
llvm-svn: 21772
2005-05-08 00:19:31 +00:00
Chris Lattner
cd7caaa866 Handle some simple cases where we can see that values get annihilated.
llvm-svn: 21771
2005-05-08 00:08:33 +00:00
Chris Lattner
5662127ed6 Rewrite the guts of the reassociate pass to be more efficient and logical. Instead
of trying to do local reassociation tweaks at each level, only process an expression
tree once (at its root).  This does not improve the reassociation pass in any real way.

llvm-svn: 21768
2005-05-07 21:59:39 +00:00
Chris Lattner
3edf09a5eb Convert shifts to muls to assist reassociation. This implements
Reassociate/shifttest.ll

llvm-svn: 21761
2005-05-07 04:24:13 +00:00
Chris Lattner
b1ea71fbcd Simplify the code and rearrange it. No major functionality changes here.
llvm-svn: 21759
2005-05-07 04:08:02 +00:00
Misha Brukman
53e199440e Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Misha Brukman
2a80e53645 Fix #includes of i*.h => Instructions.h as per PR403.
llvm-svn: 15328
2004-07-29 17:05:13 +00:00
Chris Lattner
0f61d55197 Fixes working towards PR341
llvm-svn: 14839
2004-07-15 01:50:47 +00:00
Brian Gaeke
dbf4f13e85 Make this pass use a more specific debug message than "Processing:".
llvm-svn: 14541
2004-07-01 19:27:10 +00:00
Chris Lattner
d33cc684b5 Finegrainify namespacification
llvm-svn: 10725
2004-01-09 06:02:20 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Misha Brukman
acc53cc7c6 Declare FunctionPasses as such so that they can be used in FunctionPassManager.
llvm-svn: 9768
2003-11-07 17:20:18 +00:00
John Criswell
b402729b30 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.

llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
87843f87b8 Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.
llvm-svn: 9269
2003-10-19 21:34:28 +00:00
Chris Lattner
f2ed60c0b7 Decrease usage of use_size()
llvm-svn: 9135
2003-10-15 16:48:29 +00:00
Misha Brukman
db8303670b Credits now go into the top-level CREDITS.TXT
llvm-svn: 8662
2003-09-22 21:57:56 +00:00
Misha Brukman
56f7db4178 Spell `necessary' correctly.
llvm-svn: 7944
2003-08-18 14:43:39 +00:00
Chris Lattner
4e543f7021 Assign arguments different ranks so they get grouped together
llvm-svn: 7813
2003-08-13 16:16:26 +00:00
Chris Lattner
7105c4aad0 Fix bug: Reassociate/2003-08-12-InfiniteLoop.ll
llvm-svn: 7792
2003-08-12 21:45:24 +00:00
Chris Lattner
c8d2398084 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
686e94e760 DEBUG got moved to Support/Debug.h
llvm-svn: 7492
2003-08-01 22:15:03 +00:00
Chris Lattner
e006ca4580 Fix spelling
llvm-svn: 5983
2003-05-02 19:26:34 +00:00
Chris Lattner
db6b7ba364 Remove unnecesary &*'s
llvm-svn: 5872
2003-04-23 16:37:45 +00:00
Chris Lattner
497c0d443c Rename Instruction::hasSideEffects() -> mayWriteToMemory()
llvm-svn: 5620
2003-02-24 20:48:32 +00:00
Chris Lattner
61d594690a Fix a huge performance problem in reassociate by introducing a
rank map cache for instruction ranks

llvm-svn: 5030
2002-12-15 03:56:00 +00:00
Chris Lattner
18fe81719d Minor changes:
* Reword comment to make more clear
  * Don't print out BB's after modification made
  * Don't delete and new an instruction when we need to move something, just move it.

llvm-svn: 5029
2002-12-15 03:49:50 +00:00
Chris Lattner
b913f4e785 Fixes to the reassociate pass to make it respect dominance properties
Huge thanks go to Casey Carter for writing this fix, reassociate is now
reoperational!

llvm-svn: 4471
2002-10-31 17:12:59 +00:00
Chris Lattner
b565d3ac5b - Rename AnalysisUsage::preservesAll to getPreservesAll & preservesCFG to
setPreservesCFG to be less confusing.

llvm-svn: 4255
2002-10-21 20:00:28 +00:00
Chris Lattner
7cf9f6f4b1 Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
    * Broke constructor to take two const char * arguments instead of one, so
      that indendation can be taken care of automatically.
    * Sort the list by pass name when printing
    * Make sure to print all statistics as a group, instead of randomly when
      the statistics dtors are called.
    * Updated ProgrammersManual with new semantics.

llvm-svn: 4002
2002-10-01 22:38:41 +00:00
Chris Lattner
da9702a8a1 Simplify code (somtimes dramatically), by using the new "auto-insert" feature
of instruction constructors.

llvm-svn: 3656
2002-09-10 17:04:02 +00:00
Chris Lattner
7a9eb848cd * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
  are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses

llvm-svn: 3113
2002-07-26 21:12:46 +00:00
Chris Lattner
05fe67c0d2 *** empty log message ***
llvm-svn: 3075
2002-07-25 06:17:51 +00:00
Chris Lattner
c482880f9e *** empty log message ***
llvm-svn: 3016
2002-07-23 18:06:35 +00:00
Chris Lattner
dfd421a7df MEGAPATCH checkin.
For details, See: docs/2002-06-25-MegaPatchInfo.txt

llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner
1f2723a2c9 Use the new DEBUG(x) macro to allow debugging code to be enabled on the commandline
llvm-svn: 2713
2002-05-22 17:17:27 +00:00
Chris Lattner
a524df6d1d * Make debug output conditional on #define
* Add optimization to rank computation to not recursively search when
  unneccesary.
* More agressively negate expressions to open reassociation opportunities.
* Linearize (A+B)+(C+D) into ((A+B)+C)+D

llvm-svn: 2637
2002-05-16 04:37:07 +00:00
Chris Lattner
adba963886 Add support for printing out statistics information when -stats is added to
the command line

llvm-svn: 2601
2002-05-10 15:38:35 +00:00
Chris Lattner
9de1aeb91c Give the longer name to the instruction that will probably be eliminated later
llvm-svn: 2581
2002-05-09 20:11:23 +00:00
Chris Lattner
c38d2de2b5 Initial checkin of expression reassociation pass
llvm-svn: 2559
2002-05-08 22:19:27 +00:00