platform/upstream/llvm.git
4 years ago[lit] Create report generators during argument parsing
Julian Lettner [Fri, 1 May 2020 22:52:44 +0000 (15:52 -0700)]
[lit] Create report generators during argument parsing

4 years ago[lit] Small refinements for xunit report output
Julian Lettner [Fri, 1 May 2020 22:20:18 +0000 (15:20 -0700)]
[lit] Small refinements for xunit report output

4 years ago[lit] Factor out report generators into separate file
Julian Lettner [Fri, 1 May 2020 16:35:46 +0000 (09:35 -0700)]
[lit] Factor out report generators into separate file

Factor out the report generators from main.py into reports.py.

I verified that we generate the exact same output by running `check-all`
and comparing the new and old output for both report flavors.

4 years ago[lit] Only update specific fields from remote test object
Julian Lettner [Fri, 1 May 2020 16:51:46 +0000 (09:51 -0700)]
[lit] Only update specific fields from remote test object

Don't update whole test object from the remote (pickled) finished test
object.  Doing so also changes the config and suite members, which we
want to avoid.

4 years ago[gn build] Port 6cb073133c5
LLVM GN Syncbot [Sat, 2 May 2020 00:00:04 +0000 (00:00 +0000)]
[gn build] Port 6cb073133c5

4 years ago[lld] Merge Mach-O input sections
Kellie Medlin [Fri, 1 May 2020 23:29:06 +0000 (16:29 -0700)]
[lld] Merge Mach-O input sections

Summary: Similar to other formats, input sections in the MachO
implementation are now grouped under output sections. This is primarily
a refactor, although there's some new logic (like resolving the output
section's flags based on its inputs).

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

4 years ago[mlir][DenseStringElementsAttr] Add support for the Attribute based get* methods.
River Riddle [Fri, 1 May 2020 23:26:45 +0000 (16:26 -0700)]
[mlir][DenseStringElementsAttr] Add support for the Attribute based get* methods.

This was missed in the original revision. This allows for using the opaque Attribute accessors when the elements are strings.

4 years ago[llvm][NFC] Rename variable as per https://reviews.llvm.org/D79215
Mircea Trofin [Fri, 1 May 2020 23:30:41 +0000 (16:30 -0700)]
[llvm][NFC] Rename variable as per https://reviews.llvm.org/D79215

Operator error - performed the rename and didn't save.

4 years ago[llvm][NFC] Inliner: simplify inlining decision logic
Mircea Trofin [Thu, 30 Apr 2020 23:22:31 +0000 (16:22 -0700)]
[llvm][NFC] Inliner: simplify inlining decision logic

Summary:
shouldInline makes a decision based on the InlineCost of a call site, as
well as an evaluation on whether the site should be deferred. This means
it's possible for the decision to be not to inline, even for an
InlineCost that would otherwise allow it.

Both uses of shouldInline performed the exact same logic after calling
it. In addition, the decision on whether to inline or not was
communicated through two values of the Option<InlineCost> return value:
None, or an InlineCost evaluating to false.

Simplified by:
- encapsulating the decision in the return object. The bool it evaluates
to communicates unambiguously the decision. The InlineCost is also
available.
- encapsulated the common post-shouldInline code into shouldInline.

Reviewers: davidxl, echristo, eraman

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[mlir][GPUOpsLowering] Add missing include for FormatVariadic
River Riddle [Fri, 1 May 2020 22:57:42 +0000 (15:57 -0700)]
[mlir][GPUOpsLowering] Add missing include for FormatVariadic

4 years ago[ARM64] Remove more dead code. NFC.
Davide Italiano [Fri, 1 May 2020 22:05:42 +0000 (15:05 -0700)]
[ARM64] Remove more dead code. NFC.

4 years ago[ARM64] Remove dead code.
Davide Italiano [Fri, 1 May 2020 22:04:44 +0000 (15:04 -0700)]
[ARM64] Remove dead code.

4 years ago[SveEmitter] Add builtins for shifts.
Sander de Smalen [Fri, 1 May 2020 20:39:16 +0000 (21:39 +0100)]
[SveEmitter] Add builtins for shifts.

This patch adds builtins for:
- svasrd
- svlsl
- svlsr

4 years ago[llvm-objcopy] -O binary: skip empty sections
Fangrui Song [Fri, 1 May 2020 05:15:05 +0000 (22:15 -0700)]
[llvm-objcopy] -O binary: skip empty sections

After SHF_ALLOC sections are ordered by LMA:

* If initial sections are empty, GNU objcopy skips their contents while we
  emit leading zeros. (binary-paddr.test %t4)
* If trailing sections are empty, GNU objcopy skips their contents while we
  emit trailing zeros. (binary-paddr.test %t5)

This patch matches GNU objcopy's behavior. Linkers don't keep p_memsz
PT_LOAD segments. Such empty sections would not have a containing
PT_LOAD and `Section::ParentSegment` might be null if linkers fail to
optimize the file offsets (lld D79254).

In particular, without D79254, the arm Linux kernel's multi_v5_defconfig
depends on this behavior: in `vmlinux`, an empty .text_itcm is mapped at
a very high address (0xfffe0000) but the kernel does not expect
`objcopy -O binary` to create a very large `arch/arm/boot/Image`
(0xfffe0000-0xc0000000 ~= 1GiB). See https://bugs.llvm.org/show_bug.cgi?id=45632

Reviewed By: jhenderson

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

4 years ago[clang][OpenMP] Fix mangling of linear parameters.
Francesco Petrogalli [Mon, 27 Apr 2020 19:39:42 +0000 (19:39 +0000)]
[clang][OpenMP] Fix mangling of linear parameters.

Summary:
The linear parameter token in the mangling function must be multiplied
by the pointee size in bytes when the parameter is a pointer.

Reviewers: ABataev, andwar, jdoerfert

Subscribers: yaxunl, guansong, cfe-commits

Tags: #clang

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

4 years ago[AIX] Skip unsupported ORC JIT RemoteObjectLayerTest on AIX
David Tenty [Fri, 1 May 2020 19:48:21 +0000 (15:48 -0400)]
[AIX] Skip unsupported ORC JIT RemoteObjectLayerTest on AIX

Summary:
Currently the XCOFF backend does not support writing 64-bit object
files, which the ORC JIT tests will try to exercise if we are on AIX. This patch
selectively disables the tests on AIX for now.

Reviewers: hubert.reinterpretcast, jasonliu, DiggerLin, stevewan, lhames

Reviewed By: hubert.reinterpretcast, lhames

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[lldb/API] Add SBCommandInterpreterRunResult
Jonas Devlieghere [Fri, 1 May 2020 20:23:51 +0000 (13:23 -0700)]
[lldb/API] Add SBCommandInterpreterRunResult

This adds an RunCommandInterpreter overload that returns an instance of
SBCommandInterpreterRunResults. The goal is to avoid having to add more
and more overloads when we need more output arguments.

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

4 years ago[SVE] Fix invalid use of VectorType::getNumElements() in PatternMatch
Christopher Tetreault [Fri, 1 May 2020 17:58:50 +0000 (10:58 -0700)]
[SVE] Fix invalid use of VectorType::getNumElements() in PatternMatch

Summary:
Update cst_pred_ty to only work on FixedVectorType. It operates on
integers and integer vectors, and returns true if the predicate returns
true for all elements of the vector. This operation is not possible on
scalable vectors. Make this behavior explicit in the code and document
the fact that it only tests fixed width vectors.

Identified by test LLVM.Transforms/InstCombine::nsw.ll

Reviewers: efriedma, c-rhodes, david-arm, spatel

Reviewed By: david-arm

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[libc++abi] Add -Wno-unreachable-code when building test for throwing incomplete...
Louis Dionne [Fri, 1 May 2020 19:27:54 +0000 (15:27 -0400)]
[libc++abi] Add -Wno-unreachable-code when building test for throwing incomplete types

Slightly older Clangs seem to think they are more clever than they really
are, and they think the code can never be executed. The code can actually
be executed in case the exception runtime is mis-implemented, which is
exactly what this test is testing. This commit just disables the spurious
warning.

4 years ago[clang] [unittest/AST] Fix linking to LLVMTestingSupport
Michał Górny [Fri, 1 May 2020 19:22:33 +0000 (21:22 +0200)]
[clang] [unittest/AST] Fix linking to LLVMTestingSupport

Link to LLVMTestingSupport via target_link_libraries() instead of
clang_target_link_libraries().  The latter is ineffective if tests
are linked to libclang.so.  This solution is consistent with what other
tests do.

4 years ago[lldb/CommandInterpreter] Fix typo in CommandInterpreterResult::IsResult
Jonas Devlieghere [Fri, 1 May 2020 19:03:56 +0000 (12:03 -0700)]
[lldb/CommandInterpreter] Fix typo in CommandInterpreterResult::IsResult

A missing `=` turned a comparison into an assignment.

4 years ago[IndexedAccessorRange] Only offset the base if the index is non-zero.
River Riddle [Fri, 1 May 2020 18:56:21 +0000 (11:56 -0700)]
[IndexedAccessorRange] Only offset the base if the index is non-zero.

This is more efficient and removes the need for derived ranges to handle the degenerate empty case.

4 years ago[CMake] Provide a proper default location for llvm-lit for out-of-tree users on Windo...
Vladimir Vereschaka [Wed, 29 Apr 2020 23:15:16 +0000 (16:15 -0700)]
[CMake] Provide a proper default location for llvm-lit for out-of-tree users on Windows host.

llvm-lit gets '.py' extension on Windows host during its configuration.
We need to provide a correct name for llvm-lit including file extension
within LLVM_CONFIG_DEFAULT_EXTERNAL_LIT variable.

Update for commit 45526d29a5b2cf126b83ada3991921970007d16f.

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

4 years ago[DebugInfo] Update loop metadata in stripNonLineTableDebugInfo
Vedant Kumar [Thu, 30 Apr 2020 20:22:22 +0000 (13:22 -0700)]
[DebugInfo] Update loop metadata in stripNonLineTableDebugInfo

Summary:
Have stripNonLineTableDebugInfo() attach updated !llvm.loop metadata to
an instruction (instead of updating and then discarding the metadata).

This fixes "!dbg attachment points at wrong subprogram for function"
errors seen while archiving an iOS app.

It would be nice -- as a follow-up -- to catch this issue earlier,
perhaps by modifying the verifier to constrain where DILocations are
allowed. Any alternative suggestions appreciated.

rdar://61982466

Reviewers: aprantl, dsanders

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[libc++] Try re-enabling DSL test on Windows
Louis Dionne [Wed, 29 Apr 2020 15:30:37 +0000 (11:30 -0400)]
[libc++] Try re-enabling DSL test on Windows

The issues we were seeing before should have been fixed, but it's hard
to say for sure without running through the bots again.

4 years ago[lldb/CommandInterpreter] Add CommandInterpreterRunResult (NFC)
Jonas Devlieghere [Fri, 1 May 2020 18:29:07 +0000 (11:29 -0700)]
[lldb/CommandInterpreter] Add CommandInterpreterRunResult (NFC)

This patch adds a new class CommandInterpreterRunResult which will be
backing the SBCommandInterpreterRunResult. It keeps track of the number
of errors as well as the result which is an enum, as proposed by Pavel
in D79120. The command interpreter now populates the results directly,
instead of its own member variables.

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

4 years ago[ELF][test] Improve tests
Fangrui Song [Fri, 1 May 2020 18:04:20 +0000 (11:04 -0700)]
[ELF][test] Improve tests

Prepare for the upcomong change that removes unneeded sh_offset
advancement for empty sections whose PT_LOAD are removed.

4 years ago[MLIR][docs] Update tutorial language around Op and Operation* and 'opaque'
Stephen Neuendorffer [Wed, 29 Apr 2020 23:27:36 +0000 (16:27 -0700)]
[MLIR][docs] Update tutorial language around Op and Operation* and 'opaque'

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

4 years agoFix pr31836 on Windows too, and correctly handle repeated separators.
Nico Weber [Fri, 1 May 2020 00:39:19 +0000 (20:39 -0400)]
Fix pr31836 on Windows too, and correctly handle repeated separators.

The approach in D30000 assumes that the '/' returned by path::begin()
is the first element for absolute paths, but that's not true on
Windows.

Also, on Windows backslashes in include lines often end up escaped
so that there are two of them. Having backslashes in include lines
is undefined behavior in most cases and implementation-defined
behavior in C++20, but since clang treats it as normal repeated
path separators, the diagnostic should too.

Unbreaks -Wnonportable-include-path for absolute paths on Windows,
and unbreaks it on non-Windows in the case of absolute paths with
repeated directory separators.

This affects e.g. the `#include __FILE__` technique if the file
passed to clang has the wrong case for the drive letter. Before:

C:\src\llvm-project>bin\clang-cl.exe c:\src\llvm-project\test.cc
c:\\src\\llvm-project\\test.cc(4,10): warning: non-portable path to file
    '"c\\srccllvm-projectctest.cc.'; specified path differs in case from
    file name on disk [-Wnonportable-include-path]
         ^

Now:

C:\src\llvm-project> out\gn\bin\clang-cl c:\src\llvm-project\test.cc
c:\\src\\llvm-project\\test.cc(4,10): warning: non-portable path to file
    '"C:\\src\\llvm-project\\test.cc"'; specified path differs in case from
    file name on disk [-Wnonportable-include-path]
         ^

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

4 years ago[X86] Lower the cost of v4i64->v4i32 truncate with avx512.
Craig Topper [Fri, 1 May 2020 17:38:33 +0000 (10:38 -0700)]
[X86] Lower the cost of v4i64->v4i32 truncate with avx512.

We use the vpmovqd instruction which is a single uop. So
the cost should be 1.

4 years ago[examples] Fix an incomplete comment.
Lang Hames [Fri, 1 May 2020 18:01:48 +0000 (11:01 -0700)]
[examples] Fix an incomplete comment.

4 years ago[examples] Call setProcessAllSections to ensure debug sections aren't droppped.
Lang Hames [Thu, 30 Apr 2020 23:08:25 +0000 (16:08 -0700)]
[examples] Call setProcessAllSections to ensure debug sections aren't droppped.

Calling setProcessAllSections(true) is required to make sure that all sections,
even those not marked as necessary for execution, are passed to the memory
manager.

4 years ago[libc++] Re-enable some tests under ASAN and MSAN
Louis Dionne [Fri, 1 May 2020 17:25:40 +0000 (13:25 -0400)]
[libc++] Re-enable some tests under ASAN and MSAN

The tests were disabled under ASAN/MSAN because old Clangs were very
slow to build the test cases. However, I checked with the Clang used
on our build bots and the tests are not slow to build anymore, so the
tests can be re-enabled.

4 years ago[SVE] Fix invalid usage of VectorType::getNumElements() in InstCombine
Christopher Tetreault [Fri, 1 May 2020 17:17:54 +0000 (10:17 -0700)]
[SVE] Fix invalid usage of VectorType::getNumElements() in InstCombine

Summary:
Make foldVectorBinop return null if the instruction type is a scalable
vector. It is unclear what, if any, of this function works with scalable
vectors.

Identified by test LLVM.Transforms/InstCombine::nsw.ll

Reviewers: efriedma, david-arm, fpetrogalli, spatel

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[InstCombine] fix miscompile from multi-use cttz/ctlz transform
Sanjay Patel [Fri, 1 May 2020 17:51:21 +0000 (13:51 -0400)]
[InstCombine] fix miscompile from multi-use cttz/ctlz transform

PR45762:
https://bugs.llvm.org/show_bug.cgi?id=45762

4 years ago[InstCombine] add test for faulty cttz fold (PR45762); NFC
Sanjay Patel [Fri, 1 May 2020 16:53:57 +0000 (12:53 -0400)]
[InstCombine] add test for faulty cttz fold (PR45762); NFC

4 years ago[libc++] Turn on warnings in the test suite in C++03 for Clang-based compilers
Louis Dionne [Fri, 1 May 2020 17:14:04 +0000 (13:14 -0400)]
[libc++] Turn on warnings in the test suite in C++03 for Clang-based compilers

4 years agoRevert "Reapply "Add support for #pragma float_control" with improvements to"
Melanie Blower [Fri, 1 May 2020 17:31:09 +0000 (10:31 -0700)]
Revert "Reapply "Add support for #pragma float_control" with improvements to"

This reverts commit 69aacaf699922ffe0450f567e21208c10c84731f.

4 years ago[libc++] Disable test that we use -Werror in C++03
Louis Dionne [Fri, 1 May 2020 17:11:55 +0000 (13:11 -0400)]
[libc++] Disable test that we use -Werror in C++03

4 years ago[ADT] Add DenseSetImpl(begin, end)
Fangrui Song [Fri, 1 May 2020 16:57:18 +0000 (09:57 -0700)]
[ADT] Add DenseSetImpl(begin, end)

4 years ago[libc++] NFC: fix typos
Louis Dionne [Fri, 1 May 2020 17:10:06 +0000 (13:10 -0400)]
[libc++] NFC: fix typos

4 years ago[InstCombine] Additional 'concat of ORs' BSWAP/BITREVERSE tests for D79041
Simon Pilgrim [Fri, 1 May 2020 16:57:28 +0000 (17:57 +0100)]
[InstCombine] Additional 'concat of ORs' BSWAP/BITREVERSE tests for D79041

4 years agoReapply "Add support for #pragma float_control" with improvements to
Melanie Blower [Fri, 1 May 2020 16:26:15 +0000 (09:26 -0700)]
Reapply "Add support for #pragma float_control" with improvements to
test cases
Add support for #pragma float_control

Reviewers: rjmccall, erichkeane, sepavloff

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

This reverts commit 85dc033caccaa6ab919d57f9759290be41240146, and makes
corrections to the test cases that failed on buildbots.

4 years ago[mlir][rocdl] fix shared lib build. NFC.
Wen-Heng (Jack) Chung [Fri, 1 May 2020 16:49:15 +0000 (09:49 -0700)]
[mlir][rocdl] fix shared lib build. NFC.

Summary: - Add missing dependency to MLIRVectorToLLVM to get shared libs built.

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

4 years ago[SveEmitter] Add builtins for various FP operations
Sander de Smalen [Fri, 1 May 2020 16:34:42 +0000 (17:34 +0100)]
[SveEmitter] Add builtins for various FP operations

Unary:
- svexpa, svtmad, svtsmul, svtssel,
  svscale, svrecpe, svrecps, svrsqrte,
  svrsqrts,

Binary:
- svabd, svadd, svdiv, svdivr,
  svmin, svmax, svminnm, svmaxnm,
  svmul, svmulx, svsub, svsubr,
  svmul_lane

Complex:
- svcadd, svcmla

4 years agoscudo: Exclude previous tag when retagging freed memory.
Peter Collingbourne [Thu, 30 Apr 2020 23:42:17 +0000 (16:42 -0700)]
scudo: Exclude previous tag when retagging freed memory.

This means that immediate use after free will be detected 100% of
the time.

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

4 years ago[NFC] Try to fix test due asan failure
Diogo Sampaio [Fri, 1 May 2020 16:16:58 +0000 (17:16 +0100)]
[NFC] Try to fix test due asan failure

4 years ago[llvm-readobj] - Simplify conditions used for printing segment mappings. NFCI.
Georgii Rymar [Thu, 23 Apr 2020 12:54:25 +0000 (15:54 +0300)]
[llvm-readobj] - Simplify conditions used for printing segment mappings. NFCI.

This patch is a NFC refactoring.

Currently the logic is overcomplicated, contains dead conditions and is very hard to read.
This patch performs a very straightforward simplification. Probably it can be
simplified and improved more, but we need to land test cases documenting/testing
all the current functionality first.

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

4 years ago[llvm-readelf] - Do not crash when the PT_INTERP has a broken offset.
Georgii Rymar [Tue, 28 Apr 2020 15:16:00 +0000 (18:16 +0300)]
[llvm-readelf] - Do not crash when the PT_INTERP has a broken offset.

We do not verify the p_offset of the PT_INTERP header and tool may
crash when a program interpreter name string goes past the end of the file.

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

4 years ago[OPENMP50]Codegen for reduction clauses with 'task' modifier.
Alexey Bataev [Fri, 24 Apr 2020 13:56:29 +0000 (09:56 -0400)]
[OPENMP50]Codegen for reduction clauses with 'task' modifier.

Summary:
Added codegen for reduction clause with task modifier.
```
  #pragma omp ... reduction(task, +: a)
  {
  #pragma omp ... in_reduction(+: a)
  }
```
is translated into something like this:
```
  #pragma omp ... reduction(+:a)
  {
    struct red_input_t {
      void *reduce_shar;
      void *reduce_orig;
      size_t reduce_size;
      void *reduce_init;
      void *reduce_fini;
      void *reduce_comb;
      unsigned flags;
    } r_var;
    r_var.reduce_shar = &a;
    r_var.reduce_orig = &original a;
    r_var.reduce_size = sizeof(a);
    r_var.reduce_init = [](void* l,void*){return *(int*)l=0;};
    r_var.reduce_fini = nullptr;
    r_var.reduce_comb = [](void* l,void* r){return *(int*)l += *(int)r;};
    void *tg = __kmpc_taskred_modifier_init(<loc_addr>,<gtid>,
      <flag - 0 for parallel, 1 for worksharing>,
      <1 - number of reduction elements>,
      &r_var);
    {
    #pragma omp ... in_reduction(+: a) firstprivate(tg)
    ...
    }
    __kmpc_task_reduction_modifier_fini(<loc_addr>,<gtid>,
      <flag - 0 for parallel, 1 for worksharing>);
  }
```

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, jfb, cfe-commits, caomhin

Tags: #clang

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

4 years ago[llvm-readobj][test] - Stop using binaries in gnu-phdrs.test, split and refine it.
Georgii Rymar [Thu, 23 Apr 2020 08:09:38 +0000 (11:09 +0300)]
[llvm-readobj][test] - Stop using binaries in gnu-phdrs.test, split and refine it.

gnu-phdrs.test uses 2 precompiled objects and has issues:

* It does not test all possible program headers.
* It does not test target-specific headers (arm, mips).
* It does not use --strict-whitespace --match-full-line to check the format of the output.
* It is possible to check things better/nicer.
* It also tests --section-mapping.

This patch makes gnu-phdrs.test to stop using binaries and addresses issues above.
It splits --section-mapping testing to gnu-section-mapping.test

I am going to use it as a base for a follow-up patch that should also test
section to segment mapping conditions that we currently have
(see the discussion in D78709)

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

4 years ago[DAG] SimplifyDemandedVectorElts - add INSERT_SUBVECTOR SimplifyMultipleUseDemandedBi...
Simon Pilgrim [Fri, 1 May 2020 15:08:30 +0000 (16:08 +0100)]
[DAG] SimplifyDemandedVectorElts - add INSERT_SUBVECTOR SimplifyMultipleUseDemandedBits handling

4 years ago[DAG] SimplifyDemandedVectorElts - remove INSERT_SUBVECTOR if we don't demand the...
Simon Pilgrim [Fri, 1 May 2020 14:38:20 +0000 (15:38 +0100)]
[DAG] SimplifyDemandedVectorElts - remove INSERT_SUBVECTOR if we don't demand the subvector

4 years ago[libc++] Avoid using GNU extension in test, which triggers a warning
Louis Dionne [Fri, 1 May 2020 15:04:34 +0000 (11:04 -0400)]
[libc++] Avoid using GNU extension in test, which triggers a warning

4 years ago[libc++] Make sure -Werror is enabled all the time, except in verify tests
Louis Dionne [Thu, 30 Apr 2020 22:11:07 +0000 (18:11 -0400)]
[libc++] Make sure -Werror is enabled all the time, except in verify tests

4 years ago[InstSimplify] allow insertelement-with-undef fold if poison-safe
Sanjay Patel [Fri, 1 May 2020 14:34:29 +0000 (10:34 -0400)]
[InstSimplify] allow insertelement-with-undef fold if poison-safe

The more general fold was not poison-safe, so it was removed:
rG5486e00
...but it is ok to have this transform if analysis can determine
the vector contains no poison. The test shows a simple example
of that: constant integer elements are not poison.

4 years ago[InstSimplify] update test; NFC
Sanjay Patel [Fri, 1 May 2020 14:06:02 +0000 (10:06 -0400)]
[InstSimplify] update test; NFC

Missed this test diff when committing:
rG5486e00dc3

4 years ago[Bitcode] reserve in front of push_back loops. NFCI.
Benjamin Kramer [Fri, 1 May 2020 13:39:55 +0000 (15:39 +0200)]
[Bitcode] reserve in front of push_back loops. NFCI.

4 years ago[SCCP] Get a copy of the state of CopyOf once.
Florian Hahn [Fri, 1 May 2020 13:43:15 +0000 (14:43 +0100)]
[SCCP] Get a copy of the state of CopyOf once.

This fixes potential reference invalidations, when no lattice value is
assigned for CopyOf. As the state of CopyOf won't change while in
handleCallResult, we can get a copy once and use that.

Should fix PR45749.

4 years agoRevert "Add support for #pragma float_control"
Melanie Blower [Fri, 1 May 2020 13:36:58 +0000 (06:36 -0700)]
Revert "Add support for #pragma float_control"

This reverts commit 4f1e9a17e9d28bdfd035313c96b3a5d4c91a7733.
due to fail on buildbot, sorry for the noise

4 years ago[InstSimplify] remove poison-unsafe insertelement of undef value
Sanjay Patel [Fri, 1 May 2020 13:18:33 +0000 (09:18 -0400)]
[InstSimplify] remove poison-unsafe insertelement of undef value

PR45481:
https://bugs.llvm.org/show_bug.cgi?id=45481

SDAG has an identical transform to this, so there's little
chance of any real-world impact. OTOH, that means we are
effectively sweeping the bug out of sight because poison
exists in codegen too.

4 years agoAdd support for #pragma float_control
Melanie Blower [Mon, 27 Apr 2020 14:25:59 +0000 (07:25 -0700)]
Add support for #pragma float_control

Reviewers: rjmccall, erichkeane, sepavloff

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

4 years ago[DAG] SimplifyDemandedVectorElts - add EXTRACT_SUBVECTOR SimplifyMultipleUseDemandedB...
Simon Pilgrim [Fri, 1 May 2020 12:47:55 +0000 (13:47 +0100)]
[DAG] SimplifyDemandedVectorElts - add EXTRACT_SUBVECTOR SimplifyMultipleUseDemandedBits handling

4 years ago[InstCombine] adjust tests for pow(); NFC
Sanjay Patel [Fri, 1 May 2020 12:23:34 +0000 (08:23 -0400)]
[InstCombine] adjust tests for pow(); NFC

D68231 would change this, but the existing test
doesn't cover what was probably intended (a libcall test).

4 years agoRemove unused variable. NFC.
Benjamin Kramer [Fri, 1 May 2020 12:29:58 +0000 (14:29 +0200)]
Remove unused variable. NFC.

4 years ago[IR] AttributeList::getContext has a single user, remove it.
Benjamin Kramer [Fri, 1 May 2020 12:18:29 +0000 (14:18 +0200)]
[IR] AttributeList::getContext has a single user, remove it.

4 years ago[IR] Make Attributes and AttributeLists trivially destructible and BumpPtrAllocate...
Benjamin Kramer [Fri, 1 May 2020 12:12:17 +0000 (14:12 +0200)]
[IR] Make Attributes and AttributeLists trivially destructible and BumpPtrAllocate them

4 years ago[ms] llvm-lib gives a more useful error if no inputs and no output path are provided
Eric Astor [Fri, 1 May 2020 11:42:54 +0000 (07:42 -0400)]
[ms] llvm-lib gives a more useful error if no inputs and no output path are provided

Summary:
If no inputs and no output path are provided, llvm-lib should produce a useful error.

Before this, it would fail by reading from an unitialized StringRef.

Reviewed By: vvereschaka

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

4 years ago[mlir][spirv] Handle debug information during (de)serialization.
Denis Khalikov [Fri, 1 May 2020 09:51:22 +0000 (12:51 +0300)]
[mlir][spirv] Handle debug information during (de)serialization.

Summary:
This is an initial version, currently supports OpString and OpLine
for autogenerated operations during (de)serialization.

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

4 years agoFix indentation. NFC.
Jay Foad [Fri, 1 May 2020 10:37:59 +0000 (11:37 +0100)]
Fix indentation. NFC.

4 years ago[Gnu toolchain] Move GCC multilib/multiarch paths support from Linux to Gnu
Samuel Thibault [Fri, 1 May 2020 10:36:23 +0000 (12:36 +0200)]
[Gnu toolchain] Move GCC multilib/multiarch paths support from Linux to Gnu
Add missing files

Summary: The current code for GNU/Linux is actually completely generic, and can be moved to Gnu, so it can benefit GNU/Hurd and GNU/kFreeBSD

Reviewers: kristina, sammccall, lebedev.ri, MaskRay, arsenm, phosek

Reviewed By: MaskRay, phosek

Subscribers: wdng, ormris, emaste, arichardson, krytarowski, cfe-commits

Tags: #clang

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

4 years ago[X86] Improving folding of concat_vectors of subvectors from the same broadcast
Simon Pilgrim [Fri, 1 May 2020 10:22:57 +0000 (11:22 +0100)]
[X86] Improving folding of concat_vectors of subvectors from the same broadcast

Handle concat_vectors(extract_subvector(broadcast(x)), extract_subvector(broadcast(x))) -> broadcast(x)

To expose this we also need collectConcatOps to recognise the insert_subvector(x, extract_subvector(x, lo), hi) subvector splat pattern

4 years ago[Gnu toolchain] Move GCC multilib/multiarch paths support from Linux to Gnu
Samuel Thibault [Fri, 1 May 2020 10:11:21 +0000 (12:11 +0200)]
[Gnu toolchain] Move GCC multilib/multiarch paths support from Linux to Gnu

Summary: The current code for GNU/Linux is actually completely generic, and can be moved to Gnu, so it can benefit GNU/Hurd and GNU/kFreeBSD

Reviewers: kristina, sammccall, lebedev.ri, MaskRay, arsenm, phosek

Reviewed By: MaskRay, phosek

Subscribers: wdng, ormris, emaste, arichardson, krytarowski, cfe-commits

Tags: #clang

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

4 years ago[docs][llvm-cxxfilt] Document --no-strip-underscore option
James Henderson [Thu, 30 Apr 2020 09:56:40 +0000 (10:56 +0100)]
[docs][llvm-cxxfilt] Document --no-strip-underscore option

This option was added several months ago in commit e84468c1.

Reviewed by: MaskRay, erik.pilkington, steven_wu

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

4 years ago[AMDGPU] Remove unnecessary s_waitcnt between VMEM loads
Jay Foad [Thu, 30 Apr 2020 09:51:09 +0000 (10:51 +0100)]
[AMDGPU] Remove unnecessary s_waitcnt between VMEM loads

VMEM loads of the same type (sampler vs no sampler) are guaranteed to
write their result registers in order, so there is no need for an
s_waitcnt even if they write to overlapping vgprs.

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

4 years ago[X86] Update type actions for ISD::TRUNCATE with avx512f to be Legal when possible...
Craig Topper [Fri, 1 May 2020 06:23:37 +0000 (23:23 -0700)]
[X86] Update type actions for ISD::TRUNCATE with avx512f to be Legal when possible. NFCI

The Custom handler wasn't doing anything for these cases anyway.

4 years ago[mlir] Add sine operation to Standard dialect.
MaheshRavishankar [Fri, 1 May 2020 04:39:21 +0000 (21:39 -0700)]
[mlir] Add sine operation to Standard dialect.

Also add lowering of sine operation to SPIR-V dialect.

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

4 years ago[mlir][OpBuilder] Remove the vtable from OpBuilder in favor of using the listener...
River Riddle [Fri, 1 May 2020 04:28:36 +0000 (21:28 -0700)]
[mlir][OpBuilder] Remove the vtable from OpBuilder in favor of using the listener pattern

The current OpBuilder has a set of virtual functions required by the fact that the PatternRewriter inherits from it for convenience. The PatternRewriter is required to know about IR mutations for correctness. This revision changes the relationship to be explicit by having users register a listener with the builder instead of using inheritance/vtables. This still requires that users properly transfer the listener when creating new builders, but has several benefits:

* More than one builder can be created during pattern rewrites(assuming that the listener is properly forwarded)
* OpBuilder no longer requires a vtable, and thus does not incur the cost when a listener isn't present.

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

4 years ago[mlir][StandardToSPIRV] Add support for lowering integer casting.
Hanhan Wang [Fri, 1 May 2020 02:29:05 +0000 (19:29 -0700)]
[mlir][StandardToSPIRV] Add support for lowering integer casting.

Summary:
Maps ZeroExtendIOp and TruncateIOp to spirv::UConvertOp and spirv::SConvertOp.

Depends On D78974

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

4 years ago[mlir][StandardToSPIRV] Emulate bitwidths not supported for load op.
Hanhan Wang [Fri, 1 May 2020 02:27:08 +0000 (19:27 -0700)]
[mlir][StandardToSPIRV] Emulate bitwidths not supported for load op.

Summary:
The current implementation in SPIRVTypeConverter just unconditionally turns
everything into 32-bit if it doesn't meet the requirements of extensions or
capabilities. In this case, we can load a 32-bit value and then do bit
extraction to get the value.

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

4 years ago[tests] Revert unhelpful change from d73eed42d1dc
Hubert Tong [Fri, 1 May 2020 02:18:54 +0000 (22:18 -0400)]
[tests] Revert unhelpful change from d73eed42d1dc

4 years ago[tests] Speculative fix for buildbot breakage from c5f7c039efe7
Hubert Tong [Fri, 1 May 2020 02:04:02 +0000 (22:04 -0400)]
[tests] Speculative fix for buildbot breakage from c5f7c039efe7

4 years agoHandle cases for subregisters.
Suyog Sarda [Wed, 31 Jul 2019 06:17:38 +0000 (11:47 +0530)]
Handle cases for subregisters.

While restoring latency, check if any of the registers of
source instruction is a subregister of the successor instructions
apart from being same register.

4 years ago[lit] Don't crash for --time-tests in aborted test run
Julian Lettner [Fri, 1 May 2020 01:15:50 +0000 (18:15 -0700)]
[lit] Don't crash for --time-tests in aborted test run

Properly print the test times histogram even for aborted (user
interrupt, [Ctrl+C]) test runs.

4 years ago[clang] Add vendor identity for Hygon Dhyana processor to cpuid.h
Craig Topper [Fri, 1 May 2020 01:04:25 +0000 (18:04 -0700)]
[clang] Add vendor identity for Hygon Dhyana processor to cpuid.h

The vendor id is used to determine whether the processor
supports hardware CRC32 in the Scudo code. The previous
discussion about the patch is in [1], and more information
about Hygon Dhyana processor is in[2].

[1]: https://reviews.llvm.org/D62368
[2]: https://git.kernel.org/torvalds/c/c9661c1e80b609cd038db7c908e061f0535804ef

Patch by fanjinke (Jinke Fan)

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

4 years ago[lit] Add EXCLUDED test result category
Julian Lettner [Mon, 13 Apr 2020 20:01:46 +0000 (13:01 -0700)]
[lit] Add EXCLUDED test result category

Track and print the number of tests that were discovered but not
executed due to test selection options:
  * --filter (regex filter)
  * --max-tests (limits number of tests)
  * sharding feature

With this change all discovered tests are accounted for: every
discovered test is included in one of the counts printed in the summary.

Reviewed By: jdenny

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

4 years ago[MC][Target][XCOFF] Consolidate MCAsmInfo XCOFF defaults; NFC
Hubert Tong [Fri, 1 May 2020 00:44:04 +0000 (20:44 -0400)]
[MC][Target][XCOFF] Consolidate MCAsmInfo XCOFF defaults; NFC

The setting of `MCAsmInfo` properties for XCOFF got split between
`MCAsmInfoXCOFF` and `PPCXCOFFMCAsmInfo`. Except for the properties that
are dependent on the target information being passed via the
constructor, the properties being set in `PPCXCOFFMCAsmInfo` had no
fundamental reason for being treated as specific for XCOFF on PowerPC.
Indeed, the property that might be considered more specific to PowerPC,
`NeedsFunctionDescriptors`, was set in `MCAsmInfoXCOFF`.

XCOFF being specific to PowerPC anyway, this patch consolidates the
setting of the properties into `MCAsmInfoXCOFF` except for the cases
that are dependent on the information provided via the
`PPCXCOFFMCAsmInfo` constructor.

This patch also reorders the assignments to the fields to match the
declaration order in `MCAsmInfo`.

4 years ago[XCOFF] Clean-up enum use in BinaryFormat/XCOFF.h; NFC
Hubert Tong [Fri, 1 May 2020 00:40:53 +0000 (20:40 -0400)]
[XCOFF] Clean-up enum use in BinaryFormat/XCOFF.h; NFC

Summary:
This patch splits mostly unrelated size constants into separate
constexpr variables, sets explicit underlying types for the enumerations
to match the fields they are used for, and improves various comments.

This patch also replaces `<cname>` headers with `<name.h>` headers to
match the usage of the declared names as global namespace members in the
file.

Reviewers: jasonliu, DiggerLin, daltenty, sfertile

Reviewed By: jasonliu, sfertile

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

4 years ago[X86] Add x, t and g modifiers for inline asm
Craig Topper [Fri, 1 May 2020 00:25:37 +0000 (17:25 -0700)]
[X86] Add x, t and g modifiers for inline asm

This patch adds the x, t and g modifiers for inline asm from GCC. These will print a vector register as xmm*, ymm* or zmm* respectively.

I also fixed register names with modifiers with inteldialect so they are no longer printed with a leading %.

Patch by Amanieu d'Antras

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

4 years ago[NFC] Add include cstdint for SIZE_MAX.
Andrew Browne [Fri, 1 May 2020 00:24:05 +0000 (17:24 -0700)]
[NFC] Add include cstdint for SIZE_MAX.

4 years agoRevert "Revert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems.""
Andrew Browne [Fri, 1 May 2020 00:17:23 +0000 (17:17 -0700)]
Revert "Revert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems.""

This reverts commit ac2635e457d53b80b0a6f73a5041767197643aae.

Revert was too hasty, build was already broken.

4 years ago[X86] Don't return true from isTruncateFree for vectors
Craig Topper [Thu, 30 Apr 2020 23:25:29 +0000 (16:25 -0700)]
[X86] Don't return true from isTruncateFree for vectors

Also fix some cost tables for vXi1 types to match the costs entries for the types they will be promoted to.

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

4 years agoRevert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems."
Andrew Browne [Thu, 30 Apr 2020 23:40:48 +0000 (16:40 -0700)]
Revert "[ADT] Fix SmallVector unused template instantiation on 32-bit systems."

This reverts commit 25e2e92297e21bb4e0acab1b6bb5b2fdd5dc49ad.

Buildbot failure.

4 years ago[ADT] Fix SmallVector unused template instantiation on 32-bit systems.
Andrew Browne [Thu, 30 Apr 2020 22:15:35 +0000 (15:15 -0700)]
[ADT] Fix SmallVector unused template instantiation on 32-bit systems.

Summary:
This was introduced in dda3c19a3618dce94 aka D77621.

The unused template instantiation causes a warning on 32 bit systems
about truncating a uint64_t to 32-bit size_t.

Reviewed By: dblaikie, smeenai

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

4 years agoAdd header guards for header files that should not be included on the PS4 platform.
Douglas Yung [Thu, 30 Apr 2020 23:17:34 +0000 (16:17 -0700)]
Add header guards for header files that should not be included on the PS4 platform.

Reviewers: craig.topper

Reviewed By: craig.topper

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[libcxx][libcxxabi][libunwind] Use libgcc on Android
Shoaib Meenai [Fri, 24 Apr 2020 04:19:11 +0000 (21:19 -0700)]
[libcxx][libcxxabi][libunwind] Use libgcc on Android

Android doesn't have a libgcc_s and uses libgcc instead, so adjust the
build accordingly. This matches compiler-rt's build setup. libc++abi and
libunwind were already checking for libgcc but in a different context.
This change makes them search only for libgcc on Android now, but the
code to link against libgcc if it were present was already there.

Reviewed By: #libc, #libc_abi, #libunwind, rprichard, srhines

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

4 years ago[FIX][libc++][Regex] Using regex_constants match_prev_avail | match_not_bol | match_n...
Diogo Sampaio [Thu, 30 Apr 2020 22:34:01 +0000 (23:34 +0100)]
[FIX][libc++][Regex] Using regex_constants match_prev_avail | match_not_bol | match_not_bow

Summary:
pr42199
When using regex_constants::match_prev_avail, it is defined that
--first is valid, and match_not_bol and match_not_bow should be
ignored. At the moment these flags are not ignored. This fixis that.

Reviewers: ldionne, miyuki, EricWF, mclow.lists, #libc

Reviewed By: ldionne, miyuki, #libc

Subscribers: broadwaylamb, dexonsmith, libcxx-commits

Tags: #libc

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

4 years ago[gn build] Port cfea3dc1021
LLVM GN Syncbot [Thu, 30 Apr 2020 22:15:14 +0000 (22:15 +0000)]
[gn build] Port cfea3dc1021

4 years ago[mlir][nvvm][rocdl] refactor NVVM and ROCDL dialect. NFC.
Wen-Heng (Jack) Chung [Thu, 30 Apr 2020 22:05:28 +0000 (00:05 +0200)]
[mlir][nvvm][rocdl] refactor NVVM and ROCDL dialect. NFC.

- Extract common logic between -convert-gpu-to-nvvm and -convert-gpu-to-rocdl.
- Cope with the fact that alloca operates on different addrspaces between NVVM
  and ROCDL.
- Modernize unit tests for ROCDL dialect.

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

4 years ago[ms] Fix repeated executions of the no-inputs llvm-lib test
Eric Astor [Thu, 30 Apr 2020 22:08:07 +0000 (18:08 -0400)]
[ms] Fix repeated executions of the no-inputs llvm-lib test

`rm` the file, THEN run the command that shouldn't create it, THEN confirm that it doesn't exist