platform/upstream/llvm.git
22 months ago[bazel] Add some general build flags
Arthur Eubanks [Mon, 26 Sep 2022 01:21:35 +0000 (18:21 -0700)]
[bazel] Add some general build flags

22 months ago[Clang][LoongArch] Add inline asm support for constraints f/l/I/K
Weining Lu [Thu, 22 Sep 2022 12:03:01 +0000 (20:03 +0800)]
[Clang][LoongArch] Add inline asm support for constraints f/l/I/K

This patch adds support for constraints `f`, `l`, `I`, `K` according
to [1]. The remain constraints (`k`, `m`, `ZB`, `ZC`) will be added
later as they are a little more complex than the others.
f: A floating-point register (if available).
l: A signed 16-bit constant.
I: A signed 12-bit constant (for arithmetic instructions).
K: An unsigned 12-bit constant (for logic instructions).

For now, no need to support register alias (e.g. `$a0`) in llvm as
clang will correctly decode the usage of register name aliases into
their official names. And AFAIK, the not yet upstreamed `rustc` for
LoongArch will always use official register names (e.g. `$r4`).

[1] https://gcc.gnu.org/onlinedocs/gccint/Machine-Constraints.html

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

22 months ago[AVR] Fix useDeprecatedPositionallyEncodedOperands errors.
James Y Knight [Mon, 19 Sep 2022 14:10:01 +0000 (10:10 -0400)]
[AVR] Fix useDeprecatedPositionallyEncodedOperands errors.

This is a follow-on to https://reviews.llvm.org/D134073.

It renames a few fields to have consistent names, as well as renaming
operands to match the field names.

The encoder behavior is unchanged by this cleanup, but a few
instructions were previously being disassembled incorrectly, and have
been corrected by this change. All of the affected instructions were
missing disassembly tests, which are now added.

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

22 months ago[AMDGPU] Fix useDeprecatedPositionallyEncodedOperands errors in R600.
James Y Knight [Fri, 16 Sep 2022 21:21:06 +0000 (17:21 -0400)]
[AMDGPU] Fix useDeprecatedPositionallyEncodedOperands errors in R600.

This is a follow-on to https://reviews.llvm.org/D134073.

It renames a couple of fields to match their operands, as well as
introducing sub-operand names where required.

This change _only_ fixes the 'R600' half of the target, not the
'AMDGPU' half. Fixing the AMDGPU half will be a significantly more
difficult change (which I've not yet attempted.)

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

22 months ago[Lanai] Fix useDeprecatedPositionallyEncodedOperands errors.
James Y Knight [Sun, 12 Jun 2022 22:06:29 +0000 (22:06 +0000)]
[Lanai] Fix useDeprecatedPositionallyEncodedOperands errors.

This is a follow-on to https://reviews.llvm.org/D134073.

Lanai was almost clean: the only issue is that 'bit' behaves
differently than 'bits<1>', because only the 'bits' type preserves
unresolved references via 'keepUnsetBits()' in
TableGen/Record.h. Thus, use bits instead.

This issue _would_ have caused invalid instruction emission/decoding,
except that the PQ bits were being overriden after the fact by code in
'adjustPqBits' in MCTargetDesc/LanaiMCCodeEmitter.cpp, and
'PostOperandDecodeAdjust' in Disassembler/LanaiDisassembler.cpp.

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

22 months ago[clang-format][NFC] Rewrite prints in python3 compatible way
Danil Sidoruk [Sun, 25 Sep 2022 20:27:42 +0000 (13:27 -0700)]
[clang-format][NFC] Rewrite prints in python3 compatible way

Closes #55996.

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

22 months ago[Coroutines] Regenerate coro-retcon-resume-values.ll
Simon Pilgrim [Sun, 25 Sep 2022 18:58:18 +0000 (19:58 +0100)]
[Coroutines] Regenerate coro-retcon-resume-values.ll

22 months ago[clang-cl] Implement /ZH: flag
Nico Weber [Fri, 23 Sep 2022 15:12:59 +0000 (11:12 -0400)]
[clang-cl] Implement /ZH: flag

Based on a patch by Arlo Siemsen (D98438)!

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

22 months ago[clang-format] Look ahead before consuming `bool` in requires clause.
Emilia Dreamer [Sun, 25 Sep 2022 17:30:10 +0000 (20:30 +0300)]
[clang-format] Look ahead before consuming `bool` in requires clause.

The comment handling the bool case says:
"bool is only allowed if it is directly followed by a paren for a cast"

This change more closely follows this directive by looking ahead for
the paren before consuming the bool keyword itself. Without a following
paren, the bool would be part of something else, such as a return type
for a function declaration

Fixes https://github.com/llvm/llvm-project/issues/57538

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

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

22 months ago[clang-format] Correctly annotate static and consteval lambdas
Emilia Dreamer [Sun, 25 Sep 2022 17:29:34 +0000 (20:29 +0300)]
[clang-format] Correctly annotate static and consteval lambdas

`P1169` "static operator()" (https://wg21.link/P1169) is accepted to
C++23 and while clang itself doesn't exactly support it yet,
clang-format could quite easily.

This simply allows the keyword `static` to be a part of lambdas as
specified by the addition to [expr.prim.lambda.general]

While adding this, I noticed `consteval` lambdas also aren't handled,
so that keyword is now allowed to be a part of lambdas as well

Reviewed By: HazardyKnusperkeks, owenpan, MyDeveloperDay

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

22 months ago[PhaseOrdering][X86] Add missing triple from fast-basictest.ll test
Simon Pilgrim [Sun, 25 Sep 2022 15:23:35 +0000 (16:23 +0100)]
[PhaseOrdering][X86] Add missing triple from fast-basictest.ll test

22 months ago[SLP][X86] Add missing triple from pr49081.ll test
Simon Pilgrim [Sun, 25 Sep 2022 15:22:42 +0000 (16:22 +0100)]
[SLP][X86] Add missing triple from pr49081.ll test

22 months agofix errors on passing input iterator to `std::views::take`
Hui Xie [Fri, 2 Sep 2022 18:24:22 +0000 (19:24 +0100)]
fix errors on passing input iterator to `std::views::take`

In the implementation of `std::views::take`, it uses `subrange<Iter>` as part of the return type. But in case of input iterator, `subrange<Iter>` can be ill-formed

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

22 months agoAutogenerate a couple of test in the AMDGPU backend. NFC
Amaury Séchet [Sun, 25 Sep 2022 14:00:22 +0000 (14:00 +0000)]
Autogenerate a couple of test in the AMDGPU backend. NFC

22 months ago[CostModel][X86] Add missing cost kinds for v2i64 icmp on SLM
Simon Pilgrim [Sun, 25 Sep 2022 14:12:21 +0000 (15:12 +0100)]
[CostModel][X86] Add missing cost kinds for v2i64 icmp on SLM

22 months ago[X86] Fix Icelake VPMULLQ zmm pipes and adjust AVX512DQ v8i64 mul costs to match...
Simon Pilgrim [Sun, 25 Sep 2022 13:18:03 +0000 (14:18 +0100)]
[X86] Fix Icelake VPMULLQ zmm pipes and adjust AVX512DQ v8i64 mul costs to match worse case

Icelake PMULLQ throughput regressed cf SkylakeServer as its Pipe0 only

Confirmed with Intel SOM, Agner and instlatx64

22 months ago[libc++] Rewrites graph_header_deps.py.
Mark de Wever [Mon, 19 Sep 2022 15:37:35 +0000 (17:37 +0200)]
[libc++] Rewrites graph_header_deps.py.

The new version is a lot simpler and has less option which were not
used. This uses the CSV files as generated by D133127 as input data.

The current Python script has more features but uses a simple "grep"
making the output less accurate:
- Conditionally included header are always included. This is an issue
  since part of our includes are unneeded transitive includes. Based on
  the language version they may be omitted. The script however always
  includes them.
- Includes in comments are processed as-if they are includes. This is an
  issue when comments explain how certain data is generated; of course
  there are digraphs which the script omits.

This implementation uses Clang's --trace-includes to generate the includes
per header. This means the input of the generation script always has the
real list of includes.

Libc++ is moving from large monolithic Standard headers to more fine
grained headers. For example, algorithm includes every header in
`__algorithm`. Adding all these detail headers in the graph makes the
output unusable. Instead it only shows the Standard headers. The
transitive includes of the detail headers are parsed and "attributed" to
the Standard header including them. This gives an accurate include graph
without the unneeded clutter. Note that this graph is still big.

This changes fixes the cyclic dependency issue with the previous version
of the tool so the markers and its documentation is removed.

Since the input has no cycles the CI test is removed.

Reviewed By: #libc, ldionne

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

22 months ago[AMDGPU] Pattern for flat atomic fadd f64 intrinsic with local addr
Petar Avramovic [Sun, 25 Sep 2022 10:52:32 +0000 (12:52 +0200)]
[AMDGPU] Pattern for flat atomic fadd f64 intrinsic with local addr

Fix regression from clang opencl test in builtins-fp-atomics-gfx90a.cl
test_flat_add_local_f64 caused by D130579
Revert a3becb333d7faae695e18728e9b8fa3a3579a240.

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

22 months ago[libc++][test] Improves transitive includes.
Mark de Wever [Thu, 1 Sep 2022 17:21:27 +0000 (19:21 +0200)]
[libc++][test] Improves transitive includes.

This test generates the include graph of the Standard headers of libc++ in
a CSV file. This was originally used to generate graphviz dot files. During
review it was noticed these files have all information needed to replace
the current transitive includes. Therefore the output, with the same information as the .dot file is stored in a .csv file. This removes
all the existing transitive include files.

The .cvs can be converted by a .dot file by the script in D134188.

Reviewed By: #libc, ldionne

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

22 months ago[InstSimplify] fold redundant select of min/max, part 2
Sanjay Patel [Sun, 25 Sep 2022 11:02:26 +0000 (07:02 -0400)]
[InstSimplify] fold redundant select of min/max, part 2

This extends e5d15e116292 to handle the inverse predicates
(there's probably a more elegant way to specify the preds).

These patterns correspond to the existing simplify:
max (min X, Y), X --> X
...and extra preds for (non)equality.

The tests cycle through all 10 icmp preds for each min/max
variant with 4 swapped operand patterns each (and the min/max
operands are commuted in every other test within those).

Some Alive2 examples to verify:
https://alive2.llvm.org/ce/z/XMvEKQ
https://alive2.llvm.org/ce/z/QpMChr

22 months ago[lld-macho] Force higher alignment for __thread_vars
Daniel Bertalan [Sat, 24 Sep 2022 19:10:31 +0000 (21:10 +0200)]
[lld-macho] Force higher alignment for __thread_vars

`__thread_vars` contains pointers to `__tlv_bootstrap`, which are fixed
up by dyld; however the section's alignment is not specified. This means
that the relocations might end up on odd addresses, which is not
representable by the soon to be added chained fixups.

This is arguably a bug in MC, but this behavior has been there since TLV
support was originally added.

This patch forces the `__thread_vars` sections to be aligned to the
target's pointer size. This is done by ld64 as well.

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

22 months ago[X86] Pre-commit unit test for D134477
Han Zhu [Sun, 25 Sep 2022 04:51:35 +0000 (21:51 -0700)]
[X86] Pre-commit unit test for D134477

22 months ago[Clang] Improve diagnostics about the invalid target feature.
wangliushuai [Sun, 25 Sep 2022 02:16:30 +0000 (10:16 +0800)]
[Clang] Improve diagnostics about the invalid target feature.

Clang with debug builds will crash when run with empty target feature input.
And the warning message is a little bit confusing. This patch adds an empty
check and a new diagnostic to illustrate where goes wrong.

Reviewed By: MaskRay, aaron.ballman

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

22 months ago[RISCV] Pattern match scalable strided load/store
Philip Reames [Sun, 25 Sep 2022 00:06:48 +0000 (17:06 -0700)]
[RISCV] Pattern match scalable strided load/store

Very straight forward extension of the existing pattern matching pass to handle scalable types as well as fixed length types. The only extra bit beyond removing a bailout is recognizing stepvector.

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

22 months ago[RISCV] Add lowering for scalable @llvm.riscv.masked.strided.load/store
Philip Reames [Sun, 25 Sep 2022 00:05:10 +0000 (17:05 -0700)]
[RISCV] Add lowering for scalable @llvm.riscv.masked.strided.load/store

The code previously assumed fixed length vectors; make the relevant code conditional.

Having the lowering in place is neccessary for an upcoming change to generalize scatter/gather matching to scalable vectors.

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

22 months ago[ARM] Fix check lines in memcpy-inline.ll test. NFC
David Green [Sat, 24 Sep 2022 20:29:41 +0000 (21:29 +0100)]
[ARM] Fix check lines in memcpy-inline.ll test. NFC

Commit c442698 updated the check lines in this file, but did so in a
way that removed a number of the existing checks, as the
update_llc_test_checks script does not understand all triples. This
fixes it up as needed to keep testing Thumb1 code.

22 months ago[LoopVersioning] Add tests where versioning requires LAA invalidation.
Florian Hahn [Sat, 24 Sep 2022 19:33:49 +0000 (20:33 +0100)]
[LoopVersioning] Add tests where versioning requires LAA invalidation.

Additional test cases for #57825.

22 months ago[BPF] memcmp.ll - add checks for all loads
Simon Pilgrim [Sat, 24 Sep 2022 17:55:25 +0000 (18:55 +0100)]
[BPF] memcmp.ll - add checks for all loads

Noticed while triaging alignment issues for #57872

22 months ago[BPF] ex1.ll - add checks for stores
Simon Pilgrim [Sat, 24 Sep 2022 17:53:59 +0000 (18:53 +0100)]
[BPF] ex1.ll - add checks for stores

Noticed while triaging alignment issues for #57872

22 months ago[clang-tidy] Fix a false positive in readability-simplify-boolean-expr
Nathan James [Sat, 24 Sep 2022 17:29:17 +0000 (18:29 +0100)]
[clang-tidy] Fix a false positive in readability-simplify-boolean-expr

Reviewed By: LegalizeAdulthood

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

22 months ago[InstSimplify] fold redundant select of min/max
Sanjay Patel [Sat, 24 Sep 2022 15:08:19 +0000 (11:08 -0400)]
[InstSimplify] fold redundant select of min/max

This is similar to the existing simplify:
max (max X, Y), X --> max X, Y
...but the select condition can be one of
several predicates as shown in the tests.

The tests cycle through all 10 icmp preds for
each min/max variant with 4 swapped operand
patterns each (and the min/max operands are
commuted in every other test within those).

Some Alive2 examples to verify:
https://alive2.llvm.org/ce/z/lCAQm4
https://alive2.llvm.org/ce/z/kzxVXC

22 months ago[InstSimplify] add tests for select with min/max op; NFC
Sanjay Patel [Fri, 23 Sep 2022 18:31:51 +0000 (14:31 -0400)]
[InstSimplify] add tests for select with min/max op; NFC

These are organized as 10 (predicates) * 4 (swapped operands) * 4 (min/max variants) = 160 tests.

22 months ago[Clang] Warn when trying to dereference void pointers in C
Jun Zhang [Sat, 24 Sep 2022 14:18:04 +0000 (22:18 +0800)]
[Clang] Warn when trying to dereference void pointers in C

Previously we only have an extension that warn void pointer deferencing
in C++, but for C we did nothing.

C2x 6.5.3.2p4 says The unary * operator denotes indirection. If it points
to an object, the result is an lvalue designating the object. However, there
is no way to form an lvalue designating an object of an incomplete type as
6.3.2.1p1 says "an lvalue is an expression (with an object type other than
void)", so the behavior is undefined.

Fixes https://github.com/llvm/llvm-project/issues/53631

Signed-off-by: Jun Zhang <jun@junz.org>
Differential Revision: https://reviews.llvm.org/D134461

22 months ago[TableGen] Add useDeprecatedPositionallyEncodedOperands option.
James Y Knight [Tue, 20 Sep 2022 12:30:20 +0000 (08:30 -0400)]
[TableGen] Add useDeprecatedPositionallyEncodedOperands option.

Summary:
The existing undefined-bitfield-to-operand matching behavior is very
hard to understand, due to the combination of positional and named
matching. This can make it difficult to track down a bug in a target's
instruction definitions.

Over the last decade, folks have tried to work-around this in various
ways, but it's time to finally ditch the positional matching. With
https://reviews.llvm.org/D131003, there are no longer cases that
_require_ positional matching, and it's time to start removing usage
and support for it.

Therefore: add a (default-false) option, and set it to true only in
those targets that require positional matching today. Subsequent
changes will start cleaning up additional in-tree targets.

NOTE TO OUT OF TREE TARGET MAINTAINERS:

If this change breaks your build, you may restore the previous
behavior simply by adding:
  let useDeprecatedPositionallyEncodedOperands = 1;
to your target's InstrInfo tablegen definition. However, this is
temporary -- the option will be removed in the future.

If your target does not set 'decodePositionallyEncodedOperands', you
may thus start migrating to named operands. However, if you _do_
currently set that option, I recommend waiting until a subsequent
change lands, which adds decoder support for named sub-operands.

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

22 months ago[TableGen][CodeEmitterGen] Allow local names for sub-operands in a operand list.
James Y Knight [Mon, 5 Sep 2022 16:10:21 +0000 (12:10 -0400)]
[TableGen][CodeEmitterGen] Allow local names for sub-operands in a operand list.

These names can then be matched by name against 'bits' fields in a
record, to populate an instruction's encoding.

This does _not_ yet change DecoderEmitter to allow by-name matching of
sub-operands. Unlike the encoder, the decoder already defaulted to not
supporting positional matching, and backends had workarounds in place
for the missing decoding support.

Additionally, use this new capability to allow the ARM and AArch64
backends not to require any positional operand matching.

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

22 months ago[flang] Handle NULL(mold) used in initializer region
Valentin Clement [Sat, 24 Sep 2022 13:22:47 +0000 (15:22 +0200)]
[flang] Handle NULL(mold) used in initializer region

NULL intrinsic with a MOLD argument can be used in a type constructor.
This patch handles this use case with a specific lowering that create
an unallocated box with the MOLD type.

Reviewed By: PeteSteinfeld

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

22 months ago[Clang] Make Clang driver suggest '-Xclang' for CC1 options passed to the driver
Joseph Huber [Fri, 23 Sep 2022 16:39:25 +0000 (11:39 -0500)]
[Clang] Make Clang driver suggest '-Xclang' for CC1 options passed to the driver

This patch adds an additional check for if an options passed to the
Clang driver could've been intended for the clang compiler. This is
primarily done for the times when a user attempts to pass an option like
`-ast-dump` to the driver instead.

Reviewed By: MaskRay, aaron.ballman

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

22 months ago[RISCV][Clang] Replace all undef value with poison
eopXD [Fri, 23 Sep 2022 02:15:36 +0000 (19:15 -0700)]
[RISCV][Clang] Replace all undef value with poison

Address remaining work that dates back to discussion in D126745

Reviewed By: craig.topper

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

22 months ago[flang] Lower character result of bind(c) function by value
Valentin Clement [Sat, 24 Sep 2022 06:58:50 +0000 (08:58 +0200)]
[flang] Lower character result of bind(c) function by value

BIND(C) Function returning character must return it by value and
not as hidden argument like done currently. This patch update the
code to return it by value for both use cases.

Reviewed By: PeteSteinfeld

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

22 months ago[RISCV] Rename RISCVScheduleB.td to RISCVScheduleZb.td. NFC
Craig Topper [Sat, 24 Sep 2022 04:38:03 +0000 (21:38 -0700)]
[RISCV] Rename RISCVScheduleB.td to RISCVScheduleZb.td. NFC

22 months ago[RISCV] Add missing scheduler classes to Zbkb and Zbkx instructions.
Craig Topper [Sat, 24 Sep 2022 04:37:09 +0000 (21:37 -0700)]
[RISCV] Add missing scheduler classes to Zbkb and Zbkx instructions.

22 months ago[mlir][spirv] Switch to kEmitAccessorPrefix_Predixed
Jakub Kuderski [Sat, 24 Sep 2022 04:36:53 +0000 (00:36 -0400)]
[mlir][spirv] Switch to kEmitAccessorPrefix_Predixed

Fixes https://github.com/llvm/llvm-project/issues/57887

Reviewed By: antiagainst

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

22 months ago[RISCV] Remove a few remnants of Zbr I misssed.
Craig Topper [Sat, 24 Sep 2022 04:21:51 +0000 (21:21 -0700)]
[RISCV] Remove a few remnants of Zbr I misssed.

22 months ago[mlir][nvgpu] Use TableGen TypeDef for NVGPU dialect types
Christopher Bate [Fri, 23 Sep 2022 20:37:38 +0000 (14:37 -0600)]
[mlir][nvgpu] Use TableGen TypeDef for NVGPU dialect types

Moves definition of DeviceAsyncToken to use the declarative Tablegen
TypeDef since the type is trivial. This also allows for removing the
current code for parsing/printing types by using the auto-generated
functions.

Reviewed By: ThomasRaoux

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

22 months agoRevert "[RISCV] Lower BUILD_VECTOR to RISCVISD::VID_VL if it is floating-point type."
Craig Topper [Sat, 24 Sep 2022 00:16:09 +0000 (17:16 -0700)]
Revert "[RISCV] Lower BUILD_VECTOR to RISCVISD::VID_VL if it is floating-point type."

This reverts commit dd53a0bb30413d26c3ab63a5c57c3cdf301be7a1.

We have seen crashes from this internally. Probably due to the use
of RoundingMode::Dynamic.

22 months ago[mlir][spirv] Switch to kEmitAccessorPrefix_Both
Jakub Kuderski [Sat, 24 Sep 2022 01:28:58 +0000 (21:28 -0400)]
[mlir][spirv] Switch to kEmitAccessorPrefix_Both

Prepare for switching to prefixed accessors.

Issue: https://github.com/llvm/llvm-project/issues/57887

Reviewed By: antiagainst, rriddle

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

22 months ago[flang] Fix crash in semantics in error recovery
Peter Klausler [Wed, 7 Sep 2022 00:45:38 +0000 (17:45 -0700)]
[flang] Fix crash in semantics in error recovery

When a FUNCTION statement has both an explicit type in its prefix
and a RESULT clause in its suffix, semantics crashes due to the
redundant type; emit a nice error message instead.

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

22 months agoImplement nanosleep per https://pubs.opengroup.org/onlinepubs/009695399/basedefs...
Raman Tenneti [Sat, 24 Sep 2022 00:13:23 +0000 (00:13 +0000)]
Implement nanosleep per https://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html

Tested:
Limited unit test: This makes a call and checks that no error was
returned, but we currently don't have the ability to ensure that
time has elapsed as expected.

Co-authored-by: Jeff Bailey <jeffbailey@google.com>
Reviewed By: sivachandra, jeffbailey

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

22 months ago[flang] Preserve component array lower bounds in folding
Peter Klausler [Wed, 21 Sep 2022 19:22:18 +0000 (12:22 -0700)]
[flang] Preserve component array lower bounds in folding

When a component array of a named constant is extracted as
a constant value, ensure that the lower bounds of the array
are properly acquired from the declaration of the component.

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

22 months ago[RISCV] Merge half-intrinsics-strict.ll into zvh-half-intrinsics-strict.ll. NFC
Craig Topper [Fri, 23 Sep 2022 21:25:27 +0000 (14:25 -0700)]
[RISCV] Merge half-intrinsics-strict.ll into zvh-half-intrinsics-strict.ll. NFC

I had forgotten how we had the files partitioned.

22 months ago[objdump] Fix typo in error message.
Daniel Rodríguez Troitiño [Fri, 23 Sep 2022 23:10:27 +0000 (16:10 -0700)]
[objdump] Fix typo in error message.

Change "inconsistant" for "inconsistent" in the message, the file name
and the test output.

Reviewed By: pete, MaskRay

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

22 months ago[flang][runtime] Enabled HAS_FLOAT128 for builds with clang.
Slava Zakharin [Thu, 22 Sep 2022 23:58:53 +0000 (16:58 -0700)]
[flang][runtime] Enabled HAS_FLOAT128 for builds with clang.

I am building with clang, and I noticed for quite a while that
REAL(16) runtimes functions are not available. I did not know why
until I saw this typo.

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

22 months ago[flang] Fix spurious error with COMMON and EQUIVALENCE
Peter Klausler [Wed, 21 Sep 2022 19:21:18 +0000 (12:21 -0700)]
[flang] Fix spurious error with COMMON and EQUIVALENCE

f18 emits an error message when two objects related by EQUIVALENCE
to a third are specified as members of a COMMON block.  This is not
always a sign of an error, however; it is possible for multiple objects
in a COMMON block to all be equivalenced to distinct offsets in another
object in a way that is consistent.  So refine the check.

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

22 months ago[flang] Allow "non-expandable" scalars in single-element contexts
Peter Klausler [Wed, 21 Sep 2022 19:20:25 +0000 (12:20 -0700)]
[flang] Allow "non-expandable" scalars in single-element contexts

When a scalar expression is not expandable -- i.e., it would have to be
evaluated once and saved in a temporary to avoid changing the semantics
of the program if it were to be evaluated more than once -- it affects
some aspects of folding and expression semantics.  In cases where
scalar expansion would not cause multiple evaluations due to the shape
of the result having but a single element, however, these "non-expandable"
scalar expressions can be safely allowed.

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

22 months agoMake MLIR model URLs cache variables
Yi Kong [Fri, 23 Sep 2022 22:21:53 +0000 (15:21 -0700)]
Make MLIR model URLs cache variables

This allows us to directly use the models published on Github.

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

22 months ago[AMDGPU] Precommit switching test to generated checks for D134463
jeff [Fri, 23 Sep 2022 22:08:51 +0000 (22:08 +0000)]
[AMDGPU] Precommit switching test to generated checks for D134463

Change-Id: I0d90f86ab759347a2f20448d28cc09ddaea3a4d4

22 months ago[flang] Allow a generic-spec on a PUBLIC/PRIVATE statement to declare a generic
Peter Klausler [Wed, 21 Sep 2022 19:19:22 +0000 (12:19 -0700)]
[flang] Allow a generic-spec on a PUBLIC/PRIVATE statement to declare a generic

A generic-spec can appear on a module accessibility control statement
even if it has not been declared as a generic interface, because there's
nothing else that it could be.

While here, simplify the parse tree and parser for AccessId, since
one of its alternatives is ambiguous with the other.

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

22 months ago[flang] Fold IS_CONTIGUOUS() to .FALSE. when it is known to be
Peter Klausler [Wed, 21 Sep 2022 19:18:15 +0000 (12:18 -0700)]
[flang] Fold IS_CONTIGUOUS() to .FALSE. when it is known to be

At present, IS_CONTIGUOUS() can only either fold to .TRUE. or
remain unknown.  The underlying analysis, however, is capable
of returning a tri-state result (true, false, or unknown).
Extend and expose it to folding so that IS_CONTIGUOUS() can
fold to .FALSE. as well as to .TRUE. when contiguity is
known.

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

22 months ago[RISCV] Promote f16 STRICT_FCEIL/FLOOR/TRUNC/NEARBYINT/RINT/ROUND,ROUNDEVEN to f32.
Craig Topper [Fri, 23 Sep 2022 20:59:30 +0000 (13:59 -0700)]
[RISCV] Promote f16 STRICT_FCEIL/FLOOR/TRUNC/NEARBYINT/RINT/ROUND,ROUNDEVEN to f32.

22 months ago[flang] Don't emit portability warnings for things in module files
Peter Klausler [Wed, 21 Sep 2022 19:16:37 +0000 (12:16 -0700)]
[flang] Don't emit portability warnings for things in module files

Any symbol in a module file will have been already shamed with
portability warnings when the module was compiled, so don't pile
on when compiling other program units that use the module.
This also silences warnings about some symbols whose names were
created or extended by the compiler to avoid clashes.

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

22 months ago[RISCV] Simplify check-prefixes in half-intrinsics.ll. NFC
Craig Topper [Fri, 23 Sep 2022 18:47:58 +0000 (11:47 -0700)]
[RISCV] Simplify check-prefixes in half-intrinsics.ll. NFC

22 months ago[flang] Fix spurious errors from MODULE subprograms
Peter Klausler [Wed, 21 Sep 2022 19:15:09 +0000 (12:15 -0700)]
[flang] Fix spurious errors from MODULE subprograms

When an explicit MODULE procedure is defined in the same (sub)module
as its interface, and the interface was defined in a generic
interface of the same name, bogus errors about symbols already
having been defined will ensue.  Cleaning up this aspect of name
resolution and symbol table management requires marking the
place-holding SubprogramNameDetails symbols of explicit MODULE
subprograms as such, ensuring that that attribute is not inherited
if the SubprogramNameDetails symbol is recycled as a SubprogramDetails,
and gathering some code that should have been common between
BeginSubprogram() and BeginMpSubprogram() together in one
new routine.

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

22 months ago[clang][AMDGPU] Temporarily disable clang atomic fadd test for gfx90a
Petar Avramovic [Fri, 23 Sep 2022 19:48:27 +0000 (21:48 +0200)]
[clang][AMDGPU] Temporarily disable clang atomic fadd test for gfx90a

Test is broken by D130579. Temporarily disable to silence builbot failures.

22 months agoFix Z3 version detection regexp
Mikhail Korolev [Fri, 23 Sep 2022 18:46:32 +0000 (15:46 -0300)]
Fix Z3 version detection regexp

regexp for try_run path expects '0 or more' digits which is incorrect because it should be 'one or more', regexp for header parsing expects 'exactly one' digit which is incorrect with current Z3 version (4.11.2)

Reviewed By: mikhail.ramalho

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

22 months agoRevert "[SROA] Create additional vector type candidates based on store and load slices"
Douglas Yung [Fri, 23 Sep 2022 18:24:02 +0000 (11:24 -0700)]
Revert "[SROA] Create additional vector type candidates based on store and load slices"

This reverts commit de3445e0ef15c420955ad720fccf08473f460443.

This is causing GHI #57796 and #57821.

22 months agoRevert "[SROA] Check typeSizeEqualsStoreSize in isVectorPromotionViable"
Douglas Yung [Fri, 23 Sep 2022 18:23:51 +0000 (11:23 -0700)]
Revert "[SROA] Check typeSizeEqualsStoreSize in isVectorPromotionViable"

This reverts commit 3f08d248c44c744deda38423409b86720822739e.

The commit this change is fixing is being reverted due to GHI #57796 and #37821, so revert this commit as well.

22 months ago[flang] Replace negative known CHARACTER length with zero in type analysis
Peter Klausler [Wed, 21 Sep 2022 19:12:36 +0000 (12:12 -0700)]
[flang] Replace negative known CHARACTER length with zero in type analysis

When a DynamicType for CHARACTER has a known length, correct a negative
length value to its effective length of zero so that all such types
compare equal in interface compatibility checking.

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

22 months agoFix GH57943: Friend constraint checker didn't handle null decls.
Erich Keane [Fri, 23 Sep 2022 19:17:12 +0000 (12:17 -0700)]
Fix GH57943: Friend constraint checker didn't handle null decls.

Apparently TransformDecl in TreeTransform can be called with a nullptr
for a Decl, so my casts were illegal.  The fix here is to add an early
exit to my TransformDecl.

22 months ago[AMDGPU] Add GFX11 feature for subtargets with more VGPRs
Jay Foad [Fri, 23 Sep 2022 08:02:49 +0000 (09:02 +0100)]
[AMDGPU] Add GFX11 feature for subtargets with more VGPRs

The full complement of physical VGPRs for GFX11 is 50% more than GFX10.
Some subtargets have this, others stay the same as GFX10. This affects
occupancy calculations.

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

22 months ago[RegisterCoalescer] fix dst subreg replacement during remat copy trick
Afanasyev Ivan [Fri, 23 Sep 2022 18:52:29 +0000 (18:52 +0000)]
[RegisterCoalescer] fix dst subreg replacement during remat copy trick

Instructions might use definition register as its "undef" operand. It
happens on architectures with predicated executon:

```
%0:subreg = instruction op_1, ..., op_N, undef %0:subreg, op_N+2, ...
```

RegisterCoalescer should take into account all remat instruction
operands during destination subregister fixup.

```
; remat result before fix:
%1 = instruction op_1, ..., op_N, undef %1:subreg, op_N+2, ...

; remat result after fix (correct):
%1 = instruction op_1, ..., op_N, undef %1, op_N+2, ...
```

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

22 months ago[flang] A separate module procedure must inherit interface attributes
Peter Klausler [Wed, 21 Sep 2022 19:09:56 +0000 (12:09 -0700)]
[flang] A separate module procedure must inherit interface attributes

Attributes like PURE, ELEMENTAL, &c. are specified on the interface of
a separate module procedure, so when the MODULE PROCEDURE is defined in
a submodule, it must acquire those attributes from the interface.

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

22 months agoRestore "[MemProf] Memprof profile matching and annotation"
Teresa Johnson [Fri, 23 Sep 2022 13:43:07 +0000 (06:43 -0700)]
Restore "[MemProf] Memprof profile matching and annotation"

This reverts commit 794b7ea960ccc3222f2af582efadbc5e5c464292, and
thus restores commit a212d8da94d08e229aa8d65283e4b116310bba10, and
follow on fixes 0cd6763fa93159b84d70a5bb602c24996acaafaa,
e9ff53d42feac7fc157718523275619a8106f2f3, and
37c6a25e9ab230e5e21fa34e246d9fec55275df0.

Use a hash function (BLAKE3) instead of hash_combine/hash_code which are
not guaranteed to be stable across executions.

Additionally, it adds a "REQUIRES: x86_64-linux" to the tests that have
raw profile inputs to avoid failures on big endian bots.

Reviewers: snehasish, davidxl

Subscribers: llvm-commits

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

22 months agoReland "[llvm] Support forward-referenced globals with dso_local_equivalent"
Leonard Chan [Wed, 21 Sep 2022 20:15:14 +0000 (20:15 +0000)]
Reland "[llvm] Support forward-referenced globals with dso_local_equivalent"

This reverts commit eef5db2c744e4799dc40ada54fdde7dbbd552807.

See https://github.com/llvm/llvm-project/issues/57815.

dso_local_equivalent would fail with an assertion on forward-referenced
globals. This is an issue that only comes up in textual IR, which is why
we've never seen this assertion with clang.

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

22 months ago[flang] Accept a separate module procedure interface as a specific procedure
Peter Klausler [Thu, 1 Sep 2022 17:14:24 +0000 (10:14 -0700)]
[flang] Accept a separate module procedure interface as a specific procedure

The code snippet

  module m
    interface
      module subroutine specific
      end subroutine
    end interface
    interface generic
       module procedure specific
    end interface
  end module

elicits a bogus semantic error about "specific" not being an acceptable
module procedure for the generic interface; fix.

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

22 months ago[flang] Special handling of ENTRY BIND(C,NAME=...)
Peter Klausler [Wed, 21 Sep 2022 19:06:40 +0000 (12:06 -0700)]
[flang] Special handling of ENTRY BIND(C,NAME=...)

We apply special symbol table scoping to top-level subroutine
and function names that have interoperable binding names, so
that it's possible to define the same subroutine/function name
more than once at the top level so long as their binding names
are distinct.  But we don't use those scoping techniques for
ENTRY statement symbols with interoperable binding names,
which can lead to bogus semantic errors when the same ENTRY
name is defined multiple times with distinct binding names.

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

22 months ago[flang][NFC] Document non-extension (user ELEMENTAL procedures as actual arguments)
Peter Klausler [Wed, 21 Sep 2022 19:05:20 +0000 (12:05 -0700)]
[flang][NFC] Document non-extension (user ELEMENTAL procedures as actual arguments)

Some Fortran compilers accept user-defined ELEMENTAL procedures as actual
arguments corresponding to (necessarily) non-ELEMENTAL dummy procedures;
most do not, and f18 is one of them.  Document the fact that this is not
a supported extension.

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

22 months ago[flang] Don't resolve names in derived type definitions to generics
Peter Klausler [Wed, 21 Sep 2022 19:03:54 +0000 (12:03 -0700)]
[flang] Don't resolve names in derived type definitions to generics

There's code in name resolution that handles resolution of references
that appear in the definitions of derived types -- it checks for
existing components in the type being defined, as well as for
non-parent components in its ancestors.  Special case code prevents
resolution of a name to the symbol of a procedure binding.  This
code needs to be extended so that names of generic procedures
are similarly prevented from shadowing symbols in the scope around
the type.

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

22 months ago[mlir] NFC: move mergeOffsetsSizesAndStrides into Affine/Utils
Lei Zhang [Fri, 23 Sep 2022 17:20:10 +0000 (13:20 -0400)]
[mlir] NFC: move mergeOffsetsSizesAndStrides into Affine/Utils

So that these utility functions can also be used ViewLikeInterface
ops not in the memref dialect.

Reviewed By: mravishankar, christopherbate

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

22 months ago[LV] Update handling of scalable pointer inductions after b73d2c8.
Florian Hahn [Fri, 23 Sep 2022 17:23:01 +0000 (18:23 +0100)]
[LV] Update handling of scalable pointer inductions after b73d2c8.

The dependent code has been changed quite a lot since 151c144 which
b73d2c8 effectively reverts. Now we run into a case where lowering
didn't expect/support the behavior pre 151c144 any longer.

Update the code dealing with scalable pointer inductions to also check
for uniformity in combination with isScalarAfterVectorization. This
should ensure scalable pointer inductions are handled properly during
epilogue vectorization.

Fixes #57912.

22 months agoRevert "[AggressiveInstCombine] Combine consecutive loads which are being merged...
Dmitri Gribenko [Fri, 23 Sep 2022 17:05:34 +0000 (19:05 +0200)]
Revert "[AggressiveInstCombine] Combine consecutive loads which are being merged to form a wider load."

This reverts commit 3c70c8c1df66500f67f77596b1e76cf0a8447ee5.

After this commit, during the 3-stage bootstrap the second-stage Clang
crashes.

22 months ago[AMDGPU] Precommit switching test to generated checks for D134463
jeff [Fri, 23 Sep 2022 16:22:14 +0000 (16:22 +0000)]
[AMDGPU] Precommit switching test to generated checks for D134463

Change-Id: Iaa8f6263178cfa8405d9a0298b2695b32a42fdf3

22 months ago[libc][obvious] disable mprotect test under sanitizers
Michael Jones [Fri, 23 Sep 2022 17:01:17 +0000 (10:01 -0700)]
[libc][obvious] disable mprotect test under sanitizers

fixes a build failure in my previous patch

Reviewed By: sivachandra

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

22 months ago[mlir] Plumb missing paramter to gpu transform op
Thomas Raoux [Fri, 23 Sep 2022 16:49:23 +0000 (16:49 +0000)]
[mlir] Plumb missing paramter to gpu transform op

rewriteMapNestedForeachThreadToGpuThreads was dropping the paramter to
skip inserting barrier

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

22 months ago[SLP] Adjust debug output for store vectorization failure
Philip Reames [Fri, 23 Sep 2022 16:56:08 +0000 (09:56 -0700)]
[SLP] Adjust debug output for store vectorization failure

When store vectorization is infeasible, it's helpful to have a debug logging indication of why.  A case I've hit a couple times now is accidentally using -march instead of -mtriple and getting the default TTI results.  This causes max-vf to become 1, and thus hits the added logging line.

22 months agoRevert "[Analysis] Make members of InlineCost const (NFC)"
Kazu Hirata [Fri, 23 Sep 2022 16:41:21 +0000 (09:41 -0700)]
Revert "[Analysis] Make members of InlineCost const (NFC)"

This reverts commit 9ac934d1bf5769276335b247e954f2dbcb467c79.

I'm reverting this to accommodate Yevgeny Rouban's downstream branch
where a field of InlineCost changes.

22 months ago[libc] add madvise and posix_madvise
Michael Jones [Wed, 21 Sep 2022 23:59:29 +0000 (16:59 -0700)]
[libc] add madvise and posix_madvise

Add the madvise and posix_madvise syscall wrappers and tests.

Reviewed By: sivachandra

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

22 months ago[libc] add mprotect
Michael Jones [Wed, 21 Sep 2022 23:51:53 +0000 (16:51 -0700)]
[libc] add mprotect

Add the mprotect syscall wrapper and tests.

Reviewed By: sivachandra

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

22 months ago[libc] move sys/mman macros to /include
Michael Jones [Wed, 21 Sep 2022 23:49:30 +0000 (16:49 -0700)]
[libc] move sys/mman macros to /include

Previously the mman macros were in api.td, but platform differences are
easier to handle with preprocessor macros so they have been moved to
include. Also I completed the list of macros (at least for what I need
soon) and fixed some previously incorrect values.

Reviewed By: sivachandra, lntue

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

22 months ago[X86] Use BuildStackAdjustment in stack probes
Josh Stone [Thu, 22 Sep 2022 19:56:20 +0000 (12:56 -0700)]
[X86] Use BuildStackAdjustment in stack probes

This has the advantage of dealing with live EFLAGS, using LEA instead of
SUB if needed to avoid clobbering. That also respects feature "lea-sp".

We could allow unrolled stack probing from blocks with live-EFLAGS, if
canUseAsEpilogue learns when emitStackProbeInlineGeneric will be used.

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

22 months ago[X86] Don't allow prologue stack probing with live EFLAGS
Josh Stone [Thu, 22 Sep 2022 18:45:37 +0000 (11:45 -0700)]
[X86] Don't allow prologue stack probing with live EFLAGS

Fixes https://github.com/llvm/llvm-project/issues/49509

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

22 months ago[NFC][CodeGen] Use const MF in TargetLowering stack probe functions
Josh Stone [Thu, 22 Sep 2022 18:34:26 +0000 (11:34 -0700)]
[NFC][CodeGen] Use const MF in TargetLowering stack probe functions

This makes them callable from places like canUseAsPrologue.

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

22 months ago[bazel] Be consistent and say we don't support libfpm everywhere
Arthur Eubanks [Fri, 23 Sep 2022 01:41:50 +0000 (18:41 -0700)]
[bazel] Be consistent and say we don't support libfpm everywhere

We're inconsistent about saying whether or not we support libfpm in the bazel build.

This should perhaps be configurable via a --config.

This allows the buildbots to see when llvm-exegesis-related breakages occur.

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

22 months ago[flang] Improve handling of NULL pointers when folding components of named constants
Peter Klausler [Wed, 21 Sep 2022 19:02:15 +0000 (12:02 -0700)]
[flang] Improve handling of NULL pointers when folding components of named constants

When a component reference to a named constant of derived type should
fold down to NULL() without a MOLD=, do so.

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

22 months ago[PhaseOrdering] add test for issue #50778; NFC
Sanjay Patel [Fri, 23 Sep 2022 16:08:39 +0000 (12:08 -0400)]
[PhaseOrdering] add test for issue #50778; NFC

Several different passes are involved to get the expected IR,
and we don't want that to break again.

22 months ago[lldb] Use Optional::{has_value,value,value_or}
Kazu Hirata [Fri, 23 Sep 2022 16:10:40 +0000 (09:10 -0700)]
[lldb] Use Optional::{has_value,value,value_or}

22 months agoRevert "[PhaseOrdering] add test for issue #50778; NFC"
Sanjay Patel [Fri, 23 Sep 2022 16:06:29 +0000 (12:06 -0400)]
Revert "[PhaseOrdering] add test for issue #50778; NFC"

This reverts commit cdc012fa2696434689c872abc4797a1ee8284ddf.
This accidentally deleted a test file (not sure how that became
part of the commit).

22 months ago[PhaseOrdering] add test for issue #50778; NFC
Sanjay Patel [Fri, 23 Sep 2022 15:41:04 +0000 (11:41 -0400)]
[PhaseOrdering] add test for issue #50778; NFC

Several different passes are involved to get the expected IR,
and we don't want that to break again.

22 months agoAMDGPU: Use tablegen patterns for buffer global and flat atomic fadd
Petar Avramovic [Fri, 23 Sep 2022 15:51:29 +0000 (17:51 +0200)]
AMDGPU: Use tablegen patterns for buffer global and flat atomic fadd

Remove manual selection for atomic fadd from global-isel.
Stop pre-isel translation to AtomicLoadFAdd/G_ATOMICRMW_FADD
which corresponds to llvm-ir's atomicrmw fadd instruction.

global and flat atomic fadd patterns changes:
Split rtn/no-rtn patterns
Add missing patterns or fix predicates
Remove atomicrmw patterns for v2f16 (atomic rmw doesn't support vectors).
Patterns now check addrspace of pointer, added patterns for flat intrinsic.
with global addrspace pointer that selects into global atomic instruction.

buffer atomic fadd patterns changes:
Rdit patterns to import into global-isel.
Remove gfx6/gfx7 _addr64 and _offset patterns.
Remove patterns that can't be reached (same pattern but different feature).

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

22 months agoAMDGPU: Improve atomicrmw fadd selection
Petar Avramovic [Fri, 23 Sep 2022 15:46:33 +0000 (17:46 +0200)]
AMDGPU: Improve atomicrmw fadd selection

Use same atomicrmw fadd expansion rules for gfx908, gfx940 and gfx11
as for gfx90a. Add missing globalisel legalizer support for flat
atomicrmw fadd f32 on gfx940 and gfx11.
Isel support for gfx11 will be added in D130579.

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

22 months agoAMDGPU: Add detailed buffer, global and flat atomic fadd tests
Petar Avramovic [Fri, 23 Sep 2022 15:40:00 +0000 (17:40 +0200)]
AMDGPU: Add detailed buffer, global and flat atomic fadd tests

Precommit for D130579 that will remove manual selection and use
patterns from td files. Tests are grouped based on target features.

All patterns have rtn and no-rtn versions.

buffer atomics patterns are selected based on the intrinsic used
(raw or struct) and the offset operand (imm or vgpr):
_offset raw with imm offset
_offen raw with vgpr offset (or large imm offset)
_idxen struct with imm offset
_bothen struct with vgpr offset (or large imm offset)

global and flat atomics are selected via intrinsic or the atomicrmw fadd.
atomicrmw tests have amdgpu-unsafe-fp-atomics=true and non-system scope
since they get expanded otherwise. atomicrmw fadd does not support vector
type, test float and double.

global atomics patterns are selected based on address type via (global or
flat) intrinsic or atomicrmw fadd with global address(addrspace(1)*).
'no suffix' vgpr addrspace(1)* address
_saddr sgpr addrspace(1)* address

flat atomics patterns are selected via (flat)intrinsic or atomicrmw fadd
with flat address (* - address space 0).

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