platform/upstream/llvm.git
4 years agoFix lldb build failure due to clang mangler change
Yaxun (Sam) Liu [Sun, 8 Mar 2020 05:38:30 +0000 (00:38 -0500)]
Fix lldb build failure due to clang mangler change

4 years ago[NFC] Let mangler accept GlobalDecl
Yaxun (Sam) Liu [Thu, 5 Mar 2020 17:02:13 +0000 (12:02 -0500)]
[NFC] Let mangler accept GlobalDecl

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

4 years ago[libc] [NFC] Use matchers in tests
Alex Brachet [Sun, 8 Mar 2020 03:56:03 +0000 (22:56 -0500)]
[libc] [NFC] Use matchers in tests

Summary:
Use `EXPECT_THAT` where possible in tests NFC intended.

Added a `void *` template instantiation of `StreamWrapper::operator<<`

Reviewers: sivachandra, PaulkaToast

Reviewed By: sivachandra

Subscribers: MaskRay, tschuett, libc-commits

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

4 years ago[Sema] Add -Wpointer-to-enum-cast and -Wvoid-pointer-to-enum-cast
Nathan Chancellor [Sun, 8 Mar 2020 00:37:44 +0000 (16:37 -0800)]
[Sema] Add -Wpointer-to-enum-cast and -Wvoid-pointer-to-enum-cast

GCC does not warn on casts from pointers to enumerators, while clang
currently does: https://godbolt.org/z/3DFDVG

This causes a bunch of extra warnings in the Linux kernel, where
certain structs contain a void pointer to avoid using a gigantic
union for all of the various types of driver data, such as
versions.

Add a diagnostic that allows certain projects like the kernel to
disable the warning just for enums, which allows those projects to
keep full compatibility with GCC but keeps the intention of treating
casts to integers and enumerators the same by default so that other
projects have the opportunity to catch issues not noticed before (or
follow suite and disable the warning).

Link: https://github.com/ClangBuiltLinux/linux/issues/887
Reviewed By: rjmccall

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

4 years ago[X86] Add DAG combine to replace vXi64 vzext_movl+scalar_to_vector with vYi32 vzext_m...
Craig Topper [Sun, 8 Mar 2020 00:14:26 +0000 (16:14 -0800)]
[X86] Add DAG combine to replace vXi64 vzext_movl+scalar_to_vector with vYi32 vzext_movl+scalar_to_vector if the upper 32 bits of the scalar are zero.

We can just use a 32-bit copy and zero in the SSE domain when we
zero the upper bits.

Remove an isel pattern that becomes dead with this.

4 years ago[X86] Add DAG combines to enable removing of movddup/vbroadcast + simple_load isel...
Craig Topper [Sat, 7 Mar 2020 22:39:53 +0000 (14:39 -0800)]
[X86] Add DAG combines to enable removing of movddup/vbroadcast + simple_load isel patterns.

4 years ago[X86] Add a DAG combine to turn vbroadcast(vzload X) -> vbroadcast_load
Craig Topper [Sat, 7 Mar 2020 19:33:10 +0000 (11:33 -0800)]
[X86] Add a DAG combine to turn vbroadcast(vzload X) -> vbroadcast_load

Remove now unneeded isel patterns.

4 years ago[Index/USRGeneration] Make sure that ObjC properties in categories also get namescope...
Argyrios Kyrtzidis [Sat, 7 Mar 2020 23:04:23 +0000 (15:04 -0800)]
[Index/USRGeneration] Make sure that ObjC properties in categories also get namescoped properly for USR generation

If the property is in a category that has module names from external_declaration property, make sure they are included in the USR.

rdar://59897320

4 years ago[NFC][Test commit] Remove redundant point in docs
kpdev [Sat, 7 Mar 2020 07:30:42 +0000 (10:30 +0300)]
[NFC][Test commit] Remove redundant point in docs

4 years ago[Sema] Initialize IsSurrogate
Rafael Ávila de Espíndola [Sat, 7 Mar 2020 18:52:51 +0000 (10:52 -0800)]
[Sema] Initialize IsSurrogate

This fixes https://bugs.llvm.org/show_bug.cgi?id=45096

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

4 years ago[SYCL] Driver option to select SYCL version
Ruyman [Fri, 26 Jul 2019 15:21:01 +0000 (16:21 +0100)]
[SYCL] Driver option to select SYCL version

Summary:
User can select the version of SYCL the compiler will
use via the flag -sycl-std, similar to -cl-std.

The flag defines the LangOpts.SYCLVersion option to the
version of SYCL. The default value is undefined.
If driver is building SYCL code, flag is set to the default SYCL
version (1.2.1)

The preprocessor uses this variable to define CL_SYCL_LANGUAGE_VERSION macro,
which should be defined according to SYCL 1.2.1 standard.

Only valid value at this point for the flag is 1.2.1.

Co-Authored-By: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
Signed-off-by: Ruyman Reyes <ruyman@codeplay.com>
Subscribers: ebevhan, Anastasia, cfe-commits

Tags: #clang

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

4 years ago[X86] Use MVT instead of EVT in a couple shuffle lowering functions.
Craig Topper [Sat, 7 Mar 2020 06:29:34 +0000 (22:29 -0800)]
[X86] Use MVT instead of EVT in a couple shuffle lowering functions.

4 years agoFix MLIR clang-tidy: when tweaking it does not inherit from the parent
Mehdi Amini [Sat, 7 Mar 2020 17:43:10 +0000 (17:43 +0000)]
Fix MLIR clang-tidy: when tweaking it does not inherit from the parent

It is almost identical to the top-level .clang-tidy, except that
{Member,Parameter,Variable}Case use camelBack.

4 years ago[lldb] Un-XFAIL two tests on NetBSD
Michał Górny [Sat, 7 Mar 2020 17:35:22 +0000 (18:35 +0100)]
[lldb] Un-XFAIL two tests on NetBSD

4 years ago[InstCombine] Fix known bits handling in SimplifyDemandedUseBits
Nikita Popov [Sat, 7 Mar 2020 11:18:05 +0000 (12:18 +0100)]
[InstCombine] Fix known bits handling in SimplifyDemandedUseBits

Fixes a regression from D75801. SimplifyDemandedUseBits() is also
supposed to compute the known bits (of the demanded subset) of the
instruction. For unknown instructions it does so by directly calling
computeKnownBits(). For known instructions it will compute known
bits itself. However, for instructions where only some cases are
handled directly (e.g. a constant shift amount) the known bits
invocation for the unhandled case is sometimes missing. This patch
adds the missing calls and thus removes the main discrepancy with
ExpensiveCombines mode.

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

4 years agoAssume ieee behavior without denormal-fp-math attribute
Matt Arsenault [Wed, 6 Nov 2019 18:26:43 +0000 (10:26 -0800)]
Assume ieee behavior without denormal-fp-math attribute

4 years ago[InstCombine] Regenerate test checks; NFC
Nikita Popov [Sat, 7 Mar 2020 16:18:39 +0000 (17:18 +0100)]
[InstCombine] Regenerate test checks; NFC

4 years ago[InstSimplify] Add tests for "returned" attribute; NFC
Nikita Popov [Sat, 7 Mar 2020 15:25:33 +0000 (16:25 +0100)]
[InstSimplify] Add tests for "returned" attribute; NFC

4 years ago[InstCombine] Add additional known bits folding tests; NFC
Nikita Popov [Sat, 7 Mar 2020 11:59:16 +0000 (12:59 +0100)]
[InstCombine] Add additional known bits folding tests; NFC

4 years ago[InstCombine] Highlight tests using expensive combines; NFC
Nikita Popov [Sat, 7 Mar 2020 09:56:29 +0000 (10:56 +0100)]
[InstCombine] Highlight tests using expensive combines; NFC

4 years ago[InstCombine] regenerate complete test checks; NFC
Sanjay Patel [Sat, 7 Mar 2020 15:20:38 +0000 (10:20 -0500)]
[InstCombine] regenerate complete test checks; NFC

4 years ago[InstCombine] add test for gep (select),... (PR45084); NFC
Sanjay Patel [Sat, 7 Mar 2020 15:00:31 +0000 (10:00 -0500)]
[InstCombine] add test for gep (select),... (PR45084); NFC

4 years ago[DebugInfo]: Added DWARFv5 macro header flags and corresponding helper
Sourabh Singh Tomar [Sat, 7 Mar 2020 12:20:07 +0000 (17:50 +0530)]
[DebugInfo]: Added DWARFv5 macro header flags and corresponding helper
functions.

4 years ago[Attributor] Fold terminators before changing instructions to unreachable
Stefanos Baziotis [Sat, 7 Mar 2020 10:38:44 +0000 (12:38 +0200)]
[Attributor] Fold terminators before changing instructions to unreachable

It is possible that an instruction to be changed to unreachable is
in the same block with a terminator that can be constant-folded.
In this case, as of now, the instruction will be changed to
unreachable before the terminator is folded. But, then the
whole BB becomes invalidated and so when we go ahead to fold
the terminator, we trap.

Change the order of these two.

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

4 years ago[mlir] Change EffectKind in unsigned for bitfield to avoid miscompile in
River Riddle [Sat, 7 Mar 2020 07:01:49 +0000 (23:01 -0800)]
[mlir] Change EffectKind in unsigned for bitfield to avoid miscompile in
MSVC

MSVC has problems if the type of the bitfield is different, leading to
invalid code generation.

4 years ago[mlir][nfc] Fix building mlir_c_runner_utils for Windows
Mason Remy [Sat, 7 Mar 2020 06:42:38 +0000 (22:42 -0800)]
[mlir][nfc] Fix building mlir_c_runner_utils for Windows

Summary:
On Windows, building `mlir_c_runner_utils` doesn't properly export
symbols, thus resulting in an implib not being created, which causes
an error when consuming LLVM from external projects.

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

4 years ago[mlir][NFC] remove stray decl of toAffineExpr, rename for readability
Uday Bondhugula [Sat, 7 Mar 2020 06:36:28 +0000 (22:36 -0800)]
[mlir][NFC] remove stray decl of toAffineExpr, rename for readability

Summary:
- remove stray toAffineExpr decl in affine analysis (name duplicate of
  mlir::toAffineExpr)

- rename mlir::toAffineExpr for better readability

- related NFC changes

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D75694

4 years agoRevert "Revert "[GlobalISel][Localizer] Enable intra-block localization of already...
Amara Emerson [Thu, 5 Mar 2020 19:57:45 +0000 (11:57 -0800)]
Revert "Revert "[GlobalISel][Localizer] Enable intra-block localization of already-local uses.""

This reverts commit 5583c2f2fba5be1df60f00cbc34a5098b5a49909.

The lldb bot failure was a test that was fragile and sensitive to irrelevant
changes in instruction ordering. Re-committing this as the test should have
been skipped for AArch64 now.

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

4 years agoAdd the CodeReview Documentation to GettingInvolved TOC
Hal Finkel [Sat, 7 Mar 2020 04:55:46 +0000 (04:55 +0000)]
Add the CodeReview Documentation to GettingInvolved TOC

4 years agoHigh-Level Code-Review Documentation Update
Hal Finkel [Thu, 26 Dec 2019 21:56:26 +0000 (21:56 +0000)]
High-Level Code-Review Documentation Update

This is an update to the documentation of our community code-review process.
Based on the RFC: High-Level Code-Review Documentation Update
(http://lists.llvm.org/pipermail/llvm-dev/2019-November/136808.html).

In this patch, I've pulled out the documentation into a separate file, and
broken it into a number of subsections. This is, of course, just one further
step in better documenting our community processes. I expect we'll continue to
improve this over time. Thank you to everyone who provided feedback!

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

4 years ago[mlir] Explicitly qualify Effect to avoid MSVC build failure
River Riddle [Sat, 7 Mar 2020 03:18:13 +0000 (19:18 -0800)]
[mlir] Explicitly qualify Effect to avoid MSVC build failure

MSVC qualifies the Effect reference contextually depending on where the
template is instantiated, leading to compiler failures if there is a
different Effect class defined.

4 years ago[gn build] copy compiler-rt headers to clang include dir on all platforms
Nico Weber [Sat, 7 Mar 2020 02:55:45 +0000 (21:55 -0500)]
[gn build] copy compiler-rt headers to clang include dir on all platforms

4 years ago[lldb][NFC] Make TestStats.py not an inline test
Raphael Isemann [Sat, 7 Mar 2020 02:42:20 +0000 (18:42 -0800)]
[lldb][NFC] Make TestStats.py not an inline test

There is still the bug that empty lines seem to skip any following expressions
and it makes it harder to commend between all the comments. Let's make this
a normal test instead which is just slightly more verbose but can be properly
formatted.

4 years ago[lldb][NFC] Refactor our option generation out of EvaluateExpression
Raphael Isemann [Sat, 7 Mar 2020 02:27:46 +0000 (18:27 -0800)]
[lldb][NFC] Refactor our option generation out of EvaluateExpression

4 years agoFix a copy and paste error that would cause a crash.
Greg Clayton [Fri, 6 Mar 2020 22:59:41 +0000 (14:59 -0800)]
Fix a copy and paste error that would cause a crash.

Summary: The wrong variable was being checked for an error, which mean a llvm::Error went unchecked and crashes dsymutil. Discovered this when trying to feed an ELF file to "dsymutil --update" and running into the crash.

Reviewers: aprantl, JDevlieghere

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[clang-doc] Improving Markdown Output
Petr Hosek [Sat, 7 Mar 2020 01:33:56 +0000 (17:33 -0800)]
[clang-doc] Improving Markdown Output

This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.

The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.

Patch By: Clayton

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

4 years ago[lldb] Never compile the debugserver with Clang module flags
Raphael Isemann [Sat, 7 Mar 2020 01:24:56 +0000 (17:24 -0800)]
[lldb] Never compile the debugserver with Clang module flags

Summary:
Compiling ObjC++ with Clang modules is usually not working well and compiling
the small debugserver with modules is not worth the trouble.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[lldb][cmake] Move remove_module_flags macro to AddLLDB.cmake
Raphael Isemann [Sat, 7 Mar 2020 01:07:23 +0000 (17:07 -0800)]
[lldb][cmake] Move remove_module_flags macro to AddLLDB.cmake

Summary: This is currently hidden in the Host CMakeLists but we should also use this macro in other parts of LLDB where we have ObjC++ sources (see D74891)

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

4 years agotab completion for process signal
Raphael Isemann [Fri, 6 Mar 2020 23:49:23 +0000 (15:49 -0800)]
tab completion for process signal

Summary: Provide a list of Unix signals for the tap completion for command "process signal".

Reviewers: teemperor

Subscribers: labath, jingham, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[CodeGen][ObjC] Extend lifetime of ObjC pointers passed to calls to
Akira Hatanaka [Tue, 11 Feb 2020 21:09:18 +0000 (13:09 -0800)]
[CodeGen][ObjC] Extend lifetime of ObjC pointers passed to calls to
__builtin_os_log_format

This is needed to keep all the objects, including temporaries returned
by function calls, written to the buffer alive until os_log_pack_send is
called.

rdar://problem/60105410

4 years ago[MLIR] Add document about creating a dialect.
Stephen Neuendorffer [Fri, 6 Mar 2020 19:26:56 +0000 (11:26 -0800)]
[MLIR] Add document about creating a dialect.

Goal is also to document best naming practices from here:
https://llvm.discourse.group/t/rfc-canonical-file-paths-to-dialects/621

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

4 years ago[lldb][NFC] Refactor TestSafeFuncCalls.py
Raphael Isemann [Fri, 6 Mar 2020 19:21:54 +0000 (11:21 -0800)]
[lldb][NFC] Refactor TestSafeFuncCalls.py

Summary:
This patch inlines all the single-line functions that we only use once in the test
and replaces the assertTrue with an assertEquals to improve the error message
when this test fails.

Reviewers: JDevlieghere

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[MLIR] Add missing DEPENDS line for MLIRSPIRV
Stephen Neuendorffer [Fri, 6 Mar 2020 23:10:14 +0000 (15:10 -0800)]
[MLIR] Add missing DEPENDS line for MLIRSPIRV

This line was inadvertantly left off, which results in missing dependencies
and a potentially broken build

4 years agoExtend TimeTrace to LLVM's new pass manager
Andrew Monshizadeh [Fri, 6 Mar 2020 22:16:19 +0000 (14:16 -0800)]
Extend TimeTrace to LLVM's new pass manager

With the addition of the LLD time tracing it made sense to include coverage
for LLVM's various passes. Doing so ensures that ThinLTO is also covered
with a time trace.

Before:
{F11333974}

After:
{F11333928}

Reviewed By: rnk

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

4 years agoRefactor TimeProfiler write methods (NFC)
Andrew Monshizadeh [Fri, 6 Mar 2020 22:16:17 +0000 (14:16 -0800)]
Refactor TimeProfiler write methods (NFC)

Added a write method for TimeTrace that takes two strings representing
file names. The first is any file name that may have been provided by the
user via `time-trace-file` flag, and the second is a fallback that should
be configured by the caller. This method makes it cleaner to write the
trace output because there is no longer a need to check file names at the
caller and simplifies future TimeTrace usages.

Reviewed By: modocache

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

4 years ago[WebAssembly] Add SIMD integer min/max builtins
Thomas Lively [Fri, 6 Mar 2020 21:00:16 +0000 (13:00 -0800)]
[WebAssembly] Add SIMD integer min/max builtins

Summary:
Although SIMD integer min/max operations can be expressed using the ?:
operator in C++, that operator is disallowed for vectors in C. As a
workaround, this change introduces new WebAssembly-specific builtin
functions that lower to the desired vector icmp/select sequences.

Reviewers: aheejin, dschuff, kripken

Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

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

4 years ago[mlir][SideEffects] Enable specifying side effects directly on the arguments/results...
River Riddle [Fri, 6 Mar 2020 21:55:36 +0000 (13:55 -0800)]
[mlir][SideEffects] Enable specifying side effects directly on the arguments/results of an operation.

Summary:
New classes are added to ODS to enable specifying additional information on the arguments and results of an operation. These classes, `Arg` and `Res` allow for adding a description and a set of 'decorators' along with the constraint. This enables specifying the side effects of an operation directly on the arguments and results themselves.

Example:
```
def LoadOp : Std_Op<"load"> {
  let arguments = (ins Arg<AnyMemRef, "the MemRef to load from",
                           [MemRead]>:$memref,
                       Variadic<Index>:$indices);
}
```

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

4 years ago[mlir][SideEffects] Define a set of interfaces and traits for defining side effects
River Riddle [Fri, 6 Mar 2020 21:53:16 +0000 (13:53 -0800)]
[mlir][SideEffects] Define a set of interfaces and traits for defining side effects

This revision introduces the infrastructure for defining side-effects and attaching them to operations. This infrastructure allows for defining different types of side effects, that don't interact with each other, but use the same internal mechanisms. At the base of this is an interface that allows operations to specify the different effect instances that are exhibited by a specific operation instance. An effect instance is comprised of the following:

* Effect: The specific effect being applied.
  For memory related effects this may be reading from memory, storing to memory, etc.

* Value: A specific value, either operand/result/region argument, the effect pertains to.

* Resource: This is a global entity that represents the domain within which the effect is being applied.

MLIR serves many different abstractions, which cover many different domains. Simple effects are may have very different context, for example writing to an in-memory buffer vs a database. This revision defines uses this infrastructure to define a set of initial MemoryEffects. The are effects that generally correspond to memory of some kind; Allocate, Free, Read, Write.

This set of memory effects will be used in follow revisions to generalize various parts of the compiler, and make others more powerful(e.g. DCE).

This infrastructure was originally proposed here:
https://groups.google.com/a/tensorflow.org/g/mlir/c/v2mNl4vFCUM

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

4 years ago[ELF][test] Improve MEMORY tests
Fangrui Song [Fri, 6 Mar 2020 20:53:24 +0000 (12:53 -0800)]
[ELF][test] Improve MEMORY tests

4 years agoCorrect the Bjarne Stroustrup's C++ Page link
Shivam Gupta [Fri, 6 Mar 2020 21:52:22 +0000 (16:52 -0500)]
Correct the Bjarne Stroustrup's C++ Page link

Summary: Bjarne Stroustrup's C++ Page link pointing to wrong AT&T page.

Reviewers: jyknight, sanjoy, silvas, hubert.reinterpretcast

Reviewed By: hubert.reinterpretcast

Subscribers: hubert.reinterpretcast, llvm-commits

Tags: #llvm

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

4 years ago[clang][Headers] Use __has_builtin instead of _MSC_VER.
Michael Spencer [Fri, 6 Mar 2020 01:56:13 +0000 (17:56 -0800)]
[clang][Headers] Use __has_builtin instead of _MSC_VER.

arm_acle.h relied on `_MSC_VER` to determine if a given function was
already defined as a builtin. This was incorrect because
`-fms-extensions` enables these builtins, but is not responsible for
defining `_MSC_VER` on any target. The next closest thing is
`_MSC_EXTENSIONS`, which is only defined on Windows targets, but even
this is suboptimal. What this conditional is actually trying to
determine is if the given functions are defined as builtins, so just
check that directly.

I also attempted to do this for `__nop`, but in that case intrin.h,
which is only includable if `_MSC_VER` is defined, has its own
definition. So in that case `_MSC_VER` is correct.

Differential Revision: https://reviews.llvm.org/D75719
rdar://60102353

4 years ago[gold][test] Fix tests after D75713 and D74749
Fangrui Song [Fri, 6 Mar 2020 21:35:39 +0000 (13:35 -0800)]
[gold][test] Fix tests after D75713 and D74749

4 years agoAvoid emitting unreachable SP adjustments after `throw`
Reid Kleckner [Thu, 5 Mar 2020 23:37:21 +0000 (15:37 -0800)]
Avoid emitting unreachable SP adjustments after `throw`

In 172eee9c, we tried to avoid these by modelling the callee as
internally resetting the stack pointer.

However, for the majority of functions with reserved stack frames, this
would lead LLVM to emit extra SP adjustments to undo the callee's
internal adjustment. This lead us to fix the problem further on down the
pipeline in eliminateCallFramePseudoInstr. In 5b79e603d3b7a2994, I added
use a heuristic to try to detect when the adjustment would be
unreachable.

This heuristic is imperfect, and when exception handling is involved, it
fails to fire. The new test is an example of this. Simply throwing an
exception with an active cleanup emits dead SP adjustments after the
throw. Not only are they dead, but if they were executed, they would be
incorrect, so they are confusing.

This change essentially reverts 172eee9c and makes the 5b79e603d3b7a2994
heuristic responsible for preventing unreachable stack adjustments. This
means we may emit unreachable stack adjustments for functions using EH
with unreserved call frames, but that is not very many these days. Back
in 2016 when this change was added, we were focused on 32-bit, which we
observed to have fewer reserved frames.

Fixes PR45064

Reviewed By: hans

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

4 years ago[RS4GC] Handle uses of extractelement for conversion from vector to scalar base
Anna Thomas [Fri, 6 Mar 2020 16:07:11 +0000 (11:07 -0500)]
[RS4GC] Handle uses of extractelement for conversion from vector to scalar base

As mentioned in the comments, extractelement is special
since we actually want a scalar base for that element we extracted from
the vector (i.e. not a vector base).
This same logic should apply to uses of the extractelement such as phis
and selects which have the same BDV as the extractelement.
Howeber, for these uses we conservatively mark the BDV state as
conflict, since setting the EE's new base BDV does not always dominate
these uses.

Added testcase showcases the problem where the BDV identification chokes
on the incorrect cast from vector to scalar for the phi use of
extractelement.

Tests-Run: make check, internal fuzzer testing

Reviewers: reames, skatkov, dantrushin
Reviewed-By: dantrushin
Differential Revision: https://reviews.llvm.org/D75704

4 years agoSplit findUnwindSectionsByPhdr into target-specific functions.
Sterling Augustine [Thu, 5 Mar 2020 19:50:51 +0000 (11:50 -0800)]
Split findUnwindSectionsByPhdr into target-specific functions.

Summary:
This further cleans up the control flow and makes it easier to
optimize and replace portions in a subsequent patch.

This should be NFC, but given the amount of #ifdeffing here,
it may not be. So will watch the buildbots closely.

Also, as this is purely moving existing code around, I plan to
ignore the lint errors.

Reviewers: compnerd, miyuki, mstorsjo

Subscribers: libcxx-commits

Tags: #libc

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

4 years ago[lld][test] Make tests pass when the test directory matches `bar`
Benjamin Barenblat [Fri, 6 Mar 2020 21:20:48 +0000 (13:20 -0800)]
[lld][test] Make tests pass when the test directory matches `bar`

Reviewed By: jhenderson, MaskRay

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

4 years ago[MLIR] Fixes for BUILD_SHARED_LIBS=on
Stephen Neuendorffer [Thu, 27 Feb 2020 22:53:12 +0000 (14:53 -0800)]
[MLIR] Fixes for BUILD_SHARED_LIBS=on

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

4 years ago[MLIR] Add support for libMLIR.so
Valentin Churavy [Sun, 9 Feb 2020 03:27:54 +0000 (19:27 -0800)]
[MLIR] Add support for libMLIR.so

Putting this up mainly for discussion on
how this should be done. I am interested in MLIR from
the Julia side and we currently have a strong preference
to dynamically linking against the LLVM shared library,
and would like to have a MLIR shared library.

This patch adds a new cmake function add_mlir_library()
which accumulates a list of targets to be compiled into
libMLIR.so.  Note that not all libraries make sense to
be compiled into libMLIR.so.  In particular, we want
to avoid libraries which primarily exist to support
certain tools (such as mlir-opt and mlir-cpu-runner).

Note that the resulting libMLIR.so depends on LLVM, but
does not contain any LLVM components.  As a result, it
is necessary to link with libLLVM.so to avoid linkage
errors. So, libMLIR.so requires LLVM_BUILD_LLVM_DYLIB=on

FYI, Currently it appears that LLVM_LINK_LLVM_DYLIB is broken
because mlir-tblgen is linked against libLLVM.so and
and independent LLVM components.

Previous version of this patch broke depencies on TableGen
targets.  This appears to be because it compiled all
libraries to OBJECT libraries (probably because cmake
is generating different target names).  Avoiding object
libraries results in correct dependencies.

(updated by Stephen Neuendorffer)

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

4 years ago[MLIR] Move from add_dependencies() to DEPENDS
Stephen Neuendorffer [Thu, 20 Feb 2020 18:48:51 +0000 (10:48 -0800)]
[MLIR] Move from add_dependencies() to DEPENDS

add_llvm_library and add_llvm_executable may need to create new targets with
appropriate dependencies.  As a result, it is not sufficient in some
configurations (namely LLVM_BUILD_LLVM_DYLIB=on) to only call
add_dependencies().  Instead, the explicit TableGen dependencies must
be passed to add_llvm_library() or add_llvm_executable() using the DEPENDS
keyword.

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

4 years agoPR45124: Don't leave behind pending cleanups when declaring implicit
Richard Smith [Fri, 6 Mar 2020 21:22:10 +0000 (13:22 -0800)]
PR45124: Don't leave behind pending cleanups when declaring implicit
deduction guides.

Previously if an implicit deduction guide had a default argument with a
cleanup, we'd leave the 'pending cleanup' flag set after declaring the
implicit guide. But it turns out that there's no reason to even
substitute into the default argument when declaring an implicit
deduction guide: we only need to record that the default argument
exists, not what it is, since we never actually form a call to a
deduction guide.

4 years agoReapply "clang: Treat ieee mode as the default for denormal-fp-math"
Matt Arsenault [Thu, 5 Mar 2020 14:13:09 +0000 (09:13 -0500)]
Reapply "clang: Treat ieee mode as the default for denormal-fp-math"

This reverts commit 737394c490444e968a6f640b99a6614567ca7f28.

The fp-model test was failing on platforms that enable denormal flushing
based on -ffast-math. This needs to reset to IEEE, not the default in
these cases.

Change-Id: Ibbad32f66d0d0b89b9c1173a3a96fb1a570ddd89

4 years agoFix test broken by simulator triple changes.
Adrian Prantl [Fri, 6 Mar 2020 19:13:04 +0000 (11:13 -0800)]
Fix test broken by simulator triple changes.

4 years ago[lldb] Remove some #ifdef LLDB_CONFIGURATION_DEBUG around asserts
Raphael Isemann [Fri, 6 Mar 2020 19:19:06 +0000 (11:19 -0800)]
[lldb] Remove some #ifdef LLDB_CONFIGURATION_DEBUG around asserts

Summary:
Otherwise this code won't run on the Release+Asserts builds we have on the CI.

Fixes rdar://problem/59867885 (partly)

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[lldb] Update the current execution context at the beginning of tab completions
Gongyu Deng [Fri, 6 Mar 2020 18:10:24 +0000 (10:10 -0800)]
[lldb] Update the current execution context at the beginning of tab completions

Summary: Fix a bug that tab completions won't synchronous the current execution context. ( Thanks for Jim's explanation! )

Reviewers: teemperor, labath, jingham

Reviewed By: jingham

Subscribers: jingham, labath

Tags: #lldb

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

4 years ago[InstComine] Forego of one-use check in `(X - (X & Y)) --> (X & ~Y)` if Y is...
Roman Lebedev [Fri, 6 Mar 2020 18:39:07 +0000 (21:39 +0300)]
[InstComine] Forego of one-use check in `(X - (X & Y))   -->   (X & ~Y)` if Y is a constant

Summary:
This is potentially more friendly for further optimizations,
analysies, e.g.: https://godbolt.org/z/G24anE

This resolves phase-ordering bug that was introduced
in D75145 for https://godbolt.org/z/2gBwF2
https://godbolt.org/z/XvgSua

Reviewers: spatel, nikic, dmgreen, xbolva00

Reviewed By: nikic, xbolva00

Subscribers: hiraditya, zzheng, llvm-commits

Tags: #llvm

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

4 years agoLLD already has a mechanism for caching creation of DWARCContext:
Alexey Lapshin [Thu, 27 Feb 2020 17:38:42 +0000 (20:38 +0300)]
LLD already has a mechanism for caching creation of DWARCContext:

llvm::call_once(initDwarfLine, [this]() { initializeDwarf(); });

Though it is not used in all places.

I need that patch for implementing "Remove obsolete debug info" feature
(D74169). But this caching mechanism is useful by itself, and I think it
would be good to use it without connection to "Remove obsolete debug info"
feature. So this patch changes inplace creation of DWARFContext with
its cached version.

Depends on D74308

Reviewed By: ruiu

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

4 years agoCorrectly identify iOS simulator processes in debugserver.
Adrian Prantl [Thu, 5 Mar 2020 17:51:40 +0000 (09:51 -0800)]
Correctly identify iOS simulator processes in debugserver.

Starting with iOS 13 simulator binaries are identified with an
explicit platform in the new LC_BUILD_VERSION load command.

On older deployment targets using the LC_VERSION_MIN load commands,
this patch detects when an ios process runs on a macOS host and
updates the target triple with the "simulator" environment
accordingly.

(Patch re-applied with bugfix this time).

This is part of https://bugs.swift.org/browse/SR-11971

rdar://problem/58438125

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

4 years agoRevert "Correctly identify iOS simulator processes in debugserver."
Adrian Prantl [Fri, 6 Mar 2020 17:52:20 +0000 (09:52 -0800)]
Revert "Correctly identify iOS simulator processes in debugserver."

This reverts commit 59d816d88464e93a89e0d9c80c8855ab1f453541.

It broke TestGDBRemoteClient.

4 years ago[X86] Cleanup patterns and ins for VCVTNEPS2BF16.
Craig Topper [Fri, 6 Mar 2020 18:07:15 +0000 (10:07 -0800)]
[X86] Cleanup patterns and ins for VCVTNEPS2BF16.

There was a noop bitconvert in the load pattern. While there
also make all the sources refer to src_v.RC even though its the
same as _.RC, but its consistent.

4 years ago[MLIR] Remove redundant library dependencies
Stephen Neuendorffer [Thu, 20 Feb 2020 06:56:38 +0000 (22:56 -0800)]
[MLIR] Remove redundant library dependencies

In cmake, it is redundant to have a target list under target_link_libraries()
and add_dependency().  This patch removes the redundant dependency from
add_dependency().

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

4 years agoIncrease default timeout in lldbutil.expect_state_changes()
Adrian Prantl [Fri, 6 Mar 2020 17:59:45 +0000 (09:59 -0800)]
Increase default timeout in lldbutil.expect_state_changes()

4 years agoCorrectly identify iOS simulator processes in debugserver.
Adrian Prantl [Thu, 5 Mar 2020 17:51:40 +0000 (09:51 -0800)]
Correctly identify iOS simulator processes in debugserver.

Starting with iOS 13 simulator binaries are identified with an
explicit platform in the new LC_BUILD_VERSION load command.

On older deployment targets using the LC_VERSION_MIN load commands,
this patch detects when an ios process runs on a macOS host and
updates the target triple with the "simulator" environment
accordingly.

(Patch re-applied without modifications, the bot failure was unrelated).

This is part of https://bugs.swift.org/browse/SR-11971

rdar://problem/58438125

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

4 years agoRevert "Correctly identify iOS simulator processes in debugserver."
Adrian Prantl [Fri, 6 Mar 2020 17:52:20 +0000 (09:52 -0800)]
Revert "Correctly identify iOS simulator processes in debugserver."

This reverts commit 59d816d88464e93a89e0d9c80c8855ab1f453541.

It broke TestGDBRemoteClient.

4 years agoCorrectly identify iOS simulator processes in debugserver.
Adrian Prantl [Thu, 5 Mar 2020 17:51:40 +0000 (09:51 -0800)]
Correctly identify iOS simulator processes in debugserver.

Starting with iOS 13 simulator binaries are identified with an
explicit platform in the new LC_BUILD_VERSION load command.

On older deployment targets using the LC_VERSION_MIN load commands,
this patch detects when an ios process runs on a macOS host and
updates the target triple with the "simulator" environment
accordingly.

This is part of https://bugs.swift.org/browse/SR-11971

rdar://problem/58438125

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

4 years ago[Concepts] Add null check for TemplateTypeParmType::getDecl() in GetContainedInvented...
Saar Raz [Fri, 6 Mar 2020 16:45:12 +0000 (18:45 +0200)]
[Concepts] Add null check for TemplateTypeParmType::getDecl() in GetContainedInventedTypeParmVisitor

GetContainedInventedTypeParmVisitor would not account for the case where TemplateTypeParmType::getDecl() is
nullptr, causing bug #45102.

Add the nullptr check.

4 years ago[X86] Add CMOV to i686 BMI/TBM tests
Simon Pilgrim [Fri, 6 Mar 2020 17:26:20 +0000 (17:26 +0000)]
[X86] Add CMOV to i686 BMI/TBM tests

As mentioned on D75748, there is no such target that has BMI/TBM support but not the much older CMOV.

4 years ago[Hexagon] Fix fshl/fshr -> combine() bug identified in D75114
Simon Pilgrim [Fri, 6 Mar 2020 17:22:55 +0000 (17:22 +0000)]
[Hexagon] Fix fshl/fshr -> combine() bug identified in D75114

4 years ago[Hexagon] Add fshl/fshr -> combine() tests identified in D75114
Simon Pilgrim [Fri, 6 Mar 2020 17:14:28 +0000 (17:14 +0000)]
[Hexagon] Add fshl/fshr -> combine() tests identified in D75114

Added tests showing that the fshl/fshr -> combine() is working the wrong way around

4 years ago[MLIR] Ensure that target_link_libraries() always has a keyword.
Stephen Neuendorffer [Thu, 5 Mar 2020 19:49:42 +0000 (11:49 -0800)]
[MLIR] Ensure that target_link_libraries() always has a keyword.

CMake allows calling target_link_libraries() without a keyword,
but this usage is not preferred when also called with a keyword,
and has surprising behavior.  This patch explicitly specifies a
keyword when using target_link_libraries().

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

4 years agoFix incorrect logic in maintaining the side-effect of compiler generated outliner...
Jin Lin [Thu, 5 Mar 2020 21:54:58 +0000 (13:54 -0800)]
Fix incorrect logic in maintaining the side-effect of compiler generated outliner functions

Summary: Fix incorrect logic in maintaining the side-effect of compiler generated outliner functions by adding the up-exposed uses.

Reviewers: paquette, tellenbach

Reviewed By: paquette

Subscribers: aemerson, lebedev.ri, hiraditya, llvm-commits, jinlin

Tags: #llvm

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

4 years ago[OPENMP50]Add 'depobj' modifier in 'depend' clauses.
Alexey Bataev [Fri, 6 Mar 2020 16:09:55 +0000 (11:09 -0500)]
[OPENMP50]Add 'depobj' modifier in 'depend' clauses.

Added basic support (parsing/sema/serialization) for depobj dependency
kind in depend clauses.

4 years ago[AMDGPU][ConstantFolding] Fold llvm.amdgcn.cube* intrinsics
Jay Foad [Wed, 26 Feb 2020 16:19:41 +0000 (16:19 +0000)]
[AMDGPU][ConstantFolding] Fold llvm.amdgcn.cube* intrinsics

Summary:
This folds the following family of intrinsics:
llvm.amdgcn.cubeid (face id)
llvm.amdgcn.cubema (major axis)
llvm.amdgcn.cubesc (S coordinate)
llvm.amdgcn.cubetc (T coordinate)

Reviewers: nhaehnle, arsenm, rampitec

Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[APFloat] Make use of new overloaded comparison operators. NFC.
Jay Foad [Fri, 6 Mar 2020 15:22:11 +0000 (15:22 +0000)]
[APFloat] Make use of new overloaded comparison operators. NFC.

Reviewers: ekatz, spatel, jfb, tlively, craig.topper, RKSimon, nikic, scanon

Subscribers: arsenm, jvesely, nhaehnle, hiraditya, dexonsmith, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[APFloat] Overload comparison operators
Jay Foad [Thu, 27 Feb 2020 09:57:16 +0000 (09:57 +0000)]
[APFloat] Overload comparison operators

Summary:
These implement the usual IEEE-style floating point comparison
semantics, e.g. +0.0 == -0.0 and all operators except != return false
if either argument is NaN.

Subscribers: arsenm, jvesely, nhaehnle, hiraditya, dexonsmith, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[NFC][InstCombine] Add 'x - (x & y)' tests with multi-use 'and'
Roman Lebedev [Fri, 6 Mar 2020 16:40:13 +0000 (19:40 +0300)]
[NFC][InstCombine] Add 'x - (x & y)' tests with multi-use 'and'

If %y is constant, we could still perform the fold

4 years ago[MC] Allowing the use of $-prefixed integer as asm identifiers
Lucas Prates [Mon, 10 Feb 2020 16:48:25 +0000 (16:48 +0000)]
[MC] Allowing the use of $-prefixed integer as asm identifiers

Summary:
Dollar signed prefixed integers were not allowed by the AsmParser to be
used as Identifiers, differing from the GNU assembler behavior.

This patch updates the parsing of Identifiers to consider such cases as
valid, where the identifier string includes the $ prefix itself. As the
Lexer currently splits these occurrences into separate tokens, those
need to be combined by the AsmParser itself.

Reviewers: efriedma, chill

Reviewed By: efriedma

Subscribers: sdardis, hiraditya, jrtc27, atanasyan, llvm-commits

Tags: #llvm

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

4 years ago[ARM] Fix dropped dollar sign from symbols in branch targets
Lucas Prates [Tue, 21 Jan 2020 16:36:32 +0000 (16:36 +0000)]
[ARM] Fix dropped dollar sign from symbols in branch targets

Summary:
ARMAsmParser was incorrectly dropping a leading dollar sign character
from symbol names in targets of branch instructions. This was caused by
an incorrect assumption that the contents following the dollar sign
token should be handled as a constant immediate, similarly to the #
token.

This patch avoids the operand parsing from consuming the dollar sign
token when it is followed by an identifier, making sure it is properly
parsed as part of the expression.

Reviewers: efriedma

Reviewed By: efriedma

Subscribers: danielkiss, chill, carwil, vhscampos, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[clang-format] Extend AllowShortLoopsOnASingleLine to do ... while loops.
Mitchell Balan [Fri, 6 Mar 2020 16:13:23 +0000 (11:13 -0500)]
[clang-format] Extend AllowShortLoopsOnASingleLine to do ... while loops.
Summary:
If AllowShortLoopsOnASingleLine is enabled,

  do
    a++;
  while (true);

becomes

  do a++;
  while (true);

Reviewers: MyDeveloperDay, mitchell-stellar

Reviewed by: mitchell-stellar

Contributed by: DaanDeMeyer

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

4 years ago[DebugInfo] Print the actual value of an unknown section identifier.
Igor Kudrin [Thu, 5 Mar 2020 09:43:56 +0000 (16:43 +0700)]
[DebugInfo] Print the actual value of an unknown section identifier.

This is a follow-up for D75609. As @dblaikie suggested, it prints
the actual number for an unknown section identifier when dumping
unit index sections.

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

4 years ago[Hexagon] Recognize undefined registers in expandPostRAPseudo
Krzysztof Parzyszek [Fri, 6 Mar 2020 13:54:12 +0000 (07:54 -0600)]
[Hexagon] Recognize undefined registers in expandPostRAPseudo

4 years ago[AIX] Handle LinkOnceODRLinkage and AppendingLinkage for static init gloabl arrays
Xiangling Liao [Wed, 26 Feb 2020 21:48:23 +0000 (16:48 -0500)]
[AIX] Handle LinkOnceODRLinkage and AppendingLinkage for static init gloabl arrays

Handle LinkOnceODRLinkage;
Handle AppendingLinkage type for llvm.global_ctors/dtors static init global arrays;

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

4 years agoarcher: Remove superfluous dot from warning message
Jonas Hahnfeld [Fri, 6 Mar 2020 14:18:38 +0000 (15:18 +0100)]
archer: Remove superfluous dot from warning message

4 years ago[Sema] Reword -Wrange-loop-analysis warning messages
Aaron Puchert [Fri, 6 Mar 2020 13:56:47 +0000 (14:56 +0100)]
[Sema] Reword -Wrange-loop-analysis warning messages

Summary:
The messages for two of the warnings are misleading:
* warn_for_range_const_reference_copy suggests that the initialization
  of the loop variable results in a copy. But that's not always true,
  we just know that some conversion happens, potentially invoking a
  constructor or conversion operator. The constructor might copy, as in
  the example that lead to this message [1], but it might also not.
  However, the constructed object is bound to a reference, which is
  potentially misleading, so we rewrite the message to emphasize that.
  We also make sure that we print the reference type into the warning
  message to clarify that this warning only appears when operator*
  returns a reference.
* warn_for_range_variable_always_copy suggests that a reference type
  loop variable initialized from a temporary "is always a copy". But
  we don't know this, the range might just return temporary objects
  which aren't copies of anything. (Assuming RVO a copy constructor
  might never have been called.)

The message for warn_for_range_copy is a bit repetitive: the type of a
VarDecl and its initialization Expr are the same up to cv-qualifiers,
because Sema will insert implicit casts or constructor calls to make
them match.

[1] https://bugs.llvm.org/show_bug.cgi?id=32823

Reviewers: aaron.ballman, Mordante, rtrieu

Reviewed By: aaron.ballman

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

4 years agoExtract common code to deal with multidimensional vectors.
Adrian Kuegel [Fri, 6 Mar 2020 12:04:37 +0000 (13:04 +0100)]
Extract common code to deal with multidimensional vectors.

Summary: Also replace dyn_cast_or_null with dyn_cast when possible.

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

4 years ago[OpenCL] Align vload and vstore builtins
Sven van Haastregt [Fri, 6 Mar 2020 12:45:28 +0000 (12:45 +0000)]
[OpenCL] Align vload and vstore builtins

Various vload and vstore builtins were missing or misdefined in the
TableGen description.  Align the OpenCL vload* and vstore* builtins of
the `-fdeclare-opencl-builtins` option to those of `opencl-c.h`.

Reviewed-by: Stuart Brady <stuart.brady@arm.com>
4 years ago[clangd][VSCode] Force VSCode to use the ranking provided by clangd.
Sam McCall [Fri, 6 Mar 2020 12:34:14 +0000 (13:34 +0100)]
[clangd][VSCode] Force VSCode to use the ranking provided by clangd.

Summary:
Clangd's approach is to provide lots of completions, and let ranking sort them
out. This relies on various important signals (Quality.h), without which the
large completion lists are extremely spammy.

Even with a completion result exactly at the cursor, vscode looks backwards and
tries to match the presumed partial-identifier against filterText, and uses
the result to rank, with sortText only used as a tiebreak.
By prepending the partial-identifier to the filterText, we can force the match
to be perfect and so give sortText full control of the ranking.

Full sad story: https://github.com/microsoft/language-server-protocol/issues/898

It's possible to do this on the server side too of course, and switch it on
with an initialization option. But it's a little easier in the extension, it
will get the fix to users of old clangd versions, and other editors

Reviewers: hokein

Reviewed By: hokein

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

Tags: #clang

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

4 years ago[BFI] Use CallbackVH to notify BFI about deletion of basic blocks
Daniil Suchkov [Thu, 5 Mar 2020 14:14:26 +0000 (21:14 +0700)]
[BFI] Use CallbackVH to notify BFI about deletion of basic blocks

With AssertingVHs instead of bare pointers in
BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all
tests ran by make check fail. It means that there are users of BFI that
delete basic blocks while keeping BFI. Some of those transformations add
new basic blocks, so if a new basic block happens to be allocated at
address where an already deleted block was and we don't explicitly set
block frequency for that new block, BFI will report some non-default
frequency for the block even though frequency for the block was never
set. Inliner is an example of a transformation that adds and removes BBs
while querying and updating BFI.
With this patch, thanks to updates via CallbackVH, BFI won't keep stale
pointers in its Nodes map.

This is a resubmission of 408349a25d0f5a012003f84c95b49bcc7782fa70 with
fixed compiler warning and MSVC compilation error.

Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev

Reviewed-By: asbirlea, davidxl
Tags: #llvm

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

4 years ago[DAG] Combine fshl/fshr(load1,load0,c) if we have consecutive loads
Simon Pilgrim [Fri, 6 Mar 2020 11:36:00 +0000 (11:36 +0000)]
[DAG] Combine fshl/fshr(load1,load0,c) if we have consecutive loads

As noted on D75114, if both arguments of a funnel shift are consecutive loads we are missing the opportunity to combine them into a single load.

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

4 years ago[lib/ObjectYAML] - Make `ELFYAML::Relocation::Offset` optional.
Georgii Rymar [Wed, 4 Mar 2020 13:55:15 +0000 (16:55 +0300)]
[lib/ObjectYAML] - Make `ELFYAML::Relocation::Offset` optional.

Currently `yaml2obj` require `Offset` field in a relocation description.
There are many cases when `Offset` is insignificant in a context of a test case.

Making `Offset` optional allows to simplify our test cases.
This is what this patch does.

Also, with this patch `obj2yaml` does not dump a zero offset of a relocation.

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

4 years ago[yaml2obj][obj2yaml][Object][test] - Improve testing of relocation types.
Georgii Rymar [Thu, 5 Mar 2020 13:00:16 +0000 (16:00 +0300)]
[yaml2obj][obj2yaml][Object][test] - Improve testing of relocation types.

The intention was to remove the `Object/X86/yaml-elf-x86-rel-broken.yaml test`,
This test is at the wrong place.

`yaml-elf-x86-rel-broken.yaml` was introduced in
rG892c6c86ea25dc97668ff1f1b7bf1108e85fa5ec to check that
yaml2obj can use an arbitrary `Hex32` value as a relocation type.
We have tests that check the similar functionality.

I've improved them and removed the `yaml-elf-x86-rel-broken.yaml`

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