Commit Graph

18446 Commits

Author SHA1 Message Date
Devang Patel
7cc6dcf6e0 Fix
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047971.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36236 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 00:53:01 +00:00
Evan Cheng
3fefc182a0 Increment use count of new virtuals created during PHI elimination.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36233 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-18 00:36:11 +00:00
Chris Lattner
b1b2f0bc44 Be more careful when inserting reused instructions. This fixes CodeGen/Generic/2007-04-17-lsr-crash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36231 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 23:43:50 +00:00
Evan Cheng
7be6368cac Oops. Didn't mean to check in a quick hack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36227 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 23:33:39 +00:00
Chris Lattner
8c7d2d56bf Fix a bug in my previous patch, grabbing the shift amount width from the
wrong operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36223 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 22:53:02 +00:00
Chris Lattner
120fba91a3 dag combiner just got better at pruning bits. This fixes CodeGen/ARM/rev.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36222 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 22:39:58 +00:00
Chris Lattner
895c4ab564 Fold (x << c1)>> c2 into a single shift if the bits shifted out aren't used.
This compiles:
int baz(long long a) { return (short)(((int)(a >>24)) >> 9); }

into:
_baz:
        srwi r2, r3, 1
        extsh r3, r2
        blr

on PPC, instead of:
_baz:
        slwi r2, r3, 8
        srwi r2, r2, 9
        extsh r3, r2
        blr

GCC produces:
_baz:
        srwi r10,r4,24
        insrwi r10,r3,24,0
        srawi r9,r3,24
        srawi r3,r10,9
        extsh r3,r3
        blr

This implements CodeGen/PowerPC/shl_elim.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36221 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 21:14:16 +00:00
Evan Cheng
20b0abc24f Copy coalescing change to prevent a physical register from being pin to a
long live interval that has low usage density.
1. Change order of coalescing to join physical registers with virtual
   registers first before virtual register intervals become too long.
2. Check size and usage density to determine if it's worthwhile to join.
3. If joining is aborted, assign virtual register live interval allocation
   preference field to the physical register.
4. Register allocator should try to allocate to the preferred register
   first (if available) to create identify moves that can be eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 20:32:26 +00:00
Evan Cheng
e52eef8e9a Add a register allocation preference field; add a method to compute size of a live interval.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36216 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 20:25:11 +00:00
Evan Cheng
eff03db46d Change getAllocatableSet() so it returns allocatable registers for a specific register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36215 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 20:23:34 +00:00
Evan Cheng
38b7ca6651 Keep track of number of uses within the function per virtual register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36214 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 20:22:11 +00:00
Anton Korobeynikov
e060b5385f Add comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36213 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 19:34:00 +00:00
Chris Lattner
95a5e0507e SIGN_EXTEND_INREG does not demand its top bits. Give SimplifyDemandedBits
a chance to hack on it.  This compiles:

int baz(long long a) { return (short)(((int)(a >>24)) >> 9); }

into:
_baz:
        slwi r2, r3, 8
        srwi r2, r2, 9
        extsh r3, r2
        blr

instead of:

_baz:
        srwi r2, r4, 24
        rlwimi r2, r3, 8, 0, 23
        srwi r2, r2, 9
        extsh r3, r2
        blr

This implements CodeGen/PowerPC/sign_ext_inreg1.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36212 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 19:03:21 +00:00
Dan Gohman
747603e39e Spell doFinalization right, so that it is a proper virtual override and
gets called.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 18:21:36 +00:00
Chris Lattner
261cdfbe5e remove use of BasicBlock::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36205 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 18:09:47 +00:00
Chris Lattner
3c30d10b04 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36203 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 18:03:00 +00:00
Chris Lattner
e24c92a698 remove use of BasicBlock::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36202 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:54:12 +00:00
Chris Lattner
8e8f865227 Remove use of Instruction::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36201 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:52:45 +00:00
Chris Lattner
a0e1b0e98d eliminate use of Instruction::getNext()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36200 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:51:03 +00:00
Chris Lattner
decb0ca18b remove use of Instruction::getNext
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36199 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:47:54 +00:00
Chris Lattner
b8e237bb86 eliminate use of Instruction::getPrev(). Patch by Gabor Greif in 2005.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36198 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:38:28 +00:00
Chris Lattner
4d8c16f15a eliminate a use of Instruction::getPrev(), patch by Gabor Greif in 2005.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36197 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:36:12 +00:00
Chris Lattner
d15dff24c6 rename X86FunctionInfo to X86MachineFunctionInfo to match the header file
it is defined in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36196 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 17:21:52 +00:00
Anton Korobeynikov
57fc00d5cf Implemented correct stack probing on mingw/cygwin for dynamic alloca's.
Also, fixed static case in presence of eax livin. This fixes PR331

PS: Why don't we still have push/pop instructions? :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36195 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 09:20:00 +00:00
Chris Lattner
18feb92e91 merge several fields in GlobalValue to use the same word, move CallingConv
field into SubclassData in Value.  This shrinks GlobalVAlue from 48->40
bytes, Function from 88->76, and GlobalVariable from 76->68.  This trims
4640 bytes off my testcase, reading a bc file without materializing any
functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36192 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 04:31:29 +00:00
Andrew Lenharth
15b7823006 Use this nifty Constraints thing and fix the inverted conditional moves
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36191 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 04:07:59 +00:00
Chris Lattner
f8dfef7437 The (negative) offset from a SymbolTableListTraits-using ilist to its container
object is always constant.  As such, evaluate it at compile time instead of storing
it as an ivar in SymbolTableListTraits.  This shrinks every SymbolTableListTraits
ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes,
and Module from 60->52 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36189 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 04:04:14 +00:00
Chris Lattner
17fcdd5e1b Refactor SymbolTableListTraits to only have a single pointer in it, instead
of two.  This shrinkifies Function by 8 bytes (104->96) and Module by 8
bytes (68->60).  On a testcase of mine, this reduces the memory used to
read a module header from 565680b to 561024, a little over 4K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36188 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 03:26:42 +00:00
Chris Lattner
56ecbf3013 SSE4 is apparently public now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36185 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-17 00:02:37 +00:00
Reid Spencer
e8501ab492 Make long line fit in 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36183 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 23:32:28 +00:00
Devang Patel
ac58516cdc Fix
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070416/047888.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 23:03:45 +00:00
Reid Spencer
9a9203b894 Fix problems in the PartSet lowering having to do with incorrect bit width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36180 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 22:21:14 +00:00
Reid Spencer
ed48de2375 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36179 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 22:02:23 +00:00
Reid Spencer
ce1e8efc43 Okay, yes there *is* a getKeyLength method on ValueName. And, it should be
used because we *do* want to allow nulls in names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36178 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 22:01:57 +00:00
Jeff Cohen
c398709525 In the event that some really old non-Intel or -AMD CPU is encountered...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36177 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 21:59:44 +00:00
Reid Spencer
4ccf462b99 Implement @sext and @zext parameter attribute handling properly instead of
forcing every small argument of every function regardless of attributes or
calling convention to be expanded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36174 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 21:50:40 +00:00
Jeff Cohen
22114c319a Before assuming that the original code didn't work for Athlon64, the person who
replaced it with a FIXME should have determined what did work.  Then he would have
realized that the code was in fact correct, and would have avoided breaking it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36173 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 21:48:58 +00:00
Devang Patel
6b1df0e863 Proivde getAnalysis<FPAnalysis>(Func) support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36159 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:56:24 +00:00
Devang Patel
f4bd76a035 Do not assert during analysis implementation initialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36158 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:44:16 +00:00
Devang Patel
693941bb6e Print and delete on the fly pass managers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36157 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:39:59 +00:00
Reid Spencer
36fdde18c3 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36156 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:35:38 +00:00
Reid Spencer
43e607303b Check length of string before we walk off the end of it.
Thanks, Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36155 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:31:06 +00:00
Devang Patel
0ed8df38c2 Update module pass manager to support module passes that require
function passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36154 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:27:05 +00:00
Devang Patel
569a6fd9d5 Give each pass manager chance to manage lower level analysis pass, which is
pass required by one of pass managed by the manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36153 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 20:12:57 +00:00
Anton Korobeynikov
bed2946a96 Removed tabs everywhere except autogenerated & external files. Add make
target for tabs checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36146 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 18:10:23 +00:00
Reid Spencer
2eb203a1a9 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36144 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 17:47:06 +00:00
Reid Spencer
5b35fbe6b9 Use a more optimal way to get the name of a function. Thanks, Chris.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36143 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 17:45:50 +00:00
Reid Spencer
9c15de11f1 Don't return 0 if the len == 5, let the assert handle that case.
Thanks, Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36139 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 16:56:54 +00:00
Reid Spencer
2b85c4595e For PR1336:
Subtarget option names must be given in lower case in order to be
recognized. Fixes test/CodeGen/Alpha/ctlz.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 14:06:19 +00:00
Reid Spencer
085659f040 Fix test/CodeGen/Generic/vector-constantexpr.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36123 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-16 07:08:44 +00:00