platform/upstream/llvm.git
3 years agoRevert "Support: Use std::unique_ptr for SignpostEmitter::Impl, NFC"
Duncan P. N. Exon Smith [Thu, 8 Apr 2021 23:36:42 +0000 (16:36 -0700)]
Revert "Support: Use std::unique_ptr for SignpostEmitter::Impl, NFC"

This reverts commit 022ccedde8877e877b45e49641544b5e4fff0b42. Looks like
some hosts need a definition of SignpostEmitterImpl to put it in a
unique_ptr:
https://lab.llvm.org/buildbot/#/builders/92/builds/7733

3 years agoSupport: Avoid unnecessary std::function for SignpostEmitterImpl::SignpostLog
Duncan P. N. Exon Smith [Thu, 8 Apr 2021 23:20:31 +0000 (16:20 -0700)]
Support: Avoid unnecessary std::function for SignpostEmitterImpl::SignpostLog

The destructor for SignPostEmitterImpl::SignpostLog is known statically. Avoid
the unnecessary vtable indirection through std::function in the std::unique_ptr
by turning LogDeleter into a struct. No real functionality change here.

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

3 years agoSupport: Drop the no-op initializer for SignpostEmitterImpl::Signposts, NFC
Duncan P. N. Exon Smith [Thu, 8 Apr 2021 23:14:16 +0000 (16:14 -0700)]
Support: Drop the no-op initializer for SignpostEmitterImpl::Signposts, NFC

This is a DenseMap, which has its own initializer; we don't need to explicitly
call the default constructor here.

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

3 years agoSupport: Use std::unique_ptr for SignpostEmitter::Impl, NFC
Duncan P. N. Exon Smith [Thu, 8 Apr 2021 23:04:55 +0000 (16:04 -0700)]
Support: Use std::unique_ptr for SignpostEmitter::Impl, NFC

Replace some manual memory management with std::unique_ptr.

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

3 years agoSupport: Extract fs::resize_file_before_mapping_readwrite from FileOutputBuffer
Duncan P. N. Exon Smith [Wed, 27 Jan 2021 00:01:36 +0000 (16:01 -0800)]
Support: Extract fs::resize_file_before_mapping_readwrite from FileOutputBuffer

Add a variant of `fs::resize_file` for use immediately before opening a
file with `mapped_file_region::readwrite`. On Windows, `_chsize`
(`ftruncate`) is slow, but `CreateFileMapping` (`mmap`) automatically
extends the file so the call to `fs::resize_file` can be skipped.

This optimization was added to `FileOutputBuffer` in
da9bc2e56d5a5c6332a9def1a0065eb399182b93; this commit just extracts the
logic out and adds a unit test.

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

3 years agoImprove error message when tring to export to LLVM IR with a dialect missing the...
Mehdi Amini [Thu, 8 Apr 2021 22:15:39 +0000 (22:15 +0000)]
Improve error message when tring to export to LLVM IR with a dialect missing the interface

Dialects can be translated to LLVM IR when they have the
LLVMTranslationDialectInterface interface registered. In case the
interface isn't explicitly registered, even the LLVM dialect can't be
exported to LLVM IR. This make the error message more explicit on this.

Reviewed By: ftynse

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

3 years ago[ASTMatchers] Add `cxxBaseSpecifier` matcher (non-top-level)
Nikita Kniazev [Thu, 8 Apr 2021 22:55:22 +0000 (23:55 +0100)]
[ASTMatchers] Add `cxxBaseSpecifier` matcher (non-top-level)

Required for capturing base specifier in matchers:
  `cxxRecordDecl(hasDirectBase(cxxBaseSpecifier().bind("base")))`

Reviewed By: steveire, aaron.ballman

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

3 years ago[compiler-rt][hwasan] Add C++17 new/delete operators with alignment
Leonard Chan [Thu, 25 Mar 2021 19:32:21 +0000 (12:32 -0700)]
[compiler-rt][hwasan] Add C++17 new/delete operators with alignment

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

3 years ago[RISCV] Use multiclass inheritance where possible for the VPat* multiclasses in RISVI...
Craig Topper [Thu, 8 Apr 2021 22:02:57 +0000 (15:02 -0700)]
[RISCV] Use multiclass inheritance where possible for the VPat* multiclasses in RISVInstrInfoVPseudos. NFCI

Instead of instantiating multiclasses inside multiclasses, just
inherit from them.

We can do the same for the VPseudo* multiclasses, but that may
interfere with the scheduler class work.

3 years ago[RISCV] Remove empty string after 'defm' at top level of vector .td files. NFC
Craig Topper [Thu, 8 Apr 2021 21:47:41 +0000 (14:47 -0700)]
[RISCV] Remove empty string after 'defm' at top level of vector .td files. NFC

This doesn't do anything so it's just wasted characters. I have
other plans for the ones in multiclasses.

3 years ago[lldb] (Temporarily) disable vfork-follow-parent-wp.test on Darwin
Jonas Devlieghere [Thu, 8 Apr 2021 22:05:26 +0000 (15:05 -0700)]
[lldb] (Temporarily) disable vfork-follow-parent-wp.test on Darwin

The test is failing on GreenDragon. Pinged Michał in D98822.

3 years ago[SLP]Fix PR49898: Infinite loop in SLP vectorizer.
Alexey Bataev [Thu, 8 Apr 2021 18:33:57 +0000 (11:33 -0700)]
[SLP]Fix PR49898: Infinite loop in SLP vectorizer.

We should not re-try attempt of finding of the consecutive store chain
if it was tried before.

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

3 years ago[funcattrs] Infer nosync from instruction walk
Philip Reames [Thu, 8 Apr 2021 21:02:39 +0000 (14:02 -0700)]
[funcattrs] Infer nosync from instruction walk

Pretty straightforward use of existing infrastructure and port of the attributor inference rules for nosync.

A couple points of interest:
* I deliberately switched from "monotonic or better" to "unordered or better". This is simply me being conservative and is better in line with the rest of the optimizer. We treat monotonic conservatively pretty much everywhere.
* The operand bundle test change is suspicious. It looks like we might have missed something here, but if so, it's an issue with the existing nofree inference as well. I'm going to take a closer look at that separately.
* I needed to keep the previous inference from readnone. This surprised me, but made sense once I realized readonly inference goes to lengths to reason about local vs non-local memory and that writes to local memory are okay. This is fine for the purpose of nosync, but would e.g. prevent us from inferring nofree from readnone - which is slightly surprising.

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

3 years ago[GVN] Properly invalidate ICF cache when we simplify a value
Arthur Eubanks [Thu, 8 Apr 2021 18:44:23 +0000 (11:44 -0700)]
[GVN] Properly invalidate ICF cache when we simplify a value

This fixes a "Cached first special instruction is wrong!" assert.

The assert fires because replacing a value with another can cause an
instruction to no longer be "special" to ICF. In this case,
devirtualization happened, turning an indirect call to a
call to a willreturn function which is no longer special.

Reviewed By: nikic, rnk

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

3 years agoInclude `count` in AppleClang toolchains.
Dan Liew [Thu, 8 Apr 2021 04:33:24 +0000 (21:33 -0700)]
Include `count` in AppleClang toolchains.

The motivation here is so we can run the compiler-rt tests
from a standalone build against AppleClang.

In particular the `Posix/halt_on_error-torture.cpp` and
`Posix/halt_on_error_suppress_equal_pcs.cpp` ASan test cases currently
require this binary for the tests to pass.

rdar://76366784

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

3 years ago[FileCheck, test] Rename checkWildcardRegexCharMatchFailure
Thomas Preud'homme [Wed, 10 Mar 2021 13:53:40 +0000 (13:53 +0000)]
[FileCheck, test] Rename checkWildcardRegexCharMatchFailure

Proposed edit https://reviews.llvm.org/D97845#inline-922769 in D97845
suggests the checkWildcardRegexCharMatchFailure function name is
misleading because it is not clear it checks for a match failure on each
character in the string parameter. This commit renames it to an
hopefully clearer name.

Reviewed By: jdenny

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

3 years agoAMDGPU: Add gfx90c support to code object v2 for backwards compatibility
Konstantin Zhuravlyov [Thu, 8 Apr 2021 20:42:05 +0000 (16:42 -0400)]
AMDGPU: Add gfx90c support to code object v2 for backwards compatibility

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

3 years ago[AMDGPU] Check for all meta instrs in GCNRegBankReassign
Stanislav Mekhanoshin [Thu, 8 Apr 2021 20:24:46 +0000 (13:24 -0700)]
[AMDGPU] Check for all meta instrs in GCNRegBankReassign

It used to work correctly even with a KILL, but there is
no reason to consider meta instructions since they do not
create real HW uses.

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

3 years agoAdd setting to disable LanguageRuntime UnwindPlans
Jason Molenda [Thu, 8 Apr 2021 20:28:59 +0000 (13:28 -0700)]
Add setting to disable LanguageRuntime UnwindPlans

When debugging LanguageRuntime unwindplans, it can be
helpful to disable their use and see the normal
stack walk.  Add a setting for this.

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

3 years ago[LoopRotate] Don't split loop pass manager
Nikita Popov [Sat, 3 Apr 2021 13:57:58 +0000 (15:57 +0200)]
[LoopRotate] Don't split loop pass manager

After D99249 we use three different loop pass managers for LICM,
LoopRotate and LICM+LoopUnswitch. This happens because LazyBFI
and LazyBPI are not preserved by LoopRotate (note that D74640
is no longer needed). Avoid this by marking them as preserved.

My understanding of D86156 is that it is okay to simply preserve
them (which LoopUnswitch already does for the same reason) and
rely on callbacks to deal with deleted blocks.

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

3 years ago[AMDGPU] Allow -amdgpu-unsafe-fp-atomics to ignore denorm mode
Stanislav Mekhanoshin [Wed, 7 Apr 2021 22:22:48 +0000 (15:22 -0700)]
[AMDGPU] Allow -amdgpu-unsafe-fp-atomics to ignore denorm mode

Fixes: SWDEV-274276

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

3 years ago[AIX] Support init priority attribute
Xiangling Liao [Thu, 8 Apr 2021 17:40:27 +0000 (13:40 -0400)]
[AIX] Support init priority attribute

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

3 years ago[flang][OpenMP] Add functionality to check "close nesting" of regions, which can...
Arnamoy Bhattacharyya [Thu, 8 Apr 2021 18:33:04 +0000 (14:33 -0400)]
[flang][OpenMP] Add functionality to check "close nesting" of regions, which can be used for Semantic checks.  Also adding more test cases.

Reviewed By: kiranchandramohan

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

3 years ago[mlir][StandardToSPIRV] Handle i1 case for lowering memref.load/store op
Hanhan Wang [Thu, 8 Apr 2021 19:15:15 +0000 (12:15 -0700)]
[mlir][StandardToSPIRV] Handle i1 case for lowering memref.load/store op

This patch unconditionally converts i1 types to i8 types on memrefs. If the
extensions or capabilities are not met, they will be converted to i32. Hence the
logic in IntLoadPattern and IntStorePattern are also updated.

Also added the implementation of SPIRVTypeConverter::getOptions().

Reviewed By: antiagainst

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

3 years ago[WebAssembly] Fix for PIC external symbol ISEL
Wouter van Oortmerssen [Thu, 25 Mar 2021 23:04:10 +0000 (16:04 -0700)]
[WebAssembly] Fix for PIC external symbol ISEL

wasm64 was missing DAG ISEL patterns for external symbol based global.get, but simply adding these analogous to the existing 32-bit versions doesn't work.
This is because we are conflating the 32-bit global index with the pointer represented by the external symbol, which for wasm32 happened to work.
The simplest fix is to pretend we have a 64-bit global index. This sounds incorrect, but is immaterial since once this index is stored as a MachineOperand it becomes 64-bit anyway (and has been all along). As such, the EmitInstrWithCustomInserter based implementation I experimented with become a no-op and no further changes in the C++ code are required.

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

3 years ago[LoopInterchange] Fix transformation bugs in loop interchange
Congzhe Cao [Thu, 8 Apr 2021 18:53:09 +0000 (14:53 -0400)]
[LoopInterchange] Fix transformation bugs in loop interchange

After loop interchange, the (old) outer loop header should not jump to
the `LoopExit`. Note that the old outer loop becomes the new inner loop
after interchange. If we branched to `LoopExit` then after interchange
we would jump directly from the (new) inner loop header to `LoopExit`
without executing the rest of outer loop.

This patch modifies adjustLoopBranches() such that the old outer
loop header (which becomes the new inner loop header) jumps to the
old inner loop latch which becomes the new outer loop latch after
interchange.

Reviewed By: bmahjour

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

3 years ago[RISCV] Add InstAlias for Zbb Zbp and Zbs extension
Levy Hsu [Thu, 8 Apr 2021 18:40:49 +0000 (11:40 -0700)]
[RISCV] Add InstAlias for Zbb Zbp and Zbs extension

Add InstAlias that allows the last operand to be an imm for following instructions:

1. Zbb or Zbp:
    - ror
    - rorw (RV64 Only)

2. Zbs
    - best
    - bclr
    - binv
    - bext

Reviewed By: craig.topper, jrtc27

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

3 years ago[InstCombine] fold min/max intrinsic with negated operand to abs
Sanjay Patel [Thu, 8 Apr 2021 18:29:33 +0000 (14:29 -0400)]
[InstCombine] fold min/max intrinsic with negated operand to abs

The smax case shows up in https://llvm.org/PR49885 .
The others seem unlikely, but we might as well try
for uniformity (although that could mean an extra
instruction to create "nabs").

smax -- https://alive2.llvm.org/ce/z/8yYaGy
smin -- https://alive2.llvm.org/ce/z/0_7zc_
umax -- https://alive2.llvm.org/ce/z/EcsZWs
umin -- https://alive2.llvm.org/ce/z/Xw6WvB

3 years ago[InstCombine] add tests for min/max with negated operand; NFC
Sanjay Patel [Thu, 8 Apr 2021 17:47:48 +0000 (13:47 -0400)]
[InstCombine] add tests for min/max with negated operand; NFC

3 years ago[RISCV] Prevent __builtin_riscv_orc_b_64 from being compiled RV32 target.
Craig Topper [Thu, 8 Apr 2021 16:12:57 +0000 (09:12 -0700)]
[RISCV] Prevent __builtin_riscv_orc_b_64 from being compiled RV32 target.

The backend can't handle this and will throw a fatal error from
type legalization. It's easy enough to fix that for this intrinsic
by just splitting the IR intrinsic since it works on individual bytes.

There will be other intrinsics in the future that would be harder
to support through splitting, for example grev, gorc, and shfl. Those
would require a compare and a select be inserted to check the MSB of
their control input.

This patch adds support for preventing this in the frontend with
a nice diagnostic.

Reviewed By: frasercrmck

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

3 years agoSet IgnoreLLVMUsed to false in CallGraph::addToCallGraph()
Stanislav Mekhanoshin [Mon, 5 Apr 2021 20:01:44 +0000 (13:01 -0700)]
Set IgnoreLLVMUsed to false in CallGraph::addToCallGraph()

clang++ uses llvm.compiler.used in certain cases to preserve
symbol which is fully inlined. D96087 has resulted in undefined
symbols in such cases. Set it to false by default to preserve
old behavior but keep the option for specific uses where we
want to ignore these (e.g. to detect a potential indirect call
to a function).

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

3 years ago[lld-macho][nfc] Use varargs form of hasArg()
Jez Ng [Thu, 8 Apr 2021 18:11:45 +0000 (14:11 -0400)]
[lld-macho][nfc] Use varargs form of hasArg()

3 years ago[lld-macho] Support -add_ast_path
Jez Ng [Thu, 8 Apr 2021 18:12:20 +0000 (14:12 -0400)]
[lld-macho] Support -add_ast_path

Swift builds seem to use it. All it requires is emitting the
corresponding paths as STABS.

Fixes llvm.org/PR49385.

Reviewed By: clayborg

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

3 years ago[lldb] [test] Skip clone() tests on Linux/aarch64
Michał Górny [Thu, 8 Apr 2021 18:03:21 +0000 (20:03 +0200)]
[lldb] [test] Skip clone() tests on Linux/aarch64

3 years agoRevert "[TableGen] Add support for the 'assert' statement in multiclasses"
Paul C. Anagnostopoulos [Thu, 8 Apr 2021 17:55:16 +0000 (13:55 -0400)]
Revert "[TableGen] Add support for the 'assert' statement in multiclasses"

This reverts commit 3b9a15d910a8c748b1444333a4a3905a996528bc.

3 years ago[lldb] Improve the documentation (#42017)
Sushma Unnibhavi [Thu, 8 Apr 2021 17:55:55 +0000 (10:55 -0700)]
[lldb] Improve the documentation (#42017)

Added punctuation and changed "So for instance" to "For instance".

Fixes https://llvm.org/PR42017

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

3 years ago[mlir][linalg] Fix loop upper bounds in conv fusion test
Lei Zhang [Thu, 8 Apr 2021 17:40:35 +0000 (13:40 -0400)]
[mlir][linalg] Fix loop upper bounds in conv fusion test

Reviewed By: mravishankar

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

3 years ago[analyzer] Fix false positives in inner pointer checker (PR49628)
Valeriy Savchenko [Wed, 24 Mar 2021 13:15:04 +0000 (16:15 +0300)]
[analyzer] Fix false positives in inner pointer checker (PR49628)

This patch supports std::data and std::addressof functions.

rdar://73463300

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

3 years ago[analyzer] Fix crash on spaceship operator (PR47511)
Valeriy Savchenko [Tue, 23 Mar 2021 12:38:55 +0000 (15:38 +0300)]
[analyzer] Fix crash on spaceship operator (PR47511)

rdar://68954187

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

3 years agoRevert "[DebugInfo] Correctly track SDNode dependencies for list debug values"
Stephen Tozer [Thu, 8 Apr 2021 16:54:45 +0000 (17:54 +0100)]
Revert "[DebugInfo] Correctly track SDNode dependencies for list debug values"

Reverted due to failure on the sanitizer-x86_64-linux-fast bot.

This reverts commit e10493eb5012a2c313471489646bde9595ea06c0.

3 years ago[lldb] [Process] Watch for fork/vfork notifications
Michał Górny [Fri, 12 Mar 2021 08:02:36 +0000 (09:02 +0100)]
[lldb] [Process] Watch for fork/vfork notifications

Watch for fork(2)/vfork(2) (also fork/vfork-style clone(2) on Linux)
notifications and explicitly detach the forked child process, and add
initial tests for these cases.  The code covers FreeBSD, Linux
and NetBSD process plugins.  There is no new user-visible functionality
provided -- this change lays foundations over subsequent work on fork
support.

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

3 years agoabtest.py: support bisection based on a response file
Yuanfang Chen [Thu, 8 Apr 2021 16:43:08 +0000 (09:43 -0700)]
abtest.py: support bisection based on a response file

Also makes LINK_TEST customizable from commandline with `--test` option.

3 years ago[MCA] Add tests for IPC on Cortex-A55
Andrew Savonichev [Fri, 15 Jan 2021 13:08:58 +0000 (16:08 +0300)]
[MCA] Add tests for IPC on Cortex-A55

The tests compare IPC statistics that MCA provides with IPC values
measured on Cortex-A55 hardware. For hardware tests, each snippet is
run in a loop unrolled by 1000, and IPC is measured by linux-perf.

Several tests do not match the hardware: the skewed ALU is not
supported, LDR seem to be missing a forwarding path.

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

3 years ago[lld-macho][nfc] Extend abs-symbol.s to test for local absolute symbols
Jez Ng [Thu, 8 Apr 2021 16:14:48 +0000 (12:14 -0400)]
[lld-macho][nfc] Extend abs-symbol.s to test for local absolute symbols

Addresses an old TODO.

Reviewed By: #lld-macho, oontvoo

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

3 years ago[lld-macho] Support --thinlto-jobs
Jez Ng [Thu, 8 Apr 2021 16:14:47 +0000 (12:14 -0400)]
[lld-macho] Support --thinlto-jobs

The test is loosely based off LLD-ELF's `thinlto.ll`. However, I
found that test questionable because the the -save_temps behavior it
checks for is identical regardless of whether we are running in single-
or multi-threaded mode. I tried writing a test based on `--time-trace`
but couldn't get it to run deterministically... so I've opted to just
skip checking that behavior for now.

Reviewed By: #lld-macho, gkm

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

3 years ago[MLIR] Support symbols in emptiness checks for FlatAffineConstraints
Arjun P [Thu, 8 Apr 2021 15:29:58 +0000 (20:59 +0530)]
[MLIR] Support symbols in emptiness checks for FlatAffineConstraints

Reviewed By: ftynse

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

3 years ago[DebugInfo] Correctly track SDNode dependencies for list debug values
Stephen Tozer [Fri, 26 Mar 2021 14:52:56 +0000 (14:52 +0000)]
[DebugInfo] Correctly track SDNode dependencies for list debug values

During SelectionDAG, we must track the SDNodes that each SDDbgValue depends on
to compute its value. These are ultimately derived from the location operands to
the SDDbgValue, but were stored in a separate vector prior to this patch. This
resulted in cases where one of the lists was updated incorrectly, resulting in
crashes during compilation. This patch fixes the issue by directly recomputing
the dependency list from the SDDbgOperands in getDependencies().

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

3 years ago[AMDGPU] Add some implicit uses to tests. NFC.
Jay Foad [Thu, 8 Apr 2021 15:24:19 +0000 (16:24 +0100)]
[AMDGPU] Add some implicit uses to tests. NFC.

This is just to stop a future patch from optimizing away the things that
we actually want to check for.

3 years ago[AMDGPU] SIFoldOperands: remove an unneeded isReg check. NFC.
Jay Foad [Thu, 8 Apr 2021 15:32:25 +0000 (16:32 +0100)]
[AMDGPU] SIFoldOperands: remove an unneeded isReg check. NFC.

3 years agoRevert "Reduce the number of attributes attached to each function"
Dávid Bolvanský [Thu, 8 Apr 2021 15:28:57 +0000 (17:28 +0200)]
Revert "Reduce the number of attributes attached to each function"

This reverts commit 053dc95839b3b8a36db46f8c419e36e632e989cd. It causes perf regressions - see discussion in D97116.

3 years ago[lsan] Mark 2 new lsan tests unsupported on arm-linux
David Spickett [Thu, 8 Apr 2021 14:52:15 +0000 (15:52 +0100)]
[lsan] Mark 2 new lsan tests unsupported on arm-linux

These tests were added in:
1daa48f005bd477ba8711ecdf91a1f1515f01383
59e422c90bf4796fc73237e838d8954b4e2099b1

malloc_zero.c and realloc_too_big.c fail when only
leak sanitizer is enabled.
http://lab.llvm.org:8011/#/builders/59/builds/1635
(also in an armv8 32 bit build)

(I would XFAIL them but the same test is run with
address and leak sanitizer enabled and that one does
pass)

3 years ago[lldb/DWARF] Fix a crash parsing invalid dwarf (pr49678)
Pavel Labath [Sat, 27 Mar 2021 20:21:14 +0000 (21:21 +0100)]
[lldb/DWARF] Fix a crash parsing invalid dwarf (pr49678)

If the debug info is missing the terminating null die, we would crash
when trying to access the nonexisting children/siblings. This was
discovered because the test case for D98619 accidentaly produced such
input.

3 years ago[lldb] Re-skip TestVSCode_launch
Pavel Labath [Thu, 8 Apr 2021 14:31:18 +0000 (16:31 +0200)]
[lldb] Re-skip TestVSCode_launch

The test is flaky (sleeps didn't help).

3 years ago[NFC] Fix warning introduced in 20105b6b4874a85813f7a4a3d8ad2a0f023dda14
serge-sans-paille [Thu, 8 Apr 2021 14:09:40 +0000 (16:09 +0200)]
[NFC] Fix warning introduced in 20105b6b4874a85813f7a4a3d8ad2a0f023dda14

3 years ago[AMDGPU] SIFoldOperands: make use of emplace_back. NFC.
Jay Foad [Thu, 8 Apr 2021 13:33:51 +0000 (14:33 +0100)]
[AMDGPU] SIFoldOperands: make use of emplace_back. NFC.

3 years ago[AMDGPU] SIFoldOperands: remove an unneeded make_early_inc_range. NFC.
Jay Foad [Thu, 8 Apr 2021 13:32:36 +0000 (14:32 +0100)]
[AMDGPU] SIFoldOperands: remove an unneeded make_early_inc_range. NFC.

3 years ago[AMDGPU] SIFoldOperands: try harder to fold cndmask instructions
Jay Foad [Thu, 8 Apr 2021 13:09:31 +0000 (14:09 +0100)]
[AMDGPU] SIFoldOperands: try harder to fold cndmask instructions

Look through copies to find more cases where the two values being
selected are identical. The motivation for this is just to be able to
remove the weird special case where tryFoldCndMask was called from
foldInstOperand, part way through folding a move-immediate into its
users, without regressing any lit tests.

3 years ago[LV] Pass VPWidenPHIRecipe to widenPHIInstruction (NFC).
Florian Hahn [Thu, 8 Apr 2021 13:15:39 +0000 (14:15 +0100)]
[LV] Pass VPWidenPHIRecipe to widenPHIInstruction (NFC).

Instead of passing the start value and the defined value to
widenPHIInstruction, pass the VPWidenPHIRecipe directly, which can be
used to get both (and more in future patches).

3 years ago[analyzer] Fix dead store checker false positive
Valeriy Savchenko [Wed, 24 Mar 2021 13:50:19 +0000 (16:50 +0300)]
[analyzer] Fix dead store checker false positive

It is common to zero-initialize not only scalar variables,
but also structs.  This is also defensive programming and
we shouldn't complain about that.

rdar://34122265

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

3 years agoSupport: mapped_file_region: Pass MAP_NORESERVE to mmap
Joseph Tremoulet [Thu, 8 Apr 2021 13:06:52 +0000 (09:06 -0400)]
Support: mapped_file_region:  Pass MAP_NORESERVE to mmap

This allows mapping larger files, delaying OOM failures until too many
pages of them are accessed.  This is makes the behavior of the
mapped_file_region in this regard consistent between its "Unix" and
"Windows" implementations.

Guard the code witih #if defined(MAP_NORESERVE), consistent with other
uses of MAP_NORESERVE in llvm-project, because some FreeBSD versions do
not provide this flag.

Reviewed By: clayborg

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

3 years ago[AMDGPU] SIFoldOperands: make tryFoldCndMask a member function. NFC.
Jay Foad [Thu, 8 Apr 2021 13:04:49 +0000 (14:04 +0100)]
[AMDGPU] SIFoldOperands: make tryFoldCndMask a member function. NFC.

3 years ago[AMDGPU] Fix computing live registers in prolog
Sebastian Neubauer [Thu, 8 Apr 2021 12:00:33 +0000 (14:00 +0200)]
[AMDGPU] Fix computing live registers in prolog

ScratchExecCopy needs to be marked as live, we cannot use that register
while EXEC is stored in there.

Marking SGPRForFPSaveRestoreCopy and SGPRForBPSaveRestoreCopy as
available is unnecessary, they should not be live at that point anway.

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

3 years ago[InstCombine] add icmp with no-wrap add tests; NFC
Sanjay Patel [Thu, 8 Apr 2021 12:28:59 +0000 (08:28 -0400)]
[InstCombine] add icmp with no-wrap add tests; NFC

Goes with D100095

3 years ago[TableGen] Make behavior of list slice suffix consistent across all values
Paul C. Anagnostopoulos [Mon, 5 Apr 2021 13:13:25 +0000 (09:13 -0400)]
[TableGen] Make behavior of list slice suffix consistent across all values

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

3 years ago[TableGen] Add support for the 'assert' statement in multiclasses
Paul C. Anagnostopoulos [Thu, 1 Apr 2021 17:01:43 +0000 (13:01 -0400)]
[TableGen] Add support for the 'assert' statement in multiclasses

3 years ago[CodeGen][AArch64] Fix isel crash for truncating FP stores
David Sherwood [Wed, 7 Apr 2021 08:13:00 +0000 (09:13 +0100)]
[CodeGen][AArch64] Fix isel crash for truncating FP stores

When attempting to truncate a FP vector and store the result out
to memory we crashed because we had no pattern for truncating FP
stores. In fact, we don't support these types of stores and the
correct fix is to stop marking these truncating stores as legal.

Tests have been added here:

  CodeGen/AArch64/sve-fptrunc-store.ll

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

3 years ago[mlir][spirv] Add control for non-32-bit scalar type emulation
Lei Zhang [Wed, 7 Apr 2021 18:52:16 +0000 (14:52 -0400)]
[mlir][spirv] Add control for non-32-bit scalar type emulation

Non-32-bit scalar types require special hardware support that may not
exist on all GPUs. This is reflected in SPIR-V as that non-32-bit scalar
types require special capabilities or extensions.

Previously when there is a non-32-bit type and no native support, we
unconditionally emulate it with 32-bit ones. This isn't good given that
it can have implications over ABI and data layout consistency.

This commit introduces an option to control whether to use 32-bit
types to emulate.

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

3 years ago[mlir][spirv] Timely fail type conversion
Lei Zhang [Wed, 7 Apr 2021 18:52:07 +0000 (14:52 -0400)]
[mlir][spirv] Timely fail type conversion

Per the TypeConverter API contract, returning `llvm:None` means
other conversion rules should be tried. But we only have one
rule per input type. So there is no need to try others and we can
just directly fail, which should return `nullptr`. This avoids
unnecessary checks.

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

3 years ago[AMDGPU] SIFoldOperands: refactor tryFoldCndMask with early-outs. NFC.
Jay Foad [Thu, 8 Apr 2021 12:03:20 +0000 (13:03 +0100)]
[AMDGPU] SIFoldOperands: refactor tryFoldCndMask with early-outs. NFC.

3 years ago[DebugInfo] Prevent invalid debug info being produced during LoopStrengthReduce
Stephen Tozer [Fri, 26 Mar 2021 14:52:43 +0000 (14:52 +0000)]
[DebugInfo] Prevent invalid debug info being produced during LoopStrengthReduce

During LoopStrengthReduce, some of the SSA values that are used by debug values
may be lost and/or salvaged. After LSR we attempt to recover any undef debug
values, including any that were salvaged but then lost their values afterwards,
by replacing the lost values with any live equal values (plus a possible
constant offset) that have been gathered prior to running LSR. When we do this
we restore the debug value's original DIExpression, to undo any salvaging (as we
have gone back to using the original debug value).

This process can currently produce invalid debug info if the number of operands
has changed by salvaging during LSR. Replacing old values during the
applyEqualValues step does not change the number of location operands, which
means that when we restore the old DIExpression we may have a mismatch between
the number of operands used by the debug value and the number of operands
referenced by the DIExpression. This patch fixes this by restoring the full
original location metadata at the start of the applyEqualValues step, so that
there is no mismatch in operand count between the debug value and its
DIExpression.

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

3 years ago[NFC][X86][CostModel] Add some load/store tests w/ non-power-of-two elt cnt vectors
Roman Lebedev [Thu, 8 Apr 2021 11:56:05 +0000 (14:56 +0300)]
[NFC][X86][CostModel] Add some load/store tests w/ non-power-of-two elt cnt vectors

For example the cost to load <48 x i16> should likely be 3,
because that's just 3x load i256.

3 years ago[lldb] [client] Support for multiprocess extension
Michał Górny [Fri, 12 Mar 2021 08:02:36 +0000 (09:02 +0100)]
[lldb] [client] Support for multiprocess extension

Add a minimal support for the multiprocess extension in gdb-remote
client.  It accepts PIDs as part of thread-ids, and rejects PIDs that
do not match the current inferior.

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

3 years ago[NVPTX] Fix compiler warning in NDEBUG build [NFC]
Mikael Holmen [Thu, 8 Apr 2021 11:21:07 +0000 (13:21 +0200)]
[NVPTX] Fix compiler warning in NDEBUG build [NFC]

Without the fix we get

../lib/Target/NVPTX/NVPTXLowerArgs.cpp:236:24: error: lambda capture 'Arg' is not used [-Werror,-Wunused-lambda-capture]
  auto IsALoadChain = [Arg](Value *Start) {
                       ^~~
1 error generated.

3 years ago[flang][nfc] Rename some test files
Andrzej Warzynski [Thu, 8 Apr 2021 10:01:35 +0000 (10:01 +0000)]
[flang][nfc] Rename some test files

Update test names as per Flang's coding style guide [1]:
```
File names should use dashes, not underscores.
```

[1] https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md#files

3 years ago[OpenCL][Docs] Fix typo in section label
Anastasia Stulova [Thu, 8 Apr 2021 09:59:44 +0000 (10:59 +0100)]
[OpenCL][Docs] Fix typo in section label

3 years ago[GreedyRA ORE] Add function level spill/reloads stats
Serguei Katkov [Thu, 8 Apr 2021 07:55:07 +0000 (14:55 +0700)]
[GreedyRA ORE] Add function level spill/reloads stats

Reviewers: reames, MatzeB, anemet, thegameg
Reviewed By: reames, thegameg
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D100014

3 years ago[flang][driver] Add debug options not requiring semantic checks
Andrzej Warzynski [Tue, 30 Mar 2021 10:35:42 +0000 (10:35 +0000)]
[flang][driver] Add debug options not requiring semantic checks

This patch adds two debugging options in the new Flang driver
(flang-new):
  *fdebug-unparse-no-sema
  *fdebug-dump-parse-tree-no-sema
Each of these options combines two options from the "throwaway" driver
(left: f18, right: flang-new):
  * `-fdebug-uparse -fdebug-no-semantics` --> `-fdebug-unparse-no-sema`
  * `-fdebug-dump-parse-tree -fdebug-no-semantics` -->
    `-fdebug-dump-parse-tree-no-sema`

There are no plans to implement `-fdebug-no-semantics` in the new
driver.  Such option would be too powerful. Also, it would only make
sense when combined with specific frontend actions (`-fdebug-unparse`
and `-fdebug-dump-parse-tree`). Instead, this patch adds 2 specialised
options listed above. Each of these is implemented through a dedicated
FrontendAction (also added).

The new frontend actions are implemented in terms of a new abstract base
action: `PrescanAndSemaAction`. This new base class was required so that
we can have finer control over what steps within the frontend are
executed:
  * `PrescanAction`: run the _prescanner_
  * `PrescanAndSemaAction`: run the _prescanner_ and the _parser_ (new
     in this patch)
  * `PrescanAndSemaAction`: run the _prescanner_, _parser_ and run the
    _semantic checks_

This patch introduces `PrescanAndParseAction::BeginSourceFileAction`.
Apart from the semantic checks removed at the end, it is similar to
`PrescanAndSemaAction::BeginSourceFileAction`.

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

3 years ago[LV] Logical and/or select costs
David Green [Thu, 8 Apr 2021 09:39:47 +0000 (10:39 +0100)]
[LV] Logical and/or select costs

D99674 stopped the folding of certain select operations into and/or, due
to incorrect folding in the presence of poison. D97360 added some costs
to attempt to account for the change, but only worked at the getUserCost
level, not the getCmpSelInstrCost that the vectorizer will use directly.
This adds similar logic into the vectorizer to handle these logical
and/or selects, treating them like and/or directly.

This fixes 60% performance regressions from code like the attached test
case.

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

3 years ago[LV] Add a logical and/or select cost test. NFC
David Green [Thu, 8 Apr 2021 09:27:06 +0000 (10:27 +0100)]
[LV] Add a logical and/or select cost test. NFC

3 years ago[RISCV] Support OR/XOR/AND reductions on vector masks
Fraser Cormack [Wed, 7 Apr 2021 09:03:22 +0000 (10:03 +0100)]
[RISCV] Support OR/XOR/AND reductions on vector masks

This patch adds RVV codegen support for OR/XOR/AND reductions for both
scalable- and fixed-length vector types. There are a few possible
codegen strategies for each -- vmfirst.m, vmsbf.m, and vmsif.m could be
used to some extent -- but the vpopc.m instruction was chosen since it
produces the scalar result in one instruction, after which scalar
instructions can finish off the computation.

The reductions are lowered identically for both scalable- and
fixed-length vectors, although some alternate strategies may be more
optimal on fixed-length vectors since it's cheaper to get the length of
those types.

Other reduction types were not deemed to be relevant for mask vectors.

Reviewed By: craig.topper

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

3 years ago[OpenCL] Fix mipmap read_image return types
Sven van Haastregt [Thu, 8 Apr 2021 08:51:44 +0000 (09:51 +0100)]
[OpenCL] Fix mipmap read_image return types

The return type did not match the function name.

3 years agoReorg firmware corefile tests; add test for OS plugin loading
Jason Molenda [Thu, 8 Apr 2021 08:44:13 +0000 (01:44 -0700)]
Reorg firmware corefile tests; add test for OS plugin loading

A little cleanup to how these firmware corefile tests are done; add
a test that loads a dSYM that loads an OS plugin, and confirm that
the OS plugin's threads are created.

3 years ago[AMDGPU, test] Fix use of undef FileCheck var
Thomas Preud'homme [Sun, 4 Apr 2021 10:12:58 +0000 (11:12 +0100)]
[AMDGPU, test] Fix use of undef FileCheck var

Test CodeGen/AMDGPU/amdgpu.private-memory.ll and
CodeGen/AMDGPU/private-memory-r600.ll have a block of CHECK directives
whose prefix is inconsistent: R600-CHECK Vs R600. This leads to a
R600-NOT directive using an undefined CHAN variable due to R600-CHECK
directives never being considered by FileCheck. Fixing the prefix leads
to the testcase failing. As per https://reviews.llvm.org/D99865#2675235
this commit removes the directives instead since it is not possible to
write a reliable check.

Reviewed By: arsenm

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

3 years ago[mlir] add support for index type in vectors.
Tobias Gysi [Thu, 8 Apr 2021 08:15:14 +0000 (08:15 +0000)]
[mlir] add support for index type in vectors.

The patch enables the use of index type in vectors. It is a prerequisite to support vectorization for indexed Linalg operations. This refactoring became possible due to the newly introduced data layout infrastructure. The data layout of a module defines the bitwidth of the index type needed to verify bitcasts and similar vector operations.

Reviewed By: nicolasvasilache

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

3 years ago[clang] Speedup line offset mapping computation
serge-sans-paille [Thu, 1 Apr 2021 20:18:55 +0000 (22:18 +0200)]
[clang] Speedup line offset mapping computation

Clang spends a decent amount of time in the LineOffsetMapping::get(...)
function. This function used to be vectorized (through SSE2) then the
optimization got dropped because the sequential version was on-par performance
wise.

This provides an optimization of the sequential version that works on a word at
a time, using (documented) bithacks to provide a portable vectorization.

When preprocessing the sqlite amalgamation, this yields a sweet 3% speedup.

This is a recommit of 6951b72334bbe4c189c71751edc1e361d7b5632c with endianness
and unsigned long vs uint64_t issues fixed (hopefully).

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

3 years ago[AsmParser] Recognize more escaped characters between single quotes
LemonBoy [Thu, 8 Apr 2021 07:57:50 +0000 (09:57 +0200)]
[AsmParser] Recognize more escaped characters between single quotes

The GNU AS manual states the following about single-character constants enclosed within single quotes:

>  Some backslash escapes apply to characters, \b, \f, \n, \r, \t, and \" with the same meaning as for strings, plus \' for a single quote.

Add two more characters to the switch handling this case to match GAS behaviour, plus a test to make sure nothing regresses.

Reviewed By: MaskRay

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

3 years ago[GreedyRA ORE] Extract computeNumberOfSplillsReloads to use in different places....
Serguei Katkov [Thu, 8 Apr 2021 07:38:38 +0000 (14:38 +0700)]
[GreedyRA ORE] Extract computeNumberOfSplillsReloads to use in different places. NFC.

Extract one basic block handling to introduce stat computation for method scope.

Reviewers: reames, MatzeB, anemet, thegameg
Reviewed By: reames, thegameg
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D100013

3 years ago[GreedyRA ORE] Extract stats in RAGreedyStats struct. NFC.
Serguei Katkov [Thu, 8 Apr 2021 07:27:37 +0000 (14:27 +0700)]
[GreedyRA ORE] Extract stats in RAGreedyStats struct. NFC.

Combine all collected stats into separate struct RAGreedyStats
with add and report methods.

The motivation is to extend the number of statistics to capture and instead of
adding new parameters, just combine all of them into one structure.
Additionally I plan to use report from different places in future to report data
for function as well.

Reviewers: reames, MatzeB, anemet, thegameg
Reviewed By: thegameg
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D100012

3 years ago[GreedyRA ORE] Compute ORE stats if extra analysis is enabled
Serguei Katkov [Tue, 6 Apr 2021 14:32:02 +0000 (21:32 +0700)]
[GreedyRA ORE] Compute ORE stats if extra analysis is enabled

To save compile time, avoid computation of stats if ORE will not emit it.
The motivation is to add more stats and compute it only if it will dumped.

Reviewers: reames, MatzeB, anemet, thegameg
Reviewed By: reames
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D100010

3 years ago[Debug-Info] Use inlined strings in .dwinfo section by default for DBX.
Esme-Yi [Thu, 8 Apr 2021 07:20:22 +0000 (07:20 +0000)]
[Debug-Info] Use inlined strings in .dwinfo section by default for DBX.

Summary: Set the default DwarfInlinedStrings as inlined strings for DBX, due to DBX does not support .dwstr section for now.

Reviewed By: dblaikie

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

3 years ago[RISCV] Add scalable offset under very large stack size.
Hsiangkai Wang [Thu, 8 Apr 2021 02:49:10 +0000 (10:49 +0800)]
[RISCV] Add scalable offset under very large stack size.

If the stack size is larger than 12 bits, we have to use a scratch
register to store the stack size. Before we introduce the scalable stack
offset, we could simplify

%0 = ADDI %stack.0, 0

=>

%scratch = ... # sequence of instructions to move the offset into
%%scratch
%0 = ADD %fp, %scratch

However, if the offset contains scalable part, we need to consider it.

%0 = ADDI %stack.0, 0

=>

%scratch = ... # sequence of instructions to move the offset into
%%scratch
%scratch = ADD %fp, %scratch
%scalable_offset = ... # sequence of instructions for vscaled-offset.
%0 = ADD/SUB %scratch, %scalable_offset

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

3 years ago[NFC][RISCV] Add test for scalable offset under large stack size.
Hsiangkai Wang [Thu, 8 Apr 2021 02:44:09 +0000 (10:44 +0800)]
[NFC][RISCV] Add test for scalable offset under large stack size.

This test case shows that we access wrong stack slots when the frame
object has scalable offset under large stack size.

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

3 years ago[Constant] Remove unused variable
Juneyoung Lee [Thu, 8 Apr 2021 06:44:42 +0000 (15:44 +0900)]
[Constant] Remove unused variable

3 years ago[Constant] ConstantStruct/Array should not lower poison to undef
Juneyoung Lee [Thu, 8 Apr 2021 06:20:08 +0000 (15:20 +0900)]
[Constant] ConstantStruct/Array should not lower poison to undef

This is a (late) follow-up patch of 8871a4b4cab8a56fd6ff12fd024002c3c79128b3 and
c95f39891a282ebf36199c73b705d4a2c78a46ce to make ConstantStruct::get/ConstantArray::getImpl
correctly return PoisonValue if all elements are poison.
This was found while discussing about the elements of a vector-typed UndefValue (D99853)

3 years ago[CSSPGO] Move pseudo probes to the beginning of a block to unblock SelectionDAG combine.
Hongtao Yu [Wed, 7 Apr 2021 01:32:23 +0000 (18:32 -0700)]
[CSSPGO] Move pseudo probes to the beginning of a block to unblock SelectionDAG combine.

Pseudo probes, when scattered in a block, can be chained dependencies of other regular DAG nodes and block DAG combine optimizations. To fix this, scattered probes in a block are grouped and placed at the beginning of the block. This shouldn't affect the profile quality.

Test Plan:

Reviewed By: wenlei, wmi

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

3 years agoChange the default value for `preloadDialectsInContext` for MlirOptMain
Mehdi Amini [Thu, 8 Apr 2021 03:46:56 +0000 (03:46 +0000)]
Change the default value for `preloadDialectsInContext` for MlirOptMain

This option has been deprecated for 6 months, change the default setting for now before
future removal.

While clients can set the option to true for now, they should start
updating their passes to define the right `dependentDialects` in
preparation of the removal of this option. See the FAQ for more info:
https://mlir.llvm.org/getting_started/Faq/

Reviewed By: rriddle, jpienaar

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

3 years agoInclude `llvm-config` and `not` in AppleClang toolchains.
Dan Liew [Thu, 8 Apr 2021 04:21:07 +0000 (21:21 -0700)]
Include `llvm-config` and `not` in AppleClang toolchains.

The motivation here is so that we can configure and run compiler-rt
tests from a standalone build against AppleClang.

rdar://75975846

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

3 years ago[docs] Document our norms around reverts
Philip Reames [Thu, 8 Apr 2021 03:59:40 +0000 (20:59 -0700)]
[docs] Document our norms around reverts

This has come up a few times recently, and I was surprised to notice that we don't have anything in the docs.

This patch deliberately sticks to stuff that is uncontroversial in the community. Everything herein is thought to be widely agreed to by a large majority of the community.  A few things were noted and removed in review which failed this standard, if you spot anything else, please point it out.

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

3 years ago[Driver] Drop $DEFAULT_TRIPLE-$name as a fallback program name
Fangrui Song [Thu, 8 Apr 2021 04:01:10 +0000 (21:01 -0700)]
[Driver] Drop $DEFAULT_TRIPLE-$name as a fallback program name

D13340 introduced this behavior which is not needed even for mips.
This was raised on https://lists.llvm.org/pipermail/cfe-dev/2020-May/065437.html
but no action was taken.

This was raised again in https://lists.llvm.org/pipermail/cfe-dev/2021-April/067974.html
"The LLVM host/target TRIPLE padding drama on Debian"
as it caused confusion. This patch drops the behavior.

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

3 years ago[RISCV] DAG nodes and pseudo instructions for CSR access
Serge Pavlov [Thu, 18 Mar 2021 15:07:27 +0000 (22:07 +0700)]
[RISCV] DAG nodes and pseudo instructions for CSR access

New custom DAG nodes were added to represent operations on CSR. These
nodes are lowered to corresponding pseudo instruction. Using the pseudo
instructions allows to specify different scheduling information for
operations on different system registers. It also make possible to
specify dependencies of instructions on specific system registers.

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