platform/upstream/llvm.git
5 years agoFix builbots after r364427.
Greg Clayton [Wed, 26 Jun 2019 16:22:58 +0000 (16:22 +0000)]
Fix builbots after r364427.

I was using an iterator that was equal to the end of a collection.

llvm-svn: 364447

5 years ago[WebAssembly] Omit wrap on i64x2.{shl,shr*} ISel when possible
Thomas Lively [Wed, 26 Jun 2019 16:19:59 +0000 (16:19 +0000)]
[WebAssembly] Omit wrap on i64x2.{shl,shr*} ISel when possible

Summary:
Since the WebAssembly SIMD shift instructions take i32 operands, we
truncate the i64 operand to <2 x i64> shifts during ISel. When the i64
operand is sign extended from i32, this CL makes it so the sign
extension is dropped instead of a wrap instruction added.

Reviewers: dschuff, aheejin

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 364446

5 years ago[WebAssembly] Implement tail calls and unify tablegen call classes
Thomas Lively [Wed, 26 Jun 2019 16:17:15 +0000 (16:17 +0000)]
[WebAssembly] Implement tail calls and unify tablegen call classes

Summary:
Implements direct and indirect tail calls enabled by the 'tail-call'
feature in both DAG ISel and FastISel. Updates existing call tests and
adds new tests including a binary encoding test.

Reviewers: aheejin

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

Tags: #llvm

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

llvm-svn: 364445

5 years agoFix leaks in LLVMCreateDisasmCPUFeatures
Scott Linder [Wed, 26 Jun 2019 16:13:17 +0000 (16:13 +0000)]
Fix leaks in LLVMCreateDisasmCPUFeatures

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

llvm-svn: 364444

5 years ago[dotest] Add the ability to set environment variables for the inferior.
Jonas Devlieghere [Wed, 26 Jun 2019 16:12:08 +0000 (16:12 +0000)]
[dotest] Add the ability to set environment variables for the inferior.

This patch adds a dotest flag for setting environment variables for the
inferior. This is different from the current --env flag, which sets
variables in the debugger's environment. This allows us to set things
like LD_LIBRARY_PATH for testing.

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

llvm-svn: 364443

5 years ago[clang-tidy] Generalize TransformerClangTidyCheck to take a rule generator.
Yitzhak Mandelbaum [Wed, 26 Jun 2019 16:04:38 +0000 (16:04 +0000)]
[clang-tidy] Generalize TransformerClangTidyCheck to take a rule generator.

Summary: Tidy check behavior often depends on language and/or clang-tidy options. This revision allows a user of TranformerClangTidyCheck to pass rule _generator_ in place of a rule, where the generator takes both the language and clang-tidy options. Additionally, the generator returns an `Optional` to allow for the case where the check is deemed irrelevant/disable based on those options.

Reviewers: gribozavr

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 364442

5 years ago[InstCombine] simplify code for inserts -> splat; NFC
Sanjay Patel [Wed, 26 Jun 2019 15:52:59 +0000 (15:52 +0000)]
[InstCombine] simplify code for inserts -> splat; NFC

llvm-svn: 364441

5 years agoFix build in shared lib mode.
Michael Liao [Wed, 26 Jun 2019 15:46:48 +0000 (15:46 +0000)]
Fix build in shared lib mode.

- The newly added GSYM misses LLVMBuild.txt. Add a barely one to pass
  the build.

llvm-svn: 364440

5 years ago[xray] Remove usage of procid_t
Alexandre Ganea [Wed, 26 Jun 2019 15:42:42 +0000 (15:42 +0000)]
[xray] Remove usage of procid_t

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

llvm-svn: 364439

5 years ago[LLD][COFF] Case insensitive compares for /nodefaultlib
Alexandre Ganea [Wed, 26 Jun 2019 15:40:17 +0000 (15:40 +0000)]
[LLD][COFF] Case insensitive compares for /nodefaultlib

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

llvm-svn: 364438

5 years ago[InstCombine] regenerate test checks; NFC
Sanjay Patel [Wed, 26 Jun 2019 15:24:08 +0000 (15:24 +0000)]
[InstCombine] regenerate test checks; NFC

llvm-svn: 364437

5 years ago[CodeGen] Improve formatting of jump tables (NFC)
Evandro Menezes [Wed, 26 Jun 2019 15:11:31 +0000 (15:11 +0000)]
[CodeGen] Improve formatting of jump tables (NFC)

Split jump tables into individual lines and fix spacing.

llvm-svn: 364436

5 years ago[clang-tidy] Fix ClangTidyTest to initialize context before checks.
Yitzhak Mandelbaum [Wed, 26 Jun 2019 15:04:33 +0000 (15:04 +0000)]
[clang-tidy] Fix ClangTidyTest to initialize context before checks.

Summary:
Currently, `clang::tidy::test::runCheckOnCode()` constructs the check
instances *before* initializing the ClangTidyContext. This ordering causes
problems when the check's constructor accesses the context, for example, through
`getLangOpts()`.

This revision moves the construction to after the context initialization, which
follows the pattern used in the clang tidy tool itself.

Reviewers: gribozavr

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

llvm-svn: 364435

5 years ago[X86][SSE] X86TargetLowering::isCommutativeBinOp - add PMULDQ
Simon Pilgrim [Wed, 26 Jun 2019 14:58:11 +0000 (14:58 +0000)]
[X86][SSE] X86TargetLowering::isCommutativeBinOp - add PMULDQ

Allows narrowInsertExtractVectorBinOp to reduce vector size instead of the more restricted SimplifyDemandedVectorEltsForTargetNode

llvm-svn: 364434

5 years ago[NFC][InstCombine] Revisit one-use tests in shift-amount-reassociation-in-bittest.ll
Roman Lebedev [Wed, 26 Jun 2019 14:42:39 +0000 (14:42 +0000)]
[NFC][InstCombine] Revisit one-use tests in shift-amount-reassociation-in-bittest.ll

llvm-svn: 364433

5 years ago[X86][SSE] X86TargetLowering::isCommutativeBinOp - add PCMPEQ
Simon Pilgrim [Wed, 26 Jun 2019 14:40:49 +0000 (14:40 +0000)]
[X86][SSE] X86TargetLowering::isCommutativeBinOp - add PCMPEQ

Allows narrowInsertExtractVectorBinOp to reduce vector size

llvm-svn: 364432

5 years ago[X86][SSE] X86TargetLowering::isBinOp - add PCMPGT
Simon Pilgrim [Wed, 26 Jun 2019 14:34:41 +0000 (14:34 +0000)]
[X86][SSE] X86TargetLowering::isBinOp - add PCMPGT

Allows narrowInsertExtractVectorBinOp to reduce vector size

llvm-svn: 364431

5 years ago[NFC][InstCombine] Add shift amount reassociation in bittest tests (PR42399)
Roman Lebedev [Wed, 26 Jun 2019 14:24:41 +0000 (14:24 +0000)]
[NFC][InstCombine] Add shift amount reassociation in bittest tests (PR42399)

https://bugs.llvm.org/show_bug.cgi?id=42399
https://rise4fun.com/Alive/kBb
https://rise4fun.com/Alive/1SB

llvm-svn: 364430

5 years ago[X86] shouldScalarizeBinop - never scalarize target opcodes.
Simon Pilgrim [Wed, 26 Jun 2019 14:21:29 +0000 (14:21 +0000)]
[X86] shouldScalarizeBinop - never scalarize target opcodes.

We have (almost) no target opcodes that have scalar/vector equivalents - for now assume we can't scalarize them (we can add exceptions if we need to).

llvm-svn: 364429

5 years agoMake CodeGen depend on ASTMatchers
Michael Liao [Wed, 26 Jun 2019 14:13:43 +0000 (14:13 +0000)]
Make CodeGen depend on ASTMatchers

- Shared library builds are broken due to the missing dependency.

llvm-svn: 364428

5 years agoAdd GSYM utility files along with unit tests.
Greg Clayton [Wed, 26 Jun 2019 14:09:09 +0000 (14:09 +0000)]
Add GSYM utility files along with unit tests.

The full GSYM patch started with: https://reviews.llvm.org/D53379

In that patch we wanted to split up getting GSYM into the LLVM code base so we are not committing too much code at once.

This is a first in a series of patches where I only add the foundation classes along with complete unit tests. They provide the foundation for encoding and decoding a GSYM file.

File entries are defined in llvm::gsym::FileEntry. This class splits the file up into a directory and filename represented by uniqued string table offsets. This allows all files that are referred to in a GSYM file to be encoded as 1 based indexes into a global file table in the GSYM file.

Function information in stored in llvm::gsym::FunctionInfo. This object represents a contiguous address range that has a name and range with an optional line table and inline call stack information.

Line table entries are defined in llvm::gsym::LineEntry. They store only address, file and line information to keep the line tables simple and allows the information to be efficiently encoded in a subsequent patch.

Inline information is defined in llvm::gsym::InlineInfo. These structs store the name of the inline function, along with one or more address ranges, and the file and line that called this function. They also contain any child inline information.

There are also utility classes for address ranges in llvm::gsym::AddressRange, and string table support in llvm::gsym::StringTable which are simple classes.

The unit tests test all the APIs on these simple classes so they will be ready for the next patches where we will create GSYM files and parse GSYM files.

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

llvm-svn: 364427

5 years agoAMDGPU: Fix unused variable
Matt Arsenault [Wed, 26 Jun 2019 13:48:04 +0000 (13:48 +0000)]
AMDGPU: Fix unused variable

llvm-svn: 364426

5 years agoAMDGPU: Check MRI for callee saved regs instead of TRI
Matt Arsenault [Wed, 26 Jun 2019 13:39:29 +0000 (13:39 +0000)]
AMDGPU: Check MRI for callee saved regs instead of TRI

This should the same, but MRI does allow dynamically changing the CSR
set, although currently not used.

llvm-svn: 364425

5 years ago[clang/DIVar] Emit the flag for params that have unmodified value
Djordje Todorovic [Wed, 26 Jun 2019 13:32:02 +0000 (13:32 +0000)]
[clang/DIVar] Emit the flag for params that have unmodified value

Emit the debug info flag that indicates that a parameter has unchanged
value throughout a function.

([5/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>
Differential Revision: https://reviews.llvm.org/D58035

llvm-svn: 364424

5 years ago[OpenCL] Improve diagnostic for placement new
Sven van Haastregt [Wed, 26 Jun 2019 13:31:24 +0000 (13:31 +0000)]
[OpenCL] Improve diagnostic for placement new

Without an explicit declaration for placement new, clang would reject
uses of placement new with "'default new' is not supported in OpenCL
C++".  This may mislead users into thinking that placement new is not
supported, see e.g. PR42060.

Clarify that placement new requires an explicit declaration.

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

llvm-svn: 364423

5 years ago[InlineCost] cleanup calculations of Cost and Threshold
Fedor Sergeev [Wed, 26 Jun 2019 13:24:24 +0000 (13:24 +0000)]
[InlineCost] cleanup calculations of Cost and Threshold

Summary:
Doing better separation of Cost and Threshold.
Cost counts the abstract complexity of live instructions, while Threshold is an upper bound of complexity that inlining is comfortable to pay.
There are two parts:
     - huge 15K last-call-to-static bonus is no longer subtracted from Cost
       but rather is now added to Threshold.

       That makes much more sense, as the cost of inlining (Cost) is not changed by the fact
       that internal function is called once. It only changes the likelyhood of this inlining
       being profitable (Threshold).

     - bonus for calls proved-to-be-inlinable into callee is no longer subtracted from Cost
       but added to Threshold instead.

While calculations are somewhat different,  overall InlineResult should stay the same since Cost >= Threshold compares the same.

Reviewers: eraman, greened, chandlerc, yrouban, apilipenko
Reviewed By: apilipenko
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60740

llvm-svn: 364422

5 years ago[clangd] Added functionality for getting semantic highlights for variable and functio...
Johan Vikstrom [Wed, 26 Jun 2019 13:08:36 +0000 (13:08 +0000)]
[clangd] Added functionality for getting semantic highlights for variable and function declarations

llvm-svn: 364421

5 years ago[X86][Codegen] X86DAGToDAGISel::matchBitExtract(): consistently capture lambdas by...
Roman Lebedev [Wed, 26 Jun 2019 12:19:52 +0000 (12:19 +0000)]
[X86][Codegen] X86DAGToDAGISel::matchBitExtract(): consistently capture lambdas by value

llvm-svn: 364420

5 years ago[X86] X86DAGToDAGISel::matchBitExtract(): pattern c: truncation awareness
Roman Lebedev [Wed, 26 Jun 2019 12:19:47 +0000 (12:19 +0000)]
[X86] X86DAGToDAGISel::matchBitExtract(): pattern c: truncation awareness

Summary:
The one thing of note here is that the 'bitwidth' constant (32/64) was previously pessimistic.
Given `x & (-1 >> (C - z))`, we were taking `C` to be `bitwidth(x)`, but in reality
we want `(-1 >> (C - z))` pattern to mean "low z bits must be all-ones".
And for that, `C` should be `bitwidth(-1 >> (C - z))`, i.e. of the shift operation itself.

Last pattern D does not seem to exhibit any of these truncation issues.
Although it has the opposite problem - if we extract low bits (no shift) from i64,
and then truncate to i32, then we fail to shrink this 64-bit extraction into 32-bit extraction.

Reviewers: RKSimon, craig.topper, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 364419

5 years ago[X86] X86DAGToDAGISel::matchBitExtract(): pattern b: truncation awareness
Roman Lebedev [Wed, 26 Jun 2019 12:19:39 +0000 (12:19 +0000)]
[X86] X86DAGToDAGISel::matchBitExtract(): pattern b: truncation awareness

Summary:
(Not so) boringly identical to pattern a (D62786)
Not yet sure how do deal with the last pattern c.

Reviewers: RKSimon, craig.topper, spatel

Reviewed By: RKSimon

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 364418

5 years ago[X86] X86DAGToDAGISel::matchBitExtract(): pattern a: truncation awareness
Roman Lebedev [Wed, 26 Jun 2019 12:19:11 +0000 (12:19 +0000)]
[X86] X86DAGToDAGISel::matchBitExtract(): pattern a: truncation awareness

Summary:
Finally tying up loose ends here.

The problem is quite simple:
If we have pattern `(x >> start) &  (1 << nbits) - 1`,
and then truncate the result, that truncation will be propagated upwards,
into the `and`. And that isn't currently handled.

I'm only fixing pattern `a` here,
the same fix will be needed for patterns `b`/`c` too.

I *think* this isn't missing any extra legality checks,
since we only look past truncations. Similary, i don't think
we can get any other truncation there other than i64->i32.

Reviewers: craig.topper, RKSimon, spatel

Reviewed By: craig.topper

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 364417

5 years agoRevert "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline."
Clement Courbet [Wed, 26 Jun 2019 12:13:13 +0000 (12:13 +0000)]
Revert "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline."

Breaks sanitizers:
    libFuzzer :: cxxstring.test
    libFuzzer :: memcmp.test
    libFuzzer :: recommended-dictionary.test
    libFuzzer :: strcmp.test
    libFuzzer :: value-profile-mem.test
    libFuzzer :: value-profile-strcmp.test

llvm-svn: 364416

5 years ago[HardwareLoops] NFC - move loop with irreducible control flow checking logic to Harew...
Chen Zheng [Wed, 26 Jun 2019 12:02:43 +0000 (12:02 +0000)]
[HardwareLoops] NFC - move loop with irreducible control flow checking logic to HarewareLoopInfo.

llvm-svn: 364415

5 years agoFix the build after r364401
Hans Wennborg [Wed, 26 Jun 2019 11:56:38 +0000 (11:56 +0000)]
Fix the build after r364401

It was failing with:

/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/lib/Target/X86/X86ISelLowering.cpp:18772:66:
error: call of overloaded 'makeArrayRef(<brace-enclosed initializer list>)' is ambiguous
     scaleShuffleMask<int>(Scale, makeArrayRef<int>({ 0, 2, 1, 3 }), Mask);
                                                                  ^
/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/lib/Target/X86/X86ISelLowering.cpp:18772:66: note: candidates are:
In file included from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/CodeGen/MachineFunction.h:20:0,
                 from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/CodeGen/CallingConvLower.h:19,
                 from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/lib/Target/X86/X86ISelLowering.h:17,
                 from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/lib/Target/X86/X86ISelLowering.cpp:14:
/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/ADT/ArrayRef.h:480:15:
note: llvm::ArrayRef<T> llvm::makeArrayRef(const std::vector<_RealType>&) [with T = int]
   ArrayRef<T> makeArrayRef(const std::vector<T> &Vec) {
               ^
/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/ADT/ArrayRef.h:485:37:
note: llvm::ArrayRef<T> llvm::makeArrayRef(const llvm::ArrayRef<T>&) [with T = int]
   template <typename T> ArrayRef<T> makeArrayRef(const ArrayRef<T> &Vec) {
                                     ^

llvm-svn: 364414

5 years ago[clangd] Disable failing unittest on non-x86 platforms
Kadir Cetinkaya [Wed, 26 Jun 2019 11:52:20 +0000 (11:52 +0000)]
[clangd] Disable failing unittest on non-x86 platforms

llvm-svn: 364413

5 years ago[ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline.
Clement Courbet [Wed, 26 Jun 2019 11:50:18 +0000 (11:50 +0000)]
[ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline.

This allows later passes (in particular InstCombine) to optimize more
cases.

One that's important to us is `memcmp(p, q, constant) < 0` and memcmp(p, q, constant) > 0.

llvm-svn: 364412

5 years agogn build: Merge r364387
Nico Weber [Wed, 26 Jun 2019 11:44:54 +0000 (11:44 +0000)]
gn build: Merge r364387

llvm-svn: 364411

5 years ago[docs][llvm-symbolizer] Improve llvm-symbolizer documentation
James Henderson [Wed, 26 Jun 2019 11:42:03 +0000 (11:42 +0000)]
[docs][llvm-symbolizer] Improve llvm-symbolizer documentation

As detailed in https://bugs.llvm.org/show_bug.cgi?id=42253, there were a
number of issues in the llvm-symbolizer documentation. This patch fixes
them by:

 1. Adding [addresses...] to the synopsis, and matching the formatting
    of other tools.
 2. Rewriting the description to fix grammar issues and mention other
    usage options.
 3. Rewriting the examples to be easier to read.
 4. Re-ordering the options into alphabetical order.
 5. Improving the text of some of the option descriptions, and adding
    some examples to individual options.
 6. Splitting the Mach-O options into a separate section of the
    document.
 7. Standardizing on double dashes for long options throughout the file.
 8. Adding a reference to the llvm-addr2line document.

Reviewed by: mtrent, ikudrin

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

llvm-svn: 364410

5 years agogn build: Merge r364386
Nico Weber [Wed, 26 Jun 2019 11:35:28 +0000 (11:35 +0000)]
gn build: Merge r364386

llvm-svn: 364409

5 years agogn build: Merge r364389
Nico Weber [Wed, 26 Jun 2019 11:33:56 +0000 (11:33 +0000)]
gn build: Merge r364389

llvm-svn: 364408

5 years ago[X86][AVX] combineExtractSubvector - 'little to big' extract_subvector(bitcast()...
Simon Pilgrim [Wed, 26 Jun 2019 11:21:09 +0000 (11:21 +0000)]
[X86][AVX] combineExtractSubvector - 'little to big' extract_subvector(bitcast()) support

Ideally this needs to be a generic combine in DAGCombiner::visitEXTRACT_SUBVECTOR but there's some nasty regressions in aarch64 due to neon shuffles not handling bitcasts at all.....

llvm-svn: 364407

5 years ago[IR/DIVar] Add the flag for params that have unmodified value
Djordje Todorovic [Wed, 26 Jun 2019 11:19:26 +0000 (11:19 +0000)]
[IR/DIVar] Add the flag for params that have unmodified value

Introduce the debug info flag that indicates that a parameter has unchanged
value throughout a function. This info will be used to emit the expressions
with DW_OP_entry_value.

([4/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>
Differential Revision: https://reviews.llvm.org/D58034

llvm-svn: 364406

5 years ago[DAGCombine] visitEXTRACT_SUBVECTOR - add TODO for extract_subvector(bitcast()) support
Simon Pilgrim [Wed, 26 Jun 2019 11:17:38 +0000 (11:17 +0000)]
[DAGCombine] visitEXTRACT_SUBVECTOR - add TODO for extract_subvector(bitcast()) support

We support 'big to little' (e.g. extract_subvector(v16i8 bitcast(v2i64))) but not 'little to big' cases  (e.g. extract_subvector(v2i64 bitcast(v16i8)))

llvm-svn: 364405

5 years ago[ARM] Handle fixup_arm_pcrel_9 correctly on big-endian targets
Mikhail Maltsev [Wed, 26 Jun 2019 10:48:40 +0000 (10:48 +0000)]
[ARM] Handle fixup_arm_pcrel_9 correctly on big-endian targets

Summary:
The getFixupKindContainerSizeBytes function returns the size of the
instruction containing a given fixup. Currently fixup_arm_pcrel_9 is
not handled in this function, this causes an assertion failure in
the debug build and incorrect codegen in the release build.

This patch fixes the problem.

Reviewers: ostannard, simon_tatham

Reviewed By: ostannard

Subscribers: javed.absar, kristof.beyls, hiraditya, pbarrio, llvm-commits

Tags: #llvm

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

llvm-svn: 364404

5 years ago[RISCV] Add pseudo instruction for calls with explicit register
Lewis Revill [Wed, 26 Jun 2019 10:35:58 +0000 (10:35 +0000)]
[RISCV] Add pseudo instruction for calls with explicit register

This patch adds the PseudoCALLReg instruction which allows using an
explicit register operand as the destination for the return address.

GCC can successfully parse this form of the call instruction, which
would be used for calls to functions which do not use ra as the return
address register, such as the __riscv_save libcalls. This patch forms
the first part of an implementation of -msave-restore for RISC-V.

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

llvm-svn: 364403

5 years ago[clang] Fix test failures after the rL364399
Djordje Todorovic [Wed, 26 Jun 2019 10:23:25 +0000 (10:23 +0000)]
[clang] Fix test failures after the rL364399

llvm-svn: 364402

5 years ago[X86][AVX] truncateVectorWithPACK - avoid bitcasted shuffles
Simon Pilgrim [Wed, 26 Jun 2019 09:50:11 +0000 (09:50 +0000)]
[X86][AVX] truncateVectorWithPACK - avoid bitcasted shuffles

truncateVectorWithPACK is often used in conjunction with ComputeNumSignBits which struggles when peeking through bitcasts.

This fix tries to avoid bitcast(shuffle(bitcast())) patterns in the 256-bit 64-bit sublane shuffles so we can still see through at least until lowering when the shuffles will need to be bitcasted to widen the shuffle type.

llvm-svn: 364401

5 years agoRevert r364332 "[scudo][standalone] Introduce the C & C++ wrappers"
Hans Wennborg [Wed, 26 Jun 2019 09:46:26 +0000 (09:46 +0000)]
Revert r364332 "[scudo][standalone] Introduce the C & C++ wrappers"

Makes the build fail with e.g.

  llvm/projects/compiler-rt/lib/scudo/standalone/wrappers_c.inc:20:68: error:
  declaration of 'void* calloc(size_t, size_t)' has a different exception
  specifier
   INTERFACE WEAK void *SCUDO_PREFIX(calloc)(size_t nmemb, size_t size) {
                                                                      ^

See llvm-commits thread.

> Summary:
> This CL adds C & C++ wrappers and associated tests. Those use default
> configurations for a Scudo combined allocator that will likely be
> tweaked in the future.
>
> This is the final CL required to have a functional C & C++ allocator
> based on Scudo.
>
> The structure I have chosen is to define the core C allocation
> primitives in an `.inc` file that can be customized through defines.
> This allows to easily have 2 (or more) sets of wrappers backed by
> different combined allocators, as demonstrated by the `Bionic`
> wrappers: one set for the "default" allocator, one set for the "svelte"
> allocator.
>
> Currently all the tests added have been gtests, but I am planning to
> add some more lit tests as well.
>
> Reviewers: morehouse, eugenis, vitalybuka, hctim, rengolin
>
> Reviewed By: morehouse
>
> Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits
>
> Tags: #llvm, #sanitizers
>
> Differential Revision: https://reviews.llvm.org/D63612

llvm-svn: 364400

5 years ago[CC1Option] Add the option to enable the debug entry values
Djordje Todorovic [Wed, 26 Jun 2019 09:38:09 +0000 (09:38 +0000)]
[CC1Option] Add the option to enable the debug entry values

The option enables debug info about parameter's entry values.

The example of using the option:

clang -g -O2 -Xclang -femit-debug-entry-values test.c

In addition, when the option is set add the flag all_call_sites
in a subprogram in order to support GNU extension as well.

([3/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>
Differential Revision: https://reviews.llvm.org/D58033

llvm-svn: 364399

5 years ago[LoopUnroll] Add support for loops with exiting headers and uncond latches.
Florian Hahn [Wed, 26 Jun 2019 09:16:57 +0000 (09:16 +0000)]
[LoopUnroll] Add support for loops with exiting headers and uncond latches.

This patch generalizes the UnrollLoop utility to support loops that exit
from the header instead of the latch. Usually, LoopRotate would take care
of must of those cases, but in some cases (e.g. -Oz), LoopRotate does
not kick in.

Codesize impact looks relatively neutral on ARM64 with -Oz + LTO.

Program                                         master     patch     diff
 External/S.../CFP2006/447.dealII/447.dealII   629060.00  627676.00  -0.2%
 External/SPEC/CINT2000/176.gcc/176.gcc        1245916.00 1244932.00 -0.1%
 MultiSourc...Prolangs-C/simulator/simulator   86100.00   86156.00    0.1%
 MultiSourc...arks/Rodinia/backprop/backprop   66212.00   66252.00    0.1%
 MultiSourc...chmarks/Prolangs-C++/life/life   67276.00   67312.00    0.1%
 MultiSourc...s/Prolangs-C/compiler/compiler   69824.00   69788.00   -0.1%
 MultiSourc...Prolangs-C/assembler/assembler   86672.00   86696.00    0.0%

Reviewers: efriedma, vsk, paquette

Reviewed By: paquette

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

llvm-svn: 364398

5 years ago[HardwareLoops] NFC - move loop with irreducible control flow checking logic to isHar...
Chen Zheng [Wed, 26 Jun 2019 09:12:52 +0000 (09:12 +0000)]
[HardwareLoops] NFC - move loop with irreducible control flow checking logic to isHardwareLoopProfitable()

llvm-svn: 364397

5 years ago[clang][Tooling] Fix windows build-bots after rL364386
Kadir Cetinkaya [Wed, 26 Jun 2019 08:39:42 +0000 (08:39 +0000)]
[clang][Tooling] Fix windows build-bots after rL364386

llvm-svn: 364396

5 years ago[TargetOption] Add option to ebanble the debug entry values
Djordje Todorovic [Wed, 26 Jun 2019 08:35:43 +0000 (08:35 +0000)]
[TargetOption] Add option to ebanble the debug entry values

The option enables debug info about parameter's entry values.

([2/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>
Differential Revision: https://reviews.llvm.org/D60961

llvm-svn: 364395

5 years ago[compiler-rt][test] Set shared_libasan_path in test/asan/lit.cfg on Solaris
Rainer Orth [Wed, 26 Jun 2019 08:19:57 +0000 (08:19 +0000)]
[compiler-rt][test] Set shared_libasan_path in test/asan/lit.cfg on Solaris

While checking warnings from the Solaris buildbots, I noticed

  llvm-lit: /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/llvm/projects/compiler-rt/test/asan/lit.cfg:119: warning: %shared_libasan substitution not set but dynamic ASan is available.

Fixed as follows.  Tested on x86_64-pc-solaris2.11.

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

llvm-svn: 364394

5 years ago[NFC][InstCombine] Add shift amount reassociation tests (PR42391)
Roman Lebedev [Wed, 26 Jun 2019 08:17:05 +0000 (08:17 +0000)]
[NFC][InstCombine] Add shift amount reassociation tests (PR42391)

https://bugs.llvm.org/show_bug.cgi?id=42391
https://rise4fun.com/Alive/9E2

llvm-svn: 364393

5 years ago[clangd] Don't rename the namespace.
Haojian Wu [Wed, 26 Jun 2019 08:10:26 +0000 (08:10 +0000)]
[clangd] Don't rename the namespace.

Summary:
Also fix a small bug -- the extra argument "-xc++" doesn't overwrite the
language if the argument is present after the file name in the compiler
command.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 364392

5 years agoReland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were...
Fangrui Song [Wed, 26 Jun 2019 08:09:08 +0000 (08:09 +0000)]
Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded

This restores r361830 "[ELF] Error on relocations to STT_SECTION symbols if the sections were discarded"
and dependent commits (r362218, r362497) which were reverted by r364321, with a fix of a --gdb-index issue.

.rela.debug_ranges contains relocations of range list entries:

    // start address of a range list entry
    // old: 0; after r361830: 0
    00000000000033a0 R_X86_64_64 .text._ZN2v88internal7Isolate7factoryEv + 0
    // end address of a range list entry
    // old: 0xe; after r361830: 0
    00000000000033a8 R_X86_64_64 .text._ZN2v88internal7Isolate7factoryEv + e

If both start and end addresses of a range list entry resolve to 0,
DWARFDebugRangeList::isEndOfListEntry() will return true, then the
.debug_range decoding loop will terminate prematurely:

    while (true) {
      decode StartAddress
      decode EndAddress
      if (Entry.isEndOfListEntry()) // prematurely
        break;
      Entries.push_back(Entry);
    }

In lld/ELF/SyntheticSections.cpp, readAddressAreas() will read
incomplete address ranges and the resulting .gdb_index will be
incomplete. For files that gdb hasn't loaded their debug info, gdb uses
.gdb_index to map addresses to CUs. The absent entries make gdb fail to
symbolize some addresses.

To address this issue, we simply allow relocations to undefined symbols
in DWARF.cpp:findAux() and let RelocationResolver resolve them.

This patch should fix:

[1] http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190603/659848.html
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=978067

llvm-svn: 364391

5 years ago[clangd] Add Value field to HoverInfo
Kadir Cetinkaya [Wed, 26 Jun 2019 08:00:24 +0000 (08:00 +0000)]
[clangd] Add Value field to HoverInfo

Summary:
Put a symbols value information which is deduced from initializer
expression into HoverInfo struct.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 364390

5 years ago[clangd] Enable extraction of system includes from custom toolchains
Kadir Cetinkaya [Wed, 26 Jun 2019 07:45:27 +0000 (07:45 +0000)]
[clangd] Enable extraction of system includes from custom toolchains

Summary:
Some custom toolchains come with their own header files and compiler
drivers. Those compiler drivers implicitly know about include search path for
those headers. This patch aims to extract that information from drivers and add
it to the command line when invoking clang frontend.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 364389

5 years ago[clangd] Link and initialize target infos
Kadir Cetinkaya [Wed, 26 Jun 2019 07:39:14 +0000 (07:39 +0000)]
[clangd] Link and initialize target infos

llvm-svn: 364387

5 years ago[clang][Tooling] Infer target and mode from argv[0] when using JSONCompilationDatabase
Kadir Cetinkaya [Wed, 26 Jun 2019 07:39:03 +0000 (07:39 +0000)]
[clang][Tooling] Infer target and mode from argv[0] when using JSONCompilationDatabase

Summary:
Wraps JSON compilation database with a target and mode adding database
wrapper. So that driver can correctly figure out which toolchain to use.

Note that clients that wants to make use of this target discovery mechanism
needs to link in TargetsInfos and initialize them at startup.

Reviewers: ilya-biryukov

Subscribers: mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 364386

5 years ago[Metadata] Add GNU extensions for call site DWARF symbols
Djordje Todorovic [Wed, 26 Jun 2019 07:31:09 +0000 (07:31 +0000)]
[Metadata] Add GNU extensions for call site DWARF symbols

As discussed on RFC
(http://lists.llvm.org/pipermail/llvm-dev/2019-February/130094.html), this
is set of patches that introduces debug information about call site and
call site parameters. Since the LLVM has portion of this support (dumping
DWARF 5 symbols for calls), we generate GNU extensions as well. All of that
will be restricted under an option.

([1/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>
Differential Revision: https://reviews.llvm.org/D60712

llvm-svn: 364385

5 years ago[ExpandMemCmp] Honor prefer-vector-width.
Clement Courbet [Wed, 26 Jun 2019 07:06:49 +0000 (07:06 +0000)]
[ExpandMemCmp] Honor prefer-vector-width.

Reviewers: gchatelet, echristo, spatel, atdt

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 364384

5 years ago[PowerPC] Fixed missing change flag of emitRLDICWhenLoweringJumpTables
Kai Luo [Wed, 26 Jun 2019 05:25:16 +0000 (05:25 +0000)]
[PowerPC] Fixed missing change flag of emitRLDICWhenLoweringJumpTables

PPCMIPeephole::emitRLDICWhenLoweringJumpTables should return a bool
value to indicate optimization is conducted or not.

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

llvm-svn: 364383

5 years agoTeach the DAGCombine to fold this pattern(c1 and c2 is constant).
QingShan Zhang [Wed, 26 Jun 2019 05:12:53 +0000 (05:12 +0000)]
Teach the DAGCombine to fold this pattern(c1 and c2 is constant).

// fold (sext (select cond, c1, c2)) -> (select cond, sext c1, sext c2)
// fold (zext (select cond, c1, c2)) -> (select cond, zext c1, zext c2)
// fold (aext (select cond, c1, c2)) -> (select cond, sext c1, sext c2)
Sign extend the operands if it is any_extend, to keep the signess of the operands that, the other combine rule would apply. The any_extend is handled as zero extend for constants. i.e.

t1: i8 = select t0, Constant:i8<-1>, Constant:i8<0>
t2: i64 = any_extend t1
 -->
t3: i64 = select t0, Constant:i64<-1>, Constant:i64<0>
 -->
t4: i64 = sign_extend_inreg t3

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

llvm-svn: 364382

5 years ago[HIP] Support attribute hip_pinned_shadow
Yaxun Liu [Wed, 26 Jun 2019 03:47:37 +0000 (03:47 +0000)]
[HIP] Support attribute hip_pinned_shadow

This patch introduces support of hip_pinned_shadow variable for HIP.

A hip_pinned_shadow variable is a global variable with attribute hip_pinned_shadow.
It has external linkage on device side and has no initializer. It has internal
linkage on host side and has initializer or static constructor. It can be accessed
in both device code and host code.

This allows HIP runtime to implement support of HIP texture reference.

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

llvm-svn: 364381

5 years agoFix build failure due to missing break
Yaxun Liu [Wed, 26 Jun 2019 03:33:03 +0000 (03:33 +0000)]
Fix build failure due to missing break

llvm-svn: 364380

5 years agoRevert [llvm-objcopy][NFC] Refactor output target parsing
Rumeet Dhindsa [Wed, 26 Jun 2019 03:00:57 +0000 (03:00 +0000)]
Revert [llvm-objcopy][NFC] Refactor output target parsing

This reverts r364254 (git commit 545f001d1b9a7b58a68d75e70bfc36c841de8999)

This change causes some llvm-obcopy tests to fail with valgrind.

Following is the output for basic-keep.test
Command Output (stderr):
--

==107406== Conditional jump or move depends on uninitialised value(s)
==107406==    at 0x1A30DD: executeObjcopy(llvm::objcopy::CopyConfig const&) (llvm-objcopy.cpp:235)
==107406==    by 0x1A3935: main (llvm-objcopy.cpp:294)

llvm-svn: 364379

5 years agoRevert [llvm-objcopy][NFCI] Fix build failure with GCC
Rumeet Dhindsa [Wed, 26 Jun 2019 02:57:34 +0000 (02:57 +0000)]
Revert [llvm-objcopy][NFCI] Fix build failure with GCC

This reverts r364263 (git commit 81eb82840524818ec0ec14285c866c09b9634df0)

This commit is related to r364254 which is causing some llvm-objcopy tests
to fail with valgrind.

Error:
Conditional jump or move depends on uninitialised value(s)

llvm-svn: 364378

5 years ago[NFC] Fix buildbot breaks due to r364375
Nemanja Ivanovic [Wed, 26 Jun 2019 02:46:03 +0000 (02:46 +0000)]
[NFC] Fix buildbot breaks due to r364375

For some reason, the update_llc_checks.py script produces checks for
empty lines which cause failures. Corrected that to check for actual
text produced by llc.

llvm-svn: 364377

5 years ago[ARM] Fix -Wimplicit-fallthrough after D60709/r364331
Fangrui Song [Wed, 26 Jun 2019 02:34:10 +0000 (02:34 +0000)]
[ARM] Fix -Wimplicit-fallthrough after D60709/r364331

llvm-svn: 364376

5 years ago[PowerPC][NFC] Add a TOC save test case prior to posting a related patch
Nemanja Ivanovic [Wed, 26 Jun 2019 02:01:11 +0000 (02:01 +0000)]
[PowerPC][NFC] Add a TOC save test case prior to posting a related patch

An upcoming patch will modify the behaviour with respect to saving the TOC
in functions with indirect calls.
Adding a test case so the patch will show the difference in codegen.

llvm-svn: 364375

5 years agogn build: Merge r364288.
Peter Collingbourne [Wed, 26 Jun 2019 01:52:22 +0000 (01:52 +0000)]
gn build: Merge r364288.

llvm-svn: 364374

5 years ago[PowerPC] Mark FCOPYSIGN legal for FP vectors
Nemanja Ivanovic [Wed, 26 Jun 2019 01:48:57 +0000 (01:48 +0000)]
[PowerPC] Mark FCOPYSIGN legal for FP vectors

This was just an omission in the back end. We have had the instructions for both
single and double precision for a few HW generations, but never got around to
legalizing these.

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

llvm-svn: 364373

5 years ago[PowerPC][NFC] Move peephole optimization of RLDICR into a method.
Kai Luo [Wed, 26 Jun 2019 01:34:37 +0000 (01:34 +0000)]
[PowerPC][NFC] Move peephole optimization of RLDICR into a method.

llvm-svn: 364372

5 years ago[WebAssembly] Fix accidental omission from rLLD364367
Keno Fischer [Wed, 26 Jun 2019 01:26:53 +0000 (01:26 +0000)]
[WebAssembly] Fix accidental omission from rLLD364367

There was another place where handling for this relocation was missing
that was accidentally omitted from rLLD364367, causing the newly added
test to fail on the buildbots.

llvm-svn: 364371

5 years agoMC: correct the emission of weak aliases in COFF
Saleem Abdulrasool [Wed, 26 Jun 2019 01:09:52 +0000 (01:09 +0000)]
MC: correct the emission of weak aliases in COFF

The weak alias should have the characteristics set to
`IMAGE_EXTERN_WEAK_SEARCH_ALIAS` to indicate that the weak external here
is a symbol alias and that the symbol is aliased to a locally defined
symbol.  We were previously setting the characteristics to
`IMAGE_EXTERN_WEAK_SEARCH_LIBRARY` which indicates that the symbol
should be looked for in the libraries.

llvm-svn: 364370

5 years agoFollow up fix for r364366.
Dan Liew [Wed, 26 Jun 2019 00:54:06 +0000 (00:54 +0000)]
Follow up fix for r364366.

When setting the parallelism group support MSan and use a syntactically
compact condition.

rdar://problem/51754620

llvm-svn: 364369

5 years ago[lld/WebAssembly] Slightly nicer error message for malformed input files
Keno Fischer [Wed, 26 Jun 2019 00:52:46 +0000 (00:52 +0000)]
[lld/WebAssembly] Slightly nicer error message for malformed input files

Summary:
Before:
```
wasm-ld: error: Relocations not in offset order
```
After
```
wasm-ld: error: While processing `libjulia.so`: Relocations not in offset order
```

At least this way you get to find out which input file is malformed.

Reviewers: sbc100
Differential Revision: https://reviews.llvm.org/D63694

llvm-svn: 364368

5 years ago[WebAssembly] Fix list of relocations with addends in lld
Keno Fischer [Wed, 26 Jun 2019 00:52:42 +0000 (00:52 +0000)]
[WebAssembly] Fix list of relocations with addends in lld

Summary:
The list of relocations with addend in lld was missing `R_WASM_MEMORY_ADDR_REL_SLEB`,
causing `wasm-ld` to generate corrupted output. This fixes that problem and while
we're at it pulls the list of such relocations into the Wasm.h header, to avoid
duplicating it in multiple places.

Reviewers: sbc100
Differential Revision: https://reviews.llvm.org/D63696

llvm-svn: 364367

5 years agoAdd USan+ASan and UBSan+TSan tests to shadow-memory lit parallelism group.
Dan Liew [Wed, 26 Jun 2019 00:35:51 +0000 (00:35 +0000)]
Add USan+ASan and UBSan+TSan tests to shadow-memory lit parallelism group.

Summary:
Previously we were running these tests without the "shadow-memory"
lit parallelism group even though we run the ASan and TSan tests in
this group to avoid problems with many processes using shadow memory
in parallel.

On my local machine the UBSan+TSan tests would previously timeout
if I set a 30 second per test limit. With this change I no longer
see individual test timeouts.

This change was made in response to the greendragon build bot reporting
individual test timeouts for these tests. Given that the UBSan+ASan and
UBSan+TSan tests did not have a parallelism group previously it's likely
that some other change has caused the performance degradation. However
I haven't been able to track down the cause so until we do, this change
seems reasonable and is in line with what we already do with ASan and
TSan tests.

rdar://problem/51754620

Reviewers: yln, kubamracek, vsk, samsonov

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 364366

5 years ago[analyzer] exploded-graph-rewriter: Prettier location context dumps.
Artem Dergachev [Wed, 26 Jun 2019 00:14:49 +0000 (00:14 +0000)]
[analyzer] exploded-graph-rewriter: Prettier location context dumps.

Make them span wider.

llvm-svn: 364365

5 years agoTeach TableGen Intrin Emitter to handle LLVMPointerType<llvm_any_ty>
Erich Keane [Wed, 26 Jun 2019 00:08:22 +0000 (00:08 +0000)]
Teach TableGen Intrin Emitter to handle LLVMPointerType<llvm_any_ty>

r363233 rewrote a bunch of the Intrin Emitter code, however the new
function to update the arg codes did not properly consider a pointer to
an any.  This patch adds that logic.

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

llvm-svn: 364364

5 years agoRevert "Change the ABI version and ABI namespace to be `_LIBCPP_VERSION`"
Eric Fiselier [Wed, 26 Jun 2019 00:05:14 +0000 (00:05 +0000)]
Revert "Change the ABI version and ABI namespace to be `_LIBCPP_VERSION`"

There are some suspicious bot failures that I want to ensure aren't
caused by this patch.

I'll recommit tomorrow.

llvm-svn: 364363

5 years agoprint-supported-cpus quality of life patch.
Ziang Wan [Tue, 25 Jun 2019 23:57:14 +0000 (23:57 +0000)]
print-supported-cpus quality of life patch.

Claim all input files so that clang does not give a warning. Add two
short-cut aliases: -mcpu=? and -mtune=?.

llvm-svn: 364362

5 years agoFix a typo in help text.
Adrian McCarthy [Tue, 25 Jun 2019 23:13:16 +0000 (23:13 +0000)]
Fix a typo in help text.

llvm-svn: 364361

5 years ago[WebAssembly] Remove catch_all from AsmParser
Heejin Ahn [Tue, 25 Jun 2019 23:04:12 +0000 (23:04 +0000)]
[WebAssembly] Remove catch_all from AsmParser

Summary:
`catch_all` is from the first version of EH proposal and now has been
removed. There were no tests covering this, and thus no tests to remove
or fix.

Reviewers: aardappel

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

Tags: #llvm

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

llvm-svn: 364360

5 years agoRevert Devirtualize destructor of final class.
Rumeet Dhindsa [Tue, 25 Jun 2019 22:58:25 +0000 (22:58 +0000)]
Revert Devirtualize destructor of final class.

This reverts r364100 (git commit 405c2b16225fc6eaf5eb8ba3ce584699a3b159ef)

llvm-svn: 364359

5 years agoAdd github lockdown app to auto-close pull requests.
Tom Stellard [Tue, 25 Jun 2019 22:51:46 +0000 (22:51 +0000)]
Add github lockdown app to auto-close pull requests.

llvm-svn: 364358

5 years agoDump what value failed byval attribute verification
Reid Kleckner [Tue, 25 Jun 2019 22:33:32 +0000 (22:33 +0000)]
Dump what value failed byval attribute verification

This verifier check is failing for us while doing ThinLTO on Chrome for
x86, see https://crbug.com/978218, and this helps to debug the problem.

llvm-svn: 364357

5 years ago[GWP-ASan] Guard against recursive allocs. Pack TLS for perf.
Mitch Phillips [Tue, 25 Jun 2019 22:29:05 +0000 (22:29 +0000)]
[GWP-ASan] Guard against recursive allocs. Pack TLS for perf.

Summary:
Add a recursivity guard for GPA::allocate(). This means that any
recursive allocations will fall back to the supporting allocator. In future
patches, we will introduce stack trace collection support. The unwinder will be
provided by the supporting allocator, and we can't guarantee they don't call
malloc() (e.g. backtrace() on posix may call dlopen(), which may call malloc().

Furthermore, this patch packs the new TLS recursivity guard into a thread local
struct, so that TLS variables should be hopefully not fall across cache lines.

Reviewers: vlad.tsyrklevich, morehouse, eugenis

Reviewed By: eugenis

Subscribers: kubamracek, #sanitizers, llvm-commits, eugenis

Tags: #sanitizers, #llvm

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

llvm-svn: 364356

5 years agoRevert "Add ReadCStringFromMemory for faster string reads"
Antonio Afonso [Tue, 25 Jun 2019 22:22:13 +0000 (22:22 +0000)]
Revert "Add ReadCStringFromMemory for faster string reads"

This reverts commit a7335393f50246b59db450dc6005f7c8f29e73a6.

It seems this is breaking a bunch of tests (https://reviews.llvm.org/D62503#1549874) so reverting until I find the time to repro and fix.

llvm-svn: 364355

5 years agoChange the ABI version and ABI namespace to be `_LIBCPP_VERSION`
Eric Fiselier [Tue, 25 Jun 2019 22:13:39 +0000 (22:13 +0000)]
Change the ABI version and ABI namespace to be `_LIBCPP_VERSION`
when _LIBCPP_ABI_UNSTABLE is defined.

User defined _LIBCPP_ABI_NAMESPACE will still be respected,
but the default version namespace in unstable mode will be the libc++ version
(Currently '__9000').

Previously  `_LIBCPP_ABI_VERSION` and `_LIBCPP_ABI_NAMESPACE` were
`1` and `__1` respectively, whuch conflicted with the stable ABI

llvm-svn: 364354

5 years ago[MachinePipeliner] Fix risky iterator usage R++, --R
Jinsong Ji [Tue, 25 Jun 2019 21:50:56 +0000 (21:50 +0000)]
[MachinePipeliner] Fix risky iterator usage R++, --R

When we calculate MII, we use two loops, one with iterator R++ to
check whether we can reserve the resource, then --R to move back
the iterator to do reservation.

This is risky, as R++, --R may not point to the same element at all.
The can cause wrong MII.

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

llvm-svn: 364353

5 years agoandroid: enable double-word CAS on x64
Saleem Abdulrasool [Tue, 25 Jun 2019 21:43:34 +0000 (21:43 +0000)]
android: enable double-word CAS on x64

The android target assumes that for the x86_64 target, the CPU supports SSE4.2
and popcnt. This implies that the CPU is Nehalem or newer. This should be
sufficiently new to provide the double word compare and exchange instruction.
This allows us to directly lower `__sync_val_compare_and_swap_16` to a `cmpxchg16b`.
It appears that the libatomic in android's NDK does not provide the
implementation for lowering calls to the library function.

llvm-svn: 364352

5 years ago[dotest] Remove unused function
Jonas Devlieghere [Tue, 25 Jun 2019 21:19:44 +0000 (21:19 +0000)]
[dotest] Remove unused function

The function `EnvArray` has no used.

llvm-svn: 364351

5 years ago[PowerPC][NFC]Add a test for MachinePipeliner bug
Jinsong Ji [Tue, 25 Jun 2019 20:56:17 +0000 (20:56 +0000)]
[PowerPC][NFC]Add a test for MachinePipeliner bug

llvm-svn: 364350

5 years agoDon't look for the TargetFrameLowering in the implementation
Matt Arsenault [Tue, 25 Jun 2019 20:53:35 +0000 (20:53 +0000)]
Don't look for the TargetFrameLowering in the implementation

The same oddity was apparently copy-pasted between multiple targets.

llvm-svn: 364349

5 years ago[InstCombine] Simplify icmp ult/uge (shl %x, C2), C1 iff C1 is power of two -> icmp...
Huihui Zhang [Tue, 25 Jun 2019 20:44:52 +0000 (20:44 +0000)]
[InstCombine] Simplify icmp ult/uge (shl %x, C2), C1 iff C1 is power of two -> icmp eq/ne (and %x, (lshr -C1, C2)), 0.

Simplify 'shl' inequality test into 'and' equality test.

This pattern happens in the middle-end while simplifying bitfield access,
Exposed in https://reviews.llvm.org/D63505

https://rise4fun.com/Alive/6uz

Reviewers: lebedev.ri, efriedma

Reviewed By: lebedev.ri

Subscribers: spatel, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 364348

5 years agoRemove redundant expression evaluation context when substituting into a
Richard Smith [Tue, 25 Jun 2019 20:40:27 +0000 (20:40 +0000)]
Remove redundant expression evaluation context when substituting into a
template argument.

We do need one of these but we don't need two.

llvm-svn: 364347