Commit Graph

124162 Commits

Author SHA1 Message Date
Daniel Dunbar f07b5ec0dc IRgen/ABI/x86_64: Avoid passing small structs using byval sometimes.
- We do this when it is easy to determine that the backend will pass them on
   the stack properly by itself.

Currently LLVM codegen is really bad in some cases with byval, for example, on
the test case here (which is derived from Sema code, which likes to pass
SourceLocations around)::

  struct s47 { unsigned a; };
  void f47(int,int,int,int,int,int,struct s47);
  void test47(int a, struct s47 b) { f47(a, a, a, a, a, a, b); }

we used to emit code like this::

  ...
  movl	%esi, -8(%rbp)
  movl	-8(%rbp), %ecx
  movl	%ecx, (%rsp)
  ...

to handle moving the struct onto the stack, which is just appalling.

Now we generate::

  movl	%esi, (%rsp)

which seems better, no?

llvm-svn: 152462
2012-03-10 01:03:58 +00:00
Fariborz Jahanian 2677dede22 Minor change to my last rewrite patch.
llvm-svn: 152461
2012-03-10 00:53:02 +00:00
Jakob Stoklund Olesen 99014ff206 Report the defining instruction.
llvm-svn: 152460
2012-03-10 00:44:11 +00:00
Fariborz Jahanian 34327fcdae objc modern rewriter: Mark class and ivar definitions with __declspec(dllexport)
// rdar://11023563

llvm-svn: 152459
2012-03-10 00:39:34 +00:00
Jakob Stoklund Olesen 9f3e5744ab Add SSA verification to MachineVerifier.
Somehow we never verified SSA dominance before.

llvm-svn: 152458
2012-03-10 00:36:06 +00:00
Jakob Stoklund Olesen 6ea6a14458 Use SmallPtrSet instead of DenseSet.
llvm-svn: 152457
2012-03-10 00:36:04 +00:00
Douglas Gregor dfa5b22238 Qualifiers on a canonical array type go on the outermost type, not the
innermost type. Fixes PR12142.

llvm-svn: 152456
2012-03-10 00:29:33 +00:00
Richard Smith 4e9e523fcf Assign APValues by swapping from a temporary. Removes a bunch of unnecessary
copy-construction, which Daniel Dunbar reports as giving a 0.75% speedup on
403.gcc/combine.c. The performance differences on my constexpr torture tests
are below the noise floor.

llvm-svn: 152455
2012-03-10 00:28:11 +00:00
Benjamin Kramer e1e549d617 Give dagcombiner's worklist some inline capacity.
llvm-svn: 152454
2012-03-10 00:23:58 +00:00
Jim Ingham ab175242d9 Fix the process of getting the ObjC runtime - if we ask for it too early (in the process of handling the
load notification for the first load) then we will set it the runtime to NULL and won't re-search for it.
Added a way for the dynamic loader to force a re-search, since it knows the world has changed.

llvm-svn: 152453
2012-03-10 00:22:19 +00:00
Akira Hatanaka da00aa80b6 Do not custom lower i64 nodes if i64 is not a legal type. Move lines that set
operation action of nodes.

llvm-svn: 152452
2012-03-10 00:03:50 +00:00
Fariborz Jahanian c2e2ad6486 objective-c modern rewriter. More fixes related to rewriting
ivars in the modern rewriter.

llvm-svn: 152451
2012-03-09 23:46:23 +00:00
Akira Hatanaka b7f78592e2 Lower SETCC nodes during legalization. Previously, it was lowered in DAG combine pass.
llvm-svn: 152450
2012-03-09 23:46:03 +00:00
Jakob Stoklund Olesen 7d544f9165 Assert on SSA errors in LiveVariables.
All uses of a virtual register must be dominated by its def.

llvm-svn: 152449
2012-03-09 23:41:44 +00:00
Ted Kremenek 33be12003f Teach RetainCountChecker about mixing method families with explicit annotations. Fixes <rdar://problem/10824732>.
llvm-svn: 152448
2012-03-09 23:34:08 +00:00
Akira Hatanaka 3e914578c5 Remove unused header files.
llvm-svn: 152447
2012-03-09 23:28:30 +00:00
Douglas Gregor bcfe5582a5 Document the conversion from a lambda closure type to a block pointer
in Objective-C++.

llvm-svn: 152446
2012-03-09 23:24:48 +00:00
Andrew Trick af1bee7235 misched: handle scheduler that insert instructions at empty region boundaries.
And add comments, since this is obviously confusing.

llvm-svn: 152445
2012-03-09 22:34:56 +00:00
Richard Smith 2a70e65436 Improve diagnostics for UCNs referring to control characters and members of the
basic source character set in C++98. Add -Wc++98-compat diagnostics for same in
literals in C++11. Extend such support to cover string literals as well as
character literals, and mark N2170 as done.

This seems too minor to warrant a release note to me. Let me know if you disagree.

llvm-svn: 152444
2012-03-09 22:27:51 +00:00
Kevin Enderby deed5aaa41 Add the missing call to Error when a bad X86 scale expression is parsed.
llvm-svn: 152443
2012-03-09 22:24:10 +00:00
Daniel Dunbar 900ceade87 [Sema] Fix a diag change to include a range that appeared intended, but never
actually happened.

llvm-svn: 152442
2012-03-09 21:38:22 +00:00
Nico Weber 97bd94bd98 Update comment after r152140. Clarify a bit too.
llvm-svn: 152441
2012-03-09 21:19:44 +00:00
Anna Zaks 394d07ea88 [analyzer] Add support for NoRedundancy inlining mode.
We do not reanalyze a function, which has already been analyzed as an
inlined callee. As per PRELIMINARY testing, this gives over
50% run time reduction on some benchmarks without decreasing of the
number of bugs found.

Turning the mode on by default.

llvm-svn: 152440
2012-03-09 21:14:01 +00:00
Anna Zaks c255577062 CallGraph: Add getNode() method, constify.
llvm-svn: 152439
2012-03-09 21:13:53 +00:00
Jim Ingham 329617a80a Make debugserver quieter about memory read errors.
<rdar://problem/10681220>

llvm-svn: 152438
2012-03-09 21:09:42 +00:00
Argyrios Kyrtzidis b7d1ca27bd Allow serializing an invalid ParmVarDecl and don't set access to public for
invalid ParmVarDecls.

Part of rdar://11007039.

llvm-svn: 152437
2012-03-09 21:09:04 +00:00
David Meyer 6c614bf717 Support reading GNU symbol versions in ELFObjectFile
* Add enums and structures for GNU version information.
* Implement extraction of that information on a per-symbol basis (ELFObjectFile::getSymbolVersion).
* Implement a generic interface, GetELFSymbolVersion(), for getting the symbol version from the ObjectFile (hides the templating).
* Have llvm-readobj print out the version, when available.
* Add a test for the new feature: readobj-elf-versioning.test

llvm-svn: 152436
2012-03-09 20:59:52 +00:00
David Meyer d53422d1a7 [Object]
Make Binary::TypeID more granular, to distinguish between ELF 32/64 little/big

llvm-svn: 152435
2012-03-09 20:41:57 +00:00
Daniel Dunbar 4fccc877c9 Revert r152430 "[AST] Mark ASTContext::getTypeInfo and some friends as
LLVM_READONLY.", getTypeInfo() is totally not READONLY, which I should have
probably noticed given that I made it so mere hours ago. Oops.

llvm-svn: 152434
2012-03-09 20:41:19 +00:00
Matt Beaumont-Gay 639ac334c7 Add a helper to get a CXXConstructExpr from a CXXNewExpr.
llvm-svn: 152433
2012-03-09 20:36:34 +00:00
Argyrios Kyrtzidis 2559629c5b Improve our semantic error recovery.
When an error made a record member invalid, the record would stay as "isBeingDefined" and
not "completeDefinition". Even easily recoverable errors ended up propagating records in
such "beingDefined" state, for example:

struct A {
  ~A() const; // expected-error {{'const' qualifier is not allowed on a destructor}}
};
struct B : A {}; // A & B would stay as "not complete definition" and "being defined".

This weird state was impending lookups in the records and hitting assertion in the ASTWriter.

Part of rdar://11007039

llvm-svn: 152432
2012-03-09 20:10:30 +00:00
Daniel Dunbar d5744b9910 [AST] Mark Expr::Ignore*() functions as LLVM_READONLY.
llvm-svn: 152431
2012-03-09 20:02:56 +00:00
Daniel Dunbar b150e1b1af [AST] Mark ASTContext::getTypeInfo and some friends as LLVM_READONLY.
llvm-svn: 152430
2012-03-09 20:02:54 +00:00
Daniel Dunbar 0fbc2bd499 [AST] Mark Expr::getExprLoc() as LLVM_READONLY.
llvm-svn: 152429
2012-03-09 20:02:51 +00:00
Daniel Dunbar eda65572bb [Sema] Remove dead getSourceRange() call, caught by Clang after marking
LLVM_READONLY.

llvm-svn: 152428
2012-03-09 20:02:47 +00:00
Jim Ingham 34aae5b9bc Handle the case where we get called to determine the ObjC runtime version BEFORE the loader code has
winnowed all the unloaded libraries from the process module list.
<rdar://problem/11015223>

llvm-svn: 152427
2012-03-09 19:59:28 +00:00
Daniel Dunbar e4775e1659 [AST/etc] Mark {getSourceRange(),getStartLoc(),getEndLoc()} as LLVM_READONLY.
- The theory here is that we have these functions sprinkled in all over the
   place. This should allow the optimizer to at least realize it can still do
   load CSE across these calls.
 - I blindly marked all instances as such, even though the optimizer can infer
   this attribute in some instances (some of the inline ones) as that was easier
   and also, when given the choice between thinking and not thinking, I prefer
   the latter.

You might think this is mere frivolity, but actually this is good for a .7 -
1.1% speedup on 403.gcc/combine.c, JSC/Interpreter.cpp,
OGF/NSBezierPath-OAExtensions.m.

llvm-svn: 152426
2012-03-09 19:35:29 +00:00
Duncan Sands 14eb175836 Add statistics on removed switch cases, and fix the phi statistic
to count the number of phis changed, not the number visited.

llvm-svn: 152425
2012-03-09 19:21:15 +00:00
Richard Smith f5a0d10c2c Add user-defined literals to release notes.
llvm-svn: 152424
2012-03-09 19:09:47 +00:00
Enrico Granata 332b0b9a2f Fixing a problem with the NSSet summary provider; plus, providing a further optimization to the whole Cocoa formatters infrastructure
llvm-svn: 152423
2012-03-09 19:04:53 +00:00
Gregory Szorc 3a08300585 [llvm.py] Make ObjectFile destructor work
Previous code had a double free in MemoryBuffer. The tests now pass.

llvm-svn: 152422
2012-03-09 18:56:33 +00:00
Dan Gohman 500b598c5c When identifying exit nodes for the reverse-CFG reverse-post-order
traversal, consider nodes for which the only successors are backedges
which the traversal is ignoring to be exit nodes. This fixes a problem
where the bottom-up traversal was failing to visit split blocks along
split loop backedges. This fixes rdar://10989035.

llvm-svn: 152421
2012-03-09 18:50:52 +00:00
Fariborz Jahanian c8a322a407 lldb support: under debugger support flag, when sending message
to forward class, and assigning to an 'id' type var, message
sends default to 'id'. // rdar"//10988847

llvm-svn: 152420
2012-03-09 18:47:16 +00:00
Daniel Dunbar 62ee6417ac [AST/Sema/libclang] Replace getSourceRange().getBegin() with getLocStart().
- getSourceRange().getBegin() is about as awesome a pattern as .copy().size().

I already killed the hot paths so this doesn't seem to impact performance on my
tests-of-the-day, but it is a much more sensible (and shorter) pattern.

llvm-svn: 152419
2012-03-09 18:35:03 +00:00
Daniel Dunbar ddb83c7194 [AST/Sema] Add {CXXBaseSpecifier,Declarator,DeclSpec,TypeLoc,UnqualifiedId}::getLoc{Start,End}.
llvm-svn: 152418
2012-03-09 18:34:54 +00:00
Howard Hinnant 3bfc622bdb Enable / silence -Wunused-parameter.
llvm-svn: 152415
2012-03-09 18:01:37 +00:00
Kevin Enderby 014e1cde5f Fix the x86 disassembler to at least print the lock prefix if it is the first
prefix.  Added a FIXME to remind us this still does not work when it is not the
first prefix.

llvm-svn: 152414
2012-03-09 17:52:49 +00:00
Daniel Dunbar 3618cb7b6b [Support] Drop verbose _ATTRIBUTE from LLVM_ATTRIBUTE_{READONLY,READNONE} macro
names.

llvm-svn: 152413
2012-03-09 16:30:33 +00:00
Daniel Dunbar cdf295c532 [AST] Define a few more key getLocStart() implementations.
- This cuts the # of getSourceRange calls by 60% on
   OGF/NSBezierPath-OAExtensions.m.

llvm-svn: 152412
2012-03-09 15:39:24 +00:00
Daniel Dunbar b0ab5e9f5c [AST] Reimplement Stmt::getLoc{Start,End} to dispatch to subclass overloads.
- getSourceRange() can be very expensive, we should try to avoid it if at all possible.

In conjunction with the previous commit I measured a ~2% speedup on 403.gcc/combine.c and a 3% speedup on OmniGroupFrameworks/NSBezierPath-OAExtensions.m.

llvm-svn: 152411
2012-03-09 15:39:19 +00:00