Skip to content
  1. Apr 21, 2010
    • Dan Gohman's avatar
      Move several SelectionDAG-independent utility functions out of the · 450aa64f
      Dan Gohman authored
      SelectionDAG directory and into a new Analysis.cpp file.
      
      llvm-svn: 101975
      450aa64f
    • Johnny Chen's avatar
      Thumb instructions which have reglist operands at the end and predicate operands · dd56c405
      Johnny Chen authored
      before reglist were not properly handled with respect to IT Block.  Fix that by
      creating a new method ARMBasicMCBuilder::DoPredicateOperands() used by those
      instructions for disassembly.  Add a test case.
      
      llvm-svn: 101974
      dd56c405
    • Chris Lattner's avatar
      Implement (but don't enable) PR6724 and rdar://6295824. In short, · 6fbe7049
      Chris Lattner authored
      we have RefreshCallGraph detect when a function pass devirtualizes
      a call, and have CGSCCPassMgr iterate (up to a count) when this 
      happens.  This allows (in the example) GVN to devirtualize the 
      call in foo, then the inliner to inline it away.
      
      This is not currently enabled because I haven't done any analysis
      on the (potentially substantial) code size or performance impact of
      doing this, and guess what, it exposes callgraph updating bugs in
      various passes.  This is progress though, and you can play with it
      by passing -max-cg-scc-iterations=5 to opt.
      
      llvm-svn: 101973
      6fbe7049
    • Douglas Gregor's avatar
      Overhaul the AST representation of Objective-C message send · 9a129194
      Douglas Gregor authored
      expressions, to improve source-location information, clarify the
      actual receiver of the message, and pave the way for proper C++
      support. The ObjCMessageExpr node represents four different kinds of
      message sends in a single AST node:
      
        1) Send to a object instance described by an expression (e.g., [x method:5])
        2) Send to a class described by the class name (e.g., [NSString method:5])
        3) Send to a superclass class (e.g, [super method:5] in class method)
        4) Send to a superclass instance (e.g., [super method:5] in instance method)
      
      Previously these four cases where tangled together. Now, they have
      more distinct representations. Specific changes:
      
        1) Unchanged; the object instance is represented by an Expr*.
      
        2) Previously stored the ObjCInterfaceDecl* referring to the class
        receiving the message. Now stores a TypeSourceInfo* so that we know
        how the class was spelled. This both maintains typedef information
        and opens the door for more complicated C++ types (e.g., dependent
        types). There was an alternative, unused representation of these
        sends by naming the class via an IdentifierInfo *. In practice, we
        either had an ObjCInterfaceDecl *, from which we would get the
        IdentifierInfo *, or we fell into the case below...
      
        3) Previously represented by a class message whose IdentifierInfo *
        referred to "super". Sema and CodeGen would use isStr("super") to
        determine if they had a send to super. Now represented as a
        "class super" send, where we have both the location of the "super"
        keyword and the ObjCInterfaceDecl* of the superclass we're
        targetting (statically).
      
        4) Previously represented by an instance message whose receiver is a
        an ObjCSuperExpr, which Sema and CodeGen would check for via
        isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
        where we have both the location of the "super" keyword and the
        ObjCInterfaceDecl* of the superclass we're targetting
        (statically). Note that ObjCSuperExpr only has one remaining use in
        the AST, which is for "super.prop" references.
      
      The new representation of ObjCMessageExpr is 2 pointers smaller than
      the old one, since it combines more storage. It also eliminates a leak
      when we loaded message-send expressions from a precompiled header. The
      representation also feels much cleaner to me; comments welcome!
      
      This patch attempts to maintain the same semantics we previously had
      with Objective-C message sends. In several places, there are massive
      changes that boil down to simply replacing a nested-if structure such
      as:
      
        if (message has a receiver expression) {
          // instance message
          if (isa<ObjCSuperExpr>(...)) {
           // send to super
          } else {
           // send to an object
         }
        } else {
          // class message
          if (name->isStr("super")) {
            // class send to super
          } else {
            // send to class
          }
        }
      
      with a switch
      
        switch (E->getReceiverKind()) {
        case ObjCMessageExpr::SuperInstance: ...
        case ObjCMessageExpr::Instance: ...
        case ObjCMessageExpr::SuperClass: ...
        case ObjCMessageExpr::Class:...
        }
      
      There are quite a few places (particularly in the checkers) where
      send-to-super is effectively ignored. I've placed FIXMEs in most of
      them, and attempted to address send-to-super in a reasonable way. This
      could use some review.
      
      llvm-svn: 101972
      9a129194
    • Evan Cheng's avatar
      - Clean up some crappy code which deals with coalescing of copies which look at · 2034d9f2
      Evan Cheng authored
        extract_subreg / insert_subreg, etc.
      - Add support for more aggressive insert_subreg coalescing.
      
      llvm-svn: 101971
      2034d9f2
    • Dan Gohman's avatar
      Revert r101471. For tight recursive functions which have multiple · 4398308f
      Dan Gohman authored
      recursive callsites, inlining can reduce the number of calls by
      exponential factors, as it does in
      MultiSource/Benchmarks/Olden/treeadd. More involved heuristics
      will be needed.
      
      llvm-svn: 101969
      4398308f
    • Bill Wendling's avatar
      Handle a displacement location in 64-bit as an RIP-relative displacement. It · 11740305
      Bill Wendling authored
      fixes a bug (<rdar://problem/7880900>) in the JIT. This code wouldn't work:
      
      target triple = "x86_64-apple-darwin"
      
      define double @func(double %a) {
        %tmp1 = fmul double %a, 5.000000e-01            ; <double> [#uses=1]
        ret double %tmp1
      }
      
      define i32 @main() nounwind {
        %1 = call double @func(double 4.770000e-04) ; <i64> [#uses=0]
        ret i32 0
      }
      
      llvm-svn: 101965
      11740305
    • Evan Cheng's avatar
      Rewrite machine cse to avoid recursion. · 4b2ef56a
      Evan Cheng authored
      llvm-svn: 101964
      4b2ef56a
    • Dan Gohman's avatar
      Add another variant of this test which found a place where · ad33d337
      Dan Gohman authored
      CodeGen's ComputeMaskedBits was being over-conservative when computing
      bits for an ADD.
      
      llvm-svn: 101963
      ad33d337
    • Anders Carlsson's avatar
      Remove an unused parameter from isImplicitlyDefined. · b722993c
      Anders Carlsson authored
      llvm-svn: 101962
      b722993c
    • John Thompson's avatar
      Fix comment to reflect recent code change. · 7bc797b0
      John Thompson authored
      llvm-svn: 101960
      7bc797b0
    • Chris Lattner's avatar
      teach the x86 address matching stuff to handle · 84776786
      Chris Lattner authored
      (shl (or x,c), 3) the same as (shl (add x, c), 3)
      when x doesn't have any bits from c set.
      
      This finishes off PR1135.  Before we compiled the block to:
      to:
      
      LBB0_3:                                 ## %bb
      	cmpb	$4, %dl
      	sete	%dl
      	addb	%dl, %cl
      	movb	%cl, %dl
      	shlb	$2, %dl
      	addb	%r8b, %dl
      	shlb	$2, %dl
      	movzbl	%dl, %edx
      	movl	%esi, (%rdi,%rdx,4)
      	leaq	2(%rdx), %r9
      	movl	%esi, (%rdi,%r9,4)
      	leaq	1(%rdx), %r9
      	movl	%esi, (%rdi,%r9,4)
      	addq	$3, %rdx
      	movl	%esi, (%rdi,%rdx,4)
      	incb	%r8b
      	decb	%al
      	movb	%r8b, %dl
      	jne	LBB0_1
      
      Now we produce:
      
      LBB0_3:                                 ## %bb
      	cmpb	$4, %dl
      	sete	%dl
      	addb	%dl, %cl
      	movb	%cl, %dl
      	shlb	$2, %dl
      	addb	%r8b, %dl
      	shlb	$2, %dl
      	movzbl	%dl, %edx
      	movl	%esi, (%rdi,%rdx,4)
      	movl	%esi, 8(%rdi,%rdx,4)
      	movl	%esi, 4(%rdi,%rdx,4)
      	movl	%esi, 12(%rdi,%rdx,4)
      	incb	%r8b
      	decb	%al
      	movb	%r8b, %dl
      	jne	LBB0_1
      
      llvm-svn: 101958
      84776786
    • Ted Kremenek's avatar
      Fix USRs for 'extern' variables declaration in functions/method bodies. · 6d159c10
      Ted Kremenek authored
      Fix USRs for @synthesize.
      Add more USR tests.
      
      llvm-svn: 101954
      6d159c10
    • Ted Kremenek's avatar
      Specify linkage for Objective-C declarations. · 926d8608
      Ted Kremenek authored
      llvm-svn: 101953
      926d8608
    • Anders Carlsson's avatar
      Factor some common code out into a separate function. · cedc0a46
      Anders Carlsson authored
      llvm-svn: 101952
      cedc0a46
    • Dale Johannesen's avatar
      Because of the EMMS problem, right now we have to support · 0522b90c
      Dale Johannesen authored
      user-defined operations that use MMX register types, but
      the compiler shouldn't generate them on its own.  This adds
      a Synthesizable abstraction to represent this, and changes
      the vector widening computation so it won't produce MMX types.
      (The motivation is to remove noise from the ABI compatibility
      part of the gcc test suite, which has some breakage right now.)
      
      llvm-svn: 101951
      0522b90c
    • Devang Patel's avatar
      Rename ValueMapTy as ValueToValueMapTy to clearly indicate that this has no... · 21766432
      Devang Patel authored
      Rename ValueMapTy as ValueToValueMapTy to clearly indicate that this has no replationship with ADT/ValueMap.
      
      llvm-svn: 101950
      21766432
    • Devang Patel's avatar
      There is no need to install ValueMapper.h header. · 382b9696
      Devang Patel authored
      llvm-svn: 101949
      382b9696
    • Fariborz Jahanian's avatar
      Fixes a code gen. bug by removing an assert. · acdfa7ac
      Fariborz Jahanian authored
      It is ok to have c++-ness inside extern "C" 
      block. Fixes pr6644.
      
      llvm-svn: 101948
      acdfa7ac
  2. Apr 20, 2010
Loading