platform/upstream/llvm.git
9 years agoTeach llvm-build to avoid touching LibraryDependencies.inc unless the contents
Peter Collingbourne [Wed, 19 Nov 2014 03:34:20 +0000 (03:34 +0000)]
Teach llvm-build to avoid touching LibraryDependencies.inc unless the contents
change. This saves us from rebuilding llvm-config each time we reconfigure.

llvm-svn: 222308

9 years agoExpose LLVM version string via macro in llvm-config.h, and modify Go bindings
Peter Collingbourne [Wed, 19 Nov 2014 03:34:17 +0000 (03:34 +0000)]
Expose LLVM version string via macro in llvm-config.h, and modify Go bindings
to make use of it.

llvm-svn: 222307

9 years agoStandardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.
David Blaikie [Wed, 19 Nov 2014 03:06:06 +0000 (03:06 +0000)]
Standardize on StringMap::insert, removing uses of StringMap::GetOrCreateValue.

llvm-svn: 222306

9 years agoRemove uses of StringMap::GetOrCreateValue in favor of stl-compatible API usage
David Blaikie [Wed, 19 Nov 2014 03:05:07 +0000 (03:05 +0000)]
Remove uses of StringMap::GetOrCreateValue in favor of stl-compatible API usage

llvm-svn: 222305

9 years agoUpdate for LLVM API change
David Blaikie [Wed, 19 Nov 2014 03:04:29 +0000 (03:04 +0000)]
Update for LLVM API change

llvm-svn: 222304

9 years agoUpdate for LLVM API change
David Blaikie [Wed, 19 Nov 2014 02:56:13 +0000 (02:56 +0000)]
Update for LLVM API change

llvm-svn: 222303

9 years agoMake StringSet::insert return pair<iterator, bool> like other self-associative containers
David Blaikie [Wed, 19 Nov 2014 02:56:00 +0000 (02:56 +0000)]
Make StringSet::insert return pair<iterator, bool> like other self-associative containers

StringSet is still a bit dodgy in that it exposes the raw iterator of
the StringMap parent, which exposes the weird detail that StringSet
actually has a 'value'... but anyway, this is useful for a handful of
clients that want to reference the newly inserted/persistent string data
in the StringSet/Map/Entry/thing.

llvm-svn: 222302

9 years agoAdd additional checks to the SavedLocationForRegister method
Jason Molenda [Wed, 19 Nov 2014 02:29:52 +0000 (02:29 +0000)]
Add additional checks to the SavedLocationForRegister method
where it is retrieving the Return Address register contents
on a target where that's a thing.  If we fail to get a valid
RA, we force a switch to the fallback unwind plan.  This patch
adds a sanity check for that fallback unwind plan -- it must
get a valid CFA for this frame in addition to being able to
retrieve the caller's PC -- and it correctly marks the unwind
rules as failing if the fallback unwind plan fails.

<rdar://problem/19010211>

llvm-svn: 222301

9 years ago[mach-o] propagate dylib version numbers
Nick Kledzik [Wed, 19 Nov 2014 02:21:53 +0000 (02:21 +0000)]
[mach-o] propagate dylib version numbers

Mach-o does not use a simple SO_NEEDED to track dependent dylibs.  Instead,
the linker copies four things from each dylib to each client: the runtime path
(aka "install name"), the build time, current version (dylib build number), and
compatibility version  The build time is no longer used (it cause every rebuild
of a dylib to be different).  The compatibility version is usually just 1.0
and never changes, or the dylib becomes incompatible.

This patch copies that information into the NormalizedMachO format and
propagates it to clients.

llvm-svn: 222300

9 years agollvm-readobj: fix off-by-one error in COFFDumper
Rui Ueyama [Wed, 19 Nov 2014 02:07:10 +0000 (02:07 +0000)]
llvm-readobj: fix off-by-one error in COFFDumper

It printed out base relocation table header as table entry.
This patch also makes llvm-readobj to not skip ABSOLUTE entries
becuase it was confusing.

llvm-svn: 222299

9 years agoCleanup quick_exit tests and get them passing in C++03.
Eric Fiselier [Wed, 19 Nov 2014 01:45:12 +0000 (01:45 +0000)]
Cleanup quick_exit tests and get them passing in C++03.

Wrap the original test in _LIBCPP_HAS_QUICK_EXIT so it only runs when we have
quick_exit and add two new tests that check that when _LIBCPP_HAS_QUICK_EXIT
is not defined then no definition of std::at_quick_exit or std::quick_exit are
available.

llvm-svn: 222298

9 years agoMake the ASan OS X DYLD_INSERT_LIBRARIES detection path-independent
Kuba Brecka [Wed, 19 Nov 2014 01:31:59 +0000 (01:31 +0000)]
Make the ASan OS X DYLD_INSERT_LIBRARIES detection path-independent

Reviewed at http://reviews.llvm.org/D6238

ASan on Darwin during launch reads DYLD_INSERT_LIBRARIES env. variable and if it's not set or if the ASan dylib is not present in there, it relaunches the process. The check whether the dylib is present in the variable is now trying to find a full path in there. This fails in the scenarios where we want to copy the dylib to the executable's directory or somewhere else and set the DYLD_INSERT_LIBRARIES manually, see http://reviews.llvm.org/D6018.

Let's change the search in DYLD_INSERT_LIBRARIES to only look for the filename of the dylib and not the full path.

llvm-svn: 222297

9 years agodiff --git a/test/language.support/support.types/nullptr_t.pass.cpp b/test/language...
Eric Fiselier [Wed, 19 Nov 2014 01:31:56 +0000 (01:31 +0000)]
diff --git a/test/language.support/support.types/nullptr_t.pass.cpp b/test/language.support/support.types/nullptr_t.pass.cpp
index 6c15fef..4d7c8b0 100644
--- a/test/language.support/support.types/nullptr_t.pass.cpp
+++ b/test/language.support/support.types/nullptr_t.pass.cpp
@@ -18,42 +18,62 @@ struct A
     A(std::nullptr_t) {}
 };

+template <class T>
+void test_conversions()
+{
+    {
+        T p = 0;
+        assert(p == nullptr);
+    }
+    {
+        T p = nullptr;
+        assert(p == nullptr);
+        assert(nullptr == p);
+        assert(!(p != nullptr));
+        assert(!(nullptr != p));
+    }
+}
+
+template <class T>
+void test_comparisons()
+{
+    T p = nullptr;
+    assert(p == nullptr);
+    assert(p <= nullptr);
+    assert(p >= nullptr);
+    assert(!(p != nullptr));
+    assert(!(p < nullptr));
+    assert(!(p > nullptr));
+    assert(nullptr == p);
+    assert(nullptr <= p);
+    assert(nullptr >= p);
+    assert(!(nullptr != p));
+    assert(!(nullptr < p));
+    assert(!(nullptr > p));
+}
+
+
 int main()
 {
     static_assert(sizeof(std::nullptr_t) == sizeof(void*),
                   "sizeof(std::nullptr_t) == sizeof(void*)");
-    A* p = 0;
-    assert(p == nullptr);
-    void (A::*pmf)() = 0;
-#ifdef __clang__
-    // GCC 4.2 can't handle this
-    assert(pmf == nullptr);
-#endif
-    int A::*pmd = 0;
-    assert(pmd == nullptr);
-    A a1(nullptr);
-    A a2(0);
-    bool b = nullptr;
-    assert(!b);
-    assert(nullptr == nullptr);
-    assert(nullptr <= nullptr);
-    assert(nullptr >= nullptr);
-    assert(!(nullptr != nullptr));
-    assert(!(nullptr < nullptr));
-    assert(!(nullptr > nullptr));
-    A* a = nullptr;
-    assert(a == nullptr);
-    assert(a <= nullptr);
-    assert(a >= nullptr);
-    assert(!(a != nullptr));
-    assert(!(a < nullptr));
-    assert(!(a > nullptr));
-    assert(nullptr == a);
-    assert(nullptr <= a);
-    assert(nullptr >= a);
-    assert(!(nullptr != a));
-    assert(!(nullptr < a));
-    assert(!(nullptr > a));
-    std::ptrdiff_t i = reinterpret_cast<std::ptrdiff_t>(nullptr);
-    assert(i == 0);
+
+    {
+        test_conversions<std::nullptr_t>();
+        test_conversions<void*>();
+        test_conversions<A*>();
+        test_conversions<void(*)()>();
+        test_conversions<void(A::*)()>();
+        test_conversions<int A::*>();
+    }
+    {
+        test_comparisons<std::nullptr_t>();
+        test_comparisons<void*>();
+        test_comparisons<A*>();
+        test_comparisons<void(*)()>();
+    }
+    {
+        bool b = nullptr;
+        assert(!b);
+    }
 }
diff --git a/test/language.support/support.types/nullptr_t_integral_cast.fail.cpp b/test/language.support/support.types/nullptr_t_integral_cast.fail.cpp
new file mode 100644
index 0000000..92bd879
--- /dev/null
+++ b/test/language.support/support.types/nullptr_t_integral_cast.fail.cpp
@@ -0,0 +1,17 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// typedef decltype(nullptr) nullptr_t;
+
+#include <cstddef>
+
+int main()
+{
+    std::ptrdiff_t i = static_cast<std::ptrdiff_t>(nullptr);
+}
diff --git a/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp b/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp
new file mode 100644
index 0000000..34c7a93
--- /dev/null
+++ b/test/language.support/support.types/nullptr_t_integral_cast.pass.cpp
@@ -0,0 +1,24 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// NOTE: nullptr_t emulation cannot handle a reinterpret_cast to an
+// integral type
+// XFAIL: c++98, c++03
+
+// typedef decltype(nullptr) nullptr_t;
+
+
+#include <cstddef>
+#include <cassert>
+
+int main()
+{
+    std::ptrdiff_t i = reinterpret_cast<std::ptrdiff_t>(nullptr);
+    assert(i == 0);
+}

llvm-svn: 222296

9 years agoAdd "-k" and "-K" options to the driver, that allow you to register
Jim Ingham [Wed, 19 Nov 2014 01:28:13 +0000 (01:28 +0000)]
Add "-k" and "-K" options to the driver, that allow you to register
some commands that will get run if the target crashes.

Also fix the bug where the local .lldbinit file was not getting
sourced before not after the target was created from the file options on the
driver command line.

<rdar://problem/19019843>

llvm-svn: 222295

9 years agoUse a memcpy so that type based alias analysis sees the change.
Rafael Espindola [Wed, 19 Nov 2014 01:02:22 +0000 (01:02 +0000)]
Use a memcpy so that type based alias analysis sees the change.

The other option would be to do something like

if (that.isSingleWord())
  VAL = that.VAL;
else
  pVal = that.pVal

This bug was causing 86TTI::getIntImmCost to be miscompiled in a LTO
bootstrap in stage2, causing the build of stage3 to fail.

LLVM is getting quiet good at exploiting this. Not sure if there is anything
a sanitizer could do to help

llvm-svn: 222294

9 years agoFix MSVC warning.
Rui Ueyama [Wed, 19 Nov 2014 00:48:06 +0000 (00:48 +0000)]
Fix MSVC warning.

This patch fixes the following MSVC warning.

  warning C4334: '<<' : result of 32-bit shift implicitly
  converted to 64 bits (was 64-bit shift intended?)

llvm-svn: 222293

9 years ago[Aarch64] Customer lowering of CTPOP to SIMD should check for NEON availability
Weiming Zhao [Wed, 19 Nov 2014 00:29:14 +0000 (00:29 +0000)]
[Aarch64] Customer lowering of CTPOP to SIMD should check for NEON availability

llvm-svn: 222292

9 years ago[asan] initial support for experimental basic-block tracing; also add tests for vario...
Kostya Serebryany [Wed, 19 Nov 2014 00:24:11 +0000 (00:24 +0000)]
[asan] initial support for experimental basic-block tracing; also add tests for various levels of -fsanitize-coverage

llvm-svn: 222291

9 years ago[asan] add experimental basic-block tracing to asan-coverage; also fix -fsanitize...
Kostya Serebryany [Wed, 19 Nov 2014 00:22:58 +0000 (00:22 +0000)]
[asan] add experimental basic-block tracing to asan-coverage; also fix -fsanitize-coverage=3 which was broken by r221718

llvm-svn: 222290

9 years agollvm-readobj: teach it how to dump COFF base relocation table
Rui Ueyama [Wed, 19 Nov 2014 00:18:07 +0000 (00:18 +0000)]
llvm-readobj: teach it how to dump COFF base relocation table

llvm-svn: 222289

9 years agoIntroduce llvm::SplitAllCriticalEdges
Kostya Serebryany [Wed, 19 Nov 2014 00:17:31 +0000 (00:17 +0000)]
Introduce llvm::SplitAllCriticalEdges

Summary:
move the code from BreakCriticalEdges::runOnFunction()
into a separate utility function llvm::SplitAllCriticalEdges()
so that it can be used independently.
No functionality change intended.

Test Plan: check-llvm

Reviewers: nlewycky

Reviewed By: nlewycky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D6313

llvm-svn: 222288

9 years agoRevert r222039 because of bot failure.
Manman Ren [Wed, 19 Nov 2014 00:13:26 +0000 (00:13 +0000)]
Revert r222039 because of bot failure.

http://lab.llvm.org:8080/green/job/clang-Rlto_master/298/
Hopefully, bot will be green. If not, we will re-submit the commit.

llvm-svn: 222287

9 years agoR600/SI: Implement areMemAccessesTriviallyDisjoint
Matt Arsenault [Wed, 19 Nov 2014 00:01:31 +0000 (00:01 +0000)]
R600/SI: Implement areMemAccessesTriviallyDisjoint

This partially makes up for not having address spaces
used for alias analysis in some simple cases.

This is not yet enabled by default so shouldn't change anything yet.

llvm-svn: 222286

9 years agoR600/SI: Set hasSideEffects = 0 on load and store instructions.
Matt Arsenault [Tue, 18 Nov 2014 23:57:33 +0000 (23:57 +0000)]
R600/SI: Set hasSideEffects = 0 on load and store instructions.

Assuming unmodeled side effects interferes with some scheduling
opportunities.

Don't put it in the base class of DS instructions since there
are a few weird effecting, non load/store instructions there.

llvm-svn: 222285

9 years agoclang-format: Add option to disable alignment after opening brackets
Daniel Jasper [Tue, 18 Nov 2014 23:55:27 +0000 (23:55 +0000)]
clang-format: Add option to disable alignment after opening brackets

Before:
  SomeFunction(parameter,
               parameter);

After:
  SomeFunction(parameter,
      parameter);

Patch by Harry Terkelsen, thank you!

llvm-svn: 222284

9 years agoclang-format: Fix space between generic type parameter and square
Daniel Jasper [Tue, 18 Nov 2014 23:48:01 +0000 (23:48 +0000)]
clang-format: Fix space between generic type parameter and square
bracket

Before:
  public Foo<X, Y> [] foos;

After:
  public Foo<X, Y>[] foos;

Patch by Harry Terkelsen. Thank you!

llvm-svn: 222283

9 years agoModify tests to check that va_copy is only defined in C++11 and beyond.
Eric Fiselier [Tue, 18 Nov 2014 23:46:18 +0000 (23:46 +0000)]
Modify tests to check that va_copy is only defined in C++11 and beyond.

llvm-svn: 222282

9 years ago[X86][AVX] 256-bit vector stack unaligned load/stores identification
Simon Pilgrim [Tue, 18 Nov 2014 23:38:19 +0000 (23:38 +0000)]
[X86][AVX] 256-bit vector stack unaligned load/stores identification

Under many circumstances the stack is not 32-byte aligned, resulting in the use of the vmovups/vmovupd/vmovdqu instructions when inserting ymm reloads/spills.

This minor patch adds these instructions to the isFrameLoadOpcode/isFrameStoreOpcode helpers so that they can be correctly identified and not be treated as folded reloads/spills.

This has also been noticed by http://llvm.org/bugs/show_bug.cgi?id=18846 where it was causing redundant spills - I've added a reduced test case at test/CodeGen/X86/pr18846.ll

Differential Revision: http://reviews.llvm.org/D6252

llvm-svn: 222281

9 years agoShuffle APIs around a little bit, so that if you pass custom summary options, we...
Enrico Granata [Tue, 18 Nov 2014 23:36:25 +0000 (23:36 +0000)]
Shuffle APIs around a little bit, so that if you pass custom summary options, we don't end up caching the summary hence obtained. You may want to obtain an uncapped summary, but this should not be reflected in the summary we cache. The drawback is that we don't cache as aggressively as we could, but at least you get to have different summaries with different options without having to reset formatters or the SBValue at each step

llvm-svn: 222280

9 years agoprofile: Robustify instrprof tests
Justin Bogner [Tue, 18 Nov 2014 23:03:14 +0000 (23:03 +0000)]
profile: Robustify instrprof tests

Change these tests not to rely on the exact metadata numbers the
profile data gets.

llvm-svn: 222279

9 years agoFlush out test cases for tuples constructor SFINAE
Eric Fiselier [Tue, 18 Nov 2014 23:01:57 +0000 (23:01 +0000)]
Flush out test cases for tuples constructor SFINAE

llvm-svn: 222278

9 years agoAdd the ability for the NSString and libc++ std::string formatters to retrieve uncapp...
Enrico Granata [Tue, 18 Nov 2014 22:54:45 +0000 (22:54 +0000)]
Add the ability for the NSString and libc++ std::string formatters to retrieve uncapped data

llvm-svn: 222277

9 years agoAllow dsymutil to exists in a path with spaces in it
Enrico Granata [Tue, 18 Nov 2014 22:47:33 +0000 (22:47 +0000)]
Allow dsymutil to exists in a path with spaces in it

llvm-svn: 222276

9 years agoRevert "git-svn test commit"
Ismail Pazarbasi [Tue, 18 Nov 2014 22:45:59 +0000 (22:45 +0000)]
Revert "git-svn test commit"

This reverts commit aa8d370ee798f75bc05a1ae9a240bc3e5b6870ac.

llvm-svn: 222275

9 years ago[Hexagon] Adding A2_and instruction.
Colin LeMahieu [Tue, 18 Nov 2014 22:45:47 +0000 (22:45 +0000)]
[Hexagon] Adding A2_and instruction.

llvm-svn: 222274

9 years agogit-svn test commit
Ismail Pazarbasi [Tue, 18 Nov 2014 22:44:51 +0000 (22:44 +0000)]
git-svn test commit

llvm-svn: 222273

9 years ago[FastISel][AArch64] Also allow folding of sign-/zero-extend and arithmetic
Chad Rosier [Tue, 18 Nov 2014 22:41:49 +0000 (22:41 +0000)]
[FastISel][AArch64] Also allow folding of sign-/zero-extend and arithmetic
shift-right for booleans (i1).

Arithmetic shift-right immediate with sign-/zero-extensions also works for
boolean values.  Update the assert and the test cases to reflect that fact.

llvm-svn: 222272

9 years agoMore override warning cleanup.
Eric Christopher [Tue, 18 Nov 2014 22:40:27 +0000 (22:40 +0000)]
More override warning cleanup.

llvm-svn: 222271

9 years ago[FastISel][AArch64] Also allow folding of sign-/zero-extend and logical
Chad Rosier [Tue, 18 Nov 2014 22:38:42 +0000 (22:38 +0000)]
[FastISel][AArch64] Also allow folding of sign-/zero-extend and logical
shift-right for booleans (i1).

Logical shift-right immediate with sign-/zero-extensions also works for boolean
values.  Update the assert and the test cases to reflect that fact.

llvm-svn: 222270

9 years agoFix 80-column violations, trailing whitespace, comment text.
Eric Christopher [Tue, 18 Nov 2014 22:36:15 +0000 (22:36 +0000)]
Fix 80-column violations, trailing whitespace, comment text.

llvm-svn: 222269

9 years agoThis test also requires an aarch64 target.
Eric Christopher [Tue, 18 Nov 2014 22:36:11 +0000 (22:36 +0000)]
This test also requires an aarch64 target.

llvm-svn: 222268

9 years agoFix an inaccurate comment
Justin Bogner [Tue, 18 Nov 2014 22:17:30 +0000 (22:17 +0000)]
Fix an inaccurate comment

llvm-svn: 222267

9 years ago[mach-o] for 32-bit arm, in -r mode support B (not BL) to undefined symbol
Nick Kledzik [Tue, 18 Nov 2014 22:08:50 +0000 (22:08 +0000)]
[mach-o] for 32-bit arm, in -r mode support B (not BL) to undefined symbol

When fixing up BL instructions, the linker has to compare the thumbness of the
target to decide if the instruction needs to be converted to BLX.  But with B
instruction there is no BX, so the linker asserts if the target is not the
same thumbness. This assert was firing in -r mode when the target was undefined
which it interpreted as being non-thumb.

Test case change is to add a B (in both thumb and arm code) to an undefined
symbol and round trip through -r mode.

llvm-svn: 222266

9 years agoInstCombine: Fix another infinite loop caused by visitFPTrunc
David Majnemer [Tue, 18 Nov 2014 22:06:45 +0000 (22:06 +0000)]
InstCombine: Fix another infinite loop caused by visitFPTrunc

We would attempt to replace an frem's operand with the same operand.
This would cause InstCombine to think real work was done, causing
InstCombine to enter an infinite loop.

This fixes the second part of PR21576.

llvm-svn: 222265

9 years ago[Sema] Patch to issue warning on comparing parameters with
Fariborz Jahanian [Tue, 18 Nov 2014 21:57:54 +0000 (21:57 +0000)]
[Sema] Patch to issue warning on comparing parameters with
nonnull attribute when comparison is always true/false.
Original patch by Steven Wu. I have added extra code to prevent issuing of
warning  when the nonnull parameter is modified prior to the comparison.
This addition prevents false positives in the most obvious cases.
There may still be false positive warnings in some cases (as one of my tests
indicates), but benefit far outweighs such cases. rdar://18712242

llvm-svn: 222264

9 years ago[Hexagon] Adding A2_sub instruction
Colin LeMahieu [Tue, 18 Nov 2014 21:51:51 +0000 (21:51 +0000)]
[Hexagon] Adding A2_sub instruction
Renaming test files.

llvm-svn: 222263

9 years agoFind SWIG with CMake
Ismail Pazarbasi [Tue, 18 Nov 2014 21:46:06 +0000 (21:46 +0000)]
Find SWIG with CMake

SWIG is searched under certain paths within python script. CMake can
detect SWIG with find_package(SWIG). This is used iff user checks
LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION. If
buildSwigWrapperClasses.py does not receive swigExecutable argument,
then the script will use its current search implementation.

llvm-svn: 222262

9 years agoRevert "Revert r222040 because of bot failure."
David Majnemer [Tue, 18 Nov 2014 21:30:02 +0000 (21:30 +0000)]
Revert "Revert r222040 because of bot failure."

This reverts commit r222203, reverting r222040 didn't end up turning the
bot green.

llvm-svn: 222261

9 years agoAdd support for LLVM_USE_SANITIZER=Thread to test suite
Eric Fiselier [Tue, 18 Nov 2014 21:28:49 +0000 (21:28 +0000)]
Add support for LLVM_USE_SANITIZER=Thread to test suite

llvm-svn: 222260

9 years agoAdd support for LLVM_USE_SANITIZER=Thread
Eric Fiselier [Tue, 18 Nov 2014 21:26:45 +0000 (21:26 +0000)]
Add support for LLVM_USE_SANITIZER=Thread

llvm-svn: 222259

9 years agoAdd support for LLVM_USE_SANITIZER=Thread
Eric Fiselier [Tue, 18 Nov 2014 21:23:38 +0000 (21:23 +0000)]
Add support for LLVM_USE_SANITIZER=Thread

Summary: This will help in testing libc++ and libc++abi with tsan.

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: samsonov, llvm-commits

Differential Revision: http://reviews.llvm.org/D6283

llvm-svn: 222258

9 years ago[FastISel][AArch64] Follow-up fix for "Fix shift-immediate emission for "zero" shifts."
Juergen Ributzka [Tue, 18 Nov 2014 21:20:17 +0000 (21:20 +0000)]
[FastISel][AArch64] Follow-up fix for "Fix shift-immediate emission for "zero" shifts."

Shifts also perform sign-/zero-extends to larger types, which requires us to emit
an integer extend instead of a simple COPY.

Related to PR21594.

llvm-svn: 222257

9 years agoR600/SI: Move SIFixSGPRCopies to inst selector passes
Matt Arsenault [Tue, 18 Nov 2014 21:06:58 +0000 (21:06 +0000)]
R600/SI: Move SIFixSGPRCopies to inst selector passes

This should expose more of the actually used VALU
instructions to the machine optimization passes.

This also should help getting i1 handling into a better state.
For not entirly understood reasons, this fixes the split-scalar-i64-add.ll
test where a 64-bit add would only partially be moved to the VALU
resulting in use of undefined VCC.

llvm-svn: 222256

9 years ago[AArch64] Don't optimize all compare instructions.
Juergen Ributzka [Tue, 18 Nov 2014 21:02:40 +0000 (21:02 +0000)]
[AArch64] Don't optimize all compare instructions.

"optimizeCompareInstr" converts compares (cmp/cmn) into plain sub/add
instructions when the flags are not used anymore. This conversion is valid for
most instructions, but not all. Some instructions that don't set the flags
(e.g. sub with immediate) can set the SP, whereas the flag setting version uses
the same encoding for the "zero" register.

Update the code to also check for the return register before performing the
optimization to make sure that a cmp doesn't suddenly turn into a sub that sets
the stack pointer.

I don't have a test case for this, because it isn't easy to trigger.

llvm-svn: 222255

9 years agoFix an incorrect chain operand when expanding INSERT_VECTOR operations through the...
Owen Anderson [Tue, 18 Nov 2014 20:50:19 +0000 (20:50 +0000)]
Fix an incorrect chain operand when expanding INSERT_VECTOR operations through the stack.

Patch by Daniil Troshkov!

llvm-svn: 222254

9 years agoR600/SI: Make sure resource descriptors are always stored in SGPRs
Tom Stellard [Tue, 18 Nov 2014 20:39:39 +0000 (20:39 +0000)]
R600/SI: Make sure resource descriptors are always stored in SGPRs

llvm-svn: 222253

9 years ago[libcxxabi] Refactor CMakeLists.txt's handling of compile and link flags to suppress...
Eric Fiselier [Tue, 18 Nov 2014 20:37:53 +0000 (20:37 +0000)]
[libcxxabi] Refactor CMakeLists.txt's handling of compile and link flags to suppress warnings.

Summary:
This patch mirrors the recent change to libc++ found here http://reviews.llvm.org/D6277.
This fixes PR20395 (http://llvm.org/bugs/show_bug.cgi?id=20395).

Reviewers: jroelofs, mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6286

llvm-svn: 222252

9 years agoMarked LWG 2399 as complete. I committed a test for this earlier today.
Marshall Clow [Tue, 18 Nov 2014 20:37:47 +0000 (20:37 +0000)]
Marked LWG 2399 as complete. I committed a test for this earlier today.

llvm-svn: 222251

9 years ago[Reassociate] Use test cases that can actually be optimized to verify optional
Chad Rosier [Tue, 18 Nov 2014 20:34:01 +0000 (20:34 +0000)]
[Reassociate] Use test cases that can actually be optimized to verify optional
flags are cleared.  The reassociation pass was just reordering the leaf nodes
in the previous test cases.

llvm-svn: 222250

9 years ago[Hexagon] Converting from ADD_rr to A2_add which has encoding bits.
Colin LeMahieu [Tue, 18 Nov 2014 20:28:11 +0000 (20:28 +0000)]
[Hexagon] Converting from ADD_rr to A2_add which has encoding bits.
Adding test to show correct instruction selection and encoding.

llvm-svn: 222249

9 years ago[Reassociate] Rename local variable to not use same name as a member
Chad Rosier [Tue, 18 Nov 2014 20:21:54 +0000 (20:21 +0000)]
[Reassociate] Rename local variable to not use same name as a member
variable. NFC.

llvm-svn: 222248

9 years ago[FastISel][AArch64] Fix shift-immediate emission for "zero" shifts.
Juergen Ributzka [Tue, 18 Nov 2014 19:58:59 +0000 (19:58 +0000)]
[FastISel][AArch64] Fix shift-immediate emission for "zero" shifts.

This change emits a COPY for a shift-immediate with a "zero" shift value.
This fixes PR21594 where we emitted a shift instruction with an incorrect
immediate operand.

llvm-svn: 222247

9 years agoFixed the stop hook test after recent editline changes.
Greg Clayton [Tue, 18 Nov 2014 19:45:23 +0000 (19:45 +0000)]
Fixed the stop hook test after recent editline changes.

llvm-svn: 222246

9 years agoAdd decorator for test that fails on FreeBSD after editline rework
Ed Maste [Tue, 18 Nov 2014 19:30:13 +0000 (19:30 +0000)]
Add decorator for test that fails on FreeBSD after editline rework

llvm.org/21599

llvm-svn: 222245

9 years agoTest commit to verify that commit access works.
Jozef Kolek [Tue, 18 Nov 2014 19:20:34 +0000 (19:20 +0000)]
Test commit to verify that commit access works.

llvm-svn: 222244

9 years agoPatch from dawn@burble.org to make the --silent-run do what it says, not the opposite...
Jim Ingham [Tue, 18 Nov 2014 19:12:13 +0000 (19:12 +0000)]
Patch from dawn@burble.org to make the --silent-run do what it says, not the opposite of what it says.

llvm-svn: 222243

9 years agoAdd a test for LWG issue #2399. We already implement this, but now we have a test...
Marshall Clow [Tue, 18 Nov 2014 18:14:53 +0000 (18:14 +0000)]
Add a test for LWG issue #2399. We already implement this, but now we have a test as well.

llvm-svn: 222242

9 years agoTweak EarlyCSE to recognize series of dead stores
Philip Reames [Tue, 18 Nov 2014 17:46:32 +0000 (17:46 +0000)]
Tweak EarlyCSE to recognize series of dead stores

EarlyCSE is giving up on the current instruction immediately when it recognizes that the current instruction makes a previous store trivially dead. There's no reason to do this. Once the previous store has been deleted, it's perfectly legal to remember the value of the current store (for value forwarding) and the fact the store occurred (it could be dead too!).

Reviewed by: Hal
Differential Revision: http://reviews.llvm.org/D6301

llvm-svn: 222241

9 years agoUpdate status of LWG issues 2340, 2396 and 2401. In all three cases, these are things...
Marshall Clow [Tue, 18 Nov 2014 17:35:16 +0000 (17:35 +0000)]
Update status of LWG issues 2340, 2396 and 2401. In all three cases, these are things that we already do.

llvm-svn: 222240

9 years agoRemove triple in testing case to recover an arm bot.
Manman Ren [Tue, 18 Nov 2014 16:45:34 +0000 (16:45 +0000)]
Remove triple in testing case to recover an arm bot.

llvm-svn: 222239

9 years agoSince Eric poisoned the comma operator on all our test iterators, we no longer need...
Marshall Clow [Tue, 18 Nov 2014 16:15:00 +0000 (16:15 +0000)]
Since Eric poisoned the comma operator on all our test iterators, we no longer need 'comma_iterator'. Remove it from the test suite.

llvm-svn: 222238

9 years agoOMPAtomicDirective::Create(): Fix \param. [-Wdocumentation]
NAKAMURA Takumi [Tue, 18 Nov 2014 15:05:01 +0000 (15:05 +0000)]
OMPAtomicDirective::Create(): Fix \param. [-Wdocumentation]

llvm-svn: 222237

9 years ago[asan] Re-enable zero_page_pc test on Android.
Evgeniy Stepanov [Tue, 18 Nov 2014 14:28:57 +0000 (14:28 +0000)]
[asan] Re-enable zero_page_pc test on Android.

It's not failing anymore. Not sure what has changed (the bot was down for a
long time), but lets keep it this way.

llvm-svn: 222236

9 years agoDon't include <stddef.h>
Jeroen Ketema [Tue, 18 Nov 2014 14:19:27 +0000 (14:19 +0000)]
Don't include <stddef.h>

Including a standard or system header isn't allowed in OpenCL.

The type "size_t" needs to be explicitely defined now.

v2: Use __SIZE_TYPE__ instead of unsigned int.
v3: Define ptrdiff_t and NULL.

Patch-by: Jean-Sébastien Pédron
Reviewed-by: Jeroen Ketema
Reviewed-by: Jan Vesely
llvm-svn: 222235

9 years ago[asan] Fix CMake CMP0046 warning in standalone build.
Evgeniy Stepanov [Tue, 18 Nov 2014 14:04:12 +0000 (14:04 +0000)]
[asan] Fix CMake CMP0046 warning in standalone build.

Make FileCheck an "imported dependency" in standalone build.

llvm-svn: 222234

9 years agoCallGraphTest.cpp: Remove invalid tests. ++S might step over F if S == F.
NAKAMURA Takumi [Tue, 18 Nov 2014 12:23:19 +0000 (12:23 +0000)]
CallGraphTest.cpp: Remove invalid tests. ++S might step over F if S == F.

MSVC Runtime detects "Assertion failed: vector iterator not incrementable"

llvm-svn: 222233

9 years ago[msan] Remove MSanDR and supporting code.
Evgeniy Stepanov [Tue, 18 Nov 2014 10:33:15 +0000 (10:33 +0000)]
[msan] Remove MSanDR and supporting code.

MSanDR is a dynamic instrumentation tool that can instrument the code
(prebuilt libraries and such) that could not be instrumented at compile time.

This code is unused (to the best of our knowledge) and unmaintained, and
starting to bit-rot.

llvm-svn: 222232

9 years ago[OPENMP] Additional processing of 'omp atomic read' directive.
Alexey Bataev [Tue, 18 Nov 2014 10:14:22 +0000 (10:14 +0000)]
[OPENMP] Additional processing of 'omp atomic read' directive.
According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic read' is allowed to be used only for expression statements of form 'v = x;', where x and v (as applicable) are both l-value expressions with scalar type. Patch adds checks for it.

llvm-svn: 222231

9 years agoInstCombine: Fold away tautological masked compares
David Majnemer [Tue, 18 Nov 2014 09:31:41 +0000 (09:31 +0000)]
InstCombine: Fold away tautological masked compares

It is impossible for (x & INT_MAX) == 0 && x == INT_MAX to ever be true.

While this sort of reasoning should normally live in InstSimplify,
the machinery that derives this result is not trivial to split out.

llvm-svn: 222230

9 years agoInstCombine: Clean up foldLogOpOfMaskedICmps
David Majnemer [Tue, 18 Nov 2014 09:31:36 +0000 (09:31 +0000)]
InstCombine: Clean up foldLogOpOfMaskedICmps

No functional change intended.

llvm-svn: 222229

9 years agotsan: add description of AcquireGlobal function
Dmitry Vyukov [Tue, 18 Nov 2014 06:44:43 +0000 (06:44 +0000)]
tsan: add description of AcquireGlobal function

llvm-svn: 222228

9 years agoAdd PIC-level support to Clang.
Justin Hibbits [Tue, 18 Nov 2014 06:17:20 +0000 (06:17 +0000)]
Add PIC-level support to Clang.

Summary:
This distinguishes between -fpic and -fPIC now, with the additions in LLVM for
PIC level support.

Test Plan: No regressions

Reviewers: echristo, rafael

Reviewed By: rafael

Subscribers: rnk, emaste, llvm-commits

Differential Revision: http://reviews.llvm.org/D5400

llvm-svn: 222227

9 years agoFix up the code in the FuncUnwinders class that
Jason Molenda [Tue, 18 Nov 2014 05:57:42 +0000 (05:57 +0000)]
Fix up the code in the FuncUnwinders class that
retrieves the personality routine addr and the
LSDA addr.  Don't bother checking with the
"non-call site" unwind plan - this kind of
information is only going to come from the
call site unwind plan.

llvm-svn: 222226

9 years agoAdd documentation for the SBTarget::ReadInstructions and
Jason Molenda [Tue, 18 Nov 2014 05:43:11 +0000 (05:43 +0000)]
Add documentation for the SBTarget::ReadInstructions and
SBTarget::GetInstructions APIs so it's a little clearer to
understand which should be used.

<rdar://problem/18787018>

llvm-svn: 222225

9 years ago[ASTReader] Add a convenience function to retrieve all the input files of a module...
Argyrios Kyrtzidis [Tue, 18 Nov 2014 05:24:18 +0000 (05:24 +0000)]
[ASTReader] Add a convenience function to retrieve all the input files of a module file.

llvm-svn: 222224

9 years agodocs: Modernize some examples in WritingAnLLVMPass
Justin Bogner [Tue, 18 Nov 2014 05:22:39 +0000 (05:22 +0000)]
docs: Modernize some examples in WritingAnLLVMPass

llvm-svn: 222223

9 years agodocs: Fix a couple of typo-ish errors in WritingAnLLVMPass
Justin Bogner [Tue, 18 Nov 2014 05:00:52 +0000 (05:00 +0000)]
docs: Fix a couple of typo-ish errors in WritingAnLLVMPass

- Make CallGraphSCCPass's paragraph about doFinalization refer to
  runOnSCC instead of runOnFunction, since that's what it's about.
- Fix a reference in the FunctionPass paragraph.

llvm-svn: 222222

9 years agoMake the mutex ivar in Unwind recursive so we don't have a thread
Jason Molenda [Tue, 18 Nov 2014 04:57:28 +0000 (04:57 +0000)]
Make the mutex ivar in Unwind recursive so we don't have a thread
deadlocking when we have the base Unwind class and the HistoryUnwind
subclass both trying to acquire the lock on the same thread to clear
their respective ivar state.
<rdar://problem/18986350>

llvm-svn: 222221

9 years agoFully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()
Frederic Riss [Tue, 18 Nov 2014 03:40:51 +0000 (03:40 +0000)]
Fully handle globals and functions in CGDebugInfo::getDeclarationOrDefinition()

Currently this function would return nothing for functions or globals that
haven't seen a definition yet. Make it return a forward declaration that will
get RAUWed with the definition if one is seen at a later point. The strategy
used to implement this is similar to what's done for types: the forward
declarations are stored in a vector and post processed upon finilization to
perform the required RAUWs.

For now the only user of getDeclarationOrDefinition() is EmitUsingDecl(), thus
this patch allows to emit correct imported declarations even in the absence of
an actual definition of the imported entity.

(Another user will be the debug info generation for argument default values
that I need to resurect).

Differential Revision: http://reviews.llvm.org/D6173

llvm-svn: 222220

9 years ago[DebugInfo] Move collection of various function/var decl properties into helper funct...
Frederic Riss [Tue, 18 Nov 2014 03:40:46 +0000 (03:40 +0000)]
[DebugInfo] Move collection of various function/var decl properties into helper functions.

NFC. Helpers to be re-used in upcoming commit.

llvm-svn: 222219

9 years agoUpdate to match LLVM r222216
David Majnemer [Tue, 18 Nov 2014 03:06:52 +0000 (03:06 +0000)]
Update to match LLVM r222216

llvm-svn: 222218

9 years agoAllow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable...
Frederic Riss [Tue, 18 Nov 2014 02:46:11 +0000 (02:46 +0000)]
Allow DwarfCompileUnit::constructImportedEntityDIE to instanciate a GlobalVariable DIE.

Usually global variables are in a retain list and instanciated before
any call to constructImportedEntityDIE is made. This isn't true for
forward declarations though.
The testcase for this change is generated by a clang patched to emit
such forward declarations (patch at http://reviews.llvm.org/D6173
which will land soon). The updated testcase tests more than just
global variables, it now tests every type of 'using' clause we
support.

llvm-svn: 222217

9 years agollvm-readobj: Don't print the Characteristics field as the Subsystem
David Majnemer [Tue, 18 Nov 2014 02:45:28 +0000 (02:45 +0000)]
llvm-readobj: Don't print the Characteristics field as the Subsystem

We claimed that we were printing the Subystem field when we were
actually printing the Characteristics field.

llvm-svn: 222216

9 years agoSimplifyCFG: Range'ify some for-loops. No functional change.
Hans Wennborg [Tue, 18 Nov 2014 02:37:11 +0000 (02:37 +0000)]
SimplifyCFG: Range'ify some for-loops. No functional change.

llvm-svn: 222215

9 years agoRead the LSDA and Personality Routine function address out of the
Jason Molenda [Tue, 18 Nov 2014 02:27:42 +0000 (02:27 +0000)]
Read the LSDA and Personality Routine function address out of the
eh_frame data.  These two pieces of information are used in the
process of exception handler unwinding on SysV ABI systems.

This patch reads the data from the eh_frame section
(DWARFCallFrameInfo.cpp), allows for it to be saved & read out
of a given UnwindPlan (UnwindPlan.h, UnwindPlan.cpp) - as well
as printing the information in the UnwindPlan::Dump method - and
adds methods to the FuncUnwinders object so that higher levels
can query if a given function has an LSDA / personality routine
defined.

It's only lightly tested, but seems to be working correctly as long
as your have this information in eh_frame.  Does not address getting
this information from compact unwind yet on Darwin systems.

<rdar://problem/18742797>

llvm-svn: 222214

9 years agoIndVarSimplify: Allow LFTR to fire more often
David Majnemer [Tue, 18 Nov 2014 02:20:58 +0000 (02:20 +0000)]
IndVarSimplify: Allow LFTR to fire more often

I added a pessimization in r217102 to prevent miscompiles when the
incremented induction variable was used in a comparison; it would be
poison.

Try to use the incremented induction variable more often when we can be
sure that the increment won't end in poison.

Differential Revision: http://reviews.llvm.org/D6222

llvm-svn: 222213

9 years agoIR: Sink MDNode::Hash down to GenericMDNode::Hash
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 02:20:29 +0000 (02:20 +0000)]
IR: Sink MDNode::Hash down to GenericMDNode::Hash

Part of PR21532.

llvm-svn: 222212

9 years agoIR: Move MDNode operands from the back to the front
Duncan P. N. Exon Smith [Tue, 18 Nov 2014 01:56:14 +0000 (01:56 +0000)]
IR: Move MDNode operands from the back to the front

Having the operands at the back prevents subclasses from safely adding
fields.  Move them to the front.

Instead of replicating the custom `malloc()`, `free()` and `DestroyFlag`
logic that was there before, overload `new` and `delete`.

I added calls to a new `GenericMDNode::dropAllReferences()` in
`LLVMContextImpl::~LLVMContextImpl()`.  There's a maze of callbacks
happening during teardown, and this resolves them before we enter
the destructors.

Part of PR21532.

llvm-svn: 222211

9 years agoUpdate testing case that was accidently duplicated.
Manman Ren [Tue, 18 Nov 2014 01:49:06 +0000 (01:49 +0000)]
Update testing case that was accidently duplicated.

llvm-svn: 222210

9 years agoFix covered switch warning
Michael J. Spencer [Tue, 18 Nov 2014 01:26:46 +0000 (01:26 +0000)]
Fix covered switch warning

llvm-svn: 222209