Commit Graph

27840 Commits

Author SHA1 Message Date
Chris Lattner
646085dde9 changes to get ptr_rc to be accepted in patterns. This is needed for ppc preinc
stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31738 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 21:18:40 +00:00
Evan Cheng
3cdd9f65ed Revert. This wasn't meant to be checked in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31737 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 19:20:33 +00:00
Chris Lattner
26e552b04c group load and store instructions together. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31736 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 19:19:53 +00:00
Chris Lattner
fc14b31540 Fix predicates for unindexed stores so they don't accidentally match indexed
stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31735 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 19:13:39 +00:00
Chris Lattner
6a5339ba65 Rework PPC64 calls. Now we have a LR8/CTR8 register which the PPC64 calls
clobber.  This allows LR8 to be save/restored correctly as a 64-bit quantity,
instead of handling it as a 32-bit quantity.  This unbreaks ppc64 codegen when
the code is actually located above the 4G boundary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31734 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 18:44:47 +00:00
Chris Lattner
d10434215d remove a ton of custom selection logic no longer needed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31733 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 18:43:11 +00:00
Chris Lattner
7c3a96b81a Fix a bug handling nodes with variable arguments. The code was fixed to assume
that there were two input operands before the variable operand portion.  This
*happened* to be true for all call instructions, which took a chain and a
destination, but was not true for the PPC BCTRL instruction, whose destination
is implicit.

Making this code more general allows elimination of the custom selection logic
for BCTRL.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31732 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 18:41:38 +00:00
Chris Lattner
20ddd4a7ae it would be nice of ctlz were lowered to bsf etc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31730 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 08:08:46 +00:00
Chris Lattner
e511b74f4a implement InstCombine/shift-simplify.ll by transforming:
(X >> Z) op (Y >> Z)  -> (X op Y) >> Z

for all shifts and all ops={and/or/xor}.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31729 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 07:46:50 +00:00
Chris Lattner
9961cf1fed new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31728 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 07:45:36 +00:00
Chris Lattner
9c2328e5a9 implement InstCombine/and-compare.ll:test1. This compiles:
typedef struct { unsigned prefix : 4; unsigned code : 4; unsigned unsigned_p : 4; } tree_common;
int foo(tree_common *a, tree_common *b) { return a->code == b->code; }

into:

_foo:
        movl 4(%esp), %eax
        movl 8(%esp), %ecx
        movl (%eax), %eax
        xorl (%ecx), %eax
        # TRUNCATE movb %al, %al
        shrb $4, %al
        testb %al, %al
        sete %al
        movzbl %al, %eax
        ret

instead of:

_foo:
        movl 8(%esp), %eax
        movb (%eax), %al
        shrb $4, %al
        movl 4(%esp), %ecx
        movb (%ecx), %cl
        shrb $4, %cl
        cmpb %al, %cl
        sete %al
        movzbl %al, %eax
        ret

saving one cycle by eliminating a shift.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31727 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 06:06:06 +00:00
Chris Lattner
96dddd969f new testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31726 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 06:04:35 +00:00
Chris Lattner
ac011bce9e lower "X = seteq Y, Z" to '(shr (ctlz (xor Y, Z)), 5)' instead of
'(shr (ctlz (sub Y, Z)), 5)'.

The use of xor better exposes the operation to bit-twiddling logic in the
dag combiner.  For example, this:

typedef struct {
  unsigned prefix : 4;
  unsigned code : 4;
  unsigned unsigned_p : 4;
} tree_common;

int foo(tree_common *a, tree_common *b) {
  return a->code == b->code;
}

Now compiles to:

_foo:
        lwz r2, 0(r4)
        lwz r3, 0(r3)
        xor r2, r3, r2
        rlwinm r2, r2, 28, 28, 31
        cntlzw r2, r2
        srwi r3, r2, 5
        blr

instead of:

_foo:
        lbz r2, 3(r4)
        lbz r3, 3(r3)
        srwi r2, r2, 4
        srwi r3, r3, 4
        subf r2, r2, r3
        cntlzw r2, r2
        srwi r3, r2, 5
        blr

saving a cycle.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31725 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 05:28:08 +00:00
Andrew Lenharth
472c7918b0 A shim over other AA impls to catch incorrect uses
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31724 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 05:21:04 +00:00
Reid Spencer
d798a515e9 Discard code that supported old bytecode formats. This makes the Bytecode
Reader code much easier to read and maintain. Backwards compatibility from
version 5 format has been retained. Older formats will produce an error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31723 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 04:47:22 +00:00
Devang Patel
df1a10ece6 Implement removeDeadPasses().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31722 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 03:05:08 +00:00
Devang Patel
03153c70de Keep track of Last user of analysis phase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31721 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 02:54:23 +00:00
Devang Patel
b899eed1bc Use std::map to map AnalysisID and Pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31720 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 01:59:59 +00:00
Chris Lattner
9b62b458c5 add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31719 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 01:57:53 +00:00
Chris Lattner
2fe4bf453b minor tweaks, reject vector preinc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31717 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 01:38:31 +00:00
Devang Patel
c1d6e1fc9c Manage analysis passes during run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31716 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 01:23:29 +00:00
Tanya Lattner
01d3e38267 Updating configure script for 2.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31715 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 00:59:52 +00:00
Devang Patel
5770c7cd52 Update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31713 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-14 00:03:04 +00:00
Evan Cheng
7ce4578353 Matches MachineInstr changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31712 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 23:36:35 +00:00
Evan Cheng
d7de496b23 - Let MachineInstr ctors add implicit def and use operands. Other operands
will be inserted before these operands. If the opcode changes (by
  setOpcode), the implicit operands are updated as well.
- Added IsKill, IsDead fields to MachineOperand in preparation for changes
  that move kill / dead info to MachineInstr's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31711 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 23:34:06 +00:00
Devang Patel
2718bfbaa6 Update PassManagerImpl_New::analysisCurrentlyAvailable to check all
managed passmanagers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31710 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 22:53:19 +00:00
Devang Patel
be6d515f48 Check currently available anlysis in active managers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31709 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 22:40:09 +00:00
Chris Lattner
c9dcf28955 teach the g5 hazard recognizer about update loads. This fixes
Ptrdist/anagram among others.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31708 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 20:11:06 +00:00
Reid Spencer
759bfd0934 For PR950:
Changes for new cast instructions that are backwards compatible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31707 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 18:00:52 +00:00
Reid Spencer
d718559c7f Don't hard code test names into the test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31706 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 17:55:34 +00:00
Reid Spencer
497a27c33a Fix 80 cols violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31705 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 16:21:09 +00:00
Reid Spencer
f9dd2aade2 For PR950:
Use the notcast script in preparation for 12 casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31704 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 16:13:38 +00:00
Reid Spencer
f7c8a97472 For PR950:
Use the notcast script in preparation for 12 cast instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31703 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 16:12:25 +00:00
Reid Spencer
28fa65b62e Make it handle plain old cast too, for old assembly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31702 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 16:11:14 +00:00
Reid Spencer
9fd5d13e51 Handle ptrtoint and inttoptr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31701 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 16:09:37 +00:00
Reid Spencer
0244099956 Add some output so the user is informed while they wait.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31700 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 16:08:51 +00:00
Reid Spencer
7cbe67d789 Add a link to the GEP FAQ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31698 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 08:03:59 +00:00
Chris Lattner
c2e6801cc7 remove redundant code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31697 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 01:10:12 +00:00
Nick Lewycky
bf63734a1b Cute example from Chris Lattner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31696 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 00:23:28 +00:00
Bill Wendling
b39a55a2e7 Initialize some pointers to quiet the compiler (when doing build_gcc
builds).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31694 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-12 11:10:39 +00:00
Reid Spencer
5c0ef47d83 Document new constant expr operators, rename bitconvert as bitcast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31693 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 23:08:07 +00:00
Reid Spencer
a0610f9750 Revert premature patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31692 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 23:06:47 +00:00
Reid Spencer
c795a48e76 Document new constant expr operators, rename bitconvert as bitcast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31691 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 22:34:59 +00:00
Jim Laskey
dfc55885e2 Make sure stack link is set in 64-bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31690 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 22:22:07 +00:00
Jim Laskey
863ab9fbd6 XFAIL All but powerpc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31689 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 22:14:46 +00:00
Reid Spencer
72679258ff Add a preview of two new conversion operators: ptrtoint and inttoptr. Update
the defintion of bitconvert correspondingly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31688 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 21:00:47 +00:00
Reid Spencer
0288d18bb6 Remvoe a do-nothing else block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31687 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 20:27:49 +00:00
Reid Spencer
a07d5b9164 Make an assert comment match the tested assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31686 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 20:07:59 +00:00
Reid Spencer
2803b4cc58 Minor style fixes from review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31685 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 19:59:25 +00:00
Chris Lattner
a94a203f34 implement proper PPC64 prolog/epilog codegen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31684 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-11 19:05:28 +00:00