Commit Graph

7268 Commits

Author SHA1 Message Date
Chris Lattner
730b1ad2c4 Fix test/Regression/Analysis/BasicAA/2004-07-28-MustAliasbug.llx
This also fixes the miscompilation of MallocBench/gs with dead store
elimination enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15324 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 07:56:39 +00:00
Brian Gaeke
246b40ae7a Get rid of a few dead method declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15323 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 06:43:10 +00:00
Brian Gaeke
a308f80155 Get rid of calls to void llvm::printSet(const ValueSet &).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15322 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 06:43:09 +00:00
Brian Gaeke
db7c40db10 Get rid of calls to void llvm::printSet(const ValueSet &).
Use LiveRange's iterator types and operations instead of ValueSet's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15321 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 06:43:08 +00:00
Brian Gaeke
fb8f856f14 Don't derive from ValueSet to implement class LiveRange; instead, use a
SetVector<Value *> data member.
Add << operator for LiveRanges (a dumb one, for now.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15320 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 06:43:06 +00:00
Brian Gaeke
988f5b530a Fix a few typoes and grammaroes in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15319 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 04:25:43 +00:00
Brian Gaeke
fc63adb1b9 Remove mustSaveAcrossCalls flag, which isn't ever read, and its mutator,
markForSaveAcrossCalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15317 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-29 04:15:36 +00:00
Chris Lattner
83660c5aed Minor corrections
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15309 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 20:18:53 +00:00
Brian Gaeke
b2f30a3792 TargetInstrInfo::hasOperandInterlock() is always true, because it is
never overridden by any target.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15308 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:24:48 +00:00
Misha Brukman
8b88d906a2 Add notes on bug involving casting ulong -> double, thanks to Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15307 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:16:10 +00:00
Misha Brukman
a0af38c46a Simplify loading (un)signed constants to registers, patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15306 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:13:49 +00:00
Misha Brukman
b7697a6dd2 Remove an extra 8 byte distance penalty. Patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15305 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:13:07 +00:00
Misha Brukman
f63bc199c6 Find longs by type, not by their primitive size being 64. Patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15304 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 19:12:24 +00:00
Misha Brukman
8b29776d68 LI can only take signed values, so values > 32767 can only be loaded with ORI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15299 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 00:56:04 +00:00
Misha Brukman
b9b8ba58e7 Reorganize tests to place them in proper directories.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15298 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 00:55:12 +00:00
Misha Brukman
56d38c6ca1 UnitTests 2003-05-26-Shorts and 2003-07-09-LoadShorts have been fixed;
2003-05-22-VarSizeArray is broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15297 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 00:01:41 +00:00
Misha Brukman
af313fb188 Fix printing of immediate operands by looking at their operand types in
the TargetInstrInfo.  This fixes UnitTests 2003-05-26-Shorts and
2003-07-09-LoadShorts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15296 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-28 00:00:48 +00:00
Misha Brukman
8c02c1cbb8 Renamed files:
* PowerPCReg.td => PowerPCRegisterinfo.td
* PowerPCInstrs.td => PowerPCInstrInfo.td


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15295 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 23:29:16 +00:00
Brian Gaeke
de0ceb58ba ConstantTypeMustBeLoaded has been incorporated into SparcV9PreSelection, its
only user.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15294 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 21:43:38 +00:00
Brian Gaeke
a770e0041b This was the only user of TargetInstrInfo::ConstantTypeMustBeLoaded().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15293 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 21:11:20 +00:00
Robert Bocchino
71698285e8 This change fixed a bug in the function visitMul. The prior version
assumed that a constant on the RHS of a multiplication was either an
IntConstant or an FPConstant.  It checked for an IntConstant and then,
if it did not find one, did a hard cast to an FPConstant.  That code
would crash if the RHS were a ConstantExpr that was neither an
IntConstant nor an FPConstant.  This version replaces the hard cast
with a dyn_cast.  It performs the same way for IntConstants and
FPConstants but does nothing, instead of crashing, for constant
expressions.

The regression test for this change is 2004-07-27-ConstantExprMul.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15291 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 21:02:21 +00:00
Brian Gaeke
eb6c29bbfd Get rid of the (apparently non-working) filePrinterEmitter which is added in
debug mode.  Its only effect seems to be the creation of an empty file...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15289 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 19:37:37 +00:00
Misha Brukman
4ce5ce25e8 Branch selection support implemented by Nate Begeman for long branches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15288 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:43:04 +00:00
Misha Brukman
ab96790f2c Correctly print out long branches, assert on finding pseudo instr COND_BRANCH
Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15286 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:40:39 +00:00
Misha Brukman
bd2c870539 Run the branch selection pass right before the asm printer.
Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15285 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:39:34 +00:00
Misha Brukman
596c23134b Remove empty unused method processFunctionBeforeFrameFinalized()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15284 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:38:40 +00:00
Misha Brukman
f228fa0580 Add COND_BRANCH pseudo instruction, patch by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15283 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:35:54 +00:00
Misha Brukman
fa20a6dfd7 Build COND_BRANCHes which may become long or short, decided by a later pass.
Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15282 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:35:23 +00:00
Misha Brukman
8aebe9f96c Moved definition of invertPPCBranchOpcode() into PowerPCInstrInfo class.
Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15281 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:34:11 +00:00
Misha Brukman
999d9cfde5 Add PowerPCBranchSelector to discover which are `long' branches.
Contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15280 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 18:33:06 +00:00
Brian Gaeke
c998981505 TargetInstrInfo::getNOPOpCode() has been replaced by a reference to V9::NOP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15279 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:43:24 +00:00
Brian Gaeke
a376ee2d13 Convert many of the virtual TargetInstrInfo methods used as helper
functions in SparcV9InstrSelection and SparcV9PreSelection into regular
old global functions.  As it happens, none of them really have anything
to do with TargetInstrInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15278 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:43:23 +00:00
Brian Gaeke
1b4aeb5cec As it happens, none of these TargetInstrInfo methods which are only
used in the SparcV9 backend really have anything to do with
TargetInstrInfo, so we're converting them into regular old global
functions and moving their declarations to SparcV9InstrSelectionSupport.h.
(They're mostly used as helper functions for SparcV9InstrSelection.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15277 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:43:22 +00:00
Brian Gaeke
96d4bf7aee Make the create...() functions for some of these passes return a FunctionPass *.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15276 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:43:21 +00:00
Misha Brukman
c91bc30436 Fixed saving/restoring LR unconditionally, only done as necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15275 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:17:48 +00:00
Misha Brukman
9a771d55fe Save and restore LR just like any other register and ONLY if we actually modify
it (due to calls or globals access).  We now compile `void empty(){}' to `blr'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15274 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:17:18 +00:00
Misha Brukman
e862f306fb LR is a 32-bit int reg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15273 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:15:32 +00:00
Misha Brukman
53f567817c MovePCtoLR (which is `bl' in disguise) modifies LR implicitly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15272 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:15:05 +00:00
Misha Brukman
08cc7b30bb Register LR is callee-saved
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15271 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:14:34 +00:00
Misha Brukman
435c785803 Add IMPLICIT_DEF of LR for branch-and-link instrs (calls and global accesses)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15270 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 17:13:58 +00:00
Chris Lattner
b0015c510f nuke pointless -debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15267 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 08:03:18 +00:00
Chris Lattner
105d26acb4 Fix conservative assumption, which was quite broken. Also, notice that
functions known to not access memory (like sin/cos) don't access memory! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15264 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 07:46:26 +00:00
Chris Lattner
eaa243039b Fix hoisting of void typed values, e.g. calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15263 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 07:38:32 +00:00
Chris Lattner
70c7d03d1c alloca void makes no sense
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15262 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 07:30:02 +00:00
Chris Lattner
63e9930498 Remove a bogus assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15261 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 07:22:21 +00:00
Chris Lattner
fe98f27e80 Complete rewrite of this pass to be faster, use less memory, be easier to
understand, and more accurate to boot!  This implements
GlobalModRef/purecse.ll over the previous impl.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15260 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 06:40:37 +00:00
Chris Lattner
bcb11cf132 Simplify code and silence warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15255 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 02:34:49 +00:00
Chris Lattner
efe30ef790 Use context-sensitive alias analysis to avoid pessimization in clients of
AliasSetTracker (dse and licm).  This implements
DeadStoreElimination/context-sensitive.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15254 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 02:20:26 +00:00
Chris Lattner
db5b80a7f2 Make basicaa a bit more aggressive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15252 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 02:18:52 +00:00
Chris Lattner
e181b94309 basic-aa can actually provide simple mod/ref info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15251 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 02:13:55 +00:00
Chris Lattner
05e47987ee This was implemented back in march
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15250 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-27 01:59:42 +00:00
Misha Brukman
ab640a5728 Do not store the stack pointer if the stack size is 0.
Also, convert C-style comments to C++ and make sure code wraps at 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15245 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 22:00:26 +00:00
Misha Brukman
3ada3e3f82 ADDI can take several forms, including:
addi r1, r2, 0
  addi r1, <frame index #n>, 0

so we must check for the second parameter being a register for this instruction
to be considered a reg-to-reg copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15244 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:50:38 +00:00
Misha Brukman
8790d47453 assert() on MachineInstr properties instead of checking them dynamically
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15243 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:35:58 +00:00
Misha Brukman
774a297c83 * Recognize `addi r1, r2, 0' a move instruction
* List formats of instructions currently recognized as moves


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15242 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 21:29:00 +00:00
Misha Brukman
8606aea117 Fix indentation: should be 2 spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15240 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:48:58 +00:00
Misha Brukman
91b5ca838a Fix file header as it has been renamed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15239 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:45:48 +00:00
Misha Brukman
c6d398abbb Renamed files to have the `X86' prefix for uniqueness purposes.
All CVS history was renamed, the *,v were copied over.  No worries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15238 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:43:11 +00:00
Misha Brukman
b097f216b0 * Rewrote casts
* Implemented GEP folding
* Dynamically output global address stuff once per function
* Fix casting fp<->short/byte

Patch contributed by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15237 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 18:13:24 +00:00
Misha Brukman
cf8d244394 Increment the label number in runOnFunction() rather than while printing out
some instruction.  Patch by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15236 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:28:33 +00:00
Misha Brukman
bb966a4a59 More notes on bugs, unimplemented features, and suggested code improvements.
Written by Nate Begeman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15235 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:23:55 +00:00
Misha Brukman
3c616b45e7 Fix subtracting values > 2^15 in the prologue/epilogue, by Nate Begeman.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15234 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 16:22:52 +00:00
Chris Lattner
a000279a7d Implement DeadStoreElim/alloca.llx by observing that allocas are dead at the
end of the function (either return or unwind)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15232 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 06:14:11 +00:00
Chris Lattner
61d462760b Add some new methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15230 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 05:50:23 +00:00
Chris Lattner
595ee7ec26 Throttle back indvar substitution from creating multiplies in loops. This is bad bad bad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15227 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 02:47:12 +00:00
Chris Lattner
8d65a06a3e Fix bug in previous patch :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15226 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 01:40:20 +00:00
Chris Lattner
badf091b47 Fix an extremely serious regression that was causing LLVM basic blocks to be
scrambled around almost at random, having really bad effects on icache locality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15225 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-26 01:22:59 +00:00
Chris Lattner
1d78516c65 Fix a serious bug in the double constant reader. In particular, because
(At[3] << 24) is an int type and it is being coerced to uint64_t, it was
getting sign extended, causing us to get FFFFFFFFxxxxxxxx constants all of
the time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15224 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 23:15:44 +00:00
Chris Lattner
a9d790c831 Temporarily disable this code, as it is emitting LLVM_NAN("nan") which results in a call to the
glibc 'nan' function because the initializer is not a string.  This breaks when used in a global
initializer.  Try compiling this testcase for example:

%X = global float <some nan value>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15223 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 22:36:35 +00:00
Reid Spencer
cddc86f27c Avoid use of size(), which counts, in favor of other mechanisms.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15221 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:44:54 +00:00
Reid Spencer
ada1618afa Always write FP values correctly.
Adjust for new Module.h interface for dependent libraries.
Excise unused backwards compatibility flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15220 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:36:26 +00:00
Reid Spencer
7d146e1107 Don't create a backwards compatibility flag for something that was a
regression bug introduced in release 1.2


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15219 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:32:51 +00:00
Reid Spencer
5ac8812c54 Adjust to new Module.h interface for dependent libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15218 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:32:02 +00:00
Reid Spencer
feaf10e571 Adjust to new Module.h interface for dependent libraries
Remove mem leaks resulting from not freeing parse strings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15217 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:30:51 +00:00
Reid Spencer
c9a1f0dcdd Adjust to new Module.h interface for dependent libraries
Only write the target triple and deplibs if they are non-empty.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15216 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 21:29:43 +00:00
Chris Lattner
34a1005737 Fix a latent bug in the AliasSetTracker that was exposed by the FreeInst additions and broke a bunch of programs last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15214 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:32:01 +00:00
Reid Spencer
801db47373 bug 263:
Ensure the list of libraries is cleared.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15212 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:08:57 +00:00
Reid Spencer
83f6a77c8f bug 263:
Add ability to write target triple and dependent libraries information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15211 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:08:18 +00:00
Reid Spencer
ad89bd6a1a bug 263:
- encode/decode target triple and dependent libraries
bug 401:
- fix encoding/decoding of FP values to be little-endian only
bug 402:
- initial (compatible) cut at 24-bit types instead of 32-bit
- reduce size of block headers by 50%
Other:
- cleanup Writer by consolidating to one compilation unit, rem. other files
- use a std::vector instead of std::deque so the buffer can be allocated
  in multiples of 64KByte chunks rather than in multiples of some smaller
  (default) number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15210 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 18:07:36 +00:00
Reid Spencer
0be13e7f14 bug 263:
Provide parsing for the target triple and dependent libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15209 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:58:28 +00:00
Reid Spencer
3cd2fe3d2f bug 263:
Provide new tokens for target triples and dependent libraries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15208 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 17:56:00 +00:00
Chris Lattner
70e9b59b0e * Substantially simplify how free instructions are handled (potentially fixing
a bug in DSE).
* Delete dead operand uses iteratively instead of recursively, using a
  SetVector.
* Defer deletion of dead operand uses until the end of processing, which means
  we don't have to bother with updating the AliasSetTracker.  This speeds up
  DSE substantially.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15204 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 11:09:56 +00:00
Alkis Evlogimenos
5a0a1c2cba Add some comments to the backtracking code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15200 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 08:10:33 +00:00
Chris Lattner
a9e2f3d0ab Free instructions kill values too. This implements DeadStoreElim/free.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15199 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:58:38 +00:00
Chris Lattner
5c88260f70 Add support for free instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15197 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:57:37 +00:00
Chris Lattner
c25b55a5b2 Fix the sense of joinable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15196 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:47:25 +00:00
Chris Lattner
d67e439241 Remove linux/solaris specific stuff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15195 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:34:00 +00:00
Chris Lattner
f542649f1b This patch makes use of the infrastructure implemented before to safely and
aggressively coallesce live ranges even if they overlap.  Consider this LLVM
code for example:

int %test(int %X) {
        %Y = mul int %X, 1      ;; Codegens to Y = X
        %Z = add int %X, %Y
        ret int %Z
}

The mul is just there to get a copy into the code stream.  This produces
this machine code:

 (0x869e5a8, LLVM BB @0x869b9a0):
        %reg1024 = mov <fi#-2>, 1, %NOREG, 0    ;; "X"
        %reg1025 = mov %reg1024                 ;; "Y"  (subsumed by X)
        %reg1026 = add %reg1024, %reg1025
        %EAX = mov %reg1026
        ret

Note that the life times of reg1024 and reg1025 overlap, even though they
contain the same value.  This results in this machine code:

test:
        mov %EAX, DWORD PTR [%ESP + 4]
        mov %ECX, %EAX
        add %EAX, %ECX
        ret

Another, worse case involves loops and PHI nodes.  Consider this trivial loop:
testcase:

int %test2(int %X) {
entry:
        br label %Loop
Loop:
        %Y = phi int [%X, %entry], [%Z, %Loop]
        %Z = add int %Y, 1
        %cond = seteq int %Z, 100
        br bool %cond, label %Out, label %Loop
Out:
        ret int %Z
}

Because of interactions between the PHI elimination pass and the register
allocator, this got compiled to this code:

test2:
        mov %ECX, DWORD PTR [%ESP + 4]
.LBBtest2_1:
***     mov %EAX, %ECX
        inc %EAX
        cmp %EAX, 100
***     mov %ECX, %EAX
        jne .LBBtest2_1

        ret

Or on powerpc, this code:

_test2:
        mflr r0
        stw r0, 8(r1)
        stwu r1, -60(r1)
.LBB_test2_1:
        addi r2, r3, 1
        cmpwi cr0, r2, 100
***     or r3, r2, r2
        bne cr0, .LBB_test2_1

***     or r3, r2, r2
        lwz r0, 68(r1)
        mtlr r0
        addi r1, r1, 60
        blr 0



With this improvement in place, we now generate this code for these two
testcases, which is what we want:


test:
        mov %EAX, DWORD PTR [%ESP + 4]
        add %EAX, %EAX
        ret

test2:
        mov %EAX, DWORD PTR [%ESP + 4]
.LBBtest2_1:
        inc %EAX
        cmp %EAX, 100
        jne .LBBtest2_1 # Loop
        ret

Or on PPC:

_test2:
        mflr r0
        stw r0, 8(r1)
        stwu r1, -60(r1)
.LBB_test2_1:
        addi r3, r3, 1
        cmpwi cr0, r3, 100
        bne cr0, .LBB_test2_1

        lwz r0, 68(r1)
        mtlr r0
        addi r1, r1, 60
        blr 0


Static numbers for spill code loads/stores/reg-reg copies (smaller is better):

em3d:       before: 47/25/26         after: 44/22/24
164.gzip:   before: 433/245/310      after: 403/231/278
175.vpr:    before: 3721/2189/1581   after: 4144/2081/1423
176.gcc:    before: 26195/8866/9235  after: 25942/8082/8275
186.crafty: before: 4295/2587/3079   after: 4119/2519/2916
252.eon:    before: 12754/7585/5803  after: 12508/7425/5643
256.bzip2:  before: 463/226/315      after: 482:241/309


Runtime perf number samples on X86:

gzip: before: 41.09 after: 39.86
bzip2: runtime: before: 56.71s after: 57.07s
gcc: before: 6.16 after: 6.12
eon: before: 2.03s after: 2.00s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15194 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 07:11:19 +00:00
Chris Lattner
d3a205eab5 Make a method const, no functionality changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15193 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 06:23:01 +00:00
Chris Lattner
1d6dc97463 I think that V8 should coallesce registers, don't you?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15192 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 06:19:04 +00:00
Alkis Evlogimenos
89756ea109 Use name.empty() instead of testing against equality with the empty
string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15191 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 06:16:52 +00:00
Alkis Evlogimenos
83949fcf7c Disallow creation of named values of type void.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15190 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 06:07:15 +00:00
Chris Lattner
62d4e16a05 Fix a bug where we incorrectly value numbered the first PHI definition the
same as the PHI use.  This is not correct as the PHI use value is different
depending on which branch is taken.  This fixes espresso with aggressive
coallescing, and perhaps others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15189 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 05:45:18 +00:00
Chris Lattner
6925a9f9cc Fix a bug in the range remover
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15188 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 05:43:53 +00:00
Chris Lattner
c83e40d1b6 Add debugging output for joining assignments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15187 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-25 03:24:11 +00:00
Alkis Evlogimenos
3f86193cd2 Remove implementation of operator= and make it private so that it is
not used accidentally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15172 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 18:55:15 +00:00
Alkis Evlogimenos
a1613db62f Change std::map<unsigned, LiveInterval*> into a std::map<unsigned,
LiveInterval>. This saves some space and removes the pointer
indirection caused by following the pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15167 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 11:44:15 +00:00
Chris Lattner
c47b6677ae obvious fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15162 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 07:51:27 +00:00
Chris Lattner
21ddf17ff6 Get rid of the printout from the low-level system interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15161 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 07:50:48 +00:00
Chris Lattner
e96b2ed211 Pass timeouts into the low level "execute program with timeout" function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15160 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-24 07:49:11 +00:00