platform/upstream/llvm.git
5 years ago[InstCombine] add tests for funnel shifts; NFC
Sanjay Patel [Tue, 20 Nov 2018 17:51:49 +0000 (17:51 +0000)]
[InstCombine] add tests for funnel shifts; NFC

These are included in D54666, so adding them first with baseline results.

Patch by: @nikic (Nikita Popov)

llvm-svn: 347333

5 years ago[InstSimplify] fold funnel shifts with undef operands
Sanjay Patel [Tue, 20 Nov 2018 17:34:59 +0000 (17:34 +0000)]
[InstSimplify] fold funnel shifts with undef operands

Splitting these off from the D54666.

Patch by: nikic (Nikita Popov)

llvm-svn: 347332

5 years ago[InstSimplify] add tests for funnel shift with undef operands; NFC
Sanjay Patel [Tue, 20 Nov 2018 17:30:09 +0000 (17:30 +0000)]
[InstSimplify] add tests for funnel shift with undef operands; NFC

These are part of D54666, so adding them here before the patch to
show the baseline (currently unoptimized) results.

Patch by: @nikic (Nikita Popov)

llvm-svn: 347331

5 years ago[InstructionSimplify] Add support for saturating add/sub
Sanjay Patel [Tue, 20 Nov 2018 17:20:26 +0000 (17:20 +0000)]
[InstructionSimplify] Add support for saturating add/sub

Add support for saturating add/sub in InstructionSimplify. In particular, the following simplifications are supported:

    sat(X + 0) -> X
    sat(X + undef) -> -1
    sat(X uadd MAX) -> MAX
    (and commutative variants)

    sat(X - 0) -> X
    sat(X - X) -> 0
    sat(X - undef) -> 0
    sat(undef - X) -> 0
    sat(0 usub X) -> 0
    sat(X usub MAX) -> 0

Patch by: @nikic (Nikita Popov)

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

llvm-svn: 347330

5 years agoAdd benchmarks for sorting and heap functions.
Samuel Benzaquen [Tue, 20 Nov 2018 17:15:17 +0000 (17:15 +0000)]
Add benchmarks for sorting and heap functions.

Summary:
Benchmarks for std::sort, std::stable_sort, std::make_heap,
std::sort_heap, std::pop_heap and std::push_heap.

The benchmarks are run with integers and strings, and with different
sorted input.

Reviewers: EricWF

Subscribers: christof, mgrang, ldionne, libcxx-commits

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

llvm-svn: 347329

5 years ago[ConstantFolding] Add support for saturating add/sub
Sanjay Patel [Tue, 20 Nov 2018 17:05:55 +0000 (17:05 +0000)]
[ConstantFolding] Add support for saturating add/sub

Support saturating add/sub in constant folding, based on the APInt methods introduced in D54332.

Patch by: @nikic (Nikita Popov)

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

llvm-svn: 347328

5 years ago[ELF] Allow --noinhibit-exec to produce corrupted executable with relocation overflow
Fangrui Song [Tue, 20 Nov 2018 17:04:11 +0000 (17:04 +0000)]
[ELF] Allow --noinhibit-exec to produce corrupted executable with relocation overflow

Summary:
When --noinhibit-exec is used, ld.bfd/gold emit errors but allow to produce corrupted executable, which is handy for debugging purpose. lld's --noinhibit-exec has a different meaning and changes some errors to warnings. This patch replaces "error" with "errorOrWarn" to exploit that property.

We may revisit this: if we should keep them as errors (as ld.bfd/gold do) but allow to produce a (corrupted) executable.

Reviewers: ruiu, grimar, espindola

Reviewed By: grimar

Subscribers: Timmmm, jhenderson, emaste, arichardson, llvm-commits

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

llvm-svn: 347327

5 years ago[AMDGPU] Regenerate weird stores tests.
Simon Pilgrim [Tue, 20 Nov 2018 17:04:02 +0000 (17:04 +0000)]
[AMDGPU] Regenerate weird stores tests.

Makes an upcoming SimplifyDemandedBits optimization much easier to understand.

llvm-svn: 347326

5 years ago[LoopSink] Add preheader to alias set
Guozhi Wei [Tue, 20 Nov 2018 16:49:07 +0000 (16:49 +0000)]
[LoopSink] Add preheader to alias set

This patch fixes PR39695.

The original LoopSink only considers memory alias in loop body. But PR39695 shows that instructions following sink candidate in preheader should also be checked. This is a conservative patch, it simply adds whole preheader block to alias set. It may lose some optimization opportunity, but I think that is very rare because: 1 in the most common case st/ld to the same address, the load should already be optimized away. 2 usually preheader is not very large.

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

llvm-svn: 347325

5 years ago[APInt] Add methods for saturated add and sub
Sanjay Patel [Tue, 20 Nov 2018 16:47:59 +0000 (16:47 +0000)]
[APInt] Add methods for saturated add and sub

This adds the sadd_sat, uadd_sat, ssub_sat, usub_sat methods for performing saturating additions and subtractions to APInt.

Split out from D54237.

Patch by: nikic (Nikita Popov)

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

llvm-svn: 347324

5 years ago[lit] Build and link TestIRMemoryMapWindows explicitly
Stella Stamenova [Tue, 20 Nov 2018 16:44:06 +0000 (16:44 +0000)]
[lit] Build and link TestIRMemoryMapWindows explicitly

If we just invoke clang-cl without specifying the linker, the tests fail on Windows because they cannot find the correct linker to use, so it needs to be specified explicitly

llvm-svn: 347323

5 years ago[NFC] Remove MS line endings in diagnostics file.
Erich Keane [Tue, 20 Nov 2018 16:32:46 +0000 (16:32 +0000)]
[NFC] Remove MS line endings in diagnostics file.

Change-Id: I74704acf052e2e8fe707f18230bc5655c2bf2a91
llvm-svn: 347322

5 years ago[lit] Disable the stop hook tests on Windows
Stella Stamenova [Tue, 20 Nov 2018 16:24:03 +0000 (16:24 +0000)]
[lit] Disable the stop hook tests on Windows
These tests are not able to pass on Windows as written as they don't even build

llvm-svn: 347321

5 years ago[AST] Store the expressions in ParenListExpr in a trailing array
Bruno Ricci [Tue, 20 Nov 2018 16:20:40 +0000 (16:20 +0000)]
[AST] Store the expressions in ParenListExpr in a trailing array

Use the newly available space in the bit-fields of Stmt
and store the expressions in a trailing array. This saves
2 pointer per ParenListExpr.

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

Reviewed By: rjmccall

llvm-svn: 347320

5 years ago[AST][NFC] Factor out some repeated code in ArraySubscriptExpr.
Bruno Ricci [Tue, 20 Nov 2018 16:09:45 +0000 (16:09 +0000)]
[AST][NFC] Factor out some repeated code in ArraySubscriptExpr.

Factor out the test for whether the LHS is the base of the
array subscript expression into a private method lhsIsBase.

NFC.

llvm-svn: 347319

5 years ago[PatternMatch] Handle undef vectors consistently
Sanjay Patel [Tue, 20 Nov 2018 16:08:19 +0000 (16:08 +0000)]
[PatternMatch] Handle undef vectors consistently

This patch fixes the issue noticed in D54532.
The problem is that cst_pred_ty-based matchers like m_Zero() currently do not match
scalar undefs (as expected), but *do* match vector undefs. This may lead to optimization
inconsistencies in rare cases.

There is only one existing test for which output changes, reverting the change from D53205.
The reason here is that vector fsub undef, %x is no longer matched as an m_FNeg(). While I
think that the new output is technically worse than the previous one, it is consistent with
scalar, and I don't think it's really important either way (generally that undef should have
been folded away prior to reassociation.)

I've also added another test case for this issue based on InstructionSimplify. It took some
effort to find that one, as in most cases undef folds are either checked first -- and in the
cases where they aren't it usually happens to not make a difference in the end. This is the
only case I was able to come up with. Prior to this patch the test case simplified to undef
in the scalar case, but zeroinitializer in the vector case.

Patch by: @nikic (Nikita Popov)

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

llvm-svn: 347318

5 years ago[AST][NFC] Pack ArraySubscriptExpr
Bruno Ricci [Tue, 20 Nov 2018 16:03:33 +0000 (16:03 +0000)]
[AST][NFC] Pack ArraySubscriptExpr

Use the newly available space in the bit-fields of Stmt.
This saves one pointer per ArraySubscriptExpr.

llvm-svn: 347317

5 years ago[AArch64, x86] add tests for shift-not (PR39657); NFC
Sanjay Patel [Tue, 20 Nov 2018 15:49:42 +0000 (15:49 +0000)]
[AArch64, x86] add tests for shift-not (PR39657); NFC

llvm-svn: 347316

5 years ago[clang-tidy] Don't generate incorrect fixes for class constructed from list-initializ...
Haojian Wu [Tue, 20 Nov 2018 15:45:15 +0000 (15:45 +0000)]
[clang-tidy] Don't generate incorrect fixes for class constructed from list-initialized arguments

Summary:
Currently the smart_ptr check (modernize-make-unique) generates the
fixes that cannot compile for cases like below -- because brace list can
not be deduced in `make_unique`.

```
struct Bar { int a, b; };
struct Foo { Foo(Bar); };
auto foo = std::unique_ptr<Foo>(new Foo({1, 2}));
```

Reviewers: aaron.ballman

Subscribers: xazax.hun, cfe-commits

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

llvm-svn: 347315

5 years agoRevert 347294, it turned many bots on lab.llvm.org:8011/console red.
Nico Weber [Tue, 20 Nov 2018 15:27:43 +0000 (15:27 +0000)]
Revert 347294, it turned many bots on lab.llvm.org:8011/console red.

llvm-svn: 347314

5 years ago[DAGCombine] Add calls to SimplifyDemandedVectorElts from visitINSERT_SUBVECTOR ...
Simon Pilgrim [Tue, 20 Nov 2018 15:23:50 +0000 (15:23 +0000)]
[DAGCombine] Add calls to SimplifyDemandedVectorElts from visitINSERT_SUBVECTOR (PR37989)

This uncovered an off-by-one typo in SimplifyDemandedVectorElts's INSERT_SUBVECTOR handling as its bounds check was bailing on safe indices.

llvm-svn: 347313

5 years agoUpdate the documentation for attribute feature tests.
Aaron Ballman [Tue, 20 Nov 2018 15:23:07 +0000 (15:23 +0000)]
Update the documentation for attribute feature tests.

This clarifies that __has_cpp_attribute is no longer always an extension since it's now available in C++2a. Also, Both __has_cpp_attribute and __has_c_attribute can accept attribute scope tokens with alternative spelling (clang vs _Clang and gnu vs __gnu__).

llvm-svn: 347312

5 years ago[PowerPC] Add Itineraries for STWU/STWUX etc
Jinsong Ji [Tue, 20 Nov 2018 15:11:42 +0000 (15:11 +0000)]
[PowerPC] Add Itineraries for STWU/STWUX etc

When doing some instruction scheduling work, we noticed some missing itineraries.

Before we switch to machine scheduler, those missing itineraries might not have impact to actually scheduling,
because we can still get same latency due to default values.

With machine scheduler, however, itineraries will have impact to scheduling.
eg: NumMicroOps will default to be 0 if there is NO itineraries for specific instruction class.
And most of the instruction class with itineraries will have NumMicroOps default to 1.

This will has impact on the count of RetiredMOps, affects the Pending/Available Queue,
then causing different scheduling or suboptimal scheduling further.

This patch is for STWU/STWUX (IIC_LdStStoreUpd ) for P8.

Since there are already multiple IIC for store update, this patch also merge
IIC_LdStSTDU/IIC_LdStStoreUpd to IIC_LdStSTU
IIC_LdStSTDUX to IIC_LdStSTUX

and we add a new testcase in https://reviews.llvm.org/D54699 to show the difference.

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

llvm-svn: 347311

5 years ago[PowerPC][NFC]Add testcase for STWU scheduling check
Jinsong Ji [Tue, 20 Nov 2018 14:55:43 +0000 (14:55 +0000)]
[PowerPC][NFC]Add testcase for STWU scheduling check

This patch add a STWU testcase for scheduling check.

Currently P7/P8 which use itineraries are missing IIC_LdStStoreUpd,
We use CHECK-ITIN prefix to check P7/P8, then use default for P9 (and future).

We will fix the missing itineraries of IIC_LdStStoreUpd in following patch,
and update this testcase to show the scheduling difference only there.

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

llvm-svn: 347310

5 years ago[llvm-exegesis][NFC] Some code style cleanup
Jinsong Ji [Tue, 20 Nov 2018 14:41:59 +0000 (14:41 +0000)]
[llvm-exegesis][NFC] Some code style cleanup

Apply review comments of https://reviews.llvm.org/D54185 to other target as well, specifically:

1. make anonymous namespaces as small as possible, avoid using static inside anonymous namespaces
2. Add missing header to some files
3. GetLoadImmediateOpcodem-> getLoadImmediateOpcode
4. Fix typo

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

llvm-svn: 347309

5 years agoFix MSVC 'truncation of constant value' warning. NFCI.
Simon Pilgrim [Tue, 20 Nov 2018 14:29:40 +0000 (14:29 +0000)]
Fix MSVC 'truncation of constant value' warning. NFCI.

llvm-svn: 347308

5 years ago[clang-format] JS: don't treat is: as a type matcher
Krasimir Georgiev [Tue, 20 Nov 2018 14:22:43 +0000 (14:22 +0000)]
[clang-format] JS: don't treat is: as a type matcher

Summary:
Clang-format is treating all occurences of `is` in js as type matchers. In some
cases this is wrong, as it might be a dict key.

Reviewers: mprobst

Reviewed By: mprobst

Subscribers: cfe-commits

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

llvm-svn: 347307

5 years ago[ASTImporter] Set redecl chain of functions before any other import
Gabor Marton [Tue, 20 Nov 2018 14:19:39 +0000 (14:19 +0000)]
[ASTImporter] Set redecl chain of functions before any other import

Summary:
FunctionDecl import starts with a lookup and then we create a new Decl.
Then in case of CXXConstructorDecl we further import other Decls
(base classes, members through CXXConstructorDecl::inits()) before connecting
the redecl chain.  During those in-between imports structural eq fails
because the canonical decl is different.  This commit fixes this.
Synthesizing a test seemed extremely hard, however, Xerces analysis
reproduces the problem.

Reviewers: a_sidorin, a.sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits

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

llvm-svn: 347306

5 years ago[CMake] Streamline code signing for debugserver and pass entitlements to extended...
Stefan Granitz [Tue, 20 Nov 2018 14:10:33 +0000 (14:10 +0000)]
[CMake] Streamline code signing for debugserver and pass entitlements to extended llvm_codesign

Summary:
Use llvm_codesign to sign debugserver with entitlements.
Set global LLVM_CODESIGNING_IDENTITY from LLDB_CODESIGN_IDENTITY (if given).
Pass through ENTITLEMENTS from add_lldb_executable to add_llvm_executable.
Handle reconfigurations correctly.

We have a lot of cases, make them explicit:

(1) build and sign debugserver, if all conditions apply:
* LLDB_NO_DEBUGSERVER=OFF (default)
* On Darwin: LLDB_USE_SYSTEM_DEBUGSERVER=OFF (default)
* On Darwin: LLVM_CODESIGNING_IDENTITY == lldb_codesign

(2) use system debugserver, if on Darwin and any of:
* LLDB_USE_SYSTEM_DEBUGSERVER=ON and found on system (explicit case)
* LLVM_CODESIGNING_IDENTITY != lldb_codesign and found on system (fallback case)

(3) debugserver will not be available, in case of:
* LLDB_NO_DEBUGSERVER=ON
* On Darwin: LLVM_CODESIGNING_IDENTITY != lldb_codesign and not found on system

(4) error state, in case of:
* LLDB_USE_SYSTEM_DEBUGSERVER=ON and not found on system
* LLDB_USE_SYSTEM_DEBUGSERVER=ON and LLDB_NO_DEBUGSERVER=ON

Reviewers: xiaobai, beanz, vsk, JDevlieghere

Subscribers: mgorny, lldb-commits, llvm-commits

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

llvm-svn: 347305

5 years agoAllow force updating the NumCreatedFIDsForFileID.
Vassil Vassilev [Tue, 20 Nov 2018 13:53:20 +0000 (13:53 +0000)]
Allow force updating the NumCreatedFIDsForFileID.

Our internal clients implement parsing cache based on FileID. In order for the
Preprocessor to reenter the cached FileID it needs to reset its
NumCreatedFIDsForFileID.

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

llvm-svn: 347304

5 years ago[X86][SSE] Add computeKnownBits/ComputeNumSignBits support for PACKSS/PACKUS instruct...
Simon Pilgrim [Tue, 20 Nov 2018 13:23:37 +0000 (13:23 +0000)]
[X86][SSE] Add computeKnownBits/ComputeNumSignBits support for PACKSS/PACKUS instructions.

Pull out getPackDemandedElts demanded elts remapping helper from computeKnownBitsForTargetNode and use in computeKnownBits/ComputeNumSignBits.

llvm-svn: 347303

5 years ago[X86][SSE] XFormVExtractWithShuffleIntoLoad - getVectorShuffle won't accept SM_Sentin...
Simon Pilgrim [Tue, 20 Nov 2018 12:17:50 +0000 (12:17 +0000)]
[X86][SSE] XFormVExtractWithShuffleIntoLoad - getVectorShuffle won't accept SM_SentinelZero

Noticed while working on improving demanded elts target shuffle shuffle combining

llvm-svn: 347302

5 years ago[TargetLowering] Improve SimplifyDemandedVectorElts/SimplifyDemandedBits support
Simon Pilgrim [Tue, 20 Nov 2018 12:02:16 +0000 (12:02 +0000)]
[TargetLowering] Improve SimplifyDemandedVectorElts/SimplifyDemandedBits support

For bitcast nodes from larger element types, add the ability for SimplifyDemandedVectorElts to call SimplifyDemandedBits by merging the elts mask to a bits mask.

I've raised https://bugs.llvm.org/show_bug.cgi?id=39689 to deal with the few places where SimplifyDemandedBits's lack of vector handling is a problem.

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

llvm-svn: 347301

5 years ago[X86][SSE] Lower immediately to PACKUS instead of VECTOR_SHUFFLE.
Simon Pilgrim [Tue, 20 Nov 2018 11:46:37 +0000 (11:46 +0000)]
[X86][SSE] Lower immediately to PACKUS instead of VECTOR_SHUFFLE.

As discussed on rL347240, this avoids some regressions on D54679 and also helps some combines to kick in a bit earlier.

llvm-svn: 347300

5 years ago[X86][SSE] Add SimplifyDemandedVectorElts support for PACKSS/PACKUS instructions.
Simon Pilgrim [Tue, 20 Nov 2018 11:09:46 +0000 (11:09 +0000)]
[X86][SSE] Add SimplifyDemandedVectorElts support for PACKSS/PACKUS instructions.

As discussed on rL347240.

llvm-svn: 347299

5 years ago[clangd] Replay preamble #includes to clang-tidy checks.
Sam McCall [Tue, 20 Nov 2018 10:58:48 +0000 (10:58 +0000)]
[clangd] Replay preamble #includes to clang-tidy checks.

Summary:
This is needed to correctly handle checks that use IncludeInserter,
which is very common.

I couldn't find a totally safe example of a check to enable for testing,
I picked modernize-deprecated-headers which some will probably hate.
We should get configuration working...

This depends on D54691 which ensures our calls to getFile(open=false)
don't break subsequent accesses via the FileManager.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 347298

5 years ago[clangd] Allow observation of changes to global CDBs.
Sam McCall [Tue, 20 Nov 2018 10:56:03 +0000 (10:56 +0000)]
[clangd] Allow observation of changes to global CDBs.

Summary:
Currently, changes *within* CDBs are not tracked (CDB has no facility to do so).
However, discovery of new CDBs are tracked (all files are marked as modified).
Also, files whose compilation commands are explicitly set are marked modified.

The intent is to use this for auto-index. Newly discovered files will be indexed
with low priority.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 347297

5 years ago[X86] Preserve undef information when creating a punpckl/hbw from a v16i8 where all...
Craig Topper [Tue, 20 Nov 2018 09:04:01 +0000 (09:04 +0000)]
[X86] Preserve undef information when creating a punpckl/hbw from a v16i8 where all the even or odd elements are undef.

Previously if V2 was unused we ended up using V1 for both inputs as part of the code that follows the new code. By using lowerVectorShuffleWithUNPCK we keep the undef nature of V2 in the output.

As near as I can tell this makes v16i8 behavior consistent with every other VT now.

This does mean that we give the register allocator freedom to fill in random registers now and create false dependencies. But like I said we're already doing that for other types.

llvm-svn: 347296

5 years ago[X86] Add custom type legalization for v8i8->v8i32 sign extend pre-SSE4.1
Craig Topper [Tue, 20 Nov 2018 09:03:58 +0000 (09:03 +0000)]
[X86] Add custom type legalization for v8i8->v8i32 sign extend pre-SSE4.1

This helps with a future patch and makes us less reliant on DAG combine merging shuffles.

llvm-svn: 347295

5 years agoUse is.constant intrinsic for __builtin_constant_p
Bill Wendling [Tue, 20 Nov 2018 08:53:30 +0000 (08:53 +0000)]
Use is.constant intrinsic for __builtin_constant_p

Summary:
A __builtin_constant_p may end up with a constant after inlining. Use
the is.constant intrinsic if it's a variable that's in a context where
it may resolve to a constant, e.g., an argument to a function after
inlining.

Reviewers: rsmith, shafik

Subscribers: jfb, kristina, cfe-commits, nickdesaulniers, jyknight

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

llvm-svn: 347294

5 years ago[libclang] Unify getCursorDecl and getCursorParentDecl
Fangrui Song [Tue, 20 Nov 2018 08:00:00 +0000 (08:00 +0000)]
[libclang] Unify getCursorDecl and getCursorParentDecl

They do the same thing, thus the latter (which has only 2 call sites) can be deleted.

llvm-svn: 347293

5 years ago[X86] Replace more calls to getZeroVector with regular getConstant.
Craig Topper [Tue, 20 Nov 2018 06:54:01 +0000 (06:54 +0000)]
[X86] Replace more calls to getZeroVector with regular getConstant.

getZeroVector produces a specifically canonicalized zero vector, but we can just let DAG legalization take care of it.

The test changes are because MULH lowering happens later than it should and this change gave us the opportunity to constant fold away a multiply during a DAG combine before the build_vector got legalized with a bitcast.

llvm-svn: 347290

5 years agoRecommit "[LoopSimplifyCFG] Teach LoopSimplifyCFG to constant-fold branches and switches"
Max Kazantsev [Tue, 20 Nov 2018 05:43:32 +0000 (05:43 +0000)]
Recommit "[LoopSimplifyCFG] Teach LoopSimplifyCFG to constant-fold branches and switches"

The initial version of patch lacked Phi nodes updates in destinations of removed
edges. This version contains this update and tests on this situation.

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

llvm-svn: 347289

5 years ago[PowerPC] Don't combine to bswap store on 1-byte truncating store
Nemanja Ivanovic [Tue, 20 Nov 2018 04:42:31 +0000 (04:42 +0000)]
[PowerPC] Don't combine to bswap store on 1-byte truncating store

Turns out that there was no check for a store that truncates down
to a single byte when combining a (store (bswap...)) into a byte-swapping
store. This patch just adds that check.

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

llvm-svn: 347288

5 years ago[SelectionDAG] Compute known bits and num sign bits for live out vector registers...
Craig Topper [Tue, 20 Nov 2018 04:30:26 +0000 (04:30 +0000)]
[SelectionDAG] Compute known bits and num sign bits for live out vector registers. Use it to add AssertZExt/AssertSExt in the live in basic blocks

Summary:
We already support this for scalars, but it was explicitly disabled for vectors. In the updated test cases this allows us to see the upper bits are zero to use less multiply instructions to emulate a 64 bit multiply.

This should help with this ispc issue that a coworker pointed me to https://github.com/ispc/ispc/issues/1362

Reviewers: spatel, efriedma, RKSimon, arsenm

Reviewed By: spatel

Subscribers: wdng, llvm-commits

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

llvm-svn: 347287

5 years ago[XRay] Add a test for allocator exhaustion
Dean Michael Berris [Tue, 20 Nov 2018 03:56:04 +0000 (03:56 +0000)]
[XRay] Add a test for allocator exhaustion

Use a more representative test of allocating small chunks for
oddly-sized (small) objects from an allocator that has a page's worth of
memory.

llvm-svn: 347286

5 years agoEnsure FileManagerTest expects "\\" as path separator on Windows platforms
Matthew Voss [Tue, 20 Nov 2018 03:30:28 +0000 (03:30 +0000)]
Ensure FileManagerTest expects "\\" as path separator on Windows platforms

llvm-svn: 347284

5 years agoSkip TestTargetCreateDeps
Jonas Devlieghere [Tue, 20 Nov 2018 01:18:49 +0000 (01:18 +0000)]
Skip TestTargetCreateDeps

Skip this test because Windows deals differently with shared libraries.

llvm-svn: 347283

5 years agoDriver: SCS is compatible with every other sanitizer.
Peter Collingbourne [Tue, 20 Nov 2018 01:01:49 +0000 (01:01 +0000)]
Driver: SCS is compatible with every other sanitizer.

Because SCS relies on system-provided runtime support, we can use it
together with any other sanitizer simply by linking the runtime for
the other sanitizer.

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

llvm-svn: 347282

5 years ago[ExecutionEngine][Interpreter] Fix out-of-bounds array access.
Lang Hames [Tue, 20 Nov 2018 01:01:26 +0000 (01:01 +0000)]
[ExecutionEngine][Interpreter] Fix out-of-bounds array access.

If args is empty then accesing element 0 is illegal.

https://reviews.llvm.org/D53556

Patch by Eugene Sharygin. Thanks Eugene!

llvm-svn: 347281

5 years ago[XRay] Move buffer extents back to the heap
Dean Michael Berris [Tue, 20 Nov 2018 01:00:26 +0000 (01:00 +0000)]
[XRay] Move buffer extents back to the heap

Summary:
This change addresses an issue which shows up with the synchronised race
between threads writing into a buffer, and another thread reading the
buffer.

In a lot of cases, we cannot guarantee that threads will always see the
signal to finalise their buffers in time despite the grace periods and
state machine maintained through atomic variables. This change addresses
it by ensuring that the same instance being updated to indicate how much
of the buffer is "used" by the writing thread is the same instance being
read by the thread processing the buffer to be written out to disk or
handled through the iterators.

To do this, we ensure that all the "extents" instances live in their own
the backing store, in a different contiguous page from the
buffer-specific backing store. We also take precautions to ensure that
the atomic variables are cache-line-sized to prevent false-sharing from
unnecessarily causing cache contention on unrelated writes/reads.

It's feasible that we may in the future be able to move the storage of
the extents objects into the single backing store, slightly changing the
way to compute the size(s) of the buffers, but in the meantime we'll
settle for the isolation afforded by having a different backing store
for the extents instances.

Reviewers: mboerger

Subscribers: jfb, llvm-commits

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

llvm-svn: 347280

5 years ago[compiler-rt] Use zx_futex_wait_deprecated for Fuchsia sanitizer runtime
Petr Hosek [Tue, 20 Nov 2018 00:55:20 +0000 (00:55 +0000)]
[compiler-rt] Use zx_futex_wait_deprecated for Fuchsia sanitizer runtime

This change is part of the soft-transition to the new synchronization
primitives which implement priority inheritance.

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

llvm-svn: 347279

5 years ago[DAGCombiner] reduce code duplication in visitXOR; NFC
Sanjay Patel [Tue, 20 Nov 2018 00:51:45 +0000 (00:51 +0000)]
[DAGCombiner] reduce code duplication in visitXOR; NFC

llvm-svn: 347278

5 years ago[WebAssembly] Remove unused function return types (NFC)
Heejin Ahn [Tue, 20 Nov 2018 00:38:10 +0000 (00:38 +0000)]
[WebAssembly] Remove unused function return types (NFC)

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 347277

5 years ago[CodeView] Don't print PointerAttributes when dumping.
Zachary Turner [Tue, 20 Nov 2018 00:10:27 +0000 (00:10 +0000)]
[CodeView] Don't print PointerAttributes when dumping.

PointerAttributes is a bitwise-or of several other fields, each of
which is already printed on its own line with a better explanation.
So this doesn't really help much.

llvm-svn: 347275

5 years agoImplement computeKnownBits for scalar_to_vector
Stanislav Mekhanoshin [Mon, 19 Nov 2018 23:34:07 +0000 (23:34 +0000)]
Implement computeKnownBits for scalar_to_vector

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

llvm-svn: 347274

5 years ago[WebAssembly] Fix inaccurate comments / assertion messages
Heejin Ahn [Mon, 19 Nov 2018 23:31:28 +0000 (23:31 +0000)]
[WebAssembly] Fix inaccurate comments / assertion messages

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 347273

5 years ago[WebAssembly] Make starting indices calcaulation simpler (NFC)
Heejin Ahn [Mon, 19 Nov 2018 23:21:25 +0000 (23:21 +0000)]
[WebAssembly] Make starting indices calcaulation simpler (NFC)

Summary:
At the beginning of `assignIndexes() function, when `FunctionIndex` and
`GlobalIndex` variables are created, `InputFunctions` and `InputGlobals`
vectors are guaranteed to be empty, because those vectors are only
populated in `assignIndexes()` function. Current code looks like they
are nonempty, so this patch deletes them for better readability.

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 347272

5 years agoIt's its
Paul Robinson [Mon, 19 Nov 2018 22:53:42 +0000 (22:53 +0000)]
It's its

llvm-svn: 347271

5 years agoAdd interceptor for the setvbuf(3) from NetBSD
Kamil Rytarowski [Mon, 19 Nov 2018 22:44:26 +0000 (22:44 +0000)]
Add interceptor for the setvbuf(3) from NetBSD

Summary:
setvbuf(3) is a routine to setup stream buffering.

Enable the interceptor for NetBSD.

Add dedicated tests for setvbuf(3) and functions
on top of this interface: setbuf, setbuffer, setlinebuf.

Based on original work by Yang Zheng.

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: devnexen, tomsun.0.7, kubamracek, llvm-commits, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 347270

5 years ago[Transforms] Prefer static and avoid namespaces, NFC
Reid Kleckner [Mon, 19 Nov 2018 22:19:05 +0000 (22:19 +0000)]
[Transforms] Prefer static and avoid namespaces, NFC

Put 'static' on three functions in an anonymous namespace as per our
coding style.

Remove the 'namespace llvm {}' around the .cpp file and explicitly
declare the free function 'llvm::optimizeGlobalCtorsList' in 'llvm::'.
I prefer this style for free functions because the compiler will error
out if the .h and .cpp files don't agree on the function name or
prototype.

llvm-svn: 347269

5 years ago[X86] Rename combineVSZext->combineExtendVectorInreg. NFC
Craig Topper [Mon, 19 Nov 2018 22:18:47 +0000 (22:18 +0000)]
[X86] Rename combineVSZext->combineExtendVectorInreg. NFC

Now that we no longer have target specific vector extend nodes let's make the function name match the nodes we do use.

llvm-svn: 347268

5 years ago[NFC][libcxx] Fix incorrect comments
Louis Dionne [Mon, 19 Nov 2018 22:06:42 +0000 (22:06 +0000)]
[NFC][libcxx] Fix incorrect comments

llvm-svn: 347267

5 years ago[X86] Add test case to show missed opportunity to use a single pmuludq to implement...
Craig Topper [Mon, 19 Nov 2018 22:04:12 +0000 (22:04 +0000)]
[X86] Add test case to show missed opportunity to use a single pmuludq to implement a multiply when a zext lives in another basic block.

This can occur when one of the inputs to the multiply is loop invariant. Though my test cases just use two basic blocks with an unconditional jump which we won't merge until after isel in the codegen pipeline.

For scalars, I believe SelectionDAGBuilder can add an AssertZExt to pass knowledge across basic blocks but its explicitly disabled for vectors.

llvm-svn: 347266

5 years agoAMDGPU: Fix V_FMA_F16 selection on GFX9
Konstantin Zhuravlyov [Mon, 19 Nov 2018 21:10:16 +0000 (21:10 +0000)]
AMDGPU: Fix V_FMA_F16 selection on GFX9

GFX9 should select opsel version.

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

llvm-svn: 347265

5 years ago[libcxx] Fix XFAIL for GCC 4.9
Louis Dionne [Mon, 19 Nov 2018 20:53:38 +0000 (20:53 +0000)]
[libcxx] Fix XFAIL for GCC 4.9

The XFAIL started passing since we're only testing for trivial-copyability of
reference_wrapper in C++14 and above. This commit constrains the XFAIL to
gcc-4.9 with C++14 (it would also fail on C++17 and above, but those standards
are not available with GCC 4.9).

llvm-svn: 347264

5 years ago[libcxx] Update test of trivial copyability of reference_wrapper
Louis Dionne [Mon, 19 Nov 2018 20:21:45 +0000 (20:21 +0000)]
[libcxx] Update test of trivial copyability of reference_wrapper

N4151 is not an extension anymore, it was standardized in C++14.

llvm-svn: 347263

5 years ago[Coverage] Fix PR39258: support coverage regions that start deeper than they end
Vedant Kumar [Mon, 19 Nov 2018 20:10:22 +0000 (20:10 +0000)]
[Coverage] Fix PR39258: support coverage regions that start deeper than they end

popRegions used to assume that the start location of a region can't be
nested deeper than the end location, which is not always true.

Patch by Orivej Desh!

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

llvm-svn: 347262

5 years ago[Sema] Fix PR38987: keep end location of a direct initializer list
Vedant Kumar [Mon, 19 Nov 2018 20:10:21 +0000 (20:10 +0000)]
[Sema] Fix PR38987: keep end location of a direct initializer list

If PerformConstructorInitialization of a direct initializer list constructor is
called while instantiating a template, it has brace locations in its BraceLoc
arguments but not in the Kind argument.

This reverts the hunk https://reviews.llvm.org/D41921#inline-468844.

Patch by Orivej Desh!

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

llvm-svn: 347261

5 years agoRevert "[LoopSimplifyCFG] Teach LoopSimplifyCFG to constant-fold branches and switches"
Benjamin Kramer [Mon, 19 Nov 2018 20:01:20 +0000 (20:01 +0000)]
Revert "[LoopSimplifyCFG] Teach LoopSimplifyCFG to constant-fold branches and switches"

This reverts commits r347183 & r347184. Crashes while building libxml.

llvm-svn: 347260

5 years ago[AMDGPU] Restored selection of scalar_to_vector (v2x16)
Stanislav Mekhanoshin [Mon, 19 Nov 2018 19:58:13 +0000 (19:58 +0000)]
[AMDGPU] Restored selection of scalar_to_vector (v2x16)

This works if DAG combiner is enabled, but without combining
we cannot select scalar_to_vector of <2 x half> and <2 x i16>.

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

llvm-svn: 347259

5 years ago[clang][CodeGen] Implicit Conversion Sanitizer: discover the world of CompoundAssign...
Roman Lebedev [Mon, 19 Nov 2018 19:56:43 +0000 (19:56 +0000)]
[clang][CodeGen] Implicit Conversion Sanitizer: discover the world of CompoundAssign operators

Summary:
As reported by @regehr (thanks!) on twitter (https://twitter.com/johnregehr/status/1057681496255815686),
we (me) has completely forgot about the binary assignment operator.
In AST, it isn't represented as separate `ImplicitCastExpr`'s,
but as a single `CompoundAssignOperator`, that does all the casts internally.
Which means, out of these two, only the first one is diagnosed:
```
auto foo() {
    unsigned char c = 255;
    c = c + 1;
    return c;
}
auto bar() {
    unsigned char c = 255;
    c += 1;
    return c;
}
```
https://godbolt.org/z/JNyVc4

This patch does handle the `CompoundAssignOperator`:
```
int main() {
  unsigned char c = 255;
  c += 1;
  return c;
}
```
```
$ ./bin/clang -g -fsanitize=integer /tmp/test.c && ./a.out
/tmp/test.c:3:5: runtime error: implicit conversion from type 'int' of value 256 (32-bit, signed) to type 'unsigned char' changed the value to 0 (8-bit, unsigned)
    #0 0x2392b8 in main /tmp/test.c:3:5
    #1 0x7fec4a612b16 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x22b16)
    #2 0x214029 in _start (/build/llvm-build-GCC-release/a.out+0x214029)
```

However, the pre/post increment/decrement is still not handled.

Reviewers: rsmith, regehr, vsk, rjmccall, #sanitizers

Reviewed By: rjmccall

Subscribers: mclow.lists, cfe-commits, regehr

Tags: #clang, #sanitizers

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

llvm-svn: 347258

5 years ago[InstCombine] Set debug loc on `mergeStoreIntoSuccessor` phi
Vedant Kumar [Mon, 19 Nov 2018 19:55:02 +0000 (19:55 +0000)]
[InstCombine] Set debug loc on `mergeStoreIntoSuccessor` phi

Assigning a merged debug location to the `mergeStoreIntoSuccessor` phi
improves backtrace quality.

Fixes llvm.org/PR38083.

llvm-svn: 347257

5 years ago[IR] Add hasNPredecessors, hasNPredecessorsOrMore to BasicBlock
Vedant Kumar [Mon, 19 Nov 2018 19:54:27 +0000 (19:54 +0000)]
[IR] Add hasNPredecessors, hasNPredecessorsOrMore to BasicBlock

Add methods to BasicBlock which make it easier to efficiently check
whether a block has N (or more) predecessors.

This can be more efficient than using pred_size(), which is a linear
time operation.

We might consider adding similar methods for successors. I haven't done
so in this patch because succ_size() is already O(1).

With this patch applied, I measured a 0.065% compile-time reduction in
user time for running `opt -O3` on the sqlite3 amalgamation (30 trials).
The change in mergeStoreIntoSuccessor alone saves 45 million linked list
iterations in a stage2 Release build of llc.

See llvm.org/PR39702 for a harder but more general way of achieving
similar results.

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

llvm-svn: 347256

5 years ago[DAGCombine] SimplifyNodeWithTwoResults - ensure same legalization for LO/HI operands...
Simon Pilgrim [Mon, 19 Nov 2018 19:37:59 +0000 (19:37 +0000)]
[DAGCombine] SimplifyNodeWithTwoResults - ensure same legalization for LO/HI operands (PR21207)

Consistently use (!LegalOperations || isOperationLegalOrCustom) for all node pairs.

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

llvm-svn: 347255

5 years agoFix clang test suite on Windows by reverting part of r347216
Reid Kleckner [Mon, 19 Nov 2018 19:36:28 +0000 (19:36 +0000)]
Fix clang test suite on Windows by reverting part of r347216

Otherwise, the clang analyzer tests fail on Windows when attempting to
unpickle AnalyzerTest objects in the worker processes. The pattern of,
add to path, import, remove from path, serialize, deserialize, doesn't
work. Once something gets added to the path, if we want to move it
across the wire for multiprocessing, we need to keep the module on
sys.path.

llvm-svn: 347254

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Mon, 19 Nov 2018 19:18:33 +0000 (19:18 +0000)]
Fix Wdocumentation warning. NFCI.

llvm-svn: 347253

5 years agoFix unused function warning.
Simon Pilgrim [Mon, 19 Nov 2018 19:18:00 +0000 (19:18 +0000)]
Fix unused function warning.

llvm-svn: 347252

5 years ago[TargetLowering] expandFP_TO_UINT - improve fp16 support
Simon Pilgrim [Mon, 19 Nov 2018 19:16:13 +0000 (19:16 +0000)]
[TargetLowering] expandFP_TO_UINT - improve fp16 support

As discussed on D53794, for float types with ranges smaller than the destination integer type, then we should be able to just use a regular FP_TO_SINT opcode.

I thought we'd need to provide MSA test cases for very small integer types as well (fp16 -> i8 etc.), but it turns out that promotion will kick in so they're unnecessary.

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

llvm-svn: 347251

5 years ago[IR] DISubprogram::toSPFlags(): fix "enumeral and non-enumeral type in conditional...
Roman Lebedev [Mon, 19 Nov 2018 19:07:03 +0000 (19:07 +0000)]
[IR] DISubprogram::toSPFlags(): fix "enumeral and non-enumeral type in conditional expression"

/build/llvm/include/llvm/IR/DebugInfoMetadata.h: In static member function ‘static llvm::DISubprogram::DISPFlags llvm::DISubprogram::toSPFlags(bool, bool, bool, unsigned int)’:
/build/llvm/include/llvm/IR/DebugInfoMetadata.h:1636:50: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
                                   (IsLocalToUnit ? SPFlagLocalToUnit : 0) |
                                    ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/build/llvm/include/llvm/IR/DebugInfoMetadata.h:1637:49: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
                                   (IsDefinition ? SPFlagDefinition : 0) |
                                    ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/build/llvm/include/llvm/IR/DebugInfoMetadata.h:1638:48: warning: enumeral and non-enumeral type in conditional expression [-Wextra]
                                   (IsOptimized ? SPFlagOptimized : 0));
                                    ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

llvm-svn: 347250

5 years agoAdd missing stream operator for Polynomial class to fix debug builds.
Simon Pilgrim [Mon, 19 Nov 2018 18:57:49 +0000 (18:57 +0000)]
Add missing stream operator for Polynomial class to fix debug builds.

llvm-svn: 347249

5 years ago[X86][CostModel] Don't lookup intrinsic cost tables if the intrinsic isn't one we...
Craig Topper [Mon, 19 Nov 2018 18:57:31 +0000 (18:57 +0000)]
[X86][CostModel] Don't lookup intrinsic cost tables if the intrinsic isn't one we care about

We're seeing some issues internally where we sent some intrinsics into the cost model that the getTypeLegalizationCost call fails on, but X86 specific tables don't care about. Our base class implementation takes care of them. We'd just like X86 backend to ignore them.

This patch makes sure the switch returned something X86 cares about and skips the table lookups and type legalization call if not. Probably more efficient too since we don't go scanning the tables for every intrinsic we could possibly see.

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

llvm-svn: 347248

5 years agoAdd missing closing bracket.
Simon Pilgrim [Mon, 19 Nov 2018 18:54:34 +0000 (18:54 +0000)]
Add missing closing bracket.

llvm-svn: 347247

5 years agoFix build break from r347239
Paul Robinson [Mon, 19 Nov 2018 18:51:11 +0000 (18:51 +0000)]
Fix build break from r347239

llvm-svn: 347246

5 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Mon, 19 Nov 2018 18:46:40 +0000 (18:46 +0000)]
Fix Wdocumentation warning. NFCI.

llvm-svn: 347245

5 years agoAdd docker configurations used by the buildbots.
Eric Fiselier [Mon, 19 Nov 2018 18:43:31 +0000 (18:43 +0000)]
Add docker configurations used by the buildbots.

These are the scripts I use to create the docker images for
the build bots and run them.

llvm-svn: 347244

5 years ago[lldbsuite] Invoke sed on Windows to determine the cache dir for clang
Stella Stamenova [Mon, 19 Nov 2018 18:41:33 +0000 (18:41 +0000)]
[lldbsuite] Invoke sed on Windows to determine the cache dir for clang

Summary: In order to invoke sed on Windows, we need to quote the command correctly. Since we already have commands which do that, move the definitions at the beginning of the file and then re-use them for each command.

Reviewers: aprantl, zturner

Subscribers: teemperor, lldb-commits

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

llvm-svn: 347243

5 years ago[X86][SSE] Remove unnecessary bit-and in pshufb vector ctlz (PR39703)
Simon Pilgrim [Mon, 19 Nov 2018 18:40:59 +0000 (18:40 +0000)]
[X86][SSE] Remove unnecessary bit-and in pshufb vector ctlz (PR39703)

SSE PSHUFB vector ctlz lowering works at the i4 nibble level. As detailed in PR39703, we were masking the lower nibble off but we only actually use it in the case where the upper nibble is known to be zero, making it safe to remove the mask and save an instruction.

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

llvm-svn: 347242

5 years ago[InterleavedLoadCombine] Fix warnings
Martin Elshuber [Mon, 19 Nov 2018 18:35:31 +0000 (18:35 +0000)]
[InterleavedLoadCombine] Fix warnings

* remove unused function
* fix compare

llvm-svn: 347241

5 years ago[X86] Attempt to improve v32i8/v64i8 multiply lowering by applying the v16i8 non...
Craig Topper [Mon, 19 Nov 2018 18:32:53 +0000 (18:32 +0000)]
[X86] Attempt to improve v32i8/v64i8 multiply lowering by applying the v16i8 non-avx2 algorithm to each 128-bit lane.

Previously we split the vectors in half to allow the two halves to be any extended then concatenated the results back together.

This patch instead instead extends the v16i8 sse algorithm to extend half of each 128-bit lane using punpcklbw/punpckhbw. Multiplies all the low half lanes and high half lanes together in separate operations. Then merges the half lane results back together using packuswb.

Unfortunately, some of the cases in vector-reduce-mul.ll regress because we aren't narrowing the vector width of the multiplies as we reduce. The splitting was somewhat making up for that before by causing halves to be discarded after the split.

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

llvm-svn: 347240

5 years ago[DebugInfo] DISubprogram flags get their own flags word. NFC.
Paul Robinson [Mon, 19 Nov 2018 18:29:28 +0000 (18:29 +0000)]
[DebugInfo] DISubprogram flags get their own flags word. NFC.
This will hold flags specific to subprograms. In the future
we could potentially free up scarce bits in DIFlags by moving
subprogram-specific flags from there to the new flags word.

This patch does not change IR/bitcode formats, that will be
done in a follow-up.

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

llvm-svn: 347239

5 years ago[ARM] Attempt to fix arm selfhost bots after rL347191
Sam Parker [Mon, 19 Nov 2018 18:08:46 +0000 (18:08 +0000)]
[ARM] Attempt to fix arm selfhost bots after rL347191

llvm-svn: 347238

5 years agoAddress comments.
Kadir Cetinkaya [Mon, 19 Nov 2018 18:06:36 +0000 (18:06 +0000)]
Address comments.

llvm-svn: 347237

5 years agoUse digest size instead of hardcoding it.
Kadir Cetinkaya [Mon, 19 Nov 2018 18:06:33 +0000 (18:06 +0000)]
Use digest size instead of hardcoding it.

llvm-svn: 347236

5 years ago[clangd] Store source file hash in IndexFile{In,Out}
Kadir Cetinkaya [Mon, 19 Nov 2018 18:06:29 +0000 (18:06 +0000)]
[clangd] Store source file hash in IndexFile{In,Out}

Summary:
Puts the digest of the source file that generated the index into
serialized index and stores them back on load, if exists.

Reviewers: sammccall

Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 347235

5 years ago[AMDGPU] Fix -Wunused-variable
Fangrui Song [Mon, 19 Nov 2018 17:54:27 +0000 (17:54 +0000)]
[AMDGPU] Fix -Wunused-variable

llvm-svn: 347234

5 years ago[libcxx] Fix incorrect #include for std::hash
Louis Dionne [Mon, 19 Nov 2018 17:40:16 +0000 (17:40 +0000)]
[libcxx] Fix incorrect #include for std::hash

Reviewed as https://reviews.llvm.org/D54705.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 347233

5 years ago[libcxx] Add missing <cstddef> includes in tests
Louis Dionne [Mon, 19 Nov 2018 17:39:50 +0000 (17:39 +0000)]
[libcxx] Add missing <cstddef> includes in tests

Some tests use type std::max_align_t, but don't include <cstddef> header
directly. As a result, these tests won't compile against some conformant
libraries.

Reviewed as https://reviews.llvm.org/D54645.
Thanks to Andrey Maksimov for the patch.

llvm-svn: 347232

5 years ago[AMDGPU] Convert insert_vector_elt into set of selects
Stanislav Mekhanoshin [Mon, 19 Nov 2018 17:39:20 +0000 (17:39 +0000)]
[AMDGPU] Convert insert_vector_elt into set of selects

This allows to avoid scratch use or indirect VGPR addressing for
small vectors.

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

llvm-svn: 347231

5 years ago[llvm-nm] Fix use-after-free for MachOUniversalBinaries
Francis Visoiu Mistrih [Mon, 19 Nov 2018 17:19:50 +0000 (17:19 +0000)]
[llvm-nm] Fix use-after-free for MachOUniversalBinaries

MachOObjectFile::getHostArch() returns a temporary, and getArchName
returns a StringRef pointing to a temporary std::string.

No tests since it doesn't trigger any errors except with the sanitizers.

llvm-svn: 347230