Commit Graph

98701 Commits

Author SHA1 Message Date
Bill Wendling 4466e981f9 Formatting changes. No functionality change.
llvm-svn: 122789
2011-01-03 23:59:05 +00:00
Owen Anderson 0839d3930a Fix comment.
llvm-svn: 122788
2011-01-03 23:51:56 +00:00
Owen Anderson d62d37225a Use the new addEscapingValue callback to update GlobalsModRef when GVN adds PHIs of GEPs. For the moment,
have GlobalsModRef handle this conservatively by simply removing the value from its maps.

llvm-svn: 122787
2011-01-03 23:51:43 +00:00
Evan Cheng f02ca16ba7 Convert MC tests to .s so codegen changes won't break them.
llvm-svn: 122786
2011-01-03 23:47:14 +00:00
Chris Lattner bde6ec1db6 Duncan deftly points out that readnone functions aren't
invalidated by stores, so they can be handled as 'simple'
operations.

llvm-svn: 122785
2011-01-03 23:38:13 +00:00
Argyrios Kyrtzidis cd12b63b47 Fix 80 column violation.
llvm-svn: 122784
2011-01-03 23:15:14 +00:00
Evan Cheng 65089fc6c7 Use pushq / popq instead of subq $8, %rsp / addq $8, %rsp to adjust stack in
prologue and epilogue if the adjustment is 8. Similarly, use pushl / popl if
the adjustment is 4 in 32-bit mode.

In the epilogue, takes care to pop to a caller-saved register that's not live
at the exit (either return or tailcall instruction).
rdar://8771137

llvm-svn: 122783
2011-01-03 22:53:22 +00:00
Douglas Gregor 752a595655 Implement pack expansions whose pattern is a base-specifier.
llvm-svn: 122782
2011-01-03 22:36:02 +00:00
Argyrios Kyrtzidis d5756a609d When in code-completion, skip obj-c method bodies for speed up.
llvm-svn: 122781
2011-01-03 22:33:06 +00:00
Douglas Gregor 7ec835f35b Add a test that is currently failing
llvm-svn: 122780
2011-01-03 21:56:22 +00:00
David Greene 544a3e932f Don't pattern match "clang-" as it may be part of a tool name with a
triple suffix.

llvm-svn: 122779
2011-01-03 21:55:08 +00:00
Wesley Peck 6941044c72 Fix more stack layout issues in the MBlaze backend.
llvm-svn: 122778
2011-01-03 21:40:26 +00:00
Owen Anderson b6e4ff0d85 Stub out a new updating interface to AliasAnalysis, allowing stateful analyses to be informed when
a pointer value has potentially become escaping.  Implementations can choose to either fall back to
conservative responses for that value, or may recompute their analysis to accomodate the change.

llvm-svn: 122777
2011-01-03 21:38:41 +00:00
Douglas Gregor 98318c2259 Properly rebuild pack expansions whose pattern is a non-type template
argument. As part of this, be more careful when determining if there
are any parameter packs that cannot be expanded.

llvm-svn: 122776
2011-01-03 21:37:45 +00:00
Douglas Gregor 875b6fe364 Unwrap template argument packs when checking the template arguments of
a class template partial specialiation, and look through pack
expansions when checking the conditions of C++0x [temp.class.spec]p8.

llvm-svn: 122774
2011-01-03 21:13:47 +00:00
Owen Anderson 4423070356 We can count properly.
llvm-svn: 122773
2011-01-03 21:08:22 +00:00
Chris Lattner 16e42128c2 fix rdar://8813415 - a miscompilation of 164.gzip that loop-idiom
exposed.  It turns out to be a latent bug in basicaa, scary.

llvm-svn: 122772
2011-01-03 21:03:33 +00:00
Chris Lattner 12fa3c6a94 filecheckize
llvm-svn: 122771
2011-01-03 21:01:26 +00:00
Johnny Chen c77e5b2f44 Fix typo of the test method name.
llvm-svn: 122770
2011-01-03 20:40:08 +00:00
Douglas Gregor 1440693c50 Diagnose the presence of unexpanded parameter packs within class
template partial specialization arguments.

llvm-svn: 122769
2011-01-03 20:35:03 +00:00
Oscar Fuentes 0db031d532 TableGen.cmake: sometimes the .td file is not in the current directory
(clang/include/clang/Basic/StmtNodes.td, for instance, is tablegenned
from clang/include/clang/AST/CMakeLists.txt) so it is not contained on
the list of all .td files on the current source directory which is
used as the DEPENDS of the custom command. We must add the .td file to
the DEPENDS list of the custom command. Otherwise some .inc files are
not regenerated when the corresponding .td file changes.

llvm-svn: 122768
2011-01-03 20:01:32 +00:00
Johnny Chen 9ebe1724e3 Updated comment.
llvm-svn: 122767
2011-01-03 19:55:37 +00:00
Argyrios Kyrtzidis a8636f1b3e Remove a couple of setters that have no callers.
llvm-svn: 122766
2011-01-03 19:52:51 +00:00
Argyrios Kyrtzidis 76dbe8c800 Speed up code-completion by skipping function bodies.
When we are in code-completion mode, skip parsing of all function bodies except the one where the
code-completion point resides.

For big .cpp files like 'SemaExpr.cpp' the improvement makes a huge difference, in some cases cutting down
code-completion time -62% !

We don't get diagnostics for the bodies though, so modify the code-completion tests that check for errors.

See rdar://8814203.

llvm-svn: 122765
2011-01-03 19:44:02 +00:00
Douglas Gregor 968f23ab97 Implement support for pack expansions in initializer lists and
expression lists.

llvm-svn: 122764
2011-01-03 19:31:53 +00:00
Chandler Carruth 8e666510f6 Fix PR8841 by checking for both semantic and lecical dependent
contexts. This prevents -Wunused-function from firing on friend function
definitions inside of class templates for example.

llvm-svn: 122763
2011-01-03 19:27:19 +00:00
Fariborz Jahanian 9a7d57d57f Consider zero-length array of structs when
computing ivar layouts for objc-gc.
Fixes // rdar://8800513

llvm-svn: 122762
2011-01-03 19:23:18 +00:00
Douglas Gregor a3efea1881 Refactor the tree transform's many loops over sets of expressions
(transforming each in turn) into calls into one central routine
(TransformExprs) that transforms a list of expressions. This
refactoring is preparatory work for pack expansions whose in an
expression-list. 

No functionality change.

llvm-svn: 122761
2011-01-03 19:04:46 +00:00
Owen Anderson 3a33d0cc4a Simplify GVN's value expression structure, allowing the elimination of a lot of
almost-but-not-quite-identical code.  No intended functionality change.

llvm-svn: 122760
2011-01-03 19:00:11 +00:00
Chris Lattner 16ca19ffc5 stength reduce my previous patch a bit. The only instructions
that are allowed to have metadata operands are intrinsic calls,
and the only ones that take metadata currently return void.
Just reject all void instructions, which should not be value
numbered anyway.  To future proof things, add an assert to the
getHashValue impl for calls to check that metadata operands 
aren't present.

llvm-svn: 122759
2011-01-03 18:43:03 +00:00
Chris Lattner 142f1cd251 fix PR8895: metadata operands don't have a strong use of their
nested values, so they can change and drop to null, which can
change the hash and cause havok.

It turns out that it isn't a good idea to value number stuff
with metadata operands anyway, so... don't.

llvm-svn: 122758
2011-01-03 18:28:15 +00:00
Fariborz Jahanian c63f1c5ab6 Guard lazy synthesis of provisional ivars under the new
-fobjc-default-synthesize-properties flag.

llvm-svn: 122757
2011-01-03 18:08:02 +00:00
Argyrios Kyrtzidis 7cd69249fa In the latest episode of "Deserializing bugs caused by accessors" the series reached a thrilling climax when
FunctionDecl::setPure crashed a poor user's code.

Remove the use of this accessor when deserializing, along with several other in the neighborhood. Fixes rdar://8759653.

llvm-svn: 122756
2011-01-03 17:57:40 +00:00
Chandler Carruth 540960f4a2 Fix PR8654, ensuring each branch of an #if, #elif, #else, ... chain
receives a PPCallback.

Patch by Richard Smith.

llvm-svn: 122755
2011-01-03 17:40:17 +00:00
David Greene dc276c315c Reapply 122341 to fix PR8199 now that clang changes are in.
llvm-svn: 122754
2011-01-03 17:30:25 +00:00
David Greene 7b29345ff3 Support lit fixes for PR8199
Replace "clang++" with "clang\+\+" because we have to escape regexp
special characters now.  This is in preparation for changes to lit to
fix PR8199.  Tests will fail until the lit part gets committed.

llvm-svn: 122753
2011-01-03 17:28:52 +00:00
Douglas Gregor fdfd41375a Another variadic template metafunction test case: summing values.
llvm-svn: 122752
2011-01-03 17:25:02 +00:00
Douglas Gregor e8e9dd624c Implement support for pack expansions whose pattern is a non-type
template argument (described by an expression, of course). For
example:

  template<int...> struct int_tuple { };

  template<int ...Values>
  struct square {
    typedef int_tuple<(Values*Values)...> type;
  };

It also lays the foundation for pack expansions in an initializer-list.
  

llvm-svn: 122751
2011-01-03 17:17:50 +00:00
Oscar Fuentes 67cce9b135 Use some of the llvm cmake infraestructure. This takes care of
disabling rtti and exceptions where requested. Remove some unnecessary
code too.

llvm-svn: 122750
2011-01-03 17:00:02 +00:00
Oscar Fuentes 13ce15ca69 LLVMProcessSources: add .def files along with .h files to targets for
the benefit of project-based generators (VS, XCode, etc).

llvm-svn: 122749
2011-01-03 16:59:52 +00:00
Douglas Gregor 3d90ae27e7 Consolidate template metafunction tests for variadic templates into a single file
llvm-svn: 122748
2011-01-03 16:17:20 +00:00
Oscar Fuentes 2835efdc75 Set LLVM_NO_RTTI and LLVM_USED_LIBS for clangStaticAnalyzerCheckers
Patch by arrowdodger!

llvm-svn: 122747
2011-01-03 14:53:25 +00:00
Duncan Sands 697de77339 Speed up instsimplify by about 10-15% by not bothering to retry
InstructionSimplify on instructions that didn't change since the
last time round the loop.

llvm-svn: 122745
2011-01-03 10:50:04 +00:00
Douglas Gregor bfe022caa1 When we attempt to create a built-in that involves a library type we
don't have access to (e.g., fprintf, which needs the library type
FILE), fail with a warning and forget about the builtin
entirely. Previously, we would actually provide an error, which breaks
autoconf's super-lame checks for fprintf, longjmp, etc. Fixes PR8316.

llvm-svn: 122744
2011-01-03 09:37:44 +00:00
Evan Cheng 150d2124b2 Undo what looks like accidental removal of an instcombine pass in r122740.
llvm-svn: 122743
2011-01-03 07:53:18 +00:00
Cameron Zwarich 43cecb1200 Switch a worklist in CodeGenPrepare to SmallVector and increase the inline
capacity on the Visited SmallPtrSet. On 403.gcc, this is about a 4.5% speedup of
CodeGenPrepare time (which itself is 10% of time spent in the backend).

This is progress towards PR8889.

llvm-svn: 122741
2011-01-03 06:33:01 +00:00
Chris Lattner b5d1579c72 Turn on earlycse by default. This seems to be a small performance
improvement in the generated code, and speeds up 'opt -std-compile-opts'
compile time on 176.gcc from 24.84s to 23.2s (about 7%).

This also resolves a specific code quality issue in rdar://7352081 which
was generating poor code for:

int t(int a, int b) {
  if (a & b & 1)
    return a & b;
  return 3;
}

llvm-svn: 122740
2011-01-03 06:19:09 +00:00
Nick Lewycky 80b2e8151e Further expand what a call graph pass may do.
The rationale is that after analyzing a function in the SCC, we may want to
modify it in a way that requires us to update its uses (f.e. to replace the
call with a constant) or its users (f.e. to call it with fewer arguments).

llvm-svn: 122739
2011-01-03 06:16:07 +00:00
Chris Lattner 9e5e9ed79a earlycse can do trivial with-a-block dead store
elimination as well.  This deletes 60 stores in 176.gcc
that largely come from bitfield code.

llvm-svn: 122736
2011-01-03 04:17:24 +00:00
Cameron Zwarich 18f164f7c9 Use a RecyclingAllocator to allocate values for MachineCSE's ScopedHashTable for
a 28% speedup of MachineCSE time on 403.gcc.

llvm-svn: 122735
2011-01-03 04:07:46 +00:00