]> granicus.if.org Git - llvm/log
llvm
5 years ago[llvm-objcopy][test] Clean up -B tests
Fangrui Song [Wed, 25 Sep 2019 03:41:01 +0000 (03:41 +0000)]
[llvm-objcopy][test] Clean up -B tests

-B is ignored for GNU objcopy compatibility after D67215/r371914.

* Delete mentions of -B from input-output-target.test - we have enough -B tests.
* Merge binary-input-with-arch.test into binary-output-target.test.

Reviewed By: rupprecht

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372809 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Powerpc][LoopPreIncPrep] NFC - refactor this pass for ds/dq form.
Chen Zheng [Wed, 25 Sep 2019 03:02:19 +0000 (03:02 +0000)]
[Powerpc][LoopPreIncPrep] NFC - refactor this pass for ds/dq form.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372803 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Docs] Moves Reference docs to new page
DeForest Richards [Wed, 25 Sep 2019 00:49:02 +0000 (00:49 +0000)]
[Docs] Moves Reference docs to new page

Moves Reference docs to new page. Also adds a table of contents to Getting Involved page.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372796 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly][NFC] Remove duplicate SIMD instructions and predicates
Thomas Lively [Wed, 25 Sep 2019 00:15:59 +0000 (00:15 +0000)]
[WebAssembly][NFC] Remove duplicate SIMD instructions and predicates

Summary:
Instead of having different v128.load and v128.store instructions for
each MVT, just have one of each that is reused in all the
patterns. Also removes the HasSIMD128 predicate where accompanied by
HasUnimplementedSIMD128, since the latter implies the former.

Reviewers: aheejin, dschuff

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372792 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoUse double quotes for LDFLAGS in -DLLVM_BUILD_INSTRUMENTED_COVERAGE
Justin Bogner [Tue, 24 Sep 2019 23:56:22 +0000 (23:56 +0000)]
Use double quotes for LDFLAGS in -DLLVM_BUILD_INSTRUMENTED_COVERAGE

Mimics the changes in r372209 to handle the change of quotes in
r372226. Probably isn't sufficient for windows, but unbreaks the cmake
flag at least.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372791 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SCEV] Disable canonical expansion for non-affine addrecs.
Artur Pilipenko [Tue, 24 Sep 2019 23:21:07 +0000 (23:21 +0000)]
[SCEV] Disable canonical expansion for non-affine addrecs.

Reviewed By: apilipenko

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

Patch by Evgeniy Brevnov (ybrevnov@azul.com)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372789 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[BPF] Generate array dimension size properly for zero-size elements
Yonghong Song [Tue, 24 Sep 2019 22:38:43 +0000 (22:38 +0000)]
[BPF] Generate array dimension size properly for zero-size elements

Currently, if an array element type size is 0, the number of
array elements will be set to 0, regardless of what user
specified. This implementation is done in the beginning where
BTF is mostly used to calculate the member offset.

For example,
  struct s {};
  struct s1 {
        int b;
        struct s a[2];
  };
  struct s1 s1;
The BTF will have struct "s1" member "a" with element count 0.

Now BTF types are used for compile-once and run-everywhere
relocations and we need more precise type representation
for type comparison. Andrii reported the issue as there
are differences between original structure and BTF-generated
structure.

This patch made the change to correctly assign "2"
as the number elements of member "a".
Some dead codes related to ElemSize compuation are also removed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372785 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAdding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.
Puyan Lotfi [Tue, 24 Sep 2019 22:38:18 +0000 (22:38 +0000)]
Adding support for overriding LLVM_ENABLE_RUNTIMES for runtimes builds.

Second attempt: Now with ';' -> '|' replacement.

On some platforms, certain runtimes are not supported. For runtimes builds of
those platforms it would be nice if we could disable certain runtimes (ie
libunwind on Windows).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372784 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[PGO][PGSO] ProfileSummary changes.
Hiroshi Yamauchi [Tue, 24 Sep 2019 22:17:51 +0000 (22:17 +0000)]
[PGO][PGSO] ProfileSummary changes.

(Split of off D67120)

ProfileSummary changes for profile guided size optimization.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372783 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoExtends the expansion of the LWZtoc pseduo op for AIX.
Sean Fertile [Tue, 24 Sep 2019 18:04:51 +0000 (18:04 +0000)]
Extends the expansion of the LWZtoc pseduo op for AIX.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372772 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GCRelocate] Add a peephole to canonicalize base pointer relocation
Philip Reames [Tue, 24 Sep 2019 17:24:16 +0000 (17:24 +0000)]
[GCRelocate] Add a peephole to canonicalize base pointer relocation

If we generate the gc.relocate, and then later prove two arguments to the statepoint are equivalent, we should canonicalize the gc.relocate to the form we would have produced if this had been known before rewriting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372771 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add MMX MOVD/MOVQ stores to folding tables to support stack folding
Simon Pilgrim [Tue, 24 Sep 2019 16:15:32 +0000 (16:15 +0000)]
[X86] Add MMX MOVD/MOVQ stores to folding tables to support stack folding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372770 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] (a+b) < a && (a+b) != 0 -> (0-b) < a iff a/b != 0 (PR43259)
Roman Lebedev [Tue, 24 Sep 2019 16:10:50 +0000 (16:10 +0000)]
[InstCombine] (a+b) < a && (a+b) != 0 -> (0-b) < a iff a/b != 0 (PR43259)

Summary:
This is again motivated by D67122 sanitizer check enhancement.
That patch seemingly worsens `-fsanitize=pointer-overflow`
overhead from 25% to 50%, which strongly implies missing folds.

For
```
#include <cassert>
char* test(char& base, signed long offset) {
  __builtin_assume(offset < 0);
  return &base + offset;
}
```
We produce

https://godbolt.org/z/r40U47

and again those two icmp's can be merged:
```
Name: 0
Pre: C != 0
  %adjusted = add i8 %base, C
  %not_null = icmp ne i8 %adjusted, 0
  %no_underflow = icmp ult i8 %adjusted, %base
  %r = and i1 %not_null, %no_underflow
=>
  %neg_offset = sub i8 0, C
  %r = icmp ugt i8 %base, %neg_offset
```
https://rise4fun.com/Alive/ALap
https://rise4fun.com/Alive/slnN

There are 3 other variants of this pattern,
i believe they all will go into InstSimplify.

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

Reviewers: spatel, xbolva00, nikic

Reviewed By: spatel

Subscribers: efriedma, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372768 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] (a+b) <= a && (a+b) != 0 -> (0-b) < a (PR43259)
Roman Lebedev [Tue, 24 Sep 2019 16:10:38 +0000 (16:10 +0000)]
[InstCombine] (a+b) <= a && (a+b) != 0 -> (0-b) < a (PR43259)

Summary:
This is again motivated by D67122 sanitizer check enhancement.
That patch seemingly worsens `-fsanitize=pointer-overflow`
overhead from 25% to 50%, which strongly implies missing folds.

This pattern isn't exactly what we get there
(strict vs. non-strict predicate), but this pattern does not
require known-bits analysis, so it is best to handle it first.

```
Name: 0
  %adjusted = add i8 %base, %offset
  %not_null = icmp ne i8 %adjusted, 0
  %no_underflow = icmp ule i8 %adjusted, %base
  %r = and i1 %not_null, %no_underflow
=>
  %neg_offset = sub i8 0, %offset
  %r = icmp ugt i8 %base, %neg_offset
```
https://rise4fun.com/Alive/knp

There are 3 other variants of this pattern,
they all will go into InstSimplify:
https://rise4fun.com/Alive/bIDZ

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

Reviewers: spatel, xbolva00, nikic

Reviewed By: spatel

Subscribers: hiraditya, majnemer, vsk, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372767 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Add tests showing failure to stack fold MMX MOVD/MOVQ stores
Simon Pilgrim [Tue, 24 Sep 2019 15:40:09 +0000 (15:40 +0000)]
[X86] Add tests showing failure to stack fold MMX MOVD/MOVQ stores

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372766 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TextAPI] Remove redundant checking causing warnings. NFC.
Michael Liao [Tue, 24 Sep 2019 14:52:13 +0000 (14:52 +0000)]
[TextAPI] Remove redundant checking causing warnings. NFC.

- Minor coding format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372765 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRegex: Make "match" and "sub" const member functions
Thomas Preud'homme [Tue, 24 Sep 2019 14:42:36 +0000 (14:42 +0000)]
Regex: Make "match" and "sub" const member functions

Summary:
The Regex "match" and "sub" member functions were previously not "const"
because they wrote to the "error" member variable. This commit removes
those assignments, and instead assumes that the validity of the regex
is already known after the initial compilation of the regular
expression. As a result, these member functions were possible to make
"const". This makes it easier to do things like pre-compile Regexes
up-front, and makes "match" and "sub" thread-safe. The error status is
now returned as an optional output, which also makes the API of "match"
and "sub" more consistent with each other.

Also, some uses of Regex that could be refactored to be const were made const.

Patch by Nicolas Guillemot

Reviewers: jankratochvil, thopre

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372764 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[yaml2obj/obj2yaml] - Add support for .stack_sizes sections.
George Rimar [Tue, 24 Sep 2019 14:22:37 +0000 (14:22 +0000)]
[yaml2obj/obj2yaml] - Add support for .stack_sizes sections.

.stack_sizes is a SHT_PROGBITS section that contains pairs of
<address (4/8 bytes), stack size (uleb128)>.

This patch teach tools to parse and dump it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372762 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Compiler] Fix LLVM_NODISCARD for GCC
David Bolvansky [Tue, 24 Sep 2019 14:01:14 +0000 (14:01 +0000)]
[Compiler] Fix LLVM_NODISCARD for GCC

Summary:
This branch is currently dead since we don't use C++17.
 #if __cplusplus > 201402L && LLVM_HAS_CPP_ATTRIBUTE(nodiscard)
 #define LLVM_NODISCARD [[nodiscard]]

This branch is Clang-only.
 #elif LLVM_HAS_CPP_ATTRIBUTE(clang::warn_unused_result)
 #define LLVM_NODISCARD [[clang::warn_unused_result]]

While we could use gnu variant  [[gnu::warn_unused_result]], it is not ideal because it works only on functions.
/home/xbolva00/LLVM/llvm/include/llvm/ADT/ArrayRef.h:41:24: warning: â€˜warn_unused_result’ attribute only applies to function types [-Wattributes]

GCC (checked 5,6,7,8) seems to enable [[nodiscard]] even in C++14 mode and does not produce warnings that nodiscard is C++17 feature. but Clang does - but we do not reach it due the code above. So it affects only GCC and does what we want.

Reviewers: jfb, rsmith, echristo, aaron.ballman

Reviewed By: aaron.ballman

Subscribers: MaskRay, dexonsmith

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372761 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoAggressiveAntiDepBreaker - silence static analyzer null dereference warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 13:57:51 +0000 (13:57 +0000)]
AggressiveAntiDepBreaker - silence static analyzer null dereference warning. NFCI.

Assert that we've found the critical path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372759 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSafepointIRVerifier - silence static analyzer dyn_cast<Instruction> null dereference...
Simon Pilgrim [Tue, 24 Sep 2019 13:57:44 +0000 (13:57 +0000)]
SafepointIRVerifier - silence static analyzer dyn_cast<Instruction> null dereference warnings. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<Instruction> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372758 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[COFF] Silence static analyzer null dereference warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 13:57:38 +0000 (13:57 +0000)]
[COFF] Silence static analyzer null dereference warning. NFCI.

Assert that the COFFSymbolRef is correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372757 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert r372333: [DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a targe...
Ilya Biryukov [Tue, 24 Sep 2019 13:48:02 +0000 (13:48 +0000)]
Revert r372333: [DAG][X86] Convert isNegatibleForFree/GetNegatedExpression to a target hook (PR42863)

Reason: this caused severe compile time regressions in JAX.
See email thread  of original revision on llvm-commits for details:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20190923/697042.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372756 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs][llvm-strip][llvm-objcopy] Improve wording and fix highlighting
James Henderson [Tue, 24 Sep 2019 13:41:39 +0000 (13:41 +0000)]
[docs][llvm-strip][llvm-objcopy] Improve wording and fix highlighting

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372754 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[docs][llvm-size] Fix typo
James Henderson [Tue, 24 Sep 2019 13:14:22 +0000 (13:14 +0000)]
[docs][llvm-size] Fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372750 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Orc] Silence static analyzer dyn_cast<ConstantInt> null dereference warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 12:43:55 +0000 (12:43 +0000)]
[Orc] Silence static analyzer dyn_cast<ConstantInt> null dereference warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372746 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-objcopy] Fix a warningon unused variable. NFC.
Michael Liao [Tue, 24 Sep 2019 12:43:44 +0000 (12:43 +0000)]
[llvm-objcopy] Fix a warningon unused variable. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372745 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoConstantFold - silence static analyzer dyn_cast<> null dereference warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 12:30:13 +0000 (12:30 +0000)]
ConstantFold - silence static analyzer dyn_cast<> null dereference warning. NFCI.

Early out if the vector element is not Constant.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372743 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix cppcheck "reduce variable scope" warning. NFCI.
Simon Pilgrim [Tue, 24 Sep 2019 12:30:07 +0000 (12:30 +0000)]
Fix cppcheck "reduce variable scope" warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372742 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IR] IntrinsicInst - silence static analyzer dyn_cast<> null dereference warnings...
Simon Pilgrim [Tue, 24 Sep 2019 11:40:45 +0000 (11:40 +0000)]
[IR] IntrinsicInst - silence static analyzer dyn_cast<> null dereference warnings. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372733 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoLoopVectorize - silence static analyzer dyn_cast<CmpInst> null dereference warning...
Simon Pilgrim [Tue, 24 Sep 2019 11:27:38 +0000 (11:27 +0000)]
LoopVectorize - silence static analyzer dyn_cast<CmpInst> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<CmpInst> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372732 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[tblgen] Disable Leak detection for ASan/GCC and LSan/LLVM
Kamil Rytarowski [Tue, 24 Sep 2019 11:22:34 +0000 (11:22 +0000)]
[tblgen] Disable Leak detection for ASan/GCC and LSan/LLVM

Summary: Add support for sanitizing TableGen.cpp with ASan/GCC and LSan/LLVM.

Reviewers: fjricci, kcc, aaron.ballman, mgorny

Reviewed By: fjricci

Subscribers: jakubjelinek, llvm-commits, #llvm

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372731 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SimplifyCFG] FoldTwoEntryPHINode - silence static analyzer null dereference warning...
Simon Pilgrim [Tue, 24 Sep 2019 11:17:20 +0000 (11:17 +0000)]
[SimplifyCFG] FoldTwoEntryPHINode - silence static analyzer null dereference warning. NFCI.

Assert that we've found the DomBlock.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372728 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSimplifyCFG - silence static analyzer dyn_cast<LandingPadInst> null dereference warni...
Simon Pilgrim [Tue, 24 Sep 2019 11:17:13 +0000 (11:17 +0000)]
SimplifyCFG - silence static analyzer dyn_cast<LandingPadInst> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<LandingPadInst> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372727 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoSimplifyCFG - silence static analyzer dyn_cast<Instruction> null dereference warning...
Simon Pilgrim [Tue, 24 Sep 2019 11:17:06 +0000 (11:17 +0000)]
SimplifyCFG - silence static analyzer dyn_cast<Instruction> null dereference warning. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<Instruction> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372726 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ModuloSchedule] KernelRewriter::rewrite - silence static analyzer dyn_cast<> null...
Simon Pilgrim [Tue, 24 Sep 2019 10:58:42 +0000 (10:58 +0000)]
[ModuloSchedule] KernelRewriter::rewrite - silence static analyzer dyn_cast<> null dereference warning. NFCI.

Assert that we've found the start of the MI schedule list.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372723 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Split large widening MVE loads
David Green [Tue, 24 Sep 2019 10:53:09 +0000 (10:53 +0000)]
[ARM] Split large widening MVE loads

Similar to rL372717, we can force the splitting of extends of vector loads in
MVE, in order to use the better widening loads as opposed to going through
expensive extends. This adds a combine to early-on detect extends of loads and
split the load in two, from where normal legalisation will kick in and we get a
series of widening loads.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372721 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agolowerObjCCall - silence static analyzer dyn_cast<CallInst> null dereference warnings...
Simon Pilgrim [Tue, 24 Sep 2019 10:46:30 +0000 (10:46 +0000)]
lowerObjCCall - silence static analyzer dyn_cast<CallInst> null dereference warnings. NFCI.

The static analyzer is warning about a potential null dereference, but we should be able to use cast<CallInst> directly and if not assert will fire for us.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372720 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] MVE sext and widen/narrow tests from larger types. NFC
David Green [Tue, 24 Sep 2019 10:39:58 +0000 (10:39 +0000)]
[ARM] MVE sext and widen/narrow tests from larger types. NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372719 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM] Split large truncating MVE stores
David Green [Tue, 24 Sep 2019 10:10:41 +0000 (10:10 +0000)]
[ARM] Split large truncating MVE stores

MVE does not have a simple sign extend instruction that can move elements
across lanes. We currently often end up moving each lane into and out of a GPR,
in order to get elements into the correct places. When we have a store of a
trunc (or a extend of a load), we can instead just split the store/load in two,
using the narrowing/widening load/store instructions from each half of the
vector.

This does that for stores. It happens very early in a store combine, so as to
easily detect the truncates. (It would be possible to do this later, but that
would involve looking through a buildvector of extract elements. Not impossible
but this way seemed simpler).

By enabling store combines we also get a vmovdrr combine for free, helping some
other tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372717 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r372712
GN Sync Bot [Tue, 24 Sep 2019 09:43:29 +0000 (09:43 +0000)]
gn build: Merge r372712

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372713 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago [llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.
Seiya Nuta [Tue, 24 Sep 2019 09:38:23 +0000 (09:38 +0000)]
 [llvm-objcopy] Refactor ELF-specific config out to ELFCopyConfig. NFC.

Summary:
This patch splits the command-line parsing into two phases:

First, parse cross-platform options and leave ELF-specific options unparsed.

Second, in the ELF implementation, parse ELF-specific options and construct ELFCopyConfig.

Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich, MaskRay

Reviewed By: alexshap, jhenderson, jakehehrlich, MaskRay

Subscribers: mgorny, emaste, arichardson, jakehehrlich, MaskRay, abrachet, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372712 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoMCRegisterInfo: Merge getLLVMRegNum and getLLVMRegNumFromEH
Pavel Labath [Tue, 24 Sep 2019 09:31:02 +0000 (09:31 +0000)]
MCRegisterInfo: Merge getLLVMRegNum and getLLVMRegNumFromEH

Summary:
The functions different in two ways:
- getLLVMRegNum could return both "eh" and "other" dwarf register
  numbers, while getLLVMRegNumFromEH only returned the "eh" number.
- getLLVMRegNum asserted if the register was not found, while the second
  function returned -1.

The second distinction was pretty important, but it was very hard to
infer that from the function name. Aditionally, for the use case of
dumping dwarf expressions, we needed a function which can work with both
kinds of number, but does not assert.

This patch solves both of these issues by merging the two functions into
one, returning an Optional<unsigned> value. While the same thing could
be achieved by adding an "IsEH" argument to the (renamed)
getLLVMRegNumFromEH function, it seemed better to avoid the confusion of
two functions and put the choice of asserting into the hands of the
caller -- if he checks the Optional value, he can safely process
"untrusted" input, and if he blindly dereferences the Optional, he gets
the assertion.

I've updated all call sites to the new API, choosing between the two
options according to the function they were calling originally, except
that I've updated the usage in DWARFExpression.cpp to use the "safe"
method instead, and added a test case which would have previously
triggered an assertion failure when processing (incorrect?) dwarf
expressions.

Reviewers: dsanders, arsenm, JDevlieghere

Subscribers: wdng, aprantl, javed.absar, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372710 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r372706
GN Sync Bot [Tue, 24 Sep 2019 09:11:31 +0000 (09:11 +0000)]
gn build: Merge r372706

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372707 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.
Alexey Lapshin [Tue, 24 Sep 2019 08:47:03 +0000 (08:47 +0000)]
[Debuginfo] dbg.value points to undef value after Induction Variable Simplification.

Induction Variable Simplification pass does not update dbg.value intrinsic.

Before:

%add = add nuw nsw i32 %ArgIndex.06, 1
call void @llvm.dbg.value(metadata i32 %add, metadata !17, metadata !DIExpression())

After:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 undef, metadata !17, metadata !DIExpression())

There should be:

%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
call void @llvm.dbg.value(metadata i64 %indvars.iv.next, metadata !17, metadata !DIExpression())

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372703 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[LV] Forced vectorization with runtime checks and OptForSize
Sjoerd Meijer [Tue, 24 Sep 2019 08:03:34 +0000 (08:03 +0000)]
[LV] Forced vectorization with runtime checks and OptForSize

When vectorisation is forced with a pragma, we optimise for min size, and we
need to emit runtime memory checks, then allow this code growth and don't run
in an assert like we currently do.

This is the result of D65197 and D66803, and was a use-case not really
considered before. If this now happens, we emit an optimisation remark warning
about the code-size expansion, which can be avoided by not forcing
vectorisation or possibly source-code modifications.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372694 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "[lit] Add -D__clang_analyzer__ to clang_analyze_cc1"
Jan Korous [Tue, 24 Sep 2019 03:20:59 +0000 (03:20 +0000)]
Revert "[lit] Add -D__clang_analyzer__ to clang_analyze_cc1"

This reverts commit 4185460f758b98ea5b898c04c179704756ca8f53.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372686 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[lit] Add -D__clang_analyzer__ to clang_analyze_cc1
Jan Korous [Tue, 24 Sep 2019 01:59:20 +0000 (01:59 +0000)]
[lit] Add -D__clang_analyzer__ to clang_analyze_cc1

Fixup after fbd13570b0d

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372682 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Fold a shifty implementation of clamp-to-allones.
Huihui Zhang [Tue, 24 Sep 2019 00:30:09 +0000 (00:30 +0000)]
[InstCombine] Fold a shifty implementation of clamp-to-allones.

Summary:
Fold
or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X)
into
X s> Y ? -1 : X

https://rise4fun.com/Alive/d8Ab

clamp255 is a common operator in image processing, can be implemented
in a shifty way "(255 - X) >> 31 | X & 255". Fold shift into select
enables more optimization, e.g., vmin generation for ARM target.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Reviewed By: lebedev.ri

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372678 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Fold a shifty implementation of clamp-to-zero.
Huihui Zhang [Tue, 24 Sep 2019 00:15:03 +0000 (00:15 +0000)]
[InstCombine] Fold a shifty implementation of clamp-to-zero.

Summary:
Fold
and(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X)
into
X s> Y ? X : 0

https://rise4fun.com/Alive/lFH

Fold shift into select enables more optimization,
e.g., vmax generation for ARM target.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Reviewed By: lebedev.ri

Subscribers: xbolva00, andreadb, craig.topper, RKSimon, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372676 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[GlobalISel][IRTranslator] Fix switch table lowering to use signed LE not unsigned.
Amara Emerson [Tue, 24 Sep 2019 00:09:23 +0000 (00:09 +0000)]
[GlobalISel][IRTranslator] Fix switch table lowering to use signed LE not unsigned.

We were miscompiling switch value comparisons with the wrong signedness, which
shows up when we have things like switch case values with i1 types, which end up
being legalized incorrectly.

Fixes PR43383

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372675 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[MemorySSA] Update Phi insertion.
Alina Sbirlea [Mon, 23 Sep 2019 23:50:16 +0000 (23:50 +0000)]
[MemorySSA] Update Phi insertion.

Summary:
MemoryPhis may be needed following a Def insertion inthe IDF of all the
new accesses added (phis + potentially a def). Ensure this also  occurs when
only the new MemoryPhis are the defining accesses.

Note: The need for computing IDF here is because of new Phis added with
edges incoming from unreachable code, Phis that had previously been
simplified. The preferred solution is to not reintroduce such Phis.
This patch is the needed fix while working on the preferred solution.

Reviewers: george.burgess.iv

Subscribers: Prazek, sanjoy.google, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372673 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[NFC][InstCombine] Add tests for shifty implementation of clamping.
Huihui Zhang [Mon, 23 Sep 2019 23:48:32 +0000 (23:48 +0000)]
[NFC][InstCombine] Add tests for shifty implementation of clamping.

Summary:
Clamp negative to zero and clamp positive to allOnes are common
operation in image saturation.

Add tests for shifty implementation of clamping, as prepare work for
folding:

and(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) --> X s> 0 ? X : 0;

or(ashr(subNSW(Y, X), ScalarSizeInBits(Y)-1), X) --> X s> Y ? allOnes : X.

Reviewers: lebedev.ri, efriedma, spatel, kparzysz, bcahoon

Subscribers: llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372671 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoHotColdSplitting: invalidate the AssumptionCache on split
Saleem Abdulrasool [Mon, 23 Sep 2019 22:23:01 +0000 (22:23 +0000)]
HotColdSplitting: invalidate the AssumptionCache on split

When a cold path is outlined, the value tracking in the assumption cache may be
invalidated due to the code motion.  We would previously trip an assertion in
subsequent passes (but required the passes to happen in a single run as the
assumption cache is shared across the passes).  Invalidating the cache ensures
that we get the correct information when needed with the legacy pass manager as
well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372667 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-lipo] Add support for archives
Alexander Shaposhnikov [Mon, 23 Sep 2019 22:22:55 +0000 (22:22 +0000)]
[llvm-lipo] Add support for archives

Add support for creating universal binaries which
can contain an archive.

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

Test plan: make check-all

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372666 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SampleFDO] Treat names in profile as not cold only when profile symbol list
Wei Mi [Mon, 23 Sep 2019 22:11:35 +0000 (22:11 +0000)]
[SampleFDO] Treat names in profile as not cold only when profile symbol list
is available

In rL372232, we treated names showing up in profile as not cold when
profile-sample-accurate is enabled. This caused 70k size regression in
Chrome/Android. The patch put a guard and only enable the change when
profile symbol list is available, i.e., keep the old behavior when profile
symbol list is not available.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372665 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFix uninitialized variable warning. NFCI.
Simon Pilgrim [Mon, 23 Sep 2019 21:32:38 +0000 (21:32 +0000)]
Fix uninitialized variable warning. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372662 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Reduce the number of unique check prefixes in memset-nonzero.ll. NFC
Craig Topper [Mon, 23 Sep 2019 21:29:28 +0000 (21:29 +0000)]
[X86] Reduce the number of unique check prefixes in memset-nonzero.ll. NFC

The avx512 with prefer-256-bit generates the same code as AVX2 so
just reuse that prefix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372661 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] vNxM.load_splat instructions
Thomas Lively [Mon, 23 Sep 2019 20:42:12 +0000 (20:42 +0000)]
[WebAssembly] vNxM.load_splat instructions

Summary:
Adds the new load_splat instructions as specified at
https://github.com/WebAssembly/simd/blob/master/proposals/simd/SIMD.md#load-and-splat.

DAGISel does not allow matching multiple copies of the same load in a
single pattern, so we use a new node in WebAssemblyISD to wrap loads
that should be splatted.

Depends on D67783.

Reviewers: aheejin

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372655 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] foldOrOfICmps(): Acquire SimplifyQuery with set CxtI
Roman Lebedev [Mon, 23 Sep 2019 20:40:47 +0000 (20:40 +0000)]
[InstCombine] foldOrOfICmps(): Acquire SimplifyQuery with set CxtI

Extracted from https://reviews.llvm.org/D67849#inline-610377

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372654 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] foldAndOfICmps(): Acquire SimplifyQuery with set CxtI
Roman Lebedev [Mon, 23 Sep 2019 20:40:40 +0000 (20:40 +0000)]
[InstCombine] foldAndOfICmps(): Acquire SimplifyQuery with set CxtI

Extracted from https://reviews.llvm.org/D67849#inline-610377

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372653 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[WebAssembly] Remove unused memory instructions and patterns
Thomas Lively [Mon, 23 Sep 2019 20:04:59 +0000 (20:04 +0000)]
[WebAssembly] Remove unused memory instructions and patterns

Summary:
Removes duplicated SIMD loads and store instructions and removes
patterns involving GlobalAddresses that were not used in any tests.

Reviewers: aheejin, sunfish

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

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372648 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] Annotate strndup calls with dereferenceable_or_null
David Bolvansky [Mon, 23 Sep 2019 19:55:45 +0000 (19:55 +0000)]
[InstCombine] Annotate strndup calls with dereferenceable_or_null

"Implementations are free to malloc() a buffer containing either (size + 1) bytes or (strnlen(s, size) + 1) bytes. Applications should not assume that strndup() will allocate (size + 1) bytes when strlen(s) is smaller than size."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372647 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[X86] Use TargetConstant for condition code on X86ISD::SETCC/CMOV/BRCOND nodes.
Craig Topper [Mon, 23 Sep 2019 19:48:20 +0000 (19:48 +0000)]
[X86] Use TargetConstant for condition code on X86ISD::SETCC/CMOV/BRCOND nodes.

This removes the need for ConvertToTarget opcodes in the isel table.
It's also consistent with the recent changes to use TargetConstant
for intrinsic nodes that always take immediates.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372645 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TableGen] Emit OperandType enums for RegisterOperands/RegisterClasses
Aditya Nandakumar [Mon, 23 Sep 2019 18:51:00 +0000 (18:51 +0000)]
[TableGen] Emit OperandType enums for RegisterOperands/RegisterClasses

https://reviews.llvm.org/D66773

The OpTypes::OperandType was creating an enum for all records that
inherit from Operand, but in reality there are operands for instructions
that inherit from other types too. In particular, RegisterOperand and
RegisterClass. This commit adds those types to the list of operand types
that are tracked by the OperandType enum.

Patch by: nlguillemot

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372641 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[IR] Add getExtendedType() to IntegerType and Type (dispatching to IntegerType or...
Roman Lebedev [Mon, 23 Sep 2019 18:21:33 +0000 (18:21 +0000)]
[IR] Add getExtendedType() to IntegerType and Type (dispatching to IntegerType or VectorType)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372638 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): improve comment
Roman Lebedev [Mon, 23 Sep 2019 18:21:14 +0000 (18:21 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): improve comment

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372637 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLC] Convert some strndup calls to strdup calls
David Bolvansky [Mon, 23 Sep 2019 18:20:01 +0000 (18:20 +0000)]
[SLC] Convert some strndup calls to strdup calls

Summary:
Motivation:
- If we can fold it to strdup, we should (strndup does more things than strdup).
- Annotation mechanism. (Works for strdup well).

strdup and strndup are part of C 20 (currently posix fns), so we should optimize them.

Reviewers: efriedma, jdoerfert

Reviewed By: jdoerfert

Subscribers: lebedev.ri, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372636 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563)
Roman Lebedev [Mon, 23 Sep 2019 17:04:28 +0000 (17:04 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. c/d/e with mask (PR42563)

Summary:
If we have a pattern `(x & (-1 >> maskNbits)) << shiftNbits`,
we already know (have a fold) that will drop the `& (-1 >> maskNbits)`
mask iff `(shiftNbits-maskNbits) s>= 0` (i.e. `shiftNbits u>= maskNbits`).

So even if `(shiftNbits-maskNbits) s< 0`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: c, normal+mask
  %t0 = lshr i32 -1, C1
  %t1 = and i32 %t0, %x
  %r = shl i32 %t1, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = i32 ((-(C2-C1))+32)
  %n2 = zext i32 %n1 to i64
  %n3 = lshr i64 -1, %n2
  %n4 = trunc i64 %n3 to i32
  %r = and i32 %n0, %n4
```
https://rise4fun.com/Alive/gslRa

Naturally, old `%masked` will have to be one-use.
This is not valid for pattern f - where "masking" is done via `ashr`.

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

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372630 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563)
Roman Lebedev [Mon, 23 Sep 2019 17:04:14 +0000 (17:04 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): pat. a/b with mask (PR42563)

Summary:
And this is **finally** the interesting part of that fold!

If we have a pattern `(x & (~(-1 << maskNbits))) << shiftNbits`,
we already know (have a fold) that will drop the `& (~(-1 << maskNbits))`
mask iff `(maskNbits+shiftNbits) u>= bitwidth(x)`.
But that is actually ignorant, there's more general fold here:

In this pattern, `(maskNbits+shiftNbits)` actually correlates
with the number of low bits that will remain in the final value.
So even if `(maskNbits+shiftNbits) u< bitwidth(x)`, we can still
fold, we will just need to apply a **constant** mask afterwards:
```
Name: a, normal+mask
  %onebit = shl i32 -1, C1
  %mask = xor i32 %onebit, -1
  %masked = and i32 %mask, %x
  %r = shl i32 %masked, C2
=>
  %n0 = shl i32 %x, C2
  %n1 = add i32 C1, C2
  %n2 = zext i32 %n1 to i64
  %n3 = shl i64 -1, %n2
  %n4 = xor i64 %n3, -1
  %n5 = trunc i64 %n4 to i32
  %r = and i32 %n0, %n5
```
https://rise4fun.com/Alive/F5R

Naturally, old `%masked` will have to be one-use.
Similar fold exists for patterns c,d,e, will post patch later.

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

Reviewers: spatel, nikic, xbolva00

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372629 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[BreakFalseDeps] ignore function with minsize attribute
Sanjay Patel [Mon, 23 Sep 2019 17:01:01 +0000 (17:01 +0000)]
[BreakFalseDeps] ignore function with minsize attribute

This came up in the x86-specific:
https://bugs.llvm.org/show_bug.cgi?id=43239
...but it is a general problem for the BreakFalseDeps pass.
Dependencies may be broken by adding some other instruction,
so that should be avoided if the overall goal is to minimize size.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372628 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAdd...
Alexey Bataev [Mon, 23 Sep 2019 16:25:03 +0000 (16:25 +0000)]
[SLP] Fix for PR31847: Assertion failed: (isLoopInvariant(Operands[i], L) && "SCEVAddRecExpr operand is not loop-invariant!")

Summary:
Initially SLP vectorizer replaced all going-to-be-vectorized
instructions with Undef values. It may break ScalarEvaluation and may
cause a crash.
Reworked SLP vectorizer so that it does not replace vectorized
instructions by UndefValue anymore. Instead vectorized instructions are
marked for deletion inside if BoUpSLP class and deleted upon class
destruction.

Reviewers: mzolotukhin, mkuper, hfinkel, RKSimon, davide, spatel

Subscribers: RKSimon, Gerolf, anemet, hans, majnemer, llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372626 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/
Roman Lebedev [Mon, 23 Sep 2019 16:04:32 +0000 (16:04 +0000)]
[InstCombine] foldUnsignedUnderflowCheck(): s/Subtracted/ZeroCmpOp/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372625 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AMDGPU][MC] Corrected handling of relocatable expressions
Dmitry Preobrazhensky [Mon, 23 Sep 2019 15:41:51 +0000 (15:41 +0000)]
[AMDGPU][MC] Corrected handling of relocatable expressions

See bug 43359: https://bugs.llvm.org//show_bug.cgi?id=43359

Reviewers: rampitec

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372622 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoHexagonLoopIdiomRecognition - silence static analyzer dyn_cast<> null dereference...
Simon Pilgrim [Mon, 23 Sep 2019 15:36:24 +0000 (15:36 +0000)]
HexagonLoopIdiomRecognition - silence static analyzer dyn_cast<> null dereference warnings. NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372619 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[TextAPI] Add New Supported Platforms
Cyndy Ishida [Mon, 23 Sep 2019 15:28:02 +0000 (15:28 +0000)]
[TextAPI] Add New Supported Platforms

Summary: This patch introduces simulators, as well was the restriced zippered and macCatalyst to supported platforms

Reviewers: ributzka, steven_wu

Reviewed By: ributzka

Subscribers: hiraditya, dexonsmith, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372618 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Hexagon] Bitcast v4i16 to v8i8, unify no-op casts between scalar and HVX
Krzysztof Parzyszek [Mon, 23 Sep 2019 14:33:27 +0000 (14:33 +0000)]
[Hexagon] Bitcast v4i16 to v8i8, unify no-op casts between scalar and HVX

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372616 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Alignment][NFC] Migrate Instructions to Align
Guillaume Chatelet [Mon, 23 Sep 2019 14:23:37 +0000 (14:23 +0000)]
[Alignment][NFC] Migrate Instructions to Align

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372613 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library
Simon Pilgrim [Mon, 23 Sep 2019 14:11:48 +0000 (14:11 +0000)]
[llvm] [cmake] Add possibility to use ChooseMSVCCRT.cmake when include LLVM library

Modify LLVMConfig to produce LLVM_USE_CRT variables in build-directory. It helps to set the same compiler debug options like in builded library.

Committed on behalf of @igorban (Igor)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372610 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[x86] fix assert with horizontal math + broadcast of vector (PR43402)
Sanjay Patel [Mon, 23 Sep 2019 13:30:23 +0000 (13:30 +0000)]
[x86] fix assert with horizontal math + broadcast of vector (PR43402)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372606 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ValueTracking] Remove unused matchSelectPattern optional argument. NFCI.
Simon Pilgrim [Mon, 23 Sep 2019 13:20:47 +0000 (13:20 +0000)]
[ValueTracking] Remove unused matchSelectPattern optional argument. NFCI.

The matchSelectPattern const wrapper is never explicitly called with the optional Instruction::CastOps argument, and it turns out that it wasn't being forwarded to matchSelectPattern anyway!

Noticed while investigating clang static analyzer warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372604 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ValueTracking] Fix uninitialized variable warnings in matchSelectPattern const wrapp...
Simon Pilgrim [Mon, 23 Sep 2019 13:15:52 +0000 (13:15 +0000)]
[ValueTracking] Fix uninitialized variable warnings in matchSelectPattern const wrapper. NFCI.

Static analyzer complains about const_cast uninitialized variables, we should explicitly set these to null.

Ideally that const wrapper would go away though.......

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372603 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agollvm-undname: Add support for demangling typeinfo names
Nico Weber [Mon, 23 Sep 2019 13:13:37 +0000 (13:13 +0000)]
llvm-undname: Add support for demangling typeinfo names

typeinfo names aren't symbols but string constant contents
stored in compiler-generated typeinfo objects, but llvm-cxxfilt
can demangle these for Itanium names.

In the MSVC ABI, these are just a '.' followed by a mangled
type -- this means they don't start with '?' like all MS-mangled
symbols do.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372602 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCosmetic; don't use the magic constant 35 when HASH is more readable. This matches...
Mark Murray [Mon, 23 Sep 2019 12:52:42 +0000 (12:52 +0000)]
Cosmetic; don't use the magic constant 35 when HASH is more readable. This matches other MCK__<THING>_* usage better.

Summary: No functional change. This fixes a magic constant in MCK__*_... macros only.

Reviewers: ostannard

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372599 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoFunction::BuildLazyArguments() - fix "variable used but never read" analyzer warning...
Simon Pilgrim [Mon, 23 Sep 2019 12:49:39 +0000 (12:49 +0000)]
Function::BuildLazyArguments() - fix "variable used but never read" analyzer warning. NFCI.

Simplify the code by separating the masking of the SDC variable from using it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372598 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r372595
GN Sync Bot [Mon, 23 Sep 2019 12:44:45 +0000 (12:44 +0000)]
gn build: Merge r372595

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372597 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Alignment][NFC] DataLayout migration to llvm::Align
Guillaume Chatelet [Mon, 23 Sep 2019 12:41:36 +0000 (12:41 +0000)]
[Alignment][NFC] DataLayout migration to llvm::Align

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: jholewinski, hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372596 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Alignment] Get DataLayout::StackAlignment as Align
Guillaume Chatelet [Mon, 23 Sep 2019 12:01:32 +0000 (12:01 +0000)]
[Alignment] Get DataLayout::StackAlignment as Align

Summary:
Internally it is needed to know if StackAlignment is set but we can
expose it as llvm::Align.

This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372585 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoLocalizer - fix "variable used but never read" analyzer warning. NFCI.
Simon Pilgrim [Mon, 23 Sep 2019 11:38:10 +0000 (11:38 +0000)]
Localizer - fix "variable used but never read" analyzer warning. NFCI.

Simplify the code by separating the modification of the Changed variable from returning it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372583 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoTargetInstrInfo::getStackSlotRange - fix "variable used but never read" analyzer...
Simon Pilgrim [Mon, 23 Sep 2019 11:36:24 +0000 (11:36 +0000)]
TargetInstrInfo::getStackSlotRange - fix "variable used but never read" analyzer warning. NFCI.

We don't need to divide the BitSize local variable at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372582 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agogn build: Merge r372564
GN Sync Bot [Mon, 23 Sep 2019 11:08:25 +0000 (11:08 +0000)]
gn build: Merge r372564

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372581 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoRevert "Reland "[utils] Implement the llvm-locstats tool""
Djordje Todorovic [Mon, 23 Sep 2019 11:04:11 +0000 (11:04 +0000)]
Revert "Reland "[utils] Implement the llvm-locstats tool""

This reverts commit rL372554.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372580 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj] - Stop treating ".stack_sizes.*" sections as stack sizes sections.
George Rimar [Mon, 23 Sep 2019 10:43:09 +0000 (10:43 +0000)]
[llvm-readobj] - Stop treating ".stack_sizes.*" sections as stack sizes sections.

llvm-readobj currently handles .stack_sizes.* (e.g. .stack_sizes.foo)
as a normal stack sizes section. Though MC does not produce sections with
such names. Also, linkers do not combine .stack_sizes.* into .stack_sizes.

A mini discussion about this correctness issue is here: https://reviews.llvm.org/D67757#inline-609274
This patch changes implementation so that only now only '.stack_sizes' name is
accepted as a real stack sizes section.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372578 91177308-0d34-0410-b5e6-96231b3b80d8

5 years agoCriticalAntiDepBreaker - Assert that we've found the bottom of the critical path...
Simon Pilgrim [Mon, 23 Sep 2019 10:42:47 +0000 (10:42 +0000)]
CriticalAntiDepBreaker - Assert that we've found the bottom of the critical path. NFCI.

Silences static analyzer null dereference warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372577 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[llvm-readobj] - Implement LLVM-style dumping for .stack_sizes sections.
George Rimar [Mon, 23 Sep 2019 10:33:19 +0000 (10:33 +0000)]
[llvm-readobj] - Implement LLVM-style dumping for .stack_sizes sections.

D65313 implemented GNU-style dumping (llvm-readelf).
This one implements LLVM-style dumping (llvm-readobj).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372576 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[FunctionAttrs] Enable nonnull arg propagation
David Bolvansky [Mon, 23 Sep 2019 09:58:02 +0000 (09:58 +0000)]
[FunctionAttrs] Enable nonnull arg propagation

Enable flag introduced in rL294998. Security concerns are no longer valid, since function signatures for mentioned libc functions has no nonnull attribute (Clang does not generate them? I see no nonnull attr in LLVM IR for these functions) and since rL372091 we carefully annotate the callsites where we know that size is static, non zero. So let's enable this flag again..

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372573 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM][MVE] Remove old tail predicates
Sam Parker [Mon, 23 Sep 2019 09:48:25 +0000 (09:48 +0000)]
[ARM][MVE] Remove old tail predicates

Remove any predicate that we replace with a vctp intrinsic, and try
to remove their operands too. Also look into the exit block to see if
there's any duplicates of the predicates that we've replaced and
clone the vctp to be used there instead.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372567 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[AArch64] support neon_sshl and neon_ushl in performIntrinsicCombine.
Florian Hahn [Mon, 23 Sep 2019 09:38:53 +0000 (09:38 +0000)]
[AArch64] support neon_sshl and neon_ushl in performIntrinsicCombine.

Try to generate ushll/sshll for aarch64_neon_ushl/aarch64_neon_sshl,
if their first operand is extended and the second operand is a constant

Also adds a few tests marked with FIXME, where we can further increase
codegen.

Reviewers: t.p.northover, samparker, dmgreen, anemet

Reviewed By: anemet

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372565 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[ARM][LowOverheadLoops] Use subs during revert.
Sam Parker [Mon, 23 Sep 2019 08:57:50 +0000 (08:57 +0000)]
[ARM][LowOverheadLoops] Use subs during revert.

Check whether there are any uses or defs between the LoopDec and
LoopEnd. If there's not, then we can use a subs to set the cpsr and
skip generating a cmp.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372560 91177308-0d34-0410-b5e6-96231b3b80d8

5 years ago[Alignment][NFC] Switch DataLayout private members to llvm::Align
Guillaume Chatelet [Mon, 23 Sep 2019 08:38:36 +0000 (08:38 +0000)]
[Alignment][NFC] Switch DataLayout private members to llvm::Align

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@372558 91177308-0d34-0410-b5e6-96231b3b80d8