platform/upstream/llvm.git
2 years ago[NFC] Replace hard-coded usages of SystemZ::R15D with SpecialRegisters API
Anirudh Prasad [Fri, 24 Sep 2021 18:59:29 +0000 (14:59 -0400)]
[NFC] Replace hard-coded usages of SystemZ::R15D with SpecialRegisters API

This patch changes hard-coded usages of SystemZ::R15D with calls to the getStackPointerRegister function. Uses in the LowerCall function are avoided to avoid merge conflicts with an expected upcoming patch.

Reviewed By: uweigand

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

2 years ago[DSE] Add additional capture tests (NFC)
Nikita Popov [Fri, 24 Sep 2021 19:12:51 +0000 (21:12 +0200)]
[DSE] Add additional capture tests (NFC)

These test other escape sources and the case of multiple
underlying objects.

2 years ago[TargetLibraryInfo] Correctly handle sqrt*_finite
Paul Robinson [Fri, 24 Sep 2021 00:44:41 +0000 (17:44 -0700)]
[TargetLibraryInfo] Correctly handle sqrt*_finite

Other <math>_finite calls are marked as unavailable except on GNU/Linux;
it looks like the sqrt set was just overlooked.

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

2 years ago[compiler-rt] Add shared_cxxabi requirement to some tests
Leonard Chan [Fri, 24 Sep 2021 18:51:26 +0000 (11:51 -0700)]
[compiler-rt] Add shared_cxxabi requirement to some tests

This adds REQUIRES: shared_cxxabi to a bunch of tests that would fail if this
weak reference in sanitizer common was undefined. This is necessary in cases
where libc++abi.a is statically linked in. Because there is no strong reference
to __cxa_demangle in compiler-rt, then if libc++abi is linked in via a static
archive, then the linker will not extract the archive member that would define
that weak symbol. This causes a handful of tests to fail because this leads to
the symbolizer printing mangled symbols where tests expect them demangled.

Technically, this feature is WAI since sanitizer runtimes shouldn't fail if
this symbol isn't resolved, and linking statically means you wouldn't need to
link in all of libc++abi. As a workaround, we can simply make it a requirement
that these tests use shared libc++abis.

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

2 years ago[ARM] Addition jump table plus while loop block placement pass test.
David Green [Fri, 24 Sep 2021 18:30:49 +0000 (19:30 +0100)]
[ARM] Addition jump table plus while loop block placement pass test.

Also regenerated the file, whilst here.

2 years ago[libc++][NFC] Update status of old issue LWG2560 -- we implement it properly
Louis Dionne [Fri, 24 Sep 2021 18:21:58 +0000 (14:21 -0400)]
[libc++][NFC] Update status of old issue LWG2560 -- we implement it properly

2 years agoDebugInfo: Move the '=' version of -gsimple-template-names to the frontend
David Blaikie [Fri, 24 Sep 2021 18:15:53 +0000 (11:15 -0700)]
DebugInfo: Move the '=' version of -gsimple-template-names to the frontend

Based on feedback from Paul Robinson on 38c09ea that the 'mangled' mode
is only useful as an LLVM-developer-internal tool in combination with
llvm-dwarfdump --verify, so demote that to a frontend-only (not driver)
option. The driver support is simply -g{no-,}simple-template-names to
switch on simple template names, without the option to use the mangled
template name scheme there.

2 years ago[LiveIntervals] Fix asan debug build failures
Jay Foad [Fri, 24 Sep 2021 17:43:17 +0000 (18:43 +0100)]
[LiveIntervals] Fix asan debug build failures

Call RemoveMachineInstrFromMaps before erasing instrs.
repairIntervalsInRange will do this for you after erasing the
instruction, but it's not safe to rely on it because assertions in
SlotIndexes::removeMachineInstrFromMaps refer to fields in the erased
instruction.

This fixes asan buildbot failures caused by D110328.

2 years ago[libc++][NFC] Mark LWG3158 as implemented
Louis Dionne [Fri, 24 Sep 2021 18:10:19 +0000 (14:10 -0400)]
[libc++][NFC] Mark LWG3158 as implemented

It has been implemented in 59e26308e60a.

2 years ago[SystemZ][z/OS] Add GOFF Support to the DataLayout
Anirudh Prasad [Fri, 24 Sep 2021 18:05:55 +0000 (14:05 -0400)]
[SystemZ][z/OS] Add GOFF Support to the DataLayout

- This patch adds in the GOFF mangling support to the LLVM data layout string. A corresponding additional line has been added into the data layout section in the language reference documentation.
- Furthermore, this patch also sets the right data layout string for the z/OS target in the SystemZ backend.

Reviewed By: uweigand, Kai, abhina.sreeskantharajan, MaskRay

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

2 years ago[mlir:OpConversion] Remove the remaing usages of the deprecated matchAndRewrite methods
River Riddle [Fri, 24 Sep 2021 17:51:20 +0000 (17:51 +0000)]
[mlir:OpConversion] Remove the remaing usages of the deprecated matchAndRewrite methods

This commits updates the remaining usages of the ArrayRef<Value> based
matchAndRewrite/rewrite methods in favor of the new OpAdaptor
overload.

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

2 years ago[mlir:OpConversionPattern] Add overloads for taking an Adaptor instead of ArrayRef
River Riddle [Fri, 24 Sep 2021 17:50:58 +0000 (17:50 +0000)]
[mlir:OpConversionPattern] Add overloads for taking an Adaptor instead of ArrayRef

This has been a TODO for a long time, and it brings about many advantages (namely nice accessors, and less fragile code). The existing overloads that accept ArrayRef are now treated as deprecated and will be removed in a followup (after a small grace period). Most of the upstream MLIR usages have been fixed by this commit, the rest will be handled in a followup.

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

2 years ago[NFC][libc++] Update clang-format style.
Mark de Wever [Wed, 15 Sep 2021 16:29:22 +0000 (18:29 +0200)]
[NFC][libc++] Update clang-format style.

Changes the style as requested by @ldionne in D103368.

Reviewed By: ldionne, #libc, Quuxplusone

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

2 years agoRevert "Allow rematerialization of virtual reg uses"
Stanislav Mekhanoshin [Fri, 24 Sep 2021 16:53:51 +0000 (09:53 -0700)]
Revert "Allow rematerialization of virtual reg uses"

Reverted due to two distcint performance regression reports.

This reverts commit 92c1fd19abb15bc68b1127a26137a69e033cdb39.

2 years agoFix test from 8dd42f, capitalization in test
Erich Keane [Fri, 24 Sep 2021 17:24:17 +0000 (10:24 -0700)]
Fix test from 8dd42f, capitalization in test

2 years agoAdd test for DR1307, which we have already implemented.
Erich Keane [Fri, 24 Sep 2021 17:19:06 +0000 (10:19 -0700)]
Add test for DR1307, which we have already implemented.

Also regenerated cxx_dr_status.html

2 years ago[libc++] Refactor the tests for common_view to reduce duplication
Louis Dionne [Fri, 24 Sep 2021 17:10:44 +0000 (13:10 -0400)]
[libc++] Refactor the tests for common_view to reduce duplication

2 years ago[ConstantFold] ConstantFoldGetElementPtr - use APInt::isNegative() instead of getSExt...
Simon Pilgrim [Fri, 24 Sep 2021 17:08:56 +0000 (18:08 +0100)]
[ConstantFold] ConstantFoldGetElementPtr - use APInt::isNegative() instead of getSExtValue() to support big ints

Fixes fuzz test: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39197

2 years ago[SCCP] Regenerate bigint test checks
Simon Pilgrim [Fri, 24 Sep 2021 17:00:05 +0000 (18:00 +0100)]
[SCCP] Regenerate bigint test checks

2 years ago[PowerPC][NFC] Add test case in preparation for codegen change
Albion Fung [Fri, 24 Sep 2021 17:17:50 +0000 (12:17 -0500)]
[PowerPC][NFC] Add test case in preparation for codegen change

This test case tests doubles inserted into vector ints,
and help make apparent the optimizations a future patch
will make.

2 years agoFix wrong FixIt about union in cppcoreguidelines-pro-type-member-init
liuke [Fri, 24 Sep 2021 17:14:09 +0000 (13:14 -0400)]
Fix wrong FixIt about union in cppcoreguidelines-pro-type-member-init

At most one variant member of a union may have a default member
initializer. The case of anonymous records with multiple levels of
nesting like the following also needs to meet this rule. The original
logic is to horizontally obtain all the member variables in a record
that need to be initialized and then filter to the variables that need
to be fixed. Obviously, it is impossible to correctly initialize the
desired variables according to the nesting relationship.

See Example 3 in class.union

union U {
  U() {}
  int x;  // int x{};
  union {
    int k;  // int k{};  <==  wrong fix
  };
  union {
    int z;  // int z{};  <== wrong fix
    int y;
  };
};

2 years agoWrite test for CWG1772/CWG1762/CWG1779, mark them 'done', and update
Erich Keane [Fri, 24 Sep 2021 15:31:26 +0000 (08:31 -0700)]
Write test for CWG1772/CWG1762/CWG1779, mark them 'done', and update
cxx_dr_status.html

I noticed that these two DRs are currently working correctly, so I
added a pair of lit tests that check the AST (which is most useful for
CWG1779, since 'dependent' is really only observable in an ast dump) to
make sure __func__ works correctly in dependent cases, and in lambda
operator().

Also noticed that CWG1762, mostly an 'example' change, works correctly,
so added a test so that it gets marked 'done' as well.

Additionally, I regenerated cxx_dr_status.html, updating it for Clang
13's release, based on the cwg_status.html from August 12, 2021.

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

2 years ago[PowerPC] Mark splat immediate instructions as rematerializable
Victor Huang [Fri, 24 Sep 2021 15:46:56 +0000 (10:46 -0500)]
[PowerPC] Mark splat immediate instructions as rematerializable

This patch marks splat immediate instructions XXSPLTIW and XXSPLTIDP as
rematerializable to prevent MachineLICM from moving them out of loops.

Reviewed By: lei, amy

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

2 years agoRe-apply "[JumpThreading] Ignore free instructions"
Hans Wennborg [Fri, 24 Sep 2021 16:44:20 +0000 (18:44 +0200)]
Re-apply "[JumpThreading] Ignore free instructions"

It seems the crashes we saw wasn't caused by this (see comments on the review).

> This is basically D108837 but for jump threading. Free instructions
> should be ignored for the threading decision. JumpThreading already
> skips some free instructions (like pointer bitcasts), but does not
> skip various free intrinsics -- in fact, it currently gives them a
> fairly large cost of 2.
>
> Differential Revision: https://reviews.llvm.org/D110290

This reverts commit 4604695d7c20e72b551a1a5224f3de877cb41bd3.

2 years agoRevert "[flang][fir] Add support to mangle/deconstruct namelist group name"
Valentin Clement [Fri, 24 Sep 2021 16:49:40 +0000 (18:49 +0200)]
Revert "[flang][fir] Add support to mangle/deconstruct namelist group name"

This reverts commit 3593ae4312f6156c9ca50d46cdb55a8dfad782d0.

2 years ago[AMDGPU] Always reserve flat scratch SGPR for architected flat scratch
Stanislav Mekhanoshin [Fri, 24 Sep 2021 00:34:13 +0000 (17:34 -0700)]
[AMDGPU] Always reserve flat scratch SGPR for architected flat scratch

With architected flat scratch it becomes readonly. We must always
reserve SGPR pair for it even if we do not use scratch at all since
an attempt to write to SGPRs mapped to FLAT_SCRATCH results in
memory violation.

This is not needed since GFX10 with architected flat scratch though
since special SGPRs are not carving space from normal SGPRs.

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

2 years ago[mlir] Linalg: ensure tile-and-pad always creates padding as requested
Alex Zinenko [Fri, 24 Sep 2021 16:26:19 +0000 (18:26 +0200)]
[mlir] Linalg: ensure tile-and-pad always creates padding as requested

Initially, the padding transformation and the related operation were only used
to guarantee static shapes of subtensors in tiled operations. The
transformation would not insert the padding operation if the shapes were
already static, and the overall code generation would actively remove such
"noop" pads. However, this transformation can be also used to pack data into
smaller tensors and marshall them into faster memory, regardless of the size
mismatches. In context of expert-driven transformation, we should assume that,
if padding is requested, a potentially padded tensor must be always created.
Update the transformation accordingly. To do this, introduce an optional
`packing` attribute to the `pad_tensor` op that serves as an indication that
the padding is an intentional choice (as opposed to side effect of type
normalization) and should be left alone by cleanups.

Reviewed By: nicolasvasilache

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

2 years ago[PowerPC] Add range check for vec_genpcvm builtins
Quinn Pham [Tue, 14 Sep 2021 18:56:21 +0000 (13:56 -0500)]
[PowerPC] Add range check for vec_genpcvm builtins

This patch adds range checking for some Power10 altivec builtins. Range
checking is done in SemaChecking.

Reviewed By: #powerpc, lei, Conanap

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

2 years agoRecommit "[DSE] Track earliest escape, use for loads in isReadClobber."
Florian Hahn [Fri, 24 Sep 2021 14:41:47 +0000 (15:41 +0100)]
Recommit "[DSE] Track earliest escape, use for loads in isReadClobber."

This reverts the revert commit df56fc6ebbee6c458b0473185277b7860f7e3408.

This version of the patch adjusts the location where the EarliestEscapes
cache is cleared when an instruction gets removed. The earliest escaping
instruction does not have to be a memory instruction.

It could be a ptrtoint instruction like in the added test
@earliest_escape_ptrtoint, which subsequently gets removed. We need to
invalidate the EarliestEscape entry referring to the ptrtoint when
deleting it.

This fixes the crash mentioned in
https://bugs.chromium.org/p/chromium/issues/detail?id=1252762#c6

2 years ago[MC][NFC] Add end-of-namespace comments
Fraser Cormack [Fri, 24 Sep 2021 15:45:13 +0000 (16:45 +0100)]
[MC][NFC] Add end-of-namespace comments

2 years agotsan: don't use pipe2 in tests
Dmitry Vyukov [Fri, 24 Sep 2021 15:48:48 +0000 (17:48 +0200)]
tsan: don't use pipe2 in tests

MacOS buildbots failed:
stress.cpp:57:7: error: use of undeclared identifier 'pipe2'
https://green.lab.llvm.org/green//job/clang-stage1-RA/24209/consoleFull#-3468768778254eaf0-7326-4999-85b0-388101f2d404

Fix the test to not use pipe2.

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

2 years ago[X86][SSE] combineMulToPMADDWD - replace sext(v8i16) -> zext(v8i16)
Simon Pilgrim [Fri, 24 Sep 2021 14:30:04 +0000 (15:30 +0100)]
[X86][SSE] combineMulToPMADDWD - replace sext(v8i16) -> zext(v8i16)

As suggested on D108522, if we're sign extending a v4i16 source before multiplying as a v4i32, then we can replace that with a zero extension and rely on the implicit sign-extension of PMADDWD.

2 years ago[libc++] Require a C++20 capable compiler.
Mark de Wever [Thu, 23 Sep 2021 16:15:02 +0000 (12:15 -0400)]
[libc++] Require a C++20 capable compiler.

This enforces libcxx and its benchmarks are compiled by a C++20 capable
compiler. Based on review comments in D103413.

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

2 years ago[x86] convert logic-of-FP-compares to FP logic-of-vector-compares
Sanjay Patel [Fri, 24 Sep 2021 15:31:11 +0000 (11:31 -0400)]
[x86] convert logic-of-FP-compares to FP logic-of-vector-compares

This is motivated by the examples and discussion in:
https://llvm.org/PR51245
...and related bugs.

By using vector compares and vector logic, we can convert 2 'set'
instructions into 1 'movd' or 'movmsk' and generally improve
throughput/reduce instructions.

Unfortunately, we don't have a complete vector compare ISA before
AVX, so I left SSE-only out of this patch. Ie, we'd need extra logic
ops to simulate the missing predicates for SSE 'cmpp*', so it's not
as clearly a win.

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

2 years ago[InstCombine] add tests for lshr-trunc-lshr; NFC
Sanjay Patel [Fri, 24 Sep 2021 15:24:14 +0000 (11:24 -0400)]
[InstCombine] add tests for lshr-trunc-lshr; NFC

2 years ago[libc++][NFC] Add missing link to a ranges review
Louis Dionne [Fri, 24 Sep 2021 15:37:26 +0000 (11:37 -0400)]
[libc++][NFC] Add missing link to a ranges review

2 years ago[Transforms/Utils] Remove redundant declaration computeSyntheticCounts (NFC)
Kazu Hirata [Fri, 24 Sep 2021 15:08:57 +0000 (08:08 -0700)]
[Transforms/Utils] Remove redundant declaration computeSyntheticCounts (NFC)

2 years ago[llvm-objcopy][NFC] Add a helper method RelocationSectionBase::getNamePrefix()
Igor Kudrin [Fri, 24 Sep 2021 15:02:36 +0000 (22:02 +0700)]
[llvm-objcopy][NFC] Add a helper method RelocationSectionBase::getNamePrefix()

Refactor handleArgs() to use that method.

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

2 years ago[TargetLibraryInfo][AMDGPU] Minor cleanup, NFC
Paul Robinson [Fri, 24 Sep 2021 14:36:01 +0000 (07:36 -0700)]
[TargetLibraryInfo][AMDGPU] Minor cleanup, NFC

2 years agoRevert "[InstCombine] fold cast of right-shift if high bits are not demanded (2nd...
Sanjay Patel [Fri, 24 Sep 2021 14:37:38 +0000 (10:37 -0400)]
Revert "[InstCombine] fold cast of right-shift if high bits are not demanded (2nd try)"

This reverts commit bb9333c3504a4a02b982526ad8264d14c6ec1ad4.

This exposes another existing bug that causes an infinite loop as shown in
D110170
...so reverting while I look at another fix.

2 years agotsan: add a stress test
Dmitry Vyukov [Fri, 24 Sep 2021 13:55:31 +0000 (15:55 +0200)]
tsan: add a stress test

The stress test does various assorted things
(memory accesses, function calls, atomic operations,
thread creation/join, intercepted libc calls)
in multiple threads just to stress various parts
of the runtime.

Reviewed By: melver

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

2 years agoRevert "[JumpThreading] Ignore free instructions"
Hans Wennborg [Fri, 24 Sep 2021 14:14:53 +0000 (16:14 +0200)]
Revert "[JumpThreading] Ignore free instructions"

It caused compiler crashes, see comment on the code review for repro.

> This is basically D108837 but for jump threading. Free instructions
> should be ignored for the threading decision. JumpThreading already
> skips some free instructions (like pointer bitcasts), but does not
> skip various free intrinsics -- in fact, it currently gives them a
> fairly large cost of 2.
>
> Differential Revision: https://reviews.llvm.org/D110290

This reverts commit 1e3c6fc7cb9d2ee6a5328881f95d6643afeadbff.

2 years agotsan: add a test for flushing memory
Dmitry Vyukov [Fri, 24 Sep 2021 12:54:47 +0000 (14:54 +0200)]
tsan: add a test for flushing memory

Add a test for __tsan_flush_memory() and for background
flushing of the runtime memory.

Reviewed By: melver

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

2 years agoRevert "[DSE] Track earliest escape, use for loads in isReadClobber."
Nico Weber [Fri, 24 Sep 2021 13:56:56 +0000 (09:56 -0400)]
Revert "[DSE] Track earliest escape, use for loads in isReadClobber."

This reverts commit 5ce89279c0986d0bcbe526dce52f91dd0c16427c.
Makes clang crash, see comments on https://reviews.llvm.org/D109844

2 years ago[compiler-rt] Use portable "#!/usr/bin/env bash" shebang for tests.
Frederic Cambus [Fri, 24 Sep 2021 13:34:16 +0000 (19:04 +0530)]
[compiler-rt] Use portable "#!/usr/bin/env bash" shebang for tests.

In build_symbolizer.sh we can safely remove the -eu argument from the shebang (which is an unportable construct), as the scripts sets **-e** and **-u** already.

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

2 years ago[SystemZ] NFC: Remove unused intrinsic template arg 'name'
Cullen Rhodes [Fri, 24 Sep 2021 11:37:33 +0000 (11:37 +0000)]
[SystemZ] NFC: Remove unused intrinsic template arg 'name'

Identified in D109359.

Reviewed By: uweigand

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

2 years ago[lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API
Michał Górny [Fri, 24 Sep 2021 08:28:58 +0000 (10:28 +0200)]
[lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API

Refactor Socket::DecodeHostAndPort() to use LLVM API over redundant
LLDB API.  In particular, this means llvm::Regex, llvm::Error return
type and llvm::to_integer().

While at it, change the port type from int32_t to uint16_t.  The method
never returns any value outside this range, and using the correct type
allows us to rely on getAsInteger()'s implicit overflow check.

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

2 years ago[Analysis] Fix another issue when querying vscale attributes on functions
David Sherwood [Fri, 24 Sep 2021 12:31:38 +0000 (13:31 +0100)]
[Analysis] Fix another issue when querying vscale attributes on functions

There are several places in the code that are currently broken where
we assume an Instruction is always a member of a BasicBlock that
lives in a Function. This is a problem specifically when
attempting to get the vscale_range attribute. This patch adds checks
that an Instruction's parent also has a parent!

I've added a test for a function-less @llvm.vscale intrinsic call here:

  unittests/Analysis/ValueTrackingTest.cpp

2 years ago[flang][fir] Add support to mangle/deconstruct namelist group name
Valentin Clement [Fri, 24 Sep 2021 12:05:23 +0000 (14:05 +0200)]
[flang][fir] Add support to mangle/deconstruct namelist group name

Add support to create unique name for namelist group and be able to
deconstruct them.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2 years agoRevert "[lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API"
Michał Górny [Fri, 24 Sep 2021 11:33:51 +0000 (13:33 +0200)]
Revert "[lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API"

This reverts commit a6daf99228bc16fb7f2596d67a0d00fef327ace5.  It causes
buildbot regressions, I'll investigate.

2 years ago[lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API
Michał Górny [Fri, 24 Sep 2021 08:28:58 +0000 (10:28 +0200)]
[lldb] [Host] Refactor Socket::DecodeHostAndPort() to use LLVM API

Refactor Socket::DecodeHostAndPort() to use LLVM API over redundant
LLDB API.  In particular, this means llvm::Regex, llvm::Error return
type and llvm::to_integer().

While at it, change the port type from int32_t to uint16_t.  The method
never returns any value outside this range, and using the correct type
allows us to rely on getAsInteger()'s implicit overflow check.

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

2 years ago[LiveIntervals] Repair live intervals that gain subranges
Jay Foad [Thu, 23 Sep 2021 07:24:28 +0000 (08:24 +0100)]
[LiveIntervals] Repair live intervals that gain subranges

In repairIntervalsInRange, if the new instructions refer to subregs but
the old instructions did not, make sure any existing live interval for
the superreg is updated to have subranges. Also skip repairing any range
that we have recalculated from scratch, partly for efficiency but also
to avoids some cases that repairOldRegInRange can't handle.

The existing test/CodeGen/AMDGPU/twoaddr-regsequence.mir provides some
test coverage for this change: when TwoAddressInstructionPass converts
REG_SEQUENCE into subreg copies, the live intervals will now get
subranges and MachineVerifier will verify that the subranges are
correct. Unfortunately MachineVerifier does not complain if the
subranges are not present, so the test also passed before this patch.

This patch also fixes ~800 of the ~1500 failures in the whole CodeGen
lit test suite when -early-live-intervals is forced on.

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

2 years ago[LiveIntervals] Fix repairOldRegInRange for simple def cases
Jay Foad [Wed, 22 Sep 2021 11:14:18 +0000 (12:14 +0100)]
[LiveIntervals] Fix repairOldRegInRange for simple def cases

The fix applied in D23303 "LiveIntervalAnalysis: fix a crash in repairOldRegInRange"
was over-zealous. It would bail out when the end of the range to be
repaired was in the middle of the first segment of the live range of
Reg, which was always the case when the range contained a single def of
Reg.

This patch fixes it as suggested by Matthias Braun in post-commit review
on the original patch, and tests it by adding -early-live-intervals to
a selection of existing lit tests that now pass.

(Note that D23303 was originally applied to fix a crash in
SILoadStoreOptimizer, but that is now moot since D23814 updated
SILoadStoreOptimizer to run before scheduling so it no longer has to
update live intervals.)

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

Unrevert with some changes to the tests:
- Add -verify-machineinstrs to check for remaining problems in live
  interval support in TwoAddressInstructionPass.
- Drop test/CodeGen/AMDGPU/extract-load-i1.ll since it suffers from
  some of those remaining problems.

2 years ago[NFC] Mark LI.getLoopsInPreorder and LI.getLoopsInReverseSiblingPreorder const.
Joachim Meyer [Fri, 24 Sep 2021 10:01:02 +0000 (12:01 +0200)]
[NFC] Mark LI.getLoopsInPreorder and LI.getLoopsInReverseSiblingPreorder const.

They create a new vector with the list, so they can be const.

Reviewed By: fhahn

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

2 years ago[MLIR] PresburgerSet: support divisions in operations
Arjun P [Fri, 24 Sep 2021 10:04:06 +0000 (15:34 +0530)]
[MLIR] PresburgerSet: support divisions in operations

Add support for intersecting, subtracting, complementing and checking equality of sets having divisions.

Reviewed By: bondhugula

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

2 years ago[mlir] add pad_tensor(tensor.cast) -> pad_tensor canonicalizer
Alex Zinenko [Thu, 23 Sep 2021 16:37:28 +0000 (18:37 +0200)]
[mlir] add pad_tensor(tensor.cast) -> pad_tensor canonicalizer

This canonicalization pattern complements the tensor.cast(pad_tensor) one in
propagating constant type information when possible. It contributes to the
feasibility of pad hoisting.

Reviewed By: nicolasvasilache

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

2 years ago[CodeMoverUtils] Enhance isSafeToMoveBefore() when moving BBs
Congzhe Cao [Fri, 24 Sep 2021 09:40:58 +0000 (05:40 -0400)]
[CodeMoverUtils] Enhance isSafeToMoveBefore() when moving BBs

When moving an entire basic block BB before InsertPoint, currently
we check for all instructions whether the operands dominates
InsertPoint, however, this can be improved such that even an
operand does not dominate InsertPoint, as long as it appears as
a previous instruction in the same BB, it is safe to move.

Reviewed By: Whitney

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

2 years agoReapply "[Dexter] Improve performance by evaluating expressions only when needed"
Stephen Tozer [Fri, 24 Sep 2021 09:27:22 +0000 (10:27 +0100)]
Reapply "[Dexter] Improve performance by evaluating expressions only when needed"

Fixes issue found on greendragon buildbot, in which an incorrectly
indented statement following an if block led to entire frames being
dropped instead of simply filtering unneeded watches.

This reverts commit 1f44fa3ac17ceacc753019092bc50436c77ddcfa.

2 years ago[analyzer] Retrieve a value from list initialization of constant array declaration...
Denys Petrov [Tue, 21 Sep 2021 11:34:37 +0000 (14:34 +0300)]
[analyzer] Retrieve a value from list initialization of constant array declaration in a global scope.

Summary: Fix the point that we didn't take into account array's dimension. Retrieve a value of global constant array by iterating through its initializer list.

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

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

2 years agoRevert "[libcxx][pretty printers] Import gdb module in gdb feature check"
David Spickett [Fri, 24 Sep 2021 09:11:28 +0000 (09:11 +0000)]
Revert "[libcxx][pretty printers] Import gdb module in gdb feature check"

This reverts commit 0c2a4548455c6c943ac5e2b5c51ed5c2c91e34e7.

This was my mistake. When gdb can find its data directory it'll
import it automatically. If it can't (like when you're using a
version from a build folder) you need to give it the data
directory path.

We're safe to assume gdb is installed for testing purposes
so it'll import it for us.

2 years ago[RISCV] (2/2) Add the tail policy argument to builtins/intrinsics.
Hsiangkai Wang [Mon, 6 Sep 2021 13:27:15 +0000 (21:27 +0800)]
[RISCV] (2/2) Add the tail policy argument to builtins/intrinsics.

Add the tail policy argument to Clang builtins. There
are two policies for tail elements. Tail agnostic means users do not
care about the values in the tail elements and tail undisturbed means
the values in the tail elements need to be kept after the operation. In
order to let users control the tail policy, we add an additional
argument at the end of the argument list.

For unmasked operations, we have no maskedoff and the tail policy is
always tail agnostic. If users want to keep tail elements under unmasked
operations, they could use all one mask in the masked operations to do
it. So, we only add the additional argument for masked operations for
most cases. There are exceptions listed below.

In this patch, we do not handle the following cases to reduce the
complexity of the patch. There could be two separate patches for them.

Use dest argument to control tail policy
vmerge.vvm/vmerge.vxm/vmerge.vim (add _t builtins with additional dest
argument)
vfmerge.vfm (add _t builtins with additional dest argument)
vmv.v.v (add _t builtins with additional dest argument)
vmv.v.x (add _t builtins with additional dest argument)
vmv.v.i (add _t builtins with additional dest argument)
vfmv.v.f (add _t builtins with additional dest argument)
vadc.vvm/vadc.vxm/vadc.vim (add _t builtins with additional dest
argument)
vsbc.vvm/vsbc.vxm (add _t builtins with additional dest argument)

Always has tail argument for masked/unmasked intrinsics
Vector Single-Width Integer Multiply-Add Instructions (add _t and _mt
builtins)
Vector Widening Integer Multiply-Add Instructions (add _t and _mt
builtins)
Vector Single-Width Floating-Point Fused Multiply-Add Instructions (add
_t and _mt builtins)
Vector Widening Floating-Point Fused Multiply-Add Instructions (add _t
and _mt builtins)
Vector Reduction Operations (add _t and _mt builtins)
Vector Slideup Instructions (add _t and _mt builtins)
Vector Slidedown Instructions (add _t and _mt builtins)

Discussion: https://github.com/riscv/rvv-intrinsic-doc/pull/101

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

2 years ago[RISCV] (1/2) Add the tail policy argument to builtins/intrinsics.
Hsiangkai Wang [Thu, 2 Sep 2021 14:42:50 +0000 (22:42 +0800)]
[RISCV] (1/2) Add the tail policy argument to builtins/intrinsics.

Add the tail policy argument to LLVM IR intrinsics. There are two policies for tail elements. Tail agnostic means users do not care about the values in the tail elements and tail undisturbed means the values in the tail elements need to be kept after the operation. In order to let users control the tail policy, we add an additional argument at the end of the argument list.

For unmasked operations, we have no maskedoff and the tail policy is always tail agnostic. If users want to keep tail elements under unmasked operations, they could use all one mask in the masked operations to do it. So, we only add the additional argument for masked operations for most cases. There are exceptions listed below.

In this patch, we do not handle the following cases to reduce the complexity of the patch. There could be two separate patches for them.

* Use dest argument to control tail policy
vmerge.vvm/vmerge.vxm/vmerge.vim (add _t builtins with additional dest argument)
vfmerge.vfm (add _t builtins with additional dest argument)
vmv.v.v (add _t builtins with additional dest argument)
vmv.v.x (add _t builtins with additional dest argument)
vmv.v.i (add _t builtins with additional dest argument)
vfmv.v.f (add _t builtins with additional dest argument)
vadc.vvm/vadc.vxm/vadc.vim (add _t builtins with additional dest argument)
vsbc.vvm/vsbc.vxm (add _t builtins with additional dest argument)

* Always has tail argument for masked/unmasked intrinsics
Vector Single-Width Integer Multiply-Add Instructions (add _t and _mt builtins)
Vector Widening Integer Multiply-Add Instructions (add _t and _mt builtins)
Vector Single-Width Floating-Point Fused Multiply-Add Instructions (add _t and _mt builtins)
Vector Widening Floating-Point Fused Multiply-Add Instructions (add _t and _mt builtins)
Vector Reduction Operations (add _t and _mt builtins)
Vector Slideup Instructions (add _t and _mt builtins)
Vector Slidedown Instructions (add _t and _mt builtins)

Discussion: https://github.com/riscv/rvv-intrinsic-doc/pull/101

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

2 years ago[X86][SLM] Fix ADDQ/SUBQ/CMPEQQ throughput to account for running on either port.
Simon Pilgrim [Thu, 23 Sep 2021 18:47:58 +0000 (19:47 +0100)]
[X86][SLM] Fix ADDQ/SUBQ/CMPEQQ throughput to account for running on either port.

Testing on a SLM box suggests these can run on either port, but the throughput is 4cy on either (inc MMX versions). Confirmed with Intel AoM / Agner / InstLatX64.

2 years ago[clang-doc] Pass Record argument by const-ref. NFCI.
Simon Pilgrim [Thu, 23 Sep 2021 15:08:47 +0000 (16:08 +0100)]
[clang-doc] Pass Record argument by const-ref. NFCI.

Record is a SmallVector<uint64_t, 1024> - we really need to avoid passing this by value.

Avoid unnecessary big copies, reported by coverity.

2 years ago[libcxx][pretty printers] Import gdb module in gdb feature check
David Spickett [Fri, 24 Sep 2021 09:02:34 +0000 (09:02 +0000)]
[libcxx][pretty printers] Import gdb module in gdb feature check

Earlier versions of GDB do not do this automatically.
(from my checks 8.3 does not and 9.2 does)

2 years ago[Analysis] Fix issues when querying vscale attributes on functions
David Sherwood [Tue, 21 Sep 2021 11:11:04 +0000 (12:11 +0100)]
[Analysis] Fix issues when querying vscale attributes on functions

There are several places in the code that are currently broken as
they assume an Instruction always has a parent Function when
attempting to get the vscale_range attribute. This patch adds checks
that an Instruction has a parent.

I've added a test for a parentless @llvm.vscale intrinsic call here:

  unittests/Analysis/ValueTrackingTest.cpp

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

2 years ago[llvm-objcopy][docs] Add missing options to the help output and the command guide
gbreynoo [Fri, 24 Sep 2021 08:36:47 +0000 (09:36 +0100)]
[llvm-objcopy][docs] Add missing options to the help output and the command guide

This change is to keep the help text and command guide of objcopy in
tandem.

- In the help output the options --rename-section and
  --set-section-flags were missing the flag exclude, which is found in
  the command guide.
- In the command guide the alias -G for --keep-global-symbol was
    missing, which is found in the help output.

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

2 years ago[clang-format] Fixed an unused variable warning
Dmitri Gribenko [Fri, 24 Sep 2021 08:36:21 +0000 (10:36 +0200)]
[clang-format] Fixed an unused variable warning

2 years ago[libcxx][pretty printers] Check GDB Python scripting support
David Spickett [Thu, 23 Sep 2021 13:28:24 +0000 (13:28 +0000)]
[libcxx][pretty printers] Check GDB Python scripting support

I found this after upgrading from Ubuntu bionic (gdb 8.1.1) to
Focal (gdb 9.2). (where this test fails, but that's for a
different patch)

9.2 allows you to set breakpoint commands from
Python, which was added in 8.3.
(bintutils a913fffbdee21fdd50e8de0596358be425775678
"Allow breakpoint commands to be set from Python")

The reason this test never failed before was because it did so
silently. "source <python file>" doesn't fail even if that script
raises an Exception.

To fix this extend the gdb lit feature to check that:
* gdb exists
* has Python support
* allows you to set breakpoint commands

Reviewed By: #libc, ldionne

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

2 years ago[SystemZ] Implement ISD::BITCAST for fp128 -> i128.
Jonas Paulsson [Thu, 23 Sep 2021 16:13:58 +0000 (18:13 +0200)]
[SystemZ] Implement ISD::BITCAST for fp128 -> i128.

The type legalizer has by default no method of doing this bitcast other than
storing and reloading the value from stack.

This patch implements a custom lowering of this operation using extractions
of subregs (z13 and earlier using FP128 register pairs), or of vector
elements (with 'vector enhancements 1' using VR128 FP registers).

Review: Ulrich Weigand

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

2 years ago[AArch64] Rewrite ldst-unsignedimm.ll codegen test.
David Green [Fri, 24 Sep 2021 08:08:59 +0000 (09:08 +0100)]
[AArch64] Rewrite ldst-unsignedimm.ll codegen test.

Instead of relying on many volatile loads/stores in a single function,
rewrite the test to use separate functions as any other test would.

2 years ago[mlir][linalg] Fix result type in FoldSourceTensorCast
Matthias Springer [Fri, 24 Sep 2021 07:39:37 +0000 (16:39 +0900)]
[mlir][linalg] Fix result type in FoldSourceTensorCast

* Do not discard static result type information that cannot be inferred from lower/upper padding.
* Add optional argument to `PadTensorOp::inferResultType` for specifying known result dimensions.

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

2 years ago[Driver] Correctly handle static C++ standard library
Petr Hosek [Tue, 21 Sep 2021 06:25:21 +0000 (23:25 -0700)]
[Driver] Correctly handle static C++ standard library

When statically linking C++ standard library, we shouldn't add -Bdynamic
after including the library on the link line because that might override
user settings like -static and -static-pie. Rather, we should surround
the library with --push-state/--pop-state to make sure that -Bstatic
only applies to C++ standard library and nothing else. This has been
supported since GNU ld 2.25 (2014) so backwards compatibility should
no longer be a concern.

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

2 years ago[GlobalISel][IRTranslator] Fix crash during bit-test switch optimization with odd...
Amara Emerson [Fri, 24 Sep 2021 06:49:39 +0000 (23:49 -0700)]
[GlobalISel][IRTranslator] Fix crash during bit-test switch optimization with odd types.

Odd switch case types cause a crash in the conversion to MVT. Instead use a pointer sized
scalar type which is what SDAG does in these cases.

2 years ago[clang-format][docs] Fix documentation of clang-format BasedOnStyle type
Ludovic Jozeau [Fri, 24 Sep 2021 07:14:53 +0000 (08:14 +0100)]
[clang-format][docs] Fix documentation of clang-format BasedOnStyle type

Fix little inconsistency and use `std::string` (which is used everywhere
else) instead of `string`

Reviewed By: MyDeveloperDay, HazardyKnusperkeks

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

2 years ago[clang-format] ensure clang-format command-line argument sets up the default left...
mydeveloperday [Fri, 24 Sep 2021 07:11:05 +0000 (08:11 +0100)]
[clang-format] ensure clang-format command-line argument sets up the default left/right qualifier ordering

When specifying the alignment direction on the command line ensure
we set up the default ordering.

Fix spelling mistakes in the command-line argument

Reviewed By: HazardyKnusperkeks

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

2 years ago[lldb] Fix target-symbols-add-unwind.test for clang 7647a841
Pavel Labath [Fri, 24 Sep 2021 07:05:19 +0000 (09:05 +0200)]
[lldb] Fix target-symbols-add-unwind.test for clang 7647a841

We need a different flag combination to produce .debug_frame.

2 years ago[clang-offload-bundler][docs][NFC] invalid indentation cause build issue
mydeveloperday [Fri, 24 Sep 2021 07:03:52 +0000 (08:03 +0100)]
[clang-offload-bundler][docs][NFC] invalid indentation cause build issue

2 years ago[AArch64][GlobalISel] Fix crash in the extend(extract_vector_elt) optimization.
Amara Emerson [Fri, 24 Sep 2021 05:53:52 +0000 (22:53 -0700)]
[AArch64][GlobalISel] Fix crash in the extend(extract_vector_elt) optimization.

It was assuming that GPR extends could only have destination sizes of 32 or 64
bits, but for AArch64 we allow < 32 bits even without matching size physregs.

2 years ago[ORC-RT] Rename ExecutorAddress to ExecutorAddr.
Lang Hames [Fri, 24 Sep 2021 03:52:21 +0000 (20:52 -0700)]
[ORC-RT] Rename ExecutorAddress to ExecutorAddr.

This is an ORC-runtime counterpart to LLVM commit ef391df2b63, and the
motivation is the same: to move to a shorter name to improve the ergonomics of
this type before it's more widely adopted.

2 years ago[PowerPC] SemaChecking for darn family of builtins
Albion Fung [Thu, 23 Sep 2021 19:44:06 +0000 (14:44 -0500)]
[PowerPC] SemaChecking for darn family of builtins

The __darn family of builtins are only available on Pwr9,
and only __darn_32 is available on both 64 and 32 bit, while the rest
are only available on 64 bit. The patch adds sema checking
for these builtins and separate the __darn_32's 32 bit
test cases.

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

2 years agoFix that same path separator issue again...
David Blaikie [Fri, 24 Sep 2021 04:15:01 +0000 (21:15 -0700)]
Fix that same path separator issue again...

2 years agoDebugInfo: STN: Handle unreconstitutable types in function types
David Blaikie [Fri, 24 Sep 2021 04:13:16 +0000 (21:13 -0700)]
DebugInfo: STN: Handle unreconstitutable types in function types

2 years agoRemove non-portable directory separator from test
David Blaikie [Fri, 24 Sep 2021 03:46:57 +0000 (20:46 -0700)]
Remove non-portable directory separator from test

2 years ago[ORC] Rename ExecutorAddress to ExecutorAddr.
Lang Hames [Thu, 23 Sep 2021 19:00:47 +0000 (12:00 -0700)]
[ORC] Rename ExecutorAddress to ExecutorAddr.

Removing the 'ess' suffix improves the ergonomics without sacrificing clarity.
Since this class is likely to be used more frequently in the future it's worth
some short term pain to fix this now.

2 years ago[docs] Document the --print-passes flag in opt.
Frederic Cambus [Fri, 24 Sep 2021 03:26:36 +0000 (08:56 +0530)]
[docs] Document the --print-passes flag in opt.

Reviewed By: aeubanks, asbirlea

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

2 years ago[Sanitizers] intercept ttyent api on FreeBSD.
David Carlier [Fri, 24 Sep 2021 03:26:05 +0000 (04:26 +0100)]
[Sanitizers] intercept ttyent api on FreeBSD.

and ttyentpath separately on NetBSD.

Reviewed By: vitalybuka

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

2 years ago[TableGen] Allow targets to entirely ignore Psets for registers
Christudasan Devadasan [Thu, 23 Sep 2021 04:08:14 +0000 (00:08 -0400)]
[TableGen] Allow targets to entirely ignore Psets for registers

Tablegen currently expects targets to have at least one
pressure set for every broader register category. AMDGPU's
VGPR or AGPR, for instance, seemed to work correctly without
any pset, though we have forced one for each type to avoid
the assertion in computeRegUnitSets. However, psets can not
be entirely empty. At least one set is mandatory for every
target. This patch bypasses the assertion for the classes
when GeneratePressureSet is zero while ensuring the
RegUnitSets are not empty.

Reviewed By: arsenm, rampitec

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

2 years ago[gn build] Port a2c1cf09dfaa
LLVM GN Syncbot [Fri, 24 Sep 2021 03:01:20 +0000 (03:01 +0000)]
[gn build] Port a2c1cf09dfaa

2 years ago[ORC] Introduce EPCGenericDylibManager / SimpleExecutorDylibManager.
Lang Hames [Wed, 22 Sep 2021 05:34:46 +0000 (15:34 +1000)]
[ORC] Introduce EPCGenericDylibManager / SimpleExecutorDylibManager.

EPCGenericDylibManager provides an interface for loading dylibs and looking up
symbols in the executor, implemented using EPC-calls to functions in the
executor.

SimpleExecutorDylibManager is an executor-side service that provides the
functions used by EPCGenericDylibManager.

SimpleRemoteEPC is updated to use an EPCGenericDylibManager instance to
implement the ExecutorProcessControl loadDylib and lookup methods. In a future
commit these methods will be removed, and clients updated to use
EPCGenericDylibManagers directly.

2 years agoDebugInfo: Implement the -gsimple-template-names functionality
David Blaikie [Mon, 20 Sep 2021 03:45:42 +0000 (20:45 -0700)]
DebugInfo: Implement the -gsimple-template-names functionality

This excludes certain names that can't be rebuilt from the available
DWARF:

* Atomic types - no DWARF differentiating int from atomic int.
* Vector types - enough DWARF (an attribute on the array type) to do
  this, but I haven't written the extra code to add the attributes
  required for this
* Lambdas - ambiguous with any other unnamed class
* Unnamed classes/enums - would need column info for the type in
  addition to file/line number
* noexcept function types - not encoded in DWARF

2 years ago[AMDGPU] Legalize initialized LDS variables
Christudasan Devadasan [Thu, 16 Sep 2021 16:06:16 +0000 (12:06 -0400)]
[AMDGPU] Legalize initialized LDS variables

We don't allow an initializer for LDS variables
and there is an early abort during instruction
selection. This patch legalizes them by ignoring
the init values. During assembly emission, proper
error reporting already exists for such instances.

Reviewed By: arsenm

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

2 years ago[Driver] Default Generic_GCC x86 to -fasynchronous-unwind-tables
Fangrui Song [Fri, 24 Sep 2021 02:39:50 +0000 (19:39 -0700)]
[Driver] Default Generic_GCC x86 to -fasynchronous-unwind-tables

to match GCC and Clang's own x86-64.

2 years ago[Polly] Implement user-directed loop distribution/fission.
Michael Kruse [Wed, 22 Sep 2021 22:27:16 +0000 (17:27 -0500)]
[Polly] Implement user-directed loop distribution/fission.

This is a simple version without the possibility to define distribute
points or followup-transformations. However, it is the first
transformation that has to check whether the transformation is correct.

It interprets the same metadata as the LoopDistribute pass.

Re-apply after revert in c7bcd72a38bcf99e03e4651ed5204d1a1f2bf695 with
fix: Take isBand out of #ifndef NDEBUG since it now is used
unconditionally.

2 years agoAdd missing storageType to AttrDef to ODS
Mehdi Amini [Fri, 24 Sep 2021 00:15:49 +0000 (00:15 +0000)]
Add missing storageType to AttrDef to ODS

This is only noticeable when using an attribute across dialects I think.
Previously the namespace would be ommited, but it wouldn't matter as
long as the generated code stays within a single namespace.

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

2 years ago[mlir][linalg] Support tile+peel with TiledLoopOp
Matthias Springer [Fri, 24 Sep 2021 01:22:03 +0000 (10:22 +0900)]
[mlir][linalg] Support tile+peel with TiledLoopOp

Only scf.for was supported until now.

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

2 years ago[mlir][linalg] Merge all tiling passes into a single one.
Matthias Springer [Fri, 24 Sep 2021 01:16:14 +0000 (10:16 +0900)]
[mlir][linalg] Merge all tiling passes into a single one.

Passes such as `linalg-tile-to-tiled-loop` are merged into `linalg-tile`.

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

2 years ago[ThinLTO] Fix bot failures
Teresa Johnson [Fri, 24 Sep 2021 00:57:16 +0000 (17:57 -0700)]
[ThinLTO] Fix bot failures

Fix bot failures after 2c1defeee40cf643ea6f0fa5e01164c9a4c48c30. The new
GUID I added isn't matching because it is a local with the source path
prepended. There isn't much use in matching the GUID's exactly anyway,
so remove those from the patterns.

2 years ago[ThinLTO] Don't emit original GUID for locals to distributed indexes
Teresa Johnson [Wed, 22 Sep 2021 23:25:33 +0000 (16:25 -0700)]
[ThinLTO] Don't emit original GUID for locals to distributed indexes

In ThinLTO for locals we normally compute the GUID from the name after
prepending the source path to get a unique global id. SamplePGO indirect
call profiles contain the target GUID without this uniquification,
however (unless compiling with -funique-internal-linkage-names).
Therefore, the index contains the original GUID of the local symbols
(without module path prepended to uniquify), in order to correctly
handle the call edges added for these indirect call profile targets
with SamplePGO.

We were emitting these to the combined index when writing it out as
bitcode, which is unnecessary and causes overhead when writing out the
indexes for distributed backends. The only use of the original GUID name
is in the thin link. Suppress it in that case. This reduced the thin
link time for a large distributed build by about 7%, and the aggregate
size of the serialized indexes by over 2%.

Continue to print it when writing out the full index, since that is just
used for debugging and testing.

Update a distributed thinlto index test to contain a local and ensure
that we don't get a COMBINED_ORIGINAL_NAME record.

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

2 years ago[compiler-rt][profile] Make corrupted-profile.c more robust
Leonard Chan [Fri, 24 Sep 2021 00:16:47 +0000 (17:16 -0700)]
[compiler-rt][profile] Make corrupted-profile.c more robust

This test specifically checks that profiles are not mergeable if there's a
change in the CounterPtr in the profile header. The test manually changes
CounterPtr by explicitly calling memset on some offset into the profile file.
This test would fail if binary IDs were emitted because the offset calculation
does not take into account the binary ID sizes.

This patch updates the test to use types provided in profile/InstrProfData.inc
to make it more resistant to profile layout changes.

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