Commit Graph

13096 Commits

Author SHA1 Message Date
Chris Lattner
7d5c1e1ed1 Don't use invalidated iterators!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26521 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 07:53:16 +00:00
Evan Cheng
f42f516984 Add an entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26520 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 07:49:50 +00:00
Chris Lattner
ab51f3fa96 Canonicalize (X+C1)*C2 -> X*C2+C1*C2
This implements Transforms/InstCombine/add.ll:test31


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26519 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 06:04:02 +00:00
Evan Cheng
62bec2ca4c MEMSET / MEMCPY lowering bugs: we can't issue a single WORD / DWORD version of
rep/stos and rep/mov if the count is not a constant. We could do
  rep/stosl; and $count, 3; rep/stosb
For now, I will lower them to memset / memcpy calls. We will revisit this after
a little bit experiment.

Also need to take care of the trailing bytes even if the count is a constant.
Since the max. number of trailing bytes are 3, we will simply issue loads /
stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26517 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 02:48:56 +00:00
Chris Lattner
5a3cf8de5d Be more conservative with our symbolic alias analysis. In particular,
don't assume that A[1][0] and A[0][i] can't alias.  "i" might be out of
range, or even negative.  This fixes a miscompilation of 188.ammp (which
does bad pointer tricks) with the new CFE.

Testcase here: Analysis/BasicAA/2006-03-03-BadArraySubscript.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26515 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 02:06:34 +00:00
Chris Lattner
b27b69f283 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26513 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 01:19:34 +00:00
Evan Cheng
8df346b4e8 Typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26512 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 01:12:00 +00:00
Jim Laskey
b80af6f572 Added support for dwarf block data entries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26509 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 21:00:14 +00:00
Chris Lattner
329b951b69 Unbreak autouprade of llvm.sqrt, simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26506 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 16:31:22 +00:00
Jim Laskey
f01e547700 Adding basic structure support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26505 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 15:06:57 +00:00
Evan Cheng
3e1ce5a44d Add more vector NodeTypes: VSDIV, VUDIV, VAND, VOR, and VXOR.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26504 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 07:01:07 +00:00
Evan Cheng
33143dce15 Number of NodeTypes now exceeds 128.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26503 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 06:58:59 +00:00
Evan Cheng
bfa284f697 SDOperand::isOperand should not be a forwarding. It must check *this against N's operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26502 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 06:42:32 +00:00
Evan Cheng
80d8eaae05 Added isOperand(N): true if this is an operand of N
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26501 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 06:24:54 +00:00
Evan Cheng
fb43331226 A bit more tweaking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26500 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 06:23:43 +00:00
Jeff Cohen
d84525480a Fix VC++ compilation errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26498 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 03:25:07 +00:00
Evan Cheng
932f022b82 Move #include "llvm/CodeGen/AsmPrinter.h" to top since it's the interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26493 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 02:04:29 +00:00
Chris Lattner
a8309ae1cb Split the valuetypes out of Target.td into ValueTypes.td
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26490 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:55:26 +00:00
Chris Lattner
21959390c1 Change this to work with renamed intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26484 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:34:17 +00:00
Chris Lattner
aecb0627fa Make this work with renamed intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26482 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:30:23 +00:00
Chris Lattner
01ac91e2fd updates for recent changes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26481 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 01:21:36 +00:00
Chris Lattner
41edaa0529 remove the read/write port/io intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26479 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 00:19:58 +00:00
Chris Lattner
03dd465215 Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709, and paving the way for future progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26476 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-03 00:00:25 +00:00
Chris Lattner
bad08000f1 Simplify the autoupgrade interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26475 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-02 23:59:12 +00:00
Chris Lattner
ffa987d3ee Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709, and paving the way for future progress.

Significantly refactor autoupgrading code, to handle the more complex case
(where we upgrade one argument in a function), and fix some bugs in it.

Testcase here: llvm/test/Regression/Bytecode/memcpy.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26474 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-02 23:58:40 +00:00
Chris Lattner
89188a1096 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26472 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-02 22:34:38 +00:00
Evan Cheng
86ec7d1d07 - Fixed some priority calculation bugs that were causing bug 478. Among them:
a predecessor appearing more than once in the operand list was counted as
  multiple predecessor; priority1 should be updated during scheduling;
  CycleBound was updated after the node is inserted into priority queue; one
  of the tie breaking condition was flipped.
- Take into consideration of two address opcodes. If a predecessor is a def&use
  operand, it should have a higher priority.
- Scheduler should also favor floaters, i.e. nodes that do not have real
  predecessors such as MOV32ri.
- The scheduling fixes / tweaks fixed bug 478:
        .text
        .align  4
        .globl  _f
_f:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl %eax, %edx
        imull %ecx, %edx
        imull %eax, %eax
        imull %ecx, %ecx
        addl %eax, %ecx
        leal (%ecx,%edx,2), %eax
        ret

  It is also a slight performance win (1% - 3%) for most tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26470 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-02 21:38:29 +00:00
Chris Lattner
db3f873bd8 Generalize the REM folding code to handle another case Nick Lewycky
pointed out: realize the AND can provide factors and look through Casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26469 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-02 06:50:58 +00:00
Jim Laskey
6a3eb01084 Support for enumerations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26466 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 23:52:37 +00:00
Evan Cheng
246ae0dcf7 Don't print llvm constant in assmebly file. Assembler won't like comments that
span multiple lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26463 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 22:18:09 +00:00
Evan Cheng
a4ffcc23a2 Back out my last check-in. Wrong place to fix it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26462 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 22:17:00 +00:00
Evan Cheng
7cfdd01869 AsmWriter should not print LLVM constant in comment. Assembler won't like
multi-line comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26461 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 22:00:59 +00:00
Chris Lattner
1ec05d1bb4 Fix CodeGen/Generic/2006-03-01-dagcombineinfloop.ll, an infinite loop
in the dag combiner on 176.gcc on x86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26459 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 21:47:21 +00:00
Jim Laskey
9c4447aa2b Switch back to using actual dwarf tags. Simplifies code without loss to other
debug forms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26455 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 20:39:36 +00:00
Chris Lattner
b2742f4a26 Fix a typo evan noticed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26454 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 19:55:35 +00:00
Jim Laskey
92ae740396 Use context and not compile unit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26453 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 18:20:30 +00:00
Jim Laskey
288fe0f74d I guess I can handle large type sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26452 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 18:13:05 +00:00
Jim Laskey
f8913f19ae Basic array support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26451 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 17:53:02 +00:00
Chris Lattner
0f6ab6ff97 Implement CodeGen/PowerPC/or-addressing-mode.ll, which is also PR668.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26450 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 07:14:48 +00:00
Chris Lattner
00d18f0879 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26448 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 06:36:20 +00:00
Chris Lattner
5126984b1d Compile this:
void foo(float a, int *b) { *b = a; }

to this:

_foo:
        fctiwz f0, f1
        stfiwx f0, 0, r4
        blr

instead of this:

_foo:
        fctiwz f0, f1
        stfd f0, -8(r1)
        lwz r2, -4(r1)
        stw r2, 0(r4)
        blr

This implements CodeGen/PowerPC/stfiwx.ll, and also incidentally does the
right thing for GCC bugzilla 26505.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26447 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 05:50:56 +00:00
Chris Lattner
8c13d0a573 Use a target-specific dag-combine to implement CodeGen/PowerPC/fp-int-fp.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26445 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 04:57:39 +00:00
Chris Lattner
2466472a2b Add support for target-specific dag combines
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26443 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 04:53:38 +00:00
Chris Lattner
00ffed0468 Add interfaces for targets to provide target-specific dag combiner optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26442 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 04:52:55 +00:00
Chris Lattner
5750df9d69 Add a new AddToWorkList method, start using it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26441 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 04:03:14 +00:00
Chris Lattner
0b1a85f110 Pull shifts by a constant through multiplies (a form of reassociation),
implementing Regression/CodeGen/X86/mul-shift-reassoc.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26440 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 03:44:24 +00:00
Evan Cheng
d30bf01e90 Vector op lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26438 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 01:11:20 +00:00
Evan Cheng
860771d2d8 Vector ops lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26436 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 01:09:54 +00:00
Evan Cheng
f338dd881f New type v2f32.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26435 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 01:06:22 +00:00
Evan Cheng
1ab7d859cf - Added VConstant as an abstract version of ConstantVec.
- All abstrct vector nodes must have # of elements and element type as their
first two operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26432 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-01 00:51:13 +00:00