Commit Graph

10677 Commits

Author SHA1 Message Date
Chris Lattner
2d0a82570a Add a new cmove instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11722 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-23 01:16:05 +00:00
Alkis Evlogimenos
98e17cf543 Move LiveIntervals.h up to be the first included header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11721 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-23 01:01:21 +00:00
Alkis Evlogimenos
888b1a6ccd Pull PhysRegTracker out of RegAllocLinearScan as it can be used by other allocators as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11720 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-23 00:53:31 +00:00
Alkis Evlogimenos
a2f6a408dc Move LiveIntervals.h to lib/CodeGen since it shouldn't be exposed to other parts of the compiler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11719 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-23 00:50:15 +00:00
Chris Lattner
986618ebc7 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 :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11717 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 19:47:26 +00:00
Chris Lattner
d0d1c8f830 Another bug fix for empty MBB's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11716 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 19:37:31 +00:00
Alkis Evlogimenos
890f92328d 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11715 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 19:23:26 +00:00
Chris Lattner
688c8252d2 Fix a bug where we were implicitly assuming that there would be at least
one terminator instruction in each basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11714 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 19:08:15 +00:00
Chris Lattner
7ca04097ad Reduce the number of pointless copies inserted due to constant pointer refs.
Also, make an assertion actually fireable!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11713 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 17:35:42 +00:00
Chris Lattner
827832c705 Fix bug in previous checkout: leave the iterator at the first instruction
AFTER the GEP that was emitted.  :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11712 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 17:05:38 +00:00
Alkis Evlogimenos
e33da36cbd Fix silly bug in implementation of getUseType(). Thanks Misha.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11711 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 07:24:19 +00:00
Chris Lattner
3f1e8e7ceb 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11710 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 07:04:00 +00:00
Alkis Evlogimenos
f216421181 When folding memory operands in machine instructions be careful to
leave register operands with the same use/def flags as the original
instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11709 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 06:54:26 +00:00
Chris Lattner
2425f8c629 Significantly simplify gep_type_iterator, and make its interface more general/powerful
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11708 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 06:27:03 +00:00
Chris Lattner
e735b2de30 Fix a soon-to-be-missing #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11707 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 06:26:17 +00:00
Chris Lattner
b228f9c86b Get all instruction definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11706 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 06:25:38 +00:00
Chris Lattner
14c6ef7ca1 Wow this is out of date. When we have _real_ code generator documentation,
this should be folded into it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11705 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 05:53:54 +00:00
Alkis Evlogimenos
0f338a1e8c Print basic block boundaries in machine instruction debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11704 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 05:46:04 +00:00
Chris Lattner
8b1dc16444 Link to most recent "LLVM document"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11703 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 05:45:02 +00:00
Chris Lattner
c6bd195336 Implement Transforms/InstCombine/cast.ll:test13, a case which occurs in a
hot 164.gzip loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11702 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 05:25:17 +00:00
Chris Lattner
0ca4418b95 Test that the instruction combiner can fold away a cast in a GEP instruction.
This occurs in 164.gzip, as a result of it declaring arrays extern.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11701 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 05:24:09 +00:00
Chris Lattner
6d2fdcfb8a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11700 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 04:44:58 +00:00
Alkis Evlogimenos
7200c6b82a Abstract merging of ranges away from number of slots per instruction.
Also make it less aggressive as the current implementation breaks in
some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11696 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 04:05:13 +00:00
Chris Lattner
0ad9170327 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11695 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-22 00:53:54 +00:00
Chris Lattner
d85645f526 Fix an iterator invalidation problem which was causing some nodes to not be
correctly merged over!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11693 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 22:28:26 +00:00
Chris Lattner
5171115cf3 Use handy method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11692 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 22:27:31 +00:00
Chris Lattner
9c0b9bf2b5 Update comments and add warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11691 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 22:27:20 +00:00
Misha Brukman
ac2ecd0ba0 `cat' is usually in /bin, not /usr/bin, at least on our systems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11690 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 21:51:41 +00:00
Chris Lattner
b9632bee7c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11689 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 21:06:19 +00:00
Alkis Evlogimenos
d6f6d1a80d Make 'fold' statistic's description the same in both allocators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11687 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 18:07:33 +00:00
Chris Lattner
3567937f16 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11686 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-21 00:30:28 +00:00
Chris Lattner
d10b5fd395 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11684 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 23:52:15 +00:00
Chris Lattner
4e46e320a5 Add two missing returns, which caused us to be very pessimistic about the
printf and scanf families!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11683 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 23:27:09 +00:00
Chris Lattner
01533ff652 new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11682 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 23:05:43 +00:00
John Criswell
b9a131e8a6 Added the POVRAY_ROOT to locate Povray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11681 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 22:30:46 +00:00
John Criswell
0538d4223b Added an option for configuring Povray. By default, it should find my local
installation of Povray (and not do anything for people who don't have it).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11680 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 22:30:22 +00:00
John Criswell
c224efb7a6 Build an archive for use with Povray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11678 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 21:26:46 +00:00
Alkis Evlogimenos
007726ca6f Some more statistics improvements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11676 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 20:53:26 +00:00
Alkis Evlogimenos
df158c7e3f Disambiguate statistic descriptions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11675 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 20:46:49 +00:00
Alkis Evlogimenos
cea4471120 Rename statistic and add another one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11674 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 20:43:08 +00:00
Chris Lattner
8ecc27e667 Add support for some string functions, the scanf family, and sprintf
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11673 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 20:27:11 +00:00
Chris Lattner
3da125839d Add a simple implementation of strncpy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11672 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 20:15:47 +00:00
Chris Lattner
54e4e20286 New testcase, do not emit a call to __builtin_sqrt, emit a call to sqrt instead!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11668 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 19:08:12 +00:00
Chris Lattner
9832874504 Bug fixed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11662 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 17:41:35 +00:00
Chris Lattner
9d7c585982 PR244: [llvm-gcc] miscompilation when a function is re-declared as static
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11661 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 17:32:24 +00:00
Brian Gaeke
22f7646d5e Add checks for <execinfo.h> and backtrace().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11660 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 06:41:59 +00:00
Alkis Evlogimenos
fa510c4af5 Fix crash in debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11659 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 06:41:12 +00:00
Brian Gaeke
38ce7e57d4 Use backtrace() and include execinfo.h, if they were detected by autoconf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11658 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 06:40:59 +00:00
Brian Gaeke
0c80389498 Regenerated using autoheader-2.57.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11657 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 06:40:58 +00:00
Brian Gaeke
f5261471ca Regenerated using autoconf-2.57.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11656 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-20 06:40:57 +00:00