Chris Lattner
1bf9dde4a1
Finegrainify namespacification
...
llvm-svn: 11757
2004-02-23 18:38:20 +00:00
Alkis Evlogimenos
82a1d7d30e
Use MachineBasicBlock::getParent().
...
llvm-svn: 11756
2004-02-23 18:36:38 +00:00
Alkis Evlogimenos
2863fbd178
Remove implementation of default constructor as it is useless now.
...
llvm-svn: 11755
2004-02-23 18:28:35 +00:00
Alkis Evlogimenos
9b103024ef
Refactor rewinding code for finding the first terminator of a basic
...
block into MachineBasicBlock::getFirstTerminator().
This also fixes a bug in the implementation of the above in both
RegAllocLocal and InstrSched, where instructions where added after the
terminator if the basic block's only instruction was a terminator (it
shouldn't matter for RegAllocLocal since this case never occurs in
practice).
llvm-svn: 11748
2004-02-23 18:14:48 +00:00
Chris Lattner
40e15a6000
Simplify code a bit, don't go off the end of the block, now that the current
...
block we are in might be empty
llvm-svn: 11744
2004-02-23 07:42:19 +00:00
Chris Lattner
28e4e925eb
We were forgetting to add FP_REG_KILL instructions to basic blocks which will
...
eventually get an assignment due to elimination of PHIs.
llvm-svn: 11743
2004-02-23 07:29:45 +00:00
Chris Lattner
74418a30aa
Implement cast.ll::test14/15
...
llvm-svn: 11742
2004-02-23 07:16:20 +00:00
Chris Lattner
a65e5e3df1
Refactor some code. In the mul - setcc folding case, we really care about
...
whether this is the sign bit or not, so check unsigned comparisons as well.
llvm-svn: 11740
2004-02-23 06:38:22 +00:00
Alkis Evlogimenos
50598d1135
Improved PhysRegTracker interface. RegAlloc lazily allocates the register tracker using a std::auto_ptr
...
llvm-svn: 11738
2004-02-23 06:10:13 +00:00
Chris Lattner
9ecc3fc3c1
Implement mul.ll:test11
...
llvm-svn: 11737
2004-02-23 06:00:11 +00:00
Chris Lattner
51b37305d9
Implement "strength reduction" of X <= C and X >= C
...
llvm-svn: 11735
2004-02-23 05:47:48 +00:00
Chris Lattner
c31a2e26ab
Implement InstCombine/mul.ll:test10, which is a case that occurs when dealing
...
with "predication"
llvm-svn: 11734
2004-02-23 05:39:21 +00:00
Alkis Evlogimenos
99af6ca36b
Simplify iterator usage now that we have next(). Also don't pass iterators by reference now that MachineInstr* are in an ilist
...
llvm-svn: 11732
2004-02-23 04:12:30 +00:00
Chris Lattner
b200638dc4
Work around a gas bug. Print '-9223372036854775808' as unsigned.
...
llvm-svn: 11729
2004-02-23 03:27:05 +00:00
Chris Lattner
85f13fae06
Implement cast fp -> bool
...
llvm-svn: 11728
2004-02-23 03:21:41 +00:00
Chris Lattner
795ca35cde
Stop passing iterators around by reference now that we have ilists!
...
Implement cast Type::ULongTy -> double
llvm-svn: 11726
2004-02-23 03:10:10 +00:00
Alkis Evlogimenos
976f485826
Some code cleanups from Chris
...
llvm-svn: 11724
2004-02-23 01:57:39 +00:00
Alkis Evlogimenos
1525e120a6
Fix comments in PhysRegTracker and rename isPhysRegAvail to isRegAvail to be consistent with the other two
...
llvm-svn: 11723
2004-02-23 01:25:05 +00:00
Chris Lattner
f9acb33dfd
Add a new cmove instruction
...
llvm-svn: 11722
2004-02-23 01:16:05 +00:00
Alkis Evlogimenos
ee3ef42726
Move LiveIntervals.h up to be the first included header
...
llvm-svn: 11721
2004-02-23 01:01:21 +00:00
Alkis Evlogimenos
ba2b9aec71
Pull PhysRegTracker out of RegAllocLinearScan as it can be used by other allocators as well
...
llvm-svn: 11720
2004-02-23 00:53:31 +00:00
Alkis Evlogimenos
850bd0819f
Move LiveIntervals.h to lib/CodeGen since it shouldn't be exposed to other parts of the compiler
...
llvm-svn: 11719
2004-02-23 00:50:15 +00:00
Chris Lattner
cf8db3e8aa
Only insert FP_REG_KILL instructions in MachineBasicBlocks that actually
...
use FP instructions. This reduces the number of instructions inserted in
176.gcc (for example) from 58074 to 101 (it doesn't use much FP, which
is typical). This reduction speeds up the entire code generator. In the
case of 176.gcc, llc went from taking 31.38s to 24.78s. The passes that
sped up the most are the register allocator and the 2 live variable analysis
passes, which sped up 2.3, 1.3, and 1.5s respectively. The asmprinter
pass also sped up because it doesn't print the instructions in comments :)
Note that this patch is likely to expose latent bugs in machine code passes,
because now basicblock can be empty, where they were never empty before. I
cleaned out regalloclocal, but who knows about linscan :)
llvm-svn: 11717
2004-02-22 19:47:26 +00:00
Chris Lattner
5485375e5d
Another bug fix for empty MBB's
...
llvm-svn: 11716
2004-02-22 19:37:31 +00:00
Alkis Evlogimenos
7f7d70a53c
Move MOTy::UseType enum into MachineOperand. This eliminates the
...
switch statements in the constructors and simplifies the
implementation of the getUseType() member function. You will have to
specify defs using MachineOperand::Def instead of MOTy::Def though
(similarly for Use and UseAndDef).
llvm-svn: 11715
2004-02-22 19:23:26 +00:00
Chris Lattner
56a7886c8a
Fix a bug where we were implicitly assuming that there would be at least
...
one terminator instruction in each basic block.
llvm-svn: 11714
2004-02-22 19:08:15 +00:00
Chris Lattner
cc9a188e0a
Reduce the number of pointless copies inserted due to constant pointer refs.
...
Also, make an assertion actually fireable!
llvm-svn: 11713
2004-02-22 17:35:42 +00:00
Chris Lattner
ed03319931
Fix bug in previous checkout: leave the iterator at the first instruction
...
AFTER the GEP that was emitted. :(
llvm-svn: 11712
2004-02-22 17:05:38 +00:00
Chris Lattner
ade64c9839
Completely rewrite how getelementptr instructions are expanded. This has two
...
(minor) benefits right now:
1. An extra dummy MOVrr32 is gone. This move would often be coallesced by
both allocators anyway.
2. The code now uses the gep_type_iterator to walk the gep, which should future
proof it a bit. It still assumes that array indexes are Longs though.
These don't really justify rewriting the code. The big benefit will come later
though.
llvm-svn: 11710
2004-02-22 07:04:00 +00:00
Alkis Evlogimenos
6998610eda
When folding memory operands in machine instructions be careful to
...
leave register operands with the same use/def flags as the original
instruction.
llvm-svn: 11709
2004-02-22 06:54:26 +00:00
Chris Lattner
63b79422f3
Fix a soon-to-be-missing #include
...
llvm-svn: 11707
2004-02-22 06:26:17 +00:00
Chris Lattner
727748b382
Get all instruction definitions
...
llvm-svn: 11706
2004-02-22 06:25:38 +00:00
Chris Lattner
3392d316e9
Wow this is out of date. When we have _real_ code generator documentation,
...
this should be folded into it.
llvm-svn: 11705
2004-02-22 05:53:54 +00:00
Alkis Evlogimenos
ba33a0ab9b
Print basic block boundaries in machine instruction debug output.
...
llvm-svn: 11704
2004-02-22 05:46:04 +00:00
Chris Lattner
69bb1545d1
Implement Transforms/InstCombine/cast.ll:test13, a case which occurs in a
...
hot 164.gzip loop.
llvm-svn: 11702
2004-02-22 05:25:17 +00:00
Chris Lattner
cf8afa52b8
The two address pass cannot handle two addr instructions where one incoming
...
value is a physreg and one is a virtreg. For this reason, disable copy folding
entirely for physregs. Also, use the new isMoveInstr target hook which gives us
folding of FP moves as well.
llvm-svn: 11700
2004-02-22 04:44:58 +00:00
Alkis Evlogimenos
32d12d31ae
Abstract merging of ranges away from number of slots per instruction.
...
Also make it less aggressive as the current implementation breaks in
some cases.
llvm-svn: 11696
2004-02-22 04:05:13 +00:00
Chris Lattner
573441bfbd
Use isNull instead of getNode() to test for existence of a node, this is cheaper.
...
FIX MAJOR BUG, whereby we didn't merge null edges correctly. Correcting this
fixes poolallocation on 175.vpr, and possibly others.
llvm-svn: 11695
2004-02-22 00:53:54 +00:00
Chris Lattner
7bff00313e
Fix an iterator invalidation problem which was causing some nodes to not be
...
correctly merged over!
llvm-svn: 11693
2004-02-21 22:28:26 +00:00
Chris Lattner
458704f675
Use handy method
...
llvm-svn: 11692
2004-02-21 22:27:31 +00:00
Misha Brukman
642275dc4e
`cat' is usually in /bin, not /usr/bin, at least on our systems.
...
llvm-svn: 11690
2004-02-21 21:51:41 +00:00
Chris Lattner
7448a9867b
When printing a stack trace, demangle it if possible. Since we are potentially
...
in a signal handler, allocating memory or doing other unsafe things is bad,
which means we should do it in a different process.
llvm-svn: 11689
2004-02-21 21:06:19 +00:00
Alkis Evlogimenos
e39c21cc93
Make 'fold' statistic's description the same in both allocators.
...
llvm-svn: 11687
2004-02-21 18:07:33 +00:00
Chris Lattner
dacc6a7448
Instead of cloning the globals for main into the globals graph at the end of
...
BU propagation, clone the globals into the GG of EACH FUNCTION that finishes
processing! The GlobalsGraph *must* include all globals and effects from
all functions in the program. Fixing this makes pool allocation work better
on 175.vpr, but it still ultimately crashes.
llvm-svn: 11686
2004-02-21 00:30:28 +00:00
Chris Lattner
0f9200e5a5
There is no need to merge the globals graph into the function graphs at the
...
end of the BU and CBU passes. The globals will be marked incomplete, so it
doesn't matter if they are missing some info, and merging isn't guaranteed
to bring everything in anyway!
llvm-svn: 11684
2004-02-20 23:52:15 +00:00
Chris Lattner
31f8fa66cb
Add two missing returns, which caused us to be very pessimistic about the
...
printf and scanf families!
llvm-svn: 11683
2004-02-20 23:27:09 +00:00
Alkis Evlogimenos
43431e117e
Some more statistics improvements.
...
llvm-svn: 11676
2004-02-20 20:53:26 +00:00
Alkis Evlogimenos
6d57ed784f
Disambiguate statistic descriptions.
...
llvm-svn: 11675
2004-02-20 20:46:49 +00:00
Alkis Evlogimenos
70f547d06e
Rename statistic and add another one.
...
llvm-svn: 11674
2004-02-20 20:43:08 +00:00
Chris Lattner
4653c4cb50
Add support for some string functions, the scanf family, and sprintf
...
llvm-svn: 11673
2004-02-20 20:27:11 +00:00