platform/upstream/llvm.git
3 years ago[Clang][RISCV] Add rvv vsetvl and vsetvlmax intrinsic functions.
Zakk Chen [Thu, 25 Feb 2021 08:15:14 +0000 (00:15 -0800)]
[Clang][RISCV] Add rvv vsetvl and vsetvlmax intrinsic functions.

Reviewed By: craig.topper

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

3 years ago[RISCV] Fix isel pattern of masked vmslt[u]
ShihPo Hung [Thu, 18 Mar 2021 02:08:46 +0000 (19:08 -0700)]
[RISCV] Fix isel pattern of masked vmslt[u]

This patch changes the operand order of masked vmslt[u]
from (mask, rs1, scalar, maskedoff, vl)
to (maskedoff, rs1, scalar, mask, vl).

Reviewed By: craig.topper

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

3 years ago[sanitizer] Grow buffer in SharedPrintfCodeNoBuffer
Vitaly Buka [Thu, 18 Mar 2021 03:14:04 +0000 (20:14 -0700)]
[sanitizer] Grow buffer in SharedPrintfCodeNoBuffer

3 years ago[ObjectYAML] Handle Hexagon V68
Krzysztof Parzyszek [Thu, 18 Mar 2021 02:37:40 +0000 (21:37 -0500)]
[ObjectYAML] Handle Hexagon V68

3 years ago[NFC][sanitizer] Remove unneeded "explicit"
Vitaly Buka [Thu, 18 Mar 2021 02:40:45 +0000 (19:40 -0700)]
[NFC][sanitizer] Remove unneeded "explicit"

3 years ago[Hexagon] Improve stack address base reuse for HVX spills
Krzysztof Parzyszek [Thu, 18 Mar 2021 02:14:35 +0000 (21:14 -0500)]
[Hexagon] Improve stack address base reuse for HVX spills

The offset in HVX loads/stores is only 4 bits long, so often an
extra register is needed to hold the address. Minimize the number
of such registers by "standardizing" the base addresses and reusing
preexisting base registers when replacing frame indices.

3 years ago[Hexagon] Add more patterns for HVX loads and stores
Krzysztof Parzyszek [Thu, 18 Mar 2021 01:57:37 +0000 (20:57 -0500)]
[Hexagon] Add more patterns for HVX loads and stores

In particular, add patterns for loads/stores to the stack
(with a frame index as address).

3 years ago[NFC] make XCOFF dwarf dump test run only on PowerPC target.
Chen Zheng [Thu, 18 Mar 2021 01:58:09 +0000 (21:58 -0400)]
[NFC] make XCOFF dwarf dump test run only on PowerPC target.

3 years ago[XCOFF][llvm-dwarfdump] llvm-dwarfdump support for XCOFF
Chen Zheng [Tue, 16 Mar 2021 06:08:57 +0000 (02:08 -0400)]
[XCOFF][llvm-dwarfdump] llvm-dwarfdump support for XCOFF

Author: hubert.reinterpretcast, shchenz

Reviewed By: jasonliu, echristo

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

3 years ago[GlobalISel] Don't DCE LIFETIME_START/LIFETIME_END markers.
Amara Emerson [Wed, 17 Mar 2021 18:34:56 +0000 (11:34 -0700)]
[GlobalISel] Don't DCE LIFETIME_START/LIFETIME_END markers.

These are pseudos without any users, so DCE was killing them in the combiner.

Marking them as having side effects doesn't seem quite right since they don't.

Gives a nice 0.3% geomean size win on CTMark -Os.

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

3 years ago[AMDGPU] Avoid unnecessary graph visits during WQM marking
Carl Ritson [Thu, 18 Mar 2021 00:31:39 +0000 (09:31 +0900)]
[AMDGPU] Avoid unnecessary graph visits during WQM marking

Avoid revisiting nodes with the same set of defined lanes by
using a unified visited set which integrates lanes into the key.
This retains the intent of the original code by still revisiting
a subgraph if a different set of lanes is defined and hence
marking might progress differently.

Note: default size of the visited set has been confirmed to
cover >99% of invocations in large array of test shaders.

Reviewed By: piotr

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

3 years ago[mlir][Toy] Tidy up the first half of Chapter 2.
River Riddle [Thu, 18 Mar 2021 00:36:42 +0000 (17:36 -0700)]
[mlir][Toy] Tidy up the first half of Chapter 2.

This performs a few rewordings, expands on a few parts, etc.

3 years ago[mlir][Toy] Update the tutorial to use tablegen for dialect declarations
River Riddle [Thu, 18 Mar 2021 00:36:31 +0000 (17:36 -0700)]
[mlir][Toy] Update the tutorial to use tablegen for dialect declarations

This was missed when the feature was originally added.

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

3 years ago[mlir][tosa] Add tosa.slice to std.subtensor lowering
Rob Suderman [Wed, 17 Mar 2021 22:53:18 +0000 (15:53 -0700)]
[mlir][tosa] Add tosa.slice to std.subtensor lowering

Lowering to subtensor is added for tosa.slice operator.

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

3 years agoRevert "[CodeGenModule] Set dso_local for Mach-O GlobalValue"
Alex Lorenz [Thu, 11 Mar 2021 22:54:47 +0000 (14:54 -0800)]
Revert "[CodeGenModule] Set dso_local for Mach-O GlobalValue"

This reverts commit 809a1e0ffd7af40ee27270ff8ba2ffc927330e71.

Mach-O doesn't support dso_local and this change broke XNU because of the use of dso_local.

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

3 years agoPR49619: Remove delayed call to noteFailed.
Richard Smith [Thu, 18 Mar 2021 00:20:46 +0000 (17:20 -0700)]
PR49619: Remove delayed call to noteFailed.

This would assert if we hit the evaluation step limit between starting
to delay the call and finishing. In any case, delaying the call was
largely pointless as it doesn't really matter when we mark the
evaluation as having had side effects.

3 years ago[sanitizer] Remove max_len parameter from InternalScopedString
Vitaly Buka [Tue, 16 Mar 2021 23:33:04 +0000 (16:33 -0700)]
[sanitizer] Remove max_len parameter from InternalScopedString

InternalScopedString uses InternalMmapVector internally
so it can be resized dynamically as needed.

Reviewed By: eugenis

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

3 years ago[FileCheck] Fix redundant diagnostics due to numeric errors
Joel E. Denny [Wed, 17 Mar 2021 18:17:41 +0000 (14:17 -0400)]
[FileCheck] Fix redundant diagnostics due to numeric errors

Fixed substitution printing not to produce an empty diagnostic for
errors handled elsewhere.

Reviewed By: thopre

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

3 years ago[FileCheck] Fix numeric error propagation
Joel E. Denny [Wed, 17 Mar 2021 18:13:57 +0000 (14:13 -0400)]
[FileCheck] Fix numeric error propagation

A more general name might be match-time error propagation.  That is,
it's conceivable we'll one day have non-numeric errors that require
the handling fixed by this patch.

Without this patch, FileCheck behaves as follows:

```
$ cat check
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]

$ FileCheck -vv -dump-input=never check < input
check:1:54: remark: implicit EOF: expected string found in input
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]
                                                     ^
<stdin>:2:1: note: found here

^
check:1:15: error: unable to substitute variable or numeric expression: overflow error
CHECK-NOT: [[#0x8000000000000000+0x8000000000000000]]
              ^
$ echo $?
0
```

Notice that the exit status is 0 even though there's an error.
Moreover, FileCheck doesn't print the error diagnostic unless both
`-dump-input=never` and `-vv` are specified.

The same problem occurs when `CHECK-NOT` does have a match but a
capture fails due to overflow: exit status is 0, and no diagnostic is
printed unless both `-dump-input=never` and `-vv` are specified.  The
usefulness of capturing from `CHECK-NOT` is questionable, but this
case should certainly produce an error.

With this patch, FileCheck always includes the error diagnostic and
has non-zero exit status for the above examples.  It's conceivable
that this change will cause some existing tests to fail, but my
assumption is that they should fail.  Moreover, with nearly every
project enabled, this patch didn't produce additional `check-all`
failures for me.

This patch also extends input dumps to include such numeric error
diagnostics for both expected and excluded patterns.

As noted in fixmes in some of the tests added by this patch, this
patch worsens an existing issue with redundant diagnostics.  I'll fix
that bug in a subsequent patch.

Reviewed By: thopre, jhenderson

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

3 years agoPR49585: Emit the jump destination for a for loop 'continue' from within the scope...
Richard Smith [Wed, 17 Mar 2021 21:00:03 +0000 (14:00 -0700)]
PR49585: Emit the jump destination for a for loop 'continue' from within the scope of the condition variable.

The condition variable is in scope in the loop increment, so we need to
emit the jump destination from wthin the scope of the condition
variable.

For GCC compatibility (and compatibility with real-world 'FOR_EACH'
macros), 'continue' is permitted in a statement expression within the
condition of a for loop, though, so there are two cases here:

* If the for loop has no condition variable, we can emit the jump
  destination before emitting the condition.

* If the for loop has a condition variable, we must defer emitting the
  jump destination until after emitting the variable. We diagnose a
  'continue' appearing in the initializer of the condition variable,
  because it would jump past the initializer into the scope of that
  variable.

Reviewed By: rjmccall

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

3 years ago[OPENMP51]Initial support for the use clause.
Mike Rice [Wed, 17 Mar 2021 20:04:08 +0000 (13:04 -0700)]
[OPENMP51]Initial support for the use clause.

Added basic parsing/sema/serialization support for the 'use' clause.

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

3 years agoRevert "[NewPM] Verify LoopAnalysisResults after a loop pass"
Arthur Eubanks [Wed, 17 Mar 2021 22:22:35 +0000 (15:22 -0700)]
Revert "[NewPM] Verify LoopAnalysisResults after a loop pass"

This reverts commit 6db3ab2903f42712f44000afb5aa467efbd25f35.

Causing too large of compile time regression.

3 years ago[lld-macho][NFC] Minor refactor of Writer::run()
Greg McGary [Sun, 14 Mar 2021 22:35:27 +0000 (15:35 -0700)]
[lld-macho][NFC] Minor refactor of Writer::run()

Move some functions closer to their uses. Move detailed address-assignment logic out of the otherwise abstract `Writer::run()`. This prepares the ground for a diff to implement branch range extension thunks.

* `SyntheticSections.cpp`
 ** move `needsBinding()` and `prepareBranchTarget()` into `Writer.cpp`
 ** move `addNonLazyBindingEntries()` adjacent to its use.

* `Writer.cpp`
 ** move address-assignment logic from `Writer::run()` into new function `Writer::assignAddresses()`
 ** move `needsBinding()` and `prepareBranchTarget()` from `SyntheticSections.cpp`

* `Target.h`
** remove orphaned decls of `prepareSymbolRelocation()` and `validateRelocationInfo()` which were moved to other files in earlier diffs.

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

3 years ago[AArch64][GlobalISel] Fall back if disabling neon/fp in the translator.
Amara Emerson [Tue, 16 Mar 2021 18:56:32 +0000 (11:56 -0700)]
[AArch64][GlobalISel] Fall back if disabling neon/fp in the translator.

The previous technique relied on early-exiting the legalizer predicate
initialization, leaving an empty rule table. That causes a fallback
for most instructions, but some have legacy rules defined like G_ZEXT
which can try continue, but then crash.

We should fall back earlier, in the translator, to avoid this issue.

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

3 years ago[Object][MachO] Handle end iterator in getSymbolType()
Steven Wu [Wed, 17 Mar 2021 22:05:51 +0000 (15:05 -0700)]
[Object][MachO] Handle end iterator in getSymbolType()

Fix a bug in MachOObjectFile::getSymbolType() that it is not checking if
the iterator is end() before deference the iterator. Instead, return
`Other` type, which aligns with the behavior of `llvm-nm`.

rdar://75291638

Reviewed By: davide, ab

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

3 years ago[ASTMatchers][NFC] Use move semantics when passing matchers around.
Nathan James [Wed, 17 Mar 2021 22:03:07 +0000 (22:03 +0000)]
[ASTMatchers][NFC] Use move semantics when passing matchers around.

Changing matchers to use non-const members and adding r-value overloads of matcher conversions enables move optimisations.
I don't have performance figures but I can say this knocked 120k from the clang-tidy binary(86k was from the .text section) on a Release with assertions build(x86_64-unknown-linux-gnu).

Reviewed By: aaron.ballman

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

3 years ago[ARM] Add VREV MVE shuffle costs
David Green [Wed, 17 Mar 2021 21:21:43 +0000 (21:21 +0000)]
[ARM] Add VREV MVE shuffle costs

This uses the shuffle mask cost from D98206 to give a better cost of MVE
VREV instructions. This helps especially in VectorCombine where the cost
of shuffles is used to reorder bitcasts, which this helps keep the phase
ordering test for fp16 reductions producing optimal code. The isVREVMask
has been moved to a header file to allow it to be used across target
transform and isel lowering.

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

3 years ago[mlir][IR] Support parsing hex float values in the DialectSymbolParser
River Riddle [Wed, 17 Mar 2021 20:09:53 +0000 (13:09 -0700)]
[mlir][IR] Support parsing hex float values in the DialectSymbolParser

This has been a TODO for a while, and prevents breakages for attributes/types that contain floats that can't roundtrip outside of the hex format.

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

3 years ago[NewPM] Verify LoopAnalysisResults after a loop pass
Arthur Eubanks [Wed, 17 Mar 2021 19:21:59 +0000 (12:21 -0700)]
[NewPM] Verify LoopAnalysisResults after a loop pass

All loop passes should preserve all analyses in LoopAnalysisResults. Add
checks for those.

Note that due to PR44815, we don't check LAR's ScalarEvolution.
Apparently calling SE.verify() can change its results.

Reviewed By: asbirlea

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

3 years ago[M68k] Forward declare getMCInstrBeads in one place
Ricky Taylor [Wed, 17 Mar 2021 20:30:39 +0000 (13:30 -0700)]
[M68k] Forward declare getMCInstrBeads in one place

At the moment `getMCInstrBeads` is forward-declared in a few places,
bring this together into a single header file.

This was done as part of the disassembler work, since the disassembler
would otherwise add one more forward declaration.

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

3 years ago[M68k] Use fixed asm string for MxPseudo instructions
Ricky Taylor [Wed, 17 Mar 2021 20:29:02 +0000 (13:29 -0700)]
[M68k] Use fixed asm string for MxPseudo instructions

This is required because empty strings are not allowed when generating
the assembly parser tables.

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

3 years ago[compiler-rt] -fsanitize=cfi is not supported on Darwin
Jon Roelofs [Wed, 17 Mar 2021 17:50:59 +0000 (10:50 -0700)]
[compiler-rt] -fsanitize=cfi is not supported on Darwin

This was responsible for:

Failed Tests (2):
  cfi-devirt-x86_64 :: mfcall.cpp
  cfi-standalone-x86_64 :: mfcall.cpp

3 years ago[NFC][AArch64] Add codegen tests for various csinc-cmp sequences.
Pavel Iliin [Wed, 17 Mar 2021 01:15:00 +0000 (01:15 +0000)]
[NFC][AArch64] Add codegen tests for various csinc-cmp sequences.

3 years ago[X86][SSE] Add SSE2/SSE42 test coverage to urem combine tests
Simon Pilgrim [Wed, 17 Mar 2021 19:57:53 +0000 (19:57 +0000)]
[X86][SSE] Add SSE2/SSE42 test coverage to urem combine tests

Noticed when reviewing D88785

3 years ago[lld-link] emit an error when writing a PDB > 4 GiB
Nico Weber [Wed, 17 Mar 2021 15:56:13 +0000 (11:56 -0400)]
[lld-link] emit an error when writing a PDB > 4 GiB

Maybe there's a way to make them work, but until I've investigated
if tools can consume large PDBs, erroring out is better than slowly
and silently consuming all available ram due to internal invariants
being violated.

(Patch to make writing larger files work at
https://bugs.chromium.org/p/chromium/issues/detail?id=1179085#c25
but I haven't had time to check if windbg & co can consume these
large PDBs. llvm-pdbutil can't, but we can fix that one at least :) )

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

3 years ago[LCSSA] Extract a utility for deciding if a new use requires a new lcssa phi [NFC]
Philip Reames [Wed, 17 Mar 2021 19:12:00 +0000 (12:12 -0700)]
[LCSSA] Extract a utility for deciding if a new use requires a new lcssa phi [NFC]

(Triggered by a review comment on D98728, but otherwise unrelated.)

3 years ago[Test] Fix undef var in attr-speculative-load-hardening.c
Thomas Preud'homme [Tue, 15 Dec 2020 23:05:45 +0000 (23:05 +0000)]
[Test] Fix undef var in attr-speculative-load-hardening.c

Fix use of undefined variable in CHECK-NOT directive in clang test
CodeGen/attr-speculative-load-hardening.c.

Reviewed By: kristof.beyls

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

3 years ago[RISCV] Use getTargetExtractSubreg and getTargetInsertSubreg to simplify some code...
Craig Topper [Wed, 17 Mar 2021 19:09:48 +0000 (12:09 -0700)]
[RISCV] Use getTargetExtractSubreg and getTargetInsertSubreg to simplify some code. NFCI

3 years ago[lldb/Docs] Update docs with new buildbot URLs
Jan Kratochvil [Wed, 17 Mar 2021 19:09:03 +0000 (20:09 +0100)]
[lldb/Docs] Update docs with new buildbot URLs

3 years ago[lldb] [test] Skip vCont tests on Windows
Michał Górny [Wed, 17 Mar 2021 18:22:58 +0000 (19:22 +0100)]
[lldb] [test] Skip vCont tests on Windows

3 years ago[LICM] Fix a crash when sinking instructions w/token operands
Philip Reames [Wed, 17 Mar 2021 17:57:33 +0000 (10:57 -0700)]
[LICM] Fix a crash when sinking instructions w/token operands

It is not legal to form a phi node with token type. The generic LCSSA construction code handles this correctly - by not forming LCSSA for such cases - but the adhoc fixup implementation in LICM did not.

This was noticed in the context of PR49607, but can be demonstrated on ToT with the tweaked test case. This is not specific to gc.relocate btw, it also applies to usage of the preallocated family of intrinsics as well.

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

3 years ago[RISCV] Update RVV shift intrinsic tests to use XLEN bit as shift amount.
Zakk Chen [Thu, 11 Mar 2021 16:01:04 +0000 (08:01 -0800)]
[RISCV] Update RVV shift intrinsic tests to use XLEN bit as shift amount.

Fix the unexpected of using op1's element type as shift amount type.

Reviewed By: frasercrmck

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

3 years ago[TTI] Add a Mask to getShuffleCost
David Green [Wed, 17 Mar 2021 17:46:26 +0000 (17:46 +0000)]
[TTI] Add a Mask to getShuffleCost

This adds an Mask ArrayRef to getShuffleCost, so that if an exact mask
can be provided a more accurate cost can be provided by the backend.
For example VREV costs could be returned by the ARM backend. This should
be an NFC until then, laying the groundwork for that to be added.

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

3 years ago[RISCV] Support masked load/store for fixed vectors.
Craig Topper [Wed, 17 Mar 2021 17:13:00 +0000 (10:13 -0700)]
[RISCV] Support masked load/store for fixed vectors.

Reviewed By: frasercrmck

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

3 years ago[mlir][cpu-runner] register all llvm ir dialects
Aart Bik [Tue, 16 Mar 2021 18:05:09 +0000 (11:05 -0700)]
[mlir][cpu-runner] register all llvm ir dialects

This fixes broken JIT functionality on emulator platforms.
With Alex' recent movement towards squashing llvm ir dialects
into target specific dialects, we now must ensure these dialects
are registered to the cpu runner to ensure JIT can lower this
to proper LLVM IR before handing this off to the backend.

Reviewed By: ftynse

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

3 years ago[mlir][amx] regression test for tile-muli (all zero/sign-extension combinations)
Aart Bik [Tue, 16 Mar 2021 20:37:34 +0000 (13:37 -0700)]
[mlir][amx] regression test for tile-muli (all zero/sign-extension combinations)

Reviewed By: ftynse

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

3 years agoReapply "[DebugInfo] Handle multiple variable location operands in IR"
Stephen Tozer [Wed, 17 Mar 2021 15:04:27 +0000 (15:04 +0000)]
Reapply "[DebugInfo] Handle multiple variable location operands in IR"

Fixed section of code that iterated through a SmallDenseMap and added
instructions in each iteration, causing non-deterministic code; replaced
SmallDenseMap with MapVector to prevent non-determinism.

This reverts commit 01ac6d1587e8613ba4278786e8341f8b492ac941.

3 years ago[OPENMP51]Initial support for the interop directive.
Mike Rice [Mon, 15 Mar 2021 20:09:46 +0000 (13:09 -0700)]
[OPENMP51]Initial support for the interop directive.

Added basic parsing/sema/serialization support for interop directive.
Support for the 'init' clause.

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

3 years ago[CGSCC] Print CG node itself instead of its address
Bardia Mahjour [Wed, 17 Mar 2021 16:36:55 +0000 (12:36 -0400)]
[CGSCC] Print CG node itself instead of its address

Fix the debug output from cgscc

3 years ago[ELF] Special case --shuffle-sections=-1 to reverse input sections
Fangrui Song [Wed, 17 Mar 2021 16:32:44 +0000 (09:32 -0700)]
[ELF] Special case --shuffle-sections=-1 to reverse input sections

If the number of sections changes, which is common for re-links after
incremental updates, the section order may change drastically.

Special case -1 to reverse input sections. This is a stable transform.
The section order is more resilient to incremental updates.  Usually the
code issue (e.g. Static Initialization Order Fiasco, assuming pointer
comparison result of two unrelated objects) is due to the relative order
between two problematic input files A and B.  Checking the regular order
and the reversed order is sufficient.

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

3 years ago[lldb] [test] Fix TestGdbRemote_vContThreads.py logic
Michał Górny [Tue, 16 Mar 2021 23:04:06 +0000 (00:04 +0100)]
[lldb] [test] Fix TestGdbRemote_vContThreads.py logic

The TestGdbRemote_vContThreads.py were introduced to test NetBSD process
plugin's capability of sending per-thread and per-process signals.
However, at some point the tests started failing.  From retrospective,
it is possible that they were relying on some bug in the plugin's
original signal handling.

Fix the tests not to expect the process to terminate after receiving
the signals.  Instead, scan for output indicating that the signals were
received and match thread IDs in it.  Enable 'signal to all threads'
test everywhere as it works fine on Linux.  Add a new test for vCont
packet without specific thread IDs.  Introduce a helper function
to cover the common part of tests.

While this does not fix all the problems on NetBSD, it enables a subset
of the tests on other systems.  I am planning to add more tests
to the group while implementing multiprocess extension for vCont.

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

3 years ago[ms] [llvm-ml] Allow the /Zs parameter as a synonym for -filetype=null
Eric Astor [Wed, 17 Mar 2021 16:10:11 +0000 (12:10 -0400)]
[ms] [llvm-ml] Allow the /Zs parameter as a synonym for -filetype=null

For ml.exe, /Zs implies a syntax check with no output files.

Reviewed By: thakis

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

3 years ago[lldb] Correct unsigned decimal argument check in memory write
David Spickett [Wed, 17 Mar 2021 15:45:37 +0000 (15:45 +0000)]
[lldb] Correct unsigned decimal argument check in memory write

getAsInteger returns false when it succeeds.

Before:
(lldb) memory write 0x00007ffff7dd3000 99 -f "unsigned decimal"
error: '99' is not a valid unsigned decimal string value.

After:
(lldb) memory write 0x00007ffff7dd3000 99 -f "unsigned decimal"
(lldb) memory read 0x00007ffff7dd3000 0x00007ffff7dd3001
0x7ffff7dd3000: 63                                               c

3 years ago[LoopVectorize] Refine hasIrregularType predicate
LemonBoy [Wed, 17 Mar 2021 15:59:55 +0000 (16:59 +0100)]
[LoopVectorize] Refine hasIrregularType predicate

The `hasIrregularType` predicate checks whether an array of N values of type Ty is "bitcast-compatible" with a <N x Ty> vector.
The previous check returned invalid results in some cases where there's some padding between the array elements: eg. a 4-element array of u7 values is considered as compatible with <4 x u7>, even though the vector is only loading/storing 28 bits instead of 32.

The problem causes LLVM to generate incorrect code for some targets: for AArch64 the vector loads/stores are lowered in terms of ubfx/bfi, effectively losing the top (N * padding bits).

Reviewed By: lebedev.ri

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

3 years ago[Sanitizer] Fix debug builds of sanitizer_stacktrace_test.cpp
Luís Marques [Wed, 17 Mar 2021 15:57:00 +0000 (15:57 +0000)]
[Sanitizer] Fix debug builds of sanitizer_stacktrace_test.cpp

An implementation of `__sanitizer::BufferedStackTrace::UnwindImpl` is
provided per sanitizer, but there isn't one for sanitizer-common. In
non-optimized builds of the sanitizer-common tests that becomes a problem:
the test `sanitizer_stacktrace_test.cpp` won't have a reference to that
method optimized away, causing linking errors. This patch provides a dummy
implementation, which fixes those builds.

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

3 years ago[ARM] Use lrdsb for more thumb1 loads.
David Green [Wed, 17 Mar 2021 15:29:02 +0000 (15:29 +0000)]
[ARM] Use lrdsb for more thumb1 loads.

Given a sextload i16, we can usually generate "ldrsh [rn. rm]". If we
don't naturally have a rn, rm addressing mode, we can either generate
"ldrh [rn, #0]; sxth" or "mov rm, #0; ldrsh [rn. rm]".

We currently generate the first, always creating a sxth. They are both
the same number of instructions, but if we generate the second then the
mov #0 will likely be CSE'd or pulled out of a loop, etc.

This adjusts the ISel patterns to do that, creating a mov instead of a
sxth.

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

3 years agoAdd arm_neon.sdot operation
Ahmed Taei [Sat, 6 Mar 2021 04:54:01 +0000 (20:54 -0800)]
Add arm_neon.sdot operation

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

3 years ago[DAG] TargetLowering::isBinOp() - add ISD::SSUBSAT/USUBSAT
Simon Pilgrim [Wed, 17 Mar 2021 14:26:25 +0000 (14:26 +0000)]
[DAG] TargetLowering::isBinOp() - add ISD::SSUBSAT/USUBSAT

Add to the generic non-commutative binop list.

3 years ago[RGT] RPCUtilsTest, replace un-executed EXPECT with unreachable
Paul Robinson [Fri, 12 Mar 2021 16:47:48 +0000 (08:47 -0800)]
[RGT] RPCUtilsTest, replace un-executed EXPECT with unreachable

Unreachable code should be self-documented as unreachable.

Found by the Rotten Green Tests project.

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

3 years ago[llvm-objcopy][NFC] Move ownership keeping code into restoreStatOnFile().
Alexey Lapshin [Fri, 12 Mar 2021 13:31:35 +0000 (16:31 +0300)]
[llvm-objcopy][NFC] Move ownership keeping code into restoreStatOnFile().

The D93881 added functionality which preserve ownership for output file
if llvm-objcopy is called under root. That code was added into the place
where output file is created. The llvm-objcopy already has a function which
sets/restores rights/permissions for the output file.
That is the restoreStatOnFile() function. This patch moves code
(preserving ownershipping) into the restoreStatOnFile() function.

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

3 years ago[clang] Disable LTO and LLD on SystemZ for stage3 builds
Timm Bäder [Tue, 9 Mar 2021 10:51:09 +0000 (11:51 +0100)]
[clang] Disable LTO and LLD on SystemZ for stage3 builds

LLD does not support SystemZ, so it doesn't make sense to use it for
boostrap/stage3 builds, and using LTO in these cases won't work.

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

3 years ago[mlir][ODS] Support specialized Attribute class for Enums
Vladislav Vinogradov [Sat, 27 Feb 2021 12:21:00 +0000 (15:21 +0300)]
[mlir][ODS] Support specialized Attribute class for Enums

Add a feature to `EnumAttr` definition to generate
specialized Attribute class for the particular enumeration.

This class will inherit `StringAttr` or `IntegerAttr` and
will override `classof` and `getValue` methods.

With this class the enumeration predicate can be checked with simple
RTTI calls (`isa`, `dyn_cast`) and it will return the typed enumeration
directly instead of raw string/integer.

Based on the following discussion:
https://llvm.discourse.group/t/rfc-add-enum-attribute-decorator-class/2252

Reviewed By: rriddle

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

3 years ago[OCaml] Handle nullptr in Llvm.global_initializer
Timotej Kapus [Wed, 17 Mar 2021 12:47:32 +0000 (12:47 +0000)]
[OCaml] Handle nullptr in Llvm.global_initializer

LLVMGetInitializer returns nullptr in case there is no initializer.
There is not much that can be done with nullptr in OCaml, not even
test if it is null. Also, there does not seem to be a C or OCaml API
to test if there is an initializer. So this diff changes
Llvm.global_initializer to return an option.

Reviewed By: whitequark

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

3 years agoMove BaseOpWithOffsetSizesAndStrides to OpBase.td
Adrian Kuegel [Wed, 17 Mar 2021 12:43:18 +0000 (13:43 +0100)]
Move BaseOpWithOffsetSizesAndStrides to OpBase.td

It is used both by the Standard dialect and the MemRef dialect.

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

3 years agoFixing a test case that was missed in c165a99a1b8861af87e0509a2e14debf2764804b
Aaron Ballman [Wed, 17 Mar 2021 12:45:28 +0000 (08:45 -0400)]
Fixing a test case that was missed in c165a99a1b8861af87e0509a2e14debf2764804b

3 years agoRevert "[DebugInfo] Handle multiple variable location operands in IR"
Hans Wennborg [Wed, 17 Mar 2021 12:36:48 +0000 (13:36 +0100)]
Revert "[DebugInfo] Handle multiple variable location operands in IR"

This caused non-deterministic compiler output; see comment on the
code review.

> This patch updates the various IR passes to correctly handle dbg.values with a
> DIArgList location. This patch does not actually allow DIArgLists to be produced
> by salvageDebugInfo, and it does not affect any pass after codegen-prepare.
> Other than that, it should cover every IR pass.
>
> Most of the changes simply extend code that operated on a single debug value to
> operate on the list of debug values in the style of any_of, all_of, for_each,
> etc. Instances of setOperand(0, ...) have been replaced with with
> replaceVariableLocationOp, which takes the value that is being replaced as an
> additional argument. In places where this value isn't readily available, we have
> to track the old value through to the point where it gets replaced.
>
> Differential Revision: https://reviews.llvm.org/D88232

This reverts commit df69c69427dea7f5b3b3a4d4564bc77b0926ec88.

3 years ago[SYCL] Rework the SYCL driver options
Aaron Ballman [Wed, 17 Mar 2021 12:26:07 +0000 (08:26 -0400)]
[SYCL] Rework the SYCL driver options

SYCL compilations initiated by the driver will spawn off one or more
frontend compilation jobs (one for device and one for host). This patch
reworks the driver options to make upstreaming this from the downstream
SYCL fork easier.

This patch introduces a language option to identify host executions
(SYCLIsHost) and a -cc1 frontend option to enable this mode. -fsycl and
-fno-sycl become driver-only options that are rejected when passed to
-cc1. This is because the frontend and beyond should be looking at
whether the user is doing a device or host compilation specifically.
Because the frontend should only ever be in one mode or the other,
-fsycl-is-device and -fsycl-is-host are mutually exclusive options.

3 years ago[NFC][OCaml] Fix documentation for verify_function and const_of_int64
Jason Hu [Tue, 16 Mar 2021 21:02:03 +0000 (21:02 +0000)]
[NFC][OCaml] Fix documentation for verify_function and const_of_int64

Documentation of verify_function is incorrect and that of
const_of_int64 is incomplete.

Reviewed By: whitequark

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

3 years agoNFC: Use a simple macro to test AST node introspection
Stephen Kelly [Wed, 17 Mar 2021 12:08:28 +0000 (12:08 +0000)]
NFC: Use a simple macro to test AST node introspection

3 years ago[mlir] scf::ForOp: Drop iter arguments (and corresponding result) with no use
lorenzo chelini [Wed, 17 Mar 2021 11:32:45 +0000 (11:32 +0000)]
[mlir] scf::ForOp: Drop iter arguments (and corresponding result) with no use

'ForOpIterArgsFolder' can now remove iterator arguments (and corresponding
results) with no use.

Example:

```
%cst = constant 32 : i32

%0:2 = scf.for %arg1 = %lb to %ub step %step iter_args(%arg2 = %arg0, %arg3 = %cst)
  -> (i32, i32) {
  %1 = addu %arg2, %cst : i32
  scf.yield %1, %1 : i32, i32
}

use(%0#0)

```

%arg3 is not used in the block, and its corresponding result `%0#1` has no use,
thus remove the iter argument.

Reviewed By: nicolasvasilache

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

3 years ago[mlir][llvm] Pass struct results as parameter in c wrapper
Stephan Herhut [Wed, 17 Mar 2021 11:16:30 +0000 (12:16 +0100)]
[mlir][llvm] Pass struct results as parameter in c wrapper

Returning structs directly in LLVM does not necessarily align with the C ABI of
the platform. This might happen to work on Linux but for small structs this
breaks on Windows. With this change, the wrappers work platform independently.

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

3 years agoUpdate diagnostic groups for pre-compat warnings
Aaron Ballman [Wed, 17 Mar 2021 11:51:54 +0000 (07:51 -0400)]
Update diagnostic groups for pre-compat warnings

As a follow-up to D95691, add new diagnostic groups named
pre-c++N-compat to replace the old diagnostic groups with the standards
listed out explicitly. The old group names are retained for backwards
compatibility.

3 years agoAdded documentation for SSA like property in Bufferization.
Julian Gross [Wed, 27 Jan 2021 14:26:07 +0000 (15:26 +0100)]
Added documentation for SSA like property in Bufferization.

Added additional information about the SSA like properties
that has to be fulfilled in the bufferization steps.

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

3 years agoRevert rG3b635253ddd0106c88051cff3540d8eb90bee22f "[AMDGPU] Regenerate wave32.ll...
Simon Pilgrim [Wed, 17 Mar 2021 11:46:50 +0000 (11:46 +0000)]
Revert rG3b635253ddd0106c88051cff3540d8eb90bee22f "[AMDGPU] Regenerate wave32.ll test checks"

Breaks on some buildbots.

3 years ago[lit] Harmonize test timing data between Unix and Windows
David Zarzycki [Wed, 17 Mar 2021 09:48:01 +0000 (05:48 -0400)]
[lit] Harmonize test timing data between Unix and Windows

The "path" recorded for timing purposes is only used as a key into a dictionary. It is never used as an actual path to a filesystem API, therefore we should use '/' as the canonical separator so that Unix and Windows machines can share timing data. This also ensures that the lit testing works across platforms.

Reviewed By: jhenderson, jmorse

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

3 years ago[AArch64][SVE/NEON] Add support for FROUNDEVEN for both NEON and fixed length SVE
Bradley Smith [Fri, 12 Mar 2021 11:46:58 +0000 (11:46 +0000)]
[AArch64][SVE/NEON] Add support for FROUNDEVEN for both NEON and fixed length SVE

Previously NEON used a target specific intrinsic for frintn, given that
the FROUNDEVEN ISD node now exists, move over to that instead and add
codegen support for that node for both NEON and fixed length SVE.

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

3 years agoRevert "[libomptarget] Build amdgcn devicertl by default"
Jon Chesterfield [Wed, 17 Mar 2021 11:34:44 +0000 (11:34 +0000)]
Revert "[libomptarget] Build amdgcn devicertl by default"

This reverts commit e23f3502d9a2b1e9abd445130a22cc00f6464da8.
It broke the build of openmp for clang built without amdgcn
support. D98746, under review, would allow this to reland.

3 years ago[AMDGPU] Regenerate wave32.ll test checks
Simon Pilgrim [Wed, 17 Mar 2021 11:18:20 +0000 (11:18 +0000)]
[AMDGPU] Regenerate wave32.ll test checks

This is to help simplify the diff on an upcoming patch

3 years ago[MLIR] Fix lowering of Affine IfOp in the presence of yield values.
Gaurav Shukla [Wed, 17 Mar 2021 10:18:33 +0000 (15:48 +0530)]
[MLIR] Fix lowering of Affine IfOp in the presence of yield values.

This commit fixes the lowering of `Affine.IfOp` to `SCF.IfOp` in the
presence of yield values. These changes have been made as a part of
`-lower-affine` pass.

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

3 years ago[LV] Account for the cost of predication of scalarized load/store
David Green [Wed, 17 Mar 2021 10:57:50 +0000 (10:57 +0000)]
[LV] Account for the cost of predication of scalarized load/store

This adds the cost of an i1 extract and a branch to the cost in
getMemInstScalarizationCost when the instruction is predicated. These
predicated loads/store would generate blocks of something like:

    %c1 = extractelement <4 x i1> %C, i32 1
    br i1 %c1, label %if, label %else
  if:
    %sa = extractelement <4 x i32> %a, i32 1
    %sb = getelementptr inbounds float, float* %pg, i32 %sa
    %sv = extractelement <4 x float> %x, i32 1
    store float %sa, float* %sb, align 4
  else:

So this increases the cost by the extract and branch. This is probably
still too low in many cases due to the cost of all that branching, but
there is already an existing hack increasing the cost using
useEmulatedMaskMemRefHack. It will increase the cost of a memop if it is
a load or there are more than one store. This patch improves the cost
for when there is only a single store, and hopefully at some point in
the future the hack can be removed.

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

3 years ago[SLP] Fix the trunc instruction insertion problem
Bu Le [Wed, 17 Mar 2021 10:15:56 +0000 (13:15 +0300)]
[SLP] Fix the trunc instruction insertion problem

Current SLP pass has this piece of code that inserts a trunc instruction
after the vectorized instruction. In the case that the vectorized instruction
is a phi node and not the last phi node in the BB, the trunc instruction
will be inserted between two phi nodes, which will trigger verify problem
in debug version or unpredictable error in another pass.
This patch changes the algorithm to 'if the last vectorized instruction
is a phi, insert it after the last phi node in current BB' to fix this problem.

3 years ago[lldb] Correct typo in memory read error
David Spickett [Wed, 17 Mar 2021 09:43:06 +0000 (09:43 +0000)]
[lldb] Correct typo in memory read error

Reviewed By: teemperor

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

3 years ago[RISCV] Optimize "dominant element" BUILD_VECTORs
Fraser Cormack [Mon, 15 Mar 2021 15:52:16 +0000 (15:52 +0000)]
[RISCV] Optimize "dominant element" BUILD_VECTORs

This patch adds an optimization path for BUILD_VECTOR nodes where the
majority of the elements are identical. These can be splatted, with the
remaining elements patched up with INSERT_VECTOR_ELTs. The threshold can
be tweaked as required - it is currently conservative. Undef elements
are disregarded when judging the dominance of a particular element. This
allows them to be covered by the splat value.

In addition, vectors of 2 elements are always optimized to a splat (for
the upper element) and an insert at element zero.

This optimization is disabled when optimizing for size.

Reviewed By: craig.topper

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

3 years ago[AMDGPU] Split dot2-insts feature
Jay Foad [Tue, 16 Mar 2021 16:01:03 +0000 (16:01 +0000)]
[AMDGPU] Split dot2-insts feature

Split out some of the instructions predicated on the dot2-insts target
feature into a new dot7-insts, in preparation for subtargets that have
some but not all of these instructions. NFCI.

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

3 years ago[libcxx] [docs] Fix formatting of inline verbatim snippets in the Windows section
Martin Storsjö [Wed, 17 Mar 2021 09:40:17 +0000 (11:40 +0200)]
[libcxx] [docs] Fix formatting of inline verbatim snippets in the Windows section

Use double backticks instead of single, as single backticks produces
italic formatting.

3 years ago[TableGen] Fix excessive compile time issue in FixedLenDecoderEmitter
Jay Foad [Fri, 5 Mar 2021 11:32:06 +0000 (11:32 +0000)]
[TableGen] Fix excessive compile time issue in FixedLenDecoderEmitter

This patch reduces the time taken for clang to compile the generated
disassembler for an out-of-tree target with InsnType bigger than 64 bits
from 4m30s to 48s.

D67686 did a similar thing for CodeEmitterGen.

The idea is to tweak the API of the APInt-like InsnType class so that
we don't need so many temporary InsnTypes. This takes advantage of the
rule stated in D52100 that currently "no string of bits extracted
from the encoding may exceeed 64-bits", so we can use uint64_t for some
temporaries.

D52100 goes on to say that "fields are still permitted to exceed 64-bits
so long as they aren't one contiguous string of bits". This patch breaks
that by always using a "uint64_t tmp" in the generated decodeToMCInst,
but it should be easy to fix in FilterChooser::emitBinaryParser by
choosing to use a different type of tmp based on the known total field
width.

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

3 years ago[SLP][Test] Precommit test for D98423
Bu Le [Wed, 17 Mar 2021 08:09:20 +0000 (11:09 +0300)]
[SLP][Test] Precommit test for D98423

3 years agoMake iteration over the DeclContext::lookup_result safe.
Vassil Vassilev [Wed, 17 Mar 2021 08:56:05 +0000 (08:56 +0000)]
Make iteration over the DeclContext::lookup_result safe.

The idiom:
```
DeclContext::lookup_result R = DeclContext::lookup(Name);
for (auto *D : R) {...}
```

is not safe when in the loop body we trigger deserialization from an AST file.
The deserialization can insert new declarations in the StoredDeclsList whose
underlying type is a vector. When the vector decides to reallocate its storage
the pointer we hold becomes invalid.

This patch replaces a SmallVector with an singly-linked list. The current
approach stores a SmallVector<NamedDecl*, 4> which is around 8 pointers.
The linked list is 3, 5, or 7. We do better in terms of memory usage for small
cases (and worse in terms of locality -- the linked list entries won't be near
each other, but will be near their corresponding declarations, and we were going
to fetch those memory pages anyway). For larger cases: the vector uses a
doubling strategy for reallocation, so will generally be between half-full and
full. Let's say it's 75% full on average, so there's N * 4/3 + 4 pointers' worth
of space allocated currently and will be 2N pointers with the linked list. So we
break even when there are N=6 entries and slightly lose in terms of memory usage
after that. We suspect that's still a win on average.

Thanks to @rsmith!

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

3 years ago[sanitizer_common][test] Handle missing REG_STARTEND in Posix/regex_startend.cpp
Rainer Orth [Wed, 17 Mar 2021 08:56:19 +0000 (09:56 +0100)]
[sanitizer_common][test] Handle missing REG_STARTEND in Posix/regex_startend.cpp

As reported in D96348 <https://reviews.llvm.org/D96348>, the
`Posix/regex_startend.cpp` test `FAIL`s on Solaris because
`REG_STARTEND` isn't defined.  It's a BSD extension not present everywhere.
E.g. AIX doesn't have it, too.

Fixed by wrapping the test in `#ifdef REG_STARTEND`.

Tested on `amd64-pc-solaris2.11`, `sparcv9-sun-solaris2.11`, and
`x86_64-pc-linux-gnu`.

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

3 years ago[-Wcalled-once-parameter] Let escapes overwrite MaybeCalled states
Valeriy Savchenko [Mon, 15 Mar 2021 08:00:07 +0000 (11:00 +0300)]
[-Wcalled-once-parameter] Let escapes overwrite MaybeCalled states

This commit makes escapes symmetrical, meaning that having escape
before and after the branching, where parameter is not called on
one of the paths, will have the same effect.

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

3 years ago[libcxx] Simplify rounding of durations in win32 __libcpp_thread_sleep_for
Martin Storsjö [Fri, 26 Feb 2021 14:13:38 +0000 (16:13 +0200)]
[libcxx] Simplify rounding of durations in win32 __libcpp_thread_sleep_for

Also fix a comment typo, and remove a superfluous "std::" qualififcation
in __libcpp_semaphore_wait_timed for consistency.

This mirrors what was suggested in review of
1773eec6928f4e37b377e23b84d7a2a07d0d1d0d.

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

3 years ago[NFC] [XCOFF] Update PowerPC readobj test case with expression
edwin-wang [Wed, 17 Mar 2021 08:02:50 +0000 (16:02 +0800)]
[NFC] [XCOFF] Update PowerPC readobj test case with expression

This patch is to replace the fixed value with expression.
Keep .file section as fixed values as it might be changed. The
remaining sections will hardly be modified. So the Index values
are sequential. By using expression, we can avoid the fixed value
changes in coming patches.

This is a follow-up of patch D97117.

Reviewed By: hubert.reinterpretcast, shchenz

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

3 years ago[MC] Delete unused MCOperand::{create,is,get}FPImm
Fangrui Song [Wed, 17 Mar 2021 07:30:38 +0000 (00:30 -0700)]
[MC] Delete unused MCOperand::{create,is,get}FPImm

3 years ago[Flang][OpenMP][OpenACC] Add function for mapping parser clause classes with the...
Praveen [Sun, 14 Mar 2021 12:42:30 +0000 (18:12 +0530)]
[Flang][OpenMP][OpenACC] Add function for mapping parser clause classes with the corresponding clause kind.

1. Generate the mapping for clauses between the parser class and the
   corresponding clause kind for OpenMP and OpenACC using tablegen.

2. Add a common function to get the OmpObjectList from the OpenMP
   clauses to avoid repetition of code.

Reviewed by: Kiranchandramohan @kiranchandramohan , Valentin Clement @clementval

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

3 years ago[OCaml] Fix buildbot failure in OCaml tests
Vaivaswatha Nagaraj [Wed, 17 Mar 2021 05:55:43 +0000 (11:25 +0530)]
[OCaml] Fix buildbot failure in OCaml tests

The commit 506df1bbfd16233134a6ddea96ed2d49077840fd introduced
a call to `caml_alloc_initialized_string` which seems to be
unavailable on older OCaml versions. So I'm now switching to
using `caml_alloc_string` and using a `memcpy` after that, as
is done in the rest of the file.

Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/16/builds/7919

3 years ago[lld-macho][NFC] Drop unnecessary braces around simple if/for bodies
Greg McGary [Wed, 17 Mar 2021 04:34:28 +0000 (21:34 -0700)]
[lld-macho][NFC] Drop unnecessary braces around simple if/for bodies

Minor cleanup

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

3 years ago[Unswitch] Guard dbgs logging with LLVM_DEBUG
Arthur Eubanks [Wed, 17 Mar 2021 05:29:40 +0000 (22:29 -0700)]
[Unswitch] Guard dbgs logging with LLVM_DEBUG

3 years ago[OCaml] DebugInfo support for OCaml bindings
Vaivaswatha Nagaraj [Wed, 17 Mar 2021 03:43:21 +0000 (09:13 +0530)]
[OCaml] DebugInfo support for OCaml bindings

Many (but not all) DebugInfo functions are now added to the
OCaml bindings, and rest can be safely added incrementally.

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

3 years ago[BasicAA] Drop dependency on Loop Info. PR43276
Max Kazantsev [Wed, 17 Mar 2021 04:16:07 +0000 (11:16 +0700)]
[BasicAA] Drop dependency on Loop Info. PR43276

BasicAA stores a reference to LoopInfo inside. This imposes an implicit
requirement of keeping it up to date whenever we modify the IR (in particular,
whenever we modify terminators of blocks that belong to loops). Failing
to do so leads to incorrect state of the LoopInfo.

Because general AA does not require loop info updates and provides to API to
update it properly, the users of AA reasonably assume that there is no need to
update the loop info. It may be a reason of bugs, as example in PR43276 shows.

This patch drops dependence of BasicAA on LoopInfo to avoid this problem.

This may potentially pessimize the result of queries to BasicAA.

Differential Revision: https://reviews.llvm.org/D98627
Reviewed By: nikic

3 years ago[lld-macho] Handle error cases properly for -exported_symbol(s_list)
Greg McGary [Thu, 11 Mar 2021 00:45:18 +0000 (16:45 -0800)]
[lld-macho] Handle error cases properly for -exported_symbol(s_list)

This fixes defects in D98223 [lld-macho] implement options -(un)exported_symbol(s_list):
* disallow export of hidden symbols
* verify that whitelisted literal names are defined in the symbol table
* reflect export-status overrides in `nlist` attribute of `N_EXT` or `N_PEXT`

Thanks to @thakis for raising these issues

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