platform/upstream/llvm.git
6 years ago[builtins] Use FlushInstructionCache on windows on aarch64 as well
Martin Storsjo [Fri, 19 Jan 2018 07:34:46 +0000 (07:34 +0000)]
[builtins] Use FlushInstructionCache on windows on aarch64 as well

Generalize this handling to a separate toplevel ifdef (since any
windows case should use the same function), instead of indenting
the aarch64 case one step further.

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

llvm-svn: 322928

6 years agoSplit MachineLICM into EarlyMachineLICM and MachineLICM; NFC
Matthias Braun [Fri, 19 Jan 2018 06:46:10 +0000 (06:46 +0000)]
Split MachineLICM into EarlyMachineLICM and MachineLICM; NFC

This avoids playing games with pseudo pass IDs and avoids using an
unreliable MRI::isSSA() check to determine whether register allocation
has happened.

Note that this renames:
- MachineLICMID -> EarlyMachineLICM
- PostRAMachineLICMID -> MachineLICMID
to be consistent with the EarlyTailDuplicate/TailDuplicate naming.

llvm-svn: 322927

6 years agoSplit TailDuplicatePass into pre- and post-RA variant; NFC
Matthias Braun [Fri, 19 Jan 2018 06:08:17 +0000 (06:08 +0000)]
Split TailDuplicatePass into pre- and post-RA variant; NFC

Split TailDuplicatePass into EarlyTailDuplicate and TailDuplicate. This
avoids playing games with fake pass IDs and using MRI::isSSA() to
determine pre-/post-RA state.

llvm-svn: 322926

6 years agoMove tests to the correct place
Matthias Braun [Fri, 19 Jan 2018 06:08:15 +0000 (06:08 +0000)]
Move tests to the correct place

test/CodeGen/MIR is for testing the MIR parser/printer. Tests for passes
and targets belong to test/CodeGen/TARGETNAME.

llvm-svn: 322925

6 years ago[X86] Make better use of instregex for cmovcc/setcc/jcc instructions in the Intel...
Craig Topper [Fri, 19 Jan 2018 05:47:32 +0000 (05:47 +0000)]
[X86] Make better use of instregex for cmovcc/setcc/jcc instructions in the Intel scheduler models.

Combine all the separate condition codes into a singular expression when possible.

llvm-svn: 322924

6 years agoRevert [CGP] Re-enable Select in complex addressing mode
Serguei Katkov [Fri, 19 Jan 2018 04:52:39 +0000 (04:52 +0000)]
Revert [CGP] Re-enable Select in complex addressing mode

One of buildbots failed. Revert for now till fix the issue.

llvm-svn: 322923

6 years ago[Fuchsia] Tests for the Fuzzer support in Fuchsia driver
Petr Hosek [Fri, 19 Jan 2018 04:08:06 +0000 (04:08 +0000)]
[Fuchsia] Tests for the Fuzzer support in Fuchsia driver

This adds driver tests for the Fuzzer support.

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

llvm-svn: 322922

6 years ago[WebAssembly] Fix variable whose name is also a type name
Sam Clegg [Fri, 19 Jan 2018 03:31:07 +0000 (03:31 +0000)]
[WebAssembly] Fix variable whose name is also a type name

Some compilers don't like this and generate a warning.

llvm-svn: 322921

6 years agoWrote my own version of is_permutation; that was dominating the timings
Marshall Clow [Fri, 19 Jan 2018 03:17:45 +0000 (03:17 +0000)]
Wrote my own version of is_permutation; that was dominating the timings

llvm-svn: 322920

6 years agoAArch64: Fix emergency spillslot being out of reach for large callframes
Matthias Braun [Fri, 19 Jan 2018 03:16:36 +0000 (03:16 +0000)]
AArch64: Fix emergency spillslot being out of reach for large callframes

Re-commit of r322200: The testcase shouldn't hit machineverifiers
anymore with r322917 in place.

Large callframes (calls with several hundreds or thousands or
parameters) could lead to situations in which the emergency spillslot is
out of range to be addressed relative to the stack pointer.
This commit forces the use of a frame pointer in the presence of large
callframes.

This commit does several things:
- Compute max callframe size at the end of instruction selection.
- Add mirFileLoaded target callback. Use it to compute the max callframe size
  after loading a .mir file when the size wasn't specified in the file.
- Let TargetFrameLowering::hasFP() return true if there exists a
  callframe > 255 bytes.
- Always place the emergency spillslot close to FP if we have a frame
  pointer.
- Note that `useFPForScavengingIndex()` would previously return false
  when a base pointer was available leading to the emergency spillslot
  getting allocated late (that's the whole effect of this callback).
  Which made no sense to me so I took this case out: Even though the
  emergency spillslot is technically not referenced by FP in this case
  we still want it allocated early.

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

llvm-svn: 322919

6 years ago[Refactor] Use enum instead of magic number in handleX86ForceAlignArgPointerAttr...
Hongbin Zheng [Fri, 19 Jan 2018 03:07:00 +0000 (03:07 +0000)]
[Refactor] Use enum instead of magic number in handleX86ForceAlignArgPointerAttr, NFC

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

llvm-svn: 322918

6 years agoAArch64: Omit callframe setup/destroy when not necessary
Matthias Braun [Fri, 19 Jan 2018 02:45:38 +0000 (02:45 +0000)]
AArch64: Omit callframe setup/destroy when not necessary

Do not create CALLSEQ_START/CALLSEQ_END when there is no callframe to
setup and the callframe size is 0.

- Fixes an invalid callframe nesting for byval arguments, which would
  look like this before this patch (as in `big-byval.ll`):
    ...
    ADJCALLSTACKDOWN 32768, 0, ...   # Setup for extfunc
    ...
    ADJCALLSTACKDOWN 0, 0, ...  # setup for memcpy
    ...
    BL &memcpy ...
    ADJCALLSTACKUP 0, 0, ...    # destroy for memcpy
    ...
    BL &extfunc
    ADJCALLSTACKUP 32768, 0, ...   # destroy for extfunc

- Saves us two instructions in the common case of zero-sized stackframes.
- Remove an unnecessary scheduling barrier (hence the small unittest
  changes).

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

llvm-svn: 322917

6 years ago[Fuchsia] Enable Fuzzer as a supported sanitizer on Fuchsia
Petr Hosek [Fri, 19 Jan 2018 01:58:26 +0000 (01:58 +0000)]
[Fuchsia] Enable Fuzzer as a supported sanitizer on Fuchsia

libFuzzer has been ported to Fuchsia so enable it in the driver.

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

llvm-svn: 322916

6 years ago[WebAssembly] Add test expectations for gcc C++ tests (gcc/testsuite/g++.dg)
Sam Clegg [Fri, 19 Jan 2018 01:40:52 +0000 (01:40 +0000)]
[WebAssembly] Add test expectations for gcc C++ tests (gcc/testsuite/g++.dg)

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

llvm-svn: 322915

6 years ago[ORC] Revert r322913 while I investigate an ASan failure.
Lang Hames [Fri, 19 Jan 2018 01:40:26 +0000 (01:40 +0000)]
[ORC] Revert r322913 while I investigate an ASan failure.

llvm-svn: 322914

6 years ago[ORC] Redesign the JITSymbolResolver interface to support bulk queries.
Lang Hames [Fri, 19 Jan 2018 01:12:40 +0000 (01:12 +0000)]
[ORC] Redesign the JITSymbolResolver interface to support bulk queries.

Bulk queries reduce IPC/RPC overhead for cross-process JITing and expose
opportunities for parallel compilation.

The two new query methods are lookupFlags, which finds the flags for each of a
set of symbols; and lookup, which finds the address and flags for each of a
set of symbols. (See doxygen comments for more details.)

The existing JITSymbolResolver class is renamed LegacyJITSymbolResolver, and
modified to extend the new JITSymbolResolver class using the following scheme:

- lookupFlags is implemented by calling findSymbolInLogicalDylib for each of the
symbols, then returning the result of calling getFlags() on each of these
symbols. (Importantly: lookupFlags does NOT call getAddress on the returned
symbols, so lookupFlags will never trigger materialization, and lookupFlags will
never call findSymbol, so only symbols that are part of the logical dylib will
return results.)

- lookup is implemented by calling findSymbolInLogicalDylib for each symbol and
falling back to findSymbol if findSymbolInLogicalDylib returns a null result.
Assuming a symbol is found its getAddress method is called to materialize it and
the result (if getAddress succeeds) is stored in the result map, or the error
(if getAddress fails) is returned immediately from lookup. If any symbol is not
found then lookup returns immediately with an error.

This change will break any out-of-tree derivatives of JITSymbolResolver. This
can be fixed by updating those classes to derive from LegacyJITSymbolResolver
instead.

llvm-svn: 322913

6 years ago[X86] Add missing check for RDSEED to ICL, CNL, SKX sections of test/Preprocessor...
Craig Topper [Fri, 19 Jan 2018 00:28:42 +0000 (00:28 +0000)]
[X86] Add missing check for RDSEED to ICL, CNL, SKX sections of test/Preprocessor/predefined-arch-macros.c

llvm-svn: 322912

6 years ago[WebAssembly] Export the stack pointer when using --emit-relocs
Sam Clegg [Thu, 18 Jan 2018 23:57:55 +0000 (23:57 +0000)]
[WebAssembly] Export the stack pointer when using --emit-relocs

This solves the problem that --emit-relocs needs the stack-pointer
to be exported, in order to write out any relocations that reference
the __stack_pointer symbol by its symbol index.

Patch by Nicholas Wilson!

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

llvm-svn: 322911

6 years ago[X86] Add intrinsic support for the RDPID instruction
Craig Topper [Thu, 18 Jan 2018 23:52:31 +0000 (23:52 +0000)]
[X86] Add intrinsic support for the RDPID instruction

This adds a new instrinsic to support the rdpid instruction. The implementation is a bit weird because the intrinsic is defined as always returning 32-bits, but the assembler support thinks the instruction produces a 64-bit register in 64-bit mode. But really it zeros the upper 32 bits. So I had to add separate patterns where 64-bit mode uses an extract_subreg.

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

llvm-svn: 322910

6 years agoAdd a missing file header.
Rui Ueyama [Thu, 18 Jan 2018 23:46:28 +0000 (23:46 +0000)]
Add a missing file header.

llvm-svn: 322909

6 years ago[WebAssembly] Add missing function exports and SYM_INFO to --relocatable output
Sam Clegg [Thu, 18 Jan 2018 23:40:49 +0000 (23:40 +0000)]
[WebAssembly] Add missing function exports and SYM_INFO to --relocatable output

When writing relocatable files we were exporting for all globals
(including file-local syms), but not for functions. Oops. To be
consistent with non-relocatable output, all symbols (file-local
and global) should be exported. Any symbol targetted by further
relocations needs to be exported. The lack of local function
exports was just an omission, I think.

Second bug: Local symbol names can collide, causing an illegal
Wasm file to be generated! Oops again. This only previously affected
producing relocatable output from two files, where each had a global
with the same name. We need to "budge" the symbol names for locals
that are exported on relocatable output.

Third bug: LLD's relocatable output wasn't writing out any symbol
flags! Thus the local globals weren't being marked as local, and
the hidden flag was also stripped...

Added tests to exercise colliding local names with/without
relocatable flag

Patch by Nicholas Wilson!

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

llvm-svn: 322908

6 years ago[InstSimplify] regenerate checks and add tests for commutes; NFC
Sanjay Patel [Thu, 18 Jan 2018 23:11:24 +0000 (23:11 +0000)]
[InstSimplify] regenerate checks and add tests for commutes; NFC

llvm-svn: 322907

6 years agoAMDGPU/SI: Fix typos in d16 support patch the buffer intrinsics.
Changpeng Fang [Thu, 18 Jan 2018 22:57:57 +0000 (22:57 +0000)]
AMDGPU/SI: Fix typos in d16 support patch the buffer intrinsics.

llvm-svn: 322906

6 years ago[CodeView] Add line numbers for inlined call sites
Reid Kleckner [Thu, 18 Jan 2018 22:55:43 +0000 (22:55 +0000)]
[CodeView] Add line numbers for inlined call sites

We did this for inline call site line tables, but we hadn't done it for
regular function line tables yet. This patch copies that logic from
encodeInlineLineTable.

llvm-svn: 322905

6 years ago[CodeView] Sink complex inline functions to .cpp file, NFC
Reid Kleckner [Thu, 18 Jan 2018 22:55:14 +0000 (22:55 +0000)]
[CodeView] Sink complex inline functions to .cpp file, NFC

I'm cleaning up this code before I attempt to fix a line table bug.

llvm-svn: 322904

6 years agoAMDGPU/SI: Add d16 support for image intrinsics.
Changpeng Fang [Thu, 18 Jan 2018 22:08:53 +0000 (22:08 +0000)]
AMDGPU/SI: Add d16 support for image intrinsics.

Summary:
  This patch implements d16 support for image load, image store and image sample intrinsics.

Reviewers:
  Matt, Brian.

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

llvm-svn: 322903

6 years agoTypo fix SIBABRT -> SIGABRT.
Eric Christopher [Thu, 18 Jan 2018 21:45:51 +0000 (21:45 +0000)]
Typo fix SIBABRT -> SIGABRT.

Based on a patch by Henry Wong!

llvm-svn: 322902

6 years agoRemove TautologicalInRangeCompare from Extra and TautologicalCompare.
Nico Weber [Thu, 18 Jan 2018 21:40:27 +0000 (21:40 +0000)]
Remove TautologicalInRangeCompare from Extra and TautologicalCompare.

This removes the following (already default-off) warnings from -Wextra:
  -Wtautological-type-limit-compare,
  -Wtautological-unsigned-zero-compare
  -Wtautological-unsigned-enum-zero-compare

On the thread "[cfe-dev] -Wtautological-constant-compare issues", clang
code owners Richard Smith, John McCall, and Reid Kleckner as well as
libc++ code owner Marshall Clow stated that these new warnings are not
yet ready for prime time and shouldn't be part of -Wextra.

Furthermore, Vedant Kumar (Apple), Peter Hosek (Fuchsia), and me (Chromium)
expressed the same concerns (Vedant on that thread, Peter on
https://reviews.llvm.org/D39462, me on https://reviews.llvm.org/D41512).

So remove them from -Wextra, and remove TautologicalInRangeCompare from
TautologicalCompare too until they're usable with real-world code.

llvm-svn: 322901

6 years ago[test] Actually check the common parts in CodeGen/ARM/global-merge-external.ll. NFC.
Martin Storsjo [Thu, 18 Jan 2018 21:21:48 +0000 (21:21 +0000)]
[test] Actually check the common parts in CodeGen/ARM/global-merge-external.ll. NFC.

Previously, these parts weren't ever checked. The label patterns
need to be extended to match successfully on macho.

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

llvm-svn: 322900

6 years agohalf_divide: Implement using x/y
Jan Vesely [Thu, 18 Jan 2018 21:12:06 +0000 (21:12 +0000)]
half_divide: Implement using x/y

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322899

6 years agohalf_tan: Implement using tan
Jan Vesely [Thu, 18 Jan 2018 21:12:04 +0000 (21:12 +0000)]
half_tan: Implement using tan

v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322898

6 years agohalf_sin: Implement using sin
Jan Vesely [Thu, 18 Jan 2018 21:12:01 +0000 (21:12 +0000)]
half_sin: Implement using sin

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322897

6 years agohalf_recip: Implement using 1/x
Jan Vesely [Thu, 18 Jan 2018 21:11:58 +0000 (21:11 +0000)]
half_recip: Implement using 1/x

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322896

6 years agohalf_log2: Implement using log2
Jan Vesely [Thu, 18 Jan 2018 21:11:56 +0000 (21:11 +0000)]
half_log2: Implement using log2

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322895

6 years agohalf_log10: Implement using log10
Jan Vesely [Thu, 18 Jan 2018 21:11:53 +0000 (21:11 +0000)]
half_log10: Implement using log10

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322894

6 years agohalf_log: Implement using log
Jan Vesely [Thu, 18 Jan 2018 21:11:50 +0000 (21:11 +0000)]
half_log: Implement using log

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322893

6 years agohalf_exp10: Implement using exp10
Jan Vesely [Thu, 18 Jan 2018 21:11:48 +0000 (21:11 +0000)]
half_exp10: Implement using exp10

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322892

6 years agohalf_exp2: Implement using exp2
Jan Vesely [Thu, 18 Jan 2018 21:11:45 +0000 (21:11 +0000)]
half_exp2: Implement using exp2

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322891

6 years agohalf_exp: Implement using exp
Jan Vesely [Thu, 18 Jan 2018 21:11:43 +0000 (21:11 +0000)]
half_exp: Implement using exp

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322890

6 years agohalf_cos: Implement using cos
Jan Vesely [Thu, 18 Jan 2018 21:11:40 +0000 (21:11 +0000)]
half_cos: Implement using cos

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322889

6 years agohalf_sqrt: Cleanup implementation
Jan Vesely [Thu, 18 Jan 2018 21:11:38 +0000 (21:11 +0000)]
half_sqrt: Cleanup implementation

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322888

6 years agohalf_rsqrt: Cleanup implementation
Jan Vesely [Thu, 18 Jan 2018 21:11:35 +0000 (21:11 +0000)]
half_rsqrt: Cleanup implementation

Passes CTS on carrizo
v2: Use full precision implementation

Reviewer: Jeroen Ketema <j.ketema@xs4all.nl>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 322887

6 years ago[clang-tidy objc-property-declaration] Expand list of ObjC acronyms
Ben Hamilton [Thu, 18 Jan 2018 20:51:24 +0000 (20:51 +0000)]
[clang-tidy objc-property-declaration] Expand list of ObjC acronyms

Summary:
We were missing some pretty common acronyms in the camelCase
property name check objc-property-declaration.

This expands the list and sorts it lexicographically, so we can
avoid duplicates.

Test Plan: make -j12 check-clang-tools

Reviewers: Wizard, hokein, klimek

Reviewed By: Wizard

Subscribers: cfe-commits

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

llvm-svn: 322886

6 years agoSupport: Add missing #include.
Peter Collingbourne [Thu, 18 Jan 2018 20:49:33 +0000 (20:49 +0000)]
Support: Add missing #include.

This #include is necessary to provide the definitions of _fpclass
and _FPCLASS_NZ when building with libc++.

llvm-svn: 322885

6 years ago[DWARFv5] Number the line-table's directory array correctly.
Paul Robinson [Thu, 18 Jan 2018 20:33:35 +0000 (20:33 +0000)]
[DWARFv5] Number the line-table's directory array correctly.

The compilation directory has always been #0, but as of DWARF v5 it is
explicitly listed in the line-table section instead of implicitly
being a reference to the compile_unit DIE's DW_AT_comp_dir attribute.
This means the dumper should number the dumped array starting with 0
or 1 depending on the DWARF version of the line table.

References in the generated DWARF are correct, it's just the dumper
that was wrong.  Also some assembler-coded tests were similarly
confused about directory numbers.

llvm-svn: 322884

6 years agoc-index-test: small fix to CXString handling and disposal
Steve O'Brien [Thu, 18 Jan 2018 20:21:07 +0000 (20:21 +0000)]
c-index-test: small fix to CXString handling and disposal

Summary: (Separating some unrelated changes out of D42043)

Reviewers: vsk, benlangmuir, akyrtzi

Subscribers: cfe-commits

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

llvm-svn: 322883

6 years ago[scudo] Use -fsanitize=scudo rather than --whole-archive in tests
Kostya Kortchinsky [Thu, 18 Jan 2018 20:02:56 +0000 (20:02 +0000)]
[scudo] Use -fsanitize=scudo rather than --whole-archive in tests

Summary:
Tests were being run by whole-linking the static library with our test binaries.
But since `-fsanitize=scudo` landed with rL317337, we might as well change how
the tests are compiled to use it.

The only difference will be on Android, where the clang flag links in the
dynamic library instead, but the bots are already pushing
`libclang_rt.*-android.so` to the device there is no additional change needed.

Tested locally, including with a standalone build, and an Android one on a O
device, and it all passes.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 322882

6 years agowe have now https support for apt.llvm.org. Updating the URL
Sylvestre Ledru [Thu, 18 Jan 2018 19:57:35 +0000 (19:57 +0000)]
we have now https support for apt.llvm.org. Updating the URL

llvm-svn: 322881

6 years agoConvert comment to C-style to prevent warning
Sam Clegg [Thu, 18 Jan 2018 19:31:33 +0000 (19:31 +0000)]
Convert comment to C-style to prevent warning

llvm-svn: 322880

6 years agoFollow-up to rL322875 by initializing the do_libcxxabi variable properly.
Dimitry Andric [Thu, 18 Jan 2018 19:30:30 +0000 (19:30 +0000)]
Follow-up to rL322875 by initializing the do_libcxxabi variable properly.

llvm-svn: 322879

6 years ago[AArch64][GlobalISel] Add isel support for global values in the large code model.
Amara Emerson [Thu, 18 Jan 2018 19:21:27 +0000 (19:21 +0000)]
[AArch64][GlobalISel] Add isel support for global values in the large code model.

Fixes PR35958.

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

llvm-svn: 322878

6 years ago[X86][SSE] Regenerate vector promotion tests
Simon Pilgrim [Thu, 18 Jan 2018 19:17:26 +0000 (19:17 +0000)]
[X86][SSE] Regenerate vector promotion tests

llvm-svn: 322877

6 years ago[RISCV] Fixed setting predicates for compressed instructions.
Ana Pazos [Thu, 18 Jan 2018 18:54:05 +0000 (18:54 +0000)]
[RISCV] Fixed setting predicates for compressed instructions.

Summary:
Fixed setting predicates for compressed instructions.
Some instructions were being generated with C extension
enabled only, without proper checks for the other
required extensions like F, D and 32 and 64-bit target checks.
Affected instructions:
C_FLD, C_FLW, C_LD, C_FSD, C_FSW, C_SD,
C_JAL, C_ADDIW, C_SUBW, C_ADDW,
C_FLDSP, C_FLWSP, C_LDSP, C_FSDSP, C_FSWSP, C_SDSP

Reviewers: asb, shiva0217

Reviewed By: asb

Subscribers: rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, llvm-commits

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

llvm-svn: 322876

6 years agoAdd a -no-libcxxabi option to the test-release.sh script.
Dimitry Andric [Thu, 18 Jan 2018 18:39:13 +0000 (18:39 +0000)]
Add a -no-libcxxabi option to the test-release.sh script.

On FreeBSD, it is currently not possible to build libcxxabi and link
against it, so we have been building releases with -no-libs for quite
some time.

However, libcxx and libunwind should build without problems, so provide
an option to skip just libcxxabi.

llvm-svn: 322875

6 years ago[X86][AVX] Add 256/512-bit slow PMULLD tests
Simon Pilgrim [Thu, 18 Jan 2018 18:38:32 +0000 (18:38 +0000)]
[X86][AVX] Add 256/512-bit slow PMULLD tests

llvm-svn: 322874

6 years ago[ClangFormat] ObjCSpaceBeforeProtocolList should be true in the google style
Ben Hamilton [Thu, 18 Jan 2018 18:37:16 +0000 (18:37 +0000)]
[ClangFormat] ObjCSpaceBeforeProtocolList should be true in the google style

Summary:
The Google style guide is neutral on whether there should be a
space before the protocol list in an Objective-C @interface or
@implementation.

The majority of Objective-C code in both Apple's public
header files and Google's open-source uses a space before
the protocol list, so this changes the google style to
default ObjCSpaceBeforeProtocolList to true.

Test Plan: make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: krasimir, djasper, klimek

Reviewed By: krasimir

Subscribers: klimek, cfe-commits

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

llvm-svn: 322873

6 years agoAdd memory tracking
Marshall Clow [Thu, 18 Jan 2018 18:37:11 +0000 (18:37 +0000)]
Add memory tracking

llvm-svn: 322872

6 years agoSpeed up iteration of CodeView record streams.
Zachary Turner [Thu, 18 Jan 2018 18:35:01 +0000 (18:35 +0000)]
Speed up iteration of CodeView record streams.

There's some abstraction overhead in the underlying
mechanisms that were being used, and it was leading to an
abundance of small but not-free copies being made.  This
showed up on a profile.  Eliminating this and going back to
a low-level byte-based implementation speeds up lld with
/DEBUG between 10 and 15%.

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

llvm-svn: 322871

6 years ago[cmake] [libcxxabi] Don't print warning when tests are disabled.
Don Hinton [Thu, 18 Jan 2018 18:29:36 +0000 (18:29 +0000)]
[cmake] [libcxxabi] Don't print warning when tests are disabled.

Summary:
Don't print, possibly erroneous, warning if
LIBCXXABI_INCLUDE_TESTS is false.

This patch fixes a problem introduced in r291367.

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

llvm-svn: 322870

6 years agoSprinkle a few <cstdlib> includes, for libomptarget sources using
Dimitry Andric [Thu, 18 Jan 2018 18:24:22 +0000 (18:24 +0000)]
Sprinkle a few <cstdlib> includes, for libomptarget sources using
malloc, free, alloca and getenv.  NFCI.

llvm-svn: 322869

6 years ago[CodeGen][NFC] Rename IsVerbose to IsStandalone in Machine*::print
Francis Visoiu Mistrih [Thu, 18 Jan 2018 18:05:15 +0000 (18:05 +0000)]
[CodeGen][NFC] Rename IsVerbose to IsStandalone in Machine*::print

Committed r322867 too soon.

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

llvm-svn: 322868

6 years ago[CodeGen] Print RegClasses on MI in verbose mode
Francis Visoiu Mistrih [Thu, 18 Jan 2018 17:59:06 +0000 (17:59 +0000)]
[CodeGen] Print RegClasses on MI in verbose mode

r322086 removed the trailing information describing reg classes for each
register.

This patch adds printing reg classes next to every register when
individual operands/instructions/basic blocks are printed. In the case
of dumping MIR or printing a full function, by default don't print it.

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

llvm-svn: 322867

6 years ago[SLP] Fix test checks, NFC.
Alexey Bataev [Thu, 18 Jan 2018 17:34:27 +0000 (17:34 +0000)]
[SLP] Fix test checks, NFC.

llvm-svn: 322865

6 years agoUse high_resolution_clock instead of steady_clock. Also now builds with gcc 7.2 ...
Marshall Clow [Thu, 18 Jan 2018 17:01:34 +0000 (17:01 +0000)]
Use high_resolution_clock instead of steady_clock. Also now builds with gcc 7.2 (for comparison purposes)

llvm-svn: 322864

6 years agoA simple program for testing OSS-Fuzz test cases locally.
Marshall Clow [Thu, 18 Jan 2018 16:52:19 +0000 (16:52 +0000)]
A simple program for testing OSS-Fuzz test cases locally.

llvm-svn: 322863

6 years ago[ADT] Just give up on GCC, I can't fix this.
Benjamin Kramer [Thu, 18 Jan 2018 16:23:40 +0000 (16:23 +0000)]
[ADT] Just give up on GCC, I can't fix this.

While the memmove workaround fixed it for GCC 6.3. GCC 4.8 and GCC 7.1
are still broken. I have no clue what's going on, just blacklist GCC for
now.

Needless to say this code is ubsan, asan and msan-clean.

llvm-svn: 322862

6 years ago[ELF][MIPS] Rename function. NFC
Simon Atanasyan [Thu, 18 Jan 2018 15:59:10 +0000 (15:59 +0000)]
[ELF][MIPS] Rename function. NFC

llvm-svn: 322861

6 years ago[ELF][MIPS] Decompose relocation type for N32 / N64 earlier. NFC
Simon Atanasyan [Thu, 18 Jan 2018 15:59:05 +0000 (15:59 +0000)]
[ELF][MIPS] Decompose relocation type for N32 / N64 earlier. NFC

We need to decompose relocation type for N32 / N64 ABI. Let's do it
before any other manipulations with relocation type in the `relocateOne`
routine.

llvm-svn: 322860

6 years ago[ADT] Add a workaround for GCC miscompiling the trivially copyable Optional
Benjamin Kramer [Thu, 18 Jan 2018 15:47:59 +0000 (15:47 +0000)]
[ADT] Add a workaround for GCC miscompiling the trivially copyable Optional

I've seen random crashes with GCC 4.8, GCC 6.3 and GCC 7.3, triggered by
my Optional change. All of them affect a different set of targets. This
change fixes the instance of the problem I'm seeing on my local machine,
let's hope it's good enough for the other instances too.

llvm-svn: 322859

6 years ago[OpenMP] Correct generation of offloading entries
Jonas Hahnfeld [Thu, 18 Jan 2018 15:38:03 +0000 (15:38 +0000)]
[OpenMP] Correct generation of offloading entries

Firstly, each offloading entry must have a unique name or the
linker will complain if there are multiple files with target
regions. Secondly, the compiler must not introduce padding so
mark the struct with a PackedAttr.

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

llvm-svn: 322858

6 years ago[clangd] Remove unused IncludeGlobals completion option, always pass true to sema
Sam McCall [Thu, 18 Jan 2018 15:31:30 +0000 (15:31 +0000)]
[clangd] Remove unused IncludeGlobals completion option, always pass true to sema

llvm-svn: 322856

6 years ago[TargetLowering] add punctuation for readability; NFC
Sanjay Patel [Thu, 18 Jan 2018 15:25:32 +0000 (15:25 +0000)]
[TargetLowering] add punctuation for readability; NFC

llvm-svn: 322855

6 years ago[clangd] Always use preamble (even stale) for code completion
Ilya Biryukov [Thu, 18 Jan 2018 15:17:00 +0000 (15:17 +0000)]
[clangd] Always use preamble (even stale) for code completion

Summary:
This improves performance of code completion, because we avoid stating
the files from the preamble and never attempt to parse the files
without using the preamble if it's provided.

However, the change comes at a cost of sometimes providing incorrect
results when doing code completion after making actually considerable
changes to the files used in the preamble or the preamble itself.
Eventually the preamble will get rebuilt and code completion will
be providing the correct results.

Reviewers: bkramer, sammccall, jkorous-apple

Reviewed By: sammccall

Subscribers: klimek, cfe-commits

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

llvm-svn: 322854

6 years ago[Frontend] Allow to use PrecompiledPreamble without calling CanReuse
Ilya Biryukov [Thu, 18 Jan 2018 15:16:53 +0000 (15:16 +0000)]
[Frontend] Allow to use PrecompiledPreamble without calling CanReuse

Summary:
The new method 'OverridePreamble' allows to override the preamble of
any source file without checking if preamble bounds or dependencies
were changed.

This is used for completion in clangd.

Reviewers: bkramer, sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

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

llvm-svn: 322853

6 years ago[ScopBuilder] Revise statement naming when there are multiple statements per BB.
Michael Kruse [Thu, 18 Jan 2018 15:15:50 +0000 (15:15 +0000)]
[ScopBuilder] Revise statement naming when there are multiple statements per BB.

The goal is to have -polly-stmt-granularity=bb and
-polly-stmt-granularity=scalar-indep to have the same names if there is
just one statement per basic block.

This fixes a fluke when Polybench's jacobi-2d is optimized differently
depending on the -polly-stmt-granularity option, although both options
create the same SCoP, just with different statement names.

The new naming scheme is:

With -polly-use-llvm-names=0:
Stmt<BBIdx as decimal><Idx within BB as letter>

With -polly-use-llvm-names=1:
Stmt_BBName_<Idx within BB as letter>

The <Idx within BB> suffix is omitted for the main statement of a BB. The
main statement is either the one containing the first store or call
(those cannot be removed by the simplifyer), or if there is no such
instruction, the first. If after simplification there is just a single
statement left, it should be the main statement and have the same names as
with -polly-stmt-granularity=bb.

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

llvm-svn: 322852

6 years ago[ScopInfo] Pass name to ScopStmt ctor. NFC.
Michael Kruse [Thu, 18 Jan 2018 15:15:38 +0000 (15:15 +0000)]
[ScopInfo] Pass name to ScopStmt ctor. NFC.

This will give control of the statement's name to the caller.
Required to give -polly-stmt-granularity=scalar-indep more control
over the name of the generated statement in a follow-up commit.

llvm-svn: 322851

6 years ago[MachineOutliner] Fix r322788 - don't write to working directory
Sam McCall [Thu, 18 Jan 2018 15:02:28 +0000 (15:02 +0000)]
[MachineOutliner] Fix r322788 - don't write to working directory

llvm-svn: 322850

6 years ago[docs] Make ReleaseProcess.rst 80 column. NFCI
Joel Jones [Thu, 18 Jan 2018 14:57:55 +0000 (14:57 +0000)]
[docs] Make ReleaseProcess.rst 80 column. NFCI

llvm-svn: 322849

6 years ago[CodeGen][NFC] Refactor MachineInstr::print
Francis Visoiu Mistrih [Thu, 18 Jan 2018 14:52:14 +0000 (14:52 +0000)]
[CodeGen][NFC] Refactor MachineInstr::print

* Handle more cases where the MI is not attached yet
* Add similar asserts like in MIRPrinter::print

llvm-svn: 322848

6 years ago[HWAsan] Fix uninitialized variable.
Benjamin Kramer [Thu, 18 Jan 2018 14:19:04 +0000 (14:19 +0000)]
[HWAsan] Fix uninitialized variable.

Found by msan.

llvm-svn: 322847

6 years ago[X86] Add PR35918 test case
Simon Pilgrim [Thu, 18 Jan 2018 13:42:02 +0000 (13:42 +0000)]
[X86] Add PR35918 test case

llvm-svn: 322846

6 years agoFix MSVC "uninitialized variable" warning.
Simon Pilgrim [Thu, 18 Jan 2018 13:28:54 +0000 (13:28 +0000)]
Fix MSVC "uninitialized variable" warning.

llvm-svn: 322845

6 years agotest commit
Klaus Kretzschmar [Thu, 18 Jan 2018 12:58:50 +0000 (12:58 +0000)]
test commit

llvm-svn: 322844

6 years ago[RISCV] Codegen support for the standard RV32M instruction set extension
Alex Bradbury [Thu, 18 Jan 2018 12:36:38 +0000 (12:36 +0000)]
[RISCV] Codegen support for the standard RV32M instruction set extension

llvm-svn: 322843

6 years agoEnable sanitizer_common tests on NetBSD
Kamil Rytarowski [Thu, 18 Jan 2018 11:49:45 +0000 (11:49 +0000)]
Enable sanitizer_common tests on NetBSD

Summary:
NetBSD can handle asan, ubsan, msan, tsan tests
on 64-bit and when applicable 32-bit X86 OS.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Subscribers: srhines, llvm-commits, kubamracek, mgorny, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322842

6 years agoBreak a line into two lines
Kamil Rytarowski [Thu, 18 Jan 2018 11:38:10 +0000 (11:38 +0000)]
Break a line into two lines

This should restore the rule of <=80 characters per line.

llvm-svn: 322841

6 years ago[RISCV] Implement frame pointer elimination
Alex Bradbury [Thu, 18 Jan 2018 11:34:02 +0000 (11:34 +0000)]
[RISCV] Implement frame pointer elimination

llvm-svn: 322839

6 years ago[ADT] Split optional to only include copy mechanics and dtor for non-trivial types.
Benjamin Kramer [Thu, 18 Jan 2018 11:26:24 +0000 (11:26 +0000)]
[ADT] Split optional to only include copy mechanics and dtor for non-trivial types.

This makes uses of Optional more transparent to the compiler (and
clang-tidy) and generates slightly smaller code.

This is a re-land of r317019, which had issues with GCC 4.8 back then.
Those issues don't reproduce anymore, but I'll watch the buildbots
closely in case anything goes wrong.

llvm-svn: 322838

6 years agoAdd new NetBSD interceptors: getgrouplist(3) & getgroupmembership(3)
Kamil Rytarowski [Thu, 18 Jan 2018 11:17:35 +0000 (11:17 +0000)]
Add new NetBSD interceptors: getgrouplist(3) & getgroupmembership(3)

Summary:
getgrouplist, getgroupmembership -- calculate group access list

Sponsored by <The NetBSD Foundation>

Reviewers: vitalybuka, joerg

Reviewed By: vitalybuka

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322836

6 years agoFix logging test on windows
Pavel Labath [Thu, 18 Jan 2018 11:15:50 +0000 (11:15 +0000)]
Fix logging test on windows

Refactor in r322653 broke the logging test on windows because MSVC uses
a fully qualified name as the value of __FUNCTION__, which is not what
we were expecting. I'm changing the code to use the more portable
__func__, which behaves the same as on clang/gcc.

The standard still says that the value of __func__ is implementation
defined, so if we run into problems with this test again we may just
need to drop it.

llvm-svn: 322834

6 years agoAdd new interceptors: access(2), faccessat(2)
Kamil Rytarowski [Thu, 18 Jan 2018 11:04:25 +0000 (11:04 +0000)]
Add new interceptors: access(2), faccessat(2)

Summary:
access, faccessat - check access permissions of a file or pathname

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322831

6 years agoAdd missing headers for Debug builds
Jonas Hahnfeld [Thu, 18 Jan 2018 10:58:43 +0000 (10:58 +0000)]
Add missing headers for Debug builds

llvm-svn: 322830

6 years agoAdd new interceptors for pwcache(3)-style functions
Kamil Rytarowski [Thu, 18 Jan 2018 10:53:27 +0000 (10:53 +0000)]
Add new interceptors for pwcache(3)-style functions

Summary:
From <pwd.h>: user_from_uid, uid_from_user

From <grp.h>: group_from_gid, gid_from_group

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 322829

6 years agoA new test to demostrate the current SHLD/SHRD code generation.
Andrew V. Tischenko [Thu, 18 Jan 2018 10:40:48 +0000 (10:40 +0000)]
A new test to demostrate the current SHLD/SHRD code generation.

llvm-svn: 322828

6 years ago[clangd] Output log messages to stderr when not configured (e.g. in tests). NFC
Sam McCall [Thu, 18 Jan 2018 10:24:01 +0000 (10:24 +0000)]
[clangd] Output log messages to stderr when not configured (e.g. in tests). NFC

llvm-svn: 322827

6 years ago[ASTMatcher] Add isScoped matcher for enumDecl.
Haojian Wu [Thu, 18 Jan 2018 09:47:57 +0000 (09:47 +0000)]
[ASTMatcher] Add isScoped matcher for enumDecl.

Summary:

Reviewers: bkramer, aaron.ballman

Subscribers: aaron.ballman, cfe-commits, klimek

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

llvm-svn: 322826

6 years ago[RISCV][NFC] Add nounwind to functions in div.ll and mul.ll
Alex Bradbury [Thu, 18 Jan 2018 09:41:14 +0000 (09:41 +0000)]
[RISCV][NFC] Add nounwind to functions in div.ll and mul.ll

Committing this separately to minimise irrelevant changes for an upcoming
patch.

llvm-svn: 322825

6 years ago[clangd] CodeCompleteTests cleanup: naming, ordering, helpers. NFC
Sam McCall [Thu, 18 Jan 2018 09:27:56 +0000 (09:27 +0000)]
[clangd] CodeCompleteTests cleanup: naming, ordering, helpers. NFC

llvm-svn: 322824

6 years ago[SelectionDAG] Convert assert to condtion
Sam Parker [Thu, 18 Jan 2018 09:22:24 +0000 (09:22 +0000)]
[SelectionDAG] Convert assert to condtion

Follow-up to r322120 which can cause assertions for AArch64 because
v1f64 and v1i64 are legal types.

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

llvm-svn: 322823

6 years ago[clang-tidy] Don't generate fix for argument constructed from std::initializer_list.
Haojian Wu [Thu, 18 Jan 2018 08:58:18 +0000 (08:58 +0000)]
[clang-tidy] Don't generate fix for argument constructed from std::initializer_list.

Summary:
A follow-up fix of rL311652.

The previous `vector` in our test is different with `std::vector`, so
The check still generates fixes for std::vector (`auto p =
std::unique_ptr<Foo>(new Foo({1,2,3}))`) in real world, the patch makes the
vector behavior in test align with std::vector (both AST nodes are the same now).

Reviewers: ilya-biryukov, alexfh

Reviewed By: ilya-biryukov

Subscribers: klimek, xazax.hun, cfe-commits

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

llvm-svn: 322822