Commit Graph

130198 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen bc90a4ea82 Require and preserve LoopInfo for early if-conversion.
It will surely be needed by heuristics.

llvm-svn: 160027
2012-07-10 22:39:56 +00:00
Chandler Carruth 2207f76cd4 Teach the LiveInterval::join function to use the fast merge algorithm,
generalizing its implementation sufficiently to support this value
number scenario as well.

This cuts out another significant performance hit in large functions
(over 10k basic blocks, etc), especially those with "natural" CFG
structures.

llvm-svn: 160026
2012-07-10 22:25:21 +00:00
Jakob Stoklund Olesen 02638392c1 Run early if-conversion in domtree post-order.
This ordering allows nested if-conversion without using a work list, and
it makes it possible to update the dominator tree on the fly as well.

Any erased basic blocks will always be dominated by the current
post-order position, so the domtree can be pruned without invalidating
the iterator.

llvm-svn: 160025
2012-07-10 22:18:23 +00:00
Richard Smith 9fce7bc721 Fix crash when constant-evaluating a CXXConstructExpr representing
value-initialization for an array of class type with a trivial default
constructor.

llvm-svn: 160024
2012-07-10 22:12:55 +00:00
Jordan Rose eab627b951 [analyzer] Construct stack variables directly in their VarDecl.
Also contains a number of tweaks to inlining that are necessary
for constructors and destructors. (I have this enabled on a private
branch, but it is very much unstable.)

llvm-svn: 160023
2012-07-10 22:08:01 +00:00
Jordan Rose d1d54aa131 [analyzer] Use CallEvent for building inlined stack frames.
In order to accomplish this, we now build the callee's stack frame
as part of the CallEnter node, rather than the subsequent BlockEdge node.
This should not have any effect on perceived behavior or diagnostics.

This makes it safe to re-enable inlining of member overloaded operators.

llvm-svn: 160022
2012-07-10 22:07:57 +00:00
Jordan Rose fbe6dba15a [analyzer] Make CallEnter, CallExitBegin, and CallExitEnd not be StmtPoints
These ProgramPoints are used in inlining calls,
and not all calls have associated statements anymore.

llvm-svn: 160021
2012-07-10 22:07:52 +00:00
Jordan Rose 4ee71b8a18 [analyzer] Add a CXXDestructorCall CallEvent.
While this work is still fairly tentative (destructors are still left out of
the CFG by default), we now handle destructors in the same way as any other
calls, instead of just automatically trying to inline them.

llvm-svn: 160020
2012-07-10 22:07:47 +00:00
Jordan Rose 681cce9908 [analyzer] Add new PreImplicitCall and PostImplicitCall ProgramPoints.
These are currently unused, but are intended to be used in lieu of PreStmt
and PostStmt when the call is implicit (e.g. an automatic object destructor).

This also modifies the Data1 field of ProgramPoints to allow storing any
pointer-sized value, as opposed to only aligned pointers. This is necessary
to store SourceLocations.

There is currently no BugReporter support for these; they should be skipped
over in any diagnostic output.

This commit also tags checkers that currently rely on function calls only
occurring at StmtPoints.

llvm-svn: 160019
2012-07-10 22:07:42 +00:00
DeLesley Hutchins 868830f727 Thread safety analysis: impove handling of trylock expressions.
llvm-svn: 160018
2012-07-10 21:47:55 +00:00
Chad Rosier 67055f5ddc 80-column violations and whitespace.
llvm-svn: 160017
2012-07-10 21:35:27 +00:00
Sean Callanan 17cf1130ed Fixed a hang which causes LLDB to enter an infinite
loop if "memory read" is run with the -t option and
the type name contains a keyword like "struct" that
isn't followed by a space.  Now if a keyword isn't
followed by a space we continue searching after it,
instead of at the beginning of the type name.

Also optimized the code to not call strlen() on
a fixed set of statically-declared constant strings.

llvm-svn: 160016
2012-07-10 21:24:26 +00:00
Daniel Jasper 1dad183b38 Add more matchers and do cleanups.
Reviewers: klimek

    Differential Revision: http://ec2-50-18-127-156.us-west-1.compute.amazonaws.com/D2

llvm-svn: 160013
2012-07-10 20:20:19 +00:00
Enrico Granata 8b95df290e Turning the interpreter mutex into a static global to avoid a potential leak. Might need to be turned back into a pointer if it causes issues with the destructor chain.
llvm-svn: 160012
2012-07-10 19:04:14 +00:00
Chad Rosier 97c2214277 Move [get|set]BasePtrStackAdjustment() from MachineFrameInfo to
X86MachineFunctionInfo as this is currently only used by X86. If this ever
becomes an issue on another arch (e.g., ARM) then we can hoist it back out.

llvm-svn: 160009
2012-07-10 18:27:15 +00:00
Enrico Granata a29bdad954 <rdar://problem/11751427> Fixing an issue where multiple threads could concurrently try and initialize Python and cause crashes
llvm-svn: 160008
2012-07-10 18:23:48 +00:00
Chad Rosier 3ee9a4c29e Add newline.
llvm-svn: 160006
2012-07-10 17:57:00 +00:00
Chad Rosier 579b1fee6b Add test case accidentally omitted from r160002.
llvm-svn: 160004
2012-07-10 17:49:39 +00:00
Chad Rosier bdb08ac50a Add support for dynamic stack realignment in the presence of dynamic allocas on
X86.  Basically, this is a reapplication of r158087 with a few fixes.

Specifically, (1) the stack pointer is restored from the base pointer before
popping callee-saved registers and (2) in obscure cases (see comments in patch)
we must cache the value of the original stack adjustment in the prologue and
apply it in the epilogue.

rdar://11496434

llvm-svn: 160002
2012-07-10 17:45:53 +00:00
Benjamin Kramer 60d7f5a1d7 Disable death tests on platforms which don't support them.
llvm-svn: 160000
2012-07-10 17:30:44 +00:00
Arnaud A. de Grandmaison 617f5269c3 Adds support for auto-detection of compilation databases, looking in a directory and all its parents.
llvm-svn: 159998
2012-07-10 16:56:35 +00:00
Axel Naumann b307400326 Improve r159256 following Chandler's comments:
Implement UniqueFileContainer::erase(), camelCase, add comment on future optimizations of the cache versus de-optimizations of invalidations.

llvm-svn: 159997
2012-07-10 16:50:27 +00:00
Anna Zaks 8698dd63d7 [analyzer] Remove redundant check (scalar type is a superset of integer)
PR13319 Reported by Jozsef Mihalicza.

llvm-svn: 159996
2012-07-10 16:27:55 +00:00
Axel Naumann b2f1a46402 Clear diagnostic counts after processing the diagnostics.
The consumer might see multiple input files (e.g. for cling) and since r159977 the count is maintained across input files.

llvm-svn: 159995
2012-07-10 16:24:07 +00:00
Chandler Carruth 77d940011d Fix a bug where I didn't test for an empty range before inspecting the
back of it.

I don't have anything even remotely close to a test case for this. It
only broke two build bots, both of them doing bootstrap builds, one of
them a dragonegg bootstrap. It doesn't break for me when I bootstrap
either. It doesn't reproduce every time or on many machines during the
bootstrap. Many thanks to Duncan Sands who got the exact command (and
stage of the bootstrap) which failed on the dragonegg bootstrap and
managed to get it to trigger under valgrind with debug symbols. The fix
was then found by inspection.

llvm-svn: 159993
2012-07-10 15:41:33 +00:00
Manuel Klimek a9c86c980b Fixes the MSVC build.
llvm-svn: 159992
2012-07-10 14:21:30 +00:00
Nadav Rotem d908ddc186 Improve the loading of load-anyext vectors by allowing the codegen to load
multiple scalars and insert them into a vector. Next, we shuffle the elements
into the correct places, as before.
Also fix a small dagcombine bug in SimplifyBinOpWithSameOpcodeHands, when the
migration of bitcasts happened too late in the SelectionDAG process.

llvm-svn: 159991
2012-07-10 13:25:08 +00:00
Manuel Klimek 65fd0e1fd3 Adds support for auto-detection of compilation databases
from a source file and changes clang-check to make use of this.

This makes clang-check just work on in-tree builds, and allows
easy setup via a symlink per source directory to make clang-check
work without any extra configuration.

llvm-svn: 159990
2012-07-10 13:10:51 +00:00
Richard Barton 1dc44dcedd Fix instruction description of VMOV (between two ARM core registers and two single-precision resiters) (and do it properly this time!
llvm-svn: 159989
2012-07-10 12:51:09 +00:00
Alexey Samsonov 2d4bd13eb6 [Sanitizer] fix CMake build
llvm-svn: 159988
2012-07-10 09:17:06 +00:00
Manuel Klimek af18d52c09 Update the docs with specifics about escaping of compile commands.
llvm-svn: 159987
2012-07-10 08:05:54 +00:00
Alexey Samsonov 9f666ea6ca [ASan] move flags description to separate header, add comments about them.
llvm-svn: 159985
2012-07-10 07:41:27 +00:00
Craig Topper be41e2daa6 Reverse assembler/disassembler operand order for gather instructions.
llvm-svn: 159983
2012-07-10 06:38:33 +00:00
Chandler Carruth e18614dd17 Add an efficient merge operation to LiveInterval and use it to avoid
quadratic behavior when performing pathological merges. Fixes the core
element of PR12652.

There is only one user of addRangeFrom left: join. I'm hoping to
refactor further in a future patch and have join use this merge
operation as well.

llvm-svn: 159982
2012-07-10 05:16:17 +00:00
Chandler Carruth ac766b9b42 Teach LiveIntervals how to verify themselves and start using it in some
of the trick merge routines. This adds a layer of testing that was
necessary when implementing more efficient (and complex) merge logic for
this datastructure.

No functionality changed here.

llvm-svn: 159981
2012-07-10 05:06:03 +00:00
Chris Lattner 209ad6baa0 Jordan points out that this was incorrect: clang should recover from
*errors* with fixits on them by following the recovery advised by the
fixit, but if it is a fixit on a warning, then obviously the AST 
should be for the code as-written.

llvm-svn: 159980
2012-07-10 05:03:05 +00:00
Jordan Rose b8b2ca6ffb Allow -verify directives to specify a min and max count, not just "+".
void f(); // expected-note 0+ {{previous declaration is here}}
  void g(); // expected-note 0-1 {{previous declaration is here}}

The old "+" syntax is still an alias for "1+", and single numbers still work.

Patch by Andy Gibbs!

llvm-svn: 159979
2012-07-10 02:57:26 +00:00
Jordan Rose e1572eb3e2 Allow line numbers on -verify directives.
// expected-warning@10 {{some text}}

The line number may be absolute (as above), or relative to the current
line by prefixing the number with either '+' or '-'.

Patch by Andy Gibbs!

llvm-svn: 159978
2012-07-10 02:57:03 +00:00
Jordan Rose 6dae761810 Clean up VerifyDiagnosticsConsumer in preparation for upcoming enhancements.
Patch by Andy Gibbs!

llvm-svn: 159977
2012-07-10 02:56:15 +00:00
Richard Trieu 50f5f46a93 Properly update the FormattedArgs vector when the template type diffing falls
back to regular type printing.

llvm-svn: 159976
2012-07-10 01:46:04 +00:00
Greg Clayton cc0c4d4ae7 Improve dynamic type resolution efficiency by looking for the type in the module that contains the vtable symbol first and only look for the first match. If we don't find anything, _then_ move on to the rest of the modules in the target and watch out for multiple matches.
llvm-svn: 159975
2012-07-10 01:22:15 +00:00
Jim Grosbach 16b43dbbfe ARM: Allow more flexible patterns in NEON formats.
Some NEON instructions want to match against normal SDNodes for some
operand types and Intrinsics for others. For example, CTLZ. To enable this,
switch from explicitly requiring Intrinsic on the class templates to using
SDPatternOperator instead.

llvm-svn: 159974
2012-07-10 00:51:13 +00:00
Jim Grosbach 700068206f Allow intrinsics to be used in place of node matchables.
TableGen has support for using an intrinics name directly in a DAG,
but this breaks down when referring to just a node, as that's
handled initializer list stuff entirely via subclassing in the
parser. That is, using an instrinsic like "(int_my_intrinsic ...)"
works fine. Using it standalone for parameterizing the operator
in such a DAG does not.

Fixing this is simple enough, as we simply declare Intrinsic
as deriving from SDPatternOperator, which is the class name
intended for exactly this purpose in TargetSelectionDAG.td.

When the intrinsic is actually used in the DAG pattern, it will
be recognized and expanded to an intrinsic_wo_chain (et. al.)
just like when it's used directly.

Incoming ARM NEON cleanup based on this and a bit of functionality
improvement after that.

llvm-svn: 159973
2012-07-10 00:51:11 +00:00
Jordan Rose 6ea25fe9ce Add an explanation of -Wobjc-literal-compare to the "Objective-C Literals" page
(per Jean-Daniel's suggestion to keep around an explanation of why
direct comparisons on ObjC literals are a bad idea)

llvm-svn: 159972
2012-07-10 00:20:57 +00:00
Akira Hatanaka efff7b763b Make register Mips::RA allocatable if not in mips16 mode.
llvm-svn: 159971
2012-07-10 00:19:06 +00:00
Arnaud A. de Grandmaison cdccafa53c [cindex.py] Make CompileCommand.arguments usage consistent with CompileCommand.directory and the rest of the python binding
Patch by David Röthlisberger

llvm-svn: 159970
2012-07-10 00:00:05 +00:00
Dan Gohman 3d1512384f Delete code for folding undefs in ScalarEvolution. It's invalid in
obscure ways, and it isn't actually important in the real world.

llvm-svn: 159969
2012-07-09 23:51:20 +00:00
Chad Rosier 5e781c6363 Revert 159966 since Tanya temporarily updated the test case.
llvm-svn: 159968
2012-07-09 23:04:15 +00:00
Tanya Lattner 724eaea271 TEMPORARY. I will fix this properly shortly.
Silence buildbot so I can figure out the right flag to put this warning under.

llvm-svn: 159967
2012-07-09 23:01:07 +00:00
Chad Rosier 386433999f Put new warning in r159965 under a flag to appease buildbots. Someone please
verify this is the correct grouping.

llvm-svn: 159966
2012-07-09 22:59:22 +00:00