platform/upstream/llvm.git
6 years ago [test cases] add test cases for find more abs pattern
Chen Zheng [Wed, 11 Jul 2018 01:07:21 +0000 (01:07 +0000)]
  [test cases] add test cases for find more abs pattern

  Differential Revision: https://reviews.llvm.org/D49123

llvm-svn: 336752

6 years ago[TableGen] Fix some bad formatting. NFC
Craig Topper [Wed, 11 Jul 2018 01:01:55 +0000 (01:01 +0000)]
[TableGen] Fix some bad formatting. NFC

llvm-svn: 336751

6 years ago[SemaCXX] Remove comment from coroutines test, NFC
Brian Gesiak [Wed, 11 Jul 2018 01:00:53 +0000 (01:00 +0000)]
[SemaCXX] Remove comment from coroutines test, NFC

Summary:
The file name was accidentally included when the test file was added.

Test Plan: check-clang

llvm-svn: 336750

6 years agoAdd libcxxabi option back for sanitizer use.
Stephen Hines [Wed, 11 Jul 2018 00:50:03 +0000 (00:50 +0000)]
Add libcxxabi option back for sanitizer use.

Summary:
A prior refactoring accidentally dropped the case for using libc++abi as
the out-of-tree C++ runtime library for sanitizers. This patch restores
that functionality, which is used by Android, which can't depend on the
full libc++ for these libraries.

Reviewers: phosek, EricWF

Reviewed By: phosek

Subscribers: meikeb, kongyi, chh, mgorny, delcypher, llvm-commits, #sanitizers, pirama

Differential Revision: https://reviews.llvm.org/D49157

llvm-svn: 336749

6 years agoRemove qualtype qualifier in coroutine error to prevent assert in debug
Brian Gesiak [Wed, 11 Jul 2018 00:45:48 +0000 (00:45 +0000)]
Remove qualtype qualifier in coroutine error to prevent assert in debug

Summary:
A forward-declared coroutine_traits should trip an error; we need
a complete type.

Unfortunately, in debug mode only, we trip an assert when attempting
to provide the fully qualified type for the error message.
If you try to compile a program with a forward-declared
coroutine_traits in debug mode, clang will crash.

I've included a test for the behavior and removed the q modifier
on the error message. This prevents the crash in debug mode and
does not change the behavior for the error message on a
forward-declaration of a coroutine_traits type.

Test Plan:
I've included a test for the forward-declaration.

Patch by Tanoy Sinha!

Reviewers: modocache, GorNishanov

Reviewed By: modocache

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D49099

llvm-svn: 336748

6 years ago[docs] List correct default for -ftemplate-depth; also add missing
Richard Smith [Wed, 11 Jul 2018 00:34:54 +0000 (00:34 +0000)]
[docs] List correct default for -ftemplate-depth; also add missing
documentation for -fconstexpr-steps.

llvm-svn: 336747

6 years agoPR38095: Allow constant-folding of loads through bitcasted pointers if
Richard Smith [Wed, 11 Jul 2018 00:29:05 +0000 (00:29 +0000)]
PR38095: Allow constant-folding of loads through bitcasted pointers if
the bitcast only changed cvr-qualifications within the pointer type.

llvm-svn: 336746

6 years agoDR330: look through array types when forming the cv-decomposition of a type.
Richard Smith [Wed, 11 Jul 2018 00:19:19 +0000 (00:19 +0000)]
DR330: look through array types when forming the cv-decomposition of a type.

This allows more qualification conversions, eg. conversion from
   'int *(*)[]' -> 'const int *const (*)[]'
is now permitted, along with all the consequences of that: more types
are similar, more cases are permitted by const_cast, and conversely,
fewer "casting away constness" cases are permitted by reinterpret_cast.

llvm-svn: 336745

6 years ago[LangRef] Clarify alloca of zero bytes.
Eli Friedman [Wed, 11 Jul 2018 00:02:01 +0000 (00:02 +0000)]
[LangRef] Clarify alloca of zero bytes.

Let's be conservative here; it matches what we actually implemented, and
it should be rare in practice anyway.

Differential Revision: https://reviews.llvm.org/D49042

llvm-svn: 336744

6 years agoRefactor GdbIndexSection. NFC.
Rui Ueyama [Tue, 10 Jul 2018 23:48:27 +0000 (23:48 +0000)]
Refactor GdbIndexSection. NFC.

This patch merges createGdbIndex function and GdbIndexSection's
constructor into a single static member function of the class.

This patch also change how we keep CU vectors. Previously, CuVector
and GdbSymbols were parallel arrays, but there's no reason to choose that
design. Now, CuVector is a member of GdbSymbol class.

A lot of members are removed from GdbIndexSection. Previously, it has
members that need to be kept in sync over several phases. I belive the new
design is less error-prone, and the new code is much easier to read
than before.

llvm-svn: 336743

6 years ago[ARM] Treat cmn immediates as legal in isLegalICmpImmediate.
Eli Friedman [Tue, 10 Jul 2018 23:44:37 +0000 (23:44 +0000)]
[ARM] Treat cmn immediates as legal in isLegalICmpImmediate.

The original code attempted to do this, but the std::abs() call didn't
actually do anything due to implicit type conversions.  Fix the type
conversions, and perform the correct check for negative immediates.

This probably has very little practical impact, but it's worth fixing
just to avoid confusion in the future, I think.

Differential Revision: https://reviews.llvm.org/D48907

llvm-svn: 336742

6 years ago[ORC] Generalize alias materialization to support re-exports (i.e. aliasing of
Lang Hames [Tue, 10 Jul 2018 23:34:56 +0000 (23:34 +0000)]
[ORC] Generalize alias materialization to support re-exports (i.e. aliasing of
symbols in another VSO).

Also fixes a bug where chained aliases within a single VSO would deadlock on
materialization.

llvm-svn: 336741

6 years ago[X86] Also fix the test for _mm512_mullo_epi64 to test the intrinsic instead of a...
Craig Topper [Tue, 10 Jul 2018 23:28:05 +0000 (23:28 +0000)]
[X86] Also fix the test for _mm512_mullo_epi64 to test the intrinsic instead of a copy of the intrinsic implementation.

This had the same issue I just fixed in r336739. Apparently I copy pasted _mm512_mullo_epi64 when I added _mm512_mullox_epi64.

llvm-svn: 336740

6 years ago[X86] Fix the test for _mm512_mullox_epi64 to test the intrinsic instead of a copy...
Craig Topper [Tue, 10 Jul 2018 23:13:01 +0000 (23:13 +0000)]
[X86] Fix the test for _mm512_mullox_epi64 to test the intrinsic instead of a copy of the intrinsic implementation.

llvm-svn: 336739

6 years agoFix determination of whether a reinterpret_cast casts away constness.
Richard Smith [Tue, 10 Jul 2018 23:04:35 +0000 (23:04 +0000)]
Fix determination of whether a reinterpret_cast casts away constness.

The "casts away constness" check doesn't care at all how the different
layers of the source and destination type were formed: for example, if
the source is a pointer and the destination is a pointer-to-member, the
types are still decomposed and their pointee qualifications are still
checked.

This rule is bizarre and somewhat ridiculous, so as an extension we
accept code making use of such reinterpret_casts with a warning outside
of SFINAE contexts.

llvm-svn: 336738

6 years agoUse ExprMutationAnalyzer in performance-for-range-copy
Shuai Wang [Tue, 10 Jul 2018 22:51:06 +0000 (22:51 +0000)]
Use ExprMutationAnalyzer in performance-for-range-copy

Summary:
This gives better coverage to the check as ExprMutationAnalyzer is more
accurate comparing to isOnlyUsedAsConst.

Majority of wins come from const usage of member field, e.g.:
for (auto widget : container) { // copy of loop variable
  if (widget.type == BUTTON) { // const usage only recognized by ExprMutationAnalyzer
    // ...
  }
}

Reviewers: george.karpenkov

Subscribers: a.sidorin, cfe-commits

Differential Revision: https://reviews.llvm.org/D48854

llvm-svn: 336737

6 years agoSort includes + include a missing `extern "C"` header
George Burgess IV [Tue, 10 Jul 2018 22:48:13 +0000 (22:48 +0000)]
Sort includes + include a missing `extern "C"` header

If we don't include Initialization.h,
`LLVMInitializeAggressiveInstCombiner` won't see its `extern "C"` decl.
This causes sadness, name mangling, and linker errors.

Reported on the mailing lists by Vladimir Vissoultchev. Thanks!

llvm-svn: 336736

6 years ago[X86] Remove AddedComplexity from all patterns that use X86vzmovl as their root.
Craig Topper [Tue, 10 Jul 2018 22:23:54 +0000 (22:23 +0000)]
[X86] Remove AddedComplexity from all patterns that use X86vzmovl as their root.

Some added 20 and some added 15. Its unclear when to use which value and whether they are required at all.

This patch removes them all. If we start finding real world issues we may need to add them back with proper tests.

llvm-svn: 336735

6 years agoRefactor ClangUserExpression::Parse [NFC]
Raphael Isemann [Tue, 10 Jul 2018 22:12:39 +0000 (22:12 +0000)]
Refactor ClangUserExpression::Parse [NFC]

Summary:
This patch splits out functionality from the `Parse` method into different methods.
This benefits the code completion work (which should reuse those methods) and makes the
code a bit more readable.

Note that this patch is as minimal as possible. Some of the code in the new methods definitely
needs more refactoring.

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D48339

llvm-svn: 336734

6 years agoFix -Wmismatched-tags warning
Richard Trieu [Tue, 10 Jul 2018 22:09:33 +0000 (22:09 +0000)]
Fix -Wmismatched-tags warning

class -> struct in forward declaration.

llvm-svn: 336733

6 years ago[windows] LLDB shows the wrong values when register read is executed at a frame other...
Stella Stamenova [Tue, 10 Jul 2018 22:05:33 +0000 (22:05 +0000)]
[windows] LLDB shows the wrong values when register read is executed at a frame other than zero

Summary:
This is a clean version of the change suggested here: https://bugs.llvm.org/show_bug.cgi?id=37495

The main change is to follow the same pattern as non-windows targets and use an unwinder object to retrieve the register context. I also changed a couple of the comments to actually log, so that issues with unsupported scenarios can be tracked down more easily. Lastly, ClearStackFrames is implemented in the base class, so individual thread implementations don't have to override it.

Reviewers: asmith, zturner, aleksandr.urakov

Reviewed By: aleksandr.urakov

Subscribers: emaste, stella.stamenova, tatyana-krasnukha, llvm-commits

Differential Revision: https://reviews.llvm.org/D49111

llvm-svn: 336732

6 years ago[X86] Teach X86InstrInfo::commuteInstructionImpl to use MOVSD/MOVSS for BLEND under...
Craig Topper [Tue, 10 Jul 2018 22:02:23 +0000 (22:02 +0000)]
[X86] Teach X86InstrInfo::commuteInstructionImpl to use MOVSD/MOVSS for BLEND under optsize when the immediate allows it.

Isel currently emits movss/movsd a lot of the time and an accidental double commute turns it into a blend.

Ideally we'd select blend directly in isel under optspeed and not rely on the double commute to create blend.

llvm-svn: 336731

6 years ago[NFC] typo
JF Bastien [Tue, 10 Jul 2018 21:52:39 +0000 (21:52 +0000)]
[NFC] typo

llvm-svn: 336730

6 years ago[NFC] Switch CodeGenFunction to use value init instead of member init lists
Erich Keane [Tue, 10 Jul 2018 21:07:50 +0000 (21:07 +0000)]
[NFC] Switch CodeGenFunction to use value init instead of member init lists

The member init list for the sole constructor for CodeGenFunction
has gotten out of hand, so this patch moves the non-parameter-dependent
initializations into the member value inits.

Note: This is what was intended to be committed in r336726
llvm-svn: 336729

6 years ago[X86] Remove X86ISD::MOVLPS and X86ISD::MOVLPD. NFCI
Craig Topper [Tue, 10 Jul 2018 21:00:22 +0000 (21:00 +0000)]
[X86] Remove X86ISD::MOVLPS and X86ISD::MOVLPD. NFCI

These ISD nodes try to select the MOVLPS and MOVLPD instructions which are special load only instructions. They load data and merge it into the lower 64-bits of an XMM register. They are logically equivalent to our MOVSD node plus a load.

There was only one place in X86ISelLowering that used MOVLPD and no places that selected MOVLPS. The one place that selected MOVLPD had to choose between it and MOVSD based on whether there was a load. But lowering is too early to tell if the load can really be folded. So in isel we have patterns that use MOVSD for MOVLPD if we can't find a load.

We also had patterns that select the MOVLPD instruction for a MOVSD if we can find a load, but didn't choose the MOVLPD ISD opcode for some reason.

So it seems better to just standardize on MOVSD ISD opcode and manage MOVSD vs MOVLPD instruction with isel patterns.

llvm-svn: 336728

6 years agoRevert -r336726, which included more files than intended.
Erich Keane [Tue, 10 Jul 2018 20:51:41 +0000 (20:51 +0000)]
Revert -r336726, which included more files than intended.

llvm-svn: 336727

6 years ago[NFC] Switch CodeGenFunction to use value init instead of member init lists
Erich Keane [Tue, 10 Jul 2018 20:46:46 +0000 (20:46 +0000)]
[NFC] Switch CodeGenFunction to use value init instead of member init lists

The member init list for the sole constructor for CodeGenFunction
has gotten out of hand, so this patch moves the non-parameter-dependent
initializations into the member value inits.

llvm-svn: 336726

6 years ago[libFuzzer] Disable dataflow.test on AArch64.
Matt Morehouse [Tue, 10 Jul 2018 20:45:36 +0000 (20:45 +0000)]
[libFuzzer] Disable dataflow.test on AArch64.

Summary:
After my recent change to allow MSan + libFuzzer, the
ExplodeDFSanLabelsTest.cpp test started to overflow the stack with
recursive function SetBytesForLabel() on an AArch64 bot.  Perhaps that
bot has a smaller stack size, or maybe AArch64 has larger stack frames
for this particular function.

Reviewers: kcc, javed.absar

Reviewed By: kcc

Subscribers: kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D49150

llvm-svn: 336725

6 years ago[testsuite] Implement a category to skip libstdcxx tests
Davide Italiano [Tue, 10 Jul 2018 20:37:24 +0000 (20:37 +0000)]
[testsuite] Implement a category to skip libstdcxx tests

On systems where it's not supported.
As far as I understand Linux is the only systems which now ships
with libstdcxx (maybe NetBSD?, but I'm not entirely sure of the
state of lldb on the platform).
We could make this more fine grained looking for the header as
we do for libcxx. This is a little tricky as there's no such
thing as /usr/include/c++/v1, but libstdcxx encodes the version
number in the path (i.e. /usr/include/c++/5.4). I guess we might
match a regex, but it seems fragile to me.

Differential Revision:  https://reviews.llvm.org/D49110

llvm-svn: 336724

6 years agoRefactor parsing of option lists with a raw string suffix.
Raphael Isemann [Tue, 10 Jul 2018 20:17:38 +0000 (20:17 +0000)]
Refactor parsing of option lists with a raw string suffix.

Summary:
A subset of the LLDB commands follows this command line interface style:
   <command name> [arguments] -- <string suffix>
The parsing code for this interface has been so far been duplicated into the different
command objects which makes it hard to maintain and reuse elsewhere.

This patches improves the situation by adding a OptionsWithRaw class that centralizes
the parsing logic and allows easier testing. The different commands now just call this class to
extract the arguments and the raw suffix from the provided user input.

Reviewers: jingham

Reviewed By: jingham

Subscribers: mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D49106

llvm-svn: 336723

6 years ago[AMDGPU] Fix layering issue with AMDGPUHSAMetadataStreamer (NFC)
Scott Linder [Tue, 10 Jul 2018 20:07:22 +0000 (20:07 +0000)]
[AMDGPU] Fix layering issue with AMDGPUHSAMetadataStreamer (NFC)

llvm-svn: 336722

6 years ago[ThinLTO] Use std::map to get determistic imports files
Teresa Johnson [Tue, 10 Jul 2018 20:06:04 +0000 (20:06 +0000)]
[ThinLTO] Use std::map to get determistic imports files

Summary:
I noticed that the .imports files emitted for distributed ThinLTO
backends do not have consistent ordering. This is because StringMap
iteration order is not guaranteed to be deterministic. Since we already
have a std::map with this information, used when emitting the individual
index files (ModuleToSummariesForIndex), use it for the imports files as
well.

This issue is likely causing some unnecessary rebuilds of the ThinLTO
backends in our distributed build system as the imports files are inputs
to those backends.

Reviewers: pcc, steven_wu, mehdi_amini

Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D48783

llvm-svn: 336721

6 years ago[X86] Remove dead SDNode object from X86InstrFragmentsSIMD.td. NFC
Craig Topper [Tue, 10 Jul 2018 20:03:51 +0000 (20:03 +0000)]
[X86] Remove dead SDNode object from X86InstrFragmentsSIMD.td. NFC

It points to an opcode that doesn't exist.

llvm-svn: 336720

6 years agoRevert "[Fuzzer] Afl driver changing iterations handling"
Matt Morehouse [Tue, 10 Jul 2018 19:58:42 +0000 (19:58 +0000)]
Revert "[Fuzzer] Afl driver changing iterations handling"

This reverts rL334510 due to breakage of afl_driver's command line
interface.

Patch By: Jonathan Metzman

Differential Revision: https://reviews.llvm.org/D49141

llvm-svn: 336719

6 years agoRevert r336653 "[VPlan] Add VPlanTestBase.h with helper class to build VPlan for...
Evgeniy Stepanov [Tue, 10 Jul 2018 19:56:10 +0000 (19:56 +0000)]
Revert r336653 "[VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests."

Memory leaks in tests.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap/builds/6289/steps/check-llvm%20asan/logs/stdio

Direct leak of 192 byte(s) in 1 object(s) allocated from:
    #0 0x554ea8 in operator new(unsigned long) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:106
    #1 0x56cef1 in llvm::VPlanTestBase::doAnalysis(llvm::Function&) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h:53:14
    #2 0x56bec4 in llvm::VPlanTestBase::buildHCFG(llvm::BasicBlock*) /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanTestBase.h:57:3
    #3 0x571f1e in llvm::(anonymous namespace)::VPlanHCFGTest_testVPInstructionToVPRecipesInner_Test::TestBody() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/unittests/Transforms/Vectorize/VPlanHCFGTest.cpp:119:15
    #4 0xed2291 in testing::Test::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #5 0xed44c8 in testing::TestInfo::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2656:11
    #6 0xed5890 in testing::TestCase::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:2774:28
    #7 0xef3634 in testing::internal::UnitTestImpl::RunAllTests() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc:4649:43
    #8 0xef27e0 in testing::UnitTest::Run() /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/src/gtest.cc
    #9 0xebbc23 in RUN_ALL_TESTS /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/googletest/include/gtest/gtest.h:2233:46
    #10 0xebbc23 in main /b/sanitizer-x86_64-linux-bootstrap/build/llvm/utils/unittest/UnitTestMain/TestMain.cpp:51
    #11 0x7f65569592e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)

and more.

llvm-svn: 336718

6 years agoPatch to fix pragma metadata for do-while loops
Bjorn Pettersson [Tue, 10 Jul 2018 19:55:02 +0000 (19:55 +0000)]
Patch to fix pragma metadata for do-while loops

Summary:
Make sure that loop metadata only is put on the backedge
when expanding a do-while loop.
Previously we added the loop metadata also on the branch
in the pre-header. That could confuse optimization passes
and result in the loop metadata being associated with the
wrong loop.

Fixes https://bugs.llvm.org/show_bug.cgi?id=38011

Committing on behalf of deepak2427 (Deepak Panickal)

Reviewers: #clang, ABataev, hfinkel, aaron.ballman, bjope

Reviewed By: bjope

Subscribers: bjope, rsmith, shenhan, zzheng, xbolva00, lebedev.ri, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D48721

llvm-svn: 336717

6 years agoRevert r336590 "[libclang] evalute compound statement cursors before trying to evaluate"
Evgeniy Stepanov [Tue, 10 Jul 2018 19:49:07 +0000 (19:49 +0000)]
Revert r336590 "[libclang] evalute compound statement cursors before trying to evaluate"

New memory leaks in
LibclangParseTest_EvaluateChildExpression_Test::TestBody()

llvm-svn: 336716

6 years agoRevert r336591 "[libclang] NFC, simplify clang_Cursor_Evaluate"
Evgeniy Stepanov [Tue, 10 Jul 2018 19:48:53 +0000 (19:48 +0000)]
Revert r336591 "[libclang] NFC, simplify clang_Cursor_Evaluate"

This change is blocking r336590 which is being reverted due to memory leaks.

llvm-svn: 336715

6 years agoLimit ASan non-executable-pc test case to x86 bots
Vlad Tsyrklevich [Tue, 10 Jul 2018 19:34:46 +0000 (19:34 +0000)]
Limit ASan non-executable-pc test case to x86 bots

The test case fails on the big-endian PPC bot, probably because PowerPC
uses function descriptors. More over other architectures don't support
NX mappings. (This test case was not being exercised prior to r336633.)

llvm-svn: 336714

6 years ago[CMake] Set per-runtime library directory suffix in runtimes build
Petr Hosek [Tue, 10 Jul 2018 19:13:33 +0000 (19:13 +0000)]
[CMake] Set per-runtime library directory suffix in runtimes build

Do not use LLVM_RUNTIMES_LIBDIR_SUFFIX variable which is an internal
variable used by the runtimes build from individual runtimes, instead
set per-runtime librarhy directory suffix variable which is necessary
for the sanitized runtimes build to install libraries into correct
location.

Differential Revision: https://reviews.llvm.org/D49121

llvm-svn: 336713

6 years ago[X86] Remove AddedComplexity from register form of NOT. NFCI
Craig Topper [Tue, 10 Jul 2018 19:09:00 +0000 (19:09 +0000)]
[X86] Remove AddedComplexity from register form of NOT. NFCI

I believe isProfitableToFold will stop the load folding that this was intended to overcome.

Given an (xor load, -1), isProfitableToFold will see that the immediate can be folded with the xor using a one byte immediate since it can be sign extended. It doesn't know about NOT, but the one byte immediate check is enough to stop the fold.

llvm-svn: 336712

6 years ago[X86] Remove AddedComplexity from MMX_X86movw2d patterns.
Craig Topper [Tue, 10 Jul 2018 18:41:58 +0000 (18:41 +0000)]
[X86] Remove AddedComplexity from MMX_X86movw2d patterns.

There were only 3 patterns with this node as a root and they all the same AddedComplexity. So this doesn't really do anything.

llvm-svn: 336711

6 years agoFix a typo/regression in r335495.
John Baldwin [Tue, 10 Jul 2018 17:44:08 +0000 (17:44 +0000)]
Fix a typo/regression in r335495.

Use getTriple.isMIPS64() to detect 64-bit MIPS ABIs in
FreeBSD::getSupportedSanitizers() instead of getTriple.isMIPS32().

Reviewed By: atanasyan

Differential Revision: https://reviews.llvm.org/D49143

llvm-svn: 336710

6 years ago[libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITY
Louis Dionne [Tue, 10 Jul 2018 17:38:30 +0000 (17:38 +0000)]
[libc++] Declare noop_coroutine() with _LIBCPP_INLINE_VISIBILITY

Summary:
It was defined with the right visibility, but declared without any visibility.
This function was left out of a prior revision that did the same to several
functions in <compare> (r336665) because the compiler I used didn't support
coroutines. This reinforces the need for automated checks -- there might
still be several cases of this throughout the library.

Reviewers: EricWF

Subscribers: modocache, christof, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D49145

llvm-svn: 336709

6 years ago[CMake] Teach the build system to codesign built products
Justin Bogner [Tue, 10 Jul 2018 17:32:48 +0000 (17:32 +0000)]
[CMake] Teach the build system to codesign built products

Automatically codesign all executables and dynamic libraries if a
codesigning identity is given (via LLVM_CODESIGNING_IDENTITY). This
option is darwin only for now.

Also update platforms/iOS.cmake to pick up the right versions of
codesign and codesign_allocate.

llvm-svn: 336708

6 years ago[AMDGPU] Refactor HSAMetadataStream::emitKernel (NFC)
Scott Linder [Tue, 10 Jul 2018 17:31:32 +0000 (17:31 +0000)]
[AMDGPU] Refactor HSAMetadataStream::emitKernel (NFC)

Move all metadata construction into AMDGPUHSAMetadataStreamer.

Differential Revision: https://reviews.llvm.org/D48176

llvm-svn: 336707

6 years ago[gcov] Fix fallout from r336693
Ulrich Weigand [Tue, 10 Jul 2018 17:08:05 +0000 (17:08 +0000)]
[gcov] Fix fallout from r336693

Fix building GCDAProfiling.c with pre-C99 compilers.
This caused a build bot failure.

llvm-svn: 336706

6 years ago[asan] Disable non-execute test on s390
Ulrich Weigand [Tue, 10 Jul 2018 16:55:27 +0000 (16:55 +0000)]
[asan] Disable non-execute test on s390

Processors before z14 don't support non-execute protection,
so they will start execution random memory contents, causing
the test to randomly fail or succeed.

llvm-svn: 336705

6 years ago[ELF][MIPS] Add mote tests on MipsArchTree routines, fix typos in error messages
Simon Atanasyan [Tue, 10 Jul 2018 16:51:17 +0000 (16:51 +0000)]
[ELF][MIPS] Add mote tests on MipsArchTree routines, fix typos in error messages

This fix add more test cases for routines check MIPS ELF header flags and
flags from .MIPS.abiflags sections. The tests use yaml2obj for object
files generation because not all combinations of flags can be produced
by LLVM tools.

llvm-svn: 336704

6 years ago[GlobalISel][X86_64] Support for G_SITOFP
Alexander Ivchenko [Tue, 10 Jul 2018 16:38:35 +0000 (16:38 +0000)]
[GlobalISel][X86_64] Support for G_SITOFP

The instruction selection is automatically handled by tablegen

llvm-svn: 336703

6 years ago[Evaluator] Examine alias when evaluating function call
Eugene Leviant [Tue, 10 Jul 2018 16:34:23 +0000 (16:34 +0000)]
[Evaluator] Examine alias when evaluating function call

This fixes PR38120

llvm-svn: 336702

6 years ago[DAGCombiner] Add special case fast paths for udiv x,1 and udiv x,-1
Simon Pilgrim [Tue, 10 Jul 2018 16:33:07 +0000 (16:33 +0000)]
[DAGCombiner] Add special case fast paths for udiv x,1 and udiv x,-1

udiv x,-1 was going down the (slow) BuildUDIV route resulting in unnecessary shifts.

llvm-svn: 336701

6 years agoInitialize a variable properly to fix buildbots.
Rui Ueyama [Tue, 10 Jul 2018 16:26:15 +0000 (16:26 +0000)]
Initialize a variable properly to fix buildbots.

llvm-svn: 336700

6 years agoTry to fix broken build due to r336663.
Dan Liew [Tue, 10 Jul 2018 16:22:05 +0000 (16:22 +0000)]
Try to fix broken build due to r336663.

It turns out that the `${XRAY_HEADERS}` CMake variable was already
in use and was used for public headers. It seems that
`lib/xray/tests/CMakeLists.txt` was depending on this.

To fix rename the new `${XRAY_HEADERS}` to `${XRAY_IMPL_HEADERS}`.

llvm-svn: 336699

6 years agoRevert "[AccelTable] Provide abstraction for emitting DWARF5 accelerator tables."
Jonas Devlieghere [Tue, 10 Jul 2018 16:18:56 +0000 (16:18 +0000)]
Revert "[AccelTable] Provide abstraction for emitting DWARF5 accelerator tables."

This reverts r336529 because an alternative approach turned out to be a
better fit for dsymuil.

llvm-svn: 336698

6 years agoAMDGPU: Make hidden argument metadata consistent with
Konstantin Zhuravlyov [Tue, 10 Jul 2018 16:12:51 +0000 (16:12 +0000)]
AMDGPU: Make hidden argument metadata consistent with
amdgpu-implicitarg-num-bytes attribute

Differential Revision: https://reviews.llvm.org/D49096

llvm-svn: 336697

6 years ago[InstCombine] allow flag propagation when using safe constant
Sanjay Patel [Tue, 10 Jul 2018 16:09:49 +0000 (16:09 +0000)]
[InstCombine] allow flag propagation when using safe constant

This corresponds with the code for the single binop pattern
added in rL336684.

llvm-svn: 336696

6 years agoRemove s390x XFAILs now that gcov profiling works.
Ulrich Weigand [Tue, 10 Jul 2018 16:09:24 +0000 (16:09 +0000)]
Remove s390x XFAILs now that gcov profiling works.

llvm-svn: 336695

6 years ago[X86] Add srem/udiv/urem by constant tests
Simon Pilgrim [Tue, 10 Jul 2018 16:08:28 +0000 (16:08 +0000)]
[X86] Add srem/udiv/urem by constant tests

Match the tests in combine-sdiv.ll

llvm-svn: 336694

6 years ago[gcov] Fix gcov profiling on big-endian machines
Ulrich Weigand [Tue, 10 Jul 2018 16:08:27 +0000 (16:08 +0000)]
[gcov] Fix gcov profiling on big-endian machines

Two fixes required to handle big-endian systems:

- 64-bit counter values are stored in a mixed-endian format in the
gcov files: a 32-bit low-part followed by a 32-bit high part. Note that
this is already implemented correctly on the LLVM side, see
GCOVBuffer::readInt64.

- The tag values (e.g. arcs tag, object summary tag, ...) are aways
written as the same sequence of bytes independent of byte order. But
when *reading* them back in, the code reads them as 32-bit values in
host byte order. For the comparisons to work correctly, this should
instead always read them as little-endian values.

Fixes PR 38121.

Reviewed By: marco-c

Differential Revision: https://reviews.llvm.org/D49132

llvm-svn: 336693

6 years ago[gcov] Fix ABI when calling llvm_gcov_... routines from instrumentation code
Ulrich Weigand [Tue, 10 Jul 2018 16:05:47 +0000 (16:05 +0000)]
[gcov] Fix ABI when calling llvm_gcov_... routines from instrumentation code

The llvm_gcov_... routines in compiler-rt are regular C functions that
need to be called using the proper C ABI for the target. The current
code simply calls them using plain LLVM IR types. Since the type are
mostly simple, this happens to just work on certain targets. But other
targets still need special handling; in particular, it may be necessary
to sign- or zero-extended sub-word values to comply with the ABI. This
caused gcov failures on SystemZ in particular.

Now the very same problem was already fixed for the llvm_profile_ calls
here: https://reviews.llvm.org/D21736

This patch uses the same method to fix the llvm_gcov_ calls, in
particular calls to llvm_gcda_start_file, llvm_gcda_emit_function, and
llvm_gcda_emit_arcs.

Reviewed By: marco-c

Differential Revision: https://reviews.llvm.org/D49134

llvm-svn: 336692

6 years ago[WebAssembly] Add missing a few {{$}}s to a test
Heejin Ahn [Tue, 10 Jul 2018 16:00:43 +0000 (16:00 +0000)]
[WebAssembly] Add missing a few {{$}}s to a test

llvm-svn: 336691

6 years agoMake a struct type declaration private. NFC.
Rui Ueyama [Tue, 10 Jul 2018 15:57:25 +0000 (15:57 +0000)]
Make a struct type declaration private. NFC.

llvm-svn: 336690

6 years agoAMDGPU/NFC: Fix typo in test name
Konstantin Zhuravlyov [Tue, 10 Jul 2018 15:54:46 +0000 (15:54 +0000)]
AMDGPU/NFC: Fix typo in test name

hsa-metadata-enqueu-kernel.ll ->
hsa-metadata-enqueue-kernel.ll

llvm-svn: 336689

6 years ago[MC] Add interface to finish pending labels.
Jonas Devlieghere [Tue, 10 Jul 2018 15:32:17 +0000 (15:32 +0000)]
[MC] Add interface to finish pending labels.

When manually finishing the object writer in dsymutil, it's possible
that there are pending labels that haven't been resolved. This results
in an assertion when the assembler tries to fixup a label that doesn't
have an address yet.

Differential revision: https://reviews.llvm.org/D49131

llvm-svn: 336688

6 years agoUpdate test to work on Windows
Paul Robinson [Tue, 10 Jul 2018 15:23:10 +0000 (15:23 +0000)]
Update test to work on Windows

llvm-svn: 336687

6 years agoSimplify. NFC.
Rui Ueyama [Tue, 10 Jul 2018 15:15:56 +0000 (15:15 +0000)]
Simplify. NFC.

llvm-svn: 336686

6 years agoSupport -fdebug-prefix-map for assembler source (pass to cc1as). This
Paul Robinson [Tue, 10 Jul 2018 15:15:24 +0000 (15:15 +0000)]
Support -fdebug-prefix-map for assembler source (pass to cc1as).  This
is useful to omit the debug compilation dir when compiling assembly
files with -g.  Part of PR38050.

Patch by Siddhartha Bagaria!

Differential Revision: https://reviews.llvm.org/D48989

llvm-svn: 336685

6 years ago[InstCombine] safely allow non-commutative binop identity constant folds
Sanjay Patel [Tue, 10 Jul 2018 15:12:31 +0000 (15:12 +0000)]
[InstCombine] safely allow non-commutative binop identity constant folds

This was originally intended with D48893, but as discussed there, we
have to make the folds safe from producing extra poison. This should
give the single binop folds the same capabilities as the existing
folds for 2-binops+shuffle.

LLVM binary opcode review: there are a total of 18 binops. There are 7
commutative binops (add, mul, and, or, xor, fadd, fmul) which we already
fold. We're able to fold 6 more opcodes with this patch (shl, lshr, ashr,
fdiv, udiv, sdiv). There are no folds for srem/urem/frem AFAIK. We don't
bother with sub/fsub with constant operand 1 because those are
canonicalized to add/fadd. 7 + 6 + 3 + 2 = 18.

llvm-svn: 336684

6 years agoAdd CachedHashStringRef::data().
Rui Ueyama [Tue, 10 Jul 2018 15:10:49 +0000 (15:10 +0000)]
Add CachedHashStringRef::data().

This accessor is useful and could be slightly more efficient than
Str.val().data() because you can avoid StringRef instantiation.

Differential Revision: https://reviews.llvm.org/D49133

llvm-svn: 336683

6 years ago[Hexagon] Change .mir testcase to make sure function is not in SSA form
Krzysztof Parzyszek [Tue, 10 Jul 2018 14:49:54 +0000 (14:49 +0000)]
[Hexagon] Change .mir testcase to make sure function is not in SSA form

If a machine function satisfies SSA, the IsSSA property is assumed even
if the pass to be executed runs after existing from SSA. If the pass
output then does not conform to SSA, a verifier error will be flagged
(with expensive checks enabled).

llvm-svn: 336682

6 years agoAMDGPU: Try to fix test again
Matt Arsenault [Tue, 10 Jul 2018 14:47:31 +0000 (14:47 +0000)]
AMDGPU: Try to fix test again

llvm-svn: 336681

6 years agoSupport -fdebug-prefix-map in llvm-mc. This is useful to omit the
Paul Robinson [Tue, 10 Jul 2018 14:41:54 +0000 (14:41 +0000)]
Support -fdebug-prefix-map in llvm-mc.  This is useful to omit the
debug compilation dir when compiling assembly files with -g.
Part of PR38050.

Patch by Siddhartha Bagaria!

Differential Revision: https://reviews.llvm.org/D48988

llvm-svn: 336680

6 years ago[InstCombine] drop poison flags when shuffle mask undef propagates to constant
Sanjay Patel [Tue, 10 Jul 2018 14:27:55 +0000 (14:27 +0000)]
[InstCombine] drop poison flags when shuffle mask undef propagates to constant

llvm-svn: 336679

6 years agoReapply "Make __gcov_flush flush counters for all shared libraries"
Marco Castelluccio [Tue, 10 Jul 2018 14:12:03 +0000 (14:12 +0000)]
Reapply "Make __gcov_flush flush counters for all shared libraries"

This reapplies r336365, after marking tests as failing on various
configurations.

llvm-svn: 336678

6 years ago[AArch64][SVE] Asm: Support for predicated unary operations.
Sander de Smalen [Tue, 10 Jul 2018 14:05:55 +0000 (14:05 +0000)]
[AArch64][SVE] Asm: Support for predicated unary operations.

This patch adds support for the following instructions:
  CLS  (Count Leading Sign bits)
  CLZ  (Count Leading Zeros)
  CNT  (Count non-zero bits)
  CNOT (Logically invert boolean condition in vector)
  NOT  (Bitwise invert vector)
  FABS (Floating-point absolute value)
  FNEG (Floating-point negate)

All operations are predicated and unary, e.g.
  clz  z0.s, p0/m, z1.s

- CLS, CLZ, CNT, CNOT and NOT have variants for 8, 16, 32
  and 64 bit elements.

- FABS and FNEG have variants for 16, 32 and 64 bit elements.

llvm-svn: 336677

6 years agoUpdate test for backend error message change
Matt Arsenault [Tue, 10 Jul 2018 14:03:50 +0000 (14:03 +0000)]
Update test for backend error message change

llvm-svn: 336676

6 years agoReapply "AMDGPU: Force inlining if LDS global address is used"
Matt Arsenault [Tue, 10 Jul 2018 14:03:41 +0000 (14:03 +0000)]
Reapply "AMDGPU: Force inlining if LDS global address is used"

This reverts commit r336623

llvm-svn: 336675

6 years agoRename a variable for consistency. NFC.
Rui Ueyama [Tue, 10 Jul 2018 14:03:39 +0000 (14:03 +0000)]
Rename a variable for consistency. NFC.

llvm-svn: 336674

6 years ago[scudo] Use mkdir -p when creating directories for a test
Filipe Cabecinhas [Tue, 10 Jul 2018 13:59:59 +0000 (13:59 +0000)]
[scudo] Use mkdir -p when creating directories for a test

llvm-svn: 336673

6 years agoReduce memory usage when creating .gdb_index. NFC.
Rui Ueyama [Tue, 10 Jul 2018 13:49:13 +0000 (13:49 +0000)]
Reduce memory usage when creating .gdb_index. NFC.

.gdb_index sections can be very large. When you are compiling
multi-gibibyte executables, they can be larger than 1 GiB. The previous
implementation of .gdb_index seems to consume too much memory.

This patch reduces memory consumption by eliminating temporary objects.
In one experiment, memory consumption of GdbIndexSection class is
reduced from 962 MiB to 228 MiB when creating a .gdb_index of 1350 GiB.

Differential Revision: https://reviews.llvm.org/D49094

llvm-svn: 336672

6 years ago[analyzer] Add option to set maximum symbol complexity threshold
Mikhail R. Gadelha [Tue, 10 Jul 2018 13:46:05 +0000 (13:46 +0000)]
[analyzer] Add option to set maximum symbol complexity threshold

Summary:
This adds an option, max-symbol-complexity, so an user can set the maximum symbol complexity threshold.

Note that the current behaviour is equivalent to max complexity = 0, when taint analysis is not enabled and tests show that in a number of tests, having complexity = 25 yields the same results as complexity = 10000.

This patch was extracted and modified from Dominic Chen's patch, D35450.

Reviewers: george.karpenkov, NoQ, ddcc

Reviewed By: george.karpenkov

Subscribers: xazax.hun, szepet, a.sidorin

Differential Revision: https://reviews.llvm.org/D49093

llvm-svn: 336671

6 years ago[ELF] - Add a test for readCallGraph() code.
George Rimar [Tue, 10 Jul 2018 13:42:21 +0000 (13:42 +0000)]
[ELF] - Add a test for readCallGraph() code.

This is to test the following untested line:
https://github.com/llvm-mirror/lld/blob/master/ELF/Driver.cpp#L643

llvm-svn: 336670

6 years ago[LibFuzzer] Disable MSan test on Darwin which was added by r336619. The MemorySanitiz...
Dan Liew [Tue, 10 Jul 2018 13:35:35 +0000 (13:35 +0000)]
[LibFuzzer] Disable MSan test on Darwin which was added by r336619. The MemorySanitizer is
not supported on Darwin currently and so Clang refuses to compile with
`-fsanitize=memory`.

llvm-svn: 336669

6 years ago[InstCombine] allow more shuffle-binop folds with safe constants
Sanjay Patel [Tue, 10 Jul 2018 13:33:26 +0000 (13:33 +0000)]
[InstCombine] allow more shuffle-binop folds with safe constants

The case with 2 variables is more complicated than the case where
we eliminate the shuffle entirely because a shuffle with an undef
mask element creates an undef result.

I'm not aware of any current analysis/transform that recognizes that
undef propagating to a div/rem/shift, but we have to guard against
the possibility.

llvm-svn: 336668

6 years ago[DebugInfo][LoopVectorize] Preserve DL in induction PHI and Add
Anastasis Grammenos [Tue, 10 Jul 2018 13:29:50 +0000 (13:29 +0000)]
[DebugInfo][LoopVectorize] Preserve DL in induction PHI and Add

Differential Revision: https://reviews.llvm.org/D48968

llvm-svn: 336667

6 years agoRemove BUILD file from google-benchmark
Eric Fiselier [Tue, 10 Jul 2018 13:25:26 +0000 (13:25 +0000)]
Remove BUILD file from google-benchmark

llvm-svn: 336666

6 years ago[libc++] Declare <compare> operators with the proper visibility attribute
Louis Dionne [Tue, 10 Jul 2018 13:21:03 +0000 (13:21 +0000)]
[libc++] Declare <compare> operators with the proper visibility attribute

Summary:
Many operators in <compare> were _defined_ with the proper visibility attribute,
but they were _declared_ without any. This is not a problem until we change the
definition of _LIBCPP_INLINE_VISIBILITY to something that requires the
declaration to be decorated.

I also marked `strong_equality::operator weak_equality()` as
`_LIBCPP_INLINE_VISIBILITY`, since it seems like it had been forgotten.

This came up while trying to get rid of `__attribute__((__always_inline__))`
in favor of `__attribute__((internal_linkage))`.

Reviewers: EricWF, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits

Differential Revision: https://reviews.llvm.org/D49104

llvm-svn: 336665

6 years ago[DAGCombiner] visitREM - call visitSDIVLike/visitUDIVLike directly to avoid recursive...
Simon Pilgrim [Tue, 10 Jul 2018 13:18:16 +0000 (13:18 +0000)]
[DAGCombiner] visitREM - call visitSDIVLike/visitUDIVLike directly to avoid recursive combining.

As suggested by @efriedma on D48975 use the visitSDIVLike/visitUDIVLike functions introduced at rL336656.

llvm-svn: 336664

6 years ago[CMake] Add compiler-rt header files to the list of sources for targets
Dan Liew [Tue, 10 Jul 2018 13:00:17 +0000 (13:00 +0000)]
[CMake] Add compiler-rt header files to the list of sources for targets
when building with an IDE so that header files show up in the UI.
This massively improves the development workflow in IDEs.

To implement this a new function `compiler_rt_process_sources(...)` has
been added that adds header files to the list of sources when the
generator is an IDE. For non-IDE generators (e.g. Ninja/Makefile) no
changes are made to the list of source files.

The function can be passed a list of headers via the
`ADDITIONAL_HEADERS` argument. For each runtime library a list of
explicit header files has been added and passed via
`ADDITIONAL_HEADERS`. For `tsan` and `sanitizer_common` a list of
headers was already present but it was stale and has been updated
to reflect the current state of the source tree.

The original version of this patch used file globbing (`*.{h,inc,def}`)
to find the headers but the approach was changed due to this being a
CMake anti-pattern (if the list of headers changes CMake won't
automatically re-generate if globbing is used).

The LLVM repo contains a similar function named `llvm_process_sources()`
but we don't use it here for several reasons:

* It depends on the `LLVM_ENABLE_OPTION` cache variable which is
  not set in standalone compiler-rt builds.
* We would have to `include(LLVMProcessSources)` which I'd like to
  avoid because it would include a bunch of stuff we don't need.

Differential Revision: https://reviews.llvm.org/D48422

llvm-svn: 336663

6 years ago[Hexagon] Add implicit uses even when untied explicit uses are present
Krzysztof Parzyszek [Tue, 10 Jul 2018 12:57:49 +0000 (12:57 +0000)]
[Hexagon] Add implicit uses even when untied explicit uses are present

An explicit untied use is not sufficient to maintain liveness of a
register redefined in a predicated instruction. For example
  %1 = COPY %0
  ...
  %1 = A2_paddif %2, %1, 1
could become
  $r1 = COPY $r0
  ...
  $r1 = A2_paddif $p0, $r1, 1
and later
  $r1 = COPY $r0                ;; this is not really dead!
  ...
  $r1 = A2_paddif $p0, $r0, 1

llvm-svn: 336662

6 years ago[compiler-rt] Get rid of "%T" expansions
Filipe Cabecinhas [Tue, 10 Jul 2018 12:53:46 +0000 (12:53 +0000)]
[compiler-rt] Get rid of "%T" expansions

Summary:
Original patch by Kuba Mracek

The %T lit expansion expands to a common directory shared between all
the tests in the same directory, which is unexpected and unintuitive,
and more importantly, it's been a source of subtle race conditions and
flaky tests. In https://reviews.llvm.org/D35396, it was agreed that it
would be best to simply ban %T and only keep %t, which is unique to each
test. When a test needs a temporary directory, it can just create one
using mkdir %t.

This patch removes %T in compiler-rt.

Differential Revision: https://reviews.llvm.org/D48618

llvm-svn: 336661

6 years ago[modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts
Yuka Takahashi [Tue, 10 Jul 2018 12:17:34 +0000 (12:17 +0000)]
[modules] Fix 37878; Autoload subdirectory modulemaps with specific LangOpts

Summary:
Reproducer and errors:
https://bugs.llvm.org/show_bug.cgi?id=37878

lookupModule was falling back to loadSubdirectoryModuleMaps when it couldn't
find ModuleName in (proper) search paths. This was causing iteration over all
files in the search path subdirectories for example "/usr/include/foobar" in
bugzilla case.

Users don't expect Clang to load modulemaps in subdirectories implicitly, and
also the disk access is not cheap.

if (AllowExtraModuleMapSearch) true with ObjC with @import ModuleName.

Reviewers: rsmith, aprantl, bruno

Subscribers: cfe-commits, teemperor, v.g.vassilev

Differential Revision: https://reviews.llvm.org/D48367

llvm-svn: 336660

6 years ago[LowerSwitch] Fixed faulty PHI nodes
Karl-Johan Karlsson [Tue, 10 Jul 2018 12:06:16 +0000 (12:06 +0000)]
[LowerSwitch] Fixed faulty PHI nodes

Summary:
Fixed two cases of where PHI nodes need to be updated by lowerswitch.

When lowerswitch find out that the switch default branch is not
reachable it remove the old default and replace it with the most
popular block from the cases, but it forget to update the PHI
nodes in the default block.

The PHI nodes also need to be updated when the switch is replaced
with a single branch.

Reviewers: hans, reames, arsenm

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D47203

llvm-svn: 336659

6 years agoFixing builtin __atomic_fetch_min declaration
Omer Paparo Bivas [Tue, 10 Jul 2018 12:04:04 +0000 (12:04 +0000)]
Fixing builtin __atomic_fetch_min declaration

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

llvm-svn: 336658

6 years ago[Support] Harded JSON against invalid UTF-8.
Sam McCall [Tue, 10 Jul 2018 11:51:26 +0000 (11:51 +0000)]
[Support] Harded JSON against invalid UTF-8.

Parsing invalid UTF-8 input is now a parse error.
Creating JSON values from invalid UTF-8 now triggers an assertion, and
(in no-assert builds) substitutes the unicode replacement character.
Strings retrieved from json::Value are always valid UTF-8.

llvm-svn: 336657

6 years ago[DAGCombiner] Split SDIV/UDIV optimization expansions from the rest of the combines...
Simon Pilgrim [Tue, 10 Jul 2018 11:38:00 +0000 (11:38 +0000)]
[DAGCombiner] Split SDIV/UDIV optimization expansions from the rest of the combines. NFCI.

As suggested by @efriedma on D48975, this patch separates the BuildDiv/Pow2 style optimizations from the rest of the visitSDIV/visitUDIV to make it easier to reuse the combines and will allow us to avoid some rather nasty node recursive combining in visitREM.

llvm-svn: 336656

6 years ago[MinGW] Skip adding default win32 api libraries if -lwindowsapp is specified
Martin Storsjo [Tue, 10 Jul 2018 10:46:51 +0000 (10:46 +0000)]
[MinGW] Skip adding default win32 api libraries if -lwindowsapp is specified

In this setup, skip adding all the default windows import libraries,
if linking to windowsapp (which replaces them, when targeting the
windows store/UWP api subset).

With GCC, the same is achieved by using a custom spec file, but
since clang doesn't use spec files, we have to allow other means of
overriding what default libraries to use (without going all the
way to using -nostdlib, which would exclude everything). The same
approach, in detecting certain user specified libraries and omitting
others from the defaults, was already used in SVN r314138.

Differential Revision: https://reviews.llvm.org/D49059

llvm-svn: 336655

6 years ago[MinGW] Treat any -lucrt* as replacing -lmsvcrt
Martin Storsjo [Tue, 10 Jul 2018 10:46:45 +0000 (10:46 +0000)]
[MinGW] Treat any -lucrt* as replacing -lmsvcrt

Since SVN r314138, we check if the user has specified any particular
alternative msvcrt/ucrt version, and skip the default -lmsvcrt
in those cases.

In addition to the existing names checked, we should also treat
a plain -lucrt in the same way, mingw-w64 has now added a separate
import library named libucrt.a, in addition to libucrtbase.a.

Differential Revision: https://reviews.llvm.org/D49054

llvm-svn: 336654

6 years ago[VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests.
Florian Hahn [Tue, 10 Jul 2018 10:45:46 +0000 (10:45 +0000)]
[VPlan] Add VPlanTestBase.h with helper class to build VPlan for tests.

Reviewers: dcaballe, hsaito, rengolin

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D49032

llvm-svn: 336653