platform/upstream/llvm.git
4 years ago[NFC] remove unused includes of SelectionDAGISel.h
Yuanfang Chen [Sat, 11 Jul 2020 02:47:12 +0000 (19:47 -0700)]
[NFC] remove unused includes of SelectionDAGISel.h

4 years ago[NFC] remove unneeded TargetLoweringObjectFile init after 85c30f3374d9
Yuanfang Chen [Tue, 7 Jul 2020 16:39:55 +0000 (09:39 -0700)]
[NFC] remove unneeded TargetLoweringObjectFile init after 85c30f3374d9

4 years ago[llc] (almost) remove `--print-machineinstrs`
Yuanfang Chen [Mon, 20 Jul 2020 17:09:41 +0000 (10:09 -0700)]
[llc] (almost) remove `--print-machineinstrs`

Its effect could be achieved by
`-stop-after`,`-print-after`,`-print-after-all`. But a few tests need to
print MIR after ISel which could not be done with
`-print-after`/`-stop-after` since isel pass does not have commandline name.
That's the reason `--print-machineinstrs` is downgraded to
`--print-after-isel` in this patch. `--print-after-isel` could be
removed after we switch to new pass manager since isel pass would have a
commandline text name to use `print-after` or equivalent switches.

The motivation of this patch is to reduce tests dependency on
would-be-deprecated feature.

Reviewed By: arsenm, dsanders

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

4 years agoAMDGPU: Use MCRegister for preloaded arguments
Matt Arsenault [Mon, 20 Jul 2020 17:25:07 +0000 (13:25 -0400)]
AMDGPU: Use MCRegister for preloaded arguments

Attempt to fix build error with ancient GCC

4 years ago[llvm-readobj] clang-format DwarfCFIEHPrinter.h, NFC
Fangrui Song [Mon, 20 Jul 2020 17:25:16 +0000 (10:25 -0700)]
[llvm-readobj] clang-format DwarfCFIEHPrinter.h, NFC

Pre-commit header ordering changes (and other minor clean-ups) before landing D84106.

4 years ago[mlir] Added support for symbols inside linalg.generic and map concatenation
Jakub Lichman [Mon, 20 Jul 2020 16:30:10 +0000 (18:30 +0200)]
[mlir] Added support for symbols inside linalg.generic and map concatenation

This commit adds functionality needed for implementation of convolutions with
linalg.generic op. Since linalg.generic right now expects indexing maps to be
just permutations, offset indexing needed in convolutions is not possible.
Therefore in this commit we address the issue by adding support for symbols inside
indexing maps which enables more advanced indexing. The upcoming commit will
solve the problem of computing loop bounds from such maps.

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

4 years ago[LLVMgold.so] -plugin-opt=save-temps: save combined module to .lto.o instead of .o
Fangrui Song [Mon, 20 Jul 2020 16:58:31 +0000 (09:58 -0700)]
[LLVMgold.so] -plugin-opt=save-temps: save combined module to .lto.o instead of .o

This matches LLD and fixes https://sourceware.org/bugzilla/show_bug.cgi?id=26262#c1

.o is a bad choice for save-temps output because it is easy to override the bitcode file (*.o)

```
 # Use bfd for the example, -fuse-ld=gold is similar.
clang -flto -c a.c  # generate bitcode file a.o
clang -fuse-ld=bfd -flto a.o -o a -Wl,-plugin-opt=save-temps  # override a.o

 # The user repeats the command but get surprised, because a.o is now a combined module.
clang -fuse-ld=bfd -flto a.o -o a -Wl,-plugin-opt=save-temps
```

Reviewed By: tejohnson

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

4 years ago[OPENMP50]Perform data mapping analysis only for explicitly mapped data.
Alexey Bataev [Tue, 7 Jul 2020 20:16:17 +0000 (16:16 -0400)]
[OPENMP50]Perform data mapping analysis only for explicitly mapped data.

Summary:
According to OpenMP 5.0, the restrictions for mapping of overlapped data
apply only for explicitly mapped data, there is no restriction for
implicitly mapped data just like in OpenMP 4.5.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, sstefan1, cfe-commits, caomhin

Tags: #clang

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

4 years ago[libcxx] Skip tests on GCC
Vy Nguyen [Mon, 20 Jul 2020 16:53:05 +0000 (12:53 -0400)]
[libcxx] Skip tests on GCC

Summary: These don't work with GCC

Reviewers: jyknight, #libc!

Subscribers: libcxx-commits

Tags: #libc

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

4 years ago[ThinLTO] parse flags and blockcount summaries
Nick Desaulniers [Mon, 20 Jul 2020 16:50:22 +0000 (09:50 -0700)]
[ThinLTO] parse flags and blockcount summaries

Forked from pr/46523, we were having a hard time running llvm-extract on
IR from a thinLTO build of the Linux kernel.

$ llvm-extract --func jeq_imm jit-42f488b63a04fdaa931315bdadecb6d23e20529a.ll
llvm-extract: jit-42f488b63a04fdaa931315bdadecb6d23e20529a.ll:47463:8:
error: Expected 'gv', 'module', or 'typeid' at the start of summary
entry
^209 = flags: 8
       ^

Reviewed By: tejohnson

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

4 years ago[Driver] Add --ld-path= and deprecate -fuse-ld=/abs/path and -fuse-ld=rel/path
Fangrui Song [Mon, 20 Jul 2020 16:34:39 +0000 (09:34 -0700)]
[Driver] Add --ld-path= and deprecate -fuse-ld=/abs/path and -fuse-ld=rel/path

Supersedes D80225. Add --ld-path= to avoid strange target specific
prefixes and make -fuse-ld= focus on its intended job: "linker flavor".
(-f* affects generated code or language features. --ld-path does not
affect codegen, so it is not named -f*)

The way --ld-path= works is similar to "Command Search and Execution" in POSIX.1-2017 2.9.1 Simple Commands.

If --ld-path= specifies

* an absolute path, the value specifies the linker.
* a relative path without a path component separator (/), the value is searched using the -B, COMPILER_PATH, then PATH.
* a relative path with a path component separator, the linker is found relative to the current working directory.

-fuse-ld= and --ld-path= can be composed, e.g. `-fuse-ld=lld --ld-path=/usr/bin/ld.lld`

The driver can base its linker option decision on the flavor -fuse-ld=, but it should not do fragile
flavor checking with --ld-path=.

Reviewed By: whitequark, keith

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

4 years agoReland [libcxx]Put clang::trivial_abi on smart pointers
Vy Nguyen [Mon, 13 Jul 2020 16:34:37 +0000 (12:34 -0400)]
Reland [libcxx]Put clang::trivial_abi on smart pointers

    Reviewed By: ldionne,EricWF

    Tags: #libcxx

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

4 years agoRequire shell for lld/test/ELF/arm-exidx-range.s
Hans Wennborg [Mon, 20 Jul 2020 15:48:00 +0000 (17:48 +0200)]
Require shell for lld/test/ELF/arm-exidx-range.s

The test fails in 32-bit Windows builds for unclear reasons:

ld.lld: error: failed to open
C:\src\llvm_package_1100-rc1\build32_stage0\tools\lld\test\ELF\Output\arm-exidx-range.s.tmp:
The parameter is incorrect.

4 years agoFix issue in typo handling which could lead clang to hang
David Goldman [Fri, 17 Jul 2020 19:06:28 +0000 (15:06 -0400)]
Fix issue in typo handling which could lead clang to hang

Summary:
We need to detect when certain TypoExprs are not being transformed
due to invalid trees, otherwise we risk endlessly trying to fix it.

Reviewers: rsmith

Subscribers: cfe-commits

Tags: #clang

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

4 years agoAMDGPU: Remove outdated fixme
Matt Arsenault [Mon, 20 Jul 2020 15:37:31 +0000 (11:37 -0400)]
AMDGPU: Remove outdated fixme

4 years agoAMDGPU: Fix not accounting for constantexpr uses of LDS globals
Matt Arsenault [Sat, 18 Jul 2020 00:21:28 +0000 (20:21 -0400)]
AMDGPU: Fix not accounting for constantexpr uses of LDS globals

This was failing to add the size of LDS globals that weren't directly
used by an instruction. They could be used by constant expressions
which are transitively used by the function. This requires a better
search, but just abort on this for now for correctness.

4 years ago[Sema] Promote SmallSet of enum to bitset
Benjamin Kramer [Mon, 20 Jul 2020 15:33:30 +0000 (17:33 +0200)]
[Sema] Promote SmallSet of enum to bitset

Even with 300 elements, this still consumes less stack space than the
SmallSet. NFCI.

4 years agoAMDGPU/GlobalISel: Initial Implementation of calls
Matt Arsenault [Fri, 3 Jul 2020 18:47:23 +0000 (14:47 -0400)]
AMDGPU/GlobalISel: Initial Implementation of calls

Return values, and tail calls are not yet handled.

4 years agoVerifier: Check byref address space for AMDGPU calling conventions
Matt Arsenault [Mon, 29 Jun 2020 14:37:15 +0000 (10:37 -0400)]
Verifier: Check byref address space for AMDGPU calling conventions

4 years agoIssue error on invalid arithemtic conversions in C ternary
Erich Keane [Mon, 20 Jul 2020 15:00:13 +0000 (08:00 -0700)]
Issue error on invalid arithemtic conversions in C ternary

As reported in PR46774, an invalid arithemetic conversion used in a C
ternary operator resulted in an assertion. This patch replaces that
assertion with a diagnostic stating that the conversion failed.

At the moment, I believe the only case of this happening is _ExtInt
types.

4 years agoVerifier: Disallow byval and similar for AMDGPU calling conventions
Matt Arsenault [Thu, 7 May 2020 18:58:05 +0000 (14:58 -0400)]
Verifier: Disallow byval and similar for AMDGPU calling conventions

These imply stack-like semantics, which doesn't make any sense for
entry points.

4 years ago[Driver] Promote SmallSet of enum to a bitset. NFCI.
Benjamin Kramer [Mon, 20 Jul 2020 14:50:00 +0000 (16:50 +0200)]
[Driver] Promote SmallSet of enum to a bitset. NFCI.

4 years agoUpgrade SmallSets of pointer-like types to SmallPtrSet
Benjamin Kramer [Mon, 20 Jul 2020 14:41:44 +0000 (16:41 +0200)]
Upgrade SmallSets of pointer-like types to SmallPtrSet

This is slightly more efficient. NFC.

4 years ago[MLIR][Shape] Allow `shape.rank` to accept extent tensors `tensor?xindex>`
Frederik Gossen [Mon, 20 Jul 2020 14:46:18 +0000 (14:46 +0000)]
[MLIR][Shape] Allow `shape.rank` to accept extent tensors `tensor?xindex>`

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

4 years ago[MLIR][Shape] Allow `cstr_broadcastable` to accept extent tensors
Frederik Gossen [Mon, 20 Jul 2020 14:37:19 +0000 (14:37 +0000)]
[MLIR][Shape] Allow `cstr_broadcastable` to accept extent tensors

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

4 years ago[DebugInfo] Support for DW_AT_associated and DW_AT_allocated.
Alok Kumar Sharma [Mon, 20 Jul 2020 14:20:37 +0000 (19:50 +0530)]
[DebugInfo] Support for DW_AT_associated and DW_AT_allocated.

Summary:
This support is needed for the Fortran array variables with pointer/allocatable
attribute. This support enables debugger to identify the status of variable
whether that is currently allocated/associated.

  for pointer array (before allocation/association)
  without DW_AT_associated

(gdb) pt ptr
type = integer (140737345375288:140737354129776)
(gdb) p ptr
value requires 35017956 bytes, which is more than max-value-size

  with DW_AT_associated

(gdb) pt ptr
type = integer (:)
(gdb) p ptr
$1 = <not associated>

  for allocatable array (before allocation)

  without DW_AT_allocated

(gdb) pt arr
type = integer (140737345375288:140737354129776)
(gdb) p arr
value requires 35017956 bytes, which is more than max-value-size

  with DW_AT_allocated

(gdb) pt arr
type = integer, allocatable (:)
(gdb) p arr
$1 = <not allocated>

    Testing
- unit test cases added
- check-llvm
- check-debuginfo

Reviewed By: aprantl

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

4 years agoIR: Define byref parameter attribute
Matt Arsenault [Fri, 5 Jun 2020 20:58:47 +0000 (16:58 -0400)]
IR: Define byref parameter attribute

This allows tracking the in-memory type of a pointer argument to a
function for ABI purposes. This is essentially a stripped down version
of byval to remove some of the stack-copy implications in its
definition.

This includes the base IR changes, and some tests for places where it
should be treated similarly to byval. Codegen support will be in a
future patch.

My original attempt at solving some of these problems was to repurpose
byval with a different address space from the stack. However, it is
technically permitted for the callee to introduce a write to the
argument, although nothing does this in reality. There is also talk of
removing and replacing the byval attribute, so a new attribute would
need to take its place anyway.

This is intended avoid some optimization issues with the current
handling of aggregate arguments, as well as fixes inflexibilty in how
frontends can specify the kernel ABI. The most honest representation
of the amdgpu_kernel convention is to expose all kernel arguments as
loads from constant memory. Today, these are raw, SSA Argument values
and codegen is responsible for turning these into loads.

Background:

There currently isn't a satisfactory way to represent how arguments
for the amdgpu_kernel calling convention are passed. In reality,
arguments are passed in a single, flat, constant memory buffer
implicitly passed to the function. It is also illegal to call this
function in the IR, and this is only ever invoked by a driver of some
kind.

It does not make sense to have a stack passed parameter in this
context as is implied by byval. It is never valid to write to the
kernel arguments, as this would corrupt the inputs seen by other
dispatches of the kernel. These argumets are also not in the same
address space as the stack, so a copy is needed to an alloca. From a
source C-like language, the kernel parameters are invisible.
Semantically, a copy is always required from the constant argument
memory to a mutable variable.

The current clang calling convention lowering emits raw values,
including aggregates into the function argument list, since using
byval would not make sense. This has some unfortunate consequences for
the optimizer. In the aggregate case, we end up with an aggregate
store to alloca, which both SROA and instcombine turn into a store of
each aggregate field. The optimizer never pieces this back together to
see that this is really just a copy from constant memory, so we end up
stuck with expensive stack usage.

This also means the backend dictates the alignment of arguments, and
arbitrarily picks the LLVM IR ABI type alignment. By allowing an
explicit alignment, frontends can make better decisions. For example,
there's real no advantage to an aligment higher than 4, so a frontend
could choose to compact the argument layout. Similarly, there is a
high penalty to using an alignment lower than 4, so a frontend could
opt into more padding for small arguments.

Another design consideration is when it is appropriate to expose the
fact that these arguments are all really passed in adjacent
memory. Currently we have a late IR optimization pass in codegen to
rewrite the kernel argument values into explicit loads to enable
vectorization. In most programs, unrelated argument loads can be
merged together. However, exposing this property directly from the
frontend has some disadvantages. We still need a way to track the
original argument sizes and alignments to report to the driver. I find
using some side-channel, metadata mechanism to track this
unappealing. If the kernel arguments were exposed as a single buffer
to begin with, alias analysis would be unaware that the padding bits
betewen arguments are meaningless. Another family of problems is there
are still some gaps in replacing all of the available parameter
attributes with metadata equivalents once lowered to loads.

The immediate plan is to start using this new attribute to handle all
aggregate argumets for kernels. Long term, it makes sense to migrate
all kernel arguments, including scalars, to be passed indirectly in
the same manner.

Additional context is in D79744.

4 years agoMCFixup.h - remove unnecessary MCExpr.h include. NFCI.
Simon Pilgrim [Mon, 20 Jul 2020 14:17:04 +0000 (15:17 +0100)]
MCFixup.h - remove unnecessary MCExpr.h include. NFCI.

Move the include down to files that actually depend on MCExpr definitions.

Also exposes an implicit dependency on MCContext in AVRAsmBackend.h

4 years agoCodeGenDAGPatterns.h - remove unnecessary ComplexPattern forward declaration. NFCI.
Simon Pilgrim [Mon, 20 Jul 2020 13:03:46 +0000 (14:03 +0100)]
CodeGenDAGPatterns.h - remove unnecessary ComplexPattern forward declaration. NFCI.

This is defined in CodeGenTarget.h which we have to explicitly include already.

4 years agoCodeGenDAGPatterns.h - remove unused CodeGenHwModes.h include. NFCI.
Simon Pilgrim [Mon, 20 Jul 2020 12:49:20 +0000 (13:49 +0100)]
CodeGenDAGPatterns.h - remove unused CodeGenHwModes.h include. NFCI.

4 years agoAMDGPU/GlobalISel: Legalize s16->s64 G_FPEXT
Petar Avramovic [Mon, 20 Jul 2020 14:12:19 +0000 (16:12 +0200)]
AMDGPU/GlobalISel: Legalize s16->s64 G_FPEXT

Legalize using narrowScalar as s16->s32 G_FPEXT
followed by s32->s64 G_FPEXT.

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

4 years agoAMDGPU/GlobalISel: Remove outdated comment
Matt Arsenault [Sat, 18 Jul 2020 18:12:16 +0000 (14:12 -0400)]
AMDGPU/GlobalISel: Remove outdated comment

4 years agoGlobalISel: Don't handle widenScalar for vector G_INSERT
Matt Arsenault [Sat, 18 Jul 2020 16:27:16 +0000 (12:27 -0400)]
GlobalISel: Don't handle widenScalar for vector G_INSERT

This handling didn't make any sense for vectors.

4 years agoAMDGPU/GlobalISel: Fix custom lowering of llvm.trunc.f64 for SI
Matt Arsenault [Sun, 19 Jul 2020 15:57:49 +0000 (11:57 -0400)]
AMDGPU/GlobalISel: Fix custom lowering of llvm.trunc.f64 for SI

This was missing an operand from BFE and not erasing the original
instruction.

4 years agoAArch64/GlobalISel: Fix hardcoded registers in error message checks
Matt Arsenault [Sun, 19 Jul 2020 15:03:39 +0000 (11:03 -0400)]
AArch64/GlobalISel: Fix hardcoded registers in error message checks

4 years agoGlobalISel: Consistently get TII from MIRBuilder
Matt Arsenault [Sun, 19 Jul 2020 16:29:48 +0000 (12:29 -0400)]
GlobalISel: Consistently get TII from MIRBuilder

4 years ago[lldb/Utility] Simplify Scalar::SetValueFromData
Pavel Labath [Mon, 13 Jul 2020 16:04:46 +0000 (18:04 +0200)]
[lldb/Utility] Simplify Scalar::SetValueFromData

The function was fairly complicated and didn't support new bigger
integer sizes. Use llvm function for loading an APInt from memory to
write a unified implementation for all sizes.

4 years ago[lldb/test] Simplify Makefile rules for .d files
Pavel Labath [Wed, 15 Jul 2020 14:50:34 +0000 (16:50 +0200)]
[lldb/test] Simplify Makefile rules for .d files

The sed line in the rules was adding the .d file as a target to the
dependency rules -- to ensure the file gets rebuild when the sources
change. The same thing can be achieved more elegantly with some -M
flags.

4 years ago[LLE] std::inserter doesn't work with SmallSet, so don't use it.
Benjamin Kramer [Mon, 20 Jul 2020 13:42:16 +0000 (15:42 +0200)]
[LLE] std::inserter doesn't work with SmallSet, so don't use it.

4 years ago[AST][RecoveryExpr] Add recovery-ast tests for C language, NFC.
Haojian Wu [Mon, 20 Jul 2020 13:29:14 +0000 (15:29 +0200)]
[AST][RecoveryExpr] Add recovery-ast tests for C language, NFC.

some examples are working already.

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

4 years ago[AST][RecoveryExpr] Fix a crash on opencl C++.
Haojian Wu [Mon, 20 Jul 2020 13:06:40 +0000 (15:06 +0200)]
[AST][RecoveryExpr] Fix a crash on opencl C++.

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

4 years agoFix clangd build, NFC
Haojian Wu [Mon, 20 Jul 2020 13:11:00 +0000 (15:11 +0200)]
Fix clangd build, NFC

4 years ago[LoopSimplify] Use SmallPtrSet and range for loops more. NFCI.
Benjamin Kramer [Mon, 20 Jul 2020 13:00:27 +0000 (15:00 +0200)]
[LoopSimplify] Use SmallPtrSet and range for loops more. NFCI.

4 years ago[AST][RecoveryExpr] Preserve the AST for invalid conditions.
Haojian Wu [Mon, 20 Jul 2020 12:53:29 +0000 (14:53 +0200)]
[AST][RecoveryExpr] Preserve the AST for invalid conditions.

Adjust an existing diagnostic test, which is an improvement of secondary diagnostic.

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

4 years ago[LLDB/test] Simplify result formatter code
Pavel Labath [Mon, 20 Jul 2020 10:45:52 +0000 (12:45 +0200)]
[LLDB/test] Simplify result formatter code

Now that the main test results are reported through lit, and we only
have one formatter class, this code is unnecessarily baroque.

4 years ago[clangd] Exclude preprocessed-to-nothing tokens from selection
Sam McCall [Fri, 17 Jul 2020 10:03:24 +0000 (12:03 +0200)]
[clangd] Exclude preprocessed-to-nothing tokens from selection

This prevents selection of empty preprocessor entities (like #define directives,
or text in disabled sections) creating a selection in the parent element.

Summary: Based on D83508 by Aleksandr Platonov.

Reviewers: ArcsinX, kadircet

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

Tags: #clang

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

4 years ago[Syntax] expose API for expansions overlapping a spelled token range.
Sam McCall [Fri, 17 Jul 2020 09:35:04 +0000 (11:35 +0200)]
[Syntax] expose API for expansions overlapping a spelled token range.

Summary:
This allows efficiently accessing all expansions (without iterating over each
token and searching), and also identifying tokens within a range that are
affected by the preprocessor (which is how clangd will use it).

Subscribers: ilya-biryukov, kadircet, usaxena95, cfe-commits

Tags: #clang

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

4 years agoSubtargetFeatureInfo.h - remove unnecessary include and forward declarations. NFCI.
Simon Pilgrim [Mon, 20 Jul 2020 12:36:27 +0000 (13:36 +0100)]
SubtargetFeatureInfo.h - remove unnecessary include and forward declarations. NFCI.

Move necessary include down to SubtargetFeatureInfo.cpp.

4 years agoRevert "AArch64 SVE register infos and core file support"
Muhammad Omair Javaid [Mon, 20 Jul 2020 12:37:07 +0000 (17:37 +0500)]
Revert "AArch64 SVE register infos and core file support"

This reverts commit 7e017de0ad62dfd3f373354fc47b0e39c0fef657.

4 years ago[MLIR][Shape] Fold `shape.shape_eq`
Frederik Gossen [Mon, 20 Jul 2020 12:24:02 +0000 (12:24 +0000)]
[MLIR][Shape] Fold `shape.shape_eq`

Fold `shape.shape_eq`.

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

4 years ago[mlir][Vector] NFC - Improve VectorInterfaces
Nicolas Vasilache [Mon, 20 Jul 2020 12:15:31 +0000 (08:15 -0400)]
[mlir][Vector] NFC - Improve VectorInterfaces

This revision improves and makes better use of OpInterfaces for the Vector dialect.

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

4 years agoAArch64 SVE register infos and core file support
Muhammad Omair Javaid [Wed, 8 Jul 2020 01:44:12 +0000 (06:44 +0500)]
AArch64 SVE register infos and core file support

Summary:
This patch adds support for AArch64 SVE register infos description and
core file register access.

AArch64 SVE is a an optional extension of Arm v8.3-a architecture. It
has introduced 32 new vector registers Z, 16 predicate P registers and FFR
predicate register. These registers have fixed names but can dynamically
be configured to different size based on underlying OS configuration.

This patch adds register info struct that describes SVE register infos and
also provides RegisterContextPOSIXCore_arm64 routines to access SVE registers.

This patch also introduces a mechanism to configure SVE register sizes and
offsets at startup before exchanging register information across gdb-remote.

TestLinuxCore.py has been updated to include testing of SVE core files.

Reviewers: labath, clayborg, jankratochvil, jasonmolenda, rengolin

Reviewed By: labath

Subscribers: tschuett, kristof.beyls, danielkiss, lldb-commits

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

4 years ago[mlir] Support translating function linkage between MLIR and LLVM IR
Alex Zinenko [Mon, 20 Jul 2020 11:54:30 +0000 (13:54 +0200)]
[mlir] Support translating function linkage between MLIR and LLVM IR

Linkage support is already present in the LLVM dialect, and is being translated
for globals other than functions. Translation support has been missing for
functions because their conversion goes through a different code path than
other globals.

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

4 years ago[SVE] Add lowering for fixed length vector fdiv, fma, fmul and fsub operations.
Paul Walker [Mon, 20 Jul 2020 10:57:58 +0000 (10:57 +0000)]
[SVE] Add lowering for fixed length vector fdiv, fma, fmul and fsub operations.

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

4 years ago[OpenMP][Tests][NFC] Mark compatibility with older versions of clang
Joachim Protze [Mon, 20 Jul 2020 11:53:29 +0000 (13:53 +0200)]
[OpenMP][Tests][NFC] Mark compatibility with older versions of clang

4 years ago[AST][RecoveryExpr] Preserve the AST for invalid class constructions.
Haojian Wu [Mon, 20 Jul 2020 11:11:15 +0000 (13:11 +0200)]
[AST][RecoveryExpr] Preserve the AST for invalid class constructions.

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

4 years ago[Driver] Add support for -msve-vector-bits=scalable.
Paul Walker [Mon, 20 Jul 2020 10:43:45 +0000 (10:43 +0000)]
[Driver] Add support for -msve-vector-bits=scalable.

No real action is taken for a value of scalable but it provides a
route to disable an earlier specification and is effectively its
default value when omitted.

Patch also removes an "unused variable" warning.

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

4 years ago[MLIR][SPIRVToLLVM] Documentation for SPIR-V to LLVM conversion
George Mitenkov [Mon, 20 Jul 2020 10:40:18 +0000 (13:40 +0300)]
[MLIR][SPIRVToLLVM] Documentation for SPIR-V to LLVM conversion

This patch adds documentation for SPIR-V to LLVM conversion. It describes
the approaches taken and what is currently supported by this conversion
framework.

Reviewed By: antiagainst

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

4 years ago[test][llvm-readobj] Fix build bot failure after df952cb9
James Henderson [Mon, 20 Jul 2020 10:21:54 +0000 (11:21 +0100)]
[test][llvm-readobj] Fix build bot failure after df952cb9

The test wasn't updated due to being an unusual target not included in
my test run.

4 years ago[Matrix] Add minimal lowering pass that only requires TTI.
Florian Hahn [Mon, 20 Jul 2020 09:50:15 +0000 (10:50 +0100)]
[Matrix] Add minimal lowering pass that only requires TTI.

This patch adds a new variant of the matrix lowering pass that only does
a minimal lowering and only depends on TTI. The main purpose of this pass
is to have a pass with minimal dependencies to run as part of the backend
pipeline.

At the moment, the only difference to the regular lowering pass is that it
does not support remarks. But in subsequent patches add support for tiling
to the lowering pass which will require more analysis, which we do not want
to run in the backend, as the lowering should happen in the middle-end in
practice and running it in the backend is mostly for convenience when
running llc.

Reviewers: anemet, Gerolf, efriedma, hfinkel

Reviewed By: anemet

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

4 years ago[clang-cl] Allow a colon after the /Fe option (PR46720)
Hans Wennborg [Mon, 20 Jul 2020 10:04:42 +0000 (12:04 +0200)]
[clang-cl] Allow a colon after the /Fe option (PR46720)

4 years agoRemove Linux sysroot dependencies of SVE PT macros
Muhammad Omair Javaid [Mon, 20 Jul 2020 09:36:41 +0000 (14:36 +0500)]
Remove Linux sysroot dependencies of SVE PT macros

Summary:
SVE elf note data requires SVE PT macros for reading writing data. Same macros are used by Linux ptrace SVE register access.
This patch makes necessary changes to lldb/source/Plugins/Process/Linux/LinuxPTraceDefines_arm64sve.h in order to make them sysroot independent.

Reviewers: labath, rengolin

Reviewed By: labath

Subscribers: tschuett, lldb-commits, kristof.beyls

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

4 years agoRemove use of multiple reg index enums by RegisterContextPOSIX_arm64
Muhammad Omair Javaid [Mon, 20 Jul 2020 09:36:40 +0000 (14:36 +0500)]
Remove use of multiple reg index enums by RegisterContextPOSIX_arm64

Summary:
This patch removes dependence of RegisterContextPOSIX_arm64 on register number enums defined in lldb-arm64-register-enums.h.
RegisterContextPOSIX_arm64 makes use of helper functions to access register numbers defined in RegisterInfos_arm64.h via RegisterInfosPOSIX_arm64.

Reviewers: labath

Reviewed By: labath

Subscribers: emaste, kristof.beyls, arphaman, danielkiss, lldb-commits

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

4 years ago[Analyzer][StreamChecker] Report every leak, clean up state.
Balázs Kéri [Mon, 20 Jul 2020 07:07:48 +0000 (09:07 +0200)]
[Analyzer][StreamChecker] Report every leak, clean up state.

Summary:
Report resource leaks with non-fatal error.
Report every resource leak.
Stream state is cleaned up at `checkDeadSymbols`.

Reviewers: Szelethus, baloghadamsoftware, NoQ

Reviewed By: Szelethus

Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, gamesh411, Charusso, martong, ASDenysPetrov, cfe-commits

Tags: #clang

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

4 years ago[llvm-readobj] Print error when executed with no input files
Elvina Yakubova [Mon, 20 Jul 2020 07:47:11 +0000 (08:47 +0100)]
[llvm-readobj] Print error when executed with no input files

This patch changes llvm-readelf (and llvm-readobj for consistency)
behavior to print an error when executed with no input files.

Reading from stdin can be achieved via a '-' for the input
object.

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

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

Reviewed by: jhenderson, MaskRay, sbc, jyknight

4 years ago[llvm-readobj] Update tests because of changes in llvm-readobj behavior
Elvina Yakubova [Mon, 20 Jul 2020 07:39:14 +0000 (08:39 +0100)]
[llvm-readobj] Update tests because of changes in llvm-readobj behavior

This patch updates tests using llvm-readobj and llvm-readelf, because
soon reading from stdin will be achievable only via a '-' as described
here: https://bugs.llvm.org/show_bug.cgi?id=46400. Patch with changes to
llvm-readobj behavior is here: https://reviews.llvm.org/D83704

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

Reviewed by: jhenderson, MaskRay, grimar

4 years agoAArch64: emit @llvm.debugtrap as `brk #0xf000` on all platforms
Tim Northover [Fri, 17 Jul 2020 10:25:59 +0000 (11:25 +0100)]
AArch64: emit @llvm.debugtrap as `brk #0xf000` on all platforms

It's useful for a debugger to be able to distinguish an @llvm.debugtrap
from a (noreturn) @llvm.trap, so this extends the existing Windows
behaviour to other platforms.

4 years ago[LLD][ELF] - Update the lld/test/ELF/mips-merge-abiflags.s after llvm-readelf change.
Georgii Rymar [Mon, 20 Jul 2020 09:16:02 +0000 (12:16 +0300)]
[LLD][ELF] - Update the lld/test/ELF/mips-merge-abiflags.s after llvm-readelf change.

The warning message was updated
(https://reviews.llvm.org/rG256aea816da45bd3bc52317cbc89e704095a8991)

4 years agoAMDGPU/GlobalISel: Legalize s16->s64 G_FPTOSI/G_FPTOUI
Petar Avramovic [Mon, 20 Jul 2020 09:04:30 +0000 (11:04 +0200)]
AMDGPU/GlobalISel: Legalize s16->s64 G_FPTOSI/G_FPTOUI

Add narrowScalarFor action.
Add narrow scalar for typeIndex == 0 for G_FPTOSI/G_FPTOUI.
Legalize using narrowScalarFor as s16->s32 G_FPTOSI/G_FPTOUI
followed by s32->s64 G_SEXT/G_ZEXT.

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

4 years ago[llvm-readobj] - Refactor how the code dumps relocations.
Georgii Rymar [Wed, 15 Jul 2020 11:56:55 +0000 (14:56 +0300)]
[llvm-readobj] - Refactor how the code dumps relocations.

There is a strange "feature" of the code: it handles all relocations as `Elf_Rela`.
For handling `Elf_Rel` it converts them to `Elf_Rela` and passes `bool IsRela` to
specify the real type everywhere.

A related issue is that the
`decode_relrs` helper in lib/Object has to return `Expected<std::vector<Elf_Rela>>`
because of that, though it could return a vector of `Elf_Rel`.

I think we should just start using templates for relocation types, it makes the code
cleaner and shorter. This patch does it.

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

4 years ago[lldb] Remove orphaned modules in a loop
Raphael Isemann [Mon, 20 Jul 2020 08:47:21 +0000 (10:47 +0200)]
[lldb] Remove orphaned modules in a loop

Summary:

When modules reference each other (which happens for example with the different
modules LLDB loads when debugging -gmodules-compiled binaries), just iterating
over the module list once isn't good enough to find all orphans. Any removed
modules in the module list will also clear up the shared pointers they hold to
other modules, so after any module was removed from the list, LLDB should
iterate again and check if any additional modules can no be safely deleted.

This is currently causing that many gmodules tests are not cleaning up all
allocated modules which causes cleanup asserts to fail (right now these asserts
just mark the test as unsupported, but after D83865 the tests will start
failing).

Reviewers: aprantl, clayborg, JDevlieghere

Reviewed By: JDevlieghere

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

4 years ago[llvm-readelf/readobj] - Refine the error reporting in printMipsABIFlags() methods.
Georgii Rymar [Fri, 17 Jul 2020 12:45:01 +0000 (15:45 +0300)]
[llvm-readelf/readobj] - Refine the error reporting in printMipsABIFlags() methods.

It fixes/improves the following:
1) Some code was duplicated.
2) A "The .MIPS.abiflags section has a wrong size" error was not reported as a warning,
   but was printed to stdout for the LLVM style. Also, it was reported as an error for the GNU style.
   This patch changes the behavior to be consistent and to report warnings.
3) `unwrapOrError()` was used before, now a warning is reported instead.

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

4 years agoEnable the test for hasArraySize() AST matcher in all language modes
Dmitri Gribenko [Mon, 20 Jul 2020 08:22:59 +0000 (10:22 +0200)]
Enable the test for hasArraySize() AST matcher in all language modes

Summary:
In C++11 and later Clang generates an implicit conversion from int to
size_t in the AST.

Reviewers: ymandel, hokein

Reviewed By: hokein

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[lldb][NFC] Remove unused FormattersContainer::Get overload
Raphael Isemann [Mon, 20 Jul 2020 07:59:40 +0000 (09:59 +0200)]
[lldb][NFC] Remove unused FormattersContainer::Get overload

This is unused and also calls a non-existent 'Get' overload.

4 years ago[NFCI][SimplifyCFG] Guard common code hoisting with a (default-on) flag
Roman Lebedev [Mon, 20 Jul 2020 06:56:38 +0000 (09:56 +0300)]
[NFCI][SimplifyCFG] Guard common code hoisting with a (default-on) flag

Common code sinking is already guarded with a (with default-off!) flag,
so add a flag for hoisting, too.

D84108 will hopefully make hoisting off-by-default too.

4 years ago[NFC][SimplifyCFG] Add standalone test for common code hoisting xform option
Roman Lebedev [Mon, 20 Jul 2020 06:50:20 +0000 (09:50 +0300)]
[NFC][SimplifyCFG] Add standalone test for common code hoisting xform option

Also, move one test into it's correct place

4 years ago[Attributor][NFC] applying update_test_checks with --check-attributes
sstefan1 [Sun, 19 Jul 2020 19:55:43 +0000 (21:55 +0200)]
[Attributor][NFC] applying update_test_checks with --check-attributes

Summary:
All tests are updated, except wrapper.ll since it is not working nicely
with newly created functions.

Reviewers: jdoerfert, uenoku, baziotis, homerdin

Subscribers: arphaman, jfb, kuter, bbn, okura, llvm-commits

Tags: #llvm

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

4 years ago[DWARFYAML] Add dependency 'BinaryFormat'. NFC.
Xing GUO [Mon, 20 Jul 2020 05:56:04 +0000 (13:56 +0800)]
[DWARFYAML] Add dependency 'BinaryFormat'. NFC.

This patch is trying to fix build failure.

Failed tests:
http://lab.llvm.org:8011/builders/clang-ppc64le-linux-multistage/builds/12574

4 years ago[ORC] Refactor TrampolinePool to reduce virtual function calls.
Lang Hames [Mon, 20 Jul 2020 05:33:27 +0000 (22:33 -0700)]
[ORC] Refactor TrampolinePool to reduce virtual function calls.

Virtual function calls are now only made when the pool needs to be
grown to accommodate o new request.

4 years ago[lldb][NFC] Make some RegularExpression constructor calls less verbose
Raphael Isemann [Mon, 20 Jul 2020 05:10:41 +0000 (07:10 +0200)]
[lldb][NFC] Make some RegularExpression constructor calls less verbose

4 years ago[DWARFYAML] Remove 'default' tag. NFC.
Xing GUO [Mon, 20 Jul 2020 03:12:32 +0000 (11:12 +0800)]
[DWARFYAML] Remove 'default' tag. NFC.

This patch is trying to make build bots happy.

Failed bots:
http://lab.llvm.org:8011/builders/ppc64le-lld-multistage-test/builds/10705
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-android/builds/33595

4 years ago[JITLink][MachO] Tidy up debugging output for relocation parsing.
Lang Hames [Mon, 20 Jul 2020 02:33:49 +0000 (19:33 -0700)]
[JITLink][MachO] Tidy up debugging output for relocation parsing.

Identify relocations by (section name, offset) pairs, rather than plain
vmaddrs. This makes it easier to cross-reference debugging output for
relocations with output from standard object inspection tools (otool,
readelf, objdump, etc.).

4 years ago[DWARFYAML] Implement the .debug_rnglists section.
Xing GUO [Mon, 20 Jul 2020 02:42:27 +0000 (10:42 +0800)]
[DWARFYAML] Implement the .debug_rnglists section.

This patch implements the .debug_rnglists section. We are able to
produce the .debug_rnglists section by the following syntax.

```
debug_rnglists:
  - Format:              DWARF32 ## Optional
    Length:              0x1234  ## Optional
    Version:             5       ## Optional
    AddressSize:         0x08    ## Optional
    SegmentSelectorSize: 0x00    ## Optional
    OffsetEntryCount:    2       ## Optional
    Offsets:             [1, 2]  ## Optional
    Lists:
      - Entries:
          - Operator: DW_RLE_base_address
            Values:   [ 0x1234 ]
```

The generated .debug_rnglists is verified by llvm-dwarfdump, except for
the operator DW_RLE_startx_endx, since llvm-dwarfdump doesn't support
it.

Reviewed By: jhenderson

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

4 years ago[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison use canCreateUndefOrPoison
Juneyoung Lee [Mon, 20 Jul 2020 00:21:28 +0000 (09:21 +0900)]
[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison use canCreateUndefOrPoison

 This patch adds support more operations.

Reviewed By: nikic

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

4 years ago[Utils][Fix] remove unnecessary ; at the end
sstefan1 [Sun, 19 Jul 2020 18:45:24 +0000 (20:45 +0200)]
[Utils][Fix] remove unnecessary ; at the end

4 years ago[Utils] Check function attributes in update_test_checks
sstefan1 [Sat, 11 Jul 2020 19:53:50 +0000 (21:53 +0200)]
[Utils] Check function attributes in update_test_checks

Summary:
This introduces new flag to the update_test_checks and
update_cc_test_checks that allows for function attributes
to be checked in a check-line. If the flag is not set,
the behavior should remain the same.

Reviewers: jdoerfert

Subscribers: arichardson, llvm-commits

Tags: #llvm

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

4 years ago[JITLink][MachO] Fix handling of non-extern UNSIGNED pair of SUBTRACTOR relocs.
Lang Hames [Sun, 19 Jul 2020 03:43:13 +0000 (20:43 -0700)]
[JITLink][MachO] Fix handling of non-extern UNSIGNED pair of SUBTRACTOR relocs.

When processing a MachO SUBTRACTOR/UNSIGNED pair, if the UNSIGNED target
is non-extern then check the r_symbolnum field of the relocation to find
the targeted section and use the section's address to find 'ToSymbol'.

Previously 'ToSymbol' was found by loading the initial value stored at
the fixup location and treating this as an address to search for. This
is incorrect, however: the initial value includes the addend and will
point to the wrong block if the addend is less than zero or greater than
the block size.

rdar://65756694

4 years agoFix ValueTrackingTest.cpp to use pair instead of tuple
Juneyoung Lee [Sun, 19 Jul 2020 17:21:52 +0000 (02:21 +0900)]
Fix ValueTrackingTest.cpp to use pair instead of tuple

4 years ago[ConstantFolding] check applicability of AllOnes constant creation first
Jameson Nash [Wed, 15 Jul 2020 13:17:42 +0000 (09:17 -0400)]
[ConstantFolding] check applicability of AllOnes constant creation first

The getAllOnesValue can only handle things that are bitcast from a
ConstantInt, while here we bitcast through a pointer, so we may see more
complex objects (like Array or Struct).

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

4 years ago[llvm-reduce] Fix incorrect indices in argument reduction pass
Alex Richardson [Sun, 19 Jul 2020 16:24:57 +0000 (17:24 +0100)]
[llvm-reduce] Fix incorrect indices in argument reduction pass

The function extractArgumentsFromModule() was passing a one-based index to,
but replaceFunctionCalls() was expecting a zero-based argument index. This
resulted in assertion errors when reducing function call arguments with
different types. Additionally, the

Reviewed By: lebedev.ri

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

4 years ago[llvm][NFC] Add missing 'override'
Logan Smith [Sun, 19 Jul 2020 16:35:29 +0000 (09:35 -0700)]
[llvm][NFC] Add missing 'override'

4 years ago[ValueTracking] Add canCreateUndefOrPoison & let canCreatePoison use Operator
Juneyoung Lee [Sun, 19 Jul 2020 16:23:58 +0000 (01:23 +0900)]
[ValueTracking] Add canCreateUndefOrPoison & let canCreatePoison use Operator

This patch
- adds `canCreateUndefOrPoison`
- refactors `canCreatePoison` so it can deal with constantexprs

`canCreateUndefOrPoison` will be used at D83926.

Reviewed By: nikic, jdoerfert

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

4 years ago[clang] Fix the warning for a non-void consteval function without a return value...
Bruno Ricci [Sun, 19 Jul 2020 16:08:17 +0000 (17:08 +0100)]
[clang] Fix the warning for a non-void consteval function without a return value to actually say "consteval".

This warning was modified in 796ed03b8412 to use the term "consteval"
for consteval functions. However the warning has never worked as
intended since the diagnostic's arguments are used in the wrong order.

This was unfortunately missed by 796ed03b8412 since no test did exercise
this specific warning.

Additionally send the NamedDecl* into the diagnostic instead of just the
IdentifierInfo* to correctly work with special names and template
arguments.

4 years ago[clang] Disable a few formatting options for test/
Bruno Ricci [Sun, 19 Jul 2020 15:53:59 +0000 (16:53 +0100)]
[clang] Disable a few formatting options for test/

Hopefully this will make the bot a little less noisy. Rationale for each:

AlignTrailingComments: We don't want to force-align the various expected-error
                       and friends.

CommentPragmas:       Tell clang-format to leave the "// CHECK:" and the
                      "// expected-" alone.

AlwaysBreakTemplateDeclarations: Templates in tests often have no break between
                                 the template-head and the declaration.

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

4 years agoRevert "[InlineAdvisor] New inliner advisor to replay inlining from optimization...
Wenlei He [Sun, 19 Jul 2020 15:49:04 +0000 (08:49 -0700)]
Revert "[InlineAdvisor] New inliner advisor to replay inlining from optimization remarks"

This reverts commit 2d6ecfa168c2d36ac88efc854f19b05d1c540ded.

4 years ago[InlineAdvisor] New inliner advisor to replay inlining from optimization remarks
Wenlei He [Fri, 17 Jul 2020 23:35:56 +0000 (16:35 -0700)]
[InlineAdvisor] New inliner advisor to replay inlining from optimization remarks

Summary:
This change added a new inline advisor that takes optimization remarks from previous inlining as input, and provides the decision as advice so current inlining can replay inline decisions of a different compilation. Dwarf inline stack with line and discriminator is used as anchor for call sites including call context. The change can be useful for Inliner tuning as it provides a channel to allow external input for tweaking inline decisions. Existing alternatives like alwaysinline attribute is per-function, not per-callsite. Per-callsite inline intrinsic can be another solution (not yet existing), but it's intrusive to implement and also does not differentiate call context.

A switch -sample-profile-inline-replay=<inline_remarks_file> is added to hook up the new inline advisor with SampleProfileLoader's inline decision for replay. Since SampleProfileLoader does top-down inlining, inline decision can be specialized for each call context, hence we should be able to replay inlining accurately. However with a bottom-up inliner like CGSCC inlining, the replay can be limited due to lack of specialization for different call context. Apart from that limitation, the new inline advisor can still be used by regular CGSCC inliner later if needed for tuning purpose.

Subscribers: mgorny, aprantl, hiraditya, llvm-commits

Tags: #llvm

Resubmit for https://reviews.llvm.org/D84086

4 years agoSilence a "logical operation on address of string constant" via CMake instead.
Aaron Ballman [Sun, 19 Jul 2020 15:19:48 +0000 (11:19 -0400)]
Silence a "logical operation on address of string constant" via CMake instead.

4 years agoRevert 7dfff42f019583076c55993d30a63889613922dd as it broke non-Windows builds.
Aaron Ballman [Sun, 19 Jul 2020 15:12:39 +0000 (11:12 -0400)]
Revert 7dfff42f019583076c55993d30a63889613922dd as it broke non-Windows builds.

4 years agoSilencing some 'logical operation on address of string constant diagnostics; NFC
Aaron Ballman [Sun, 19 Jul 2020 14:50:51 +0000 (10:50 -0400)]
Silencing some 'logical operation on address of string constant diagnostics; NFC

4 years ago[x86] split FMA with fast-math-flags to avoid libcall
Sanjay Patel [Sun, 19 Jul 2020 14:03:55 +0000 (10:03 -0400)]
[x86] split FMA with fast-math-flags to avoid libcall

fma reassoc A, B, C --> fadd (fmul A, B), C (when target has no FMA hardware)

C/C++ code may use explicit fma() calls (which become LLVM fma
intrinsics in IR) but then gets compiled with -ffast-math or similar.
For targets that do not have FMA hardware, we don't want to go out to
the math library for a precise but slow FMA result.

I tried this as a generic DAGCombine, but it caused infinite looping
on more than 1 other target, so there's likely some over-reaching fma
formation happening.

There's also a potential intersection of strict FP with fast-math here.
Deferring to current behavior for that case (assuming that strict-ness
overrides fast-ness).

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