Commit Graph

146162 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen b5b9110b51 Make all unnamed RegisterClass TreePatternNodes typed MVT::i32.
A register class can appear as a leaf TreePatternNode with and without a
name:

  (COPY_TO_REGCLASS GPR:$src, F8RC)

In a named leaf node like GPR:$src, the register class provides type
information for the named variable represented by the node. The TypeSet
for such a node is the set of value types that the register class can
represent.

In an unnamed leaf node like F8RC above, the register class represents
itself as a kind of immediate. Such a node has the type MVT::i32,
we'll never create a virtual register representing it.

This change makes it possible to remove the special handling of
COPY_TO_REGCLASS in CodeGenDAGPatterns.cpp.

llvm-svn: 177825
2013-03-23 18:08:44 +00:00
Howard Hinnant 65a87ccdbf This is a start at making the libc++ test suite friendlier to the -fnoexceptions flag. Although this is not a complete solution, it does reduce the number of test failures on OS X from 467 to 128 on OS X when -fno-exceptions is enabled, and does not impact the number of failures at all when -fno-exceptions is not enabled. The bulk of this code was donated anonymously.
llvm-svn: 177824
2013-03-23 17:27:16 +00:00
Hal Finkel 794e05b03b Remove dead PPC LR spilling code
The LR register is unconditionally reserved, and its spilling and restoration
is handled by the prologue/epilogue code. As a result, it is never explicitly
spilled by the register allocator.

No functionality change intended.

llvm-svn: 177823
2013-03-23 17:14:27 +00:00
Benjamin Kramer e963d660cd Plug a memory leak in FileCheck when the input file is empty.
llvm-svn: 177822
2013-03-23 13:56:23 +00:00
Benjamin Kramer eab1c5f98b Move X86-dependent test into the right subdirectory.
llvm-svn: 177821
2013-03-23 09:35:44 +00:00
Owen Anderson c81616b0a9 Remove the type legality check from the SelectionDAGBuilder when it lowers @llvm.fmuladd to ISD::FMA nodes.
Performing this check unilaterally prevented us from generating FMAs when the incoming IR contained illegal vector types which would eventually be legalized to underlying types that *did* support FMA.
For example, an @llvm.fmuladd on an OpenCL float16 should become a sequence of float4 FMAs, not float4 fmul+fadd's.

NOTE: Because we still call the target-specific profitability hook, individual targets can reinstate the old behavior, if desired, by simply performing the legality check inside their callback hook.  They can also perform more sophisticated legality checks, if, for example, some illegal vector types can be productively implemented as FMAs, but not others.
llvm-svn: 177820
2013-03-23 08:26:53 +00:00
Nadav Rotem 1da30944a6 Make clang to mark static stack allocations with lifetime markers to enable a more aggressive stack coloring.
Patch by John McCall with help by Shuxin Yang.
rdar://13115369

llvm-svn: 177819
2013-03-23 06:43:35 +00:00
Michael Gottesman 764b1cfced Change method name ClearRefCount => ClearKnownPositiveRefCount to match the name of the member that it is modifying.
llvm-svn: 177818
2013-03-23 05:46:19 +00:00
Jason Molenda 6566d43207 Add two additional DNBLog's in places where we're about to kill
off the inferior process so we stand a better chance of understanding
what caused us to send a PT_KILL.
<rdar://problem/12720340> 

llvm-svn: 177817
2013-03-23 05:35:57 +00:00
Michael Gottesman 07beea47b8 Changed the method name PtrState.IsKnownIncremented() to PtrState.HasKnownPositiveRefCount().
Now said method matches namewise every other method which refers to
the member KnownPositiveRefCount of the class PtrState.

llvm-svn: 177816
2013-03-23 05:31:01 +00:00
Bob Wilson a20a1dad7f Revert svn r176894 and r177658.
Changing -ccc-install-dir to affect cc1's resource-dir setting broke our
internal LNT tests. After discussing the situation with Jim, we've decided to
pursue an alternate approach. We really want the resource-dir to be located
relative to clang, even when using -ccc-install-dir, but we're going to
add a fallback setting for the libc++ headers if they don't exist alongside
the compiler.

llvm-svn: 177815
2013-03-23 05:17:59 +00:00
Jason Molenda fc306d3987 Set the correct byte size for complex integer (-fI) memory reads.
<rdar://problem/12281172> 

llvm-svn: 177814
2013-03-23 05:16:54 +00:00
John McCall eff1884274 Under ARC, when we're passing the address of a strong variable
to an out-parameter using the indirect-writeback conversion,
and we copied the current value of the variable to the temporary,
make sure that we register an intrinsic use of that value with
the optimizer so that the value won't get released until we have
a chance to retain it.

rdar://13195034

llvm-svn: 177813
2013-03-23 02:35:54 +00:00
Enrico Granata 9d71afe8cf And then again only compute the more expensive piece of data if need be :-)
llvm-svn: 177812
2013-03-23 01:44:59 +00:00
Greg Clayton 52e6378f0f Added a python version of the performance tests. It will be good to see if the overhead of python interferes at all with our performance readings. We can try things out with this script and see how things go.
llvm-svn: 177811
2013-03-23 01:44:48 +00:00
Enrico Granata 123c39c02b Invert two condition checks to evaluate them in cheapest-to-more-expensive order
llvm-svn: 177810
2013-03-23 01:44:23 +00:00
Richard Trieu 3cee413b4a Strip off local qualifiers when converting from RecordType to
TemplateSpecializationType during template type diffing.  This allows the
correct printing of diffing qualifiers on templates.

llvm-svn: 177809
2013-03-23 01:38:36 +00:00
Greg Clayton 4a10357fb3 Added better measurements to test:
- memory delta and time for: target create
- memory delta and time for: setting breakpoint at main by name
- time to launch and hit bp at main
- overall memory of target create + bp main + run to main
- ovarall time of target create + bp main + run to main

llvm-svn: 177808
2013-03-23 01:35:50 +00:00
Enrico Granata 7d1f93942f <rdar://problem/13312903>
Exports write() and flush() from SBCommandReturnObject to enable file-like output from Python commands.
e.g.:
def ls(debugger, command, result, internal_dict):
    print >>result,”just “some output”

will produce
(lldb) ls
just “some output
(lldb) 

llvm-svn: 177807
2013-03-23 01:35:44 +00:00
Jordan Rose 8828d356fb [analyzer] Teach constraint managers about unsigned comparisons.
In C, comparisons between signed and unsigned numbers are always done in
unsigned-space. Thus, we should know that "i >= 0U" is always true, even
if 'i' is signed. Similarly, "u >= 0" is also always true, even though '0'
is signed.

Part of <rdar://problem/13239003> (false positives related to std::vector)

llvm-svn: 177806
2013-03-23 01:21:33 +00:00
Jordan Rose 8eca04b24e [analyzer] Loc-Loc operations (subtraction or comparison) produce a NonLoc.
For two concrete locations, we were producing another concrete location and
then casting it to an integer. We should just create a nonloc::ConcreteInt
to begin with.

No functionality change.

llvm-svn: 177805
2013-03-23 01:21:29 +00:00
Jordan Rose b042cc7822 [analyzer] CmpRuns.py: Accept single files as input.
This allows us to compare two direct invocations of the analyzer on a
single source file without having to wrap the output plists in their
own directories.

llvm-svn: 177804
2013-03-23 01:21:26 +00:00
Jordan Rose 59d179e9d2 [analyzer] Also transform "a < b" to "(b - a) > 0" in the constraint manager.
We can support the full range of comparison operations between two locations
by canonicalizing them as subtraction, as in the previous commit.

This won't work (well) if either location includes an offset, or (again)
if the comparisons are not consistent about which region comes first.

<rdar://problem/13239003>

llvm-svn: 177803
2013-03-23 01:21:23 +00:00
Jordan Rose 604d0bbba5 Add reverseComparisonOp and negateComparisonOp to BinaryOperator.
...and adopt them in the analyzer.

llvm-svn: 177802
2013-03-23 01:21:20 +00:00
Jordan Rose 8e6b6c0c2f [analyzer] Translate "a != b" to "(b - a) != 0" in the constraint manager.
Canonicalizing these two forms allows us to better model containers like
std::vector, which use "m_start != m_finish" to implement empty() but
"m_finish - m_start" to implement size(). The analyzer should have a
consistent interpretation of these two symbolic expressions, even though
it's not properly reasoning about either one yet.

The other unfortunate thing is that while the size() expression will only
ever be written "m_finish - m_start", the comparison may be written
"m_finish == m_start" or "m_start == m_finish". Right now the analyzer does
not attempt to canonicalize those two expressions, since it doesn't know
which length expression to pick. Doing this correctly will probably require
implementing unary minus as a new SymExpr kind (<rdar://problem/12351075>).

For now, the analyzer inverts the order of arguments in the comparison to
build the subtraction, on the assumption that "begin() != end()" is
written more often than "end() != begin()". This is purely speculation.

<rdar://problem/13239003>

llvm-svn: 177801
2013-03-23 01:21:16 +00:00
Jordan Rose 3b4c3ea2fb [analyzer] Use SymExprs to represent '<loc> - <loc>' and '<loc> == <loc>'.
We just treat this as opaque symbols, but even that allows us to handle
simple cases where the same condition is tested twice. This is very common
in the STL, which means that any project using the STL gets spurious errors.

Part of <rdar://problem/13239003>.

llvm-svn: 177800
2013-03-23 01:21:05 +00:00
Enrico Granata 852cce7c1f <rdar://problem/13315663>
commands of the form 
frame variable -f c-string foo
where foo is an arbitrary pointer (e.g. void*) now do the right thing, i.e. they deref the pointer and try to get a c-string at the pointed address instead of dumping the pointer bytes as a string. the old behavior is used as a fallback if things don’t go well

llvm-svn: 177799
2013-03-23 01:12:38 +00:00
Tobias Grosser 7670bb5c31 Cloog: Add virtual destructor to silence gcc warning
This silences the following warning:

  'polly::ClastVisitor' has virtual functions but non-virtual destructor
  [-Wnon-virtual-dtor]

llvm-svn: 177798
2013-03-23 01:10:53 +00:00
Fariborz Jahanian be8bc67b66 documentation parsing: when providing code completion comment
for a getter used in property-dot syntax, if geter has its own
comment use it. // rdar://12791315

llvm-svn: 177797
2013-03-23 01:10:45 +00:00
Tobias Grosser 4d96c8d714 clang-format: Many more files
After this commit, polly is clang-format clean. This can be tested with
'ninja polly-check-format'. Updates to clang-format may change this, but the
differences will hopefully be both small and general improvements to the
formatting.

We currently have some not very nice formatting for a couple of items, DEBUG()
stmts for example. I believe the benefit of being clang-format clean outweights
the not perfect layout of this code.

llvm-svn: 177796
2013-03-23 01:05:07 +00:00
Tobias Grosser 0db04b4778 cmake: Do not clang-format check the externally imported json library
llvm-svn: 177795
2013-03-23 01:04:48 +00:00
Sean Callanan 719a4d5d83 If there are multiple uses of an Objective-C
class symbol in the same expression, handle all
of them instead of just the first one.

<rdar://problem/13440133>

llvm-svn: 177794
2013-03-23 01:01:16 +00:00
Greg Clayton b9d8890bd9 Only get the script interpreter if we find scripting resources in the symbol file. This helps us avoid initializing python when it isn't needed.
llvm-svn: 177793
2013-03-23 00:50:58 +00:00
Greg Clayton 96b68669eb Don't need to resolve the .o file path.
llvm-svn: 177792
2013-03-23 00:50:06 +00:00
Greg Clayton 5c78d99921 Make sure the "Release" builds link against the "Release" LLDB.framework and also output the results to /dev/stdout when no outfile is supplied.
llvm-svn: 177791
2013-03-23 00:49:30 +00:00
Jason Molenda 45461571e7 Change debugserver to open the socket it listens
to in INADDR_LOOPBACK mode by default ("localhost only")
instead of INADDR_ANY ("accept connections from any system").

Add a new command line argument to debugserver, --open-connection
or -H which will enable the previous behavior.  It would be used
if you were doing two-system debugging, with lldb running on one
system and debugserver running on the other.  But it is a less
common workflow and should not be the default.

<rdar://problem/12583284> 

llvm-svn: 177790
2013-03-23 00:44:22 +00:00
Anna Zaks 130df4b0a4 [analyzer] Warn when a nil key or value are passed to NSMutableDictionary and ensure it works with subscripting.
llvm-svn: 177789
2013-03-23 00:39:21 +00:00
Anna Zaks 911a7c9e03 [analyzer] Correct the stale comment.
llvm-svn: 177788
2013-03-23 00:39:17 +00:00
Tobias Grosser 45af235e09 RegisterPasses: clang-format
llvm-svn: 177787
2013-03-23 00:32:21 +00:00
Tobias Grosser f008da125c Instvarsimplify: clang-format
Even though we will soon get rid of this pass, we reformat it on the way to
make polly clang-format clean.

llvm-svn: 177786
2013-03-23 00:32:18 +00:00
Tobias Grosser 9abbfc0b69 IndependentBlocks: clang-format and remove includes
llvm-svn: 177785
2013-03-23 00:32:15 +00:00
Richard Smith c91e327cba Build and install .syms files alongside sanitizer runtimes. These are used to
specify which symbols are exported to DSOs when the sanitizer is statically
linked into a binary.

llvm-svn: 177784
2013-03-23 00:31:07 +00:00
Richard Smith f3e624ca73 If a .syms file is available alongside a sanitizer runtime, pass it to the
linker via --dynamic-list instead of using --export-dynamic. This reduces the
size of the dynamic symbol table, and thus of the binary (in some cases by up
to ~30%).

llvm-svn: 177783
2013-03-23 00:30:08 +00:00
Tobias Grosser c30d9cc678 DeadCodeElimination: clang-format and comment
llvm-svn: 177782
2013-03-23 00:16:05 +00:00
Tobias Grosser 33bc2e93be CodePreparation: Comment and format the file properly
llvm-svn: 177781
2013-03-23 00:13:39 +00:00
Hal Finkel 446122ed57 Fix comparison of mixed signedness
177774 broke the lld-x86_64-darwin11 builder; error:
error: comparison of integers of different signs: 'int' and 'size_type' (aka 'unsigned long')
  for (SI = 0; SI < Scavenged.size(); ++SI)
               ~~ ^ ~~~~~~~~~~~~~~~~

Fix this by making SI also unsigned.

llvm-svn: 177780
2013-03-23 00:07:29 +00:00
Jason Molenda 1de00ef60a Fix a little fallout from the changes in r174757 where we would
skip every other float/double/long double as we extracted data
from a buffer.
<rdar://problem/13485062>

llvm-svn: 177779
2013-03-23 00:04:02 +00:00
Sean Silva 4359068aea [docs] Slight reword for precision.
The new wording cannot be construed as suggesting the use of
SmallVectorImpl<T> as e.g. a class member (just because the class
happens to be in an interface).

llvm-svn: 177778
2013-03-22 23:52:38 +00:00
Tobias Grosser 369430ffca codegen: properly instantiate SCEVs to the place where they are used
Given the following code

    for (i = 0; i < 10; i++) {
      ;
    }

S:  A[i] = 0

When code generating S using scev based code generation, we need to retrieve
the scev of 'i' at the location of 'S'. If we do not do this the scev that
we obtain will be expressed as {0,+,1}_for and will reference loop iterators
that do not surround 'S' and that we consequently do not know how to code
generate. What we really want is the scev to be instantiated to the value of 'i'
after the loop. This value is {10} and it can be code generated without
troubles.

llvm-svn: 177777
2013-03-22 23:42:53 +00:00
Jason Molenda c1946cd8e1 Don't bother calling Reserve on the vector unless we have entries to be added.
llvm-svn: 177776
2013-03-22 23:42:09 +00:00