Commit Graph

97596 Commits

Author SHA1 Message Date
Owen Anderson 4efa445f3c 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.

llvm-svn: 121721
2010-12-13 22:29:52 +00:00
Abramo Bagnara a44c902d2f Skip ParenType on function instantiations.
llvm-svn: 121720
2010-12-13 22:27:55 +00:00
Bob Wilson 9c00c014ab Delete a line that I forgot to revert previously.
llvm-svn: 121719
2010-12-13 22:05:55 +00:00
Bob Wilson 9b3546d877 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.

llvm-svn: 121718
2010-12-13 21:58:05 +00:00
Johnny Chen 0a3d1ca28e Add TestBreakpointIgnoreCount.py to exercise the breakpoint ignore count features,
with both command line and Python API tests.

llvm-svn: 121717
2010-12-13 21:49:58 +00:00
Bob Wilson 157fec42c9 Use pseudo instructions for 2-register Neon instructions for scalar FP.
Partial fix for Radar 8711675.

llvm-svn: 121716
2010-12-13 21:05:52 +00:00
Bob Wilson 52f522720e Remove unused instruction class arguments.
llvm-svn: 121715
2010-12-13 21:05:44 +00:00
Evan Cheng 2e51bb4ff0 Generalize BFI isel lowering a bit.
llvm-svn: 121714
2010-12-13 20:32:54 +00:00
Caroline Tice 01cb3ea2ee Revert a small but important part of the EOF handling code that Greg
missed in his previous revert.

llvm-svn: 121712
2010-12-13 20:05:03 +00:00
Chris Lattner 2d434e594e add some DEBUG's.
llvm-svn: 121711
2010-12-13 19:55:30 +00:00
Owen Anderson 578074b2f3 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.

llvm-svn: 121710
2010-12-13 19:31:11 +00:00
Jim Grosbach f588c516b7 Use 32-bit types for 32-bit values.
llvm-svn: 121709
2010-12-13 19:25:46 +00:00
Jim Grosbach 3aeb867d74 Trailing whitespace.
llvm-svn: 121708
2010-12-13 19:18:13 +00:00
Johnny Chen 68300da996 Make the test case SourceManagerTestCase.display_source_python stronger by also
matching the source line number displayed.

llvm-svn: 121706
2010-12-13 18:59:27 +00:00
Benjamin Kramer 1e155ab7e1 Fix sort predicate. qsort(3)'s predicate semantics differ from std::sort's. Fixes PR 8780.
llvm-svn: 121705
2010-12-13 18:20:38 +00:00
Greg Clayton c30abdfa7d Fixed a crasher where when a ProcessGDBRemote class was being destroyed, it would eventually destroy the dynamic loader (when the lldb_private::Process::m_dynamic_loader_ap destroys itself in the object member destructor chain). The dynamic loader was calling a pure virtual method in Process which was causing a crash. The quick fix is to reset the auto pointer in the ProcessGDBRemote destructor when ProcessGDBRemote is still a valid object with all its pure virtual functions intact.
llvm-svn: 121704
2010-12-13 18:11:18 +00:00
Chris Lattner 8e21a02c19 rename test
llvm-svn: 121697
2010-12-13 08:39:40 +00:00
Chris Lattner 10bd29f1d4 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.

llvm-svn: 121696
2010-12-13 08:39:01 +00:00
Chris Lattner fb836f8c1a reinstate my patch: the miscompile was caused by an inverted branch in the
'and' case.

llvm-svn: 121695
2010-12-13 08:12:19 +00:00
Chandler Carruth 78494f50e5 Remove a type that got reduced away from this test case but not actually deleted.
llvm-svn: 121694
2010-12-13 08:01:53 +00:00
Chris Lattner 79db357d80 Completely disable the optimization I added in r121680 until
I can track down a miscompile.  This should bring the buildbots
back to life

llvm-svn: 121693
2010-12-13 07:41:29 +00:00
Chandler Carruth 7a6d2e9ca1 Fix PR8774 by restricting when hasInit returns true. Previously, it
would return true if the initializer pointer union had *any* non-null
pointer in it, even if the pointer wasn't one that would actually be
returned via getInit(). This makes it more accurately model the logic of
'getInit() != NULL'.

This still isn't completely satisfying. From a principled stance,
I suspect we should make hasInit() and getInit() *always* return false
and NULL (resp.) for ParmVarDecl. We shouldn't at the API level treat
initializers and default arguments as the same thing.

llvm-svn: 121692
2010-12-13 07:40:47 +00:00
Chris Lattner f8d180b808 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.

llvm-svn: 121691
2010-12-13 07:35:47 +00:00
Chris Lattner fbeb55844b 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

llvm-svn: 121690
2010-12-13 07:00:06 +00:00
Chris Lattner 1d05761df4 make this logic a bit simpler.
llvm-svn: 121689
2010-12-13 06:36:51 +00:00
Chris Lattner 25c3af35d8 split all the guts of SimplifyCFGOpt::run out into one function
per terminator kind.

llvm-svn: 121688
2010-12-13 06:25:44 +00:00
Chris Lattner cb570f87e5 fix a bug in r121680 that upset the various buildbots.
llvm-svn: 121687
2010-12-13 05:34:18 +00:00
Chris Lattner a6db741f3d refactor the speculative execution logic to be factored into the cond branch code instead of
doing a cfg search for every block simplified.

llvm-svn: 121686
2010-12-13 05:26:52 +00:00
Chris Lattner 466f54ffcf simplify a bunch of code.
llvm-svn: 121685
2010-12-13 05:20:28 +00:00
Chris Lattner 6df7bdd810 move HoistThenElseCodeToIf up to a more logical and efficient-to-handle place.
llvm-svn: 121684
2010-12-13 05:15:29 +00:00
Chris Lattner 2e3832d9a0 move 'MergeBlocksIntoPredecessor' call earlier. Use
getSinglePredecessor to simplify code.

llvm-svn: 121683
2010-12-13 05:10:48 +00:00
Chris Lattner bc9e6d9dbe make these tests a bit less fragile
llvm-svn: 121682
2010-12-13 05:10:30 +00:00
Chris Lattner a69c443459 factor new code out to a SimplifyBranchOnICmpChain helper function.
llvm-svn: 121681
2010-12-13 05:03:41 +00:00
Chris Lattner a442f24a36 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.

llvm-svn: 121680
2010-12-13 04:50:38 +00:00
Chris Lattner a737721d14 merge two tests
llvm-svn: 121679
2010-12-13 04:45:56 +00:00
Chris Lattner 5a177e681e merge two very similar functions into one that has a bool argument.
llvm-svn: 121678
2010-12-13 04:26:26 +00:00
Evan Cheng f8b4c0035b Disable auto-detection of AVX support since AVX codegen support is not ready.
llvm-svn: 121677
2010-12-13 04:23:53 +00:00
Chris Lattner 9b1af510cb don't bother handling non-canonical icmp's
llvm-svn: 121676
2010-12-13 04:18:32 +00:00
Chris Lattner 395252d93e inline a function, making the result much simpler.
llvm-svn: 121675
2010-12-13 04:15:19 +00:00
Chris Lattner 62cc76e9cc Fix my previous patch to handle a degenerate case that the llvm-gcc
bootstrap buildbot tripped over.

llvm-svn: 121674
2010-12-13 03:43:57 +00:00
Chris Lattner 11dafaa3ec convert some methods to be static functions
llvm-svn: 121673
2010-12-13 03:30:12 +00:00
Chris Lattner 4642d79fb0 zap two more std::sorts.
llvm-svn: 121672
2010-12-13 03:24:30 +00:00
Chris Lattner d9bacc088a 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.

llvm-svn: 121671
2010-12-13 03:18:54 +00:00
Chris Lattner 73a58627c3 simplify code and reduce indentation
llvm-svn: 121670
2010-12-13 02:38:13 +00:00
Chris Lattner 7c8e6047d6 convert an std::sort to array_pod_sort.
llvm-svn: 121669
2010-12-13 02:00:58 +00:00
Chris Lattner 1475987634 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.

llvm-svn: 121668
2010-12-13 01:57:34 +00:00
Chris Lattner 4088e2b8e4 reduce indentation and generally simplify code, no functionality change.
llvm-svn: 121667
2010-12-13 01:47:07 +00:00
Bill Wendling 73ce4a6fd8 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'.

llvm-svn: 121666
2010-12-13 01:46:19 +00:00
Chandler Carruth 00a3833638 Reduce the number of builtin operator overload candidates added in certain
cases. First, omit all builtin overloads when no non-record type is in the set
of candidate types. Second, avoid arithmetic type overloads for non-arithmetic
or enumeral types (counting vector types as arithmetic due to Clang
extensions). When heavily using constructs such as STL's '<<' based stream
logging, this can have a significant impact. One logging-heavy test case's
compile time dropped by 10% with this. Self-host shows 1-2% improvement in
compile time, but that's likely in the noise.

llvm-svn: 121665
2010-12-13 01:44:01 +00:00
Chris Lattner 7cb7867d7a use getFirstNonPHIOrDbg to simplify this code.
llvm-svn: 121664
2010-12-13 01:28:06 +00:00