platform/upstream/llvm.git
5 years agoRevert "[CodeGen] [SelectionDAG] More efficient code for X % C == 0 (UREM case) ...
Roman Lebedev [Thu, 27 Jun 2019 17:22:31 +0000 (17:22 +0000)]
Revert "[CodeGen] [SelectionDAG] More efficient code for X % C == 0 (UREM case) (try 2)"

*Appears* to break test-suite on
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/23790

FAIL: burg.execution_time
FAIL: spiff.execution_time
FAIL: employ.execution_time
FAIL: llu.execution_time
FAIL: gramschmidt.execution_time
FAIL: fdtd-apml.execution_time

This reverts commit r364563.

llvm-svn: 364568

5 years agoFix lld build on Windows with MSVC due to C2461
Michael Liao [Thu, 27 Jun 2019 17:19:28 +0000 (17:19 +0000)]
Fix lld build on Windows with MSVC due to C2461

- It seems the same name of class and one of its fields confuses MSVC,
  https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2461?view=vs-2019
- Patch from Andryeyev, German <german.andryeyev@amd.com>

llvm-svn: 364567

5 years agoAMDGPU: Make fixing i1 copies robust against re-ordering
Nicolai Haehnle [Thu, 27 Jun 2019 16:56:44 +0000 (16:56 +0000)]
AMDGPU: Make fixing i1 copies robust against re-ordering

Summary:
The new test case led to incorrect code.

Change-Id: Ief48b227e97aa662dd3535c9bafb27d4a184efca

Reviewers: arsenm, david-salinas

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

llvm-svn: 364566

5 years ago[ARM] Move low overhead loop codegen tests into a separate file. NFC
David Green [Thu, 27 Jun 2019 16:56:41 +0000 (16:56 +0000)]
[ARM] Move low overhead loop codegen tests into a separate file. NFC

llvm-svn: 364565

5 years agoUse getConstantOperandAPInt instead of getConstantOperandVal for comparisons.
Simon Pilgrim [Thu, 27 Jun 2019 16:46:00 +0000 (16:46 +0000)]
Use getConstantOperandAPInt instead of getConstantOperandVal for comparisons.

getConstantOperandAPInt avoids any large integer issues - these are unlikely but the fuzzers do like to mess around.....

llvm-svn: 364564

5 years ago[CodeGen] [SelectionDAG] More efficient code for X % C == 0 (UREM case) (try 2)
Roman Lebedev [Thu, 27 Jun 2019 16:45:42 +0000 (16:45 +0000)]
[CodeGen] [SelectionDAG] More efficient code for X % C == 0 (UREM case) (try 2)

Summary:
I'm submitting a new revision since i don't understand how to reclaim/reopen/take over the existing one, D50222.
There is no such action in "Add Action" menu...
Original patch D50222 by @hermord (Dmytro Shynkevych)

This implements an optimization described in Hacker's Delight 10-17: when `C` is constant,
the result of `X % C == 0` can be computed more cheaply without actually calculating the remainder.
The motivation is discussed here: https://bugs.llvm.org/show_bug.cgi?id=35479.

Original patch author: @hermord (Dmytro Shynkevych)!

Notes:
- In principle, it's possible to also handle the `X % C1 == C2` case, as discussed on bugzilla.
  This seems to require an extra branch on overflow, so I refrained from implementing this for now.
- An explicit check for when the `REM` can be reduced to just its LHS is included:
  the `X % C` == 0 optimization breaks `test1` in `test/CodeGen/X86/jump_sign.ll` otherwise.
  I hadn't managed to find a better way to not generate worse output in this case.
- The `test/CodeGen/X86/jump_sign.ll` regresses, and is being fixed by a followup patch D63390.

Reviewers: RKSimon, craig.topper, spatel, hermord, xbolva00

Reviewed By: RKSimon, xbolva00

Subscribers: xbolva00, javed.absar, llvm-commits, hermord

Tags: #llvm

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

llvm-svn: 364563

5 years agoAdd a sanity check to the domain socket tests.
Adrian Prantl [Thu, 27 Jun 2019 16:45:23 +0000 (16:45 +0000)]
Add a sanity check to the domain socket tests.

rdar://problem/52062631

llvm-svn: 364562

5 years ago[X86] getTargetVShiftByConstNode - reduce variable scope. NFCI.
Simon Pilgrim [Thu, 27 Jun 2019 16:33:44 +0000 (16:33 +0000)]
[X86] getTargetVShiftByConstNode - reduce variable scope. NFCI.

Fixes cppcheck warning.

llvm-svn: 364561

5 years ago[ARM] Fix formatting issue in ARMISelLowering.cpp
Sam Tebbs [Thu, 27 Jun 2019 16:28:28 +0000 (16:28 +0000)]
[ARM] Fix formatting issue in ARMISelLowering.cpp

Fix a formatting error in ARMISelLowering.cpp::Expand64BitShift. My test
commit after receiving write access.

llvm-svn: 364560

5 years ago[llvm-nm] Fix for BZ41711 - Class character for a symbol with undefined
Chris Jackson [Thu, 27 Jun 2019 16:27:53 +0000 (16:27 +0000)]
[llvm-nm] Fix for BZ41711 - Class character for a symbol with undefined
          binding does not match class assigned by GNU nm

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

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

llvm-svn: 364559

5 years agoRevert Add github lockdown app to auto-close pull requests.
Tom Stellard [Thu, 27 Jun 2019 16:23:26 +0000 (16:23 +0000)]
Revert Add github lockdown app to auto-close pull requests.

This reverts r364358 (git commit b37f2f33916f90279f3ada3941fe6a2f8420f913)

Moving this file to a separate repository https://github.com/llvm/.github,
 so it doesn't pollute the main tree.  It also did not appear to be working.

llvm-svn: 364558

5 years agoRecommit [PowerPC] Update P9 vector costs for insert/extract element
Roland Froese [Thu, 27 Jun 2019 16:20:24 +0000 (16:20 +0000)]
Recommit [PowerPC] Update P9 vector costs for insert/extract element

Recommit patch D60160 after regression fix patch D63463.

llvm-svn: 364557

5 years ago[debug-info] Make a couple of tests more robust.
Paul Robinson [Thu, 27 Jun 2019 15:53:07 +0000 (15:53 +0000)]
[debug-info] Make a couple of tests more robust.

llvm-svn: 364556

5 years ago[Attr] Add "willreturn" function attribute
Johannes Doerfert [Thu, 27 Jun 2019 15:51:40 +0000 (15:51 +0000)]
[Attr] Add "willreturn" function attribute

This patch introduces a new function attribute, willreturn, to indicate
that a call of this function will either exhibit undefined behavior or
comes back and continues execution at a point in the existing call stack
that includes the current invocation.

This attribute guarantees that the function does not have any endless
loops, endless recursion, or terminating functions like abort or exit.

Patch by Hideto Ueno (@uenoku)

Reviewers: jdoerfert

Subscribers: mehdi_amini, hiraditya, steven_wu, dexonsmith, lebedev.ri, llvm-commits

Tags: #llvm

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

llvm-svn: 364555

5 years agoFollowup to revision 364545: Turns out that clang issues different errors for C+...
Marshall Clow [Thu, 27 Jun 2019 15:37:31 +0000 (15:37 +0000)]
Followup to revision 364545: Turns out that clang issues different errors for C++11 vs c++2a, so I tweaked the 'expected-error' bits that I added to match either of them.

llvm-svn: 364554

5 years ago[LiveDebugValues] Emit the debug entry values
Djordje Todorovic [Thu, 27 Jun 2019 15:35:48 +0000 (15:35 +0000)]
[LiveDebugValues] Emit the debug entry values

Emit replacements for clobbered parameters location if the parameter
has unmodified value throughout the funciton. This is basic scenario
where we can use the debug entry values.

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

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

llvm-svn: 364553

5 years ago[docs][llvm-nm][llvm-objdump] Improve "See Also" section
James Henderson [Thu, 27 Jun 2019 15:18:15 +0000 (15:18 +0000)]
[docs][llvm-nm][llvm-objdump] Improve "See Also" section

The "See Also" section for llvm-nm didn't actually contain any links,
and the tools referred to didn't make much sense (referring to non-LLVM
tools, when we have equivalents, or tools that aren't really to do with
symbol dumping). llvm-objdump's didn't refer to llvm-readelf.

Reviewed by: grimar

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

llvm-svn: 364552

5 years ago[clangd] Emit semantic highlighting tokens when the main AST is built.
Johan Vikstrom [Thu, 27 Jun 2019 15:13:03 +0000 (15:13 +0000)]
[clangd] Emit semantic highlighting tokens when the main AST is built.

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

llvm-svn: 364551

5 years agoBitcode: derive all types used from records instead of Values.
Tim Northover [Thu, 27 Jun 2019 14:46:51 +0000 (14:46 +0000)]
Bitcode: derive all types used from records instead of Values.

There is existing bitcode that we need to support where the structured nature
of pointer types is used to derive the result type of some operation. For
example a GEP's operation and result will be based on its input Type.

When pointers become opaque, the BitcodeReader will still have access to this
information because it's explicitly told how to construct the more complex
types used, but this information will not be attached to any Value that gets
looked up. This changes BitcodeReader so that in all places which use type
information in this manner, it's derived from a side-table rather than from the
Value in question.

llvm-svn: 364550

5 years ago[LiveRangeEdit] Fix build failure caused by the rL364536
Djordje Todorovic [Thu, 27 Jun 2019 14:31:52 +0000 (14:31 +0000)]
[LiveRangeEdit] Fix build failure caused by the rL364536

llvm-svn: 364549

5 years ago[TargetLowering] SimplifyDemandedVectorElts - add shift/rotate support.
Simon Pilgrim [Thu, 27 Jun 2019 14:25:54 +0000 (14:25 +0000)]
[TargetLowering] SimplifyDemandedVectorElts - add shift/rotate support.

llvm-svn: 364548

5 years ago[scudo][standalone] Introduce the C & C++ wrappers [fixed]
Kostya Kortchinsky [Thu, 27 Jun 2019 14:23:26 +0000 (14:23 +0000)]
[scudo][standalone] Introduce the C & C++ wrappers [fixed]

Summary:
This is a redo of D63612.

Two problems came up on some bots:
- `__builtin_umull_overflow` was not declared. This is likely due to an
  older clang or gcc, so add a guard with `__has_builtin` and fallback
  to a division in the event the builtin doesn't exist;
- contradicting definition for `malloc`, etc. This is AFAIU due to the
  fact that we ended up transitively including `stdlib.h` in the `.inc`
  due to it being the flags parser header: so move the include to the
  cc instead.

This should fix the issues, but since those didn't come up in my local
tests it's mostly guesswork.

Rest is the same!

Reviewers: morehouse, hctim, eugenis, vitalybuka, dyung, hans

Reviewed By: morehouse, dyung, hans

Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 364547

5 years ago[InstCombine] remove 'tmp' names and regenerate checks; NFC
Sanjay Patel [Thu, 27 Jun 2019 14:20:10 +0000 (14:20 +0000)]
[InstCombine] remove 'tmp' names and regenerate checks; NFC

llvm-svn: 364546

5 years agoProvide hashers for string_view only if they are using the default char_traits. Seen...
Marshall Clow [Thu, 27 Jun 2019 14:18:32 +0000 (14:18 +0000)]
Provide hashers for string_view only if they are using the default char_traits. Seen on SO: test/std/strings/string.view/string.view.hash/char_type.hash.fail.cpp

llvm-svn: 364545

5 years ago[PowerPC][HTM] Fix disassembling buffer overflow for tabortdc and others
Jinsong Ji [Thu, 27 Jun 2019 14:11:31 +0000 (14:11 +0000)]
[PowerPC][HTM] Fix disassembling buffer overflow for tabortdc and others

This was reported in https://bugs.llvm.org/show_bug.cgi?id=41751
llvm-mc aborted when disassembling tabortdc.

This patch try to clean up TM related DAGs.

* Fixes the problem by remove explicit output of cr0, and put it as implicit def.
* Update int_ppc_tbegin pattern to accommodate the implicit def of cr0.
* Update the TCHECK operand and int_ppc_tcheck accordingly.
* Add some builtin test and disassembly tests.
* Remove unused CRRC0/crrc0

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

llvm-svn: 364544

5 years agoRevert r363658 "[SVE][IR] Scalable Vector IR Type with pr42210 fix"
Hans Wennborg [Thu, 27 Jun 2019 13:55:02 +0000 (13:55 +0000)]
Revert r363658 "[SVE][IR] Scalable Vector IR Type with pr42210 fix"

We saw a 70% ThinLTO link time increase in Chromium for Android, see
crbug.com/978817. Sounds like more of PR42210.

> Recommit of D32530 with a few small changes:
>   - Stopped recursively walking through aggregates in
>     the verifier, so that we don't impose too much
>     overhead on large modules under LTO (see PR42210).
>   - Changed tests to match; the errors are slightly
>     different since they only report the array or
>     struct that actually contains a scalable vector,
>     rather than all aggregates which contain one in
>     a nested member.
>   - Corrected an older comment
>
> Reviewers: thakis, rengolin, sdesmalen
>
> Reviewed By: sdesmalen
>
> Differential Revision: https://reviews.llvm.org/D63321

llvm-svn: 364543

5 years ago[DWARF] Handle the DW_OP_entry_value operand
Djordje Todorovic [Thu, 27 Jun 2019 13:52:34 +0000 (13:52 +0000)]
[DWARF] Handle the DW_OP_entry_value operand

Add the IR and the AsmPrinter parts for handling of the DW_OP_entry_values
DWARF operation.

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

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

llvm-svn: 364542

5 years ago[TargetLowering] SimplifyDemandedBits - use DemandedElts to better identify partial...
Simon Pilgrim [Thu, 27 Jun 2019 13:48:43 +0000 (13:48 +0000)]
[TargetLowering] SimplifyDemandedBits - use DemandedElts to better identify partial splat shift amounts

llvm-svn: 364541

5 years ago[mips] Mark pseudo select instructions by the `hasNoSchedulingInfo` tag
Simon Atanasyan [Thu, 27 Jun 2019 13:41:30 +0000 (13:41 +0000)]
[mips] Mark pseudo select instructions by the `hasNoSchedulingInfo` tag

llvm-svn: 364540

5 years ago[mips] Add new items to the list of features unsupported by P5600
Simon Atanasyan [Thu, 27 Jun 2019 13:41:23 +0000 (13:41 +0000)]
[mips] Add new items to the list of features unsupported by P5600

llvm-svn: 364539

5 years ago[docs][tools] Add missing "program" tags to rst files
James Henderson [Thu, 27 Jun 2019 13:24:46 +0000 (13:24 +0000)]
[docs][tools] Add missing "program" tags to rst files

Sphinx allows for definitions of command-line options using
`.. option <name>` and references to those options via `:option:<name>`.
However, it looks like there is no scoping of these options by default,
meaning that links can end up pointing to incorrect documents. See for
example the llvm-mca document, which contains references to -o that,
prior to this patch, pointed to a different document. What's worse is
that these links appear to be non-deterministic in which one is picked
(on my machine, some references end up pointing to opt, whereas on the
live docs, they point to llvm-dwarfdump, for example).

The fix is to add the .. program <name> tag. This essentially namespaces
the options (definitions and references) to the named program, ensuring
that the links are kept correct.

Reviwed by: andreadb

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

llvm-svn: 364538

5 years ago[clangd] Fix a case where we fail to detect a header-declared symbol in rename.
Haojian Wu [Thu, 27 Jun 2019 13:24:10 +0000 (13:24 +0000)]
[clangd] Fix a case where we fail to detect a header-declared symbol in rename.

Summary:
Failing case:

```
 #include "foo.h"
 void fo^o() {}
```

getRenameDecl() returns the decl of the symbol under the cursor (which is
in the current main file), instead, we use the canonical decl to determine
whether a symbol is declared in #included header.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 364537

5 years ago[Backend] Keep call site info valid through the backend
Djordje Todorovic [Thu, 27 Jun 2019 13:10:29 +0000 (13:10 +0000)]
[Backend] Keep call site info valid through the backend

Handle call instruction replacements and deletions in order to preserve
valid state of the call site info of the MachineFunction.

NOTE: If the call site info is enabled for a new target, the assertion from
the MachineFunction::DeleteMachineInstr() should help to locate places
where the updateCallSiteInfo() should be called in order to preserve valid
state of the call site info.

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

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

llvm-svn: 364536

5 years ago[clang-tidy] Fix NDEBUG build [NFC]
Mikael Holmen [Thu, 27 Jun 2019 12:47:57 +0000 (12:47 +0000)]
[clang-tidy] Fix NDEBUG build [NFC]

llvm-svn: 364535

5 years ago[ARM] Fix bogus assertions in copyPhysReg v8.1-M cases.
Simon Tatham [Thu, 27 Jun 2019 12:41:12 +0000 (12:41 +0000)]
[ARM] Fix bogus assertions in copyPhysReg v8.1-M cases.

The code to generate register move instructions in and out of VPR and
FPSCR_NZCV had assertions checking that the other register involved
was a GPR _pair_, instead of a single GPR as it should have been.

Reviewers: miyuki, ostannard

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

Tags: #llvm

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

llvm-svn: 364534

5 years ago[ARM] Fix handling of zero offsets in LOB instructions.
Simon Tatham [Thu, 27 Jun 2019 12:41:07 +0000 (12:41 +0000)]
[ARM] Fix handling of zero offsets in LOB instructions.

The BF and WLS/WLSTP instructions have various branch-offset fields
occupying different positions and lengths in the instruction encoding,
and all of them were decoded at disassembly time by the function
DecodeBFLabelOffset() which returned SoftFail if the offset was zero.

In fact, it's perfectly fine and not even a SoftFail for most of those
offset fields to be zero. The only one that can't be zero is the 4-bit
field labelled `boff` in the architecture spec, occupying bits {26-23}
of the BF instruction family. If that one is zero, the encoding
overlaps other instructions (WLS, DLS, LETP, VCTP), so it ought to be
a full Fail.

Fixed by adding an extra template parameter to DecodeBFLabelOffset
which controls whether a zero offset is accepted or rejected. Adjusted
existing tests (only in error messages for bad disassemblies); added
extra tests to demonstrate zero offsets being accepted in all the
right places, and a few demonstrating rejection of zero `boff`.

Reviewers: DavidSpickett, ostannard

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

Tags: #llvm

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

llvm-svn: 364533

5 years ago[ARM] Make coprocessor number restrictions consistent.
Simon Tatham [Thu, 27 Jun 2019 12:40:55 +0000 (12:40 +0000)]
[ARM] Make coprocessor number restrictions consistent.

Different versions of the Arm architecture disallow the use of generic
coprocessor instructions like MCR and CDP on different sets of
coprocessors. This commit centralises the check of the coprocessor
number so that it's consistent between assembly and disassembly, and
also updates it for the new restrictions in Arm v8.1-M.

New tests added that check all the coprocessor numbers; old tests
updated, where they used a number that's now become illegal in the
context in question.

Reviewers: DavidSpickett, ostannard

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

Tags: #llvm

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

llvm-svn: 364532

5 years ago[ARM] Tighten restrictions on use of SP in v8.1-M CSEL.
Simon Tatham [Thu, 27 Jun 2019 12:40:40 +0000 (12:40 +0000)]
[ARM] Tighten restrictions on use of SP in v8.1-M CSEL.

In the `CSEL Rd,Rm,Rn` instruction family (also including CSINC, CSINV
and CSNEG), the architecture lists it as CONSTRAINED UNPREDICTABLE
(i.e. SoftFail) to use SP in the Rd or Rm slot, but outright illegal
to use it in the Rn slot, not least because some encodings of that
form are used by MVE instructions such as UQRSHLL.

MC was treating all three slots the same, as SoftFail. So the only
reason UQRSHLL was disassembled correctly at all was because the MVE
decode table is separate from the Thumb2 one and takes priority; if
you turned off MVE, then encodings such as `[0x5f,0xea,0x0d,0x83]`
would disassemble as spurious CSELs.

Fixed by inventing another version of the `GPRwithZR` register class,
which disallows SP completely instead of just SoftFailing it.

Reviewers: DavidSpickett, ostannard

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

Tags: #llvm

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

llvm-svn: 364531

5 years ago[X86] getFauxShuffle - add DemandedElts as a filter
Simon Pilgrim [Thu, 27 Jun 2019 12:35:52 +0000 (12:35 +0000)]
[X86] getFauxShuffle - add DemandedElts as a filter

This is currently benign but will be used in the future based on the elements referenced by the parent shuffle(s).

llvm-svn: 364530

5 years ago[LLD][ELF] - Replace invalid-e_shnum.s with YAML based version.
George Rimar [Thu, 27 Jun 2019 12:23:38 +0000 (12:23 +0000)]
[LLD][ELF] - Replace invalid-e_shnum.s with YAML based version.

The previous version used a precompiled binary.

After this patch, we have no more precompiled binaries
in LLD ELF test suite :)

llvm-svn: 364529

5 years ago[clangd] No need to setTraversalScope in SemanticHighlighting.
Haojian Wu [Thu, 27 Jun 2019 12:22:18 +0000 (12:22 +0000)]
[clangd] No need to setTraversalScope in SemanticHighlighting.

Summary:
We have already set it when the AST is being built, and setting TraversalScope
is not free (it will clear the cache, which is expensive to build).

Reviewers: jvikstrom

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

Tags: #clang

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

llvm-svn: 364528

5 years ago[mips] Add GPR_64 predicate to some mov[zn] instructions
Simon Atanasyan [Thu, 27 Jun 2019 12:08:17 +0000 (12:08 +0000)]
[mips] Add GPR_64 predicate to some mov[zn] instructions

llvm-svn: 364527

5 years ago[mips] Fix indentation and split long lines. NFC
Simon Atanasyan [Thu, 27 Jun 2019 12:08:10 +0000 (12:08 +0000)]
[mips] Fix indentation and split long lines. NFC

llvm-svn: 364526

5 years ago[mips] Reformat MSA instruction definitions. NFC
Simon Atanasyan [Thu, 27 Jun 2019 12:08:03 +0000 (12:08 +0000)]
[mips] Reformat MSA instruction definitions. NFC

llvm-svn: 364525

5 years agoAdd triple to a test I just added.
Jeremy Morse [Thu, 27 Jun 2019 11:52:03 +0000 (11:52 +0000)]
Add triple to a test I just added.

llvm-svn: 364524

5 years agoIR: compare type attributes deeply when looking into functions.
Tim Northover [Thu, 27 Jun 2019 11:44:45 +0000 (11:44 +0000)]
IR: compare type attributes deeply when looking into functions.

FunctionComparator attempts to produce a stable comparison of two Function
instances by looking at all available properties. Since ByVal attributes now
contain a Type pointer, they are not trivially ordered and FunctionComparator
should use its own Type comparison logic to sort them.

llvm-svn: 364523

5 years ago[Object/invalid.test] - Convert most of the sub tests to YAML.
George Rimar [Thu, 27 Jun 2019 11:31:43 +0000 (11:31 +0000)]
[Object/invalid.test] - Convert most of the sub tests to YAML.

Object/invalid.test is a test case that is used to check the behavior of tools
when broken inputs are used.

The most often tool tested there is llvm-readobj. I think we might want to move
such tests to test\tools\llvm-readobj. For now this patch converts
many sub-tests to use YAML and removes 12 binaries from the inputs.

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

llvm-svn: 364522

5 years ago[Attributor] Deducing existing nounwind attribute.
Stefan Stipanovic [Thu, 27 Jun 2019 11:27:54 +0000 (11:27 +0000)]
[Attributor] Deducing existing nounwind attribute.

Adding nounwind deduction in new attributor framework.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 364521

5 years ago[X86][SSE] Regenerate v48 shuffle test on a variety of targets
Simon Pilgrim [Thu, 27 Jun 2019 11:22:23 +0000 (11:22 +0000)]
[X86][SSE] Regenerate v48 shuffle test on a variety of targets

llvm-svn: 364520

5 years ago[clangd] Address limitations in SelectionTree:
Sam McCall [Thu, 27 Jun 2019 11:17:13 +0000 (11:17 +0000)]
[clangd] Address limitations in SelectionTree:

Summary:
 - nodes can have special-cased hit ranges including "holes" (FunctionTypeLoc in void foo())
 - token conflicts between siblings (int a,b;) are resolved in favor of left sibling
 - parent/child overlap is handled statefully rather than explicitly by comparing parent/child
   ranges (this lets us share a mechanism with sibling conflicts)

Reviewers: kadircet

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

Tags: #clang

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

llvm-svn: 364519

5 years ago[X86][AVX] SimplifyDemandedVectorElts - combine PERMPD(x) -> EXTRACTF128(X)
Simon Pilgrim [Thu, 27 Jun 2019 11:16:03 +0000 (11:16 +0000)]
[X86][AVX] SimplifyDemandedVectorElts - combine PERMPD(x) -> EXTRACTF128(X)

If we only use the bottom lane, see if we can simplify this to extract_subvector - which is always at least as quick as PERMPD/PERMQ.

llvm-svn: 364518

5 years ago[yaml2obj] - Allow overriding e_shentsize, e_shoff, e_shnum and e_shstrndx fields...
George Rimar [Thu, 27 Jun 2019 11:08:42 +0000 (11:08 +0000)]
[yaml2obj] - Allow overriding e_shentsize, e_shoff, e_shnum and e_shstrndx fields in the YAML.

This allows setting different values for e_shentsize, e_shoff, e_shnum
and e_shstrndx fields and is useful for producing broken inputs for various
test cases.

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

llvm-svn: 364517

5 years ago[ISEL][X86] Tracking of registers that forward call arguments
Djordje Todorovic [Thu, 27 Jun 2019 10:51:15 +0000 (10:51 +0000)]
[ISEL][X86] Tracking of registers that forward call arguments

While lowering calls, collect info about registers that forward arguments
into following function frame. We store such info into the MachineFunction
of the call. This is used very late when dumping DWARF info about
call site parameters.

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

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

llvm-svn: 364516

5 years ago[DebugInfo] Avoid register coalesing unsoundly changing DBG_VALUE locations
Jeremy Morse [Thu, 27 Jun 2019 10:20:27 +0000 (10:20 +0000)]
[DebugInfo] Avoid register coalesing unsoundly changing DBG_VALUE locations

Once MIR code leaves SSA form and the liveness of a vreg is considered,
DBG_VALUE insts are able to refer to non-live vregs, because their
debug-uses do not contribute to liveness. This non-liveness becomes
problematic for optimizations like register coalescing, as they can't
``see'' the debug uses in the liveness analyses.

As a result registers get coalesced regardless of debug uses, and that can
lead to invalid variable locations containing unexpected values. In the
added test case, the first vreg operand of ADD32rr is merged with various
copies of the vreg (great for performance), but a DBG_VALUE of the
unmodified operand is blindly updated to the modified operand. This changes
what value the variable will appear to have in a debugger.

Fix this by changing any DBG_VALUE whose operand will be resurrected by
register coalescing to be a $noreg DBG_VALUE, i.e. give the variable no
location. This is an overapproximation as some coalesced locations are
safe (others are not) -- an extra domination analysis would be required to
work out which, and it would be better if we just don't generate non-live
DBG_VALUEs.

This fixes PR40010.

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

llvm-svn: 364515

5 years ago[GlobalISel] Remove [un]packRegs from IRTranslator
Diana Picus [Thu, 27 Jun 2019 09:49:07 +0000 (09:49 +0000)]
[GlobalISel] Remove [un]packRegs from IRTranslator

Remove the last use of packRegs from IRTranslator and delete
pack/unpackRegs. This introduces a fallback to DAGISel for intrinsics
with aggregate arguments, since we don't have a testcase for them so
it's hard to tell how we'd want to handle them.

Discussed in https://reviews.llvm.org/D63551

llvm-svn: 364514

5 years ago[AArch64 GlobalISel] Cleanup CallLowering. NFCI
Diana Picus [Thu, 27 Jun 2019 09:24:30 +0000 (09:24 +0000)]
[AArch64 GlobalISel] Cleanup CallLowering. NFCI

Now that lowerCall and lowerFormalArgs have been refactored, we can
simplify splitToValueTypes.

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

llvm-svn: 364513

5 years ago[GlobalISel] Accept multiple vregs for lowerCall's args
Diana Picus [Thu, 27 Jun 2019 09:18:03 +0000 (09:18 +0000)]
[GlobalISel] Accept multiple vregs for lowerCall's args

Change the interface of CallLowering::lowerCall to accept several
virtual registers for each argument, instead of just one.  This is a
follow-up to D46018.

CallLowering::lowerReturn was similarly refactored in D49660 and
lowerFormalArguments in D63549.

With this change, we no longer pack the virtual registers generated for
aggregates into one big lump before delegating to the target. Therefore,
the target can decide itself whether it wants to handle them as separate
pieces or use one big register.

ARM and AArch64 have been updated to use the passed in virtual registers
directly, which means we no longer need to generate so many
merge/extract instructions.

NFCI for AMDGPU, Mips and X86.

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

llvm-svn: 364512

5 years ago[GlobalISel] Accept multiple vregs for lowerCall's result
Diana Picus [Thu, 27 Jun 2019 09:15:53 +0000 (09:15 +0000)]
[GlobalISel] Accept multiple vregs for lowerCall's result

Change the interface of CallLowering::lowerCall to accept several
virtual registers for the call result, instead of just one.  This is a
follow-up to D46018.

CallLowering::lowerReturn was similarly refactored in D49660 and
lowerFormalArguments in D63549.

With this change, we no longer pack the virtual registers generated for
aggregates into one big lump before delegating to the target. Therefore,
the target can decide itself whether it wants to handle them as separate
pieces or use one big register.

ARM and AArch64 have been updated to use the passed in virtual registers
directly, which means we no longer need to generate so many
merge/extract instructions.

NFCI for AMDGPU, Mips and X86.

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

llvm-svn: 364511

5 years ago[GlobalISel] Accept multiple vregs in lowerFormalArgs
Diana Picus [Thu, 27 Jun 2019 08:54:17 +0000 (08:54 +0000)]
[GlobalISel] Accept multiple vregs in lowerFormalArgs

Change the interface of CallLowering::lowerFormalArguments to accept
several virtual registers for each formal argument, instead of just one.
This is a follow-up to D46018.

CallLowering::lowerReturn was similarly refactored in D49660. lowerCall
will be refactored in the same way in follow-up patches.

With this change, we forward the virtual registers generated for
aggregates to CallLowering. Therefore, the target can decide itself
whether it wants to handle them as separate pieces or use one big
register. We also copy the pack/unpackRegs helpers to CallLowering to
facilitate this.

ARM and AArch64 have been updated to use the passed in virtual registers
directly, which means we no longer need to generate so many
merge/extract instructions.

AArch64 seems to have had a bug when lowering e.g. [1 x i8*], which was
put into a s64 instead of a p0. Added a test-case which illustrates the
problem more clearly (it crashes without this patch) and fixed the
existing test-case to expect p0.

AMDGPU has been updated to unpack into the virtual registers for
kernels. I think the other code paths fall back for aggregates, so this
should be NFC.

Mips doesn't support aggregates yet, so it's also NFC.

x86 seems to have code for dealing with aggregates, but I couldn't find
the tests for it, so I just added a fallback to DAGISel if we get more
than one virtual register for an argument.

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

llvm-svn: 364510

5 years ago[GlobalISel] Allow multiple VRegs in ArgInfo. NFC
Diana Picus [Thu, 27 Jun 2019 08:50:53 +0000 (08:50 +0000)]
[GlobalISel] Allow multiple VRegs in ArgInfo. NFC

Allow CallLowering::ArgInfo to contain more than one virtual register.
This is useful when passes split aggregates into several virtual
registers, but need to also provide information about the original type
to the call lowering. Used in follow-up patches.

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

llvm-svn: 364509

5 years ago[AMDGPU] Fix +DumpCode to print an entry label for the first function
Jay Foad [Thu, 27 Jun 2019 08:19:28 +0000 (08:19 +0000)]
[AMDGPU] Fix +DumpCode to print an entry label for the first function

Summary:
The +DumpCode attribute is a horrible hack in AMDGPU to embed the
disassembly of the generated code into the elf file. It is used by LLPC
to implement an extension that allows the application to read back the
disassembly of the code.

It tries to print an entry label at the start of every function, but
that didn't work for the first function in the module because
DumpCodeInstEmitter wasn't initialised until EmitFunctionBodyStart
which is too late.

Change-Id: I790d73ddf4f51fd02ab32529380c7cb7c607c4ee

Reviewers: arsenm, tpr, kzhuravl

Reviewed By: arsenm

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits

Tags: #llvm

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

llvm-svn: 364508

5 years agoSilence gcc warning after r364458
Mikael Holmen [Thu, 27 Jun 2019 08:16:18 +0000 (08:16 +0000)]
Silence gcc warning after r364458

Without the fix gcc 7.4.0 complains with

../lib/Target/X86/X86ISelLowering.cpp: In function 'bool getFauxShuffleMask(llvm::SDValue, llvm::SmallVectorImpl<int>&, llvm::SmallVectorImpl<llvm::SDValue>&, llvm::SelectionDAG&)':
../lib/Target/X86/X86ISelLowering.cpp:6690:36: error: enumeral and non-enumeral type in conditional expression [-Werror=extra]
             int Idx = (ZeroMask[j] ? SM_SentinelZero : (i + j + Ofs));
                        ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

llvm-svn: 364507

5 years ago[MachineFunction] Base support for call site info tracking
Djordje Todorovic [Thu, 27 Jun 2019 07:48:06 +0000 (07:48 +0000)]
[MachineFunction] Base support for call site info tracking

Add an attribute into the MachineFunction that tracks call site info.

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

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

llvm-svn: 364506

5 years agoFix -Wunused-variable warnings after r364464
Hans Wennborg [Thu, 27 Jun 2019 07:32:19 +0000 (07:32 +0000)]
Fix -Wunused-variable warnings after r364464

/work/llvm.monorepo/llvm/lib/Bitcode/Reader/BitcodeReader.cpp: In function
‘llvm::Expected<std::basic_string<char> > readIdentificationBlock(llvm::BitstreamCursor&)’:
/work/llvm.monorepo/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:205:22:
warning: unused variable â€˜BitCode’ [-Wunused-variable]
     switch (unsigned BitCode = MaybeBitCode.get()) {
                      ^
/work/llvm.monorepo/llvm/lib/Bitcode/Reader/BitcodeReader.cpp: In member function
‘llvm::Error {anonymous}::ModuleSummaryIndexBitcodeReader::parseModule()’:
/work/llvm.monorepo/llvm/lib/Bitcode/Reader/BitcodeReader.cpp:5367:26:
warning: unused variable â€˜BitCode’ [-Wunused-variable]
         switch (unsigned BitCode = MaybeBitCode.get()) {
                          ^

llvm-svn: 364505

5 years agoFix GCC 4 build after r364464
Hans Wennborg [Thu, 27 Jun 2019 07:32:10 +0000 (07:32 +0000)]
Fix GCC 4 build after r364464

It was failing with:

In file included from /b/s/w/ir/cache/builder/src/third_party/llvm/llvm/lib/Bitcode/Reader/BitstreamReader.cpp:9:0:
/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/Bitcode/BitstreamReader.h:
In member function 'llvm::Expected<long unsigned int> llvm::SimpleBitstreamCursor::ReadVBR64(unsigned int)':
/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/Bitcode/BitstreamReader.h:262:14:
error: could not convert 'MaybeRead' from 'llvm::Expected<unsigned int>' to 'llvm::Expected<long unsigned int>'
       return MaybeRead;
              ^
/b/s/w/ir/cache/builder/src/third_party/llvm/llvm/include/llvm/Bitcode/BitstreamReader.h:279:16:
error: could not convert 'MaybeRead' from 'llvm::Expected<unsigned int>' to 'llvm::Expected<long unsigned int>'
         return MaybeRead;
                ^

llvm-svn: 364504

5 years ago[lldb] [Plugins/SysV-x86_64] NetBSD is also using SysV ABI
Michal Gorny [Thu, 27 Jun 2019 07:09:51 +0000 (07:09 +0000)]
[lldb] [Plugins/SysV-x86_64] NetBSD is also using SysV ABI

Reenable SysV x86_64 ABI usage on NetBSD that was accidentally removed
in r364216.  This fixes numerous test failures with messages similar
to the following:

  error: Can't run the expression locally: Interpreter doesn't handle
  one of the expression's opcodes

llvm-svn: 364503

5 years ago[clang] Add DISuprogram and DIE for a func decl
Djordje Todorovic [Thu, 27 Jun 2019 06:44:44 +0000 (06:44 +0000)]
[clang] Add DISuprogram and DIE for a func decl

Attach a unique DISubprogram to a function declaration that will be
used for call site debug info.

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

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

llvm-svn: 364502

5 years agogn build: Follow-up to r364491 "[GN] Update build files"
Nico Weber [Thu, 27 Jun 2019 06:08:57 +0000 (06:08 +0000)]
gn build: Follow-up to r364491 "[GN] Update build files"

- Merge r364427 (GSYM lib) more: It was missing the new unit test
  (as pointed out by llvm/utils/gn/build/sync_source_lists_from_cmake.py),
  and it had some superfluous deps not present in the cmake build.

- Merge r364474 (clang DependencyScanning lib) more: The deps didn't
  quite match cmake.

llvm-svn: 364501

5 years ago[IR] Add DISuprogram and DIE for a func decl
Djordje Todorovic [Thu, 27 Jun 2019 06:07:41 +0000 (06:07 +0000)]
[IR] Add DISuprogram and DIE for a func decl

A unique DISubprogram may be attached to a function declaration used for
call site debug info.

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

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

llvm-svn: 364500

5 years ago[X86] Remove (vzext_movl (scalar_to_vector (load))) matching code from selectScalarSS...
Craig Topper [Thu, 27 Jun 2019 05:52:00 +0000 (05:52 +0000)]
[X86] Remove (vzext_movl (scalar_to_vector (load))) matching code from selectScalarSSELoad.

I think this will be turning into vzext_load during DAG combine.

llvm-svn: 364499

5 years ago[X86] Teach selectScalarSSELoad to not narrow volatile loads.
Craig Topper [Thu, 27 Jun 2019 05:51:56 +0000 (05:51 +0000)]
[X86] Teach selectScalarSSELoad to not narrow volatile loads.

llvm-svn: 364498

5 years ago[InstCombine][NFCI] Fix test comments.
Huihui Zhang [Thu, 27 Jun 2019 05:46:06 +0000 (05:46 +0000)]
[InstCombine][NFCI] Fix test comments.

For fold
(X & (signbit l>> Y)) ==/!= 0 -> (X << Y) >=/< 0
(X & (signbit << Y)) ==/!= 0 -> (X l>> Y) >=/< 0

Test cases of X being constant are positive tests not negative.

Prep work for D62818.

llvm-svn: 364497

5 years ago[NFC][PowerPC] Improve the for loop in Early Return
Kang Zhang [Thu, 27 Jun 2019 03:39:09 +0000 (03:39 +0000)]
[NFC][PowerPC] Improve the for loop in Early Return

Summary:

In `PPCEarlyReturn.cpp`
```
183       for (MachineFunction::iterator I = MF.begin(); I != MF.end();) {
184         MachineBasicBlock &B = *I++;
185         if (processBlock(B))
186           Changed = true;
187       }
```
Above code can be improved to:
```
184       for (MachineFunction::iterator I = MF.begin(), E = MF.end(); I != E;) {
185         MachineBasicBlock &B = *I++;
186         Changed |= processBlock(B);
187       }
```

Reviewed By: hfinkel

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

llvm-svn: 364496

5 years ago[NFC] Return early for types with size zero
Vitaly Buka [Thu, 27 Jun 2019 02:08:15 +0000 (02:08 +0000)]
[NFC] Return early for types with size zero

llvm-svn: 364495

5 years ago[Reproducers] Fix flakiness and off-by-one during replay.
Jonas Devlieghere [Thu, 27 Jun 2019 02:03:34 +0000 (02:03 +0000)]
[Reproducers] Fix flakiness and off-by-one during replay.

This fixes two replay issues that caused the tests to behave
erratically:

1. It fixes an off-by-one error, where all replies where shifted by 1
   because of a `+` packet that should've been ignored.

2. It fixes another off-by-one-error, where an asynchronous ^C was
   offsetting all subsequent packets. The reason is that we
   'synchronize' requests and replies. In reality, a stop reply is only
   sent when the process halt. During replay however, we instantly
   report the stop, as the reply to packets like continue (vCont).

Both packets should be ignored, and indeed, checking the gdb-remote log,
no unexpected packets are received anymore.

Additionally, be more pedantic when it comes to unexpected packets and
return an failure form the replay server. This way we should be able to
catch these things faster in the future.

llvm-svn: 364494

5 years ago[GN] Fix check-llvm
Vitaly Buka [Thu, 27 Jun 2019 01:35:47 +0000 (01:35 +0000)]
[GN] Fix check-llvm

llvm-svn: 364493

5 years ago[NFC] Remove unneeded local variables
Vitaly Buka [Thu, 27 Jun 2019 01:34:21 +0000 (01:34 +0000)]
[NFC] Remove unneeded local variables

llvm-svn: 364492

5 years ago[GN] Update build files
Vitaly Buka [Thu, 27 Jun 2019 01:34:19 +0000 (01:34 +0000)]
[GN] Update build files

llvm-svn: 364491

5 years ago[ARM] Don't reserve R12 on Thumb1 as an emergency spill slot.
Eli Friedman [Wed, 26 Jun 2019 23:46:51 +0000 (23:46 +0000)]
[ARM] Don't reserve R12 on Thumb1 as an emergency spill slot.

The current implementation of ThumbRegisterInfo::saveScavengerRegister
is bad for two reasons: one, it's buggy, and two, it blocks using R12
for other optimizations.  So this patch gets rid of it, and adds the
necessary support for using an ordinary emergency spill slot on Thumb1.

(Specifically, I think saveScavengerRegister was broken by r305625, and
nobody noticed for two years because the codepath is almost never used.
The new code will also probably not be used much, but it now has better
tests, and if we fail to emit a necessary emergency spill slot we get a
reasonable error message instead of a miscompile.)

A rough outline of the changes in the patch:

1. Gets rid of ThumbRegisterInfo::saveScavengerRegister.
2. Modifies ARMFrameLowering::determineCalleeSaves to allocate an
emergency spill slot for Thumb1.
3. Implements useFPForScavengingIndex, so the emergency spill slot isn't
placed at a negative offset from FP on Thumb1.
4. Modifies the heuristics for allocating an emergency spill slot to
support Thumb1.  This includes fixing ExtraCSSpill so we don't try to
use "lr" as a substitute for allocating an emergency spill slot.
5. Allocates a base pointer in more cases, so the emergency spill slot
is always accessible.
6. Modifies ARMFrameLowering::ResolveFrameIndexReference to compute the
right offset in the new cases where we're forcing a base pointer.
7. Ensures we never generate a load or store with an offset outside of
its frame object.  This makes the heuristics more straightforward.
8. Changes Thumb1 prologue and epilogue emission so it never uses
register scavenging.

Some of the changes to the emergency spill slot heuristics in
determineCalleeSaves affect ARM/Thumb2; hopefully, they should allow
the compiler to avoid allocating an emergency spill slot in cases
where it isn't necessary. The rest of the changes should only affect
Thumb1.

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

llvm-svn: 364490

5 years ago[ObjC] Improve error message for a malformed objc-type-name
Erik Pilkington [Wed, 26 Jun 2019 23:39:23 +0000 (23:39 +0000)]
[ObjC] Improve error message for a malformed objc-type-name

If the type didn't exist, we used to emit a really bad error:

t.m:3:12: error: expected ')'
-(nullable NoSuchType)foo3;
           ^

rdar://50925632

llvm-svn: 364489

5 years agoFix Bitcode/invalid.test
JF Bastien [Wed, 26 Jun 2019 23:08:29 +0000 (23:08 +0000)]
Fix Bitcode/invalid.test

On the armv8 bot the failure is slightly different in the number it prints. Don't check the numbers. This was caused by r364464.

llvm-svn: 364488

5 years ago[GWP-ASan] D63736 broke ARMv7/v8 sanitizer bots.
Mitch Phillips [Wed, 26 Jun 2019 22:24:15 +0000 (22:24 +0000)]
[GWP-ASan] D63736 broke ARMv7/v8 sanitizer bots.

Remove ARM32/ARM64 support for GWP-ASan due to a strange SEGV when
running scudo's preinit.c test. Disabling to make the bots go green
while investigating.

llvm-svn: 364486

5 years ago[cmake] Allow config.guess to be run with MSYS on Windows
Pengxuan Zheng [Wed, 26 Jun 2019 22:07:43 +0000 (22:07 +0000)]
[cmake] Allow config.guess to be run with MSYS on Windows

Summary:
With r363420, config.guess can no longer be run with MSYS on Windows and this
patch should be able to fix this particular case.

Reviewers: compnerd

Reviewed By: compnerd

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 364485

5 years agoSupport nested target.xml register definition files, lack of reg group markers.
Jason Molenda [Wed, 26 Jun 2019 21:59:39 +0000 (21:59 +0000)]
Support nested target.xml register definition files, lack of reg group markers.

The qemu x86_64 target returns a target.xml register definition file which
includes other xml files and they include others, etc.  Also, the registers
are not put in register groups like lldb wants to see.

This patch (1) puts registers that aren't in a register group in a "general"
register group, (2) change ProcessGDBRemote::GetGDBServerRegisterInfo to
be a method that starts the parsing, asking a recurisve function to fetch
and parse target.xml, (3) adds
ProcessGDBRemote::GetGDBServerRegisterInfoXMLAndProcess which can recusively
call itself to read and parse included xml files, (4) in addition to expecting
the top-level <target> element (which only happens in the top level xml file),
also an xml file that consists of a <feature> node - read the register
defintions and includes from that <feature> element.

<rdar://problem/49537922>
Differential revision: https://reviews.llvm.org/D63802

llvm-svn: 364484

5 years ago[SCCP] Fix non-deterministic uselists of return values (DenseMap -> MapVector)
Gerolf Hoflehner [Wed, 26 Jun 2019 21:44:37 +0000 (21:44 +0000)]
[SCCP] Fix non-deterministic uselists of return values (DenseMap -> MapVector)

llvm-svn: 364482

5 years agoUse the // integer divide operator in these
Jason Molenda [Wed, 26 Jun 2019 21:41:07 +0000 (21:41 +0000)]
Use the // integer divide operator in these
target definition files, like Davide's change to x86_64_target_definition.py.

llvm-svn: 364481

5 years agoFix formatting after r364479
Aaron Puchert [Wed, 26 Jun 2019 21:39:19 +0000 (21:39 +0000)]
Fix formatting after r364479

The reflowing obscurs the functional changes, so here is a separate
commit.

llvm-svn: 364480

5 years ago[Clang] Remove unused -split-dwarf and obsolete -enable-split-dwarf
Aaron Puchert [Wed, 26 Jun 2019 21:36:35 +0000 (21:36 +0000)]
[Clang] Remove unused -split-dwarf and obsolete -enable-split-dwarf

Summary:
The changes in D59673 made the choice redundant, since we can achieve
single-file split DWARF just by not setting an output file name.
Like llc we can also derive whether to enable Split DWARF from whether
-split-dwarf-file is set, so we don't need the flag at all anymore.

The test CodeGen/split-debug-filename.c distinguished between having set
or not set -enable-split-dwarf with -split-dwarf-file, but we can
probably just always emit the metadata into the IR.

The flag -split-dwarf wasn't used at all anymore.

Reviewers: dblaikie, echristo

Reviewed By: dblaikie

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

llvm-svn: 364479

5 years ago[SLP] Look-ahead operand reordering heuristic.
Vasileios Porpodas [Wed, 26 Jun 2019 21:25:24 +0000 (21:25 +0000)]
[SLP] Look-ahead operand reordering heuristic.

Summary: This patch introduces a new heuristic for guiding operand reordering. The new "look-ahead" heuristic can look beyond the immediate predecessors. This helps break ties when the immediate predecessors have identical opcodes (see lit test for an example).

Reviewers: RKSimon, ABataev, dtemirbulatov, Ayal, hfinkel, rnk

Reviewed By: RKSimon, dtemirbulatov

Subscribers: rnk, rcorcs, llvm-commits

Tags: #llvm

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

llvm-svn: 364478

5 years ago[InstCombine] change 'tmp' variable names; NFC
Sanjay Patel [Wed, 26 Jun 2019 21:19:31 +0000 (21:19 +0000)]
[InstCombine] change 'tmp' variable names; NFC

I don't think there was anything going wrong here,
but the auto-generating CHECK line script is known
to have problems with 'TMP' because it uses that
to match nameless values.

This is a retry of rL364452.

llvm-svn: 364477

5 years agoRevert r363191 "[MS] Pretend constexpr variable template specializations are inline"
Reid Kleckner [Wed, 26 Jun 2019 21:16:51 +0000 (21:16 +0000)]
Revert r363191 "[MS] Pretend constexpr variable template specializations are inline"

The next Visual Studio update will fix this issue, and it doesn't make
sense to implement this non-conforming behavior going forward.

llvm-svn: 364476

5 years ago[clang-scan-deps] Introduce the DependencyScanning library with the
Alex Lorenz [Wed, 26 Jun 2019 21:11:51 +0000 (21:11 +0000)]
[clang-scan-deps] Introduce the DependencyScanning library with the
thread worker code and better error handling

This commit extracts out the code that will powers the fast scanning
worker into a new file in a new DependencyScanning library. The error
and output handling is improved so that the clients can gather
errors/results from the worker directly.

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

llvm-svn: 364474

5 years agoAMDGPU: Assert SPAdj is 0
Matt Arsenault [Wed, 26 Jun 2019 20:56:18 +0000 (20:56 +0000)]
AMDGPU: Assert SPAdj is 0

llvm-svn: 364473

5 years agoPEI: Add default handling of spills to registers
Matt Arsenault [Wed, 26 Jun 2019 20:56:15 +0000 (20:56 +0000)]
PEI: Add default handling of spills to registers

llvm-svn: 364472

5 years ago[UpdateTestChecks][NFC] Remove entries with same prefix
Jinsong Ji [Wed, 26 Jun 2019 20:35:19 +0000 (20:35 +0000)]
[UpdateTestChecks][NFC] Remove entries with same prefix

Matching is 'lossy', triples with same prefix can be dropped.

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

llvm-svn: 364471

5 years ago[AMDGPU] Fix Livereg computation during epilogue insertion
Matt Arsenault [Wed, 26 Jun 2019 20:35:18 +0000 (20:35 +0000)]
[AMDGPU] Fix Livereg computation during epilogue insertion

The LivePhysRegs calculated in order to find a scratch register in the
epilogue code wrongly uses 'LiveIns'. Instead, it should use the
'Liveout' sets.  For the liveness, also considering the operands of
the terminator (return) instruction which is the insertion point for
the scratch-exec-copy instruction.

Patch by Christudasan Devadasan

llvm-svn: 364470

5 years ago[X86] Rework the logic in LowerBuildVectorv16i8 to make better use of any_extend...
Craig Topper [Wed, 26 Jun 2019 20:16:19 +0000 (20:16 +0000)]
[X86] Rework the logic in LowerBuildVectorv16i8 to make better use of any_extend and break false dependencies. Other improvements

This patch rewrites the loop iteration to only visit every other element starting with element 0. And we work on the "even" element and "next" element at the same time. The "First" logic has been moved to the bottom of the loop and doesn't run on every element. I believe it could create dangling nodes previously since we didn't check if we were going to use SCALAR_TO_VECTOR for the first insertion. I got rid of the "First" variable and just do a null check on V which should be equivalent. We also no longer use undef as the starting V for vectors with no zeroes to avoid false dependencies. This matches v8i16.

I've changed all the extends and OR operations to use MVT::i32 since that's what they'll be promoted to anyway. I've tried to use zero_extend only when necessary and use any_extend otherwise. This resulted in some improvements in tests where we are now able to promote aligned (i32 (extload i8)) to a 32-bit load.

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

llvm-svn: 364469

5 years ago[WebAssembly] Implement Address Sanitizer for Emscripten
Guanzhong Chen [Wed, 26 Jun 2019 20:16:14 +0000 (20:16 +0000)]
[WebAssembly] Implement Address Sanitizer for Emscripten

Summary:
This diff enables address sanitizer on Emscripten.

On Emscripten, real memory starts at the value passed to --global-base.

All memory before this is used as shadow memory, and thus the shadow mapping
function is simply dividing by 8.

Reviewers: tlively, aheejin, sbc100

Reviewed By: sbc100

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

Tags: #clang, #llvm

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

llvm-svn: 364468

5 years ago[wasm-ld] Add __global_base symbol to mark the value of --global-base
Guanzhong Chen [Wed, 26 Jun 2019 20:12:33 +0000 (20:12 +0000)]
[wasm-ld] Add __global_base symbol to mark the value of --global-base

Summary:
This is needed for address sanitizer on Emscripten. As everything in
memory starts at the value passed to --global-base, everything before
that can be used as shadow memory.

This symbol is added so that the library for the ASan runtime can know
where the shadow memory ends and real memory begins.

This is split from D63742.

Reviewers: tlively, aheejin, sbc100

Subscribers: sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 364467

5 years agoMake nrvo-string test more robust.
Adrian Prantl [Wed, 26 Jun 2019 20:04:09 +0000 (20:04 +0000)]
Make nrvo-string test more robust.

The breakpoint locations were in places where clang doesn't actually
emit a source location for and depend on the debugger's ability to
move the breakpoint forward onto a line that is already in the
function epilogue. In my testing older versions of LLDB fail to do
that, so I'm modifying the test to force a break-able location by
calling a noinline function.

<rdar://problem/52079841>

llvm-svn: 364466