Commit Graph

82874 Commits

Author SHA1 Message Date
Daniel Dunbar 53fac692fa ABI/x86-32 & x86-64: Alignment on 'byval' must be set when when the alignment
exceeds the minimum ABI alignment.

llvm-svn: 102019
2010-04-21 19:49:55 +00:00
Daniel Dunbar f5dbc072a6 Convert test to FileCheck.
llvm-svn: 102018
2010-04-21 19:34:17 +00:00
Daniel Dunbar 14ec60024c Convert test to FileCheck.
llvm-svn: 102016
2010-04-21 19:10:54 +00:00
Daniel Dunbar 557893d2a8 IRgen/x86-32: Factor out getIndirectResult(), to match x86-64 factoring.
llvm-svn: 102015
2010-04-21 19:10:51 +00:00
Daniel Dunbar 2ba67440b6 IRgen: Add checking that the LLVM and AST record layout offsets agree (for
non-bit-fields).

llvm-svn: 102014
2010-04-21 19:10:49 +00:00
Devang Patel 1a6e399874 Add command line option to disable debug info printing in .s file. This option does not impact debug info generation and preservation through earlier compile starges.
llvm-svn: 102012
2010-04-21 19:08:53 +00:00
Fariborz Jahanian 422cb21862 Improve on source location of diagnostic when default
property synthesis is using a super class ivar.

llvm-svn: 102011
2010-04-21 18:57:20 +00:00
Anders Carlsson a01874bf44 Pass the InitializedEntity to Sema::CheckConstructorAccess and use it to report different diagnostics depending on which entity is being initialized.
llvm-svn: 102010
2010-04-21 18:47:17 +00:00
Bob Wilson 4c7f50afb8 Fix a performance problem with the new SSAUpdater. This showed up in the
GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000.

llvm-svn: 102009
2010-04-21 18:39:03 +00:00
Johnny Chen d85afee134 Modified some assert() msg strings; no other functionality change.
llvm-svn: 102008
2010-04-21 18:37:48 +00:00
Anders Carlsson 34f54d55e2 Comment out an assert for now.
llvm-svn: 102007
2010-04-21 18:03:05 +00:00
Jakob Stoklund Olesen 8a070a540d Add fast register allocator, enabled with -regalloc=fast.
So far this is just a clone of -regalloc=local that has been lobotomized to run
25% faster. It drops the least-recently-used calculations, and is just plain
stupid when it runs out of registers.

The plan is to make this go even faster for -O0 by taking advantage of the short
live intervals in unoptimized code. It should not be necessary to calculate
liveness when most virtual registers are killed 2-3 instructions after they are
born.

llvm-svn: 102006
2010-04-21 18:02:42 +00:00
Fariborz Jahanian 6db6ce4fe4 Fix typo.
llvm-svn: 102005
2010-04-21 17:09:27 +00:00
Devang Patel 0940a8085e Identify when a lexical scope is split in to multiple instruction ranges. Emit such ranges using DW_AT_ranges.
llvm-svn: 102004
2010-04-21 16:32:19 +00:00
Dan Gohman a029cbe93f Make ScalarEvolution::getConstant support pointer types, for consistency
with ScalarEvolution's overall approach to pointer types.

llvm-svn: 102003
2010-04-21 16:04:04 +00:00
Duncan Sands fe29117f6c Dragonegg will be released along side llvm-2.7.
llvm-svn: 102001
2010-04-21 13:51:48 +00:00
Benjamin Kramer 3aac9c5edb Add more const to ConstExprIterator.
llvm-svn: 101999
2010-04-21 12:21:20 +00:00
John McCall bf814c79b6 I failed to notice that my last patch wasn't doing as much as it could
because EmitBranch actually clears the insert point.  This version
actually accomplishes what I initially wanted.

llvm-svn: 101998
2010-04-21 11:18:06 +00:00
John McCall e683359fc9 Teach EmitBlock to put the target block immediately after the current block
(if there's a current block).  The chief advantage of doing this is that it
lets us pick blocks (e.g. EH blocks) to push to the end of the function so
that fallthrough happens consistently --- i.e. it gives us the flexibility
of ordering blocks as we please without having to change the order in which
we generate code.  There are standard (?) optimization passes which can do some
of that for us, but better to generate reasonable code to begin with.

llvm-svn: 101997
2010-04-21 10:29:06 +00:00
John McCall 2188696d98 Miscellaneous codegen cleanups. Mostly, don't create new basic blocks
just to save the current insertion state!  This change significantly
simplifies the IR CFG in exceptions code.

llvm-svn: 101996
2010-04-21 10:05:39 +00:00
Chris Lattner a668b45ebd final hacking for tonight, still more to go.
llvm-svn: 101995
2010-04-21 06:42:24 +00:00
Zhongxing Xu 105dfb5a72 CXXNamedCastExpr is actually an abstract expression.
llvm-svn: 101994
2010-04-21 06:32:25 +00:00
Chris Lattner 1dcca8bd5e continue the process of detangling this.
llvm-svn: 101992
2010-04-21 06:23:40 +00:00
Douglas Gregor 3ecc665505 Sink the _GNU_SOURCE definition down into the target configuration,
and only define it where we know we need it---Linux and Cygwin. Thanks
to Chris for the prodding.

llvm-svn: 101989
2010-04-21 05:52:38 +00:00
Douglas Gregor 58c65652a8 Reword the note we emit when suppressing template instantiation contexts, per John's advice
llvm-svn: 101988
2010-04-21 05:40:43 +00:00
Chris Lattner 87e049558e rough pass moving stuff into relevant sections, still much
editing to do.

llvm-svn: 101987
2010-04-21 05:17:40 +00:00
Blaine Garst b4d7aa6fd6 update copyright notices
llvm-svn: 101986
2010-04-21 04:34:46 +00:00
Chris Lattner 52791c2bc9 remove ldc, rubinious, macruby, icedtea, llvm-lua, which
don't have updates for 2.7.

llvm-svn: 101985
2010-04-21 04:28:21 +00:00
Evan Cheng 4158a0ff6b Implement -disable-non-leaf-fp-elim which disable frame pointer elimination
optimization for non-leaf functions. This will be hooked up to gcc's
-momit-leaf-frame-pointer option. rdar://7886181

llvm-svn: 101984
2010-04-21 03:18:23 +00:00
Zhongxing Xu f29231ece0 The second check point in the old test case was invalid.
llvm-svn: 101983
2010-04-21 02:22:25 +00:00
John McCall 465dfb2705 Use const_cast instead of a C cast. Safer, plus it suppresses a gcc warning.
llvm-svn: 101982
2010-04-21 02:20:33 +00:00
Zhongxing Xu 3affbe6b50 Use the right predecessor.
llvm-svn: 101981
2010-04-21 02:20:10 +00:00
Zhongxing Xu d80755dac2 Add initial support for C++ delete expr.
llvm-svn: 101980
2010-04-21 02:17:31 +00:00
Evan Cheng 9c8cd8c061 isel (i32 anyext i16) as insert_subreg when 16-bit ops are being promoted.
llvm-svn: 101979
2010-04-21 01:47:12 +00:00
Evan Cheng 873310f635 Trim include.
llvm-svn: 101978
2010-04-21 01:39:06 +00:00
Dan Gohman 57c732b032 Add more const qualifiers on TargetMachine and friends.
llvm-svn: 101977
2010-04-21 01:34:56 +00:00
Dan Gohman cc5e6528a5 Update CMakeLists.txt.
llvm-svn: 101976
2010-04-21 01:32:29 +00:00
Dan Gohman 450aa64fc1 Move several SelectionDAG-independent utility functions out of the
SelectionDAG directory and into a new Analysis.cpp file.

llvm-svn: 101975
2010-04-21 01:22:34 +00:00
Johnny Chen dd56c40591 Thumb instructions which have reglist operands at the end and predicate operands
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
2010-04-21 01:01:19 +00:00
Chris Lattner 6fbe704932 Implement (but don't enable) PR6724 and rdar://6295824. In short,
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
2010-04-21 00:47:40 +00:00
Douglas Gregor 9a12919421 Overhaul the AST representation of Objective-C message send
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
2010-04-21 00:45:42 +00:00
Evan Cheng 2034d9f2da - Clean up some crappy code which deals with coalescing of copies which look at
extract_subreg / insert_subreg, etc.
- Add support for more aggressive insert_subreg coalescing.

llvm-svn: 101971
2010-04-21 00:44:22 +00:00
Dan Gohman 4398308fa7 Revert r101471. For tight recursive functions which have multiple
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
2010-04-21 00:43:30 +00:00
Bill Wendling 11740305f9 Handle a displacement location in 64-bit as an RIP-relative displacement. It
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
2010-04-21 00:34:04 +00:00
Evan Cheng 4b2ef56ad2 Rewrite machine cse to avoid recursion.
llvm-svn: 101964
2010-04-21 00:21:07 +00:00
Dan Gohman ad33d33719 Add another variant of this test which found a place where
CodeGen's ComputeMaskedBits was being over-conservative when computing
bits for an ADD.

llvm-svn: 101963
2010-04-21 00:19:28 +00:00
Anders Carlsson b722993cff Remove an unused parameter from isImplicitlyDefined.
llvm-svn: 101962
2010-04-20 23:32:58 +00:00
John Thompson 7bc797b0ca Fix comment to reflect recent code change.
llvm-svn: 101960
2010-04-20 23:21:17 +00:00
Chris Lattner 84776786a7 teach the x86 address matching stuff to handle
(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
2010-04-20 23:18:40 +00:00
Ted Kremenek 6d159c1060 Fix USRs for 'extern' variables declaration in functions/method bodies.
Fix USRs for @synthesize.
Add more USR tests.

llvm-svn: 101954
2010-04-20 23:15:40 +00:00