platform/upstream/llvm.git
4 years ago[update_cc_test_checks.py] Add the --function-signature flag
Alex Richardson [Wed, 20 Nov 2019 13:20:15 +0000 (13:20 +0000)]
[update_cc_test_checks.py] Add the --function-signature flag

Summary:
This was added to update_test_checks.py in D68819 and I believe having it
in update_cc_test_checks.py is also useful.

Reviewers: jdoerfert, MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[UptestTestChecks][NFC] Share some common command line options code
Alex Richardson [Wed, 20 Nov 2019 13:19:48 +0000 (13:19 +0000)]
[UptestTestChecks][NFC] Share some common command line options code

Summary:
Add a function common.parse_commandline_args() that adds options common
to all tools (--verbose and --update-only) and returns the parsed
commandline arguments. I plan to use the shared parsing of --verbose in a
follow-up commit to remove most of the `if args.verbose:` checks in the
scripts.

Reviewers: xbolva00, MaskRay

Reviewed By: MaskRay

Subscribers: llvm-commits

Tags: #llvm

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

4 years agoIgnore R_MIPS_JALR relocations against non-function symbols
Alex Richardson [Wed, 20 Nov 2019 13:19:16 +0000 (13:19 +0000)]
Ignore R_MIPS_JALR relocations against non-function symbols

Summary:
Current versions of clang would erroneously emit this relocation not only
against functions (loaded from the GOT) but also against data symbols
(e.g. a table of function pointers). LLD was then changing this into a
branch-and-link instruction, causing the program to jump to the data
symbol at run time. I discovered this problem when attempting to boot
MIPS64 FreeBSD after updating the to the latest upstream master.

Reviewers: atanasyan, jrtc27, espindola

Reviewed By: atanasyan

Subscribers: emaste, sdardis, krytarowski, MaskRay, llvm-commits

Tags: #llvm

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

4 years agoARM-NEON: make type modifiers orthogonal and allow multiple modifiers.
Tim Northover [Fri, 11 Oct 2019 12:46:47 +0000 (13:46 +0100)]
ARM-NEON: make type modifiers orthogonal and allow multiple modifiers.

The modifier system used to mutate types on NEON intrinsic definitions had a
separate letter for all kinds of transformations that might be needed, and we
were quite quickly running out of letters to use. This patch converts to a much
smaller set of orthogonal modifiers that can be applied together to achieve the
desired effect.

When merging with downstream it is likely to cause a conflict with any local
modifications to the .td files. There is a new script in
utils/convert_arm_neon.py that was used to convert all .td definitions and I
would suggest running it on the last downstream version of those files before
this commit rather than resolving conflicts manually.

4 years agoNeonEmitter: remove special case on casting polymorphic builtins.
Tim Northover [Wed, 30 Oct 2019 11:27:13 +0000 (11:27 +0000)]
NeonEmitter: remove special case on casting polymorphic builtins.

For some reason we were not casting a fairly obscure class of builtin calls we
expected to be polymorphic to vectors of char. It worked because the only
affected intrinsics weren't actually polymorphic after all, but is
unnecessarily complicated.

4 years agoARM-NEON: separate soon-to-be conflicting f16 patterns. NFC.
Tim Northover [Wed, 30 Oct 2019 09:26:58 +0000 (09:26 +0000)]
ARM-NEON: separate soon-to-be conflicting f16 patterns. NFC.

This separates some intrinsic definitions into multiple instantiations because
they use a modifier that forces the float size to a given value. That modifier
won't work in the new NeonEmitter modifier scheme and committing this
separately allows the Python script to be run on the .td files to perform the
conversion automatically.

4 years ago[lldb][NFC] Move ClangExpressionDeclMap's persistent decl search into its own function
Raphael Isemann [Wed, 20 Nov 2019 12:41:44 +0000 (13:41 +0100)]
[lldb][NFC] Move ClangExpressionDeclMap's persistent decl search into its own function

Searching persistent decls is a small subset of the things
FindExternalVisibleDecls does. It should be its own function instead
of being encapsulated in this `do { } while(false);` pattern.

4 years agoUpdate tests after change to llvm-cxxfilt's underscore stripping behaviour.
Tim Northover [Wed, 20 Nov 2019 13:03:38 +0000 (13:03 +0000)]
Update tests after change to llvm-cxxfilt's underscore stripping behaviour.

4 years ago[mips] Put conditions when we need to expand memory operand into a separate function...
Simon Atanasyan [Wed, 20 Nov 2019 12:27:27 +0000 (15:27 +0300)]
[mips] Put conditions when we need to expand memory operand into a separate function. NFC

`expandMemInst` expects instruction with 3 or 4 operands and the last
operand requires expanding. It's redundant to scan all operands in a
loop. We can check the last operands.

4 years ago[mips] Make MipsAsmParser::isEvaluated static function. NFC
Simon Atanasyan [Wed, 20 Nov 2019 12:22:12 +0000 (15:22 +0300)]
[mips] Make MipsAsmParser::isEvaluated static function. NFC

4 years ago[AMDGPU][DPP] Corrected DPP combiner
Dmitry Preobrazhensky [Wed, 20 Nov 2019 12:09:08 +0000 (15:09 +0300)]
[AMDGPU][DPP] Corrected DPP combiner

Added a check to make sure that the selected dpp opcode is supported by target.

Reviewers: vpykhtin, arsenm, rampitec

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

4 years agogn build: Merge 089c0f58149
LLVM GN Syncbot [Wed, 20 Nov 2019 12:30:58 +0000 (12:30 +0000)]
gn build: Merge 089c0f58149

4 years ago[CodeGen][NFC] Regenerate load-combine test with update_llc_test.
Clement Courbet [Wed, 20 Nov 2019 10:00:28 +0000 (11:00 +0100)]
[CodeGen][NFC] Regenerate load-combine test with update_llc_test.

To prepare for D27861.

4 years ago[DWARF] Add an api to get "interpreted" location lists
Pavel Labath [Fri, 8 Nov 2019 14:24:11 +0000 (15:24 +0100)]
[DWARF] Add an api to get "interpreted" location lists

Summary:
This patch adds DWARFDie::getLocations, which returns the location
expressions for a given attribute (typically DW_AT_location). It handles
both "inline" locations and references to the external location list
sections (currently only of the DW_FORM_sec_offset type). It is
implemented on top of DWARFUnit::findLoclistFromOffset, which is also
added in this patch. I tried to make their signatures similar to the
equivalent range list functionality.

The actual location list interpretation logic is in
DWARFLocationTable::visitAbsoluteLocationList. This part is not
equivalent to the range list code, but this deviation is motivated by a
desire to reuse the same location list parsing code within lldb.

The functionality is tested via a c++ unit test of the DWARFDie API.

Reviewers: dblaikie, JDevlieghere, SouraVX

Subscribers: mgorny, hiraditya, cmtice, probinson, llvm-commits, aprantl

Tags: #llvm

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

4 years ago[DebugInfo] Remove the DIFlagArgumentNotModified debug info flag
Djordje Todorovic [Wed, 20 Nov 2019 11:20:53 +0000 (12:20 +0100)]
[DebugInfo] Remove the DIFlagArgumentNotModified debug info flag

Due to changes in D68206, we remove the DIFlagArgumentNotModified
and its usage.

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

4 years agogn build: Merge ea8678d1c78
LLVM GN Syncbot [Wed, 20 Nov 2019 12:10:51 +0000 (12:10 +0000)]
gn build: Merge ea8678d1c78

4 years ago[lldb][NFC] Remove unused ClangASTContext::GetUnknownAnyType
Raphael Isemann [Wed, 20 Nov 2019 11:56:42 +0000 (12:56 +0100)]
[lldb][NFC] Remove unused ClangASTContext::GetUnknownAnyType

4 years ago[clangd] Treat UserDefinedLiteral as a leaf in SelectionTree, sidestepping tokenizati...
Sam McCall [Tue, 19 Nov 2019 15:57:31 +0000 (16:57 +0100)]
[clangd] Treat UserDefinedLiteral as a leaf in SelectionTree, sidestepping tokenization issues

Summary: Fixes https://github.com/clangd/clangd/issues/203

Reviewers: kadircet

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

Tags: #clang

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

4 years agoMove floating point related entities to namespace level
Serge Pavlov [Thu, 29 Aug 2019 12:29:11 +0000 (19:29 +0700)]
Move floating point related entities to namespace level

This is recommit of commit e6584b2b7b2d, which was reverted in
30e7ee3c4bac together with af57dbf12e54.
Original message is below.

Enumerations that describe rounding mode and exception behavior were
defined inside ConstrainedFPIntrinsic. It makes sense to use the same
definitions to represent the same properties in other cases, not only
in constrained intrinsics. It was however inconvenient as required to
include constrained intrinsics definitions even if they were not needed.
Also using long scope prefix reduced readability.

This change moves these definitioins to the namespace llvm::fp.
No functional changes.

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

4 years ago[lldb][NFC] Simplify ClangASTContext::GetBasicTypes
Raphael Isemann [Wed, 20 Nov 2019 11:40:08 +0000 (12:40 +0100)]
[lldb][NFC] Simplify ClangASTContext::GetBasicTypes

static convenience methods that do the clang::ASTContext -> ClangASTContext
conversion and handle errors by simply ignoring them are not a good idea.

4 years ago[lldb][NFC] Remove ClangASTContext::GetAsDeclContext
Raphael Isemann [Wed, 20 Nov 2019 11:17:48 +0000 (12:17 +0100)]
[lldb][NFC] Remove ClangASTContext::GetAsDeclContext

Everything we pass to this function is already a DeclContext.

4 years ago[lldb][NFC] Remove ClangASTContext::FieldIsBitfield overload
Raphael Isemann [Wed, 20 Nov 2019 11:09:19 +0000 (12:09 +0100)]
[lldb][NFC] Remove ClangASTContext::FieldIsBitfield overload

4 years ago[lldb][NFC] Remove ClangASTContext::GetUniqueNamespaceDeclaration overload
Raphael Isemann [Wed, 20 Nov 2019 10:36:15 +0000 (11:36 +0100)]
[lldb][NFC] Remove ClangASTContext::GetUniqueNamespaceDeclaration overload

This overload is only used in one place and having static overloads for
all methods that only do an additional clang::ASTContext -> ClangASTContext
conversion is just not sustainable.

4 years ago[AMDGPU] add support for hostcall buffer pointer as hidden kernel argument
Sameer Sahasrabuddhe [Tue, 19 Nov 2019 08:35:39 +0000 (14:05 +0530)]
[AMDGPU] add support for hostcall buffer pointer as hidden kernel argument

Hostcall is a service that allows a kernel to submit requests to the
host using shared buffers, and block until a response is
received. This will eventually replace the shared buffer currently
used for printf, and repurposes the same hidden kernel argument. This
change introduces a new ValueKind in the HSA metadata to represent the
hostcall buffer.

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

4 years ago[ExecutionEngine] Add a missing break to avoid warnings
Martin Storsjö [Wed, 20 Nov 2019 10:19:50 +0000 (12:19 +0200)]
[ExecutionEngine] Add a missing break to avoid warnings

This fixes buildbot errors since dc3ee330891c2.

4 years ago[llvm-readobj] - Improve dumping of the SHT_LLVM_LINKER_OPTIONS sections.
Georgii Rymar [Tue, 12 Nov 2019 09:46:44 +0000 (12:46 +0300)]
[llvm-readobj] - Improve dumping of the SHT_LLVM_LINKER_OPTIONS sections.

I've added a few tests that shows how the current code could overrun the section data
buffer while dumping. I had to rewrite the code to fix this.

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

4 years agoReland "[clang] Remove the DIFlagArgumentNotModified debug info flag"
Djordje Todorovic [Tue, 19 Nov 2019 13:47:08 +0000 (14:47 +0100)]
Reland "[clang] Remove the DIFlagArgumentNotModified debug info flag"

It turns out that the ExprMutationAnalyzer can be very slow when AST
gets huge in some cases. The idea is to move this analysis to the LLVM
back-end level (more precisely, in the LiveDebugValues pass). The new
approach will remove the performance regression, simplify the
implementation and give us front-end independent implementation.

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

4 years agoExecutionEngine: add preliminary support for COFF ARM64
Adam Kallai [Wed, 20 Nov 2019 08:51:03 +0000 (10:51 +0200)]
ExecutionEngine: add preliminary support for COFF ARM64

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

4 years ago[llvm-readobj/llvm-readelf] - Improve dumping of versioning sections.
Georgii Rymar [Mon, 18 Nov 2019 14:43:50 +0000 (17:43 +0300)]
[llvm-readobj/llvm-readelf] - Improve dumping of versioning sections.

Our elf-versioninfo.test is not perfect. It does not properly test how
flags are dumped and also we have a bug: they are dumped as enums in
LLVM style now, i.e not dumped properly.

GNU style uses a `versionFlagToString` method to build a string from flags
which seems is consistent with GNU readelf.

In this patch I fixed the issues mentioned.

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

4 years agoIntroduce llvm-install-name-tool
Alexander Shaposhnikov [Wed, 20 Nov 2019 07:30:52 +0000 (23:30 -0800)]
Introduce llvm-install-name-tool

This diff adds a new "driver" for llvm-objcopy
which is supposed to emulate the behavior of install-name-tool.
This is a recommit of b5913e6 with ubsan, test dependencies issues fixed.

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

Test plan: make check-all

4 years ago[FEnv] Fix AddingConstrainedIntrinsics.rst after llvmorg-10-init-10282-g0c50c0b0552
Fangrui Song [Wed, 20 Nov 2019 07:09:07 +0000 (23:09 -0800)]
[FEnv] Fix AddingConstrainedIntrinsics.rst after llvmorg-10-init-10282-g0c50c0b0552

4 years ago[FEnv] File with properties of constrained intrinsics
Serge Pavlov [Tue, 5 Nov 2019 13:42:16 +0000 (20:42 +0700)]
[FEnv] File with properties of constrained intrinsics

Summary
In several places we need to enumerate all constrained intrinsics or IR
nodes that should be represented by them. It is easy to miss some of
the cases. To make working with these intrinsics more convenient and
robust, this change introduces file containing definitions of all
constrained intrinsics and some of their properties. This file can be
included to generate constrained intrinsics processing code.

Reviewers: kpn, andrew.w.kaylor, cameron.mcinally, uweigand

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/GlobalISel: Legalize FDIV64
Austin Kerbow [Mon, 18 Nov 2019 00:43:59 +0000 (16:43 -0800)]
AMDGPU/GlobalISel: Legalize FDIV64

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, rovka, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

4 years agoUse lld::make<T> to make TpiSource objects
Rui Ueyama [Tue, 19 Nov 2019 06:04:21 +0000 (15:04 +0900)]
Use lld::make<T> to make TpiSource objects

In lld we rarely use std::unique_ptr but instead allocate new instances
using lld::make<T>() so that they are deallocated at the end of linking.
This patch changes existing code so that that follows the convention.

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

4 years agoExtends the tblgen macro to allow mlir-tblgen to be installed
Eric Schweitz [Wed, 20 Nov 2019 03:28:12 +0000 (19:28 -0800)]
Extends the tblgen macro to allow mlir-tblgen to be installed

The mlir-tblgen tool was not getting installed.  This change allows
the MLIR project to be installed along with llvm-tblgen.

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

4 years agoRevert "[clang][IFS] Driver Pipeline: generate stubs after standard pipeline (2)"
Puyan Lotfi [Wed, 20 Nov 2019 02:59:50 +0000 (21:59 -0500)]
Revert "[clang][IFS] Driver Pipeline: generate stubs after standard pipeline (2)"

This reverts commit ea8e02822341e2421b94167d828d3f224e767424.

4 years agoRevert "[clang][IFS] Fixing failing bots that do not have PPC target or "orbis-ld""
Puyan Lotfi [Wed, 20 Nov 2019 02:59:39 +0000 (21:59 -0500)]
Revert "[clang][IFS] Fixing failing bots that do not have PPC target or "orbis-ld""

This reverts commit 377d70cdea733e36107e99d9148864d24797d51c.

4 years agoRevert "[clang][IFS] Attempting to fix missing 'orbis-ld' on scei-ps4-ubuntu bot."
Puyan Lotfi [Wed, 20 Nov 2019 02:59:31 +0000 (21:59 -0500)]
Revert "[clang][IFS] Attempting to fix missing 'orbis-ld' on scei-ps4-ubuntu bot."

This reverts commit 29fd1e1f4a372f3870e054da24b57a4f45861808.

4 years agoRevert "[clang][IFS] Fixing unsupported emulation mode on clang-ppc64be-linux bot."
Puyan Lotfi [Wed, 20 Nov 2019 02:59:22 +0000 (21:59 -0500)]
Revert "[clang][IFS] Fixing unsupported emulation mode on clang-ppc64be-linux bot."

This reverts commit 1b387484b9b38a4a1e98a9d22a9a26065b0d184e.

4 years agoRevert "[clang][IFS][test] Removing driver-test.c. Test is still too brittle."
Puyan Lotfi [Wed, 20 Nov 2019 02:59:10 +0000 (21:59 -0500)]
Revert "[clang][IFS][test] Removing driver-test.c. Test is still too brittle."

This reverts commit f37356d6f60ae5db978611621d3a375ed87ec0f0.

4 years ago[clang][IFS][test] Removing driver-test.c. Test is still too brittle.
Puyan Lotfi [Wed, 20 Nov 2019 02:42:17 +0000 (21:42 -0500)]
[clang][IFS][test] Removing driver-test.c. Test is still too brittle.

Removing this test because if I add a triple then there are link falures
on targets like ppc and s390x. If I don't add a triple then on PS4
targets the clang driver tries to invoke orbis-ld which ends up being
not found.

4 years agoclang/Modules: Early return in CompilerInstance::createModuleManager, NFC
Duncan P. N. Exon Smith [Wed, 20 Nov 2019 02:10:04 +0000 (18:10 -0800)]
clang/Modules: Early return in CompilerInstance::createModuleManager, NFC

Reduce nesting with an early `return`.

4 years ago[musttail] Don't forward AL on Win64
Reid Kleckner [Mon, 18 Nov 2019 23:31:37 +0000 (15:31 -0800)]
[musttail] Don't forward AL on Win64

AL is only used for varargs on SysV platforms. Don't forward it on
Windows. This allows control flow guard to set up an extra hidden
parameter in RAX, as described in PR44049.

This also has the effect of freeing up RAX for use in virtual member
pointer thunks, which may also be a nice little code size improvement on
Win64.

Fixes PR44049

Reviewers: ajpaverd, efriedma, hans

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

4 years ago[LTO][Legacy] Add API for passing LLVM options separately
Francis Visoiu Mistrih [Tue, 19 Nov 2019 22:04:59 +0000 (14:04 -0800)]
[LTO][Legacy] Add API for passing LLVM options separately

In order to correctly pass options to LLVM, including options containing
spaces which are used as delimiters for multiple options in
lto_codegen_debug_options, add a new API:
lto_codegen_debug_options_array.

Unfortunately, tools/lto has no testing infrastructure yet, so there are
no tests associated with this patch.

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

4 years ago[clang][IFS] Fixing unsupported emulation mode on clang-ppc64be-linux bot.
Puyan Lotfi [Wed, 20 Nov 2019 00:24:12 +0000 (19:24 -0500)]
[clang][IFS] Fixing unsupported emulation mode on clang-ppc64be-linux bot.

I am in another pickle here where if I specify a triple, I get the wrong elf
target arch on the PPC bot (error from the PPC elf Linker). To avoid this I am
going to turn this test off on the PPC bots for now.

4 years agoRevert "Introduce llvm-install-name-tool"
Alexander Shaposhnikov [Wed, 20 Nov 2019 00:19:08 +0000 (16:19 -0800)]
Revert "Introduce llvm-install-name-tool"

This temporarily reverts the commit 88f00aef684ff84a6494e1f17d5466c5678f703d.
The change broke the buildbot http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/36836

4 years ago[Reproducer] Namespace the reproducer dump options.
Jonas Devlieghere [Wed, 20 Nov 2019 00:18:19 +0000 (16:18 -0800)]
[Reproducer] Namespace the reproducer dump options.

Make it clear that the current reproducer options are for dumping.

4 years ago[LegalizeDAG][X86] Enable STRICT_FP_TO_SINT/UINT to be promoted
Craig Topper [Wed, 20 Nov 2019 00:07:50 +0000 (16:07 -0800)]
[LegalizeDAG][X86] Enable STRICT_FP_TO_SINT/UINT to be promoted

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

4 years agoscudo: Switch from std::random_shuffle to std::shuffle in a test.
Peter Collingbourne [Tue, 19 Nov 2019 21:54:12 +0000 (13:54 -0800)]
scudo: Switch from std::random_shuffle to std::shuffle in a test.

This lets the test build with C++17.

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

4 years agoclang/Modules: Sink ASTReadResult in ReadControlBlock, NFC
Duncan P. N. Exon Smith [Tue, 19 Nov 2019 22:44:22 +0000 (14:44 -0800)]
clang/Modules: Sink ASTReadResult in ReadControlBlock, NFC

Simplify the code by avoiding some state that wasn't being used.  The
function-level `Result` was only assigned a value other than `Success`
in the handler for `OPTIONS_BLOCK_ID`, but in that case it also hits an
early return.  Remove it at the function-level to make it obvious that
the normal case always returns `Success`.

4 years ago[X86] Add custom type legalization and lowering for scalar STRICT_FP_TO_SINT/UINT
Craig Topper [Tue, 19 Nov 2019 23:51:19 +0000 (15:51 -0800)]
[X86] Add custom type legalization and lowering for scalar STRICT_FP_TO_SINT/UINT

This is a first pass at Custom lowering for these operations. I also updated some of the vector code where it was obviously easy and straightforward. More work needed in follow up.

This enables these operations to be handled with X87 where special rounding control adjustments are needed to perform a truncate.

Still need to fix Promotion in the target independent code in LegalizeDAG.
llrint/llround split into separate test file because we can't make a strict libcall properly yet either and we need to do that when i64 isn't a legal type.

This does not include any isel support. So we still rely on the mutation in SelectionDAGIsel to remove the strict from this stuff later. Except for the X87 stuff which goes through custom nodes that already had chains.

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

4 years ago[tests] Autogen a test to eliminate spurious diff from following patch
Philip Reames [Wed, 20 Nov 2019 00:01:43 +0000 (16:01 -0800)]
[tests] Autogen a test to eliminate spurious diff from following patch

4 years ago[ARC] Add InitializePasses header to fix ARC build.
Pete Couperus [Tue, 19 Nov 2019 23:48:24 +0000 (15:48 -0800)]
[ARC] Add InitializePasses header to fix ARC build.

4 years ago[clang][IFS] Attempting to fix missing 'orbis-ld' on scei-ps4-ubuntu bot.
Puyan Lotfi [Tue, 19 Nov 2019 23:32:31 +0000 (18:32 -0500)]
[clang][IFS] Attempting to fix missing 'orbis-ld' on scei-ps4-ubuntu bot.

I want this test to run end to end, but I am still having trouble with
missing linkers on the scei-ps4 bot. Will remove this test if it
continues to be a source of brittle failures. Sorry for the noise.

4 years ago[lldb][test] Prevent \n in calls to lldb's expect() test helper.
Jordan Rupprecht [Tue, 19 Nov 2019 23:06:35 +0000 (15:06 -0800)]
[lldb][test] Prevent \n in calls to lldb's expect() test helper.

Summary:
expect() forwards its command to sendline(). This can be problematic if the command already contains a newline: sendline() unconditionally adds a newline to the command, which causes the command to run twice (hitting enter in lldb runs the previous command). The expect() helper looks for the prompt and finds the first one, but because the command has run a second time, the buffer will contain the contents of the second time the command ran, causing potential erroneous matching.

Simplify the editline test, which was using different commands to workaround this misunderstanding.

Reviewers: labath

Reviewed By: labath

Subscribers: merge_guards_bot, lldb-commits

Tags: #lldb

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

4 years agoIntroduce llvm-install-name-tool
Alexander Shaposhnikov [Mon, 18 Nov 2019 23:44:58 +0000 (15:44 -0800)]
Introduce llvm-install-name-tool

This diff adds a new "driver" for llvm-objcopy
which is supposed to emulate the behavior of install-name-tool.
This is a recommit of b5913e6d2 with ubsan issues fixed.

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

Test plan: make check-all

4 years ago[GuardWidening] Remove WidenFrequentBranches transform
Philip Reames [Tue, 19 Nov 2019 23:14:41 +0000 (15:14 -0800)]
[GuardWidening] Remove WidenFrequentBranches transform

This code has never been enabled.  While it is tested, it's complicating some refactoring.  If we decide to re-implement this, doing it in SimplifyCFG would probably make more sense anyways.

4 years ago[clang][IFS] Fixing failing bots that do not have PPC target or "orbis-ld"
Puyan Lotfi [Tue, 19 Nov 2019 23:12:07 +0000 (18:12 -0500)]
[clang][IFS] Fixing failing bots that do not have PPC target or "orbis-ld"

4 years ago[clang][IFS] Driver Pipeline: generate stubs after standard pipeline (2)
Puyan Lotfi [Tue, 19 Nov 2019 08:07:47 +0000 (03:07 -0500)]
[clang][IFS] Driver Pipeline: generate stubs after standard pipeline (2)

Second Landing Attempt:

Up until now, clang interface stubs has replaced the standard
PP -> C -> BE -> ASM -> LNK pipeline. With this change, it will happen in
conjunction with it. So what when you build your code you will get an
a.out or lib.so as well as an interface stub file.

Example:

clang -shared -o libfoo.so -emit-interface-stubs ...

will generate both a libfoo.so and a libfoo.ifso. The .so file will
contain the code from the standard compilation pipeline and the .ifso
file will contain the ELF stub library.

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

4 years ago[NFC] Factor out utilities for manipulating widenable branches
Philip Reames [Tue, 19 Nov 2019 22:43:13 +0000 (14:43 -0800)]
[NFC] Factor out utilities for manipulating widenable branches

With the widenable condition construct, we have the ability to reason about branches which can be 'widened' (i.e. made to fail more often).  We've got a couple o transforms which leverage this.  This patch just cleans up the API a bit.

This is prep work for generalizing our definition of a widenable branch slightly.  At the moment "br i1 (and A, wc()), ..." is considered widenable, but oddly, neither "br i1 (and wc(), B), ..." or "br i1 wc(), ..." is.  That clearly needs addressed, so first, let's centralize the code in one place.

4 years ago[LoopPred] Generalize profitability check to handle unswitch output
Philip Reames [Tue, 19 Nov 2019 22:06:36 +0000 (14:06 -0800)]
[LoopPred] Generalize profitability check to handle unswitch output

Unswitch (and other loop transforms) like to generate loop exit blocks with unconditional successors, and phi nodes (LCSSA, or simple multiple exiting blocks sharing an exit).  Generalize the "likely very rare exit" check slightly to handle this form.

4 years ago[AArch64] Fix MIR test instruction to not have invalid operand.
Amara Emerson [Tue, 19 Nov 2019 21:38:55 +0000 (13:38 -0800)]
[AArch64] Fix MIR test instruction to not have invalid operand.

In anticipation of an improved verifier in D63973.

4 years ago[ValueTracking] Add a basic version of isKnownNonInfinity and use it to detect more...
Benjamin Kramer [Tue, 19 Nov 2019 18:12:45 +0000 (19:12 +0100)]
[ValueTracking] Add a basic version of isKnownNonInfinity and use it to detect more NoNaNs

4 years agoWrap C APIs with pragmas enforcing -Werror=strict-prototypes
Duncan P. N. Exon Smith [Thu, 14 Nov 2019 21:57:57 +0000 (13:57 -0800)]
Wrap C APIs with pragmas enforcing -Werror=strict-prototypes

Force `-Werror=strict-prototypes` so that C API tests fail to compile if
we add a non-prototype declaration.  This should help avoid regressions
like bddecba4b333f7772029b4937d2c34f9f2fda6ca was fixing.

https://reviews.llvm.org/D70285
rdar://problem/57203137

4 years agoPrecommit test showing oppurtunity when computing exit tests of unsimplified IR
Philip Reames [Tue, 19 Nov 2019 19:48:51 +0000 (11:48 -0800)]
Precommit test showing oppurtunity when computing exit tests of unsimplified IR

If we partially unswitch a loop, we leave around the (and i1 X, true) or (or i1 X, false) forms.  At the moment, this inhibits SCEVs ability to compute trip counts, patch forthcoming.

4 years ago[OPENMP50]Add if clause in simd directive.
Alexey Bataev [Tue, 19 Nov 2019 17:07:54 +0000 (12:07 -0500)]
[OPENMP50]Add if clause in simd directive.

According to OpenMP 5.0, if clause can be used in simd directive. If
condition in the if clause if false, the non-vectorized version of the
loop must be executed.

4 years ago[profile] Address unused function warnings on Windows after D69586
Vedant Kumar [Tue, 19 Nov 2019 20:51:10 +0000 (12:51 -0800)]
[profile] Address unused function warnings on Windows after D69586

This '#ifdef's out two functions which are unused on Windows, to prevent
-Wunused-function warnings.

4 years ago[CGDebugInfo] Emit subprograms for decls when AT_tail_call is understood (reland...
Vedant Kumar [Thu, 14 Nov 2019 02:19:32 +0000 (18:19 -0800)]
[CGDebugInfo] Emit subprograms for decls when AT_tail_call is understood (reland with fixes)

Currently, clang emits subprograms for declared functions when the
target debugger or DWARF standard is known to support entry values
(DW_OP_entry_value & the GNU equivalent).

Treat DW_AT_tail_call the same way to allow debuggers to follow cross-TU
tail calls.

Pre-patch debug session with a cross-TU tail call:

```
  * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
    frame #1: 0x0000000100000f99 main`main at a.c:8:10 [opt]
```

Post-patch (note that the tail-calling frame, "helper", is visible):

```
  * frame #0: 0x0000000100000fa4 main`target at b.c:4:3 [opt]
    frame #1: 0x0000000100000f80 main`helper [opt] [artificial]
    frame #2: 0x0000000100000f99 main`main at a.c:8:10 [opt]
```

This was reverted in 5b9a072c because it attached declaration
subprograms to inlinable builtin calls, which interacted badly with the
MergeICmps pass. The fix is to not attach declarations to builtins.

rdar://46577651

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

4 years ago[docs] Remove dangling parenthesis from documentation
Tim Northover [Tue, 19 Nov 2019 20:46:20 +0000 (20:46 +0000)]
[docs] Remove dangling parenthesis from documentation

Patch by leiteg.

4 years agoAdd a key method to Sema to optimize debug info size
Reid Kleckner [Fri, 15 Nov 2019 19:22:02 +0000 (11:22 -0800)]
Add a key method to Sema to optimize debug info size

It turns out that the debug info describing the Sema class is an
appreciable percentage of the total object file size of objects in Sema.
By adding a key function, clang is able to optimize the debug info size
by emitting a forward declaration in TUs that do not define the key
function.

On Windows, with clang-cl, these are the total sizes of object files in
Sema before and after this change, compiling with optimizations and
debug info:
  before: 335,012 KB
  after:  278,116 KB
  delta:  -56,896 KB
  percent: -17.0%

The effect on link time was negligible, despite having ~56MB less input.

On Linux, with clang, these are the same sizes using DWARF -g and
optimizations:
  before: 603,756 KB
  after:  515,340 KB
  delta:  -88,416 KB
  percent: -14.6%

I didn't use type units, DWARF-5, fission, or any other special flags.

Reviewed By: thakis

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

4 years ago[profile] Unbreak Fuchsia/Windows after D68351
Vedant Kumar [Tue, 19 Nov 2019 20:29:56 +0000 (12:29 -0800)]
[profile] Unbreak Fuchsia/Windows after D68351

Continuous mode is not yet supported on Fuchsia/Windows, however an
error should not be reported unless the user attempted to actually
enable continuous mode.

4 years agoThe patch is the compiler error specific on the compile error on CMVC
diggerlin [Tue, 19 Nov 2019 20:17:32 +0000 (15:17 -0500)]
The patch is the compiler error specific on the compile error on CMVC

SUMMARY:

CMVC has a compiler error on the
const uint64_t OffsetToRaw = is64Bit()
                                   ? toSection64(Sec)->FileOffsetToRawData
                                   : toSection32(Sec)->FileOffsetToRawData;

while  gcc  compiler do not have the problem.
I have to change the code to

  uint64_t OffsetToRaw;
  if (is64Bit())
    OffsetToRaw = toSection64(Sec)->FileOffsetToRawData;
  else
    OffsetToRaw = toSection32(Sec)->FileOffsetToRawData;

Reviewers: Sean Fertile
Subscribers: rupprecht, seiyai,hiraditya

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

4 years agofixe leak found by asan build bot
Tyker [Tue, 19 Nov 2019 20:05:30 +0000 (21:05 +0100)]
fixe leak found by asan build bot

4 years ago[DebugInfo] Describe size of spilled values in call site params
Vedant Kumar [Tue, 19 Nov 2019 19:58:14 +0000 (11:58 -0800)]
[DebugInfo] Describe size of spilled values in call site params

A call site parameter description of a memory operand needs to
unambiguously convey the size of the operand to prevent incorrect entry
value evaluation.

Thanks for David Stenberg for pointing this issue out!

4 years agollvm/ObjCARC: Eliminate inlined AutoreleaseRV calls
Duncan P. N. Exon Smith [Mon, 18 Nov 2019 01:58:01 +0000 (17:58 -0800)]
llvm/ObjCARC: Eliminate inlined AutoreleaseRV calls

Pair up inlined AutoreleaseRV calls with their matching RetainRV or
ClaimRV.

- RetainRV cancels out AutoreleaseRV.  Delete both instructions.
- ClaimRV is a peephole for RetainRV+Release.  Delete AutoreleaseRV and
  replace ClaimRV with Release.

This avoids problems where more aggressive inlining triggers memory
regressions.

This patch is happy to skip over non-callable instructions and non-ARC
intrinsics looking for the pair.  It is likely sound to also skip over
opaque function calls, but that's harder to reason about, and it's not
relevant to the goal here: if there's an opaque function call splitting
up a pair, it's very unlikely that a handshake would have happened
dynamically without inlining.

Note that this patch also subsumes the previous logic that looked
backwards from ReleaseRV.

https://reviews.llvm.org/D70370
rdar://problem/46509586

4 years ago[SLP] fix miscompile on min/max reductions with extra uses (PR43948) (2nd try)
Sanjay Patel [Tue, 19 Nov 2019 17:24:55 +0000 (12:24 -0500)]
[SLP] fix miscompile on min/max reductions with extra uses (PR43948) (2nd try)

The 1st attempt was reverted because it revealed an existing
bug where we could produce invalid IR (use of value before
definition). That should be fixed with:
rG39de82ecc9c2

The bug manifests as replacing a reduction operand with an undef
value.

The problem appears to be limited to cases where a min/max reduction
has extra uses of the compare operand to the select.

In the general case, we are tracking "ExternallyUsedValues" and
an "IgnoreList" of the reduction operations, but those may not apply
to the final compare+select in a min/max reduction.

For that, we use replaceAllUsesWith (RAUW) to ensure that the new
vectorized reduction values are transferred to all subsequent users.

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

4 years ago[nfc][libomptarget] Remove casts of string literals to char*
JonChesterfield [Tue, 19 Nov 2019 19:41:59 +0000 (19:41 +0000)]
[nfc][libomptarget] Remove casts of string literals to char*

4 years agoMTE: add more unchecked instructions.
Evgenii Stepanov [Fri, 15 Nov 2019 21:29:54 +0000 (13:29 -0800)]
MTE: add more unchecked instructions.

Summary:
In particular, 1- and 2-byte loads and stores ignore the pointer tag
when using SP as the base register.

Reviewers: pcc, ostannard

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agotest-release.sh: Update to fetch source from GitHub
Tom Stellard [Tue, 19 Nov 2019 18:42:56 +0000 (10:42 -0800)]
test-release.sh: Update to fetch source from GitHub

Summary:
This also changes the test-release.sh script to build using the monorepo
layout instead of copying sub-projects into llvm/tools or llvm/projects.

Reviewers: jdoerfert, hans

Reviewed By: hans

Subscribers: hans, llvm-commits

Tags: #llvm

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

4 years ago[ADT][Expensive checks] Create a std::random_device seed only once when shuffling...
Alex Lorenz [Tue, 19 Nov 2019 19:07:55 +0000 (11:07 -0800)]
[ADT][Expensive checks] Create a std::random_device seed only once when shuffling before sorting

This speeds up the build of compiler-rt with an expensive checks enabled clang by an order of
1 or 2 magnitudes on my machine. I was hoping this would also fix the 'large.test' libFuzzer
timeout on the expensive checks bot on green dragon http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/,
but the fuzzer test still takes too long to compile because of other IR/MIR verification inefficiencies.

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

4 years agoAdd a "Using LLDB" section to the welcome page of the website
Adrian Prantl [Tue, 19 Nov 2019 16:53:15 +0000 (08:53 -0800)]
Add a "Using LLDB" section to the welcome page of the website

This is an attempt to feature the user-facing resources more
prominently on the LLDB website by calling out the tutorial and the
GDB command map wight on the start page.

I also moved the "Why a new debugger" section to the "Goals"
subpage. Given that LLDB's first release is almost a decade in the
past now, the title is a bit of an anachronism.

Lastly, I moved the Architecture sub-page from "use" to "resources",
since end-users do not care about the source code layout.

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

4 years ago[ARM] MVE interleaving load and stores.
David Green [Tue, 19 Nov 2019 18:37:21 +0000 (18:37 +0000)]
[ARM] MVE interleaving load and stores.

Now that we have the intrinsics, we can add VLD2/4 and VST2/4 lowering
for MVE. This works the same way as Neon, recognising the load/shuffles
combination and converting them into intrinsics in a pre-isel pass,
which just calls getMaxSupportedInterleaveFactor, lowerInterleavedLoad
and lowerInterleavedStore.

The main difference to Neon is that we do not have a VLD3 instruction.
Otherwise most of the code works very similarly, with just some minor
differences in the form of the intrinsics to work around. VLD3 is
disabled by making isLegalInterleavedAccessType return false for those
cases.

We may need some other future adjustments, such as VLD4 take up half the
available registers so should maybe cost more. This patch should get the
basics in though.

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

4 years ago[ARM] Add and update a lot of VLDn tests. NFC
David Green [Tue, 19 Nov 2019 18:17:46 +0000 (18:17 +0000)]
[ARM] Add and update a lot of VLDn tests. NFC

4 years agoimplement printing out raw section data of xcoff objectfile for llvm-objdump
diggerlin [Tue, 19 Nov 2019 18:29:09 +0000 (13:29 -0500)]
implement printing out raw section data of xcoff objectfile for llvm-objdump

SUMMARY:
implement printing out raw section data of xcoff objectfile for llvm-objdump
and option -D --disassemble-all option for llvm-objdump

Reviewers: Sean Fertile
Subscribers: rupprecht, seiyai,hiraditya

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

4 years ago[C-index] Fix test when using Debug target & MSVC STL
Alexandre Ganea [Tue, 19 Nov 2019 18:30:14 +0000 (13:30 -0500)]
[C-index] Fix test when using Debug target & MSVC STL

Avoids a deadlock in "clang/test/Index/crash-recovery-modules.m" when building with the MSVC STL & _ITERATOR_DEBUG_LEVEL == 2 (meaning a DEBUG build)

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

4 years ago[LLDB] Fix formatting in the driver (NFC)
Jonas Devlieghere [Tue, 19 Nov 2019 18:23:35 +0000 (10:23 -0800)]
[LLDB] Fix formatting in the driver (NFC)

4 years ago[Symbolizers] On Darwin compute function offset when possible.
Dan Liew [Tue, 29 Oct 2019 06:04:27 +0000 (23:04 -0700)]
[Symbolizers] On Darwin compute function offset when possible.

Summary:
The sanitizer symbolizers support printing the function offset
(difference between pc and function start) of a stackframe using the
`%q` format specifier.

Unfortunately this didn't actually work because neither the atos
or dladdr symbolizer set the `AddressInfo::function_offset` field.

This patch teaches both symbolizers to try to compute the function
offset. In the case of the atos symbolizer, atos might not report the
function offset (e.g. it reports a source location instead) so in this
case it fallsback to using `dladdr()` to compute the function offset.

Two test cases are included.

rdar://problem/56695185

Reviewers: kubamracek, yln

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years agoclang: Add -fconvergent-functions flag
Matt Arsenault [Sun, 27 Oct 2019 00:15:10 +0000 (17:15 -0700)]
clang: Add -fconvergent-functions flag

The CUDA builtin library is apparently compiled in C++ mode, so the
assumption of convergent needs to be made in a typically non-SPMD
language. The functions in the library should still be assumed
convergent. Currently they are not, which is potentially incorrect and
this happens to work after the library is linked.

4 years ago[ELF] Disallow out-of-range section group indices after D70146
Fangrui Song [Tue, 19 Nov 2019 17:47:17 +0000 (09:47 -0800)]
[ELF] Disallow out-of-range section group indices after D70146

Exposed by invalid/sht-group-wrong-section.test
http://45.33.8.238/win/2613/step_9.txt

4 years ago[OPENMP]Rename function, NFC.
Alexey Bataev [Tue, 19 Nov 2019 17:12:23 +0000 (12:12 -0500)]
[OPENMP]Rename function, NFC.

Change the name of the CGOpenMPRuntime::emitOMPIfClause to CGOpenMPRuntime::emitIfClause.

4 years ago[nfc][libomptarget] Write amdgcn macros in terms of compiler intrinsics
JonChesterfield [Tue, 19 Nov 2019 17:23:46 +0000 (17:23 +0000)]
[nfc][libomptarget] Write amdgcn macros in terms of compiler intrinsics

4 years ago[NFC] Refactor representation of materialized temporaries
Tyker [Sun, 17 Nov 2019 10:41:55 +0000 (11:41 +0100)]
[NFC] Refactor representation of materialized temporaries

Summary:
this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718

Reviewers: rsmith, martong, shafik

Reviewed By: rsmith

Subscribers: thakis, sammccall, ilya-biryukov, rnkovacs, arphaman, cfe-commits

Tags: #clang

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

4 years ago[libTooling] Extend `buildASTFromCodeWithArgs` to take files argument.
Yitzhak Mandelbaum [Wed, 13 Nov 2019 14:04:13 +0000 (09:04 -0500)]
[libTooling] Extend `buildASTFromCodeWithArgs` to take files argument.

Summary:
Adds an optional parameter to `buildASTFromCodeWithArgs` that allows the user to
pass additional files that the main code needs to compile. This change makes
`buildASTFromCodeWithArgs` consistent with `runToolOnCodeWithArgs`.

Patch by Alexey Eremin.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[FileCheck] Use lit's internal shell for the test suite
Joel E. Denny [Tue, 19 Nov 2019 15:54:21 +0000 (10:54 -0500)]
[FileCheck] Use lit's internal shell for the test suite

An advantage is that there are less portability concerns when writing
tests.  For example, `-u` is not supported by all implementations of
`env`, but lit's internal shell provides its own `env` that supports
`-u`.

A disadvantage is that some shell constructs, such as parentheses, are
not supported, but FileCheck's test suite currently doesn't require
such constructs.

For comparison, lit configures its test suite in the same manner.  See
`llvm/utils/lit/tests/lit.cfg`.

Reviewed By: rnk

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

4 years ago[ELF] Improve --gc-sections compatibility with GNU ld regarding section groups
Fangrui Song [Tue, 19 Nov 2019 05:56:58 +0000 (21:56 -0800)]
[ELF] Improve --gc-sections compatibility with GNU ld regarding section groups

Based on D70020 by serge-sans-paille.

The ELF spec says:

> Furthermore, there may be internal references among these sections that would not make sense if one of the sections were removed or replaced by a duplicate from another object. Therefore, such groups must be included or omitted from the linked object as a unit. A section cannot be a member of more than one group.

GNU ld has 2 behaviors that we don't have:

- Group members (nextInSectionGroup != nullptr) are subject to garbage collection.
  This includes non-SHF_ALLOC SHT_NOTE sections.
  In particular, discarding non-SHF_ALLOC SHT_NOTE sections is an expected behavior by the Annobin
  project. See
  https://developers.redhat.com/blog/2018/02/20/annobin-storing-information-binaries/
  for more information.
- Groups members are retained or discarded as a unit.
  Members may have internal references that are not expressed as
  SHF_LINK_ORDER, relocations, etc. It seems that we should be more conservative here:
  if a section is marked live, mark all the other member within the
  group.

Both behaviors are reasonable. This patch implements them.

A new field InputSectionBase::nextInSectionGroup tracks the next member
within a group. on ELF64, this increases sizeof(InputSectionBase) froms
144 to 152.

InputSectionBase::dependentSections tracks section dependencies, which
is used by both --gc-sections and /DISCARD/. We can't overload it for
the "next member" semantic, because we should allow /DISCARD/ to discard
sections independent of --gc-sections (GNU ld behavior). This behavior
may be reasonably used by `/DISCARD/ : { *(.ARM.exidx*) }` or `/DISCARD/
: { *(.note*) }` (new test `linkerscript/discard-group.s`).

Reviewed By: ruiu

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

4 years agoFix openmp on PowerPC64-BE-ELFv2 ABI on FreeBSD.
AndreyChurbanov [Tue, 19 Nov 2019 16:45:06 +0000 (19:45 +0300)]
Fix openmp on PowerPC64-BE-ELFv2 ABI on FreeBSD.

Patch by adalava (Alfredo Dal'Ava J.nior)

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

4 years ago[NFC] Attempting to fix sphinx build failure with badly encoded characters from incom...
Mitchell Balan [Tue, 19 Nov 2019 16:39:13 +0000 (11:39 -0500)]
[NFC] Attempting to fix sphinx build failure with badly encoded characters from incoming patch.

4 years agogn build: Merge 7fe9435dc88
LLVM GN Syncbot [Tue, 19 Nov 2019 16:34:22 +0000 (16:34 +0000)]
gn build: Merge 7fe9435dc88

4 years agoWork on cleaning up denormal mode handling
Matt Arsenault [Tue, 29 Oct 2019 23:16:05 +0000 (16:16 -0700)]
Work on cleaning up denormal mode handling

Cleanup handling of the denormal-fp-math attribute. Consolidate places
checking the allowed names in one place.

This is in preparation for introducing FP type specific variants of
the denormal-fp-mode attribute. AMDGPU will switch to using this in
place of the current hacky use of subtarget features for the denormal
mode.

Introduce a new header for dealing with FP modes. The constrained
intrinsic classes define related enums that should also be moved into
this header for uses in other contexts.

The verifier could use a check to make sure the denorm-fp-mode
attribute is sane, but there currently isn't one.

Currently, DAGCombiner incorrectly asssumes non-IEEE behavior by
default in the one current user. Clang must be taught to start
emitting this attribute by default to avoid regressions when this is
switched to assume ieee behavior if the attribute isn't present.

4 years ago[cmake] Disable GCC 9's -Winit-list-lifetime warning in ArrayRef
Pavel Labath [Tue, 12 Nov 2019 14:19:21 +0000 (15:19 +0100)]
[cmake] Disable GCC 9's -Winit-list-lifetime warning in ArrayRef

Summary:
This is a new warning which fires when one stores a reference to the
initializer_list contents in a way which may outlive the
initializer_list which it came from. In llvm this warning is triggered
whenever someone uses the initializer_list ArrayRef constructor.

This is indeed a dangerous thing to do (I myself was bitten by that at
least once), but it is not more dangerous than calling other ArrayRef
constructors with temporary objects -- something which we are used to
and have accepted as a tradeoff for ArrayRef's efficiency.

Currently, this warnings generates so much output that it completely
obscures any actionable warnings, so this patch disables it.

Reviewers: rnk, aaron.ballman

Subscribers: mgorny, llvm-commits

Tags: #llvm

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