platform/upstream/llvm.git
4 years agoFix FastISel dropping srcloc metadata from InlineAsm
Amanieu d'Antras [Sat, 13 Jun 2020 07:16:58 +0000 (08:16 +0100)]
Fix FastISel dropping srcloc metadata from InlineAsm

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

I've also added the Extra_IsConvergent flag which was missing from FastISel.

Reviewers: echristo

Reviewed By: echristo

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lldb][test] Trying to fix build bot after 0431e4bcb27bba30156ac49be4c09ac632c5a03a
Xing GUO [Sat, 13 Jun 2020 15:53:13 +0000 (23:53 +0800)]
[lldb][test] Trying to fix build bot after 0431e4bcb27bba30156ac49be4c09ac632c5a03a

4 years agoRecommit "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`."
Xing GUO [Sat, 13 Jun 2020 14:04:51 +0000 (22:04 +0800)]
Recommit "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`."

This recommits fcc0c186e9cea0af644581069058f0e00469d20e

4 years ago[clang][NFC] Pack LambdaExpr
Bruno Ricci [Sat, 13 Jun 2020 13:17:03 +0000 (14:17 +0100)]
[clang][NFC] Pack LambdaExpr

This saves sizeof(void *) bytes per LambdaExpr.

Review-after-commit since this is a straightforward change similar
to the work done on other nodes. NFC.

4 years ago[clang-format] Fix short block when braking after control statement
mydeveloperday [Sat, 13 Jun 2020 13:17:01 +0000 (14:17 +0100)]
[clang-format] Fix short block when braking after control statement

Summary:
This patch fixes bug #44192

When clang-format is run with option AllowShortBlocksOnASingleLine, it is expected to either succeed in putting the short block with its control statement on a single line or fail and leave the block as is. When brace wrapping after control statement is activated, if the block + the control statement length is superior to column limit but the block alone is not, clang-format puts the block in two lines: one for the control statement and one for the block. This patch removes this unexpected behaviour. Current unittests are updated to check for this behaviour.

Patch By: Bouska

Reviewed By: MyDeveloperDay

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

4 years ago[clang][NFC] Add an AST dump test for LambdaExpr
Bruno Ricci [Sat, 13 Jun 2020 13:03:25 +0000 (14:03 +0100)]
[clang][NFC] Add an AST dump test for LambdaExpr

This test illustrate the bug fixed in D81787.

4 years ago[clang][NFC] Mark CWG 1443 (Default arguments and non-static data members)...
Bruno Ricci [Sat, 13 Jun 2020 12:59:54 +0000 (13:59 +0100)]
[clang][NFC] Mark CWG 1443 (Default arguments and non-static data members)...

...as done. This is a NAD which has always been implemented correctly.

4 years ago[clang][NFC] Mark CWG 974 and 1814 (default argument in a...
Bruno Ricci [Sat, 13 Jun 2020 12:49:07 +0000 (13:49 +0100)]
[clang][NFC] Mark CWG 974 and 1814 (default argument in a...

...lambda-expression) as done. They have been allowed since at least clang 3.3.

4 years agoRevert "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`."
Xing GUO [Sat, 13 Jun 2020 09:57:02 +0000 (17:57 +0800)]
Revert "[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`."

This reverts commit fcc0c186e9cea0af644581069058f0e00469d20e.

4 years ago[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`.
Xing GUO [Sat, 13 Jun 2020 09:45:09 +0000 (17:45 +0800)]
[DWARFYAML][debug_line] Replace `InitialLength` with `Format` and `Length`.

4 years agoReapply [LVI] Restructure caching to fix non-determinism
Nikita Popov [Sat, 16 Nov 2019 15:22:18 +0000 (16:22 +0100)]
Reapply [LVI] Restructure caching to fix non-determinism

This was reverted due to a reported memory usage increase. However,
a test case was never provided, and I wasn't able to reproduce it
myself.

Relative to the original patch, I have moved the block cache
structure behind a unique_ptr, to avoid storing a huge structure
inside a DenseMap.

---

Variant on D70103 to fix https://bugs.llvm.org/show_bug.cgi?id=43909.
The caching is switched to always use a BB to cache entry map, which
then contains per-value caches. A separate set contains value handles
with a deletion callback. This allows us to properly invalidate
overdefined values.

A possible alternative would be to always cache by value first and
have per-BB maps/sets in the each cache entry. In that case we could
use a ValueMap and would avoid the separate value handle set. I went
with the BB indexing at the top level to make it easier to integrate
D69914, but possibly that's not the right choice.

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

4 years ago[libunwind][RISCV] Track PC separately from RA
Amanieu d'Antras [Sat, 13 Jun 2020 06:57:48 +0000 (07:57 +0100)]
[libunwind][RISCV] Track PC separately from RA

Summary:
This allows unwinding to work across signal handler frames where the IP of the previous frame is not the same as the current value of the RA register. This is particularly useful for acquiring backtraces from signal handlers.

I kept the size of the context structure the same to avoid ABI breakage; the PC is stored in the previously unused slot for register 0.

Reviewers: #libunwind, mhorne, lenary, luismarques, arichardson, compnerd

Reviewed By: #libunwind, mhorne, lenary, compnerd

Subscribers: kamleshbhalui, jrtc27, bsdjhb, arichardson, compnerd, simoncook, kito-cheng, shiva0217, rogfer01, rkruppe, psnobl, benna, Jim, s.egerton, sameer.abuasal, evandro, llvm-commits, libcxx-commits

Tags: #libunwind, #llvm

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

4 years ago[lldb] Remove unnecessary c_str() in OutputFormattedHelpText calls (NFC)
Jonas Devlieghere [Sat, 13 Jun 2020 04:13:20 +0000 (21:13 -0700)]
[lldb] Remove unnecessary c_str() in OutputFormattedHelpText calls (NFC)

4 years ago[lldb] Small improvements in ValueObjectPrinter::PrintDecl (NFC)
Jonas Devlieghere [Sat, 13 Jun 2020 04:01:37 +0000 (21:01 -0700)]
[lldb] Small improvements in ValueObjectPrinter::PrintDecl (NFC)

Remove unused argument, simply code and reformat.

4 years ago[X86] Remove brand_id check from getHostCPUName.
Craig Topper [Sat, 13 Jun 2020 03:38:30 +0000 (20:38 -0700)]
[X86] Remove brand_id check from getHostCPUName.

Brand index was a feature some Pentium III and Pentium 4 CPUs.
It provided an index into a software lookup table to provide a
brand name for the CPU. This is separate from the family/model.

It's unclear to me why this index being non-zero was used to
block checking family/model. I think the effect of this is that
-march=native was not working correctly on the CPUs that have a
non-zero brand index. They are all about 20 years old so this
probably hasn't affected many users.

4 years ago[X86] Remove brand_id check from cpu_indicator_init.
Craig Topper [Sat, 13 Jun 2020 03:35:47 +0000 (20:35 -0700)]
[X86] Remove brand_id check from cpu_indicator_init.

Brand index was a feature some Pentium III and Pentium 4 CPUs.
It provided an index into a software lookup table to provide a
brand name for the CPU. This is separate from the family/model.

It's unclear to me why this index being non-zero was used to
block checking family/model. None of the CPUs that had a non-zero
brand index are supported by __builtin_cpu_is or target
multi-versioning so this should have no real effect.

4 years agoFix GCC5 build by renaming variable used in 'auto' deduction (NFC)
Mehdi Amini [Sat, 13 Jun 2020 02:52:55 +0000 (02:52 +0000)]
Fix GCC5 build by renaming variable used in 'auto' deduction (NFC)

GCC5 errors out with:

llvm/lib/Analysis/StackSafetyAnalysis.cpp:935:21: error: use of 'KV' before deduction of 'auto'
     for (auto &KV : KV.second.Params) {
                     ^

4 years ago[WebAssembly] WebAssembly doesn't support "protected" visibility
Dan Gohman [Wed, 10 Jun 2020 00:34:55 +0000 (17:34 -0700)]
[WebAssembly] WebAssembly doesn't support "protected" visibility

Implement the `hasProtectedVisibility()` hook to indicate that, like
Darwin, WebAssembly doesn't support "protected" visibility.

On ELF, "protected" visibility is intended to be an optimization, however
in practice it often [isn't], and ELF documentation generally ranges from
[not mentioning it at all] to [strongly discouraging its use].

[isn't]: https://www.airs.com/blog/archives/307
[not mentioning it at all]: https://gcc.gnu.org/wiki/Visibility
[strongly discouraging its use]: https://www.akkadia.org/drepper/dsohowto.pdf

While here, also mention the new Reactor support in the release notes.

4 years ago[X86] Combine the three feature variables in getHostCPUName into an array and pass...
Craig Topper [Sat, 13 Jun 2020 00:13:49 +0000 (17:13 -0700)]
[X86] Combine the three feature variables in getHostCPUName into an array and pass it around as an array reference.

This makes the setting and clearing of bits simpler.

4 years ago[X86] Combine to two feature variables in __cpu_indicator_init into an array and...
Craig Topper [Sat, 13 Jun 2020 00:13:04 +0000 (17:13 -0700)]
[X86] Combine to two feature variables in __cpu_indicator_init into an array and pass them around as pointer we can treat as an array.

This simplifies the indexing code to set and test bits.

4 years ago[X86] Explicitly initialize __cpu_features2 global in compiler-rt to 0.
Craig Topper [Sat, 13 Jun 2020 00:09:17 +0000 (17:09 -0700)]
[X86] Explicitly initialize __cpu_features2 global in compiler-rt to 0.

Seems like this may be needed in order for the linker to find the
symbol. At least on my Mac.

4 years ago[StackSafety] Run ThinLTO
Vitaly Buka [Fri, 5 Jun 2020 08:11:35 +0000 (01:11 -0700)]
[StackSafety] Run ThinLTO

Summary:
ThinLTO linking runs dataflow processing on collected
function parameters. Then StackSafetyGlobalInfoWrapperPass
in ThinLTO backend will run as usual looking up to external
symbol in the summary if needed.

Depends on D80985.

Reviewers: eugenis, pcc

Reviewed By: eugenis

Subscribers: inglorion, hiraditya, steven_wu, dexonsmith, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[StackSafety,NFC] Extract addOverflowNever
Vitaly Buka [Sat, 13 Jun 2020 00:41:28 +0000 (17:41 -0700)]
[StackSafety,NFC] Extract addOverflowNever

4 years ago[flang] Add the helper class for building fir.do_loop operations. A fir.do_loop model...
Eric Schweitz [Thu, 11 Jun 2020 20:56:12 +0000 (13:56 -0700)]
[flang] Add the helper class for building fir.do_loop operations. A fir.do_loop models the semantics of a Fortran DO loop construct. One can use this operation to explicitly capture a DO loop for passing into the high-level optimizer.

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

4 years ago[MLIR][SPIRVToLLVM] Implemented shift conversion pattern
George Mitenkov [Fri, 12 Jun 2020 23:04:17 +0000 (19:04 -0400)]
[MLIR][SPIRVToLLVM] Implemented shift conversion pattern

This patch has shift ops conversion implementation. In SPIR-V dialect,
`Shift` and `Base` may have different bit width. On the contrary,
in LLVM dialect both `Base` and `Shift` have to be of the same bit width.
This leads to the following cases:
- if `Base` has the same bit width as `Shift`, the conversion is
  straightforward.
- if `Base` has a greater bit width than `Shift`, shift is sign/zero
  extended first. Then the extended value is passed to the shift.
- otherwise the conversion is considered to be illegal.

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

4 years ago[lldb/Test] Assert that no targets or modules remain after a test completes.
Jonas Devlieghere [Fri, 12 Jun 2020 22:12:55 +0000 (15:12 -0700)]
[lldb/Test] Assert that no targets or modules remain after a test completes.

The reproducer intentionally leak every object allocated during replay,
which means that modules never get orphaned. If this were to happen for
another reason, we might not be testing what we think we are. Assert
that there are no targets left at the end of a test and that the global
module cache is empty in the non-reproducer scenario.

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

4 years ago[flang] Added test for specification expressions
Pete Steinfeld [Fri, 12 Jun 2020 19:42:51 +0000 (12:42 -0700)]
[flang] Added test for specification expressions

I added a test the exercises all of the cases instances of specification expressions as defined in section 10.1.11.

Summary: [flang] Added test for specification expressions

Reviewers: tskeith, klausler, DavidTruby

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[mlir][spirv] Enhance structure type member decoration handling
HazemAbdelhafez [Wed, 10 Jun 2020 23:15:55 +0000 (19:15 -0400)]
[mlir][spirv] Enhance structure type member decoration handling

Modify structure type in SPIR-V dialect to support:
1) Multiple decorations per structure member
2) Key-value based decorations (e.g., MatrixStride)

This commit kept the Offset decoration separate from members'
decorations container for easier implementation and logical clarity.
As such, all references to Structure layoutinfo are now offsetinfo,
and any member layout defining decoration (e.g., RowMajor for Matrix)
will be add to the members' decorations container along with its
value if any.

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

4 years ago[libcxx][test] Silence MSVC signed-to-unsigned implicit conversion warnings
Casey Carter [Fri, 12 Jun 2020 21:54:51 +0000 (14:54 -0700)]
[libcxx][test] Silence MSVC signed-to-unsigned implicit conversion warnings

4 years ago[lldb/Test] Fix unit test suffixes and add a CMake error.
Jonas Devlieghere [Fri, 12 Jun 2020 21:17:20 +0000 (14:17 -0700)]
[lldb/Test] Fix unit test suffixes and add a CMake error.

Lit will only look for unittest targets ending in `Tests`. Add an error
when the target doesn't have the `Tests` suffix.

4 years ago[WebAssembly] Add intrinsic for i64x2.mul
Thomas Lively [Fri, 12 Jun 2020 21:08:18 +0000 (14:08 -0700)]
[WebAssembly] Add intrinsic for i64x2.mul

Summary:
This instruction was implemented in 3181273be7, but that commit did
not add an intrinsic for it.

Reviewers: aheejin

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

Tags: #clang

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

4 years agoTemporarily revert "[MemCpyOptimizer] Simplify API of processStore and processMem...
Eric Christopher [Fri, 12 Jun 2020 21:00:32 +0000 (14:00 -0700)]
Temporarily revert "[MemCpyOptimizer] Simplify API of processStore and processMem* functions"
as it seems to be causing some internal crashes in AA after
email with the author.

This reverts commit f79e6a8847aa330cac6837168d02f6b319024858.

4 years ago[lldb/Test] Fix unittest name
Jonas Devlieghere [Fri, 12 Jun 2020 21:00:57 +0000 (14:00 -0700)]
[lldb/Test] Fix unittest name

Lit looks for the Tests prefix in the unit test name.

4 years ago[NFCI][MachineCopyPropagation] invalidateRegister(): use SmallSet<8> instead of DenseSet.
Roman Lebedev [Fri, 12 Jun 2020 16:08:01 +0000 (19:08 +0300)]
[NFCI][MachineCopyPropagation] invalidateRegister(): use SmallSet<8> instead of DenseSet.

This decreases the time consumed by the pass [during RawSpeed unity build]
by 25% (0.0586 s -> 0.04388 s).

While that isn't really impressive overall, that wasn't the goal here.
The memory results here are noticeable.
The baseline results are:
```
total runtime: 55.65s.
calls to allocation functions: 19754254 (354960/s)
temporary memory allocations: 4951609 (88974/s)
peak heap memory consumption: 239.13MB
peak RSS (including heaptrack overhead): 463.79MB
total memory leaked: 198.01MB
```
While with this patch the results are:
```
total runtime: 55.37s.
calls to allocation functions: 19068237 (344403/s)   # -3.47 %
temporary memory allocations: 4261772 (76974/s)      # -13.93 % (!!!)
peak heap memory consumption: 239.13MB
peak RSS (including heaptrack overhead): 463.73MB
total memory leaked: 198.01MB
```

So we get rid of *a lot* of temporary allocations.

Using `SmallSet<8>` makes sense to me because at least here
for x86 BdVer2, the size of that set is *never* more than 3,
over all of llvm test-suite + RawSpeed.

The story might be different on other targets,
not sure if it will ever justify whole DenseSet,
but if it does SmallDenseSet might be a compromise.

4 years ago[NFCI] VectorCombine: add statistic for bitcast(shuf()) -> shuf(bitcast()) xform
Roman Lebedev [Fri, 12 Jun 2020 17:49:38 +0000 (20:49 +0300)]
[NFCI] VectorCombine: add statistic for bitcast(shuf()) -> shuf(bitcast()) xform

4 years ago[NFC] OpenMPOpt: add a statistic for num of parallel regions deleted
Roman Lebedev [Fri, 12 Jun 2020 15:11:34 +0000 (18:11 +0300)]
[NFC] OpenMPOpt: add a statistic for num of parallel regions deleted

4 years agoAdd GNU idutils tag filename to .gitignore.
Kazushi (Jam) Marukawa [Fri, 12 Jun 2020 20:05:08 +0000 (16:05 -0400)]
Add GNU idutils tag filename to .gitignore.

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

4 years ago[MC] Changes to help improve target specific symbol disassembly
Ronak Chauhan [Fri, 12 Jun 2020 18:00:33 +0000 (14:00 -0400)]
[MC] Changes to help improve target specific symbol disassembly

Summary:
This commit slightly modifies the MCDisassembler, and llvm-objdump to
allow targets to also decode entire symbols.

WebAssembly uses the onSymbolStart hook it to decode preludes.
WebAssembly partially disassembles the symbol in its target specific
way; and then falls back to the normal flow of llvm-objdump.

AMDGPU needs it to decode kernel descriptors entirely, and move to the
next symbol.

This commit is to split the above task into 2.
- Changes to llvm-objdump and MC-layer without breaking WebAssembly code
  [ this commit ]
- AMDGPU's implementation of onSymbolStart that decodes kernel
  descriptors. [ https://reviews.llvm.org/D80713 ]

Reviewers: scott.linder, t-tye, sunfish, arsenm, jhenderson, MaskRay, aardappel

Reviewed By: scott.linder, jhenderson, aardappel

Subscribers: bcain, dschuff, wdng, tpr, sbc100, jgravelle-google, hiraditya, aheejin, MaskRay, rupprecht, llvm-commits

Tags: #llvm

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

4 years ago[SVE] Break dependency of Type.h on DerivedTypes.h
Christopher Tetreault [Fri, 12 Jun 2020 18:02:07 +0000 (11:02 -0700)]
[SVE] Break dependency of Type.h on DerivedTypes.h

Summary:
Inline functions in Type.h depended upon inline functions isVectorTy and
getScalarType defined in DerivedTypes.h. Reimplement these functions in
Type.h in terms of Type

Reviewers: rengolin, efriedma, echristo, c-rhodes, david-arm

Reviewed By: echristo

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years agollvm-dwarfdump: Include unit count in DWP index header dumping
David Blaikie [Fri, 12 Jun 2020 19:39:08 +0000 (12:39 -0700)]
llvm-dwarfdump: Include unit count in DWP index header dumping

And add comma separators (to be consistent with recent
changes/improvements to the dumping of other section headers) while I'm
here.

4 years ago[CMake] Use 'ssh.py' executor to run the remote library tests.
Vladimir Vereschaka [Fri, 12 Jun 2020 18:16:02 +0000 (11:16 -0700)]
[CMake] Use 'ssh.py' executor to run the remote library tests.

In order to support the libcxx new format changes SSHExecutor was
replaced with ssh.py script in the following way:

LIBxxx_EXECUTOR="<llvm-root>/libcxx/utils/ssh.py --host <username>@<host>"

See 96e6cbbf941d0f937b7e823433d4c222967a1817 commit for details.

4 years ago[amdgpu] Skip OR combining on 64-bit integer before legalizing ops.
Michael Liao [Thu, 4 Jun 2020 06:00:06 +0000 (02:00 -0400)]
[amdgpu] Skip OR combining on 64-bit integer before legalizing ops.

Reviewers: arsenm, rampitec

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

Tags: #llvm

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

4 years agoRevert "[analyzer][NFC] Don't allow dependency checkers to emit diagnostics"
Sterling Augustine [Fri, 12 Jun 2020 18:11:20 +0000 (11:11 -0700)]
Revert "[analyzer][NFC] Don't allow dependency checkers to emit diagnostics"

Summary:
This reverts commit 33fb9cbe211d1b43d4b84edf34e11001f04cddf0.

That commit violates layering by adding a dependency from StaticAnalyzer/Core
back to StaticAnalyzer/FrontEnd, creating a circular dependency.

I can't see a clean way to fix it except refactoring.

Reviewers: echristo, Szelethus, martong

Subscribers: xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy, dkrupp, Charusso, ASDenysPetrov, cfe-commits

Tags: #clang

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

4 years agoUpdate Kaleidoscope tutorial inline code
Erich Keane [Fri, 12 Jun 2020 19:01:21 +0000 (12:01 -0700)]
Update Kaleidoscope tutorial inline code

Reported on IRC, the tutorial code at the bottom of the page correctly
namespaces the FunctionPassManager, but the as-you-go code does not.
This patch adds the namespace to those.

4 years ago[libc++] Add missing sitedir to local Lit config
Louis Dionne [Fri, 12 Jun 2020 18:57:03 +0000 (14:57 -0400)]
[libc++] Add missing sitedir to local Lit config

It relied on the site dir being added by a previous config file.

4 years ago[AMDGPU] Sorted targets in amdgpu-features.cl. NFC.
Stanislav Mekhanoshin [Fri, 12 Jun 2020 18:54:12 +0000 (11:54 -0700)]
[AMDGPU] Sorted targets in amdgpu-features.cl. NFC.

4 years ago[libcxx][test] include <algorithm> for is_permutation
Casey Carter [Fri, 12 Jun 2020 18:53:53 +0000 (11:53 -0700)]
[libcxx][test] include <algorithm> for is_permutation

4 years ago[AArch64][GlobalISel] Legalize vector G_PTR_ADD and enable selection.
Amara Emerson [Mon, 8 Jun 2020 19:02:04 +0000 (12:02 -0700)]
[AArch64][GlobalISel] Legalize vector G_PTR_ADD and enable selection.

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

4 years ago[ARM] Always use reductions intrinsics under MVE
David Green [Fri, 12 Jun 2020 10:35:03 +0000 (11:35 +0100)]
[ARM] Always use reductions intrinsics under MVE

Similar to a recent change to the X86 backend, this changes things so
that we always produce a reduction intrinsics for all reduction types,
not just the legal ones. This gives a better chance in the backend to
custom lower them to something more suitable for MVE. Especially for
something like fadd the in-order reduction produced during DAG lowering
is already better than the shuffles produced in the midend, and we can
do even better with a bit of custom lowering.

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

4 years ago[TableGen] Make behavior of getValueAsListOfStrings consistent with getValueAsString
Daniel Grumberg [Wed, 10 Jun 2020 17:05:10 +0000 (18:05 +0100)]
[TableGen] Make behavior of getValueAsListOfStrings consistent with getValueAsString

4 years ago[libc++] Remove obsolete 'newlib' Lit Feature
Louis Dionne [Fri, 12 Jun 2020 15:04:42 +0000 (11:04 -0400)]
[libc++] Remove obsolete 'newlib' Lit Feature

The feature isn't defined anywhere, so it's effectively dead.

4 years ago[libc++] Migrate Lit platform detection to the DSL
Louis Dionne [Fri, 17 Apr 2020 20:00:58 +0000 (16:00 -0400)]
[libc++] Migrate Lit platform detection to the DSL

As an important fly-by fix, also make sure we set those features to their
value on the target we run on, not on the host compiling the test suite.

4 years ago[Lit] Pass through SSH_AUTH_SOCK from the surrounding environment
Louis Dionne [Fri, 12 Jun 2020 17:58:09 +0000 (13:58 -0400)]
[Lit] Pass through SSH_AUTH_SOCK from the surrounding environment

This allows running Lit tests that run ssh without having to manually
enter a password (which is inconvenient), by just having ssh-agent
setup properly when running the test suite.

4 years ago[DAGCombine] Generalize the case (add (or x, c1), c2) -> (add x, (c1 + c2))
Michael Liao [Thu, 4 Jun 2020 06:01:49 +0000 (02:01 -0400)]
[DAGCombine] Generalize the case (add (or x, c1), c2) -> (add x, (c1 + c2))

Reviewers: arsenm

Subscribers: sdardis, wdng, hiraditya, asb, rbar, johnrusso, simoncook, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, ecnelises, llvm-commits

Tags: #llvm

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

4 years agoDon't diagnose a redeclaration of a deduction guide if the prior
Richard Smith [Fri, 12 Jun 2020 17:27:48 +0000 (10:27 -0700)]
Don't diagnose a redeclaration of a deduction guide if the prior
declaration is not visible.

In passing, add a test for a similar case of conflicting redeclarations
of internal-linkage structured bindings. (This case already works).

4 years ago[flang] Dodge bogus uninitialized data warning from gcc 10.1 via code cleanup
peter klausler [Fri, 12 Jun 2020 17:05:04 +0000 (10:05 -0700)]
[flang] Dodge bogus uninitialized data warning from gcc 10.1 via code cleanup

G++ 10.1 emits inappropriate "use of uninitialized data" warnings when
compiling f18.  The warnings stem from two sites in templatized code
whose multiple instantiations magnified the number of warnings.

These changes dodge those warnings by making some innocuous changes to
the code.  In the parser, the idiom defaulted(cut >> x), which yields a
parser that always succeeds, has been replaced with a new equivalent
pass<T>() parser that returns a default-constructed value T{} in an
arguably more readable fashion.  This idiom was the only attestation of
the basic parser cut, so it has been removed and the remaining code
simplified.  In Evaluate/traverse.h, a return {}; was replaced with a
return of a default-constructed member.

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

4 years ago[analyzer] Avoid unused variable warning in opt build
Jacques Pienaar [Fri, 12 Jun 2020 16:48:49 +0000 (09:48 -0700)]
[analyzer] Avoid unused variable warning in opt build

4 years ago[AArch64][GlobalISel] Allow G_DUP for elements smaller than 32 B.
Jessica Paquette [Fri, 5 Jun 2020 23:59:27 +0000 (16:59 -0700)]
[AArch64][GlobalISel] Allow G_DUP for elements smaller than 32 B.

We select all of these via patterns now, so there's no reason to disallow this.

Update select-dup.mir to show that we correctly select the smaller types.

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

4 years ago[AArch64][GlobalISel] Set hasSideEffects = 0 on custom shuffle opcodes
Jessica Paquette [Tue, 9 Jun 2020 18:27:28 +0000 (11:27 -0700)]
[AArch64][GlobalISel] Set hasSideEffects = 0 on custom shuffle opcodes

This was making it so that the instructions weren't eliminated in
select-rev.mir and select-trn.mir despite not being used.

Update the tests accordingly.

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

4 years ago[lldb/SymbolFile] Don't parse the whole line table for the support files
Jonas Devlieghere [Fri, 12 Jun 2020 16:30:25 +0000 (09:30 -0700)]
[lldb/SymbolFile] Don't parse the whole line table for the support files

Prior to my patch of using the LLVM line table parsing code,
SymbolFileDWARF::ParseSupportFiles would only parse the line table
prologues to get the file list for any files that could be in the line
table.

With the old behavior, if we found the file that someone is setting the
breakpoint in in the support files list, we would get a valid index. If
we didn't, we would not look any further. So someone sets a breakpoint
one "MyFile.cpp:12" and if we find "MyFile.cpp" in the support file list
for the compile unit, then and only then would we get the entire line
table for that compile unit.

With the current behavior, no matter what, we always fully parse the
line table for all compile units any time any file and line breakpoint
is set. This creates a serious problem when debugging a large DWARF in
.o file project.

This patch re-instates the old behavior. Unfortunately it means we might
end up parsing to prologue twice, but I don't think that outweighs the
cost of trying to cache/reuse it.

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

4 years ago[MLIR][cmake] use add_mlir_interface() wherever possible
Stephen Neuendorffer [Fri, 12 Jun 2020 05:54:05 +0000 (22:54 -0700)]
[MLIR][cmake] use add_mlir_interface() wherever possible

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

4 years agoFix non-determinism issue with implicit lambda captures.
Erich Keane [Fri, 12 Jun 2020 16:13:48 +0000 (09:13 -0700)]
Fix non-determinism issue with implicit lambda captures.

We were using llvm::SmallPtrSet for our ODR-use set which was also used
for instantiating the implicit lambda captures. The order in which the
captures are added depends on this, so the lambda's layout ended up
changing.  The test just uses floats, but this was noticed with other
types as well.

This test replaces the short-lived SmallPtrSet (it lasts only for an
expression, which, though is a long time for lambdas, is at least not
forever) with a SmallSetVector.

4 years ago[libc++] Parse commands inside _executeScriptInternal to remove duplication
Louis Dionne [Fri, 12 Jun 2020 16:01:47 +0000 (12:01 -0400)]
[libc++] Parse commands inside _executeScriptInternal to remove duplication

Instead of parsing the command each time prior to calling _executeScriptInternal,
do it once inside _executeScriptInternal.

4 years ago[NFC] Silence compiler warning [-Wmissing-braces].
Huihui Zhang [Fri, 12 Jun 2020 15:53:04 +0000 (08:53 -0700)]
[NFC] Silence compiler warning [-Wmissing-braces].

llvm/lib/Target/AArch64/AArch64SLSHardening.cpp:146:5: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    "__llvm_slsblr_thunk_x0",  "__llvm_slsblr_thunk_x1",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    {
llvm/lib/Target/AArch64/AArch64SLSHardening.cpp:168:5: warning: suggest braces around initialization of subobject [-Wmissing-braces]
    AArch64::X0,  AArch64::X1,  AArch64::X2,  AArch64::X3,  AArch64::X4,
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    {

4 years ago[Analyzer] Replace `assert` with `ASSERT_TRUE` in a unit test to silence warnings
Adam Balogh [Fri, 12 Jun 2020 15:07:47 +0000 (17:07 +0200)]
[Analyzer] Replace `assert` with `ASSERT_TRUE` in a unit test to silence warnings

4 years ago[libc++] Remove redundant UNSUPPORTED annotation for the GDB pretty-printer tests
Louis Dionne [Fri, 12 Jun 2020 14:55:30 +0000 (10:55 -0400)]
[libc++] Remove redundant UNSUPPORTED annotation for the GDB pretty-printer tests

That test is already only enabled if LIBCXX_TEST_GDB_PRETTY_PRINTERS is
enabled, which isn't the default. If someone turns on that option on
Windows, they should be able to run the test and see whatever failure
happens.

4 years ago[mlir] Add Adaptor alias
Jacques Pienaar [Fri, 12 Jun 2020 14:38:12 +0000 (07:38 -0700)]
[mlir] Add Adaptor alias

Summary:
Add Adaptor alias alongside OperandAdaptor to make next renaming more
mechanical. OperandAdaptor's are no longer just about operands.
Considered OpAdaptor too, but then noticed we'd mostly end up with
XOp::OpAdaptor which seems redundant.

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

4 years agoGlobalISel: Fix not erasing old instruction in sitofp/uitofp lowering
Matt Arsenault [Fri, 12 Jun 2020 14:20:07 +0000 (10:20 -0400)]
GlobalISel: Fix not erasing old instruction in sitofp/uitofp lowering

4 years ago[libc++] Make executor scripts executable
Louis Dionne [Fri, 12 Jun 2020 14:28:19 +0000 (10:28 -0400)]
[libc++] Make executor scripts executable

This allows running the scripts directly, without running them through
Python.

4 years agoReland [clangd] Parse std::make_unique, and emit template diagnostics at expansion.
Sam McCall [Tue, 9 Jun 2020 13:46:35 +0000 (15:46 +0200)]
Reland [clangd] Parse std::make_unique, and emit template diagnostics at expansion.

This was originally 658af9435071 and reverted in 665dbe91f2ed.
The clang bug this triggered was fixed in 05ed3efc2ac.

4 years ago[lldb] Test creating persistent variables with $[digit] names
Raphael Isemann [Fri, 12 Jun 2020 14:12:04 +0000 (16:12 +0200)]
[lldb] Test creating persistent variables with $[digit] names

4 years agoHandle delayed-template-parsing functions imported into a non-dtp TU
Sam McCall [Tue, 9 Jun 2020 15:13:34 +0000 (17:13 +0200)]
Handle delayed-template-parsing functions imported into a non-dtp TU

Summary:
DelayedTemplateParsing is marked as BENIGN_LANGOPT, so we are allowed to
use a delayed template in a non-delayed TU.
(This is clangd's default configuration on windows: delayed-template-parsing
is on for the preamble and forced off for the current file)

However today clang fails to parse implicit instantiations in a non-dtp
TU of templates defined in a dtp PCH file (and presumably module?).
In this case the delayed parser is not registered, so the function is
simply marked "delayed" again. We then hit an assert:
end of TU template instantiation should not create more late-parsed templates

Reviewers: rsmith

Subscribers: ilya-biryukov, usaxena95, cfe-commits, kadircet

Tags: #clang

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

4 years ago[lldb][NFC] Modernize TestPersistentVariables
Raphael Isemann [Fri, 12 Jun 2020 14:05:36 +0000 (16:05 +0200)]
[lldb][NFC] Modernize TestPersistentVariables

4 years ago[mlir][doc] Fix typos in tutorial chapters
Kai Sasaki [Fri, 12 Jun 2020 13:57:35 +0000 (15:57 +0200)]
[mlir][doc] Fix typos in tutorial chapters

Summary:
Fix several typos in Toy tutorial chapters.
- Chapter 2
- Chapter 5

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

4 years agoDAGCombiner optimization for pow(x,0.75) and pow(x,0.25) on double and single precisi...
Masoud Ataei [Fri, 12 Jun 2020 14:02:16 +0000 (10:02 -0400)]
DAGCombiner optimization for pow(x,0.75) and pow(x,0.25) on double and single precision even in case massv function is asked

Here, I am proposing to add an special case for massv powf4/powd2 function (SIMD counterpart of powf/pow function in MASSV library) in MASSV pass to get later optimizations like conversion from pow(x,0.75) and pow(x,0.25) for double and single precision to sequence of sqrt's in the DAGCombiner in vector float case. My reason for doing this is: the optimized pow(x,0.75) and pow(x,0.25) for double and single precision to sequence of sqrt's is faster than powf4/powd2 on P8 and P9.

In case MASSV functions is called, and if the exponent of pow is 0.75 or 0.25, we will get the sequence of sqrt's and if exponent is not 0.75 or 0.25 we will get the appropriate MASSV function.

Reviewed By: steven.zhang

Tags: #LLVM #PowerPC

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

4 years ago[DAG] foldAddSubOfSignBit - add support for non-uniform vector constants
Simon Pilgrim [Fri, 12 Jun 2020 13:46:18 +0000 (14:46 +0100)]
[DAG] foldAddSubOfSignBit - add support for non-uniform vector constants

4 years ago[X86] Add non-uniform vector signbit test cases
Simon Pilgrim [Fri, 12 Jun 2020 13:32:36 +0000 (14:32 +0100)]
[X86] Add non-uniform vector signbit test cases

4 years ago[mlir] Mark CastOp class's shape constraint
Jacques Pienaar [Fri, 12 Jun 2020 13:50:06 +0000 (06:50 -0700)]
[mlir] Mark CastOp class's shape constraint

These ops have the same operands and result shapes.

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

4 years agoGet rid of -Wunused warnings in release build, NFC.
Haojian Wu [Fri, 12 Jun 2020 13:42:29 +0000 (15:42 +0200)]
Get rid of -Wunused warnings in release build, NFC.

4 years ago[lit] Fix handling of various keyword parse errors
Joel E. Denny [Fri, 12 Jun 2020 13:27:03 +0000 (09:27 -0400)]
[lit] Fix handling of various keyword parse errors

In TestRunner.py, D78589 extracts a `_parseKeywords` function from
`parseIntegratedTestScript`, which then expects `_parseKeywords` to
always return a list of keyword/value pairs.  However, the extracted
code sometimes returns an unresolved `lit.Test.Result` on a keyword
parsing error, which then produces a stack dump instead of the
expected diagnostic.

This patch fixes that, makes the style of those diagnostics more
consistent, and extends the lit test suite to cover them.

Reviewed By: ldionne

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

4 years ago[ASan][NFC] Refactor redzone size calculation
Marco Elver [Fri, 12 Jun 2020 12:58:00 +0000 (14:58 +0200)]
[ASan][NFC] Refactor redzone size calculation

Refactor redzone size calculation. This will simplify changing the
redzone size calculation in future.

Note that AddressSanitizer.cpp violates the latest LLVM style guide in
various ways due to capitalized function names. Only code related to the
change here was changed to adhere to the style guide.

No functional change intended.

Reviewed By: andreyknvl

Tags: #llvm

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

4 years ago[AST][RecoveryExpr] Build recovery expressions by default for C++.
Haojian Wu [Thu, 23 Apr 2020 09:14:01 +0000 (11:14 +0200)]
[AST][RecoveryExpr] Build recovery expressions by default for C++.

Reland https://reviews.llvm.org/D76696
All known crashes have been fixed, another attemption.

We have rolled out this to all internal users for a while, didn't see
big issues, we consider it is stable enough.

Reviewed By: sammccall

Subscribers: rsmith, hubert.reinterpretcast, ebevhan, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[ObjectYAML][DWARF] Add one helper function `writeInitialLength()`. NFC.
Xing GUO [Fri, 12 Jun 2020 13:10:14 +0000 (21:10 +0800)]
[ObjectYAML][DWARF] Add one helper function `writeInitialLength()`. NFC.

4 years ago[analyzer][NFC] Don't allow dependency checkers to emit diagnostics
Kirstóf Umann [Wed, 27 May 2020 10:27:32 +0000 (12:27 +0200)]
[analyzer][NFC] Don't allow dependency checkers to emit diagnostics

The thrilling conclusion to the barrage of patches I uploaded lately! This is a
big milestone towards the goal set out in http://lists.llvm.org/pipermail/cfe-dev/2019-August/063070.html.
I hope to accompany this with a patch where the a coreModeling package is added,
from which package diagnostics aren't allowed either, is an implicit dependency
of all checkers, and the core package for the first time can be safely disabled.

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

4 years ago(PR46111) Properly handle elaborated types in an implicit deduction guide
Erich Keane [Thu, 28 May 2020 17:25:53 +0000 (10:25 -0700)]
(PR46111) Properly handle elaborated types in an implicit  deduction guide

As reported in PR46111, implicit instantiation of a deduction guide
causes us to have an elaborated type as the parameter, rather than the
dependent type.

After review and feedback from @rsmith, this patch solves this problem
by wrapping the value in an uninstantiated typedef/type-alias that is
instantiated when required later.

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

4 years ago[analyzer] Introduce weak dependencies to express *preferred* checker callback evalua...
Kirstóf Umann [Wed, 27 May 2020 10:29:47 +0000 (12:29 +0200)]
[analyzer] Introduce weak dependencies to express *preferred* checker callback evaluation order

Checker dependencies were added D54438 to solve a bug where the checker names
were incorrectly registered, for example, InnerPointerChecker would incorrectly
emit diagnostics under the name MallocChecker, or vice versa [1]. Since the
system over the course of about a year matured, our expectations of what a role
of a dependency and a dependent checker should be crystallized a bit more --
D77474 and its summary, as well as a variety of patches in the stack
demonstrates how we try to keep dependencies to play a purely modeling role. In
fact, D78126 outright forbids diagnostics under a dependency checkers name.

These dependencies ensured the registration order and enabling only when all
dependencies are satisfied. This was a very "strong" contract however, that
doesn't fit the dependency added in D79420. As its summary suggests, this
relation is directly in between diagnostics, not modeling -- we'd prefer a more
specific warning over a general one.

To support this, I added a new dependency kind, weak dependencies. These are not
as strict of a contract, they only express a preference in registration order.
If a weak dependency isn't satisfied, the checker may still be enabled, but if
it is, checker registration, and transitively, checker callback evaluation order
is ensured.

If you are not familiar with the TableGen changes, a rather short description
can be found in the summary of D75360. A lengthier one is in D58065.

[1] https://www.youtube.com/watch?v=eqKeqHRAhQM

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

4 years ago[X86][SSE] combineX86ShuffleChain - combine INSERT_VECTOR_ELT patterns to INSERTPS
Simon Pilgrim [Fri, 12 Jun 2020 10:30:00 +0000 (11:30 +0100)]
[X86][SSE] combineX86ShuffleChain - combine INSERT_VECTOR_ELT patterns to INSERTPS

Noticed while trying to cleanup D66004 - if a shuffle operand came from a scalar, we're better off using INSERTPS vs UNPCKLPS as this is more likely to load fold later on. It also matches our existing BUILD_VECTOR lowering.

We can extend this to other PINSRB/D/Q/W cases in the future as the need arises.

4 years ago[MLIR] Add missing traits and assembly format to `shape.from/to_extent_tensor`
Frederik Gossen [Fri, 12 Jun 2020 10:53:15 +0000 (10:53 +0000)]
[MLIR] Add missing traits and assembly format to `shape.from/to_extent_tensor`

Add `NoSideEffect` trait to `shape.to_extent_tensor` and
`shape.from_extent_tensor` and defined custom assembly format for the
operations.

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

4 years ago[BreakCritEdges] Add option to opt-out of perserving loop-simplify.
Florian Hahn [Fri, 12 Jun 2020 10:15:26 +0000 (11:15 +0100)]
[BreakCritEdges] Add option to opt-out of perserving loop-simplify.

This patch adds a new option to CriticalEdgeSplittingOptions to control
whether loop-simplify form must be preserved. It is them used by GVN to
indicate that loop-simplify form does not have to be preserved.

This fixes a crash exposed by 189efe295b6e.

If the critical edge we are splitting goes from a block inside a loop to
a block outside the loop, splitting the edge will create a new exit
block. As a result, the new block will branch to the original exit
block, which will add a non-loop predecessor, breaking loop-simplify
form. To preserve loop-simplify form, the predecessor blocks of the
original exit are split, but that does not work for blocks with
indirectbr terminators. If preserving loop-simplify form is requested,
bail out , before making any changes.

Reviewers: reames, hfinkel, davide, efriedma

Reviewed By: efriedma

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

4 years ago[analyzer][NFC] Change checker dependency unit tests to check for the registration...
Kirstóf Umann [Sun, 31 May 2020 20:26:37 +0000 (22:26 +0200)]
[analyzer][NFC] Change checker dependency unit tests to check for the registration order

Exactly what it says on the tin! "Strong" dependencies are mentioned in contrast
to a new kind of dependency introduced in a followup patch.

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

4 years ago[ObjectYAML][test] Use a single test file to test the empty 'DWARF' entry.
Xing GUO [Fri, 12 Jun 2020 09:55:27 +0000 (17:55 +0800)]
[ObjectYAML][test] Use a single test file to test the empty 'DWARF' entry.

This patch addresses comments in [D81450](https://reviews.llvm.org/D81450#inline-748745)

Reviewed By: jhenderson

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

4 years ago[CodeGen] Increase applicability of ffine-grained-bitfield-accesses for targets with...
Alex Bradbury [Fri, 12 Jun 2020 09:26:53 +0000 (10:26 +0100)]
[CodeGen] Increase applicability of ffine-grained-bitfield-accesses for targets with limited native integer widths

As pointed out in PR45708, -ffine-grained-bitfield-accesses doesn't
trigger in all cases you think it might for RISC-V. The logic in
CGRecordLowering::accumulateBitFields checks OffsetInRecord is a legal
integer according to the datalayout. RISC targets will typically only
have the native width as a legal integer type so this check will fail
for OffsetInRecord of 8 or 16 when you would expect the transformation
is still worthwhile.

This patch changes the logic to check for an OffsetInRecord of a at
least 1 byte, that fits in a legal integer, and is a power of 2. We
would prefer to query whether native load/store operations are
available, but I don't believe that is possible.

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

4 years agoAdd missing IRBuilder include to IndirectThunks.h
Raphael Isemann [Fri, 12 Jun 2020 09:18:38 +0000 (11:18 +0200)]
Add missing IRBuilder include to IndirectThunks.h

This file didn't build with enabled modules.

4 years ago[VPlan] Reject loops without computable backedge taken counts
Florian Hahn [Fri, 12 Jun 2020 09:16:03 +0000 (10:16 +0100)]
[VPlan] Reject loops without computable backedge taken counts

getOrCreateTripCount is used to generate code for the outer loop, but it
requires a computable backedge taken counts. Check that in the VPlan
native path.

Reviewers: Ayal, gilr, rengolin, sguggill

Reviewed By: sguggill

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

4 years ago[AMDGPU] Add G16 support to image instructions
Sebastian Neubauer [Wed, 25 Mar 2020 07:38:22 +0000 (08:38 +0100)]
[AMDGPU] Add G16 support to image instructions

Add G16 feature for GFX10 and support A16 and G16 in GlobalISel.

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

4 years ago[yaml2obj][MachO] - Fix PubName/PubType handling.
Georgii Rymar [Thu, 11 Jun 2020 20:18:40 +0000 (23:18 +0300)]
[yaml2obj][MachO] - Fix PubName/PubType handling.

`PubName` and `PubType` are optional fields since D80722.

They are defined as:
  Optional<PubSection> PubNames;
  Optional<PubSection> PubTypes;

And initialized in the following way:
  IO.mapOptional("debug_pubnames", DWARF.PubNames);
  IO.mapOptional("debug_pubtypes", DWARF.PubTypes);

But problem is that because of the issue in `YAMLTraits.cpp`,
when there are no `debug_pubnames`/`debug_pubtypes` keys in a YAML description,
they are not initialized to `Optional::None` as the code expects, but they
are initialized to default `PubSection()` instances.

Because of this, the `if` condition in the following code is always true:

if (Obj.DWARF.PubNames)
  Err = DWARFYAML::emitPubSection(OS, *Obj.DWARF.PubNames,
                                  Obj.IsLittleEndian);

What means `emitPubSection` is always called and it writes few values.

This patch fixes the issue. I've reduced `sizeofcmds` by size of data
previously written because of this bug.

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

4 years ago[lldb] Don't print IRForTarget errors directly to the console
Raphael Isemann [Fri, 12 Jun 2020 08:08:08 +0000 (10:08 +0200)]
[lldb] Don't print IRForTarget errors directly to the console

Summary:

When we get an error back from IRForTarget we directly print that error to the
debugger output stream instead of putting it in the result object. The result
object only gets a vague "The expression could not be prepared to run in the
target" error message that doesn't actually tell the user what went wrong.

This patch just puts the IRForTarget errors into the status object that is
returned to the caller instead of directly printing it to the debugger. Also
updates one test that now can actually check for the error message it is
supposed to check for (instead of the default error which is all we had before).

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

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

4 years ago[PowerPC] refactor convertToImmediateForm - NFC
Chen Zheng [Fri, 12 Jun 2020 06:58:34 +0000 (02:58 -0400)]
[PowerPC] refactor convertToImmediateForm - NFC

This is a NFC patch to make convertToImmediateForm a light wrapper
for converting xform and imm form instructions on PowerPC.

Reviewed By: Steven.zhang

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

4 years ago[cmake] Don't pass -z discard-unused to Illumos ld
Rainer Orth [Fri, 12 Jun 2020 07:56:42 +0000 (09:56 +0200)]
[cmake] Don't pass -z discard-unused to Illumos ld

I'm currently working to port `libc++` to Solaris.  There exists a slightly
bitrotten port already, which was done on Illumos, an OpenSolaris
derivative.  In order not to break that port with my work, I need to test
the result on both Solaris and Illumos.  While doing so, it turned out that
Illumos `ld` doesn't support the `-z discard-sections=unused` option
currently used on SunOS unconditionally.

While there exists a patch
<https://github.com/OpenIndiana/oi-userland/blob/oi/hipster/components/developer/clang-90/patches/02-cmake_modules_AddLLVM.cmake.patch>
for LLVM 9.0 in the OpenIndiana repository, it apparently hasn't been
submitted upstream and is completely wrong: it replaces
`-z discard-sections=unused` with `-z ignore`.  In terms of the equivalent
`gld` options, this means replacing `--gc-sections` with `--as-needed`.

This patch instead tests if the linker actually supports the option before
using it.

Tested on `amd64-pc-solaris2.11` (all of Solaris 11.4, 11.3 and OpenIndiana
2020.04).

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

4 years ago[clang] Rename Decl::isHidden() to isUnconditionallyVisible().
Martin Boehme [Mon, 8 Jun 2020 13:37:44 +0000 (15:37 +0200)]
[clang] Rename Decl::isHidden() to isUnconditionallyVisible().

Also invert the sense of the return value.

As pointed out by the FIXME that this change resolves, isHidden() wasn't
a very accurate name for this function.

I haven't yet changed any of the strings that are output in
ASTDumper.cpp / JSONNodeDumper.cpp / TextNodeDumper.cpp in response to
whether isHidden() is set because

a) I'm not sure whether it's actually desired to change these strings
   (would appreciate feedback on this), and

b) In any case, I'd like to get this pure rename out of the way first,
   without any changes to tests. Changing the strings that are output in
   the various ...Dumper.cpp files will require changes to quite a few
   tests, and I'd like to make those in a separate change.

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

Reviewed By: rsmith