platform/upstream/llvm.git
6 years agoTableGen: Remove VarInit::getFieldType
Nicolai Haehnle [Sun, 25 Feb 2018 20:50:17 +0000 (20:50 +0000)]
TableGen: Remove VarInit::getFieldType

It is redundant with the implementation in TypedInit.

Change-Id: I8ab1fb5c77e4923f7eb3ffae5889f0f8af6093b4

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326061

6 years agoTableGen: Get rid of Init::getFieldInit
Nicolai Haehnle [Sun, 25 Feb 2018 20:50:11 +0000 (20:50 +0000)]
TableGen: Get rid of Init::getFieldInit

Summary:
FieldInit will just rely on the standardized resolving mechanism to give
us DefInits for folding, thus simplifying the code.

Unlike the removal of resolveListElementReference, this shouldn't have
performance implications, because DefInits do not recurse inside their
record.

Change-Id: Id4544c774c9d9ee92f293615af6ecff706453f21

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326060

6 years agoTableGen: Remove Init::resolveListElementReference
Nicolai Haehnle [Sun, 25 Feb 2018 20:50:04 +0000 (20:50 +0000)]
TableGen: Remove Init::resolveListElementReference

Summary:
Resolving a VarListElementInit should just resolve the list and then
take its element. This eliminates a lot of duplicated logic and
simplifies the next steps of refactoring resolveReferences.

This does potentially cause sub-elements of the entire list to be
resolved resulting in more work, but I didn't notice a measurable
change in performance, and a later patch adds a caching mechanism that
covers at least the common case of `var[i]` in a more generic way.

Change-Id: I7b59185b855c7368585c329c31e5be38c5749dac

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

llvm-svn: 326059

6 years agoWhen diagnosing the arguments to alloc_size, report the failing argument using a...
Aaron Ballman [Sun, 25 Feb 2018 20:40:06 +0000 (20:40 +0000)]
When diagnosing the arguments to alloc_size, report the failing argument using a 1-based index instead of a 0-based index for consistency.

Patch by Joel Denny.

llvm-svn: 326058

6 years agoFix a failing assertion with the pointer_with_type_tag attribute when the function...
Aaron Ballman [Sun, 25 Feb 2018 20:28:10 +0000 (20:28 +0000)]
Fix a failing assertion with the pointer_with_type_tag attribute when the function the attribute appertains to is variadic.

Patch by Joel Denny.

llvm-svn: 326057

6 years ago[DebugInfo] Stable sort symbols to remove non-deterministic ordering
Mandeep Singh Grang [Sun, 25 Feb 2018 19:52:34 +0000 (19:52 +0000)]
[DebugInfo] Stable sort symbols to remove non-deterministic ordering

Summary: This fixes failure in DebugInfo/X86/multiple-aranges.ll uncovered by D39245.

Reviewers: rafael, echristo, probinson

Reviewed By: probinson

Subscribers: probinson, llvm-commits, JDevlieghere

Tags: #debug-info

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

llvm-svn: 326056

6 years agoSwitch the default behavior of the Clang<> spelling to opt-in to the C2x attribute...
Aaron Ballman [Sun, 25 Feb 2018 15:34:17 +0000 (15:34 +0000)]
Switch the default behavior of the Clang<> spelling to opt-in to the C2x attribute spellings. NFC to the attribute spellings themselves.

The Clang<> spelling helper generates a spelling for C++11, GNU, and C2x attribute spellings. Previously, users had to manually opt in to the C2x spelling while we cautiously added attributes to that spelling. Now that majority of attributes are exposed in C2x, we can switch the default.

llvm-svn: 326055

6 years agoDocument why the consumed attributes (consumable, callable_when, et al) are not expos...
Aaron Ballman [Sun, 25 Feb 2018 14:54:25 +0000 (14:54 +0000)]
Document why the consumed attributes (consumable, callable_when, et al) are not exposed with a C2x spelling. NFC.

llvm-svn: 326054

6 years agoAdd a C2x spelling for the external_source_symbol and internal_linkage attributes...
Aaron Ballman [Sun, 25 Feb 2018 14:43:45 +0000 (14:43 +0000)]
Add a C2x spelling for the external_source_symbol and internal_linkage attributes in the clang vendor namespace.

Both of these attributes have existing meaning in C code, so there was no reason to exclude them from using the new spelling.

llvm-svn: 326053

6 years agoAdd a C++11 and C2x spelling for the type safety attribute (argument_with_type_tag...
Aaron Ballman [Sun, 25 Feb 2018 14:01:04 +0000 (14:01 +0000)]
Add a C++11 and C2x spelling for the type safety attribute (argument_with_type_tag, pointer_with_type_tag, and type_tag_for_datatype) in the clang vendor namespace.

The TypeTagForDatatype attribute had custom parsing rules that previously prevented it from being supported with square bracket notation. The ArgumentWithTypeTag attribute previously had unnecessary custom parsing that could be handled declaratively.

llvm-svn: 326052

6 years ago[clangd] Address FIXME and fix comment
Kirill Bobyrev [Sun, 25 Feb 2018 07:21:16 +0000 (07:21 +0000)]
[clangd] Address FIXME and fix comment

* Address a FIXME by warning the user that both -run-synchronously and -j X are
  passed.
* Fix a comment to suppress clang-tidy warning by passing the correct argument
  name.

Reviewers: ioeric

Subscribers: ilya-biryukov, jkorous-apple, cfe-commits

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

llvm-svn: 326051

6 years ago[InstSimplify] Add test cases for removal of vector fabs on known positive.
Craig Topper [Sun, 25 Feb 2018 06:51:52 +0000 (06:51 +0000)]
[InstSimplify] Add test cases for removal of vector fabs on known positive.

llvm-svn: 326050

6 years ago[InstSimplify] Remove unused parameter from test cases.
Craig Topper [Sun, 25 Feb 2018 06:51:51 +0000 (06:51 +0000)]
[InstSimplify] Remove unused parameter from test cases.

llvm-svn: 326049

6 years ago[X86] Use SDNode instead of SDPatternOperator. NFC
Craig Topper [Sun, 25 Feb 2018 06:21:04 +0000 (06:21 +0000)]
[X86] Use SDNode instead of SDPatternOperator. NFC

llvm-svn: 326048

6 years ago[clang-tidy/google] Improve the Objective-C global variable declaration check 🔧
Yan Zhang [Sun, 25 Feb 2018 04:11:26 +0000 (04:11 +0000)]
[clang-tidy/google] Improve the Objective-C global variable declaration check 🔧

Summary:
The current Objective-C global variable declaration check restricts naming that is permitted by the Google Objective-C style guide.

The Objective-C style guide states the following:
"Global and file scope constants should have an appropriate prefix. [...] Constants may use a lowercase k prefix when appropriate"
http://google.github.io/styleguide/objcguide#constants

This change fixes the check to allow two or more capital letters as an appropriate prefix. This change intentionally avoids making a decision regarding whether to flag constants that use a two letter prefix (two letter prefixes are reserved by Apple¹ but many projects seem to violate this guideline).

This change eliminates an important category of false positives (constants prefixed with '[A-Z]{2,}') at the cost of introducing a less important category of false negatives (constants prefixed with only '[A-Z]'). The false positives are observed in standard recommended code while the false negatives occur in non-standard unrecommended code. The number of eliminated false positives is expected to be significantly larger than the number of exposed false negatives.



(1)
"Two-letter prefixes like these are reserved by Apple for use in framework classes."
https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/ProgrammingWithObjectiveC/Conventions/Conventions.html

Reviewers: aaron.ballman, Wizard, hokein, benhamilton

Reviewed By: aaron.ballman, Wizard

Subscribers: aaron.ballman, cfe-commits

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

llvm-svn: 326046

6 years ago[RISCV] Enable __int128_t and __uint128_t through clang flag
Mandeep Singh Grang [Sun, 25 Feb 2018 03:58:23 +0000 (03:58 +0000)]
[RISCV] Enable __int128_t and __uint128_t through clang flag

Summary:
If the flag -fforce-enable-int128 is passed, it will enable support for __int128_t and __uint128_t types.
This flag can then be used to build compiler-rt for RISCV32.

Reviewers: asb, kito-cheng, apazos, efriedma

Reviewed By: asb, efriedma

Subscribers: shiva0217, efriedma, jfb, dschuff, sdardis, sbc100, jgravelle-google, aheejin, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, cfe-commits

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

llvm-svn: 326045

6 years ago[TargetLowering] SimplifyDemandedVectorElts - pass demanded elts through ADD/SUB ops
Simon Pilgrim [Sat, 24 Feb 2018 20:59:14 +0000 (20:59 +0000)]
[TargetLowering] SimplifyDemandedVectorElts - pass demanded elts through ADD/SUB ops

llvm-svn: 326044

6 years ago[TargetLowering] SimplifyDemandedVectorElts - pass demanded elts through TRUNCATE ops
Simon Pilgrim [Sat, 24 Feb 2018 19:28:34 +0000 (19:28 +0000)]
[TargetLowering] SimplifyDemandedVectorElts - pass demanded elts through TRUNCATE ops

llvm-svn: 326043

6 years ago[X86] Add cvt tests to avx512vl-intrinsics-fast-isel.ll
Craig Topper [Sat, 24 Feb 2018 18:58:08 +0000 (18:58 +0000)]
[X86] Add cvt tests to avx512vl-intrinsics-fast-isel.ll

llvm-svn: 326042

6 years ago[X86] Allow int_x86_sse2_cvtps2dq and int_x86_avx_cvt_ps2dq_256 to select EVEX encode...
Craig Topper [Sat, 24 Feb 2018 18:58:07 +0000 (18:58 +0000)]
[X86] Allow int_x86_sse2_cvtps2dq and int_x86_avx_cvt_ps2dq_256 to select EVEX encoded instructions.

llvm-svn: 326041

6 years ago[X86] Remove GCCBuiltin from some intrinsics that are no longer used by clang.
Craig Topper [Sat, 24 Feb 2018 18:58:02 +0000 (18:58 +0000)]
[X86] Remove GCCBuiltin from some intrinsics that are no longer used by clang.

llvm-svn: 326040

6 years ago[X86] Remove some masked cvt builtins that can be replaced with legacy sse/avx buiilt...
Craig Topper [Sat, 24 Feb 2018 18:55:13 +0000 (18:55 +0000)]
[X86] Remove some masked cvt builtins that can be replaced with legacy sse/avx buiiltins and a select.

llvm-svn: 326039

6 years agoAdd a C++11 and C2x spelling for the objc_bridge_related attribute in the clang vendo...
Aaron Ballman [Sat, 24 Feb 2018 17:37:37 +0000 (17:37 +0000)]
Add a C++11 and C2x spelling for the objc_bridge_related attribute in the clang vendor namespace.

This attribute has custom parsing rules that previously prevented it from being supported with square bracket notation.

llvm-svn: 326038

6 years agoRevert "StructurizeCFG: Test for branch divergence correctly"
Adam Nemet [Sat, 24 Feb 2018 17:29:09 +0000 (17:29 +0000)]
Revert "StructurizeCFG: Test for branch divergence correctly"

This reverts commit r325881.

Breaks many bots

llvm-svn: 326037

6 years agoAdd a C++11 and C2x spelling for the availability attribute in the clang vendor names...
Aaron Ballman [Sat, 24 Feb 2018 17:16:42 +0000 (17:16 +0000)]
Add a C++11 and C2x spelling for the availability attribute in the clang vendor namespace.

This attribute has custom parsing rules that previously prevented it from being supported with square bracket notation. Rework the clang attribute argument parsing to be more easily extended for other custom-parsed attributes.

llvm-svn: 326036

6 years ago[DebugInfo] Fix buildbot failure on non-X86 targets
Scott Linder [Sat, 24 Feb 2018 16:25:43 +0000 (16:25 +0000)]
[DebugInfo] Fix buildbot failure on non-X86 targets

llvm-svn: 326035

6 years ago[X86][SSE] combineSubToSubus - support v8i64 handling from SSSE3
Simon Pilgrim [Sat, 24 Feb 2018 14:06:39 +0000 (14:06 +0000)]
[X86][SSE] combineSubToSubus - support v8i64 handling from SSSE3

Our UMIN/UMAX, vector truncation and shuffle combining is good enough to efficiently handle v8i64 with the number of leading zeros that are necessary for PSUBUS.

llvm-svn: 326034

6 years ago[X86][SSE] combineSubToSubus - support v8i32 handling from SSSE3 (not SSE41)
Simon Pilgrim [Sat, 24 Feb 2018 13:39:13 +0000 (13:39 +0000)]
[X86][SSE] combineSubToSubus - support v8i32 handling from SSSE3 (not SSE41)

Now that UMIN etc are Legal/Custom for SSE2+, we can efficiently match SUBUS v8i32 cases from SSSE3 which can perform efficient truncation with PSHUFB.

llvm-svn: 326033

6 years ago[ubsan-minimal] Fix the ubsan_minimal debug build (COMPILER_RT_DEBUG=1) on macOS.
Dan Liew [Sat, 24 Feb 2018 13:14:44 +0000 (13:14 +0000)]
[ubsan-minimal] Fix the ubsan_minimal debug build (COMPILER_RT_DEBUG=1) on macOS.

`ubsan_minimal` makes use of the `_sanitizer::atomic_load` function.
This function uses the `DCHECK` macro which in debug builds will use
the `_sanitizer::CheckFailed` function.

This function is part of `sanitizer_common` but `ubsan_minimal` doesn't
use this so the implementation is missing which leads to link failures
on macOS when trying to link `libclang_rt.ubsan_minimal_osx_dynamic.dylib`.
This is in contrast to the BFD linker on Linux which doesn't seem to care
about the missing symbol.

A basic implementation of `_sanitizer::CheckFailed` has been added to
the `ubsan_minimal` debug build to avoid the link error. The
implementation could definitely be improved but I don't know which
functions can be used in this context so I decided to restrict myself to
functions only being used in `ubsan_minimal` already.

llvm-svn: 326032

6 years ago[X86][SSE] combineSubToSubus - begun generalizing to work with any type sizes with...
Simon Pilgrim [Sat, 24 Feb 2018 12:44:12 +0000 (12:44 +0000)]
[X86][SSE] combineSubToSubus - begun generalizing to work with any type sizes with SplitBinaryOpsAndApply

llvm-svn: 326030

6 years agoFix spelling in comment. NFCI.
Simon Pilgrim [Sat, 24 Feb 2018 12:27:02 +0000 (12:27 +0000)]
Fix spelling in comment. NFCI.

llvm-svn: 326029

6 years ago[Sparc] Return true in enableMultipleCopyHints().
Jonas Paulsson [Sat, 24 Feb 2018 08:24:31 +0000 (08:24 +0000)]
[Sparc]  Return true in enableMultipleCopyHints().

Enable multiple COPY hints to eliminate more COPYs during register allocation.

Note that this is something all targets should do, see
https://reviews.llvm.org/D38128.

Review: James Y Knight
llvm-svn: 326028

6 years agoCleanup __config indention NFC
Logan Chien [Sat, 24 Feb 2018 07:57:32 +0000 (07:57 +0000)]
Cleanup __config indention  NFC

This commit indents each level by two space characters, e.g.

#if defined(CONDITION)
#  define _LIBCPP_NAME VALUE
#else
#  define _LIBCPP_NAME VALUE
#endif

The simple #ifndef, #define, and #endif sequences are not indented, e.g.

#ifndef _LIBCPP_NAME
#define _LIBCPP_NAME ...
#endif

llvm-svn: 326027

6 years ago[X86] Remove GCCBuiltin from some intrinsics that are no longer used by clang.
Craig Topper [Sat, 24 Feb 2018 07:02:24 +0000 (07:02 +0000)]
[X86] Remove GCCBuiltin from some intrinsics that are no longer used by clang.

llvm-svn: 326026

6 years ago[cfi] Lazy initialization of CFI interceptors
Vitaly Buka [Sat, 24 Feb 2018 06:58:56 +0000 (06:58 +0000)]
[cfi] Lazy initialization of CFI interceptors

Summary:
Interceptors initialization may need to allocate memory. So if we initialize too
early we can crash in non initialized allocator.

Reviewers: pcc, eugenis

Subscribers: llvm-commits

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

llvm-svn: 326025

6 years agoRemove unused variable. We should be warning-free.
Daniel Jasper [Sat, 24 Feb 2018 06:57:47 +0000 (06:57 +0000)]
Remove unused variable. We should be warning-free.

llvm-svn: 326024

6 years agoMake module use diagnostics refer to the top-level module
Daniel Jasper [Sat, 24 Feb 2018 06:54:09 +0000 (06:54 +0000)]
Make module use diagnostics refer to the top-level module

All use declarations need to be directly placed in the top-level module
anyway, knowing the submodule doesn't really help. The header that has
the offending #include can easily be seen in the diagnostics source
location.

Review: https://reviews.llvm.org/D43673
llvm-svn: 326023

6 years ago[X86] Remove __builtin_ia32_permvarsf256_mask and __builtin_ia32_permvarsi256_mask...
Craig Topper [Sat, 24 Feb 2018 06:46:42 +0000 (06:46 +0000)]
[X86] Remove __builtin_ia32_permvarsf256_mask and __builtin_ia32_permvarsi256_mask and use the avx2 unmasked versions and a select instead.

llvm-svn: 326022

6 years ago[CFG] Keep speculatively working around an MSVC compiler crash.
Artem Dergachev [Sat, 24 Feb 2018 03:54:22 +0000 (03:54 +0000)]
[CFG] Keep speculatively working around an MSVC compiler crash.

Replace if() with a switch(). Because random changes in the code seem to
suppress the crash.

Story so far:
r325966 - Crash introduced.
r325969 - Speculative fix had no effect.
r325978 - Tried to bisect the offending function, crash suddenly disappeared.
r326016 - After another random change in the code, bug appeared again.

llvm-svn: 326021

6 years ago[X86] Use SelectionDAG::getNot instead of implementing manually. NFC
Craig Topper [Sat, 24 Feb 2018 03:15:54 +0000 (03:15 +0000)]
[X86] Use SelectionDAG::getNot instead of implementing manually. NFC

llvm-svn: 326020

6 years ago[CFG] Provide construction contexts for temporaries in conditional operators.
Artem Dergachev [Sat, 24 Feb 2018 03:10:15 +0000 (03:10 +0000)]
[CFG] Provide construction contexts for temporaries in conditional operators.

When a lifetime-extended temporary is on a branch of a conditional operator,
materialization of such temporary occurs after the condition is resolved.

This change allows us to understand, by including the MaterializeTemporaryExpr
in the construction context, the target for temporary materialization in such
cases.

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

llvm-svn: 326019

6 years ago[WebAssembly] Remove dead code.
Rui Ueyama [Sat, 24 Feb 2018 02:43:31 +0000 (02:43 +0000)]
[WebAssembly] Remove dead code.

llvm-svn: 326018

6 years ago[WebAssembly] Remove dead code.
Rui Ueyama [Sat, 24 Feb 2018 02:34:03 +0000 (02:34 +0000)]
[WebAssembly] Remove dead code.

llvm-svn: 326017

6 years ago[CFG] Provide construction contexts for temporaries bound to const references.
Artem Dergachev [Sat, 24 Feb 2018 02:07:50 +0000 (02:07 +0000)]
[CFG] Provide construction contexts for temporaries bound to const references.

In order to bind a temporary to a const lvalue reference, a no-op cast is added
to make the temporary itself const, and only then the reference is taken
(materialized). Skip the no-op cast when looking for the construction context.

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

llvm-svn: 326016

6 years ago[CFG] Provide construction contexts for functional cast-like constructors.
Artem Dergachev [Sat, 24 Feb 2018 02:05:11 +0000 (02:05 +0000)]
[CFG] Provide construction contexts for functional cast-like constructors.

When a constructor of a temporary with a single argument is treated
as a functional cast expression, skip the functional cast expression
and provide the correct construction context for the temporary.

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

llvm-svn: 326015

6 years ago[CFG] Provide construction contexts for lifetime-extended temporaries.
Artem Dergachev [Sat, 24 Feb 2018 02:00:30 +0000 (02:00 +0000)]
[CFG] Provide construction contexts for lifetime-extended temporaries.

When constructing a temporary that is going to be lifetime-extended through a
MaterializeTemporaryExpr later, CFG elements for the respective constructor
can now be queried to obtain the reference to that MaterializeTemporaryExpr
and therefore gain information about lifetime extension.

This may produce multi-layered construction contexts when information about
both temporary destruction and lifetime extension is available.

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

llvm-svn: 326014

6 years ago[WebAssebmly] Minor simplification. NFC.
Rui Ueyama [Sat, 24 Feb 2018 01:58:38 +0000 (01:58 +0000)]
[WebAssebmly] Minor simplification. NFC.

llvm-svn: 326013

6 years agoDo not use `auto` for type that is not obvious in a local context.
Rui Ueyama [Sat, 24 Feb 2018 01:39:25 +0000 (01:39 +0000)]
Do not use `auto` for type that is not obvious in a local context.

llvm-svn: 326012

6 years ago[AMDGPU] Shrinking V_SUBBREV_U32
Stanislav Mekhanoshin [Sat, 24 Feb 2018 01:32:32 +0000 (01:32 +0000)]
[AMDGPU] Shrinking V_SUBBREV_U32

V_SUBBREV_U32 is a commute opcode for V_SUBB_U32. However, when
we try to commute V_SUBB_U32 in order to shrink it we do not then
process V_SUBBREV_U32 and it stay VOP3. This is fixed.

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

llvm-svn: 326011

6 years agoCorrect ctype(3) functions with NLS on NetBSD
Kamil Rytarowski [Sat, 24 Feb 2018 01:01:14 +0000 (01:01 +0000)]
Correct ctype(3) functions with NLS on NetBSD

Summary:
The setlocale(3) function reloads the ctype(3) arrays from
external files. This happens behind the scenes in the internals
of libc (citrus library, runes functions etc).

ctype(3) functions like isspace(3) can be provided with two
variations on NetBSD: inlined or via a global symbol in libc:

```
#if defined(_NETBSD_SOURCE) && !defined(_CTYPE_NOINLINE) && \
    !defined(__cplusplus)
#include <sys/ctype_inline.h>
#else
#include <sys/ctype_bits.h>
#endif
```

The in-lined versions are de-facto array lookup operations.

```
#define isspace(c)      ((int)((_ctype_tab_ + 1)[(c)] & _CTYPE_S))
```

After setting setlocale(3) the ctype(3) arrays (_ctype_tab_,
_toupper_tab_, _tolower_tab_) are reload behind the scenes
and they are required to be marked as initialized.

Set them initialized inside the common setlocale(3) interceptor.

The arrays are of size of 257 elements: 0..255 + 1 (EOF).

This corrects errors on NetBSD/amd64 in applications
prebuilt with MSan.

Sponsored by <The NetBSD Foundation>

Reviewers: vitalybuka, dvyukov, joerg

Reviewed By: vitalybuka

Subscribers: llvm-commits, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 326008

6 years ago[Sanitizers] Increase allocated chunk limit for LargeMmapAllocator
Alex Shlyapnikov [Sat, 24 Feb 2018 01:00:27 +0000 (01:00 +0000)]
[Sanitizers] Increase allocated chunk limit for LargeMmapAllocator

Summary:
There are applications out there which allocate more than 1 << 18 large chunks
of memory (those handled by LargeMmapAllocator, aka secondary allocator).

For 64 bits, secondary allocator stores allocated chunks in a growing on
demand region of memory, growing in blocks of 128K, up to 1 << 20 chunks total.

Sanitizer internal allocator's secondary uses fixed size array storing up
to 1 << 15 chunks (down to 256K from 2Mb of memory used for that array).

Nothing is changed for 32 bits, chunks are still stored in the fixed size
array (up to 1 << 15 chunks).

Reviewers: eugenis

Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits

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

llvm-svn: 326007

6 years agoFix build breakage from r326003
Pavel Labath [Sat, 24 Feb 2018 00:54:31 +0000 (00:54 +0000)]
Fix build breakage from r326003

- an ambiguous reference to Optional<T> in llvm-dwarfdump.cpp (fixed
  with an explicit prefix).
- a missing base class initialization in Entry copy constructor (fixed
  by using the implicitly default constructor, which is possible after
  some changes which were done during review).

llvm-svn: 326006

6 years ago[llvm-objcopy] Fix typo in setSymTab
Alexander Shaposhnikov [Sat, 24 Feb 2018 00:41:01 +0000 (00:41 +0000)]
[llvm-objcopy] Fix typo in setSymTab

This diff fixes the name of the argument of
setSymTab and makes setSymTab/setStrTab private
(to make the public interface a bit cleaner).

Test plan: make check-all

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

llvm-svn: 326005

6 years ago[WebAssembly] Add exception handling option and feature
Heejin Ahn [Sat, 24 Feb 2018 00:40:50 +0000 (00:40 +0000)]
[WebAssembly] Add exception handling option and feature

Summary:
Add a llc command line option and WebAssembly architecture feature for
exception handling.

Reviewers: dschuff

Subscribers: jfb, sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 326004

6 years agoImplement equal_range for the DWARF v5 accelerator table
Pavel Labath [Sat, 24 Feb 2018 00:35:21 +0000 (00:35 +0000)]
Implement equal_range for the DWARF v5 accelerator table

Summary:
This patch implements the name lookup functionality of the .debug_names
accelerator table and hooks it up to "llvm-dwarfdump -find". To make the
interface of the two kinds of accelerator tables more consistent, I've
created an abstract "DWARFAcceleratorTable::Entry" class, which provides
a consistent interface to access the common functionality of the table
entries (such as getting the die offset, die tag, etc.). I've also
modified the apple table to vend entries conforming to this interface.

Reviewers: JDevlieghere, aprantl, probinson, dblaikie

Subscribers: vleschuk, clayborg, echristo, llvm-commits

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

llvm-svn: 326003

6 years agoDelete dead code in MachVMMemory.cpp, NFC
Vedant Kumar [Sat, 24 Feb 2018 00:17:05 +0000 (00:17 +0000)]
Delete dead code in MachVMMemory.cpp, NFC

This addresses a compiler warning.

llvm-svn: 326002

6 years ago[unittests] Disable lldb-server tests if an external debug server is in use
Vedant Kumar [Sat, 24 Feb 2018 00:17:04 +0000 (00:17 +0000)]
[unittests] Disable lldb-server tests if an external debug server is in use

The lldb-server unit tests don't test the right thing when the debug
server in use is copied from somewhere else. This can lead to spurious
test failures.

Disable these unit tests when an external debug server is in use.

Fixes llvm.org/PR36494.

llvm-svn: 326001

6 years ago[MemorySSA] Remove a redundant dyn_cast.
George Burgess IV [Sat, 24 Feb 2018 00:15:21 +0000 (00:15 +0000)]
[MemorySSA] Remove a redundant dyn_cast.

StartingAccess is a MemoryUseOrDef. No need to check again.

llvm-svn: 326000

6 years ago[X86] Remove checks for '(scalar_to_vector (i8 (trunc GR32:)))' from scalar masked...
Craig Topper [Sat, 24 Feb 2018 00:15:05 +0000 (00:15 +0000)]
[X86] Remove checks for '(scalar_to_vector (i8 (trunc GR32:)))' from scalar masked move patterns.

This portion can be matched by other patterns. We don't need it to make the larger pattern valid. It's sufficient to have a v1i1 mask input without caring where it came from.

llvm-svn: 325999

6 years agoAdd another test for PR36157.
Richard Smith [Sat, 24 Feb 2018 00:00:58 +0000 (00:00 +0000)]
Add another test for PR36157.

llvm-svn: 325998

6 years ago[ExprConstant] Fix crash when initialize an indirect field with another field.
Volodymyr Sapsai [Fri, 23 Feb 2018 23:59:20 +0000 (23:59 +0000)]
[ExprConstant] Fix crash when initialize an indirect field with another field.

When indirect field is initialized with another field, you have
MemberExpr with CXXThisExpr that corresponds to the field's immediate
anonymous parent. But 'this' was referring to the non-anonymous parent.
So when we were building LValue Designator, it was incorrect as it had
wrong starting point. Usage of such designator would cause unexpected
APValue changes and crashes.

The fix is in adjusting 'this' for indirect fields from non-anonymous
parent to the field's immediate parent.

Discovered by OSS-Fuzz:
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4985

rdar://problem/36359187

Reviewers: rsmith, efriedma

Reviewed By: rsmith

Subscribers: cfe-commits, jkorous-apple

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

llvm-svn: 325997

6 years agobpf: Hook target feature "alu32" with LLVM
Yonghong Song [Fri, 23 Feb 2018 23:55:29 +0000 (23:55 +0000)]
bpf: Hook target feature "alu32" with LLVM

LLVM has supported a new target feature "alu32" which could be enabled or
disabled by "-mattr=[+|-]alu32" when using llc.

This patch link Clang with it, so it could be also done by passing related
options to Clang, for example:

  -Xclang -target-feature -Xclang +alu32

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325996

6 years ago[AMDGPU] Fixed madak.ll test on VI, added GFX10. NFC.
Stanislav Mekhanoshin [Fri, 23 Feb 2018 23:53:27 +0000 (23:53 +0000)]
[AMDGPU] Fixed madak.ll test on VI, added GFX10. NFC.

llvm-svn: 325995

6 years ago[Sema][ObjC] Process category attributes before checking protocol uses
Alex Lorenz [Fri, 23 Feb 2018 23:49:43 +0000 (23:49 +0000)]
[Sema][ObjC] Process category attributes before checking protocol uses

This ensures that any availability attributes are attached to the
category before the availability for the referenced protocols is checked.

rdar://37829755

llvm-svn: 325994

6 years agobpf: New disassembler testcases for 32-bit subregister support
Yonghong Song [Fri, 23 Feb 2018 23:49:35 +0000 (23:49 +0000)]
bpf: New disassembler testcases for 32-bit subregister support

This patch test disassembler output for load/store instructions when
-mattr=+alu32 specified for which we want to use "w" register format.

Also, this patch extended the existing insn-unit.s and insn-unit-32.s to
make sure disassemblers for all other instructions are not affected.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325993

6 years agobpf: New codegen testcases for 32-bit subregister support
Yonghong Song [Fri, 23 Feb 2018 23:49:33 +0000 (23:49 +0000)]
bpf: New codegen testcases for 32-bit subregister support

This patch adds some unit tests for 32-bit subregister support.
We want to make sure ALU32, subregister load/store and new peephole
optimization are truely enabled once -mattr=+alu32 specified.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325992

6 years agobpf: New optimization pass for eliminating unnecessary i32 promotions
Yonghong Song [Fri, 23 Feb 2018 23:49:32 +0000 (23:49 +0000)]
bpf: New optimization pass for eliminating unnecessary i32 promotions

This pass performs peephole optimizations to cleanup ugly code sequences at
MachineInstruction layer.

Currently, the only optimization in this pass is to eliminate type
promotion
sequences for zero extending 32-bit subregisters to 64-bit registers.

If the compiler could prove the zero extended source come from 32-bit
subregistere then it is safe to erase those promotion sequece, because the
upper half of the underlying 64-bit registers were zeroed implicitly
already.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325991

6 years agobpf: New decoder namespace for 32-bit subregister load/store
Yonghong Song [Fri, 23 Feb 2018 23:49:31 +0000 (23:49 +0000)]
bpf: New decoder namespace for 32-bit subregister load/store

When -mattr=+alu32 passed to the disassembler, use decoder namespace for
32-bit subregister.

This is to disassemble load and store instructions in preferred B format
as described in previous commit:

      w = *(u8 *) (r + off) // BPF_LDX | BPF_B
      w = *(u16 *)(r + off) // BPF_LDX | BPF_H
      w = *(u32 *)(r + off) // BPF_LDX | BPF_W

      *(u8 *) (r + off) = w // BPF_STX | BPF_B
      *(u16 *)(r + off) = w // BPF_STX | BPF_H
      *(u32 *)(r + off) = w // BPF_STX | BPF_W

NOTE: all other instructions should still use the default decoder
      namespace.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325990

6 years agobpf: Enable 32-bit subregister support for -mattr=+alu32
Yonghong Song [Fri, 23 Feb 2018 23:49:30 +0000 (23:49 +0000)]
bpf: Enable 32-bit subregister support for -mattr=+alu32

After all those preparation patches, now we could enable 32-bit subregister
support once -mattr=+alu32 specified.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325989

6 years agobpf: Support 32-bit subregister in various InstrInfo hooks
Yonghong Song [Fri, 23 Feb 2018 23:49:29 +0000 (23:49 +0000)]
bpf: Support 32-bit subregister in various InstrInfo hooks

This patch support 32-bit subregister in three InstrInfo hooks, i.e.
copyPhysReg, loadRegFromStackSlot and storeRegToStackSlot,

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325988

6 years agobpf: New instruction patterns for 32-bit subregister load and store
Yonghong Song [Fri, 23 Feb 2018 23:49:28 +0000 (23:49 +0000)]
bpf: New instruction patterns for 32-bit subregister load and store

The instruction mapping between eBPF/arm64/x86_64 are:

         eBPF              arm64        x86_64
LD1   BPF_LDX | BPF_B       ldrb        movzbl
LD2   BPF_LDX | BPF_H       ldrh        movzwl
LD4   BPF_LDX | BPF_W       ldr         movl

movzbl/movzwl/movl on x86_64 accept 32-bit sub-register, for example %eax,
the same for ldrb/ldrh on arm64 which accept 32-bit "w" register. And
actually these instructions only accept sub-registers. There is no point
to have LD1/2/4 (unsigned) for 64-bit register, because on these arches,
upper 32-bits are guaranteed to be zeroed by hardware or VM, so load into
the smallest available register class is the best choice for maintaining
type information.

For eBPF we should adopt the same philosophy, to change current
format (A):

  r = *(u8 *) (r + off) // BPF_LDX | BPF_B
  r = *(u16 *)(r + off) // BPF_LDX | BPF_H
  r = *(u32 *)(r + off) // BPF_LDX | BPF_W

  *(u8 *) (r + off) = r // BPF_STX | BPF_B
  *(u16 *)(r + off) = r // BPF_STX | BPF_H
  *(u32 *)(r + off) = r // BPF_STX | BPF_W

into B:

  w = *(u8 *) (r + off) // BPF_LDX | BPF_B
  w = *(u16 *)(r + off) // BPF_LDX | BPF_H
  w = *(u32 *)(r + off) // BPF_LDX | BPF_W

  *(u8 *) (r + off) = w // BPF_STX | BPF_B
  *(u16 *)(r + off) = w // BPF_STX | BPF_H
  *(u32 *)(r + off) = w // BPF_STX | BPF_W

There is no change on encoding nor how should they be interpreted,
everything is as it is, load the specified length, write into low bits of
the register then zeroing all remaining high bits.

The only change is their associated register class and how compiler view
them.

Format A still need to be kept, because eBPF LLVM backend doesn't support
sub-registers at default, but once 32-bit subregister is enabled, it should
use format B.

This patch implemented this together with all those necessary extended load
and truncated store patterns.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325987

6 years agobpf: Support i32 in getScalarShiftAmountTy method
Yonghong Song [Fri, 23 Feb 2018 23:49:26 +0000 (23:49 +0000)]
bpf: Support i32 in getScalarShiftAmountTy method

getScalarShiftAmount method should be implemented for eBPF backend to make
sure shift amount could still get correct type once 32-bit subregisters
support are enabled.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325986

6 years agobpf: Support condition comparison on i32
Yonghong Song [Fri, 23 Feb 2018 23:49:25 +0000 (23:49 +0000)]
bpf: Support condition comparison on i32

We need to support condition comparison on i32. All these comparisons are
supposed to be combined into BPF_J* instructions which only support i64.

For ISD::BR_CC we need to promote it to i64 first, then do custom lowering.

For ISD::SET_CC, just expand to SELECT_CC like what's been done for i64.

For ISD::SELECT_CC, we also want to do custom lower for i32. However, after
32-bit subregister support enabled, it is possible the comparison operands
are i32 while the selected value are i64, or the comparison operands are
i64 while the selected value are i32. We need to define extra instruction
pattern and support them in custom instruction inserter.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325985

6 years agobpf: Handle i32 for ALU operations without ISA support
Yonghong Song [Fri, 23 Feb 2018 23:49:24 +0000 (23:49 +0000)]
bpf: Handle i32 for ALU operations without ISA support

There is no eBPF ISA support for BSWAP, ROTR, ROTL, SREM, SDIVREM, MULHU,
ADDC, ADDE etc on i32.

They could be emulated by other basic BPF_ALU operations, we'd set their
lowering action the same as i64.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325984

6 years agobpf: New calling convention for 32-bit subregisters
Yonghong Song [Fri, 23 Feb 2018 23:49:23 +0000 (23:49 +0000)]
bpf: New calling convention for 32-bit subregisters

This patch add new calling conventions to allow GPR32RegClass as valid
register class for arguments and return types.

New calling convention will only be choosen when -mattr=+alu32 specified.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325983

6 years agobpf: New target attribute "alu32" for 32-bit subregister support
Yonghong Song [Fri, 23 Feb 2018 23:49:22 +0000 (23:49 +0000)]
bpf: New target attribute "alu32" for 32-bit subregister support

This new attribute aims to control the enablement of 32-bit subregister
support on eBPF backend.

Name the interface as "alu32" is because we in particular want to enable
the generation of BPF_ALU32 instructions by enable subregister support.

This attribute could be used in the following format with llc:

  llc -mtriple=bpf -mattr=[+|-]alu32

It is disabled at default.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325982

6 years agobpf: Define instruction patterns for extensions and truncations between i32 to i64
Yonghong Song [Fri, 23 Feb 2018 23:49:21 +0000 (23:49 +0000)]
bpf: Define instruction patterns for extensions and truncations between i32 to i64

For transformations between i32 and i64, if it is explicit signed extension:
  - first cast the operand to i64
  - then use SLL + SRA to finish the extension.

if it is explicit zero extension:
  - first cast the operand to i64
  - then use SLL + SRL to finish the extension.

if it is explicit any extension:
  - just refer to 64-bit register.

if it is explicit truncation:
  - just refer to 32-bit subregister.

NOTE: Some of the zero extension sequences might be unnecessary, they will be
removed by an peephole pass on MachineInstruction layer.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325981

6 years agobpf: Tighten the immediate predication for 32-bit alu instructions
Yonghong Song [Fri, 23 Feb 2018 23:49:19 +0000 (23:49 +0000)]
bpf: Tighten the immediate predication for 32-bit alu instructions

These 32-bit ALU insn patterns which takes immediate as one operand were
initially added to enable AsmParser support, and the AsmMatcher uses "ins"
and "outs" fields to deduct the operand constraint.

However, the instruction selector doesn't work the same as AsmMatcher. The
selector will use the "pattern" field for which we are not setting the
predication for immediate operands correctly.

Without this patch, i32 would eventually means all i32 operands are valid,
both imm and gpr, while these patterns should allow imm only.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325980

6 years agobpf: Use markSuperRegs to mark reserved registers
Yonghong Song [Fri, 23 Feb 2018 23:49:18 +0000 (23:49 +0000)]
bpf: Use markSuperRegs to mark reserved registers

markSuperRegs is the canonical helper function used to mark reserved
registers. It could mark any overlapping sub-registers automatically.

Reviewed-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
llvm-svn: 325979

6 years ago[CFG] Try to narrow down MSVC compiler crash via binary search.
Artem Dergachev [Fri, 23 Feb 2018 23:38:41 +0000 (23:38 +0000)]
[CFG] Try to narrow down MSVC compiler crash via binary search.

Split the presumably offending function in two to see which part of it causes
the crash to occur.

The crash was introduced in r325966.
r325969 did not help.

llvm-svn: 325978

6 years ago[analyzer] Relax the assert used when traversing the node graph.
George Karpenkov [Fri, 23 Feb 2018 23:26:57 +0000 (23:26 +0000)]
[analyzer] Relax the assert used when traversing the node graph.

The assertion gets exposed when changing the exploration order.
This is a quick hacky fix, but the intention is that if the nodes do
merge, it should not matter which predecessor should be traverse.
A proper fix would be not to traverse predecessors at all, as all
information relevant for any decision should be avilable locally.

rdar://37540480

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

llvm-svn: 325977

6 years ago[analyzer] mark returns of functions where the region passed as parameter was not...
George Karpenkov [Fri, 23 Feb 2018 23:26:56 +0000 (23:26 +0000)]
[analyzer] mark returns of functions where the region passed as parameter was not initialized

In the wild, many cases of null pointer dereference, or uninitialized
value read occur because the value was meant to be initialized by the
inlined function, but did not, most often due to error condition in the
inlined function.
This change highlights the return branch taken by the inlined function,
in order to help user understand the error report and see why the value
was uninitialized.

rdar://36287652

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

llvm-svn: 325976

6 years ago[analyzer] Consider switch- and goto- labels when constructing the set of executed...
George Karpenkov [Fri, 23 Feb 2018 23:26:54 +0000 (23:26 +0000)]
[analyzer] Consider switch- and goto- labels when constructing the set of executed lines

When viewing the report in the collapsed mode the label signifying where
did the execution go is often necessary for properly understanding the
context.

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

llvm-svn: 325975

6 years agoFix a compiler warning in ModuleCacheTest.cpp, NFC
Vedant Kumar [Fri, 23 Feb 2018 23:18:27 +0000 (23:18 +0000)]
Fix a compiler warning in ModuleCacheTest.cpp, NFC

llvm-svn: 325974

6 years ago[DebugInfo] Add remaining files to r325970
Scott Linder [Fri, 23 Feb 2018 23:13:18 +0000 (23:13 +0000)]
[DebugInfo] Add remaining files to r325970

Add files which I missed in the original check-in

llvm-svn: 325973

6 years ago[PowerPC] Disable shrink-wrapping when getting PC address through the LR
Nemanja Ivanovic [Fri, 23 Feb 2018 23:08:34 +0000 (23:08 +0000)]
[PowerPC] Disable shrink-wrapping when getting PC address through the LR

The instruction sequence used to get the address of the PC into a GPR requires
that we clobber the link register. Doing so without having first saved it in
the prologue leaves the function unable to return. Currently, this sequence is
emitted into the entry block. To ensure the prologue is inserted before this
sequence, disable shrink-wrapping.

This fixes PR33547.

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

llvm-svn: 325972

6 years ago[MemorySSA] Fix a cache invalidation bug with removed accesses
George Burgess IV [Fri, 23 Feb 2018 23:07:18 +0000 (23:07 +0000)]
[MemorySSA] Fix a cache invalidation bug with removed accesses

I suspect there's a deeper issue here, but we probably shouldn't be
using INVALID_MEMORYSSA_ID as liveOnEntry's ID anyway.

llvm-svn: 325971

6 years ago[DebugInfo] Support DWARF v5 source code embedding extension
Scott Linder [Fri, 23 Feb 2018 23:01:06 +0000 (23:01 +0000)]
[DebugInfo] Support DWARF v5 source code embedding extension

In DWARF v5 the Line Number Program Header is extensible, allowing values with
new content types. In this extension a content type is added,
DW_LNCT_LLVM_source, which contains the embedded source code of the file.

Add new optional attribute for !DIFile IR metadata called source which contains
source text. Use this to output the source to the DWARF line table of code
objects. Analogously extend METADATA_FILE in Bitcode and .file directive in ASM
to support optional source.

Teach llvm-dwarfdump and llvm-objdump about the new values. Update the output
format of llvm-dwarfdump to make room for the new attribute on file_names
entries, and support embedded sources for the -source option in llvm-objdump.

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

llvm-svn: 325970

6 years ago[CFG] NFC: Speculative attempt to fix MSVC internal compiler error on buildbot.
Artem Dergachev [Fri, 23 Feb 2018 22:49:25 +0000 (22:49 +0000)]
[CFG] NFC: Speculative attempt to fix MSVC internal compiler error on buildbot.

Don't use fancy initialization and member access in a DenseMap.

llvm-svn: 325969

6 years ago[InstCombine] simplify code for fabs(X) * fabs(X) -> X * X; NFC
Sanjay Patel [Fri, 23 Feb 2018 22:38:10 +0000 (22:38 +0000)]
[InstCombine] simplify code for fabs(X) * fabs(X) -> X * X; NFC

llvm-svn: 325968

6 years agoSink the verification code around the assert where it's handled and wrap in NDEBUG.
Eric Christopher [Fri, 23 Feb 2018 22:32:05 +0000 (22:32 +0000)]
Sink the verification code around the assert where it's handled and wrap in NDEBUG.

This has the advantage of making release only builds more warning
free and there's no need to make this routine a class function if
it isn't using class members anyhow.

llvm-svn: 325967

6 years ago[CFG] [analyzer] NFC: Allow more complicated construction contexts.
Artem Dergachev [Fri, 23 Feb 2018 22:20:39 +0000 (22:20 +0000)]
[CFG] [analyzer] NFC: Allow more complicated construction contexts.

ConstructionContexts introduced in D42672 are an additional piece of information
included with CFGConstructor elements that help the client of the CFG (such as
the Static Analyzer) understand where the newly constructed object is stored.

The patch refactors the ConstructionContext class to prepare for including
multi-layered contexts that are being constructed gradually, layer-by-layer,
as the AST is traversed.

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

llvm-svn: 325966

6 years ago[InstSimplify] sqrt(X) * sqrt(X) --> X
Sanjay Patel [Fri, 23 Feb 2018 22:20:13 +0000 (22:20 +0000)]
[InstSimplify] sqrt(X) * sqrt(X) --> X

This was misplaced in InstCombine. We can loosen the FMF as a follow-up step.

llvm-svn: 325965

6 years ago[Utility] Simplify and generalize the CleanUp helper, NFC
Vedant Kumar [Fri, 23 Feb 2018 22:08:38 +0000 (22:08 +0000)]
[Utility] Simplify and generalize the CleanUp helper, NFC

Removing the template arguments and most of the mutating methods from
CleanUp makes it easier to understand and reuse.

In its present state, CleanUp would be too cumbersome to adapt to cases
where multiple objects need to be released. Take for example this change
in swift-lldb:

  https://github.com/apple/swift-lldb/pull/334/files#diff-6f474df750f75c8ba675f2a8408a5629R219

This change is simple to express with the new CleanUp, but not so simple
with the old version.

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

llvm-svn: 325964

6 years ago[ELF] Fix IsPreemptible comment and typo. NFC
Fangrui Song [Fri, 23 Feb 2018 21:57:49 +0000 (21:57 +0000)]
[ELF] Fix IsPreemptible comment and typo. NFC

llvm-svn: 325963

6 years agoIntrinsics calls should avoid the PLT when "RtLibUseGOT" metadata is present.
Sriraman Tallam [Fri, 23 Feb 2018 21:32:06 +0000 (21:32 +0000)]
Intrinsics calls should avoid the PLT when "RtLibUseGOT" metadata is present.

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

llvm-svn: 325962

6 years agoSet Module Metadata "RtLibUseGOT" when fno-plt is used.
Sriraman Tallam [Fri, 23 Feb 2018 21:27:33 +0000 (21:27 +0000)]
Set Module Metadata "RtLibUseGOT" when fno-plt is used.

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

llvm-svn: 325961

6 years ago[InstCombine] allow fmul-sqrt folds with less than full -ffast-math
Sanjay Patel [Fri, 23 Feb 2018 21:16:12 +0000 (21:16 +0000)]
[InstCombine] allow fmul-sqrt folds with less than full -ffast-math

Also, add a Builder method for intrinsics to reduce code duplication for clients.

llvm-svn: 325960

6 years agoSimplify a DEBUG statement to remove a set but not used variable in release builds.
Eric Christopher [Fri, 23 Feb 2018 21:14:47 +0000 (21:14 +0000)]
Simplify a DEBUG statement to remove a set but not used variable in release builds.

llvm-svn: 325959

6 years agoFix breakpoint thread name conditionals after breakpoint options refactor.
Jim Ingham [Fri, 23 Feb 2018 21:10:42 +0000 (21:10 +0000)]
Fix breakpoint thread name conditionals after breakpoint options refactor.

PR36435

llvm-svn: 325958