oota-llvm.git
14 years agoadd PR#
Chris Lattner [Sun, 29 Nov 2009 01:28:58 +0000 (01:28 +0000)]
add PR#

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90049 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a testcase for:
Chris Lattner [Sun, 29 Nov 2009 01:15:43 +0000 (01:15 +0000)]
Add a testcase for:

void test(int N, double* G) {
  long j;
  for (j = 1; j < N - 1; j++)
      G[j] = G[j] + G[j+1] + G[j-1];
}

which we now compile to one load in the loop:

LBB1_2:                                                     ## %bb
movsd 16(%rsi,%rax,8), %xmm2
incq %rdx
addsd %xmm2, %xmm1
addsd %xmm1, %xmm0
movapd %xmm2, %xmm1
movsd %xmm0, 8(%rsi,%rax,8)
incq %rax
cmpq %rcx, %rax
jne LBB1_2

instead of:

LBB1_2:                                                     ## %bb
movsd 8(%rsi,%rax,8), %xmm0
addsd 16(%rsi,%rax,8), %xmm0
addsd (%rsi,%rax,8), %xmm0
movsd %xmm0, 8(%rsi,%rax,8)
incq %rax
cmpq %rcx, %rax
jne LBB1_2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90048 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a testcase for
Chris Lattner [Sun, 29 Nov 2009 01:04:40 +0000 (01:04 +0000)]
add a testcase for

void test9(int N, double* G) {
  long j;
  for (j = 1; j < N - 1; j++)
      G[j+1] = G[j] + G[j+1];
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90047 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement PR5634.
Chris Lattner [Sun, 29 Nov 2009 00:51:17 +0000 (00:51 +0000)]
Implement PR5634.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90046 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach memdep to look for memory use intrinsics during dependency queries. Fixes
Nick Lewycky [Sat, 28 Nov 2009 21:27:49 +0000 (21:27 +0000)]
Teach memdep to look for memory use intrinsics during dependency queries. Fixes
PR5574.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90045 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoreenable load address insertion in load pre. This allows us to
Chris Lattner [Sat, 28 Nov 2009 16:08:18 +0000 (16:08 +0000)]
reenable load address insertion in load pre.  This allows us to
handle cases like this:
void test(int N, double* G) {
  long j;
  for (j = 1; j < N - 1; j++)
      G[j+1] = G[j] + G[j+1];
}

where G[1] isn't live into the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90041 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnhance InsertPHITranslatedPointer to be able to return a list of newly
Chris Lattner [Sat, 28 Nov 2009 15:39:14 +0000 (15:39 +0000)]
Enhance InsertPHITranslatedPointer to be able to return a list of newly
inserted instructions.  No functionality change until someone starts using it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90039 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimplement a FIXME: limit the depth that DecomposeGEPExpression goes the same
Chris Lattner [Sat, 28 Nov 2009 15:12:41 +0000 (15:12 +0000)]
implement a FIXME: limit the depth that DecomposeGEPExpression goes the same
way that getUnderlyingObject does it.

This fixes the 'DecomposeGEPExpression and getUnderlyingObject disagree!'
assertion on sqlite3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90038 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoenable code to handle un-phi-translatable cases more aggressively:
Chris Lattner [Sat, 28 Nov 2009 14:54:10 +0000 (14:54 +0000)]
enable code to handle un-phi-translatable cases more aggressively:
if we don't have an address expression available in a predecessor,
then model this as the value being clobbered at the end of the pred
block instead of being modeled as a complete phi translation failure.
This is important for PRE of loads because we want to see that the
load is available in all but this predecessor, and complete phi
translation failure results in not getting any information about
predecessors.

This doesn't do anything until I renable code insertion since PRE
now sees that it is available in all but one predecessors, but can't
insert the addressing in the predecessor that is missing it to
eliminate the redundancy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90037 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agodisable value insertion for now, I need to figure out how
Chris Lattner [Fri, 27 Nov 2009 22:50:07 +0000 (22:50 +0000)]
disable value insertion for now, I need to figure out how
to inform GVN about the newly inserted values.  This fixes
PR5631.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90022 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRework InsertPHITranslatedPointer to handle the recursive case, this
Chris Lattner [Fri, 27 Nov 2009 22:05:15 +0000 (22:05 +0000)]
Rework InsertPHITranslatedPointer to handle the recursive case, this
fixes PR5630 and sets the stage for the next phase of goodness (testcase
pending).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90019 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorecursively phi translate bitcast operands too, for consistency.
Chris Lattner [Fri, 27 Nov 2009 20:25:30 +0000 (20:25 +0000)]
recursively phi translate bitcast operands too, for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90016 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOops! Fix bug introduced in my recent cleanup change. Thanks to Tobias Grosser
Nick Lewycky [Fri, 27 Nov 2009 19:57:53 +0000 (19:57 +0000)]
Oops! Fix bug introduced in my recent cleanup change. Thanks to Tobias Grosser
for pointing this out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90015 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoI accidentally implemented this :)
Chris Lattner [Fri, 27 Nov 2009 19:56:00 +0000 (19:56 +0000)]
I accidentally implemented this :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90014 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd support for recursive phi translation and phi
Chris Lattner [Fri, 27 Nov 2009 19:11:31 +0000 (19:11 +0000)]
add support for recursive phi translation and phi
translation of add with immediate.  This allows us
to optimize this function:

void test(int N, double* G) {
  long j;
  G[1] = 1;
    for (j = 1; j < N - 1; j++)
        G[j+1] = G[j] + G[j+1];
}

to only do one load every iteration of the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90013 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd two simple test cases we now optimize (to one load in the loop each) and one...
Chris Lattner [Fri, 27 Nov 2009 18:08:30 +0000 (18:08 +0000)]
add two simple test cases we now optimize (to one load in the loop each) and one we don't (corresponding to the fixme I added yesterday).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90012 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofactor some logic out of instcombine into a new SimplifyAddInst method.
Chris Lattner [Fri, 27 Nov 2009 17:42:22 +0000 (17:42 +0000)]
factor some logic out of instcombine into a new SimplifyAddInst method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90011 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a deadargelim note.
Chris Lattner [Fri, 27 Nov 2009 17:12:30 +0000 (17:12 +0000)]
add a deadargelim note.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90009 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThis testcase is actually only partially redundant, and requires
Chris Lattner [Fri, 27 Nov 2009 16:53:57 +0000 (16:53 +0000)]
This testcase is actually only partially redundant, and requires
the FIXME I added yesterday to be implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90008 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix PR5436 by making the 'simple' case of SRoA not promote out of range
Chris Lattner [Fri, 27 Nov 2009 16:37:41 +0000 (16:37 +0000)]
fix PR5436 by making the 'simple' case of SRoA not promote out of range
array indexes.  The "complex" case of SRoA still handles them, and correctly.

This fixes a weirdness where we'd correctly avoid transforming A[0][42] if
the 42 was too large, but we'd only do it if it was one gep, not two separate
ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90007 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofilecheckize
Chris Lattner [Fri, 27 Nov 2009 16:31:59 +0000 (16:31 +0000)]
filecheckize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90006 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhile this test is testing a problem in the generic part of codegen,
Duncan Sands [Fri, 27 Nov 2009 16:04:14 +0000 (16:04 +0000)]
While this test is testing a problem in the generic part of codegen,
the problem only shows for msp430 and pic16 which is why it specifies
them using -march.  But it is wrong to put such tests in CodeGen/Generic,
since not everyone builds these targets.  Put a copy of the test in each
of the target test directories.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90005 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoVector types are no longer required to have a power-of-two length.
Duncan Sands [Fri, 27 Nov 2009 13:38:03 +0000 (13:38 +0000)]
Vector types are no longer required to have a power-of-two length.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90004 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoThese code generator limitations have been removed.
Duncan Sands [Fri, 27 Nov 2009 12:33:22 +0000 (12:33 +0000)]
These code generator limitations have been removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90003 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd comment.
Chris Lattner [Fri, 27 Nov 2009 08:40:14 +0000 (08:40 +0000)]
add comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90002 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoreduce nesting, no functionality change.
Chris Lattner [Fri, 27 Nov 2009 08:37:22 +0000 (08:37 +0000)]
reduce nesting, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90001 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agolimit the recursion depth of GetLinearExpression. This
Chris Lattner [Fri, 27 Nov 2009 08:32:52 +0000 (08:32 +0000)]
limit the recursion depth of GetLinearExpression.  This
fixes a crash analyzing consumer-lame, which had an "%X = add %X, 1"
in unreachable code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90000 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoteach GVN's load PRE to insert computations of the address in predecessors
Chris Lattner [Fri, 27 Nov 2009 08:25:10 +0000 (08:25 +0000)]
teach GVN's load PRE to insert computations of the address in predecessors
where it is not available.  It's unclear how to get this inserted
computation into GVN's scalar availability sets, Owen, help? :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89997 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd some tests for memdep phi translation + PRE.
Chris Lattner [Fri, 27 Nov 2009 06:42:42 +0000 (06:42 +0000)]
add some tests for memdep phi translation + PRE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89996 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothis test is failing, and is expected to.
Chris Lattner [Fri, 27 Nov 2009 06:36:28 +0000 (06:36 +0000)]
this test is failing, and is expected to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89995 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofilecheckize
Chris Lattner [Fri, 27 Nov 2009 06:33:09 +0000 (06:33 +0000)]
filecheckize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89994 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename test.
Chris Lattner [Fri, 27 Nov 2009 06:31:55 +0000 (06:31 +0000)]
rename test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89993 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix phi translation in load PRE to agree with the phi
Chris Lattner [Fri, 27 Nov 2009 06:31:14 +0000 (06:31 +0000)]
Fix phi translation in load PRE to agree with the phi
translation done by memdep, and reenable gep translation
again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89992 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoredisable this, my bootstrap worked because it wasn't an optimized build, whoops.
Chris Lattner [Fri, 27 Nov 2009 05:53:01 +0000 (05:53 +0000)]
redisable this, my bootstrap worked because it wasn't an optimized build, whoops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89991 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agotry again.
Chris Lattner [Fri, 27 Nov 2009 05:19:56 +0000 (05:19 +0000)]
try again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89990 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothis is causing buildbot failures, disable for now.
Chris Lattner [Fri, 27 Nov 2009 01:52:22 +0000 (01:52 +0000)]
this is causing buildbot failures, disable for now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89985 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothis (and probably several others) are now done.
Chris Lattner [Fri, 27 Nov 2009 00:35:04 +0000 (00:35 +0000)]
this (and probably several others) are now done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89982 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoteach phi translation of GEPs to simplify geps like 'gep x, 0'.
Chris Lattner [Fri, 27 Nov 2009 00:34:38 +0000 (00:34 +0000)]
teach phi translation of GEPs to simplify geps like 'gep x, 0'.
This allows us to compile the example from PR5313 into:

LBB1_2:                                                     ## %bb
incl %ecx
movb %al, (%rsi)
movslq %ecx, %rax
movb (%rdi,%rax), %al
testb %al, %al
jne LBB1_2

instead of:

LBB1_2:                                                     ## %bb
movslq %eax, %rcx
incl %eax
movb (%rdi,%rcx), %cl
movb %cl, (%rsi)
movslq %eax, %rcx
cmpb $0, (%rdi,%rcx)
jne LBB1_2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89981 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofactor some instcombine simplifications for getelementptr out to a new
Chris Lattner [Fri, 27 Nov 2009 00:29:05 +0000 (00:29 +0000)]
factor some instcombine simplifications for getelementptr out to a new
SimplifyGEPInst method in InstructionSimplify.h.  No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89980 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoteach memdep to do trivial PHI translation of GEPs. More to
Chris Lattner [Fri, 27 Nov 2009 00:07:37 +0000 (00:07 +0000)]
teach memdep to do trivial PHI translation of GEPs.  More to
come.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89979 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach memdep to phi translate bitcasts. This allows us to compile
Chris Lattner [Thu, 26 Nov 2009 23:41:07 +0000 (23:41 +0000)]
Teach memdep to phi translate bitcasts.  This allows us to compile
the example in GCC PR16799 to:

LBB1_2:                                                     ## %bb1
movl %eax, %eax
subq %rax, %rdi
movq %rdi, (%rcx)
movl (%rdi), %eax
testl %eax, %eax
je LBB1_2

instead of:

LBB1_2:                                                     ## %bb1
movl (%rdi), %ecx
subq %rcx, %rdi
movq %rdi, (%rax)
cmpl $0, (%rdi)
je LBB1_2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89978 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoconvert to filecheck
Chris Lattner [Thu, 26 Nov 2009 23:32:59 +0000 (23:32 +0000)]
convert to filecheck

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89977 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix typo spotted by Gabor Greif.
Nick Lewycky [Thu, 26 Nov 2009 23:19:05 +0000 (23:19 +0000)]
Fix typo spotted by Gabor Greif.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89976 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofactor some code out into some helper functions.
Chris Lattner [Thu, 26 Nov 2009 23:18:49 +0000 (23:18 +0000)]
factor some code out into some helper functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89975 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoClean up file, no functionality change.
Nick Lewycky [Thu, 26 Nov 2009 22:54:26 +0000 (22:54 +0000)]
Clean up file, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89974 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd a hack for PR5601, a crash on obsolete syntax that we plan to
Chris Lattner [Thu, 26 Nov 2009 22:48:23 +0000 (22:48 +0000)]
Add a hack for PR5601, a crash on obsolete syntax that we plan to
remove in LLVM 3.0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89973 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970
Chris Lattner [Thu, 26 Nov 2009 22:08:06 +0000 (22:08 +0000)]
fix crash on Transforms/InstCombine/intrinsics.ll introduced by r89970

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89972 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix PR5471 by removing an instcombine xform. Some pieces of the code
Chris Lattner [Thu, 26 Nov 2009 22:04:42 +0000 (22:04 +0000)]
Fix PR5471 by removing an instcombine xform.  Some pieces of the code
generates store to undef and some generates store to null as the idiom
for undefined behavior.  Since simplifycfg zaps both, don't remove the
undefined behavior in instcombine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89971 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoimplement a bunch of xforms for overflow intrinsics, based on a patch
Chris Lattner [Thu, 26 Nov 2009 21:42:47 +0000 (21:42 +0000)]
implement a bunch of xforms for overflow intrinsics, based on a patch
by Alastair Lynn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89970 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRename new TailDuplicationPass to avoid name conflict with the old one.
Bob Wilson [Thu, 26 Nov 2009 21:38:41 +0000 (21:38 +0000)]
Rename new TailDuplicationPass to avoid name conflict with the old one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89968 91177308-0d34-0410-b5e6-96231b3b80d8

14 years ago@test9 is a testcase for r89958. Before 89958, we misanalyzed the
Chris Lattner [Thu, 26 Nov 2009 19:25:46 +0000 (19:25 +0000)]
@test9 is a testcase for r89958.  Before 89958, we misanalyzed the
first expression as P+4+4*i which we considered to possibly alias
P+4*j.  Now we correctly analyze the former one as P+1+4*i.

@test10 is a sanity test that verfies that we know that P+4+4*i != P+4*i.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89960 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement PR1143 (at -m64) by making basicaa look through extensions. We
Chris Lattner [Thu, 26 Nov 2009 18:53:33 +0000 (18:53 +0000)]
Implement PR1143 (at -m64) by making basicaa look through extensions.  We
previously already handled it at -m32 because there were no i32->i64
extensions for addressing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89959 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agofix two transposed lines duncan caught and add an explanatory comment.
Chris Lattner [Thu, 26 Nov 2009 18:35:46 +0000 (18:35 +0000)]
fix two transposed lines duncan caught and add an explanatory comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89958 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agothis todo is resolved.
Chris Lattner [Thu, 26 Nov 2009 17:14:10 +0000 (17:14 +0000)]
this todo is resolved.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89957 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agomove DecomposeGEPExpression out into ValueTracking.cpp
Chris Lattner [Thu, 26 Nov 2009 17:12:50 +0000 (17:12 +0000)]
move DecomposeGEPExpression out into ValueTracking.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89956 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoteach GetLinearExpression to be a bit more aggressive.
Chris Lattner [Thu, 26 Nov 2009 17:00:01 +0000 (17:00 +0000)]
teach GetLinearExpression to be a bit more aggressive.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89955 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoresolve a fixme. I haven't figured out how to write a testcase
Chris Lattner [Thu, 26 Nov 2009 16:52:32 +0000 (16:52 +0000)]
resolve a fixme.  I haven't figured out how to write a testcase
to exercise this though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89954 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoupdate status of this. basicaa is much improved now,
Chris Lattner [Thu, 26 Nov 2009 16:42:00 +0000 (16:42 +0000)]
update status of this.  basicaa is much improved now,
only missing the one form (in this testcase).  Dan, do you
consider this example to be important?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89953 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTeach basicaa that x|c == x+c when the c bits of x are clear. This
Chris Lattner [Thu, 26 Nov 2009 16:26:43 +0000 (16:26 +0000)]
Teach basicaa that x|c == x+c when the c bits of x are clear.  This
allows us to compile the example in readme.txt into:

LBB1_1:                                                     ## %bb
movl 4(%rdx,%rax), %ecx
movl %ecx, %esi
imull (%rdx,%rax), %esi
imull %esi, %ecx
movl %esi, 8(%rdx,%rax)
imull %ecx, %esi
movl %ecx, 12(%rdx,%rax)
movl %esi, 16(%rdx,%rax)
imull %ecx, %esi
movl %esi, 20(%rdx,%rax)
addq $16, %rax
cmpq $4000, %rax
jne LBB1_1

instead of:

LBB1_1:
movl (%rdx,%rax), %ecx
imull 4(%rdx,%rax), %ecx
movl %ecx, 8(%rdx,%rax)
imull 4(%rdx,%rax), %ecx
movl %ecx, 12(%rdx,%rax)
imull 8(%rdx,%rax), %ecx
movl %ecx, 16(%rdx,%rax)
imull 12(%rdx,%rax), %ecx
movl %ecx, 20(%rdx,%rax)
addq $16, %rax
cmpq $4000, %rax
jne LBB1_1

GCC (4.2) doesn't seem to be able to eliminate the loads in this
testcase either, it generates:

L2:
movl (%rdx), %eax
imull 4(%rdx), %eax
movl %eax, 8(%rdx)
imull 4(%rdx), %eax
movl %eax, 12(%rdx)
imull 8(%rdx), %eax
movl %eax, 16(%rdx)
imull 12(%rdx), %eax
movl %eax, 20(%rdx)
addl $4, %ecx
addq $16, %rdx
cmpl $1002, %ecx
jne L2

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89952 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoteach basicaa that A[i] != A[i+1].
Chris Lattner [Thu, 26 Nov 2009 16:18:10 +0000 (16:18 +0000)]
teach basicaa that A[i] != A[i+1].

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89951 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agorename test
Chris Lattner [Thu, 26 Nov 2009 16:08:41 +0000 (16:08 +0000)]
rename test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89950 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoChange the other half of aliasGEP (which handles GEP differencing) to use DecomposeGE...
Chris Lattner [Thu, 26 Nov 2009 02:17:34 +0000 (02:17 +0000)]
Change the other half of aliasGEP (which handles GEP differencing) to use DecomposeGEPExpression.  This dramatically simplifies and shrinks the code by eliminating the horrible CheckGEPInstructions method, fixes a miscompilation (@test3) and makes the code more aggressive.  In particular, we now handle the @test4 case, which is reduced from the SmallPtrSet constructor.  Missing this caused us to emit a variable length memset instead of a fixed size one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89922 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoadd a new random feature test
Chris Lattner [Thu, 26 Nov 2009 02:16:28 +0000 (02:16 +0000)]
add a new random feature test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89921 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoGeneralize DecomposeGEPExpression to exactly handle what Value::getUnderlyingObject...
Chris Lattner [Thu, 26 Nov 2009 02:14:59 +0000 (02:14 +0000)]
Generalize DecomposeGEPExpression to exactly handle what Value::getUnderlyingObject does (when TD is around).  This allows us to avoid calling DecomposeGEPExpression unless the ultimate alias check we care about passes, speedup up BasicAA a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89920 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoImplement a new DecomposeGEPExpression method, which decomposes a GEP into a list...
Chris Lattner [Thu, 26 Nov 2009 02:13:03 +0000 (02:13 +0000)]
Implement a new DecomposeGEPExpression method, which decomposes a GEP into a list of scaled offsets.  Use this to eliminate some previous ad-hoc code which was subtly broken (it assumed all Constant*'s were non-zero, but strange constant express could be zero).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89915 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse GEPOperator more pervasively to simplify code.
Chris Lattner [Thu, 26 Nov 2009 02:11:08 +0000 (02:11 +0000)]
Use GEPOperator more pervasively to simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89914 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoupdate some notes slightly
Chris Lattner [Thu, 26 Nov 2009 01:51:18 +0000 (01:51 +0000)]
update some notes slightly

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89913 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoremove some redundant braces
Chris Lattner [Thu, 26 Nov 2009 01:50:12 +0000 (01:50 +0000)]
remove some redundant braces

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89912 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest for 89905.
Evan Cheng [Thu, 26 Nov 2009 00:35:01 +0000 (00:35 +0000)]
Test for 89905.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89906 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoWhen all defs of a vr are implicit_def, delete all of the defs.
Evan Cheng [Thu, 26 Nov 2009 00:32:36 +0000 (00:32 +0000)]
When all defs of a vr are implicit_def, delete all of the defs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89905 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSplit tail duplication into a separate pass. This is needed to avoid
Bob Wilson [Thu, 26 Nov 2009 00:32:21 +0000 (00:32 +0000)]
Split tail duplication into a separate pass.  This is needed to avoid
running tail duplication when doing branch folding for if-conversion, and
we also want to be able to run tail duplication earlier to fix some
reg alloc problems.  Move the CanFallThrough function from BranchFolding
to MachineBasicBlock so that it can be shared by TailDuplication.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89904 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTest for llvm-gcc checkin 89898.
Dale Johannesen [Wed, 25 Nov 2009 23:50:09 +0000 (23:50 +0000)]
Test for llvm-gcc checkin 89898.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89899 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUpdate to reflect recent debugging information encoding changes.
Devang Patel [Wed, 25 Nov 2009 23:28:01 +0000 (23:28 +0000)]
Update to reflect recent debugging information encoding changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89896 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRollback changes r89516: Added two SubtargetFeatures::AddFeatures methods, which...
Viktor Kutuzov [Wed, 25 Nov 2009 22:44:18 +0000 (22:44 +0000)]
Rollback changes r89516: Added two SubtargetFeatures::AddFeatures methods, which accept a comma-separated string or already parsed command line parameters as input, and some code re-factoring to use these new methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89893 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoProcessImplicitDefs should watch out for invalidated iterator and extra implicit...
Evan Cheng [Wed, 25 Nov 2009 21:13:39 +0000 (21:13 +0000)]
ProcessImplicitDefs should watch out for invalidated iterator and extra implicit operands on copies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89880 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoTail duplicate indirect branches for PowerPC, too.
Bob Wilson [Wed, 25 Nov 2009 19:57:14 +0000 (19:57 +0000)]
Tail duplicate indirect branches for PowerPC, too.
With the testcase for pr3120, the "threaded interpreter" runtime decreases
from 1788 to 1413 with this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89877 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAvoid some possibly unsafe uses of StringRef::data().
Benjamin Kramer [Wed, 25 Nov 2009 18:26:09 +0000 (18:26 +0000)]
Avoid some possibly unsafe uses of StringRef::data().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89873 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse StringRef (again) in DebugInfo interface.
Devang Patel [Wed, 25 Nov 2009 17:36:49 +0000 (17:36 +0000)]
Use StringRef (again) in DebugInfo interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89866 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoBased on the testcase for pr3120, running on my MacPro with Xeon processors,
Bob Wilson [Wed, 25 Nov 2009 17:27:53 +0000 (17:27 +0000)]
Based on the testcase for pr3120, running on my MacPro with Xeon processors,
it is definitely profitable to tail duplicate indirect branches for x86.
This is likely to be true to various degrees for all modern x86 processors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89865 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSupport PIC loading of constant pool entries
Bruno Cardoso Lopes [Wed, 25 Nov 2009 12:17:58 +0000 (12:17 +0000)]
Support PIC loading of constant pool entries

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89863 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdjust comments to new semantics.
Edward O'Callaghan [Wed, 25 Nov 2009 12:00:34 +0000 (12:00 +0000)]
Adjust comments to new semantics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89862 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSketch structure for X86 disassembler.
Daniel Dunbar [Wed, 25 Nov 2009 06:53:08 +0000 (06:53 +0000)]
Sketch structure for X86 disassembler.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89850 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAPI change Path::isSpecialFile to Path::isRegularFile, improve semantics in regards...
Edward O'Callaghan [Wed, 25 Nov 2009 06:32:19 +0000 (06:32 +0000)]
API change Path::isSpecialFile to Path::isRegularFile, improve semantics in regards to comments from 89765 post review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89848 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoPerform explicit instantiations in the proper namespace, since Clang diagnoses this...
Douglas Gregor [Wed, 25 Nov 2009 06:04:18 +0000 (06:04 +0000)]
Perform explicit instantiations in the proper namespace, since Clang diagnoses this ill-formity.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89846 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoReverting patch in revision 89758, initial attempt at fixing PR5373 has proven to...
Edward O'Callaghan [Wed, 25 Nov 2009 05:38:41 +0000 (05:38 +0000)]
Reverting patch in revision 89758, initial attempt at fixing PR5373 has proven to be bogus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89844 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd the rest of the build system logic for optional target disassemblers
Daniel Dunbar [Wed, 25 Nov 2009 04:46:58 +0000 (04:46 +0000)]
Add the rest of the build system logic for optional target disassemblers

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89841 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRegenerate configure
Daniel Dunbar [Wed, 25 Nov 2009 04:37:28 +0000 (04:37 +0000)]
Regenerate configure

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89840 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd CMake and configure logic to create llvm/Config/Disassemblers.defs.
Daniel Dunbar [Wed, 25 Nov 2009 04:30:13 +0000 (04:30 +0000)]
Add CMake and configure logic to create llvm/Config/Disassemblers.defs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89839 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSketch TableGen disassembler emitter, based on patch by Sean Callanan.
Daniel Dunbar [Wed, 25 Nov 2009 02:13:23 +0000 (02:13 +0000)]
Sketch TableGen disassembler emitter, based on patch by Sean Callanan.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89833 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse endianess dependent offsets for load/store of doubles when
Bruno Cardoso Lopes [Wed, 25 Nov 2009 01:05:25 +0000 (01:05 +0000)]
Use endianess dependent offsets for load/store of doubles when
using two swc/lwc instead of sdc/ldc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89826 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoFix compiler warnings.
Dale Johannesen [Wed, 25 Nov 2009 00:58:21 +0000 (00:58 +0000)]
Fix compiler warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89824 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoOnly include in the callee saved regs the sub registers to avoid
Bruno Cardoso Lopes [Wed, 25 Nov 2009 00:47:43 +0000 (00:47 +0000)]
Only include in the callee saved regs the sub registers to avoid
unnecessary save/restore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89823 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd proper emission of load/store double to stack slots for mips1 targets!
Bruno Cardoso Lopes [Wed, 25 Nov 2009 00:36:00 +0000 (00:36 +0000)]
Add proper emission of load/store double to stack slots for mips1 targets!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89821 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r89803.
Devang Patel [Wed, 25 Nov 2009 00:31:13 +0000 (00:31 +0000)]
Revert r89803.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89819 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRefactor target hook for tail duplication as requested by Chris.
Bob Wilson [Tue, 24 Nov 2009 23:35:49 +0000 (23:35 +0000)]
Refactor target hook for tail duplication as requested by Chris.
Make tail duplication of indirect branches much more aggressive (for targets
that indicate that it is profitable), based on further experience with
this transformation.  I compiled 3 large applications with and without
this more aggressive tail duplication and measured minimal changes in code
size.  ("size" on Darwin seems to round the text size up to the nearest
page boundary, so I can only say that any code size increase was less than
one 4k page.) Radar 7421267.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89814 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoDo not store R31 into the caller's link area on PPC.
Dale Johannesen [Tue, 24 Nov 2009 22:59:02 +0000 (22:59 +0000)]
Do not store R31 into the caller's link area on PPC.
This violates the ABI (that area is "reserved"), and
while it is safe if all code is generated with current
compilers, there is some very old code around that uses
that slot for something else, and breaks if it is stored
into.  Adjust testcases looking for current behavior.
I've verified that the stack frame size is right in all
testcases, whether it changed or not.  7311323.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89811 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoEnable debug info for ppc-darwin.
Devang Patel [Tue, 24 Nov 2009 21:38:54 +0000 (21:38 +0000)]
Enable debug info for ppc-darwin.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89803 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoUse StringRef instead of std::string in DIEString.
Devang Patel [Tue, 24 Nov 2009 19:42:17 +0000 (19:42 +0000)]
Use StringRef instead of std::string in DIEString.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89793 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRemove DebugLabelFolder pass. It is not used by dwarf writer anymore.
Devang Patel [Tue, 24 Nov 2009 19:37:07 +0000 (19:37 +0000)]
Remove DebugLabelFolder pass. It is not used by dwarf writer anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89790 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoSwith to pubtypes section before emitting pub types.
Devang Patel [Tue, 24 Nov 2009 19:18:41 +0000 (19:18 +0000)]
Swith to pubtypes section before emitting pub types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89787 91177308-0d34-0410-b5e6-96231b3b80d8