Commit Graph

98536 Commits

Author SHA1 Message Date
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
Nick Lewycky 00f1b801b1 Permit CallGraphSCCPasses readonly access to the direct callers of the functions
in their SCC as they already have with the direct callees.

llvm-svn: 122734
2011-01-03 04:01:44 +00:00
Chris Lattner 4b9a525742 switch the load table to use a recycling bump pointer allocator,
speeding earlycse up by 6%.

llvm-svn: 122733
2011-01-03 03:53:50 +00:00
Chris Lattner e0e32a9ef0 now that loads are in their own table, we can implement
store->load forwarding.  This allows EarlyCSE to zap 600 more
loads from 176.gcc.

llvm-svn: 122732
2011-01-03 03:46:34 +00:00
Chris Lattner 92bb0f9f9d split loads and calls into separate tables. Loads are now just indexed
by their pointer instead of using MemoryValue to wrap it.

llvm-svn: 122731
2011-01-03 03:41:27 +00:00
Chris Lattner 0446bb23f8 add a testcase for readonly call CSE
llvm-svn: 122730
2011-01-03 03:33:47 +00:00
Chris Lattner 4cb365414f various cleanups, no functionality change.
llvm-svn: 122729
2011-01-03 03:28:23 +00:00
Nick Lewycky 0f87ca7733 Add spliceFunction to the CallGraph interface. This allows users to efficiently
update a callGraph when performing the common operation of splicing the body to
a new function and updating all callers (such as via RAUW).

No users yet, though this is intended for DeadArgumentElimination as part of
PR8887.

llvm-svn: 122728
2011-01-03 03:19:35 +00:00
Chris Lattner b9a8efc960 Teach EarlyCSE to do trivial CSE of loads and read-only calls.
On 176.gcc, this catches 13090 loads and calls, and increases the
number of simple instructions CSE'd from 29658 to 36208.

llvm-svn: 122727
2011-01-03 03:18:43 +00:00
Chris Lattner effec5f9df add a handy typedef.
llvm-svn: 122726
2011-01-03 03:16:20 +00:00
Chris Lattner 79d83067ee rename InstValue to SimpleValue, add some comments.
llvm-svn: 122725
2011-01-03 02:20:48 +00:00
Michael J. Spencer edb5bcdde5 CMake: Add missing source file.
llvm-svn: 122724
2011-01-03 02:13:05 +00:00
Chris Lattner d815f69b30 Allocate nodes for the scoped hash table from a recyling bump pointer
allocator.  This speeds up early cse by about 20%

llvm-svn: 122723
2011-01-03 01:42:46 +00:00
Chris Lattner 2f1c34f15e really get this working with a custom allocator.
llvm-svn: 122722
2011-01-03 01:38:29 +00:00
Chris Lattner d11fd779f2 Enhance ScopedHashTable to allow it to take an allocator argument.
llvm-svn: 122721
2011-01-03 01:29:37 +00:00
Chris Lattner 02a9776b64 reduce redundancy in the hashing code and other misc cleanups.
llvm-svn: 122720
2011-01-03 01:10:08 +00:00