platform/upstream/llvm.git
4 years agoAliasAnalysisSummary.h - cleanup includes and forward declarations. NFC.
Simon Pilgrim [Mon, 20 Apr 2020 16:44:18 +0000 (17:44 +0100)]
AliasAnalysisSummary.h - cleanup includes and forward declarations. NFC.
Push InstrTypes.h include down to AliasAnalysisSummary.cpp

4 years ago[mlir][SCCP] Add support for propagating constants across inter-region control flow.
River Riddle [Tue, 21 Apr 2020 09:54:14 +0000 (02:54 -0700)]
[mlir][SCCP] Add support for propagating constants across inter-region control flow.

This is possible by adding two new ControlFlowInterface additions:

- A new interface, RegionBranchOpInterface
This interface allows for region holding operations to describe how control flows between regions. This interface initially contains two methods:

* getSuccessorEntryOperands
Returns the operands of this operation used as the entry arguments when entering the region at `index`, which was specified as a successor by `getSuccessorRegions`. when entering. These operands should correspond 1-1 with the successor inputs specified in `getSuccessorRegions`, and may be a subset of the entry arguments for that region.

*  getSuccessorRegions
Returns the viable successors of a region, or the possible successor when branching from the parent op. This allows for describing which regions may be executed when entering an operation, and which regions are executed after having executed another region of the parent op. For example, a structured loop operation may always enter into the loop body region. The loop body region may branch back to itself, or exit to the operation.

- A trait, ReturnLike
This trait signals that a terminator exits a region and forwards all of its operands as "exiting" values.

These additions allow for performing more general dataflow analysis in the presence of region holding operations.

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

4 years ago[mlir][Transforms] Add pass to perform sparse conditional constant propagation
River Riddle [Tue, 21 Apr 2020 09:54:05 +0000 (02:54 -0700)]
[mlir][Transforms] Add pass to perform sparse conditional constant propagation

This revision adds the initial pass for performing SCCP generically in MLIR. SCCP is an algorithm for propagating constants across control flow, and optimistically assumes all values to be constant unless proven otherwise. It currently supports branching control, with support for regions and inter-procedural propagation being added in followups.

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

4 years ago[clangd] Change field name to prevent shadowing
Kadir Cetinkaya [Tue, 21 Apr 2020 09:52:28 +0000 (11:52 +0200)]
[clangd] Change field name to prevent shadowing

4 years ago[mlir] [linalg] Only promote selected buffers.
Pierre Oechsel [Tue, 21 Apr 2020 09:43:28 +0000 (11:43 +0200)]
[mlir] [linalg] Only promote selected buffers.

The promotion transformation is promoting all input and output buffers of the transformed op. The user might want to only promote some of these buffers.

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

4 years ago[VE] Create a TargetInfo header. NFC
Kazushi (Jam) Marukawa [Tue, 21 Apr 2020 09:42:03 +0000 (11:42 +0200)]
[VE] Create a TargetInfo header.  NFC

Summary:
Move the declarations of getThe<Name>Target() functions into a new header in
TargetInfo and make users of these functions include this new header in
order to follow other architectures.

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

4 years ago[clangd] Fix windows buildbots for #import statements
Kadir Cetinkaya [Tue, 21 Apr 2020 08:55:52 +0000 (10:55 +0200)]
[clangd] Fix windows buildbots for #import statements

4 years ago[AST] dont invaliate VarDecl when the initializer contains errors.
Haojian Wu [Tue, 21 Apr 2020 07:57:06 +0000 (09:57 +0200)]
[AST] dont invaliate VarDecl when the initializer contains errors.

Summary:
This patch contains 2 separate changes:
1) the initializer of a variable should play no part in decl "invalid" bit;
2) preserve the invalid initializer via recovery exprs;

With 1), we will regress the diagnostics (one big regression is that we loose
the "selected 'begin' function with iterator type" diagnostic in for-range stmt;
but with 2) together, we don't have regressions (the new diagnostics seems to be
improved).

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[SVEIntrinsicOpts] NFC: Remove unused isReinterpretFromBool for no-assert builds
Sander de Smalen [Mon, 20 Apr 2020 20:24:38 +0000 (21:24 +0100)]
[SVEIntrinsicOpts] NFC: Remove unused isReinterpretFromBool for no-assert builds

isReinterpretFromBool's only use is in an assert, which causes a warning that the
function is defined but not used in no-assert builds.

4 years ago[gn build] Port 2214b9076f1
LLVM GN Syncbot [Tue, 21 Apr 2020 08:34:22 +0000 (08:34 +0000)]
[gn build] Port 2214b9076f1

4 years ago[clangd] Make signatureHelp work with stale preambles
Kadir Cetinkaya [Thu, 2 Apr 2020 08:53:23 +0000 (10:53 +0200)]
[clangd] Make signatureHelp work with stale preambles

Summary:
This is achieved by calculating newly added includes and implicitly
parsing them as if they were part of the main file.

This also gets rid of the need for consistent preamble reads.

Reviewers: sammccall

Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, mgrang, arphaman, jfb, usaxena95, cfe-commits

Tags: #clang

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

4 years ago[clangd] Store ppdirective in Inclusion
Kadir Cetinkaya [Wed, 15 Apr 2020 20:00:19 +0000 (22:00 +0200)]
[clangd] Store ppdirective in Inclusion

Summary:
This will enable PreamblePatching proposed in D77392 craft a more
informed patch.

Reviewers: sammccall

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

Tags: #clang

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

4 years ago[TTI] Remove getOperationCost
Sam Parker [Thu, 9 Apr 2020 06:41:18 +0000 (07:41 +0100)]
[TTI] Remove getOperationCost

This API call has been used recently with, a very valid, expectation
that it would do something useful but it doesn't actually query any
backend information. So, remove this method and merge its
functionality into getUserCost. As well as that, also use
getCastInstrCost to get a proper cost from the backend for the
concerned instructions though we only currently return the answer if
it's considered free. The default implementation now also checks
int/ptr conversions too, as well as truncs and bitcasts.

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

4 years ago[AST] Suppress the spammy "attempt to use a deleted fucntion" diagnostic.
Haojian Wu [Tue, 21 Apr 2020 07:18:37 +0000 (09:18 +0200)]
[AST] Suppress the spammy "attempt to use a deleted fucntion" diagnostic.

Summary:
This patch fixes the regression diagnostic, which was introduced in
https://reviews.llvm.org/D77395.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: rsmith, adamcz, cfe-commits

Tags: #clang

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

4 years ago[ARM][ParallelDSP] Handle squaring multiplies
Sam Parker [Mon, 20 Apr 2020 14:04:03 +0000 (15:04 +0100)]
[ARM][ParallelDSP] Handle squaring multiplies

The logic in ARMParallelDSP is setup to merge two 16-bits loads into
a 32-bit load and feed them into the smlads. This requires that four
loads are combined for the four inputs, but there wasn't actually a
check for this.

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

4 years ago[DenseMap] Don't capture the BucketEnd pointer before an operation that might change...
Craig Topper [Tue, 21 Apr 2020 07:00:33 +0000 (00:00 -0700)]
[DenseMap] Don't capture the BucketEnd pointer before an operation that might change the number of buckets.

This code was added in 887efa51c1e0e43ca684ed78b92dbc3a0720881b to
fix reverse iteration.

The call to InsertIntoBucket/InsertIntoBucketWithLookup can change
the number of buckets which will invalidate the BucketEnd. So
don't cache it and calculate it when creating the iterator.

4 years ago[CallSite removal][Instrumentation] Use CallBase instead of CallSite in AddressSaniti...
Craig Topper [Tue, 21 Apr 2020 04:34:35 +0000 (21:34 -0700)]
[CallSite removal][Instrumentation] Use CallBase instead of CallSite in AddressSanitizer/DataFlowSanitizer/MemorySanitizer. NFC

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

4 years ago[LICM][NFC] Reorder checks to speed up things slightly
Max Kazantsev [Tue, 21 Apr 2020 04:25:38 +0000 (11:25 +0700)]
[LICM][NFC] Reorder checks to speed up things slightly

Side effect check is made faster than potentially heavy other checks.

4 years ago[Local] Update getOrEnforceKnownAlignment/getKnownAlignment to use Align/MaybeAlign.
Craig Topper [Tue, 21 Apr 2020 03:32:05 +0000 (20:32 -0700)]
[Local] Update getOrEnforceKnownAlignment/getKnownAlignment to use Align/MaybeAlign.

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

4 years ago[OpenMPOpt] Make the combination of `ident_t*` deterministic
Johannes Doerfert [Mon, 20 Apr 2020 23:25:24 +0000 (18:25 -0500)]
[OpenMPOpt] Make the combination of `ident_t*` deterministic

Before we kept the first applicable `ident_t*` during deduplication of
runtime calls. The problem is that "first" is dependent on the iteration
order of a DenseMap. Since the proper solution, which is to combine the
information from all `ident_t*`, should be deterministic on its own, we
will not try to make the iteration order deterministic. Instead, we will
create a fresh `ident_t*` if there is not a unique existing `ident_t*`
to pick.

4 years ago[OpenMPOpt] Use a pointer value type in map
Johannes Doerfert [Mon, 20 Apr 2020 23:15:08 +0000 (18:15 -0500)]
[OpenMPOpt] Use a pointer value type in map

The value type was a set before which can easily lead to excessive
memory usage and copying. We use a pointer to a vector instead now.

4 years ago[OpenMPOpt] Make the SCC a vector to ensure deterministic results
Johannes Doerfert [Mon, 20 Apr 2020 22:51:38 +0000 (17:51 -0500)]
[OpenMPOpt] Make the SCC a vector to ensure deterministic results

4 years agoPR45535: Check for variables with non-trivial destruction when
Richard Smith [Tue, 21 Apr 2020 04:14:41 +0000 (21:14 -0700)]
PR45535: Check for variables with non-trivial destruction when
determining whether a statement expression has side-effects.

4 years agoPR45534: don't ignore unmodeled side-effects when constant-evaluating a call to __bui...
Richard Smith [Tue, 21 Apr 2020 02:27:39 +0000 (19:27 -0700)]
PR45534: don't ignore unmodeled side-effects when constant-evaluating a call to __builtin_constant_p.

Such side-effects should result in the call evaluating to 'false', even
if we can still determine what value the argument expression will
evaluate to.

4 years agoReland D76675 [llvm-objcopy] Match GNU behaviour regarding file symbols
Fangrui Song [Tue, 24 Mar 2020 07:38:48 +0000 (15:38 +0800)]
Reland D76675 [llvm-objcopy] Match GNU behaviour regarding file symbols

Don't error on Config.KeepFileSymbols for COFF and Mach-O.

Original description:

GNU objcopy removes STT_FILE symbols for strip-debug operations, and
keeps them for --discard-all operation. Match their behaviour for
llvm-objcopy.

Bug: https://github.com/android/ndk/issues/1212

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

4 years agoRevert "[llvm-objcopy] Match GNU behaviour regarding file symbols"
Yi Kong [Tue, 21 Apr 2020 04:04:01 +0000 (12:04 +0800)]
Revert "[llvm-objcopy] Match GNU behaviour regarding file symbols"

This reverts commit 7c65e88d0bc85ff2732a4e23c397ff842b97b828.

Broke non ELF targets.

4 years ago[llvm-objcopy] Match GNU behaviour regarding file symbols
Yi Kong [Tue, 24 Mar 2020 07:38:48 +0000 (15:38 +0800)]
[llvm-objcopy] Match GNU behaviour regarding file symbols

GNU objcopy removes STT_FILE symbols for strip-debug operations, and
keeps them for --discard-all operation. Match their behaviour for
llvm-objcopy.

Bug: https://github.com/android/ndk/issues/1212

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

4 years ago[MC][NFC] Use camelCase style for functions in MCObjectStreamer
Shengchen Kan [Tue, 21 Apr 2020 02:28:13 +0000 (19:28 -0700)]
[MC][NFC] Use camelCase style for functions in MCObjectStreamer

4 years ago[MC][Bugfix] Remove redundant parameter for relaxInstruction
Shengchen Kan [Fri, 17 Apr 2020 12:26:26 +0000 (20:26 +0800)]
[MC][Bugfix] Remove redundant parameter for relaxInstruction

Summary:
Before this patch, `relaxInstruction` takes three arguments, the first
argument refers to the instruction before relaxation and the third
argument is the output instruction after relaxation. There are two quite
strange things:
  1) The first argument's type is `const MCInst &`, the third
  argument's type is `MCInst &`, but they may be aliased to the same
  variable
  2) The backends of ARM, AMDGPU, RISC-V, Hexagon assume that the third
  argument is a fresh uninitialized `MCInst` even if `relaxInstruction`
  may be called like `relaxInstruction(Relaxed, STI, Relaxed)` in a
  loop.

In this patch, we drop the thrid argument, and let `relaxInstruction`
directly modify the given instruction. Also, this patch fixes the bug https://bugs.llvm.org/show_bug.cgi?id=45580, which is introduced by D77851, and
breaks the assumption of ARM, AMDGPU, RISC-V, Hexagon.

Reviewers: Razer6, MaskRay, jyknight, asb, luismarques, enderby, rtaylor, colinl, bcain

Reviewed By: Razer6, MaskRay, bcain

Subscribers: bcain, nickdesaulniers, nathanchance, wuzish, annita.zhang, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, nhaehnle, tpr, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, 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, kerbowa, llvm-commits

Tags: #llvm

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

4 years agoBPF: fix a CORE optimization bug
Yonghong Song [Sun, 19 Apr 2020 22:19:06 +0000 (15:19 -0700)]
BPF: fix a CORE optimization bug

For the test case in this patch like below
  struct t { int a; } __attribute__((preserve_access_index));
  int foo(void *);
  int test(struct t *arg) {
      long param[1];
      param[0] = (long)&arg->a;
      return foo(param);
  }

The IR right before BPF SimplifyPatchable phase:
  %1:gpr = LD_imm64 @"llvm.t:0:0$0:0"
  %2:gpr = LDD killed %1:gpr, 0
  %3:gpr = ADD_rr %0:gpr(tied-def 0), killed %2:gpr
  STD killed %3:gpr, %stack.0.param, 0
After SimplifyPatchable phase, the incorrect IR is generated:
  %1:gpr = LD_imm64 @"llvm.t:0:0$0:0"
  %3:gpr = ADD_rr %0:gpr(tied-def 0), killed %1:gpr
  CORE_MEM killed %3:gpr, 306, %0:gpr, @"llvm.t:0:0$0:0"

Note that CORE_MEM pseudo op is introduced to encode
memory operations related to CORE. In the above, we intend
to check whether we have a store like
   *(%3:gpr + 0) = ...
and if this is the case, we could replace it with
   *(%0:gpr + @"llvm.t:0:0$0:0"_ = ...

Unfortunately, in the above, IR for the store is
   *(%stack.0.param + 0) = %3:gpr
and transformation should not happen.

Note that we won't have problem if the actual CORE
dereference (arg->a) happens.

This patch fixed the problem by skip CORE optimization if
the use of ADD_rr result is not the base address of the store
operation.

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

4 years ago[llvm][NFC][CallSite] Remove CallSite from ArgumentPromotion
Mircea Trofin [Tue, 21 Apr 2020 01:14:13 +0000 (18:14 -0700)]
[llvm][NFC][CallSite] Remove CallSite from ArgumentPromotion

Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[Attributor] Use the BumpPtrAllocator in InformationCache as well
Johannes Doerfert [Thu, 16 Apr 2020 22:54:40 +0000 (17:54 -0500)]
[Attributor] Use the BumpPtrAllocator in InformationCache as well

We now also use the BumpPtrAllocator from the Attributor in the
InformationCache. The lifetime of objects in either is pretty much the
same and it should result in consistently good performance regardless of
the allocator.

Doing so requires to call more constructors manually but so far that
does not seem to be problematic or messy.

---

Single run of the Attributor module and then CGSCC pass (oldPM)
for SPASS/clause.c (~10k LLVM-IR loc):

Before:
```
calls to allocation functions: 615359 (368257/s)
temporary memory allocations: 83315 (49859/s)
peak heap memory consumption: 75.64MB
peak RSS (including heaptrack overhead): 163.43MB
total memory leaked: 269.04KB
```

After:
```
calls to allocation functions: 613042 (359555/s)
temporary memory allocations: 83322 (48869/s)
peak heap memory consumption: 75.64MB
peak RSS (including heaptrack overhead): 162.92MB
total memory leaked: 269.04KB
```

Difference:
```
calls to allocation functions: -2317 (-68147/s)
temporary memory allocations: 7 (205/s)
peak heap memory consumption: 2.23KB
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

---

4 years ago[Attributor] Partially disable three tests to unblock the windows bot
Johannes Doerfert [Tue, 21 Apr 2020 02:11:02 +0000 (21:11 -0500)]
[Attributor] Partially disable three tests to unblock the windows bot

The windows bot reported a crash [0] which seems to not happen on other
platforms. We disable the old pass manager cgscc runs while this is
under investigation.

[0]
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/23151

4 years agoUnbreak ASan runtime in the simulators.
Dan Liew [Tue, 21 Apr 2020 00:22:35 +0000 (17:22 -0700)]
Unbreak ASan runtime in the simulators.

Summary:
861b69faee5df8d4e13ef316c7474a10e4069e81 (rdar://problem/58789439) while
fixing symbolization for TSan completely broke ASan's runtime for the
simulators.

The problem with the previous patch is that the memory passed to
`putenv()` was poisoned and when passed to `putenv()` it tripped
an interceptor for `strchr()` which saw the memory was poisoned and
raised an ASan issue.

The memory was poisoned because `AtosSymbolizerProcess` objects
are created using ASan's internal allocator. Memory from this
allocator gets poisoned with `kAsanInternalHeapMagic`.

To workaround this, this patch makes the memory for the environment
variable entry a global variable that isn't poisoned.

This pass also adds a `DCHECK(getenv(K_ATOS_ENV_VAR))` because the
following DCHECK would crash because `internal_strcmp()` doesn't
work on nullptr.

rdar://problem/62067724

Reviewers: kubamracek, yln

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers

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

4 years ago[MC][NFC] Use camelCase style for function EmitInstToData
Shengchen Kan [Mon, 20 Apr 2020 09:53:00 +0000 (02:53 -0700)]
[MC][NFC] Use camelCase style for function EmitInstToData

4 years ago[llvm][NFC][CallSite] Remove CallSite from CoroEarly
Mircea Trofin [Mon, 20 Apr 2020 19:56:36 +0000 (12:56 -0700)]
[llvm][NFC][CallSite] Remove CallSite from CoroEarly

Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoFix DenseMap iterator asserts when shouldReverseIterate==true
Chris Bieneman [Mon, 20 Apr 2020 23:28:37 +0000 (18:28 -0500)]
Fix DenseMap iterator asserts when shouldReverseIterate==true

This patch gets the asserts working correctly when LLVM_REVERSE_ITERATION=On by fixing the iterators returned by the DenseMap::find* methods so that they return well-formed iterators that work with reverse iteration, and satisfy the assertions.

4 years agoRecommit: DebugInfo: Fix rangesBaseAddress DICompileUnit bitcode serialization/deseri...
David Blaikie [Tue, 21 Apr 2020 00:23:47 +0000 (17:23 -0700)]
Recommit: DebugInfo: Fix rangesBaseAddress DICompileUnit bitcode serialization/deserialization

Recommits c51b45e32ef7f35c11891f60871aa9c2c04cd991
Reverted in b350c666ab65b7585bc58301b03d2b46dc6b0504 due to some
(Google-internal) regressions I cannot reproduce... (so we'll see if
they reproduce this time around)

4 years ago[mlir] Fix getTypes() support for result ranges.
River Riddle [Tue, 21 Apr 2020 00:13:55 +0000 (17:13 -0700)]
[mlir] Fix getTypes() support for result ranges.

4 years ago[dfsan] Fix a bug in strcasecmp() and strncasecmp(): Compare the lowercase versions...
Sam Kerner [Tue, 21 Apr 2020 00:13:00 +0000 (17:13 -0700)]
[dfsan] Fix a bug in strcasecmp() and strncasecmp(): Compare the lowercase versions of the characters when choosing a return value.

Summary:
Resolves this bug:

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

Reviewers: morehouse, pcc

Reviewed By: morehouse

Subscribers: #sanitizers

Tags: #sanitizers

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

4 years agoFix inlining multi-block callees with type conversion.
Sean Silva [Sat, 18 Apr 2020 03:14:41 +0000 (20:14 -0700)]
Fix inlining multi-block callees with type conversion.

The previous code result a mismatch between block argument types and
predecessor successor args when a type conversion was needed in a
multiblock case. It was assuming the replaced result types matched the
region result types.

Also, slighly improve the debug output from the inliner.

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

4 years ago[llvm-objcopy][MachO] Copy LC_ENCRYPT_INFO/LC_ENCRYPT_INFO_64 load commands
Alexander Shaposhnikov [Mon, 20 Apr 2020 23:33:18 +0000 (16:33 -0700)]
[llvm-objcopy][MachO] Copy LC_ENCRYPT_INFO/LC_ENCRYPT_INFO_64 load commands

Copy LC_ENCRYPT_INFO/LC_ENCRYPT_INFO_64 load commands.

Test plan: make check-all

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

4 years ago[AArch64][NFC] More intrinsic tests.
Pavel Iliin [Mon, 20 Apr 2020 22:54:04 +0000 (23:54 +0100)]
[AArch64][NFC] More intrinsic tests.

4 years agoUpdate LLVMOps for CreateShuffleVector deprecation and rework
Eric Christopher [Mon, 20 Apr 2020 22:25:47 +0000 (15:25 -0700)]
Update LLVMOps for CreateShuffleVector deprecation and rework
creation string.

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

4 years agoFixing bot breakage
Chris Bieneman [Mon, 20 Apr 2020 22:43:28 +0000 (17:43 -0500)]
Fixing bot breakage

This should resolve the failures from 31282d399b7.

4 years agoFix LLVM_REVERSE_ITERATION
Chris Bieneman [Mon, 20 Apr 2020 21:50:20 +0000 (16:50 -0500)]
Fix LLVM_REVERSE_ITERATION

A recent change (4e86e5eedc6), broke `LLVM_REVERSE_ITERATION` for DenseMaps by adding an assert. It is valid to de-reference and increment one step behind `End` when reverse iteration is enabled because `End` is actually the start of the pointer bucket.

4 years agoNew pass to make internal linkage symbol names unique.
Sriraman Tallam [Mon, 20 Apr 2020 21:41:30 +0000 (14:41 -0700)]
New pass to make internal linkage symbol names unique.

With clang option -funique-internal-linkage-symbols, symbols with
internal linkage get names with the module hash appended.

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

4 years ago[SVE] Remove calls to getBitWidth from PowerPC
Christopher Tetreault [Mon, 20 Apr 2020 21:09:41 +0000 (14:09 -0700)]
[SVE] Remove calls to getBitWidth from PowerPC

Reviewers: efriedma, sdesmalen, hfinkel, david-arm, fpetrogalli

Reviewed By: efriedma, fpetrogalli

Subscribers: wuzish, nemanjai, tschuett, hiraditya, kbarton, rkruppe, psnobl, shchenz, llvm-commits

Tags: #llvm

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

4 years ago[SVE] Remove calls to getBitWidth from mips
Christopher Tetreault [Mon, 20 Apr 2020 20:58:02 +0000 (13:58 -0700)]
[SVE] Remove calls to getBitWidth from mips

Reviewers: efriedma, ahatanak, sdesmalen, c-rhodes, david-arm

Reviewed By: efriedma

Subscribers: dexonsmith, sdardis, arichardson, tschuett, hiraditya, jrtc27, atanasyan, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[ARM] MVE and scalar postinc mir tests. NFC
David Green [Mon, 20 Apr 2020 18:53:53 +0000 (19:53 +0100)]
[ARM] MVE and scalar postinc mir tests. NFC

4 years agoRevert "[AMDGPU] Set the CostPerUse value for vgpr registers."
Piotr Sobczak [Mon, 20 Apr 2020 20:01:24 +0000 (22:01 +0200)]
Revert "[AMDGPU] Set the CostPerUse value for vgpr registers."

This reverts commit 728b878de689e4921ca7f864ed3036f9b2c53853.

D76417 has caused vgpr count to go up significantly in real-world
graphics content.

4 years agoRevert "[libc++] Re-enable warnings in the new format"
Louis Dionne [Mon, 20 Apr 2020 20:42:53 +0000 (16:42 -0400)]
Revert "[libc++] Re-enable warnings in the new format"

This reverts commit 20fd62438004, which broke the C++03 build bot.
I'll have another stab at this after fixing those failures.

4 years ago[SVE] Remove calls to getBitWidth from Analysis
Christopher Tetreault [Mon, 20 Apr 2020 20:27:06 +0000 (13:27 -0700)]
[SVE] Remove calls to getBitWidth from Analysis

Reviewers: efriedma, sdesmalen, jnspaulsson, jonpa

Reviewed By: efriedma

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years ago[MachineOutliner] Annotation for outlined functions in AArch64
Andrew Litteken [Fri, 10 Apr 2020 21:46:09 +0000 (14:46 -0700)]
[MachineOutliner] Annotation for outlined functions in AArch64

- Adding changes to support comments on outlined functions with outlining for the conditions through which it was outlined (e.g. Thunks, Tail calls)
- Adapts the emitFunctionHeader to print out a comment next to the header if the target specifies it based on information in MachineFunctionInfo
- Adds mir test for function annotiation

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

4 years ago[lldb/Reproducers] Fix passive replay for (char*, size_t) functions.
Jonas Devlieghere [Mon, 20 Apr 2020 20:20:24 +0000 (13:20 -0700)]
[lldb/Reproducers] Fix passive replay for (char*, size_t) functions.

Several SB API functions return strings using (char*, size_t) output
arguments. During capture, we serialize an empty string for the char*
because the memory can be uninitialized.

During active replay, we have custom replay redirects that ensure that
we don't override the buffer from which we're reading, but rather write
to a buffer on the heap with the given length. This is sufficient for
the active reproducer use case, where we only care about the side
effects of the API calls, not the values actually returned.

This approach does not not work for passive replay because here we
ignore all the incoming arguments, and re-execute the current function
with the arguments deserialized from the reproducer. This means that
these function will update the deserialized copy of the arguments,
rather than whatever was passed in by the SWIG wrapper.

To solve this problem, this patch extends the reproducer instrumentation
to handle this special case for passive replay. We nog ignore the
replayer in the registry and the incoming char pointer, and instead
reinvoke the current method on the deserialized class, and populate the
output argument.

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

4 years agoRevert "[Local] Update getOrEnforceKnownAlignment/getKnownAlignment to use Align...
Craig Topper [Mon, 20 Apr 2020 20:25:06 +0000 (13:25 -0700)]
Revert "[Local] Update getOrEnforceKnownAlignment/getKnownAlignment to use Align/MaybeAlign."

This is breaking the clang build.

This reverts commit 897409fb56f4525639b0e47e88960f24cd91c924.

4 years ago[mlir][ods] Add materialize derived attribute method
Jacques Pienaar [Thu, 16 Apr 2020 15:05:21 +0000 (08:05 -0700)]
[mlir][ods] Add materialize derived attribute method

Summary:
Generate method to generate a DictionaryAttr with attribute values of
derived attribute. If a conversion back from the derived attribute C++
type to Attribute is not defined, then attempting to materialize such an
op's derived attributes would result in runtime failure.

This allows to treat derived attributes and attributes of an op in more
uniform manner where needed. The derived attributes are not added to the
operation but returned as new attribute instead.

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

4 years ago[Local] Update getOrEnforceKnownAlignment/getKnownAlignment to use Align/MaybeAlign.
Craig Topper [Mon, 20 Apr 2020 19:18:23 +0000 (12:18 -0700)]
[Local] Update getOrEnforceKnownAlignment/getKnownAlignment to use Align/MaybeAlign.

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

4 years ago[libc++] Re-enable warnings in the new format
Louis Dionne [Mon, 20 Apr 2020 15:33:29 +0000 (11:33 -0400)]
[libc++] Re-enable warnings in the new format

When the new libc++ test format was enabled, warnings were accidentally
dropped cause they were not part of the %{compile_flags} substitution.
This commit adds them back, however `-Werror` is only used for non-verify
tests (cause it doesn't make sense for verify tests).

4 years agoFix lld testcases I missed in D78413 (9b9454a)
Eli Friedman [Mon, 20 Apr 2020 19:48:04 +0000 (12:48 -0700)]
Fix lld testcases I missed in D78413 (9b9454a)

4 years ago[MLIR] NFC clean up loop tiling test cases
Uday Bondhugula [Sun, 19 Apr 2020 08:05:11 +0000 (13:35 +0530)]
[MLIR] NFC clean up loop tiling test cases

Summary:
Improve the checks and drop redundant ones. Rename the outlined maps
better.

Reviewers: andydavis1, nicolasvasilache

Subscribers: mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, frgossen, llvm-commits

Tags: #llvm

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

4 years ago[llvm][NFC][CallSite] Remove CallSite from Lint.cpp
Mircea Trofin [Mon, 20 Apr 2020 17:28:11 +0000 (10:28 -0700)]
[llvm][NFC][CallSite] Remove CallSite from Lint.cpp

Summary: The CallSite arg iterator is really User::op_iterator.

Reviewers: dblaikie, craig.topper

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[MLIR] Fix affine loop tiling utility upper bound bug
Uday Bondhugula [Mon, 20 Apr 2020 16:59:21 +0000 (22:29 +0530)]
[MLIR] Fix affine loop tiling utility upper bound bug

Fix intra-tile upper bound setting in a scenario where the tile size was
larger than the trip count.

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

4 years ago[SemaObjC] Forbid storing an unboxed integer literal in an NSNumber
Erik Pilkington [Mon, 13 Apr 2020 20:19:16 +0000 (16:19 -0400)]
[SemaObjC] Forbid storing an unboxed integer literal in an NSNumber

This fixes a common mistake (the 3 should be @3): NSNumber *n = 3. This extends
an existing check for NSString. Also, this only errs if the initializer isn't a
null pointer constant, so NSNumber *n = 0; continues to work. rdar://47029572

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

4 years ago[clangd] Enable diagnostic fixes within macro argument expansions.
Sam McCall [Thu, 16 Apr 2020 23:38:42 +0000 (01:38 +0200)]
[clangd] Enable diagnostic fixes within macro argument expansions.

Summary: This seems like a pretty safe case, and common enough to be useful.

Reviewers: hokein

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

Tags: #clang

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

4 years ago[NFC] [AIX] [PowerPC] Add missing instruction to AIX byval test
Chris Bowler [Mon, 20 Apr 2020 18:59:26 +0000 (14:59 -0400)]
[NFC] [AIX] [PowerPC] Add missing instruction to AIX byval test

4 years agoRequire "target datalayout" to be at the beginning of an IR file.
Eli Friedman [Sat, 18 Apr 2020 02:33:26 +0000 (19:33 -0700)]
Require "target datalayout" to be at the beginning of an IR file.

This will allow us to use the datalayout to disambiguate other
constructs in IR, like load alignment. Split off from D78403.

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

4 years ago[lldb/Test] Don't friend std::make_unique
Jonas Devlieghere [Mon, 20 Apr 2020 18:33:35 +0000 (11:33 -0700)]
[lldb/Test] Don't friend std::make_unique

This wasn't a great idea to begin with, as you can't really rely on the
implementation, but since it also doesn't work with MSVC I've just made
the ctors public.

4 years ago[AIX] Return the correct set of callee saved regs
David Tenty [Mon, 20 Apr 2020 17:11:22 +0000 (13:11 -0400)]
[AIX] Return the correct set of callee saved regs

Summary:
r13 isn't reserved on 32-bit AIX, which is reflected in our calling
convention but not callee saved regs.

Reviewers: sfertile, ZarkoCA, cebowleratibm, jasonliu

Reviewed By: sfertile

Subscribers: thakis, lei, wuzish, nemanjai, hiraditya, kbarton, llvm-commits

Tags: #llvm

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

4 years ago[PowerPC] Do not attempt to reuse load for 64-bit FP_TO_UINT without FPCVT
Nemanja Ivanovic [Mon, 20 Apr 2020 17:59:47 +0000 (12:59 -0500)]
[PowerPC] Do not attempt to reuse load for 64-bit FP_TO_UINT without FPCVT

We call the function that attempts to reuse the conversion without checking
whether the target matches the constraints that the callee expects. This patch
adds the check prior to the call.

Fixes: https://bugs.llvm.org/show_bug.cgi?id=43976

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

4 years ago[libc++] Fix a few warnings when running the test suite with GCC
Louis Dionne [Mon, 20 Apr 2020 17:48:16 +0000 (13:48 -0400)]
[libc++] Fix a few warnings when running the test suite with GCC

4 years ago[ARM] Add an low overhead sibling loop test. NFC
David Green [Mon, 20 Apr 2020 17:12:43 +0000 (18:12 +0100)]
[ARM] Add an low overhead sibling loop test. NFC

4 years agoRevert "[MS] Fix assert handling enum forward decls in hasVisibleDefinition"
Rumeet Dhindsa [Mon, 20 Apr 2020 17:23:46 +0000 (10:23 -0700)]
Revert "[MS] Fix assert handling enum forward decls in hasVisibleDefinition"

This reverts commit e62dc1f6252c1dcdcc2a64e8e3b07a32412e9d89.

Reverting as per discussion with the patch author.
This patch causes module import error, but there was no intended
behavior change for code that does not use Microsoft extensions.

4 years ago[CallSite removal][ExecutionEngine] Use CallBase in the Interpreter. NFC
Craig Topper [Mon, 20 Apr 2020 17:02:08 +0000 (10:02 -0700)]
[CallSite removal][ExecutionEngine] Use CallBase in the Interpreter. NFC

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

4 years ago[dfsan] Add "DataFlow" option to LLVM_USE_SANITIZER
Zola Bridges [Fri, 17 Apr 2020 17:15:58 +0000 (10:15 -0700)]
[dfsan] Add "DataFlow" option to LLVM_USE_SANITIZER

Summary:
This patch add the dataflow option to LLVM_USE_SANITIZER and documents
it.

Tested via check-cxx (wip to fix the errors).

Reviewers: morehouse, #libc!

Subscribers: mgorny, cfe-commits, libcxx-commits

Tags: #clang, #libc

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

4 years ago[PowerPC][AIX] Use a file check variable for register used in addressing.
Sean Fertile [Mon, 20 Apr 2020 17:02:07 +0000 (13:02 -0400)]
[PowerPC][AIX] Use a file check variable for register used in addressing.

4 years agoRevert "[AIX] Return the correct set of callee saved regs"
David Tenty [Mon, 20 Apr 2020 17:00:26 +0000 (13:00 -0400)]
Revert "[AIX] Return the correct set of callee saved regs"

This reverts commit 6c881bf1fec2288907cd87a7895c863243bba7c5.

4 years ago[LSan] Disable a failing test on ARM
Oliver Stannard [Mon, 20 Apr 2020 14:54:41 +0000 (15:54 +0100)]
[LSan] Disable a failing test on ARM

This started failing after an OS upgrade on a buildbot machine, and I
don't see anything obvious to fix or revert, so disable it for now to
get the bot green.

Covered by https://bugs.llvm.org/show_bug.cgi?id=44158

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

4 years ago[lldb/Reproducers] Support new replay mode: passive replay
Jonas Devlieghere [Mon, 20 Apr 2020 16:37:07 +0000 (09:37 -0700)]
[lldb/Reproducers] Support new replay mode: passive replay

Support passive replay as proposed in the RFC [1] on lldb-dev and
described in more detail on the lldb website [2].

This patch extends the LLDB_RECORD macros to re-invoke the current
function with arguments deserialized from the reproducer. This relies on
the function being called in the exact same order as during replay. It
uses the same mechanism to toggle the API boundary as during recording,
which guarantees that only boundary crossing calls are replayed.

Another major change is that before this patch we could ignore the
result of an API call, because we only cared about the observable
behavior. Now we need to be able to return the replayed result to the
SWIG bindings.

We reuse a lot of the recording infrastructure, which can be a little
confusing. We kept the existing naming to limit the amount of churn, but
might revisit that in a future patch.

[1] http://lists.llvm.org/pipermail/lldb-dev/2020-April/016100.html
[2] https://lldb.llvm.org/resources/reproducers.html

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

4 years ago[ValueLattice] Add move constructor (NFC)
Nikita Popov [Fri, 17 Apr 2020 17:15:01 +0000 (19:15 +0200)]
[ValueLattice] Add move constructor (NFC)

Following the rule of five, declare move constructor and move
assignment operator for ValueLatticeElement. This allows moving
the ConstantRange rather than copying it.

This does not matter in most cases, where we're dealing with
APInts <= 64 bits. It does avoid unnecessary copies of allocations
for larger APInts.

Additionally we change the implementation approach to make the
copy/move assignment operators make use of the copy/move constructors,
rather than the other way around. The constructors are the more
primitive operations.

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

4 years ago[IPT] Don't use OrderedInstructions (NFC)
Nikita Popov [Sun, 19 Apr 2020 20:12:05 +0000 (22:12 +0200)]
[IPT] Don't use OrderedInstructions (NFC)

Use Instruction::comesBefore() instead of OrderedInstructions
inside InstructionPrecedenceTracking. This also removes the
dominator tree dependency.

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

4 years ago[libcxx][docs] Clearer mark up for --param
Zola Bridges [Fri, 17 Apr 2020 21:51:40 +0000 (14:51 -0700)]
[libcxx][docs] Clearer mark up for --param

Summary:
When I read this on the website it looks like the `--` in the used font turns
into an em dash. I updated this with inline literal mark up so the `--` will
remain obvious.

Reviewers: EricWF, #libc!

Subscribers: libcxx-commits

Tags: #libc

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

4 years ago[PowerPC][AIX] ByVal formal argument support: passing on the stack.
Sean Fertile [Wed, 8 Apr 2020 13:26:57 +0000 (09:26 -0400)]
[PowerPC][AIX] ByVal formal argument support: passing on the stack.

Adds support for passing a ByVal formal argument completely on the stack
(ie after all argument registers are exhausted).

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

4 years ago[lldb/Scripts] Add verbose and failure only mode to replay script.
Jonas Devlieghere [Mon, 20 Apr 2020 15:52:07 +0000 (08:52 -0700)]
[lldb/Scripts] Add verbose and failure only mode to replay script.

Add two modes to the reproducer replay script that make debugging a
little easier. Verbose mode prints stdout and stderr, regardless of
whether replay was successful. When --failure-only is passed, output is
limited to tests that failed to replay.

4 years ago[SveEmitter] Implement zeroing of false lanes
Sander de Smalen [Mon, 20 Apr 2020 15:34:23 +0000 (16:34 +0100)]
[SveEmitter] Implement zeroing of false lanes

This implements zeroing of false lanes for binary operations,
where instead of merging into the first operand vector (_m)
a `select` is placed on the first input vector. This approach
easily translates to the use of the `zeroing movprfx` instruction.

This patch also adds builtins for svabd, svadd, svdiv, svdivr,
svmax, svmin, svmul, svmulh, svub and svsubr.

Reviewers: SjoerdMeijer, efriedma, rovka

Reviewed By: efriedma

Tags: #clang

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

4 years ago[mlir][ods] Update doc regarding attribute definitions
Lei Zhang [Mon, 13 Apr 2020 18:54:09 +0000 (14:54 -0400)]
[mlir][ods] Update doc regarding attribute definitions

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

4 years ago[mlir][spirv] NFC: remove unnecessary `%N =` in test CHECKs
Lei Zhang [Mon, 20 Apr 2020 15:52:29 +0000 (11:52 -0400)]
[mlir][spirv] NFC: remove unnecessary `%N =` in test CHECKs

4 years ago[mlir][spirv] Lower memref with dynamic dimensions to runtime arrays
Lei Zhang [Wed, 15 Apr 2020 12:42:28 +0000 (08:42 -0400)]
[mlir][spirv] Lower memref with dynamic dimensions to runtime arrays

memref types with dynamic dimensions do not have a compile-time
known size. They should be mapped to SPIR-V runtime array types.

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

4 years ago[compiler-rt] Use --standalone when running tests on the iOS simulator
Julian Lettner [Sat, 18 Apr 2020 00:09:33 +0000 (17:09 -0700)]
[compiler-rt] Use --standalone when running tests on the iOS simulator

We can use `simctl spawn --standalone` to enable running tests without
the need for an already-booted simulator instance.  This also side-steps
the problem of not having a good place to shutdown the instance after
we are finished with testing.

rdar://58118442

Reviewed By: delcypher

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

4 years ago[VectorUtils] Use early_inc_range instead of DelSet (NFC).
Florian Hahn [Mon, 20 Apr 2020 15:03:21 +0000 (16:03 +0100)]
[VectorUtils] Use early_inc_range instead of DelSet (NFC).

DelSet was used to avoid invalidating the current iterator while
modifying the map we are iterating over.

By using an early_inc_range, (which increments to iterator 'early',
allowing us to remove the current element), we can get rid of DelSet.

Reviewers: gilr, rengolin, Ayal, hsaito

Reviewed By: Ayal

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

4 years ago[Preamble] Allow recursive inclusion of header-guarded mainfile.
Sam McCall [Fri, 17 Apr 2020 14:07:21 +0000 (16:07 +0200)]
[Preamble] Allow recursive inclusion of header-guarded mainfile.

Summary:
This is guaranteed to be a no-op without the preamble, so should be a
no-op with it too.

Partially fixes https://github.com/clangd/clangd/issues/337
This doesn't yet work for #ifndef guards, which are not recognized in preambles.
see D78038

I can't for the life of me work out how to test this outside clangd.
The original reentrant preamble diagnostic was untested, I added a test
to clangd for that too.

Reviewers: kadircet

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

Tags: #clang

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

4 years ago[SveEmitter] Explicitly merge with zero/undef
Sander de Smalen [Mon, 20 Apr 2020 14:13:34 +0000 (15:13 +0100)]
[SveEmitter] Explicitly merge with zero/undef

Builtins that have the merge type MergeAnyExp or MergeZeroExp,
merge into a 'undef' or 'zero' vector respectively, which enables the
_x and _z behaviour for unary operations.

This patch also adds builtins for svabs and svneg.

Reviewers: SjoerdMeijer, efriedma, rovka

Reviewed By: efriedma

Tags: #clang

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

4 years ago[AIX] Return the correct set of callee saved regs
David Tenty [Fri, 17 Apr 2020 17:06:08 +0000 (13:06 -0400)]
[AIX] Return the correct set of callee saved regs

Summary:
r13 isn't reserved on 32-bit AIX, which is reflected in our calling
convention but not callee saved regs.

Reviewers: sfertile, ZarkoCA, cebowleratibm, jasonliu

Reviewed By: sfertile

Subscribers: lei, wuzish, nemanjai, hiraditya, kbarton, llvm-commits

Tags: #llvm

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

4 years ago[MLIR] Add AtomicRMWRegionOp.
Alexander Belyaev [Mon, 20 Apr 2020 13:16:52 +0000 (15:16 +0200)]
[MLIR] Add AtomicRMWRegionOp.

https://llvm.discourse.group/t/rfc-add-std-atomic-rmw-op/489

Differensial revision: https://reviews.llvm.org/D78352

4 years agoRevert "[ARM] Fix conditions for lowering to S[LR]I"
Petre-Ionut Tudor [Mon, 20 Apr 2020 14:43:56 +0000 (15:43 +0100)]
Revert "[ARM] Fix conditions for lowering to S[LR]I"

This reverts commit cabfcf840a9d15d92466c6774953d3aa399cde92.
The patch introduced another bug in the optimization.

4 years agoBranchFolding.h - cleanup includes and forward declarations. NFC.
Simon Pilgrim [Mon, 20 Apr 2020 14:59:24 +0000 (15:59 +0100)]
BranchFolding.h - cleanup includes and forward declarations. NFC.
Push MBFIWrapper.h include down to BranchFolding.cpp/IfConversion.cpp

4 years agoMIRVRegNamerUtils.h - remove unnecessary includes. NFC.
Simon Pilgrim [Mon, 20 Apr 2020 13:33:21 +0000 (14:33 +0100)]
MIRVRegNamerUtils.h - remove unnecessary includes. NFC.
Replace with forward declarations or push down to MIRVRegNamerUtils.cpp where necessary.

4 years ago[ELF] Add --warn-backrefs-exclude=<glob>
Fangrui Song [Sun, 5 Apr 2020 04:31:36 +0000 (21:31 -0700)]
[ELF] Add --warn-backrefs-exclude=<glob>

D77522 changed --warn-backrefs to not warn for linking sandwich
problems (-ldef1 -lref -ldef2). This removed lots of false positives.

However, glibc still has some problems. libc.a defines some symbols
which are normally in libm.a and libpthread.a, e.g. __isnanl/raise.

For a linking order `-lm -lpthread -lc`, I have seen:

```
// different resolutions: GNU ld/gold select libc.a(s_isnan.o) as the definition
backward reference detected: __isnanl in libc.a(printf_fp.o) refers to libm.a(m_isnanl.o)

// different resolutions: GNU ld/gold select libc.a(raise.o) as the definition
backward reference detected: raise in libc.a(abort.o) refers to libpthread.a(pt-raise.o)
```

To facilitate deployment of --warn-backrefs, add --warn-backrefs-exclude= so that
certain known issues (which may be impractical to fix) can be whitelisted.

Deliberate choices:

* Not a comma-separated list (`--warn-backrefs-exclude=liba.a,libb.a`).
  -Wl, splits the argument at commas, so we cannot use commas.
  --export-dynamic-symbol is similar.
* Not in the style of `--warn-backrefs='*' --warn-backrefs=-liba.a`.
  We just need exclusion, not inclusion. For easier build system
  integration, we should avoid order dependency. With the current
  scheme, we enable --warn-backrefs, and indivial libraries can add
  --warn-backrefs-exclude=<glob> to their LDFLAGS.

Reviewed By: psmith

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

4 years ago[Dexter][NFC] Add Debugger Controller To Dexter
Tom Weaver [Mon, 20 Apr 2020 14:46:55 +0000 (15:46 +0100)]
[Dexter][NFC] Add Debugger Controller To Dexter

  Add DebuggerControllerBase and DefaultController to Dexter
  implements a new architecture that supports new and novel ways of running
  a debugger under dexter.
  Current implementation adds the original default behaviour via the new
  architecture via the DefaultController, this should have NFC.

Reviewers: Orlando

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

4 years ago[libc++] Fix the no-exceptions build of libc++ on Apple
Louis Dionne [Mon, 20 Apr 2020 09:22:20 +0000 (05:22 -0400)]
[libc++] Fix the no-exceptions build of libc++ on Apple

We previously tried re-exporting symbols that didn't exist when
exceptions were disabled. Note that building libc++abi without
exceptions still doesn't work when linking against the default-provided
libSystem.dylib, because it transitively depends on libobjc.dylib,
and that requires __gxx_personality_v0. But building libc++abi
with exceptions and libc++ without exceptions does work.