oota-llvm.git
13 years agoRevert r121721, which broke buildbots.
Owen Anderson [Mon, 13 Dec 2010 22:51:08 +0000 (22:51 +0000)]
Revert r121721, which broke buildbots.

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

13 years agoReapply r121520, PartialAlias implementation for BasicAA, now that
Dan Gohman [Mon, 13 Dec 2010 22:50:24 +0000 (22:50 +0000)]
Reapply r121520, PartialAlias implementation for BasicAA, now that
memdep is updated to handle it.

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

13 years agoUpdate memdep to handle PartialAlias as MayAlias.
Dan Gohman [Mon, 13 Dec 2010 22:47:57 +0000 (22:47 +0000)]
Update memdep to handle PartialAlias as MayAlias.

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

13 years agoMake Thumb2 LEA-like instruction into pseudos, which map down to ADR. Provide correc...
Owen Anderson [Mon, 13 Dec 2010 22:29:52 +0000 (22:29 +0000)]
Make Thumb2 LEA-like instruction into pseudos, which map down to ADR.  Provide correct fixups for Thumb2 ADR,
which is _of course_ different from ARM ADR fixups, or any other Thumb2 fixup.

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

13 years agoDelete a line that I forgot to revert previously.
Bob Wilson [Mon, 13 Dec 2010 22:05:55 +0000 (22:05 +0000)]
Delete a line that I forgot to revert previously.

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

13 years agoUse COPY_TO_REGCLASS instead of pseudo instructions for Neon FP patterns.
Bob Wilson [Mon, 13 Dec 2010 21:58:05 +0000 (21:58 +0000)]
Use COPY_TO_REGCLASS instead of pseudo instructions for Neon FP patterns.
Jakob Olesen suggested that we can avoid the need for separate pseudo
instructions here by using COPY_TO_REGCLASS in the patterns.  The pattern
gets pretty ugly but it seems to work well.  Partial fix for Radar 8711675.

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

13 years agoUse pseudo instructions for 2-register Neon instructions for scalar FP.
Bob Wilson [Mon, 13 Dec 2010 21:05:52 +0000 (21:05 +0000)]
Use pseudo instructions for 2-register Neon instructions for scalar FP.
Partial fix for Radar 8711675.

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

13 years agoRemove unused instruction class arguments.
Bob Wilson [Mon, 13 Dec 2010 21:05:44 +0000 (21:05 +0000)]
Remove unused instruction class arguments.

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

13 years agoGeneralize BFI isel lowering a bit.
Evan Cheng [Mon, 13 Dec 2010 20:32:54 +0000 (20:32 +0000)]
Generalize BFI isel lowering a bit.

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

13 years agoadd some DEBUG's.
Chris Lattner [Mon, 13 Dec 2010 19:55:30 +0000 (19:55 +0000)]
add some DEBUG's.

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

13 years agoIn Thumb2, direct branches can be encoded as either a "short" conditional branch...
Owen Anderson [Mon, 13 Dec 2010 19:31:11 +0000 (19:31 +0000)]
In Thumb2, direct branches can be encoded as either a "short" conditional branch with a null predicate, or
as a "long" direct branch.  While the mnemonics are the same, they encode the branch offset differently, and
the Darwin assembler appears to prefer the "long" form for direct branches.  Thus, in the name of bitwise
equivalence, provide encoding and fixup support for it.

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

13 years agoUse 32-bit types for 32-bit values.
Jim Grosbach [Mon, 13 Dec 2010 19:25:46 +0000 (19:25 +0000)]
Use 32-bit types for 32-bit values.

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

13 years agoTrailing whitespace.
Jim Grosbach [Mon, 13 Dec 2010 19:18:13 +0000 (19:18 +0000)]
Trailing whitespace.

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

13 years agoFix sort predicate. qsort(3)'s predicate semantics differ from std::sort's. Fixes...
Benjamin Kramer [Mon, 13 Dec 2010 18:20:38 +0000 (18:20 +0000)]
Fix sort predicate. qsort(3)'s predicate semantics differ from std::sort's. Fixes PR 8780.

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

13 years agorename test
Chris Lattner [Mon, 13 Dec 2010 08:39:40 +0000 (08:39 +0000)]
rename test

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

13 years agoAdd a couple dag combines to transform mulhi/mullo into a wider multiply
Chris Lattner [Mon, 13 Dec 2010 08:39:01 +0000 (08:39 +0000)]
Add a couple dag combines to transform mulhi/mullo into a wider multiply
when the wider type is legal.  This allows us to compile:

define zeroext i16 @test1(i16 zeroext %x) nounwind {
entry:
%div = udiv i16 %x, 33
ret i16 %div
}

into:

test1:                                  # @test1
movzwl 4(%esp), %eax
imull $63551, %eax, %eax      # imm = 0xF83F
shrl $21, %eax
ret

instead of:

test1:                                  # @test1
        movw    $-1985, %ax             # imm = 0xFFFFFFFFFFFFF83F
        mulw    4(%esp)
        andl    $65504, %edx            # imm = 0xFFE0
        movl    %edx, %eax
        shrl    $5, %eax
        ret

Implementing rdar://8760399 and example #4 from:
http://blog.regehr.org/archives/320

We should implement the same thing for [su]mul_hilo, but I don't
have immediate plans to do this.

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

13 years agoreinstate my patch: the miscompile was caused by an inverted branch in the
Chris Lattner [Mon, 13 Dec 2010 08:12:19 +0000 (08:12 +0000)]
reinstate my patch: the miscompile was caused by an inverted branch in the
'and' case.

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

13 years agoCompletely disable the optimization I added in r121680 until
Chris Lattner [Mon, 13 Dec 2010 07:41:29 +0000 (07:41 +0000)]
Completely disable the optimization I added in r121680 until
I can track down a miscompile.  This should bring the buildbots
back to life

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

13 years agoremove the verbose-asm "constant pool double" comments that we were printing
Chris Lattner [Mon, 13 Dec 2010 07:35:47 +0000 (07:35 +0000)]
remove the verbose-asm "constant pool double" comments that we were printing
for each constant pool entry.  Using WriteTypeSymbolic here takes time
proportional to the size of the module, for each constant pool entry.

This speeds up -verbose-asm llc on 252.eon (a random testcase at my disposal)
from 4.4s to 2.137s.  llc takes 2.11s with asm-verbose off, so this is now a
pretty reasonable cost for verbose comments.

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

13 years agoMake simplifycfg reprocess newly formed "br (cond1 | cond2)" conditions
Chris Lattner [Mon, 13 Dec 2010 07:00:06 +0000 (07:00 +0000)]
Make simplifycfg reprocess newly formed "br (cond1 | cond2)" conditions
when simplifying, allowing them to be eagerly turned into switches.  This
is the last step required to get "Example 7" from this blog post:
http://blog.regehr.org/archives/320

On X86, we now generate this machine code, which (to my eye) seems better
than the ICC generated code:

_crud:                                  ## @crud
## BB#0:                                ## %entry
cmpb $33, %dil
jb LBB0_4
## BB#1:                                ## %switch.early.test
addb $-34, %dil
cmpb $58, %dil
ja LBB0_3
## BB#2:                                ## %switch.early.test
movzbl %dil, %eax
movabsq $288230376537592865, %rcx ## imm = 0x400000017001421
btq %rax, %rcx
jb LBB0_4
LBB0_3:                                 ## %lor.rhs
xorl %eax, %eax
ret
LBB0_4:                                 ## %lor.end
movl $1, %eax
ret

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

13 years agomake this logic a bit simpler.
Chris Lattner [Mon, 13 Dec 2010 06:36:51 +0000 (06:36 +0000)]
make this logic a bit simpler.

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

13 years agosplit all the guts of SimplifyCFGOpt::run out into one function
Chris Lattner [Mon, 13 Dec 2010 06:25:44 +0000 (06:25 +0000)]
split all the guts of SimplifyCFGOpt::run out into one function
per terminator kind.

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

13 years agofix a bug in r121680 that upset the various buildbots.
Chris Lattner [Mon, 13 Dec 2010 05:34:18 +0000 (05:34 +0000)]
fix a bug in r121680 that upset the various buildbots.

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

13 years agorefactor the speculative execution logic to be factored into the cond branch code...
Chris Lattner [Mon, 13 Dec 2010 05:26:52 +0000 (05:26 +0000)]
refactor the speculative execution logic to be factored into the cond branch code instead of
doing a cfg search for every block simplified.

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

13 years agosimplify a bunch of code.
Chris Lattner [Mon, 13 Dec 2010 05:20:28 +0000 (05:20 +0000)]
simplify a bunch of code.

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

13 years agomove HoistThenElseCodeToIf up to a more logical and efficient-to-handle place.
Chris Lattner [Mon, 13 Dec 2010 05:15:29 +0000 (05:15 +0000)]
move HoistThenElseCodeToIf up to a more logical and efficient-to-handle place.

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

13 years agomove 'MergeBlocksIntoPredecessor' call earlier. Use
Chris Lattner [Mon, 13 Dec 2010 05:10:48 +0000 (05:10 +0000)]
move 'MergeBlocksIntoPredecessor' call earlier.  Use
getSinglePredecessor to simplify code.

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

13 years agomake these tests a bit less fragile
Chris Lattner [Mon, 13 Dec 2010 05:10:30 +0000 (05:10 +0000)]
make these tests a bit less fragile

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

13 years agofactor new code out to a SimplifyBranchOnICmpChain helper function.
Chris Lattner [Mon, 13 Dec 2010 05:03:41 +0000 (05:03 +0000)]
factor new code out to a SimplifyBranchOnICmpChain helper function.

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

13 years agoenhance the "change or icmp's into switch" xform to handle one value in an
Chris Lattner [Mon, 13 Dec 2010 04:50:38 +0000 (04:50 +0000)]
enhance the "change or icmp's into switch" xform to handle one value in an
'or sequence' that it doesn't understand.  This allows us to optimize
something insane like this:

int crud (unsigned char c, unsigned x)
 {
   if(((((((((( (int) c <= 32 ||
                    (int) c == 46) || (int) c == 44)
                  || (int) c == 58) || (int) c == 59) || (int) c == 60)
               || (int) c == 62) || (int) c == 34) || (int) c == 92)
            || (int) c == 39) != 0)
     foo();
 }

into:

define i32 @crud(i8 zeroext %c, i32 %x) nounwind ssp noredzone {
entry:
  %cmp = icmp ult i8 %c, 33
  br i1 %cmp, label %if.then, label %switch.early.test

switch.early.test:                                ; preds = %entry
  switch i8 %c, label %if.end [
    i8 39, label %if.then
    i8 44, label %if.then
    i8 58, label %if.then
    i8 59, label %if.then
    i8 60, label %if.then
    i8 62, label %if.then
    i8 46, label %if.then
    i8 92, label %if.then
    i8 34, label %if.then
  ]

by pulling the < comparison out ahead of the newly formed switch.

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

13 years agomerge two tests
Chris Lattner [Mon, 13 Dec 2010 04:45:56 +0000 (04:45 +0000)]
merge two tests

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

13 years agomerge two very similar functions into one that has a bool argument.
Chris Lattner [Mon, 13 Dec 2010 04:26:26 +0000 (04:26 +0000)]
merge two very similar functions into one that has a bool argument.

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

13 years agoDisable auto-detection of AVX support since AVX codegen support is not ready.
Evan Cheng [Mon, 13 Dec 2010 04:23:53 +0000 (04:23 +0000)]
Disable auto-detection of AVX support since AVX codegen support is not ready.

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

13 years agodon't bother handling non-canonical icmp's
Chris Lattner [Mon, 13 Dec 2010 04:18:32 +0000 (04:18 +0000)]
don't bother handling non-canonical icmp's

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

13 years agoinline a function, making the result much simpler.
Chris Lattner [Mon, 13 Dec 2010 04:15:19 +0000 (04:15 +0000)]
inline a function, making the result much simpler.

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

13 years agoFix my previous patch to handle a degenerate case that the llvm-gcc
Chris Lattner [Mon, 13 Dec 2010 03:43:57 +0000 (03:43 +0000)]
Fix my previous patch to handle a degenerate case that the llvm-gcc
bootstrap buildbot tripped over.

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

13 years agoconvert some methods to be static functions
Chris Lattner [Mon, 13 Dec 2010 03:30:12 +0000 (03:30 +0000)]
convert some methods to be static functions

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

13 years agozap two more std::sorts.
Chris Lattner [Mon, 13 Dec 2010 03:24:30 +0000 (03:24 +0000)]
zap two more std::sorts.

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

13 years agofix a fairly serious oversight with switch formation from
Chris Lattner [Mon, 13 Dec 2010 03:18:54 +0000 (03:18 +0000)]
fix a fairly serious oversight with switch formation from
or'd conditions.  Previously we'd compile something like this:

int crud (unsigned char c) {
   return c == 62 || c == 34 || c == 92;
}

into:

  switch i8 %c, label %lor.rhs [
    i8 62, label %lor.end
    i8 34, label %lor.end
  ]

lor.rhs:                                          ; preds = %entry
  %cmp8 = icmp eq i8 %c, 92
  br label %lor.end

lor.end:                                          ; preds = %entry, %entry, %lor.rhs
  %0 = phi i1 [ true, %entry ], [ %cmp8, %lor.rhs ], [ true, %entry ]
  %lor.ext = zext i1 %0 to i32
  ret i32 %lor.ext

which failed to merge the compare-with-92 into the switch.  With this patch
we simplify this all the way to:

  switch i8 %c, label %lor.rhs [
    i8 62, label %lor.end
    i8 34, label %lor.end
    i8 92, label %lor.end
  ]

lor.rhs:                                          ; preds = %entry
  br label %lor.end

lor.end:                                          ; preds = %entry, %entry, %entry, %lor.rhs
  %0 = phi i1 [ true, %entry ], [ false, %lor.rhs ], [ true, %entry ], [ true, %entry ]
  %lor.ext = zext i1 %0 to i32
  ret i32 %lor.ext

which is much better for codegen's switch lowering stuff.  This kicks in 33 times
on 176.gcc (for example) cutting 103 instructions off the generated code.

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

13 years agosimplify code and reduce indentation
Chris Lattner [Mon, 13 Dec 2010 02:38:13 +0000 (02:38 +0000)]
simplify code and reduce indentation

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

13 years agoconvert an std::sort to array_pod_sort.
Chris Lattner [Mon, 13 Dec 2010 02:00:58 +0000 (02:00 +0000)]
convert an std::sort to array_pod_sort.

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

13 years agomove the "br (X == 0 | X == 1), T, F" -> switch optimization to a new
Chris Lattner [Mon, 13 Dec 2010 01:57:34 +0000 (01:57 +0000)]
move the "br (X == 0 | X == 1), T, F" -> switch optimization to a new
location in simplifycfg.  In the old days, SimplifyCFG was never run on
the entry block, so we had to scan over all preds of the BB passed into
simplifycfg to do this xform, now we can just check blocks ending with
a condbranch.  This avoids a scan over all preds of every simplified
block, which should be a significant compile-time perf win on functions
with lots of edges.  No functionality change.

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

13 years agoreduce indentation and generally simplify code, no functionality change.
Chris Lattner [Mon, 13 Dec 2010 01:47:07 +0000 (01:47 +0000)]
reduce indentation and generally simplify code, no functionality change.

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

13 years agoAdd support for using the `!if' operator when initializing variables:
Bill Wendling [Mon, 13 Dec 2010 01:46:19 +0000 (01:46 +0000)]
Add support for using the `!if' operator when initializing variables:

  class A<bit a, bits<3> x, bits<3> y> {
    bits<3> z;
    let z = !if(a, x, y);
  }

The variable z will get the value of x when 'a' is 1 and 'y' when a is '0'.

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

13 years agouse getFirstNonPHIOrDbg to simplify this code.
Chris Lattner [Mon, 13 Dec 2010 01:28:06 +0000 (01:28 +0000)]
use getFirstNonPHIOrDbg to simplify this code.

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

13 years agoreduce indentation by using continue, no functionality change.
Chris Lattner [Mon, 13 Dec 2010 01:11:17 +0000 (01:11 +0000)]
reduce indentation by using continue, no functionality change.

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

13 years agoMove <map> include out of .h and into .cpp.
Bill Wendling [Mon, 13 Dec 2010 01:05:54 +0000 (01:05 +0000)]
Move <map> include out of .h and into .cpp.

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

13 years agoMerge DEBUG statements.
Bill Wendling [Mon, 13 Dec 2010 01:03:49 +0000 (01:03 +0000)]
Merge DEBUG statements.

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

13 years agoeliminate the Records global variable, patch by Garrison Venn!
Chris Lattner [Mon, 13 Dec 2010 00:23:57 +0000 (00:23 +0000)]
eliminate the Records global variable, patch by Garrison Venn!

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

13 years agoclean up RecordKeeper::getAllDerivedDefinitions, patch by Garrison Venn!
Chris Lattner [Mon, 13 Dec 2010 00:20:52 +0000 (00:20 +0000)]
clean up RecordKeeper::getAllDerivedDefinitions, patch by Garrison Venn!

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

13 years agofurther fixes.
Chris Lattner [Mon, 13 Dec 2010 00:17:12 +0000 (00:17 +0000)]
further fixes.

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

13 years agoadd a note
Chris Lattner [Mon, 13 Dec 2010 00:15:25 +0000 (00:15 +0000)]
add a note

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

13 years agoMissed some ADDI <-> ADDIK conversions in 121649.
Wesley Peck [Sun, 12 Dec 2010 22:53:14 +0000 (22:53 +0000)]
Missed some ADDI <-> ADDIK conversions in 121649.

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

13 years agoReverting commit to LLVMLibDeps that was inadvertently done in 121649.
Wesley Peck [Sun, 12 Dec 2010 22:28:51 +0000 (22:28 +0000)]
Reverting commit to LLVMLibDeps that was inadvertently done in 121649.

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

13 years agoMBlaze delay slot filler was not capable of using ADDK and variants to fill delay...
Wesley Peck [Sun, 12 Dec 2010 22:22:49 +0000 (22:22 +0000)]
MBlaze delay slot filler was not capable of using ADDK and variants to fill delay slots. This broke several test cases when 121649 was committed. This fixes the regression.

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

13 years agoThe ADD and ADDK (and all variants) instructions where flip-flopped in the MBlaze...
Wesley Peck [Sun, 12 Dec 2010 22:02:31 +0000 (22:02 +0000)]
The ADD and ADDK (and all variants) instructions where flip-flopped in the MBlaze backend. This bug fix makes 64-bit math work on the MBlaze backend.

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

13 years agoRemove useless dynamic_cast<>().
Tobias Grosser [Sun, 12 Dec 2010 21:58:28 +0000 (21:58 +0000)]
Remove useless dynamic_cast<>().

Thanks Peter for pointing me to something that should have never been
committed to the llvm code base.

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

13 years agoRegen configure
Peter Collingbourne [Sun, 12 Dec 2010 21:42:01 +0000 (21:42 +0000)]
Regen configure

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

13 years agoFix paths; AutoRegen.sh changes its current working directory to be the
Peter Collingbourne [Sun, 12 Dec 2010 21:41:56 +0000 (21:41 +0000)]
Fix paths; AutoRegen.sh changes its current working directory to be the
autoconf directory, but these paths need to be relative to the main
source directory.  Patch originally by Dan Gohman, r67655.

Also, cause configure.ac to find absolute paths to LLVM source and
object trees.   Together, fixes PR1220.

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

13 years ago1. Change MBlaze indirect branches to use absolute branch BRALD instead of pc relativ...
Wesley Peck [Sun, 12 Dec 2010 20:52:31 +0000 (20:52 +0000)]
1. Change MBlaze indirect branches to use absolute branch BRALD instead of pc relative branch BRLD.
2. Make sure that the MBlaze stack is aligned to 4-byte boundaries.
3. Determine frame indexes that should be placed in the callers stack frame, as per the MBlaze ABI, and place them in the correct locations.

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

13 years agoCatch attempts to remove a deleted node from the CSE maps. Better to
Duncan Sands [Sun, 12 Dec 2010 13:22:50 +0000 (13:22 +0000)]
Catch attempts to remove a deleted node from the CSE maps.  Better to
catch this here rather than later after accessing uninitialized memory
etc.  Fires when compiling the testcase in PR8237.

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

13 years agofix typo
Chris Lattner [Sun, 12 Dec 2010 02:42:57 +0000 (02:42 +0000)]
fix typo

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

13 years agoGeneralize the and-icmp-select instcombine further by allowing selects of the form
Benjamin Kramer [Sat, 11 Dec 2010 10:49:22 +0000 (10:49 +0000)]
Generalize the and-icmp-select instcombine further by allowing selects of the form

(x & 2^n) ? 2^m+C : C

we can offset both arms by C to get the "(x & 2^n) ? 2^m : 0" form, optimize the
select to a shift and apply the offset afterwards.

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

13 years agoFactor the (x & 2^n) ? 2^m : 0 instcombine into its own method and generalize it
Benjamin Kramer [Sat, 11 Dec 2010 09:42:59 +0000 (09:42 +0000)]
Factor the (x & 2^n) ? 2^m : 0 instcombine into its own method and generalize it
to catch cases where n != m with a shift.

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

13 years ago(or (and (shl A, #shamt), mask), B) => ARMbfi B, A, ~mask where lsb(mask) == #shamt...
Evan Cheng [Sat, 11 Dec 2010 04:11:38 +0000 (04:11 +0000)]
(or (and (shl A, #shamt), mask), B) => ARMbfi B, A, ~mask where lsb(mask) == #shamt. rdar://8752056

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

13 years agoAdd named timer groups for the different stages of register allocation.
Jakob Stoklund Olesen [Sat, 11 Dec 2010 00:19:56 +0000 (00:19 +0000)]
Add named timer groups for the different stages of register allocation.

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

13 years agoMove MRI into RegAllocBase. Clean up debug output a bit.
Jakob Stoklund Olesen [Fri, 10 Dec 2010 23:49:00 +0000 (23:49 +0000)]
Move MRI into RegAllocBase. Clean up debug output a bit.

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

13 years agoAdd FIXME
Jim Grosbach [Fri, 10 Dec 2010 23:41:10 +0000 (23:41 +0000)]
Add FIXME

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

13 years agoRemove extraneous close parenthesis.
Nick Lewycky [Fri, 10 Dec 2010 23:14:35 +0000 (23:14 +0000)]
Remove extraneous close parenthesis.
Fix build breakage.

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

13 years agoMove variable that's unused in an NDEBUG build inside the DEBUG() macro, fixing
Nick Lewycky [Fri, 10 Dec 2010 23:05:10 +0000 (23:05 +0000)]
Move variable that's unused in an NDEBUG build inside the DEBUG() macro, fixing
lib/CodeGen/RegAllocGreedy.cpp:233: error: unused variable 'TRC' [-Wunused-variable]

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

13 years agoAttempt to get Thumb2 branch fixups working properly.
Owen Anderson [Fri, 10 Dec 2010 23:02:28 +0000 (23:02 +0000)]
Attempt to get Thumb2 branch fixups working properly.

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

13 years agoForce the greedy register allocator to always use the inline spiller.
Jakob Stoklund Olesen [Fri, 10 Dec 2010 22:54:44 +0000 (22:54 +0000)]
Force the greedy register allocator to always use the inline spiller.

Soon, RegAllocGreedy will start splitting live ranges, and then deferred
spilling won't work anyway.

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

13 years agoRip out live range splitting support from the inline spiller.
Jakob Stoklund Olesen [Fri, 10 Dec 2010 22:54:40 +0000 (22:54 +0000)]
Rip out live range splitting support from the inline spiller.

The spiller should only spill. The register allocator will drive live range
splitting, it has the needed information about register pressure and
interferences.

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

13 years agoGet rid of ellipses.
Bill Wendling [Fri, 10 Dec 2010 22:54:30 +0000 (22:54 +0000)]
Get rid of ellipses.

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

13 years agoFix merge error in my last fix to Thumb2 vldr fixups.
Owen Anderson [Fri, 10 Dec 2010 22:53:48 +0000 (22:53 +0000)]
Fix merge error in my last fix to Thumb2 vldr fixups.

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

13 years agoFixups for Thumb2 vldr's need to have the effective PC aligned as well.
Owen Anderson [Fri, 10 Dec 2010 22:46:47 +0000 (22:46 +0000)]
Fixups for Thumb2 vldr's need to have the effective PC aligned as well.

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

13 years agoThe MCFixupKindInfo table needs to be in the order that the enums were
Bill Wendling [Fri, 10 Dec 2010 22:37:19 +0000 (22:37 +0000)]
The MCFixupKindInfo table needs to be in the order that the enums were
declared. Add a note specifying this and spruce up the list a bit.

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

13 years agoProvide the necessary post-encoder hook for Thumb2 encodings of VMOV and friends.
Owen Anderson [Fri, 10 Dec 2010 22:32:08 +0000 (22:32 +0000)]
Provide the necessary post-encoder hook for Thumb2 encodings of VMOV and friends.

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

13 years agoUse AllocationOrder in RegAllocGreedy, fix a bug in the hint calculation.
Jakob Stoklund Olesen [Fri, 10 Dec 2010 22:21:05 +0000 (22:21 +0000)]
Use AllocationOrder in RegAllocGreedy, fix a bug in the hint calculation.

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

13 years agoAdd float patterns for Neon vld1-lane/dup and vst1-lane operations.
Bob Wilson [Fri, 10 Dec 2010 22:13:32 +0000 (22:13 +0000)]
Add float patterns for Neon vld1-lane/dup and vst1-lane operations.

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

13 years agoRemove unused arguments.
Bob Wilson [Fri, 10 Dec 2010 22:13:24 +0000 (22:13 +0000)]
Remove unused arguments.

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

13 years agoFix encoding of Thumb1 LDRB and STRB.
Owen Anderson [Fri, 10 Dec 2010 22:11:13 +0000 (22:11 +0000)]
Fix encoding of Thumb1 LDRB and STRB.

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

13 years agoTrailing whitespace.
Jim Grosbach [Fri, 10 Dec 2010 21:57:34 +0000 (21:57 +0000)]
Trailing whitespace.

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

13 years agoFix Thumb2 encodings of STREX and LDREX.
Owen Anderson [Fri, 10 Dec 2010 21:52:38 +0000 (21:52 +0000)]
Fix Thumb2 encodings of STREX and LDREX.

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

13 years agoRevert r121520, which may have introduced miscompilations.
Dan Gohman [Fri, 10 Dec 2010 21:48:28 +0000 (21:48 +0000)]
Revert r121520, which may have introduced miscompilations.

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

13 years agoCorrect encoding of rotation immediate for Thumb2 instructions. rdar://8755999
Jim Grosbach [Fri, 10 Dec 2010 21:24:18 +0000 (21:24 +0000)]
Correct encoding of rotation immediate for Thumb2 instructions. rdar://8755999

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

13 years agoFix encoding of 'U' bit for Thumb2 STRD/LDRD instructions. rdar://8755726
Jim Grosbach [Fri, 10 Dec 2010 21:05:07 +0000 (21:05 +0000)]
Fix encoding of 'U' bit for Thumb2 STRD/LDRD instructions. rdar://8755726

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

13 years agoMore trivial cleanup. No need to define the EncoderMethod property type. Can
Jim Grosbach [Fri, 10 Dec 2010 20:53:44 +0000 (20:53 +0000)]
More trivial cleanup. No need to define the EncoderMethod property type. Can
just assign to it.

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

13 years agoTidy up.
Jim Grosbach [Fri, 10 Dec 2010 20:51:35 +0000 (20:51 +0000)]
Tidy up.

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

13 years agoTrailing whitespace.
Jim Grosbach [Fri, 10 Dec 2010 20:47:29 +0000 (20:47 +0000)]
Trailing whitespace.

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

13 years agoImplement PartialAlias checking in BasicAA.
Dan Gohman [Fri, 10 Dec 2010 20:47:03 +0000 (20:47 +0000)]
Implement PartialAlias checking in BasicAA.

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

13 years agoFix miscompilation caused by trivial logic error in the reassignVReg()
Jakob Stoklund Olesen [Fri, 10 Dec 2010 20:45:04 +0000 (20:45 +0000)]
Fix miscompilation caused by trivial logic error in the reassignVReg()
interference check.

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

13 years agoMinimally update this code to handle PartialAlias.
Dan Gohman [Fri, 10 Dec 2010 20:14:49 +0000 (20:14 +0000)]
Minimally update this code to handle PartialAlias.

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

13 years agoUse PartialAlias to do better noalias lint checking.
Dan Gohman [Fri, 10 Dec 2010 20:04:06 +0000 (20:04 +0000)]
Use PartialAlias to do better noalias lint checking.

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

13 years agoTeach AliasAnalysisCounter about PartialAlias.
Dan Gohman [Fri, 10 Dec 2010 19:53:05 +0000 (19:53 +0000)]
Teach AliasAnalysisCounter about PartialAlias.

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

13 years agoTeach AliasAnalysisEvaluator about PartialAlias.
Dan Gohman [Fri, 10 Dec 2010 19:52:40 +0000 (19:52 +0000)]
Teach AliasAnalysisEvaluator about PartialAlias.

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

13 years agoUpdate this code to handle PartialAlias as MayAlias.
Dan Gohman [Fri, 10 Dec 2010 19:40:47 +0000 (19:40 +0000)]
Update this code to handle PartialAlias as MayAlias.

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

13 years agoIntroduce a new PartialAlias response for AliasAnalysis. For most
Dan Gohman [Fri, 10 Dec 2010 19:38:58 +0000 (19:38 +0000)]
Introduce a new PartialAlias response for AliasAnalysis. For most
AliasAnalysis consumers, PartialAlias will be treated as MayAlias.

For AliasAnalysis chaining, MayAlias says "procede to the next analysis".
PartialAlias will be used to indicate that the query should terminate,
even though it didn't reach MustAlias or NoAlias.

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

13 years agoFix some invalid alignments for Neon vld-dup and vld/st-lane instructions.
Bob Wilson [Fri, 10 Dec 2010 19:37:42 +0000 (19:37 +0000)]
Fix some invalid alignments for Neon vld-dup and vld/st-lane instructions.
Alignments smaller than the total size of the memory being loaded or stored,
unless the alignment is 8 bytes, are not allowed.  Add tests for this, too.

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

13 years agoTeach isCSRestore() that ARM/Thumb2 functions will use post-modify LDR
Jim Grosbach [Fri, 10 Dec 2010 18:41:15 +0000 (18:41 +0000)]
Teach isCSRestore() that ARM/Thumb2 functions will use post-modify LDR
instructions to restore a single register rather than an LDM instruction.
rdar://8754999

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