1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

5513 Commits

Author SHA1 Message Date
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
Alkis Evlogimenos
168e4bf455 Fix crash in debug output.
llvm-svn: 11659
2004-02-20 06:41:12 +00:00
Brian Gaeke
688940d763 Use backtrace() and include execinfo.h, if they were detected by autoconf.
llvm-svn: 11658
2004-02-20 06:40:59 +00:00
Alkis Evlogimenos
16744f2860 Fix instruction numbering in debug output.
llvm-svn: 11655
2004-02-20 06:29:51 +00:00
Alkis Evlogimenos
f32239a5c6 Too many changes in one commit:
1. LiveIntervals now implement a 4 slot per instruction model. Load,
   Use, Def and a Store slot. This is required in order to correctly
   represent caller saved register clobbering on function calls,
   register reuse in the same instruction (def resues last use) and
   also spill code added later by the allocator. The previous
   representation (2 slots per instruction) was insufficient and as a
   result was causing subtle bugs.

2. Fixes in spill code generation. This was the major cause of
   failures in the test suite.

3. Linear scan now has core support for folding memory operands. This
   is untested and not enabled (the live interval update function does
   not attempt to fold loads/stores in instructions).

4. Lots of improvements in the debugging output of both live intervals
   and linear scan. Give it a try... it is beautiful :-)

In summary the above fixes all the issues with the recent reserved
register elimination changes and get the allocator very close to the
next big step: folding memory operands.

llvm-svn: 11654
2004-02-20 06:15:40 +00:00
Chris Lattner
b24f30de8d It is totally unacceptable to print out (literally) millions of zeros when
compiling 129.compress... so don't!

llvm-svn: 11649
2004-02-20 05:49:22 +00:00
Chris Lattner
0d3df27b4c Disable the stack trace thing until we can get an autoconf test for it. This
call breaks on sparcs

llvm-svn: 11635
2004-02-19 21:21:23 +00:00
Chris Lattner
6deffd7154 Implement new function
llvm-svn: 11631
2004-02-19 20:03:14 +00:00