platform/upstream/llvm.git
5 years agoRevert "[clangd] Implement typeHierarchy/resolve for subtypes"
Russell Gallop [Fri, 12 Jul 2019 13:35:58 +0000 (13:35 +0000)]
Revert "[clangd] Implement typeHierarchy/resolve for subtypes"

Causing test failure on Windows bot

This reverts commit 5b9484e559d44bd923fc290e335891b1dd2e17c4.

llvm-svn: 365899

5 years ago[Driver] Delete dead code
Fangrui Song [Fri, 12 Jul 2019 13:21:58 +0000 (13:21 +0000)]
[Driver] Delete dead code

llvm-svn: 365898

5 years ago[gn] Tag unneeded variable.
Bryant Wong [Fri, 12 Jul 2019 13:09:39 +0000 (13:09 +0000)]
[gn] Tag unneeded variable.

When only building targets without assembly parsers (e.g. `llvm_targets_to_build
= ["NVPTX"]`), `all_targets` is empty and causes GN to warn about an
assigned-but-unused variable.

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

llvm-svn: 365897

5 years ago[DAGCombine] narrowExtractedVectorBinOp - wrap subvector extraction in helper. NFCI.
Simon Pilgrim [Fri, 12 Jul 2019 13:00:35 +0000 (13:00 +0000)]
[DAGCombine] narrowExtractedVectorBinOp - wrap subvector extraction in helper. NFCI.

First step towards supporting 'free' subvector extractions other than concat_vectors.

llvm-svn: 365896

5 years ago[LIT] Emit timeout error message only if timeout was reached
Alexey Bader [Fri, 12 Jul 2019 12:48:43 +0000 (12:48 +0000)]
[LIT] Emit timeout error message only if timeout was reached

Summary:
This improves readability of LIT output: previously
error messages gets emitted that say that there was no error:

error: command reached timeout: False

Patch by Alexey Sachkov.

Reviewers: ddunbar, mgorny, modocache

Reviewed By: mgorny

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

llvm-svn: 365895

5 years ago[clangd] Fixed toHalfOpenFileRange
Shaurya Gupta [Fri, 12 Jul 2019 11:42:31 +0000 (11:42 +0000)]
[clangd] Fixed toHalfOpenFileRange

Summary:
- Fixed toHalfOpenFileRange to work for macros as well as template
instantiations
- Added unit tests

Breaking test case for older version of toHalfOpenFileRange:
\# define FOO(X) X++
int a = 1;
int b = FOO(a);
toHalfOpenFileRange for the sourceRange of VarDecl for b returned the
wrong Range.

Reviewers: sammccall, kadircet

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

Tags: #clang

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

llvm-svn: 365894

5 years ago[InstCombine] Fold select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y) to ashr (X, Y))
David Bolvansky [Fri, 12 Jul 2019 11:31:16 +0000 (11:31 +0000)]
[InstCombine] Fold select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y) to ashr (X, Y))

Summary:
(select (icmp sgt x, -1), lshr (X, Y), ashr (X, Y)) -> ashr (X, Y))
(select (icmp slt x, 1), ashr (X, Y), lshr (X, Y)) -> ashr (X, Y))

Fixes PR41173

Alive proof by @lebedev.ri (thanks)
Name: PR41173
  %cmp = icmp slt i32 %x, 1
  %shr = lshr i32 %x, %y
  %shr1 = ashr i32 %x, %y
  %retval.0 = select i1 %cmp, i32 %shr1, i32 %shr
  =>
  %retval.0 = ashr i32 %x, %y

Optimization: PR41173
Done: 1
Optimization is correct!

Reviewers: lebedev.ri, spatel

Reviewed By: lebedev.ri

Subscribers: nikic, craig.topper, llvm-commits, lebedev.ri

Tags: #llvm

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

llvm-svn: 365893

5 years agoFix test case of llvm-nm using implicit a.out
Alex Brachet [Fri, 12 Jul 2019 10:44:06 +0000 (10:44 +0000)]
Fix test case of llvm-nm using implicit a.out

llvm-svn: 365892

5 years ago[test/Object, obj2yaml] - Move test cases from test/Object and cleanup.
George Rimar [Fri, 12 Jul 2019 10:29:29 +0000 (10:29 +0000)]
[test/Object, obj2yaml] - Move test cases from test/Object and cleanup.

test/Object is not correct place to have tests that check obj2yaml
functionality, because we have test/tools/obj2yaml folder for that.

In this patch I merged a few test cases with their YAMLs from Inputs
folder, converted one of binary inputs and moved them to
tools/obj2yaml folder.

There are still another tests that might need the same, so it is initial step.

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

llvm-svn: 365891

5 years ago[libomptarget] Fix typos and grammar in error messages, NFC.
Jonas Hahnfeld [Fri, 12 Jul 2019 10:21:55 +0000 (10:21 +0000)]
[libomptarget] Fix typos and grammar in error messages, NFC.

llvm-svn: 365890

5 years ago[tools] [llvm-nm] Default to reading from stdin not a.out
Alex Brachet [Fri, 12 Jul 2019 10:20:01 +0000 (10:20 +0000)]
[tools] [llvm-nm] Default to reading from stdin not a.out

Summary: This moves away from defaulting to a.out and uses stdin only if stdin has a file redirected to it. This has been discussed on the llvm-dev mailing list [[ https://lists.llvm.org/pipermail/llvm-dev/2019-July/133642.html | here ]].

Reviewers: jhenderson, rupprecht, MaskRay, chrisjackson

Reviewed By: jhenderson, MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 365889

5 years ago[clangd] Prioritize indexing of files that share a basename with the open file.
Sam McCall [Fri, 12 Jul 2019 10:18:42 +0000 (10:18 +0000)]
[clangd] Prioritize indexing of files that share a basename with the open file.

Summary:
In practice, opening Foo.h will still often result in Foo.cpp making the
second index build instead of the first, as the rebuild policy doesn't
know to wait.

Reviewers: kadircet

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 365888

5 years ago[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands.
Sam McCall [Fri, 12 Jul 2019 10:11:40 +0000 (10:11 +0000)]
[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed commands.

Summary:
It's common to use compiler wrappers by setting CC="gomacc clang++".
This results in both args appearing in compile_commands.json, and clang's driver
can't handle this.

This patch attempts to recognize this pattern (by looking for well-known
wrappers) and dropping argv0 in this case.

It conservatively ignores other cases for now:
 - wrappers with unknown names
 - wrappers that accept -flags
 - wrappers where the compiler to use is implied (usually cc or gcc)

This is done at the JSONCompilationDatabase level rather than somewhere more
fundamental, as (hopefully) this isn't a general conceptual problem, but a messy
aspect of the nature of the ecosystem around compile_commands.json.
i.e. compilation databases more tightly tied to the build system should not have
this problem.

Reviewers: phosek, klimek

Subscribers: llvm-commits

Tags: #llvm

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

llvm-svn: 365887

5 years agoRevert "[DwarfDebug] Dump call site debug info"
Djordje Todorovic [Fri, 12 Jul 2019 09:45:12 +0000 (09:45 +0000)]
Revert "[DwarfDebug] Dump call site debug info"

A build failure was found on the SystemZ platform.

This reverts commit 9e7e73578e54cd22b3c7af4b54274d743b6607cc.

llvm-svn: 365886

5 years ago[clangd] Move the expandAuto tweak from global namespace into annoymous namespace.
Haojian Wu [Fri, 12 Jul 2019 09:38:53 +0000 (09:38 +0000)]
[clangd] Move the expandAuto tweak from global namespace into annoymous namespace.

llvm-svn: 365885

5 years ago[Object/ELF] - Improve error reporting for notes.
George Rimar [Fri, 12 Jul 2019 09:29:12 +0000 (09:29 +0000)]
[Object/ELF] - Improve error reporting for notes.

This patch improves the error messages reported for
note sections and phdrs and also makes a cleanup for
existent test case.

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

llvm-svn: 365884

5 years ago[NFC][PowerPC] Added test for MachinePRE.
Kai Luo [Fri, 12 Jul 2019 09:10:35 +0000 (09:10 +0000)]
[NFC][PowerPC] Added test for MachinePRE.

llvm-svn: 365883

5 years ago[clangd] Don't run the prepare for tweaks that are disabled.
Haojian Wu [Fri, 12 Jul 2019 08:50:20 +0000 (08:50 +0000)]
[clangd] Don't run the prepare for tweaks that are disabled.

Summary: Previously, we ran the prepare, even for the tweaks that are disabled.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 365882

5 years ago[RISCV] Allow parsing dot '.' in assembly
Sam Elliott [Fri, 12 Jul 2019 08:36:07 +0000 (08:36 +0000)]
[RISCV] Allow parsing dot '.' in assembly

Summary:
Useful for jumps, such as `j .`.

I am not sure who should review this. Do not hesitate to change the reviewers if needed.

Reviewers: asb, jrtc27, lenary

Reviewed By: lenary

Subscribers: MaskRay, lenary, hiraditya, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, llvm-commits

Tags: #llvm

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

Patch by John LLVM (JohnLLVM)

llvm-svn: 365881

5 years agoEnable compiler-rt on SPARC
Rainer Orth [Fri, 12 Jul 2019 08:30:17 +0000 (08:30 +0000)]
Enable compiler-rt on SPARC

This patch enables compiler-rt on SPARC targets. Most of the changes are straightforward:

- Add 32 and 64-bit sparc to compiler-rt

- lib/builtins/fp_lib.h needed to check if the int128_t and uint128_t types exist (which they don't on sparc)

There's one issue of note: many asan tests fail to compile on Solaris/SPARC:

fatal error: error in backend: Function "_ZN7testing8internal16BoolFromGTestEnvEPKcb": over-aligned dynamic alloca not supported.

Therefore, while asan is still built, both asan and ubsan-with-asan testing is disabled. The
goal is to check if asan keeps compiling on Solaris/SPARC. This serves asan in gcc,
which doesn't have the problem above and works just fine.

With this patch, sparcv9-sun-solaris2.11 test results are pretty good:

Failing Tests (9):
    Builtins-sparc-sunos :: divtc3_test.c
    Builtins-sparcv9-sunos :: compiler_rt_logbl_test.c
    Builtins-sparcv9-sunos :: divtc3_test.c
[...]
    UBSan-Standalone-sparc :: TestCases/TypeCheck/misaligned.cpp
    UBSan-Standalone-sparcv9 :: TestCases/TypeCheck/misaligned.cpp

The builtin failures are due to Bugs 42493 and 42496. The tree contained a few additonal
patches either currently in review or about to be submitted.

Tested on sparcv9-sun-solaris2.11.

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

llvm-svn: 365880

5 years ago[Sanitizers] Fix SanitizerCommon-Unit :: ./Sanitizer-*-Test/MemoryMappingLayout.DumpL...
Rainer Orth [Fri, 12 Jul 2019 08:27:50 +0000 (08:27 +0000)]
[Sanitizers] Fix SanitizerCommon-Unit :: ./Sanitizer-*-Test/MemoryMappingLayout.DumpListOfModules on Solaris

The MemoryMappingLayout.DumpListOfModules currently FAILs on Solaris:

  [ RUN      ] MemoryMappingLayout.DumpListOfModules
  /vol/llvm/src/compiler-rt/local/lib/sanitizer_common/tests/sanitizer_procmaps_test.cc:52: Failure
  Value of: found
    Actual: false
  Expected: true
  [  FAILED  ] MemoryMappingLayout.DumpListOfModules (22 ms)

The problem is that the test expects the executable name from modules[i].full_name(),
however the pr_mapname field of struct prmap is just the entry in /proc/<pid>/object,
which is "a.out" instead of "Sanitizer-i386-Test".  Fortunately, the real name can
be determined by looking in proc/<pid>/path where "a.out" is a symlink to the
real path.

Tested on x86_64-pc-solaris2.11.

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

llvm-svn: 365879

5 years agoTest commit. NFC.
Bryant Wong [Fri, 12 Jul 2019 08:25:59 +0000 (08:25 +0000)]
Test commit. NFC.

Formatting fix.

llvm-svn: 365878

5 years ago[Driver] Delete --no-add-needed for RHEL7 or newer
Fangrui Song [Fri, 12 Jul 2019 06:46:47 +0000 (06:46 +0000)]
[Driver] Delete --no-add-needed for RHEL7 or newer

This is really not needed. gcc driver doesn't add this option.
BTW, since binutils 2.22, --no-copy-dt-needed-entries (new name of
--no-add-needed) is the default.

llvm-svn: 365877

5 years ago[YAMLIO] Wrap explicit specialization in llvm::yaml to appease build bots
Fangrui Song [Fri, 12 Jul 2019 06:23:24 +0000 (06:23 +0000)]
[YAMLIO] Wrap explicit specialization in llvm::yaml to appease build bots

llvm-svn: 365876

5 years agoFix odd variable names.
Rui Ueyama [Fri, 12 Jul 2019 06:12:27 +0000 (06:12 +0000)]
Fix odd variable names.

llvm-svn: 365875

5 years ago[test] Delete trailing spaces from YAML tests after D65566/r365869
Fangrui Song [Fri, 12 Jul 2019 06:01:37 +0000 (06:01 +0000)]
[test] Delete trailing spaces from YAML tests after D65566/r365869

llvm-svn: 365874

5 years ago[test] Delete trailing spaces from YAML tests
Fangrui Song [Fri, 12 Jul 2019 05:59:28 +0000 (05:59 +0000)]
[test] Delete trailing spaces from YAML tests

llvm-svn: 365873

5 years agotest/Driver/fsanitize.c: delete -target x86_64-linux-gnu from tests that should alway...
Fangrui Song [Fri, 12 Jul 2019 05:51:36 +0000 (05:51 +0000)]
test/Driver/fsanitize.c: delete -target x86_64-linux-gnu from tests that should always be available

Follow-up of D64317/r365587.

llvm-svn: 365872

5 years ago[AMDGPU] Fixed comment. NFC.
Stanislav Mekhanoshin [Fri, 12 Jul 2019 05:13:10 +0000 (05:13 +0000)]
[AMDGPU] Fixed comment. NFC.

llvm-svn: 365871

5 years ago[mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6
Simon Atanasyan [Fri, 12 Jul 2019 04:58:45 +0000 (04:58 +0000)]
[mips] Fix JmpLink to texternalsym and tglobaladdr on mcroMIPS R6

There is not match for the `MipsJmpLink texternalsym` and `MipsJmpLink
tglobaladdr` patterns for microMIPS R6. As a result LLVM incorrectly
selects the `JALRC16` compact 2-byte instruction which takes a target
instruction address from a register only and assign `R_MIPS_32` relocation
for this instruction. This relocation completely overwrites `JALRC16`
and nearby instructions.

This patch adds missed matching patterns, selects `BALC` instruction and
assign a correct `R_MICROMIPS_PC26_S1` relocation.

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

llvm-svn: 365870

5 years ago[YAMLIO] Remove trailing spaces when outputting maps
Fangrui Song [Fri, 12 Jul 2019 04:51:31 +0000 (04:51 +0000)]
[YAMLIO] Remove trailing spaces when outputting maps

llvm::yaml::Output::paddedKey unconditionally outputs spaces, which
are superfluous if the value to be dumped is a sequence or map.
Change `bool NeedsNewLine` to `StringRef Padding` so that it can be
overridden to `\n` if the value is a sequence or map.

An empty map/sequence is special. It is printed as `{}` or `[]` without
a newline, while a non-empty map/sequence follows a newline. To handle
this distinction, add another variable `PaddingBeforeContainer` and does
the special handling in endMapping/endSequence.

Reviewed By: grimar, jhenderson

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

llvm-svn: 365869

5 years ago[windows] re-call signal in sigint_handler for Windows
Nathan Lanza [Fri, 12 Jul 2019 04:43:46 +0000 (04:43 +0000)]
[windows] re-call signal in sigint_handler for Windows

Summary:
Windows requires re-setting the signal handler each time it is used
and thus ctrl-c was not behaving properly on Windows

Reviewers: jfb

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

llvm-svn: 365868

5 years ago[clangd] Implement typeHierarchy/resolve for subtypes
Nathan Ridge [Fri, 12 Jul 2019 03:26:32 +0000 (03:26 +0000)]
[clangd] Implement typeHierarchy/resolve for subtypes

Summary:
This allows the client to resolve subtypes one level at a time.

For supertypes, this is not necessary, because we eagerly compute
supertypes and return all levels.

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 365867

5 years ago[X86][PowerPC] Support -mlong-double-128
Fangrui Song [Fri, 12 Jul 2019 02:32:15 +0000 (02:32 +0000)]
[X86][PowerPC] Support -mlong-double-128

This patch makes the driver option -mlong-double-128 available for X86
and PowerPC. The CC1 option -mlong-double-128 is available on all targets
for users to test on unsupported targets.

On PowerPC, -mlong-double-128 uses the IBM extended double format
because we don't support -mabi=ieeelongdouble yet (D64283).

Reviewed By: rnk

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

llvm-svn: 365866

5 years agodocs/GithubMove.rst: Add link to GitHub migration status page
Tom Stellard [Fri, 12 Jul 2019 02:31:50 +0000 (02:31 +0000)]
docs/GithubMove.rst: Add link to GitHub migration status page

llvm-svn: 365865

5 years agoReturn Undef from isBytewiseValue for empty arrays or structs
Vitaly Buka [Fri, 12 Jul 2019 02:23:07 +0000 (02:23 +0000)]
Return Undef from isBytewiseValue for empty arrays or structs

Reviewers: pcc, eugenis

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 365864

5 years agoNFC: Unforget a colon in a few CHECK: directives.
Artem Dergachev [Fri, 12 Jul 2019 02:16:56 +0000 (02:16 +0000)]
NFC: Unforget a colon in a few CHECK: directives.

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

llvm-svn: 365863

5 years ago[PowerPC] Default to -fomit-frame-pointer when optimization is enabled
Fangrui Song [Fri, 12 Jul 2019 02:14:08 +0000 (02:14 +0000)]
[PowerPC] Default to -fomit-frame-pointer when optimization is enabled

NetBSD, Linux, CloudABI and Hurd already omit frame pointer for PowerPC.
Make it do so for other platforms.

llvm-svn: 365862

5 years ago[analyzer] exploded-graph-rewriter: Improve source location dumps.
Artem Dergachev [Fri, 12 Jul 2019 02:10:33 +0000 (02:10 +0000)]
[analyzer] exploded-graph-rewriter: Improve source location dumps.

- Correctly display macro expansion and spelling locations.
- Use the same procedure to display location context call site locations.
- Display statement IDs for program points.

llvm-svn: 365861

5 years ago[Driver] Refactor interaction between -f(no-)?omit-frame-pointer and -m(no-)?omit...
Fangrui Song [Fri, 12 Jul 2019 02:01:51 +0000 (02:01 +0000)]
[Driver] Refactor interaction between -f(no-)?omit-frame-pointer and -m(no-)?omit-leaf-frame-pointer

Use a tri-state enum to represent shouldUseFramePointer() and
shouldUseLeafFramePointer().

This simplifies the logic and fixes PR9825:
  -fno-omit-frame-pointer doesn't imply -mno-omit-leaf-frame-pointer.

and PR24003:
  /Oy- /O2 should not omit leaf frame pointer: this matches MSVC x86-32.
  (/Oy- is a no-op on MSVC x86-64.)

and:
  when CC1 option -mdisable-fp-elim if absent, -momit-leaf-frame-pointer
  can also be omitted.

The new behavior matches GCC:
  -fomit-frame-pointer wins over -mno-omit-leaf-frame-pointer
  -fno-omit-frame-pointer loses out to -momit-leaf-frame-pointer

The behavior makes lots of sense. We have 4 states:

- 00) leaf retained, non-leaf retained
- 01) leaf retained, non-leaf omitted  (this is invalid)
- 10) leaf omitted, non-leaf retained  (what -momit-leaf-frame-pointer was designed for)
- 11) leaf omitted, non-leaf omitted

"omit" options taking precedence over "no-omit" options is the only way
to make 3 valid states representable with -f(no-)?omit-frame-pointer and
-m(no-)?omit-leaf-pointer.

Reviewed By: ychen

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

llvm-svn: 365860

5 years ago[MachinePipeliner] Fix order for nodes with Anti dependence in same cycle
Jinsong Ji [Fri, 12 Jul 2019 01:59:42 +0000 (01:59 +0000)]
[MachinePipeliner] Fix order for nodes with Anti dependence in same cycle

Summary:
Problem exposed in PowerPC functional testing.

We did not consider Anti dependence for nodes in same cycle,
so we may end up generating bad machine code.
eg: the reduced test won't verify.

*** Bad machine code: Using an undefined physical register ***
- function:    lame_encode_buffer_interleaved
- basic block: %bb.4  (0x4bde4e12928)
- instruction: %29:gprc = ADDZE %27:gprc, implicit-def dead $carry, implicit $carry
- operand 3:   implicit $carry

Reviewers: bcahoon, kparzysz, hfinkel

Subscribers: MaskRay, wuzish, nemanjai, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 365859

5 years agoHandle IntToPtr in isBytewiseValue
Vitaly Buka [Fri, 12 Jul 2019 01:42:03 +0000 (01:42 +0000)]
Handle IntToPtr in isBytewiseValue

Summary:
This helps with more efficient use of memset for pattern initialization

From @pcc prototype for -ftrivial-auto-var-init=pattern optimizations

Binary size change on CTMark, (with -fuse-ld=lld -Wl,--icf=all, similar results with default linker options)
```
                   master           patch      diff
Os           8.238864e+05    8.238864e+05       0.0
O3           1.054797e+06    1.054797e+06       0.0
Os zero      8.292384e+05    8.292384e+05       0.0
O3 zero      1.062626e+06    1.062626e+06       0.0
Os pattern   8.579712e+05    8.338048e+05 -0.030299
O3 pattern   1.090502e+06    1.067574e+06 -0.020481
```

Zero vs Pattern on master
```
               zero       pattern      diff
Os     8.292384e+05  8.579712e+05  0.036578
O3     1.062626e+06  1.090502e+06  0.025124
```

Zero vs Pattern with the patch
```
               zero       pattern      diff
Os     8.292384e+05  8.338048e+05  0.003333
O3     1.062626e+06  1.067574e+06  0.003193
```

Reviewers: pcc, eugenis

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 365858

5 years agoCodegen, NFC: 32bit test in auto-var-init.cpp
Vitaly Buka [Fri, 12 Jul 2019 01:36:11 +0000 (01:36 +0000)]
Codegen, NFC: 32bit test in auto-var-init.cpp

llvm-svn: 365857

5 years agoMark destroying delete test as UNSUPPORTED with clang 7
Eric Fiselier [Fri, 12 Jul 2019 01:16:08 +0000 (01:16 +0000)]
Mark destroying delete test as UNSUPPORTED with clang 7

llvm-svn: 365856

5 years agoTolerate import errors in "not.py" implementation
Eric Fiselier [Fri, 12 Jul 2019 01:13:05 +0000 (01:13 +0000)]
Tolerate import errors in "not.py" implementation

llvm-svn: 365855

5 years agoReorganize the 'bit' header to make most of the facilities available for internal...
Marshall Clow [Fri, 12 Jul 2019 01:01:55 +0000 (01:01 +0000)]
Reorganize the 'bit' header to make most of the facilities available for internal use pre-C++20. NFC for external users

llvm-svn: 365854

5 years ago[Expression] Move IRDynamicChecks to ClangExpressionParser
Alex Langford [Fri, 12 Jul 2019 00:58:02 +0000 (00:58 +0000)]
[Expression] Move IRDynamicChecks to ClangExpressionParser

Summary:
IRDynamicChecks in its current form is specific to Clang since it deals
with the C language family. It is possible that we may want to
instrument code generated for other languages, but we can factor in a
more general mechanism to do so at a later time.

This decouples ObCLanguageRuntime from Expression!

Reviewers: compnerd, clayborg, jingham, JDevlieghere

Subscribers: mgorny, lldb-commits

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

llvm-svn: 365853

5 years agoNFC: lit: python3 compatibility for functions
Alex Lorenz [Fri, 12 Jul 2019 00:48:53 +0000 (00:48 +0000)]
NFC: lit: python3 compatibility for functions
usePlatformSdkOnDarwin/findPlatformSdkVersionOnMacOS

These functions should decode subprocess output

llvm-svn: 365852

5 years ago[InstCombine] Reorder pow() transformations (NFC)
Evandro Menezes [Fri, 12 Jul 2019 00:33:49 +0000 (00:33 +0000)]
[InstCombine] Reorder pow() transformations (NFC)

Move the transformation from `powf(x, itofp(y))` to `powi(x, y)` to the
group of transformations related to the exponent.

llvm-svn: 365851

5 years agoRe-Revert Devirtualize destructor of final class.
Jordan Rupprecht [Fri, 12 Jul 2019 00:32:08 +0000 (00:32 +0000)]
Re-Revert Devirtualize destructor of final class.

This reverts r365509 (git commit d088720edad9c29ee0d622b5d69092e18a9ac0bd)

This is a second revert[1] due to failures in internal test cases (shared offline) found during more thorough testing.

[1] Original patch commited as r364100, reverted as r364359, recommitted as r365509

llvm-svn: 365850

5 years ago[clangd] Add a missing early return in getTypeHierarchy()
Nathan Ridge [Fri, 12 Jul 2019 00:24:45 +0000 (00:24 +0000)]
[clangd] Add a missing early return in getTypeHierarchy()

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 365849

5 years agoAdd another buildbot username to the workaround list
Eric Fiselier [Fri, 12 Jul 2019 00:16:38 +0000 (00:16 +0000)]
Add another buildbot username to the workaround list

llvm-svn: 365848

5 years agoAttempt to override broken buildbot config for libc++abi.
Eric Fiselier [Fri, 12 Jul 2019 00:02:49 +0000 (00:02 +0000)]
Attempt to override broken buildbot config for libc++abi.

The buildbots were changed to pass -DLIBCXX_CXX_ABI=libcxxabi, but
they don't provide an include path for the library, so cxxabi.h is
never found while building libc++.

This is a temporary change until the buildbots are updated or until
D63883 lands in a form that unbreaks the bots

llvm-svn: 365847

5 years ago[AMDGPU] Skip calculating callee saved registers for entry function.
Michael Liao [Thu, 11 Jul 2019 23:53:30 +0000 (23:53 +0000)]
[AMDGPU] Skip calculating callee saved registers for entry function.

Reviewers: arsenm

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

Tags: #llvm

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

llvm-svn: 365846

5 years ago[CMake][Fuchsia] Use RelWithDebInfo to build runtimes
Petr Hosek [Thu, 11 Jul 2019 23:49:39 +0000 (23:49 +0000)]
[CMake][Fuchsia] Use RelWithDebInfo to build runtimes

We want to preserve debug info in our runtimes to aid symbolization and
debugging; for shared libraries this will be stripped away during
install-stripped step and distributed via .build-id, for static archives
it's part of the archive and it's a responsibility of the consumer to
strip it away in the final binary if not needed.

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

llvm-svn: 365845

5 years ago[clangd] Fix MSVC build failure.
Paul Robinson [Thu, 11 Jul 2019 23:48:06 +0000 (23:48 +0000)]
[clangd] Fix MSVC build failure.

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/26898

llvm-svn: 365844

5 years ago[Target] Replace Plugin headers with non-plugin headers
Alex Langford [Thu, 11 Jul 2019 23:45:35 +0000 (23:45 +0000)]
[Target] Replace Plugin headers with non-plugin headers

llvm-svn: 365843

5 years agoAMDGPU: s_waitcnt field should be treated as unsigned
Matt Arsenault [Thu, 11 Jul 2019 23:42:57 +0000 (23:42 +0000)]
AMDGPU: s_waitcnt field should be treated as unsigned

Also make it an ImmLeaf, so it should work with global isel as well,
which was part of the point of moving it in the first place.

llvm-svn: 365842

5 years agoUse clang driver for libfuzzer tests on Windows
Reid Kleckner [Thu, 11 Jul 2019 23:20:04 +0000 (23:20 +0000)]
Use clang driver for libfuzzer tests on Windows

Summary:
There's no real reason to use clang-cl on Windows, the clang driver
works just as well. This fixes a test which uses the -O0 flag, which was
recently removed from clang-cl to match MSVC, which lacks this flag.

While I'm here, remove the explicit -std=c++11 flag. Previously, this
flag was necessary when the default C++ standard was C++98. Now that the
default is C++14, this is no longer necessary. It's problematic on
Windows, because the Visual C++ standard library relies on C++14
features, and attempting to compile it with C++11 results in errors.
Rather than adding logic to conditionally set the standard to C++11 only
on non-Win, this flag can be removed.

See http://lab.llvm.org:8011/builders/clang-x64-windows-msvc and
https://reviews.llvm.org/D64506.

Reviewers: morehouse, thakis

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 365841

5 years agoFix memory leak in set and map.
Eric Fiselier [Thu, 11 Jul 2019 23:13:38 +0000 (23:13 +0000)]
Fix memory leak in set and map.

When assigning an initializer list into set/map, libc++ would
leak memory if the initializer list contained equivalent keys
because we failed to check if the insertion was successful.

llvm-svn: 365840

5 years ago[sancov] Ignore PC samples with value 0
Petr Hosek [Thu, 11 Jul 2019 22:59:23 +0000 (22:59 +0000)]
[sancov] Ignore PC samples with value 0

The sancov runtime for the (Fuchsia) Zircon kernel delivers results
in the standard format, but as the full array of possible samples
with 0 in uncovered slots. That runtime delivers "live" data and
has no final "export" pass to compactify out the uncovered slots,
and it seems silly to require another offline tool just for that.

Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D63695

llvm-svn: 365839

5 years ago[NewPM] Port Sancov
Leonard Chan [Thu, 11 Jul 2019 22:35:40 +0000 (22:35 +0000)]
[NewPM] Port Sancov

This patch contains a port of SanitizerCoverage to the new pass manager. This one's a bit hefty.

Changes:

- Split SanitizerCoverageModule into 2 SanitizerCoverage for passing over
  functions and ModuleSanitizerCoverage for passing over modules.
- ModuleSanitizerCoverage exists for adding 2 module level calls to initialization
  functions but only if there's a function that was instrumented by sancov.
- Added legacy and new PM wrapper classes that own instances of the 2 new classes.
- Update llvm tests and add clang tests.

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

llvm-svn: 365838

5 years ago[AMDGPU] Fixed asan error with agpr spilling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 22:30:11 +0000 (22:30 +0000)]
[AMDGPU] Fixed asan error with agpr spilling

Instruction was used after it was erased.

llvm-svn: 365837

5 years agoFix build errors LLVM tests are disabled.
Diego Novillo [Thu, 11 Jul 2019 22:08:35 +0000 (22:08 +0000)]
Fix build errors LLVM tests are disabled.

Original patch from alanbaker@google.com

Fixes the error:
CMake Error in <...>/llvm/cmake/modules/CMakeLists.txt:

export called with target "LLVMTestingSupport" which requires target
"gtest" that is not in the export set.

This occurs when LLVM is embedded in a larger project, but is configured not to
include tests. If testing is disabled gtest isn't available and LLVM fails to
configure.

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

llvm-svn: 365836

5 years agoCodeGen: Suppress c++ warnings in test
Vitaly Buka [Thu, 11 Jul 2019 21:59:09 +0000 (21:59 +0000)]
CodeGen: Suppress c++ warnings in test

llvm-svn: 365835

5 years ago[mips] Simplify test case. NFC
Simon Atanasyan [Thu, 11 Jul 2019 21:55:56 +0000 (21:55 +0000)]
[mips] Simplify test case. NFC

Before rL295040 the linker just crashed when a GOT relocation (R_MIPS_GOT16)
comes from a merge section. To ensure that this bug still fixed it's enough
to check that the linker does not crash and create GOT entries.

llvm-svn: 365834

5 years ago[AMDGPU] gfx908 agpr spilling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:54:13 +0000 (21:54 +0000)]
[AMDGPU] gfx908 agpr spilling

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

llvm-svn: 365833

5 years agoFix a Python3 compatibility error
Azharuddin Mohammed [Thu, 11 Jul 2019 21:45:48 +0000 (21:45 +0000)]
Fix a Python3 compatibility error

  File "clang/test/lit.cfg.py", line 186, in <module>
    config.available_features.add('macos-sdk-' + macOSSDKVersion)
TypeError: must be str, not bytes

llvm-svn: 365832

5 years agoRename libclang_shared to libclang-cpp
Sylvestre Ledru [Thu, 11 Jul 2019 21:42:55 +0000 (21:42 +0000)]
Rename libclang_shared to libclang-cpp

Summary: Fix bug 42475

Reviewers: beanz, tstellar

Reviewed By: beanz

Subscribers: kimgr, mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 365831

5 years ago[Attributor] Deduce "nosync" function attribute.
Stefan Stipanovic [Thu, 11 Jul 2019 21:37:40 +0000 (21:37 +0000)]
[Attributor] Deduce "nosync" function attribute.

Introduce and deduce "nosync" function attribute to indicate that a function
does not synchronize with another thread in a way that other thread might free memory.

Reviewers: jdoerfert, jfb, nhaehnle, arsenm

Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu,
dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits

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

llvm-svn: 365830

5 years ago[AMDGPU] gfx908 hazard recognizer
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:30:34 +0000 (21:30 +0000)]
[AMDGPU] gfx908 hazard recognizer

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

llvm-svn: 365829

5 years ago[InstCombine][NFCI] Add more test coverage to onehot_merge.ll
Huihui Zhang [Thu, 11 Jul 2019 21:28:25 +0000 (21:28 +0000)]
[InstCombine][NFCI] Add more test coverage to onehot_merge.ll

Prep work for upcoming patch D64275.

llvm-svn: 365828

5 years ago[analyzer] exploded-graph-rewriter: Fix filenames in program point.
Artem Dergachev [Thu, 11 Jul 2019 21:27:42 +0000 (21:27 +0000)]
[analyzer] exploded-graph-rewriter: Fix filenames in program point.

Fix a typo in JSON field name.

llvm-svn: 365827

5 years ago[AMDGPU] gfx908 scheduling
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:25:00 +0000 (21:25 +0000)]
[AMDGPU] gfx908 scheduling

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

llvm-svn: 365826

5 years ago[clang-shlib] Fix clang-shlib for PRIVATE dependencies
Shoaib Meenai [Thu, 11 Jul 2019 21:20:38 +0000 (21:20 +0000)]
[clang-shlib] Fix clang-shlib for PRIVATE dependencies

Any static library with a PRIVATE dependency ends up with a
$<LINK_ONLY:...> generator expression in its INTERFACE_LINK_LIBRARIES,
which won't be evaluated by the $<TARGET_PROPERTY:...>, so we end up
with an unevaluated generator expression in the generated build file and
Ninja chokes on the dollar sign. Just use the static library directly
for its dependencies instead of trying to propagate dependencies
manually.

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

llvm-svn: 365825

5 years ago[AMDGPU] gfx908 mfma support
Stanislav Mekhanoshin [Thu, 11 Jul 2019 21:19:33 +0000 (21:19 +0000)]
[AMDGPU] gfx908 mfma support

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

llvm-svn: 365824

5 years ago[COFF] Share the tail in delayimport symbol thunks
Martin Storsjo [Thu, 11 Jul 2019 21:19:11 +0000 (21:19 +0000)]
[COFF] Share the tail in delayimport symbol thunks

E.g. for x86_64, previously each symbol's thunk was 87 bytes. Now
there's a 12 byte thunk per symbol, plus a shared 83 byte tail
function.

This is similar to what both MS link.exe and GNU tools do for
delay imports.

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

llvm-svn: 365823

5 years agoCodeGen, NFC: Test for auto-init for 32bit pointers
Vitaly Buka [Thu, 11 Jul 2019 20:51:59 +0000 (20:51 +0000)]
CodeGen, NFC: Test for auto-init for 32bit pointers

llvm-svn: 365822

5 years ago[OPENMP]Improve handling of analysis of unsupported VLAs in reductions.
Alexey Bataev [Thu, 11 Jul 2019 20:35:31 +0000 (20:35 +0000)]
[OPENMP]Improve handling of analysis of unsupported VLAs in reductions.

Fixed the processing of the unsupported VLAs in the reduction clauses.
Used targetDiag if the diagnostics can be delayed and emit it
immediately if the target does not support VLAs and we're parsing target
directive with the reduction clauses.

llvm-svn: 365821

5 years agoOpen native file handles to avoid converting from FDs, NFC
Reid Kleckner [Thu, 11 Jul 2019 20:29:32 +0000 (20:29 +0000)]
Open native file handles to avoid converting from FDs, NFC

Follow up to r365588.

llvm-svn: 365820

5 years agoAdd convenience methods to convert LLDB to LLVM data structures.
Jonas Devlieghere [Thu, 11 Jul 2019 20:26:53 +0000 (20:26 +0000)]
Add convenience methods to convert LLDB to LLVM data structures.

This patch adds two convenience methods named GetAsLLVM to the LLDB
counterparts of the DWARF DataExtractor and the DWARF context. The
DWARFContext, once created, is cached for future usage.

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

llvm-svn: 365819

5 years ago[UpdateTestChecks] Emit warning when invalid test paths
David Bolvansky [Thu, 11 Jul 2019 20:14:22 +0000 (20:14 +0000)]
[UpdateTestChecks] Emit warning when invalid test paths

Summary:
Recently I ran into the following issue:

./update_test_checks.py /path/not-existing-file.ll

The script was silent and I was suprised why the real test file hadn't been updated.

Solution:
Emit warning if we detect this problem.

Reviewers: lebedev.ri, spatel, jdoerfert, nikic

Reviewed By: lebedev.ri, spatel, jdoerfert, nikic

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 365818

5 years ago[libomptarget-nvptx] Remove dead functions
Jonas Hahnfeld [Thu, 11 Jul 2019 20:12:51 +0000 (20:12 +0000)]
[libomptarget-nvptx] Remove dead functions

These entry points are never called by Clang trunk nor clang-ykt. If
XL doesn't use them either, they can finally go away.

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

llvm-svn: 365817

5 years ago[scudo][standalone] NFC corrections
Kostya Kortchinsky [Thu, 11 Jul 2019 19:55:53 +0000 (19:55 +0000)]
[scudo][standalone] NFC corrections

Summary:
A few corrections:
- rename `TransferBatch::MaxCached` to `getMaxCached` to conform with
  the style guide;
- move `getBlockBegin` from `Chunk::` to `Allocator::`: I believe it
  was a fallacy to have this be a `Chunk` method, as chunks'
  relationship to backend blocks are up to the frontend allocator. It
  makes more sense now, particularly with regard to the offset. Update
  the associated chunk test as the method isn't available there
  anymore;
- add a forgotten `\n` to a log string;
- for `releaseToOs`, instead of starting at `1`, start at `0` and
  `continue` on `BatchClassId`: in the end it's identical but doesn't
  assume a particular class id for batches;
- change a `CHECK` to a `reportOutOfMemory`: it's a clearer message

Reviewers: hctim, morehouse, eugenis, vitalybuka

Reviewed By: hctim

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 365816

5 years ago[NFC] Revisited tests for D64285
David Bolvansky [Thu, 11 Jul 2019 19:39:20 +0000 (19:39 +0000)]
[NFC] Revisited tests for D64285

llvm-svn: 365815

5 years agoRevert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC"
Vedant Kumar [Thu, 11 Jul 2019 19:28:07 +0000 (19:28 +0000)]
Revert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC"

This reverts commit 1af41074445229fea66b99710a850e5f42ecfa95.

llvm-svn: 365814

5 years ago[lldb] Make TestDeletedExecutable more reliable
Raphael Isemann [Thu, 11 Jul 2019 19:27:33 +0000 (19:27 +0000)]
[lldb] Make TestDeletedExecutable more reliable

Summary:
It seems that calling Popen can return to the caller before the started process has read all the needed information
from its executable. This means that in case we delete the executable while the process is still starting up,
this test will create a zombie process which in turn leads to a failing test. On my macOS system this happens quite frequently.

This patch fixes this by letting the test synchronize with the inferior after it has started up.

Reviewers: davide

Reviewed By: davide

Subscribers: labath, friss, lldb-commits

Tags: #lldb

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

llvm-svn: 365813

5 years ago[lldb] Don't use __FUNCTION__ as a file name
Raphael Isemann [Thu, 11 Jul 2019 19:26:55 +0000 (19:26 +0000)]
[lldb] Don't use __FUNCTION__ as a file name

Summary:
I saw while debugging that we call this file `ParseInternal`, which is not a very good name for our
fake expression file and also adds this unnecessary link between the way we name this function
and the other source location names we get from the expression parser. This patch is renaming
it to `<lldb-expr>` which is closer to the way Clang names its buffers, it doesn't depend on the
function name (which changes when I refactor this code) and it's easier to grep for.

Reviewers: davide

Reviewed By: davide

Subscribers: abidh, lldb-commits

Tags: #lldb

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

llvm-svn: 365812

5 years ago[NVPTX] Remove now unused atomic.load.add.f32 intrinsics
Benjamin Kramer [Thu, 11 Jul 2019 19:21:59 +0000 (19:21 +0000)]
[NVPTX] Remove now unused atomic.load.add.f32 intrinsics

llvm-svn: 365811

5 years ago[PowerPC][NFC] Update testcase to avoid dead code
Jinsong Ji [Thu, 11 Jul 2019 19:16:33 +0000 (19:16 +0000)]
[PowerPC][NFC] Update testcase to avoid dead code

The original testcase might be optimized out due to dead code,
update the testcase to avoid it.

llvm-svn: 365810

5 years ago[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC
Vedant Kumar [Thu, 11 Jul 2019 19:11:46 +0000 (19:11 +0000)]
[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC

Replace a `llvm::Function *` parameter with a bool, which seems harder
to set to the wrong value by accident.

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

llvm-svn: 365809

5 years ago[Driver] -noprofilelib flag
Petr Hosek [Thu, 11 Jul 2019 19:06:38 +0000 (19:06 +0000)]
[Driver] -noprofilelib flag

This flag is analoguous to other flags like -nostdlib or -nolibc
and could be used to disable linking of profile runtime library.
This is useful in certain environments like kernel, where profile
instrumentation is still desirable, but we cannot use the standard
runtime library.

llvm-svn: 365808

5 years ago[lld-link] implement -thinlto-{prefix,object-suffix}-replace
Bob Haarman [Thu, 11 Jul 2019 18:48:58 +0000 (18:48 +0000)]
[lld-link] implement -thinlto-{prefix,object-suffix}-replace

Summary:
Adds the following two options to lld-link:

-thinlto-prefix-replace: allows replacing a prefix in paths generated
for ThinLTO. This can be used to ensure index files and native object
files are stored in unique directories, allowing multiple distributed
ThinLTO links to proceed concurrently.

-thinlto-object-suffix-replace: allows replacing a suffix in object
file paths involved in ThinLTO. This allows minimized index files to
be used for the thin link while storing the paths to the full bitcode
files for subsequent steps (code generation and final linking).

Reviewers: ruiu, tejohnson, pcc, rnk

Subscribers: mehdi_amini, steven_wu, dexonsmith, llvm-commits

Tags: #llvm

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

llvm-svn: 365807

5 years ago[TSan] Move DECLARE_REAL macro outside of namespace
Julian Lettner [Thu, 11 Jul 2019 18:26:33 +0000 (18:26 +0000)]
[TSan] Move DECLARE_REAL macro outside of namespace

This should fix the "undefined reference to
tsan::interception::real_setjmp" linker errors.

llvm-svn: 365806

5 years ago[profile][test] Fix Profile-* :: instrprof-merge.c etc. on SPARC
Rainer Orth [Thu, 11 Jul 2019 18:26:24 +0000 (18:26 +0000)]
[profile][test] Fix Profile-* :: instrprof-merge.c etc. on SPARC

While working on https://reviews.llvm.org/D40900 (which effectively is about enabling compiler-rt on sparc these days), I came across two failing profile testcases:

  Profile-sparc :: instrprof-merge-match.test
  Profile-sparc :: instrprof-merge.c
  Profile-sparcv9 :: instrprof-merge-match.test
  Profile-sparcv9 :: instrprof-merge.c

All of them crashed with a SIGBUS in __llvm_profile_merge_from_buffer:

  Thread 2 received signal SIGSEGV, Segmentation fault.
  [Switching to Thread 1 (LWP 1)]
  0x00012368 in __llvm_profile_merge_from_buffer (
      ProfileData=0x2384c <main.Buffer> "\377lprofR\201", ProfileSize=360)
      at /vol/llvm/src/llvm/local/projects/compiler-rt/lib/profile/InstrProfilingMerge.c:95
  95        SrcDataEnd = SrcDataStart + Header->DataSize;

where Header is insufficiently aligned for a strict-alignment target like SPARC.

Fixed by forcing the alignment to uint64_t, the members of struct __llvm_profile_header,
in the callers.

Tested on sparcv9-sun-solaris2.11.

https://reviews.llvm.org/D64498

llvm-svn: 365805

5 years ago[clangd][NFC] Decrease template depth limit in RecursiveHierarchyUnbounded test
Jan Korous [Thu, 11 Jul 2019 18:21:21 +0000 (18:21 +0000)]
[clangd][NFC] Decrease template depth limit in RecursiveHierarchyUnbounded test

...to minimize the chance of stack overflow before reaching the limit.

llvm-svn: 365804

5 years ago[X86] Pre commit test cases for D64574. Along with a test case for PR42571. NFC
Craig Topper [Thu, 11 Jul 2019 18:19:27 +0000 (18:19 +0000)]
[X86] Pre commit test cases for D64574. Along with a test case for PR42571. NFC

llvm-svn: 365803

5 years ago[WebAssembly] Assembler: support negative float constants.
Wouter van Oortmerssen [Thu, 11 Jul 2019 18:18:07 +0000 (18:18 +0000)]
[WebAssembly] Assembler: support negative float constants.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 365802

5 years agoExplicitly define __STDC_FORMAT_MACROS for PRIu64
Mitch Phillips [Thu, 11 Jul 2019 18:07:03 +0000 (18:07 +0000)]
Explicitly define __STDC_FORMAT_MACROS for PRIu64

Summary:
Builds are failing on RHEL machines because of PRIu64.

lvm/projects/compiler-rt/lib/gwp_asan/guarded_pool_allocator.cpp:420:50: error: expected ')'

`snprintf(ThreadBuffer, kThreadBufferLen, "%" PRIu64, ThreadID);`
inttypes.h in RHEL uses PRIu64 macros only when __STDC_FORMAT_MACROS is defined.

Author: DTharun

Reviewers: hctim

Reviewed By: hctim

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

llvm-svn: 365801

5 years ago[lld-link] implement -thinlto-index-only
Bob Haarman [Thu, 11 Jul 2019 18:03:14 +0000 (18:03 +0000)]
[lld-link] implement -thinlto-index-only

Summary:
This implements -thinlto-index-only, -thinlto-index-only:,
and -thinlto-emit-imports-files options in lld-link. They are
analogous to their counterparts in ld.lld: -thinlto-index-only
causes us to perform ThinLTO's thin link and write index files,
but not perform code generation. -thinlto-index-only: does the
same, but also writes a text file listing the native object
files expected to be generated. -thinlto-emit-imports-files
creates a text file next to each index file, listing the files
to import from.

Reviewers: ruiu, tejohnson, pcc, rnk

Subscribers: mehdi_amini, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 365800