Commit Graph

147930 Commits

Author SHA1 Message Date
Dmitri Gribenko c2c804d145 Comment parsing: simplify code. As a side effect, this also silences GCC's
-Wunitnitialized warning.

Patch by Rui Ueyama.

llvm-svn: 179794
2013-04-18 20:50:35 +00:00
Eli Bendersky f6a88ccd73 Fix typo
llvm-svn: 179793
2013-04-18 20:49:17 +00:00
Greg Clayton c7fef74482 <rdar://problem/13627061>
Fixed an issue where "platform process list" help message has options displayed a couple dozen times.

llvm-svn: 179792
2013-04-18 20:17:32 +00:00
Bill Wendling 211316cc54 Cleanup patch:
Semantics of parameters named Index and Idx were inconsistent between
"include/llvm/IR/Attributes.h", "lib/IR/AttributeImpl.h" and
"lib/IR/Attributes.cpp": sometimes these were fixed 1-based indexes of IR
parameters (or AttributeSet::ReturnIndex for IR return values or
AttributeSet::FunctionIndex for IR functions), other times they were the
internal slot for storage in the underlying AttributeSetImpl. I renamed usage of
the former to "Index" and usage of the latter to "Slot" ("Slot" was already
being used consistently for the latter in a subset of cases)

Patch by Stephen Lin!

llvm-svn: 179791
2013-04-18 20:17:28 +00:00
Bill Wendling e3a60a9bc0 This patch addresses two cleanup issues:
1. Verify::VerifyParameterAttrs in "lib/IR/Verifier.cpp" and
   AttrBuilder::removeFunctionOnlyAttrs in "lib/IR/Attributes.cpp" (only called
   by Verify::VerifyFunctionAttrs) separately maintained a list of function-only
   attribute types. I've consolidated the logic into a new function used for
   both cases in "lib/IR/Verifier.cpp", so this logic is in one place (other
   than the AsmParser front-end)

2. Various functions in "lib/IR/Verifier.cpp" passed AttributeSet around by
   reference needlessly, as it's just a handle to an immutable pimpl body.

Patch by Stephen Lin!

llvm-svn: 179790
2013-04-18 20:15:25 +00:00
Dmitri Gribenko d29ea04446 Fix a -Wdocumentation warning
llvm-svn: 179789
2013-04-18 20:13:04 +00:00
Ashok Thirumurthi 8971be89bb Added unit tests for register read (should pass) and the expression interpreter (xfail) after the inferior has crashed.
- Thanks to Samuel Jacob for the related reproducer.

Reviewed by: Daniel Malea.

llvm-svn: 179788
2013-04-18 20:11:55 +00:00
Greg Clayton ee0c8323b2 <rdar://problem/13678882>
Disable "source info" until actually implemented.

llvm-svn: 179787
2013-04-18 19:58:52 +00:00
Anat Shemer 5570318f43 In the function InstCombiner::visitExtractElementInst() removed the limitation that extract is promoted over a cast only if the cast has only one use.
llvm-svn: 179786
2013-04-18 19:56:44 +00:00
Tom Stellard 62c03207d5 C API: Fix coding style
llvm-svn: 179785
2013-04-18 19:50:53 +00:00
Fariborz Jahanian 507a5f8cb3 Objective-C parsing [qoi]: Provide good recovery when
Objective-C dictionary literals has bad syntax for the
separator. // rdar://10679157

llvm-svn: 179784
2013-04-18 19:37:43 +00:00
Anat Shemer 0c95efad7e Added a function scalarizePHI() that sclarizes a vector phi instruction if it has only 2 uses: one to promote the vector phi in a loop and the other use is an extract operation of one element at a constant location.
llvm-svn: 179783
2013-04-18 19:35:39 +00:00
Argyrios Kyrtzidis 08dff958e9 [CMake] Create the directory before creating the link to the clang headers.
llvm-svn: 179782
2013-04-18 18:54:03 +00:00
Argyrios Kyrtzidis b86ea8a29f some more tests for r179743.
llvm-svn: 179781
2013-04-18 18:32:48 +00:00
Bill Wendling c62789f47e Fix comment. Patch by Stephen Lin.
llvm-svn: 179780
2013-04-18 18:30:16 +00:00
Greg Clayton e01e07b6e7 Since we use C++11, we should switch over to using std::unique_ptr when C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++.
Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro.

llvm-svn: 179779
2013-04-18 18:10:51 +00:00
Rafael Espindola 56f976f6bd At Jim Grosbach's request detemplate Object/MachO.h.
We are still able to handle mixed endian objects by swapping one struct at a
time.

llvm-svn: 179778
2013-04-18 18:08:55 +00:00
Argyrios Kyrtzidis f790c74b60 Add IRGen test case for r179743.
llvm-svn: 179777
2013-04-18 17:52:10 +00:00
Ted Kremenek d51ad8c125 [analyzer] Refine 'nil receiver' diagnostics to mention the name of the method not called.
llvm-svn: 179776
2013-04-18 17:44:15 +00:00
Chris Lattner 8cf09416ea Fix a comment, PR15777.
llvm-svn: 179775
2013-04-18 17:42:14 +00:00
Derek Schuff a403d243d1 Allow misaligned stores in x86 fast-isel.
In X86FastISel::X86SelectStore(), improperly aligned stores are rejected and
handled by the DAG-based ISel.  However, X86FastISel::X86SelectLoad() makes
no such requirement.  There doesn't appear to be an x86 architectural
correctness issue with allowing potentially unaligned store instructions.
This patch removes this restriction.

Patch by Jim Stichnot.

llvm-svn: 179774
2013-04-18 17:41:08 +00:00
Arnold Schwaighofer 4cd6aa110c LoopVectorizer: Recognize min/max reductions
A min/max operation is represented by a select(cmp(lt/le/gt/ge, X, Y), X, Y)
sequence in LLVM. If we see such a sequence we can treat it just as any other
commutative binary instruction and reduce it.

This appears to help bzip2 by about 1.5% on an imac12,2.

radar://12960601

llvm-svn: 179773
2013-04-18 17:22:34 +00:00
Greg Clayton 9624985b1a Re-enable m_private_run_lock changes from 179329, but only for Apple hosted builds so it doesn't break the buildbots. We will try and work the issues out in the Apple build before enabling this feature for everyone.
llvm-svn: 179772
2013-04-18 16:57:27 +00:00
Andy Gibbs 96d93907eb Dropped the parentheses for #pragma message and its kin in the -E output generator.
This was a suggestion by Jordan Rose since the documented format for these pragmas is without the parentheses.  At the same time, I've increased test coverage too for the preprocessed output.

llvm-svn: 179771
2013-04-18 16:49:37 +00:00
Fariborz Jahanian 65ff01bccb Adds a new doxygen tag needed. // rdar://12379053
llvm-svn: 179770
2013-04-18 16:45:57 +00:00
Argyrios Kyrtzidis 5af4f2b7ea [libclang] Report parameter array types as written in source, not decayed to pointer types.
Patch by Doug.
rdar://13684618

llvm-svn: 179769
2013-04-18 16:41:15 +00:00
Eli Bendersky c0ef3d8514 Fix grammar in LLVMBuild.rst
llvm-svn: 179768
2013-04-18 16:39:32 +00:00
Jordan Rose 3720e2f006 [analyzer] "Force" LazyCompoundVals on bind when they are simple enough.
The analyzer uses LazyCompoundVals to represent rvalues of aggregate types,
most importantly structs and arrays. This allows us to efficiently copy
around an entire struct, rather than doing a memberwise load every time a
struct rvalue is encountered. This can also keep memory usage down by
allowing several structs to "share" the same snapshotted bindings.

However, /lookup/ through LazyCompoundVals can be expensive, especially
since they can end up chaining back to the original value. While we try
to reuse LazyCompoundVals whenever it's safe, and cache information about
this transitivity, the fact is it's sometimes just not a good idea to
perpetuate LazyCompoundVals -- the tradeoffs just aren't worth it.

This commit changes RegionStore so that binding a LazyCompoundVal to struct
will do a memberwise copy if the struct is simple enough. Today's definition
of "simple enough" is "up to N scalar members" (see below), but that could
easily be changed in the future. This is enough to bring the test case in
PR15697 back down to a manageable analysis time (within 20% of its original
time, in an unfair test where the new analyzer is not compiled with LTO).

The actual value of "N" is controlled by a new -analyzer-config option,
'region-store-small-struct-limit'. It defaults to "2", meaning structs with
zero, one, or two scalar members will be considered "simple enough" for
this code path.

It's worth noting that a more straightforward implementation would do this
on load, not on bind, and make use of the structure we already have for this:
CompoundVal. A long time ago, this was actually how RegionStore modeled
aggregate-to-aggregate copies, but today it's only used for compound literals.
Unfortunately, it seems that we've special-cased LazyCompoundVal in certain
places (such as liveness checks) but failed to similarly special-case
CompoundVal in all of them. Until we're confident that CompoundVal is
handled properly everywhere, this solution is safer, since the entire
optimization is just an implementation detail of RegionStore.

<rdar://problem/13599304>

llvm-svn: 179767
2013-04-18 16:33:46 +00:00
Jordan Rose cdb44bdb3d [analyzer] Don't crash if we cache out after making a temporary region.
A C++ overloaded operator may be implemented as an instance method, and
that instance method may be called on an rvalue object, which has no
associated region. The analyzer handles this by creating a temporary region
just for the evaluation of this call; however, it is possible that /by
creating the region/, the analyzer ends up in a previously-explored state.
In this case we don't need to continue along this path.

This doesn't actually show any behavioral change now, but it starts being
used with the next commit and prevents an assertion failure there.

llvm-svn: 179766
2013-04-18 16:33:40 +00:00
Chad Rosier db003998fb [ms-inline asm] Simplify some logic and add a FIXME for unhandled unary minus.
llvm-svn: 179765
2013-04-18 16:28:19 +00:00
Chad Rosier c2f055d114 Make this private method.
llvm-svn: 179764
2013-04-18 16:13:18 +00:00
Eli Bendersky 97ad9245f1 Fixes to LangRef.rst: incorrect attributes syntax and misplaced 'nobuiltin'
Patch by Stephen Lin

llvm-svn: 179763
2013-04-18 16:11:44 +00:00
Chad Rosier 384823dc32 Specify that we're parsing ms-style inline assembly.
llvm-svn: 179762
2013-04-18 15:45:31 +00:00
Chad Rosier 2045b01171 Fix comment spacing.
llvm-svn: 179761
2013-04-18 15:19:45 +00:00
Howard Hinnant ab65a6f560 After years of telling people: 'If you ever find any of my code that self-move-assigns, send me a bug report.' Somebody finally took me up on it. vector::erase(begin(), begin()) does a self-move-assign of every element in the vector, leaving all of those elements in an unspecified state. I checked the other containers for this same bug and did not find it. Added test case.
llvm-svn: 179760
2013-04-18 15:02:57 +00:00
Ashok Thirumurthi cf7c55ebcc Revert of r179378 and r179329, which introduce a private thread lock around thread enumeration,
in order to prevent consistent hangs on all 3 LLDB buildbots.

llvm-svn: 179759
2013-04-18 14:38:20 +00:00
Manuel Klimek f5a0ae82e9 Multiple improvements to the AST matcher tutorial.
Patch by Jochen Eisinger.

llvm-svn: 179758
2013-04-18 14:30:45 +00:00
Benjamin Kramer 8df2cfb858 LoopVectorize: Use a set to avoid longer cycles in the reduction chain too.
Fixes PR15748.

llvm-svn: 179757
2013-04-18 14:29:13 +00:00
Benjamin Kramer 7ee3b9c0e4 Reject asm output constraints that consist of modifiers only.
Fixes PR15759.

llvm-svn: 179756
2013-04-18 13:23:23 +00:00
Alexey Samsonov 1a6cfb46e5 [Sanitizer] Rework r176802: share code between Printf and Report and simplify it a bit
llvm-svn: 179755
2013-04-18 13:18:23 +00:00
Alexey Samsonov d1efa5ef96 [Sanitizer] Don't die in symbolizer if it can't read /proc/self/exe link
llvm-svn: 179754
2013-04-18 12:46:33 +00:00
Benjamin Kramer 06022fc91a Add llvm_unreachable at end of fully covered switch to pacify GCC.
llvm-svn: 179753
2013-04-18 10:44:27 +00:00
Hao Liu a2ff69863e Fix for PR14824, An ARM Load/Store Optimization bug
llvm-svn: 179751
2013-04-18 09:11:08 +00:00
David Majnemer 81af06e003 Revert "Combine bit test + conditional or into simple math"
It is causing stage2 builds to fail, let's get them running again.

llvm-svn: 179750
2013-04-18 08:42:33 +00:00
Andy Gibbs a9b1125355 Remove duplicate "friend" declaration.
llvm-svn: 179749
2013-04-18 07:42:20 +00:00
David Majnemer bdf0caf6b1 Combine bit test + conditional or into simple math
Simplify:
(select (icmp eq (and X, C1), 0), Y, (or Y, C2))

Into:
(or (shl (and X, C1), C3), y)

Where:
C3 = Log(C2) - Log(C1)

If:
C1 and C2 are both powers of two

llvm-svn: 179748
2013-04-18 07:30:07 +00:00
Michael Gottesman 323964ca9e [objc-arc] Do not mismatch up retains inside a for loop with releases outside said for loop in the presense of differing provenance caused by escaping blocks.
This occurs due to an alloca representing a separate ownership from the
original pointer. Thus consider the following pseudo-IR:

  objc_retain(%a)
  for (...) {
    objc_retain(%a)
    %block <- %a
    F(%block)
    objc_release(%block)
  }
  objc_release(%a)

From the perspective of the optimizer, the %block is a separate
provenance from the original %a. Thus the optimizer pairs up the inner
retain for %a and the outer release from %a, resulting in segfaults.

This is fixed by noting that the signature of a mismatch of
retain/releases inside the for loop is a Use/CanRelease top down with an
None bottom up (since bottom up the Retain-CanRelease-Use-Release
sequence is completed by the inner objc_retain, but top down due to the
differing provenance from the objc_release said sequence is not
completed). In said case in CheckForCFGHazards, we now clear the state
of %a implying that no pairing will occur.

Additionally a test case is included.

rdar://12969722

llvm-svn: 179747
2013-04-18 05:39:45 +00:00
Michael Gottesman 9e5181393a Removed trailing whitespace.
llvm-svn: 179746
2013-04-18 04:34:11 +00:00
Michael Gottesman a15ab25238 Streamline arc-annotation test (removing some cases which do not add any extra coverage) and set it up to use FileCheck variables to make the test more robust.
llvm-svn: 179745
2013-04-18 04:34:06 +00:00
Argyrios Kyrtzidis 71c12fb4a3 [Parser] Handle #pragma pack/align inside C structs.
Fixes PR13580. Patch by Serge Pavlov!

llvm-svn: 179743
2013-04-18 01:42:35 +00:00