platform/upstream/llvm.git
5 years ago[InstCombine] Tests for fold Select with binary op
David Bolvansky [Sat, 28 Jul 2018 17:13:33 +0000 (17:13 +0000)]
[InstCombine] Tests for fold Select with binary op

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

llvm-svn: 338201

5 years ago[InstCombine] try to fold 'sub' to 'not'
Sanjay Patel [Sat, 28 Jul 2018 16:48:44 +0000 (16:48 +0000)]
[InstCombine] try to fold 'sub' to 'not'

https://rise4fun.com/Alive/jDd

Patterns with add/sub combos can be improved using
'not' ops. This is better for analysis and may lead
to follow-on transforms because 'xor' and 'add' are
commutative/associative. It can also help codegen.

llvm-svn: 338200

5 years ago[UBSan] Strengthen pointer checks in 'new' expressions
Serge Pavlov [Sat, 28 Jul 2018 15:33:03 +0000 (15:33 +0000)]
[UBSan] Strengthen pointer checks in 'new' expressions

With this change compiler generates alignment checks for wider range
of types. Previously such checks were generated only for the record types
with non-trivial default constructor. So the types like:

    struct alignas(32) S2 { int x; };
    typedef __attribute__((ext_vector_type(2), aligned(32))) float float32x2_t;

did not get checks when allocated by 'new' expression.

This change also optimizes the checks generated for the arrays created
in 'new' expressions. Previously the check was generated for each
invocation of type constructor. Now the check is generated only once
for entire array.

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

llvm-svn: 338199

5 years ago[AArch64][SVE] Asm: Support for PFALSE and PTEST instructions.
Sander de Smalen [Sat, 28 Jul 2018 14:18:11 +0000 (14:18 +0000)]
[AArch64][SVE] Asm: Support for PFALSE and PTEST instructions.

This patch adds PFALSE (unconditionally sets all elements of
the predicate to false) and PTEST (set the status flags for the
predicate).

llvm-svn: 338198

5 years agoAMDGPU: Stop wasting argument registers with v3i32/v3f32
Matt Arsenault [Sat, 28 Jul 2018 14:11:34 +0000 (14:11 +0000)]
AMDGPU: Stop wasting argument registers with v3i32/v3f32

SelectionDAGBuilder widens v3i32/v3f32 arguments to
to v4i32/v4f32 which consume an additional register.
In addition to wasting argument space, this produces extra
instructions since now it appears the 4th vector component has
a meaningful value to most combines.

llvm-svn: 338197

5 years ago[AArch64][SVE] Asm: Data-dependent loop predicate partitioning instructions.
Sander de Smalen [Sat, 28 Jul 2018 14:04:52 +0000 (14:04 +0000)]
[AArch64][SVE] Asm: Data-dependent loop predicate partitioning instructions.

This patch adds support for instructions that partition a predicate
based on data-dependent termination conditions in a loop.

  BRKA      Break after the first true condition
  BRKAS     Break after the first true condition, setting condition flags
  BRKB      Break before the first true condition
  BRKBS     Break before the first true condition, setting condition flags

  BRKPA     Break after the first true condition, propagating from the
            previous partition
  BRKPAS    Break after the first true condition, propagating from the
            previous partition, setting condition flags
  BRKPB     Break before the first true condition, propagating from the
            previous partition
  BRKPBS    Break before the first true condition, propagating from the
            previous partition, setting condition flags

  BRKN      Propagate break to next partition
  BKRNS     Propagate break to next partition, setting condition flags

llvm-svn: 338196

5 years ago[InstSimplify] Moved Select + AND/OR tests from InstCombine
David Bolvansky [Sat, 28 Jul 2018 13:52:45 +0000 (13:52 +0000)]
[InstSimplify] Moved Select + AND/OR tests from InstCombine

Subscribers: llvm-commits

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

llvm-svn: 338195

5 years agoDAG: Add calling convention argument to calling convention funcs
Matt Arsenault [Sat, 28 Jul 2018 13:25:19 +0000 (13:25 +0000)]
DAG: Add calling convention argument to calling convention funcs

This seems like a pretty glaring omission, and AMDGPU
wants to treat kernels differently from other calling
conventions.

llvm-svn: 338194

5 years agoAMDGPU: Stop trying to extend arguments for clover
Matt Arsenault [Sat, 28 Jul 2018 12:34:25 +0000 (12:34 +0000)]
AMDGPU: Stop trying to extend arguments for clover

This was trying to replace i8/i16 arguments with i32, which
was broken and no longer necessary.

llvm-svn: 338193

5 years ago[GlobalOpt] Test array indices inside structs for out-of-bounds accesses
David Green [Sat, 28 Jul 2018 08:20:10 +0000 (08:20 +0000)]
[GlobalOpt] Test array indices inside structs for out-of-bounds accesses

We now, from clang, can turn arrays of
  static short g_data[] = {16, 16, 16, 16, 16, 16, 16, 16, 0, 0, 0, 0, 0, 0, 0, 0};
into structs of the form
  @g_data = internal global <{ [8 x i16], [8 x i16] }> ...

GlobalOpt will incorrectly SROA it, not realising that the access to the first
element may overflow into the second. This fixes it by checking geps more
thoroughly.

I believe this makes the globalsra-partial.ll test case invalid as the %i value
could be out of bounds. I've re-purposed it as a negative test for this case.

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

llvm-svn: 338192

5 years ago[InstCombine] Fold Select with AND/OR condition
David Bolvansky [Sat, 28 Jul 2018 06:55:51 +0000 (06:55 +0000)]
[InstCombine] Fold Select with AND/OR condition

Summary:
Fold
```
%A = icmp ne i8 %X, %V1
%B = icmp ne i8 %X, %V2
%C = or i1 %A, %B
%D = select i1 %C, i8 %X, i8 %V1
ret i8 %D
  =>
ret i8 %X

Fixes https://bugs.llvm.org/show_bug.cgi?id=38334
Proof: https://rise4fun.com/Alive/plI8

Reviewers: spatel, lebedev.ri

Reviewed By: lebedev.ri

Subscribers: craig.topper, llvm-commits

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

llvm-svn: 338191

5 years ago[demangler] Fix an oss-fuzz bug from r338138
Erik Pilkington [Sat, 28 Jul 2018 04:06:30 +0000 (04:06 +0000)]
[demangler] Fix an oss-fuzz bug from r338138

Stack overflow on invalid. While collapsing references, we were skipping over a
cycle check in ForwardTemplateReference leading to a stack overflow. This commit
fixes the problem by duplicating the cycle check in ReferenceType.

llvm-svn: 338190

5 years ago[Sema][ObjC] Warn when a method declared in a protocol takes a
Akira Hatanaka [Sat, 28 Jul 2018 04:06:13 +0000 (04:06 +0000)]
[Sema][ObjC] Warn when a method declared in a protocol takes a
non-escaping parameter but the implementation's method takes an escaping
parameter.

rdar://problem/39548196

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

llvm-svn: 338189

5 years ago[CUDA][HIP] Allow function-scope static const variable
Yaxun Liu [Sat, 28 Jul 2018 03:05:25 +0000 (03:05 +0000)]
[CUDA][HIP] Allow function-scope static const variable

CUDA 8.0 E.3.9.4 says: Within the body of a __device__ or __global__
function, only __shared__ variables or variables without any device
memory qualifiers may be declared with static storage class.

It is unclear how a function-scope non-const static variable
without device memory qualifier is implemented, therefore only static
const variable without device memory qualifier is allowed, which
can be emitted as a global variable in constant address space.

Currently clang only allows function-scope static variable with
__shared__ qualifier.

This patch also allows function-scope static const variable without
device memory qualifier and emits it as a global variable in constant
address space.

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

llvm-svn: 338188

5 years ago[AST] Add a convenient getter from QualType to RecordDecl
George Karpenkov [Sat, 28 Jul 2018 02:16:13 +0000 (02:16 +0000)]
[AST] Add a convenient getter from QualType to RecordDecl

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

llvm-svn: 338187

5 years agoCompile SemaTemplate.cpp with /bigobj on MSVC
Erik Pilkington [Sat, 28 Jul 2018 01:29:31 +0000 (01:29 +0000)]
Compile SemaTemplate.cpp with /bigobj on MSVC

This should fix some bot failures introduced by r338165.

llvm-svn: 338186

5 years ago[test] Remove non-JSPON comments in JSCOP file. NFC.
Michael Kruse [Sat, 28 Jul 2018 01:11:45 +0000 (01:11 +0000)]
[test] Remove non-JSPON comments in JSCOP file. NFC.

llvm-svn: 338185

5 years ago[Dominators] Make applyUpdate's documentation less confusing [NFC]
Jakub Kuderski [Sat, 28 Jul 2018 00:54:07 +0000 (00:54 +0000)]
[Dominators] Make applyUpdate's documentation less confusing [NFC]

Summary:
It was pointed out by @chandlerc that it's not clear whether both applyUpdates and insert/deleteEdge can be used to perform multiple updates.

IMO, the confusing part was that the comment above applyUpdates made a comparison of expected update time between calling it and calling insert/deleteEdge multiple times. It's generally not possible to safely call insert/deleteEdge multiple times, which documentation for each of the 3 functions warns about, so the whole comparison makes very little sense. On top of that, the comment is already lengthy, so I think it's best to just get rid of this comparison.

Reviewers: chandlerc, asbirlea, NutshellySima, grosser

Reviewed By: chandlerc

Subscribers: llvm-commits, chandlerc

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

llvm-svn: 338184

5 years ago[CFG] Remove duplicate function/class names at the beginning of comments
Fangrui Song [Sat, 28 Jul 2018 00:48:05 +0000 (00:48 +0000)]
[CFG] Remove duplicate function/class names at the beginning of comments

Some functions/classes have renamed while the comments still use the old names. Delete them per coding style.

Also some whitespace cleanup.

llvm-svn: 338183

5 years ago[docs] Clarify role of DIExpressions within debug intrinsics
Vedant Kumar [Sat, 28 Jul 2018 00:33:47 +0000 (00:33 +0000)]
[docs] Clarify role of DIExpressions within debug intrinsics

This should make the semantics of DIExpressions within llvm.dbg.{addr,
declare, value} easier to understand.

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

llvm-svn: 338182

5 years ago[DAGCombiner] Teach DAG combiner that A-(B-C) can be folded to A+(C-B)
Craig Topper [Sat, 28 Jul 2018 00:27:25 +0000 (00:27 +0000)]
[DAGCombiner] Teach DAG combiner that A-(B-C) can be folded to A+(C-B)

This can be useful since addition is commutable, and subtraction is not.

This matches a transform that is also done by InstCombine.

llvm-svn: 338181

5 years ago[SimpleLoopUnswitch] Fix DT updates for trivial branch unswitching.
Alina Sbirlea [Sat, 28 Jul 2018 00:01:05 +0000 (00:01 +0000)]
[SimpleLoopUnswitch] Fix DT updates for trivial branch unswitching.

Summary:
Fixing 2 issues with the DT update in trivial branch switching, though I don't have a case where DT update fails.
1. After splitting ParentBB->UnswitchedBB edge, new edges become: ParentBB->LoopExitBB->UnswitchedBB, so remove ParentBB->LoopExitBB edge.
2. AFAIU, for multiple CFG changes, DT should be updated using batch updates, vs consecutive addEdge and removeEdge calls.

Reviewers: chandlerc, kuhar

Subscribers: sanjoy, jlebar, llvm-commits

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

llvm-svn: 338180

5 years agoAdd the actually calculated completions to COMPLETION_MSG
Raphael Isemann [Fri, 27 Jul 2018 23:42:34 +0000 (23:42 +0000)]
Add the actually calculated completions to COMPLETION_MSG

Summary: Otherwise this assertion message is not very useful to whoever is reading the log.

Subscribers: lldb-commits

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

llvm-svn: 338179

5 years agoRevert "Stop building liblldb with CMake's framework functionality"
Alex Langford [Fri, 27 Jul 2018 23:38:58 +0000 (23:38 +0000)]
Revert "Stop building liblldb with CMake's framework functionality"

This reverts r338154. This change is actually unnecessary, as the CMake
bug I referred to was actually not a bug but a misunderstanding of
CMake.

Original Differential Revision: https://reviews.llvm.org/D49888

llvm-svn: 338178

5 years agoAdd missing boundary checks to variable completion.
Raphael Isemann [Fri, 27 Jul 2018 23:37:08 +0000 (23:37 +0000)]
Add missing boundary checks to variable completion.

Summary: Stopgap patch to at least stop all the crashes I get from this code.

Subscribers: lldb-commits

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

llvm-svn: 338177

5 years agoRevert "[WebAssembly] Added default stack-only instruction mode for MC."
Wouter van Oortmerssen [Fri, 27 Jul 2018 23:19:51 +0000 (23:19 +0000)]
Revert "[WebAssembly] Added default stack-only instruction mode for MC."

This reverts commit d3c9af4179eae7793d1487d652e2d4e23844555f.
(SVN revision 338164)

llvm-svn: 338176

5 years ago[Support] Remove unnecessary MemoryBuffer::anchor (where the destructor serves as...
Fangrui Song [Fri, 27 Jul 2018 23:12:11 +0000 (23:12 +0000)]
[Support] Remove unnecessary MemoryBuffer::anchor (where the destructor serves as the key function)

llvm-svn: 338175

5 years ago[X86] Add support expanding multiplies by constant where the constant is -3/-5/-9...
Craig Topper [Fri, 27 Jul 2018 23:04:59 +0000 (23:04 +0000)]
[X86] Add support expanding multiplies by constant where the constant is -3/-5/-9 multplied by a power of 2.

These can be replaced with an LEA, a shift, and a negate. This seems to match what gcc and icc would do.

llvm-svn: 338174

5 years ago[llvm-objcopy] Make --strip-debug strip .zdebug* (zlib-gnu) sections
Fangrui Song [Fri, 27 Jul 2018 22:51:36 +0000 (22:51 +0000)]
[llvm-objcopy] Make --strip-debug strip .zdebug* (zlib-gnu) sections

This behavior matches GNU objcopy.

llvm-svn: 338173

5 years ago[InstrProf] Don't register __llvm_profile_runtime_user
Reid Kleckner [Fri, 27 Jul 2018 22:21:35 +0000 (22:21 +0000)]
[InstrProf] Don't register __llvm_profile_runtime_user

Refactor some FileCheck prefixes while I'm at it.

Fixes PR38340

llvm-svn: 338172

5 years agoFix whitespace in the python test suite.
Raphael Isemann [Fri, 27 Jul 2018 22:20:59 +0000 (22:20 +0000)]
Fix whitespace in the python test suite.

Summary:
The test suite has often unnecessary trailing whitespace, and sometimes
unnecessary trailing lines or a missing final new line. This patch just strips
trailing whitespace/lines and adds missing newlines at the end.

Subscribers: ki.stfu, JDevlieghere, christof, lldb-commits

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

llvm-svn: 338171

5 years agoParse a possible trailing postfix expression suffix after a fold expression
Nicolas Lesser [Fri, 27 Jul 2018 21:55:12 +0000 (21:55 +0000)]
Parse a possible trailing postfix expression suffix after a fold expression

Summary:
This patch allows the parsing of a postfix expression involving a fold expression, which is legal as a fold-expression is a primary-expression.

See also https://llvm.org/pr38282

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

llvm-svn: 338170

5 years ago[Sema] Use a TreeTransform to extract deduction guide parameter types
Erik Pilkington [Fri, 27 Jul 2018 21:23:48 +0000 (21:23 +0000)]
[Sema] Use a TreeTransform to extract deduction guide parameter types

Previously, we just canonicalized the type, but this lead to crashes with
parameter types that referred to ParmVarDecls of the constructor. There may be
more cases that this TreeTransform needs to handle though, such as a constructor
parameter type referring to a member in an unevaluated context. Canonicalization
doesn't address these cases either though, so we can address them as-needed in
follow-up commits.

rdar://41330135

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

llvm-svn: 338165

5 years ago[WebAssembly] Added default stack-only instruction mode for MC.
Wouter van Oortmerssen [Fri, 27 Jul 2018 20:56:43 +0000 (20:56 +0000)]
[WebAssembly] Added default stack-only instruction mode for MC.

Summary:
Moved Explicit Locals pass to last.
Made that pass obligatory.
Made it convert from register to stack based instructions, and removed the registers.
Fixes to related code that was expecting register based instructions.
Added the correct testing flag to all tests, depending on what the
format they were expecting so far.
Translated one test to stack format as example: reg-stackify-stack.ll

tested:
llvm-lit -v `find test -name WebAssembly`
unittests/MC/*

Reviewers: dschuff, sunfish

Subscribers: sbc100, jgravelle-google, eraman, aheejin, llvm-commits

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

llvm-svn: 338164

5 years agoRevert "Recommit [DataFormatters] Add formatter for C++17 std::optional."
Davide Italiano [Fri, 27 Jul 2018 20:38:01 +0000 (20:38 +0000)]
Revert "Recommit [DataFormatters] Add formatter for C++17 std::optional."

This broke a linux bot which doesn't support -std=c++17. The solution
is to add a decorator to skip these tests on machines with older compilers.

llvm-svn: 338162

5 years ago[InstCombine] [NFC] [Tests] Fold Select with AND/OR condition - fixed
David Bolvansky [Fri, 27 Jul 2018 20:29:32 +0000 (20:29 +0000)]
[InstCombine] [NFC] [Tests] Fold Select with AND/OR condition - fixed

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

llvm-svn: 338161

5 years agoRecommit "Enable MachineOutliner by default under -Oz for AArch64"
Jessica Paquette [Fri, 27 Jul 2018 20:18:27 +0000 (20:18 +0000)]
Recommit "Enable MachineOutliner by default under -Oz for AArch64"

Fixed the ASAN failure from before in r338148, so recommiting.

This patch enables the MachineOutliner by default in AArch64 under -Oz.

The MachineOutliner offers around a 4.5% improvement on the current -Oz code
size improvements.

We have done work into improving the debuggability of outlined code, so that
users of -Oz won't be surprised by the optimization. We have also been executing
the LLVM test suite and common external tests such as the SPEC suites
continuously with no issue. The outliner has a low compile-time overhead of
roughly 1%. At this point, the outliner would be a really good addition to the
-Oz pass pipeline!

llvm-svn: 338160

5 years ago[InstCombine] [NFC] [Tests] Fold Select with AND/OR condition
David Bolvansky [Fri, 27 Jul 2018 20:18:12 +0000 (20:18 +0000)]
[InstCombine] [NFC] [Tests] Fold Select with AND/OR condition

Subscribers: llvm-commits

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

llvm-svn: 338159

5 years ago[DEBUG_INFO] Fix tests, NFC.
Alexey Bataev [Fri, 27 Jul 2018 20:16:44 +0000 (20:16 +0000)]
[DEBUG_INFO] Fix tests, NFC.

llvm-svn: 338158

5 years ago[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4
Jordan Rupprecht [Fri, 27 Jul 2018 20:02:58 +0000 (20:02 +0000)]
[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4

Summary:
[libc++] Exclude posix_l/strtonum fallback inclusion for newlib > 2.4

r338122 changed the linkage of some methods which revealed an existing ODR violation, e.g.:
projects/libcxx/include/support/xlocale/__posix_l_fallback.h:83:38: error: 'internal_linkage' attribute does not appear on the first declaration of 'iswcntrl_l'
inline _LIBCPP_INLINE_VISIBILITY int iswcntrl_l(wint_t c, locale_t) {
                                     ^
lib/include/wctype.h:55:12: note: previous definition is here
extern int      iswcntrl_l (wint_t, locale_t);

These were added to newlib in 2.4 [1] [2], so move them to the already existing include guard.

[1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=238455adfab4f8070ac65400aac22bb8a9e502fc
[2] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commit;h=8493c1631643fada62384768408852bc0fa6ff44

Reviewers: ldionne, rsmith, EricWF

Subscribers: christof, cfe-commits

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

llvm-svn: 338157

5 years agoRecommit [DataFormatters] Add formatter for C++17 std::optional.
Davide Italiano [Fri, 27 Jul 2018 19:57:30 +0000 (19:57 +0000)]
Recommit [DataFormatters] Add formatter for C++17 std::optional.

This should have all the correct files now.
<rdar://problem/41471112>
Patch by Shafik Yaghmour.

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

llvm-svn: 338156

5 years ago[DEBUGINFO] Disable unsupported debug info options for NVPTX target.
Alexey Bataev [Fri, 27 Jul 2018 19:45:14 +0000 (19:45 +0000)]
[DEBUGINFO] Disable unsupported debug info options for NVPTX target.

Summary:
Some targets support only default set of the debug options and do not
support additional debug options, like NVPTX target. Patch introduced
virtual function supportsDebugInfoOptions() that can be overloaded
by the toolchain, checks if the target supports some debug
options and emits warning when an unsupported debug option is
found.

Reviewers: echristo

Subscribers: aprantl, JDevlieghere, cfe-commits

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

llvm-svn: 338155

5 years agoStop building liblldb with CMake's framework functionality
Alex Langford [Fri, 27 Jul 2018 19:41:17 +0000 (19:41 +0000)]
Stop building liblldb with CMake's framework functionality

Summary:
CMake has a bug in its ninja generator that prevents you from
installing targets that are built with framework support. Therefore, I want to
not rely on CMake's framework support.
See https://gitlab.kitware.com/cmake/cmake/issues/18216

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

llvm-svn: 338154

5 years agoReland r338088, "ELF: Make --print-icf-sections output deterministic."
Peter Collingbourne [Fri, 27 Jul 2018 19:10:44 +0000 (19:10 +0000)]
Reland r338088, "ELF: Make --print-icf-sections output deterministic."

The xxHash64 function has been made unsigned-char-independent, so
we can reland this change now.

Original commit message:
> The icf-safe.s test currently fails on 32-bit platforms because it uses
> the --print-icf-sections flag and depends on the output appearing in
> a specific order. However, this flag causes the output to depend on
> the order of the sections in the Sections array, which depends on the
> hash values returned from hash_combine, which happen to be different
> for that test between 32-bit and 64-bit platforms.
>
> This change makes the output deterministic by using xxHash64 instead of
> hash_combine.

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

llvm-svn: 338153

5 years ago[SLC] Test simplification of pow(x, 0.333...) to cbrt(x) (NFC)
Evandro Menezes [Fri, 27 Jul 2018 18:56:47 +0000 (18:56 +0000)]
[SLC] Test simplification of pow(x, 0.333...) to cbrt(x) (NFC)

Add test case for simplifying `pow(x, 0.333...)` into `cbrt(x)`, which
D49040 enables.

llvm-svn: 338152

5 years agoNarrow the CompletionRequest API to being append-only.
Raphael Isemann [Fri, 27 Jul 2018 18:42:46 +0000 (18:42 +0000)]
Narrow the CompletionRequest API to being append-only.

Summary:
We currently allow any completion handler to read and manipulate the list of matches we
calculated so far. This leads to a few problems:

Firstly, a completion handler's logic can now depend on previously calculated results
by another handlers. No completion handler should have such an implicit dependency,
but the current API makes it likely that this could happen (or already happens). Especially
the fact that some completion handler deleted all previously calculated results can mess
things up right now.

Secondly, all completion handlers have knowledge about our internal data structures with
this API. This makes refactoring this internal data structure much harder than it should be.
Especially planned changes like the support of descriptions for completions are currently
giant patches because we have to refactor every single completion handler.

This patch narrows the contract the CompletionRequest has with the different handlers to:

1. A handler can suggest a completion.
2. A handler can ask how many suggestions we already have.

Point 2 obviously means we still have a  dependency left between the different handlers, but
getting rid of this is too large to just append it to this patch.

Otherwise this patch just completely hides the internal StringList to the different handlers.

The CompletionRequest API now also ensures that the list of completions is unique and we
don't suggest the same value multiple times to the user. This property has been so far only
been ensured by the `Option` handler, but is now applied globally. This is part of this patch
as the OptionHandler is no longer able to implement this functionality itself.

Reviewers: jingham, davide, labath

Reviewed By: davide

Subscribers: lldb-commits

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

llvm-svn: 338151

5 years ago[AArch64, PowerPC, x86] add more signbit math tests; NFC
Sanjay Patel [Fri, 27 Jul 2018 18:31:21 +0000 (18:31 +0000)]
[AArch64, PowerPC, x86] add more signbit math tests; NFC

The tests with a constant sub operand were added with rL338143,
but the potential transform doesn't have that requirement, so
adding more tests with variable operands.

llvm-svn: 338150

5 years ago[analyzer] Extend NoStoreFuncVisitor to insert a note on IVars
George Karpenkov [Fri, 27 Jul 2018 18:26:40 +0000 (18:26 +0000)]
[analyzer] Extend NoStoreFuncVisitor to insert a note on IVars

The note is added in the following situation:

 - We are throwing a nullability-related warning on an IVar
 - The path goes through a method which *could have* (syntactically
   determined) written into that IVar, but did not

rdar://42444460

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

llvm-svn: 338149

5 years ago[MachineOutliner] Exit getOutliningCandidateInfo when we erase all candidates
Jessica Paquette [Fri, 27 Jul 2018 18:21:57 +0000 (18:21 +0000)]
[MachineOutliner] Exit getOutliningCandidateInfo when we erase all candidates

There was a missing check for if a candidate list was entirely deleted. This
adds that check.

This fixes an asan failure caused by running test/CodeGen/AArch64/addsub_ext.ll
with the MachineOutliner enabled.

llvm-svn: 338148

5 years ago[ARM] Add new target feature to fuse literal generation
Evandro Menezes [Fri, 27 Jul 2018 18:16:47 +0000 (18:16 +0000)]
[ARM] Add new target feature to fuse literal generation

This feature enables the fusion of such operations on Cortex A57 and Cortex
A72, as recommended in their Software Optimisation Guides, sections 4.14 and
4.11, respectively.

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

llvm-svn: 338147

5 years ago[OMPT] Fix OMPT callbacks for the taskloop construct and add testcase
Joachim Protze [Fri, 27 Jul 2018 18:13:24 +0000 (18:13 +0000)]
[OMPT] Fix OMPT callbacks for the taskloop construct and add testcase

Fix the order of callbacks related to the taskloop construct.
Add the iteration_count to work callbacks (according to the spec).
Use kmpc_omp_task() instead of kmp_omp_task() to include OMPT callbacks.
Add a testcase.

Patch by Simon Convent

Reviewed by: protze.joachim, hbae

Subscribers: openmp-commits

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

llvm-svn: 338146

5 years ago[OMPT] Adapt OMPT callbacks for tasks to handle untied tasks correctly
Joachim Protze [Fri, 27 Jul 2018 18:13:20 +0000 (18:13 +0000)]
[OMPT] Adapt OMPT callbacks for tasks to handle untied tasks correctly

The ompt/tasks/task_types.c testcase did not test untied tasks properly. Now,
frame addresses are tested and two scheduling points are added at which the
task can switch to another thread. Due to scheduling effects, the frame address
could be NULL.

This needed a restructure of the way OMPT callbacks are called.
__ompt_task_finish() now as an extra parameter, whether a task is completed.
Its invocation has been moved into __kmp_task_finish(). Thus, the order of the
writes to the frame addresses is not subject to scheduling effects anymore.

Patch by Simon Convent

Reviewed by: protze.joachim, hbae

Subscribers: openmp-commits

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

llvm-svn: 338145

5 years ago[OMPT] Print two more addresses in print_fuzzy_address_block()
Joachim Protze [Fri, 27 Jul 2018 18:13:15 +0000 (18:13 +0000)]
[OMPT] Print two more addresses in print_fuzzy_address_block()

The two more outputs are needed to match the return addresses when using the
Intel Compiler, as it generates more instructions between the fuzzy-printing
of the address and the runtime call.

Patch by Simon Convent

Reviewed By: protze.joachim, hbae

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

llvm-svn: 338144

5 years ago[AArch64, PowerPC, x86] add more signbit math tests; NFC
Sanjay Patel [Fri, 27 Jul 2018 18:12:29 +0000 (18:12 +0000)]
[AArch64, PowerPC, x86] add more signbit math tests; NFC

llvm-svn: 338143

5 years agoFix typos in comment.
Richard Smith [Fri, 27 Jul 2018 18:06:54 +0000 (18:06 +0000)]
Fix typos in comment.

llvm-svn: 338141

5 years ago[ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration
George Karpenkov [Fri, 27 Jul 2018 17:40:59 +0000 (17:40 +0000)]
[ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration

ObjCIvarExpr is *not* a subclass of MemberExpr, and a separate matcher
is required to support it.
Adding a hasDeclaration support as well, as it's not very useful without
it.

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

llvm-svn: 338140

5 years ago[OPENMP] Static variables on device must be externally visible.
Alexey Bataev [Fri, 27 Jul 2018 17:37:32 +0000 (17:37 +0000)]
[OPENMP] Static variables on device must be externally visible.

Do not mark static variable as internal on the device as they must be
visible from the host to be mapped correctly.

llvm-svn: 338139

5 years ago[demangler] Support for reference collapsing
Erik Pilkington [Fri, 27 Jul 2018 17:27:40 +0000 (17:27 +0000)]
[demangler] Support for reference collapsing

llvm.org/PR38323

llvm-svn: 338138

5 years ago[ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration.
George Karpenkov [Fri, 27 Jul 2018 17:26:11 +0000 (17:26 +0000)]
[ASTMatchers] Introduce a matcher for `ObjCIvarExpr`, support getting it's declaration.

ObjCIvarExpr is *not* a subclass of MemberExpr, and a separate matcher
is required to support it.
Adding a hasDeclaration support as well, as it's not very useful without
it.

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

llvm-svn: 338137

5 years agoRevert "Enable MachineOutliner by default under -Oz for AArch64"
Jessica Paquette [Fri, 27 Jul 2018 17:25:38 +0000 (17:25 +0000)]
Revert "Enable MachineOutliner by default under -Oz for AArch64"

It failed an Asan test on a bot:

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/21543/steps/check-llvm%20asan/logs/stdio

Fixing that before recommitting.

llvm-svn: 338136

5 years agoAdd missing temporary materialization conversion on left-hand side of .
Richard Smith [Fri, 27 Jul 2018 17:13:18 +0000 (17:13 +0000)]
Add missing temporary materialization conversion on left-hand side of .
in some member function calls.

Specifically, when calling a conversion function, we would fail to
create the AST node representing materialization of the class object.

llvm-svn: 338135

5 years agobpf: add missing RegState to notify MachineInstr verifier necessary register usage
Yonghong Song [Fri, 27 Jul 2018 16:58:52 +0000 (16:58 +0000)]
bpf: add missing RegState to notify MachineInstr verifier necessary register usage

Errors like the following are reported by:

  https://urldefense.proofpoint.com/v2/url?u=http-3A__lab.llvm.org-3A8011_builders_llvm-2Dclang-2Dx86-5F64-2Dexpensive-2Dchecks-2Dwin_builds_11261&d=DwIBAg&c=5VD0RTtNlTh3ycd41b3MUw&r=DA8e1B5r073vIqRrFz7MRA&m=929oWPCf7Bf2qQnir4GBtowB8ZAlIRWsAdTfRkDaK-g&s=9k-wbEUVpUm474hhzsmAO29VXVvbxJPWD9RTgCD71fQ&e=

  *** Bad machine code: Explicit definition marked as use ***
  - function:    cal_align1
  - basic block: %bb.0 entry (0x47edd98)
  - instruction: LDB $r3, $r2, 0
  - operand 0:   $r3

This is because RegState info was missing for ScratchReg inside
expandMEMCPY. This caused incomplete register usage information to
MachineInstr verifier which then would complain as there could be potential
code-gen issue if the complained MachineInstr is used in place where
register usage information matters even though the memcpy expanding is not
in such case as it happens at the last stage of IR optimization pipeline.

We should always specify those register usage information which compiler
couldn't deduct automatically whenever we add a hardware register manually.

Reported-by: Builder llvm-clang-x86_64-expensive-checks-win Build #11261
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 338134

5 years agoEnable MachineOutliner by default under -Oz for AArch64
Jessica Paquette [Fri, 27 Jul 2018 16:44:42 +0000 (16:44 +0000)]
Enable MachineOutliner by default under -Oz for AArch64

This patch enables the MachineOutliner by default in AArch64 under -Oz.

The MachineOutliner offers around a 4.5% improvement on the current -Oz code
size improvements.

We have done work into improving the debuggability of outlined code, so that
users of -Oz won't be surprised by the optimization. We have also been executing
the LLVM test suite and common external tests such as the SPEC suites
continuously with no issue. The outliner has a low compile-time overhead of
roughly 1%. At this point, the outliner would be a really good addition to the
-Oz pass pipeline!

llvm-svn: 338133

5 years ago[DAGCombiner] fold 'not' with signbit math
Sanjay Patel [Fri, 27 Jul 2018 16:42:55 +0000 (16:42 +0000)]
[DAGCombiner] fold 'not' with signbit math

This is a follow-up suggested in D48970.

Alive proofs:
https://rise4fun.com/Alive/sII

We can eliminate an instruction in the usual select-of-constants
to bit hack transform by adjusting the add/sub with constant.
This is always a win.

There are more transforms that are likely wins, but they may need
target hooks in case some targets do not benefit.

This is another step towards making up for canonicalizing to
select-of-constants in rL331486.

llvm-svn: 338132

5 years ago[x86] add more tests for signbit math; NFC
Sanjay Patel [Fri, 27 Jul 2018 16:22:40 +0000 (16:22 +0000)]
[x86] add more tests for signbit math; NFC

llvm-svn: 338131

5 years ago[PowerPC] add more tests for signbit math; NFC
Sanjay Patel [Fri, 27 Jul 2018 16:22:18 +0000 (16:22 +0000)]
[PowerPC] add more tests for signbit math; NFC

llvm-svn: 338130

5 years ago[AArch64] add more tests for signbit math; NFC
Sanjay Patel [Fri, 27 Jul 2018 16:21:56 +0000 (16:21 +0000)]
[AArch64] add more tests for signbit math; NFC

llvm-svn: 338129

5 years ago[Support] Use unsigned char for xxHash 64-bit
Fangrui Song [Fri, 27 Jul 2018 16:01:09 +0000 (16:01 +0000)]
[Support] Use unsigned char for xxHash 64-bit

Before, the last 3 bytes were char-signedness dependent.

llvm-svn: 338128

5 years agoAMDGPU/R600: Add MOV instructions to BFE patterns
Jan Vesely [Fri, 27 Jul 2018 15:00:13 +0000 (15:00 +0000)]
AMDGPU/R600: Add MOV instructions to BFE patterns

R600 can't handle immediates for BFE, these will be eliminated later.
Fixes powr/pow regressions n r600 since r334817

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

llvm-svn: 338127

5 years ago[AArch64][SVE] Asm: Predicated integer reductions.
Sander de Smalen [Fri, 27 Jul 2018 14:24:55 +0000 (14:24 +0000)]
[AArch64][SVE] Asm: Predicated integer reductions.

This patch adds support for various integer reduction operations:

  SADDV    signed add reduction to scalar
  UADDV    unsigned add reduction to scalar

  SMAXV    signed maximum reduction to scalar
  SMINV    signed minimum reduction to scalar
  UMAXV    unsigned maximum reduction to scalar
  UMINV    unsigned minimum reduction to scalar

  ANDV     logical AND reduction to scalar
  ORV      logical OR reduction to scalar
  EORV     logical EOR reduction to scalar

The reduction is predicated, e.g.
  smaxv s0, p0, z1.s

performs a signed maximum reduction on active elements in z1,
and stores the (signed max value) result in s0.

llvm-svn: 338126

5 years ago[AMDGPU][MC][DOC] Updated AMD GPU assembler description
Dmitry Preobrazhensky [Fri, 27 Jul 2018 14:17:15 +0000 (14:17 +0000)]
[AMDGPU][MC][DOC] Updated AMD GPU assembler description

llvm-svn: 338125

5 years ago[clang-tidy] Fix a crash in fuchsia-multiple-inheritance
Ilya Biryukov [Fri, 27 Jul 2018 14:05:39 +0000 (14:05 +0000)]
[clang-tidy] Fix a crash in fuchsia-multiple-inheritance

Summary: See the test case for a repro.

Reviewers: juliehockett, ioeric, hokein, aaron.ballman

Reviewed By: hokein

Subscribers: lebedev.ri, xazax.hun, cfe-commits

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

llvm-svn: 338124

5 years ago[AArch64][SVE] Asm: Predicated floating point reductions.
Sander de Smalen [Fri, 27 Jul 2018 13:58:48 +0000 (13:58 +0000)]
[AArch64][SVE] Asm: Predicated floating point reductions.

This patch adds support for various floating-point
reduction operations:

  FADDA    strictly-ordered add reduction, accumulating in scalar
  FADDV    recursive add reduction to scalar
  FMAXV    recursive max reduction to scalar
  FMINV    recursive min reduction to scalar
  FMAXNMV  recursive max number reduction to scalar
  FMINNMV  recursive min number reduction to scalar

The reduction is predicated, e.g.

  fadda d0, p0, d0, z1.d

performs the add-reduction in strict order on active elements
in z1, accumulating into d0.

  faddv d0, p0, z1.d

performs the add-reduction (not in strict order)
on active elements in z1, storing the result in d0.

llvm-svn: 338123

5 years ago[libc++] Introduce _LIBCPP_HIDE_FROM_ABI to replace _LIBCPP_INLINE_VISIBILITY
Louis Dionne [Fri, 27 Jul 2018 12:46:03 +0000 (12:46 +0000)]
[libc++] Introduce _LIBCPP_HIDE_FROM_ABI to replace _LIBCPP_INLINE_VISIBILITY

Summary:
This commit introduces a new macro, _LIBCPP_HIDE_FROM_ABI, whose goal is to
mark functions that shouldn't be part of libc++'s ABI. It marks the functions
as being hidden for dylib visibility purposes, and as having internal linkage
using Clang's __attribute__((internal_linkage)) when available, and
__always_inline__ otherwise.

It replaces _LIBCPP_INLINE_VISIBILITY, which was always using __always_inline__
to achieve similar goals, but suffered from debuggability and code size problems.
The full proposal, along with more background information, can be found here:

    http://lists.llvm.org/pipermail/cfe-dev/2018-July/058419.html

This commit does not rename uses of _LIBCPP_INLINE_VISIBILITY to
_LIBCPP_HIDE_FROM_ABI: this wide reaching but mechanical change can
be done later when we've confirmed we're happy with the new macro.

In the future, it would be nice if we could optionally allow dropping
any internal_linkage or __always_inline__ attribute, which could result
in code size improvements. However, this is currently impossible for
reasons explained here: http://lists.llvm.org/pipermail/cfe-dev/2018-July/058450.html

Reviewers: EricWF, dexonsmith, mclow.lists

Subscribers: christof, dexonsmith, llvm-commits, mclow.lists

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

llvm-svn: 338122

5 years ago[AArch64][SVE] Asm: Support for FEXPA and FTSSEL.
Sander de Smalen [Fri, 27 Jul 2018 12:40:09 +0000 (12:40 +0000)]
[AArch64][SVE] Asm: Support for FEXPA and FTSSEL.

This patch adds support for transcendental acceleration
instructions 'FEXPA' (exponential accelerator) and 'FTSSEL'
(trigonometric select coefficient).

llvm-svn: 338121

5 years ago[AArch64][SVE] Asm: Support for FRECPE and FRSQRTE.
Sander de Smalen [Fri, 27 Jul 2018 12:26:24 +0000 (12:26 +0000)]
[AArch64][SVE] Asm: Support for FRECPE and FRSQRTE.

Support for floating-point instructions for reciprocal
estimate (FRECPE) and reciprocal square root estimate (FRSQRTE).

llvm-svn: 338120

5 years ago[CMake] Followup for r337366: Only export LLVM_LINK_LLVM_DYLIB if it's set to ON
Philip Pfaffe [Fri, 27 Jul 2018 10:57:51 +0000 (10:57 +0000)]
[CMake] Followup for r337366: Only export LLVM_LINK_LLVM_DYLIB if it's set to ON

Summary:
As it was, always exporting LLVM_LINK_LLVM_DYLIB caused out-of-tree
clients to lose the ability to link against the dylib, even if in-tree tools did
not. By only exporting the setting if it is enabled, out-of-tree clients get the
correct default, but may still choose if they can.

Reviewers: mgorny, beanz, labath, bogner, chandlerc

Reviewed By: bogner, chandlerc

Subscribers: bollu, llvm-commits

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

llvm-svn: 338119

5 years ago[InstCombine] not(sub X, Y) --> add (not X), Y
Sanjay Patel [Fri, 27 Jul 2018 10:54:48 +0000 (10:54 +0000)]
[InstCombine] not(sub X, Y) --> add (not X), Y

The tests with constants show a missing optimization.
Analysis for adds is better than subs, so this can also
help with other transforms. And codegen is better with
adds for targets like x86 (destructive ops, no sub-from).

https://rise4fun.com/Alive/llK

llvm-svn: 338118

5 years ago[InstCombine] add tests for not+sub; NFC
Sanjay Patel [Fri, 27 Jul 2018 10:45:04 +0000 (10:45 +0000)]
[InstCombine] add tests for not+sub; NFC

llvm-svn: 338117

5 years ago[clangd] Return Dex Iterators
Kirill Bobyrev [Fri, 27 Jul 2018 09:54:27 +0000 (09:54 +0000)]
[clangd] Return Dex Iterators

The original Dex Iterators patch (https://reviews.llvm.org/rL338017)
caused problems for Clang 3.6 and Clang 3.7 due to the compiler bug
which prevented inferring template parameter (`Size`) in create(And|Or)?
functions. It was reverted in https://reviews.llvm.org/rL338054.

In this revision the mentioned helper functions were replaced with
variadic templated versions.

Proposed changes were tested on multiple compiler versions, including
Clang 3.6 which originally caused the failure.

llvm-svn: 338116

5 years ago[SimplifyIndVar] Canonicalize comparisons to unsigned while eliminating truncs
Max Kazantsev [Fri, 27 Jul 2018 09:43:39 +0000 (09:43 +0000)]
[SimplifyIndVar] Canonicalize comparisons to unsigned while eliminating truncs

This is a follow-up for the patch rL335020. When we replace compares against
trunc with compares against wide IV, we can also replace signed predicates with
unsigned where it is legal.

Reviewed By: reames
Differential Revision: https://reviews.llvm.org/D48763

llvm-svn: 338115

5 years ago[Support] Bring std::errc::not_supported to llvm::errc.
Victor Leschuk [Fri, 27 Jul 2018 09:15:05 +0000 (09:15 +0000)]
[Support] Bring std::errc::not_supported to llvm::errc.

llvm-svn: 338114

5 years agoAMDGPU: Fix code size for return_to_epilog pseudo
Matt Arsenault [Fri, 27 Jul 2018 09:15:03 +0000 (09:15 +0000)]
AMDGPU: Fix code size for return_to_epilog pseudo

llvm-svn: 338113

5 years agoDAG: Remove unnecessary .str()
Matt Arsenault [Fri, 27 Jul 2018 09:04:41 +0000 (09:04 +0000)]
DAG: Remove unnecessary .str()

llvm-svn: 338112

5 years agoPatternMatch: Add wrappers for fabs and canonicalize
Matt Arsenault [Fri, 27 Jul 2018 09:04:35 +0000 (09:04 +0000)]
PatternMatch: Add wrappers for fabs and canonicalize

llvm-svn: 338111

5 years agoRevert "ELF: Make --print-icf-sections output deterministic."
Ilya Biryukov [Fri, 27 Jul 2018 09:01:03 +0000 (09:01 +0000)]
Revert "ELF: Make --print-icf-sections output deterministic."

This reverts commit r338088. To unbreak our integrate.
The resulting lld output is different if compiled with '-funsigned-char'.

llvm-svn: 338110

5 years agoRevert "[LV][DebugInfo] Set DL to the middle block Icmp instruction"
Anastasis Grammenos [Fri, 27 Jul 2018 08:22:54 +0000 (08:22 +0000)]
Revert "[LV][DebugInfo] Set DL to the middle block Icmp instruction"

This reverts commit r338106.

llvm-svn: 338109

5 years ago[AST] Sink 'part of explicit cast' down into ImplicitCastExpr
Roman Lebedev [Fri, 27 Jul 2018 07:27:14 +0000 (07:27 +0000)]
[AST] Sink 'part of explicit cast' down into ImplicitCastExpr

Summary:
As discussed in IRC with @rsmith, it is slightly not good to keep that in the `CastExpr` itself:
Given the explicit cast, which is represented in AST as an `ExplicitCastExpr` + `ImplicitCastExpr`'s,
only the  `ImplicitCastExpr`'s will be marked as `PartOfExplicitCast`, but not the `ExplicitCastExpr` itself.
Thus, it is only ever `true` for `ImplicitCastExpr`'s, so we don't need to write/read/dump it for `ExplicitCastExpr`'s.

We don't need to worry that we write the `PartOfExplicitCast` in PCH after `CastExpr::path_iterator`,
since the `ExprImplicitCastAbbrev` is only used when the `NumBaseSpecs == 0`, i.e. there is no 'path'.

Reviewers: rsmith, rjmccall, erichkeane, aaron.ballman

Reviewed By: rsmith, erichkeane

Subscribers: vsk, cfe-commits, rsmith

Tags: #clang

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

llvm-svn: 338108

5 years ago[InstSimplify] tests for D48828: fold extraction from std::pair
Hiroshi Inoue [Fri, 27 Jul 2018 07:21:02 +0000 (07:21 +0000)]
[InstSimplify] tests for D48828: fold extraction from std::pair

This commit includes unit tests for D48828, which enhances InstSimplify to enable jump threading with a method whose return type is std::pair<int, bool> or std::pair<bool, int>.
I am going to commit the actual transformation later.

llvm-svn: 338107

5 years ago[LV][DebugInfo] Set DL to the middle block Icmp instruction
Anastasis Grammenos [Fri, 27 Jul 2018 07:12:44 +0000 (07:12 +0000)]
[LV][DebugInfo] Set DL to the middle block Icmp instruction

Reviewers: hsaito

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

llvm-svn: 338106

5 years ago[Docs] Remove hard tab character from code block in optbisect documentation
Craig Topper [Fri, 27 Jul 2018 06:54:13 +0000 (06:54 +0000)]
[Docs] Remove hard tab character from code block in optbisect documentation

llvm-svn: 338105

5 years ago[NFC] Remove an empty line.
Xin Tong [Fri, 27 Jul 2018 06:50:45 +0000 (06:50 +0000)]
[NFC] Remove an empty line.

llvm-svn: 338104

5 years agoMove Filesystem namespace definition out of a clang specific ifdef block.
Eric Fiselier [Fri, 27 Jul 2018 06:12:46 +0000 (06:12 +0000)]
Move Filesystem namespace definition out of a clang specific ifdef block.

llvm-svn: 338103

5 years agoAMDGPU/GlobalISel: Fix crash in regbankselect on non-power-of-2 types
Tom Stellard [Fri, 27 Jul 2018 06:04:40 +0000 (06:04 +0000)]
AMDGPU/GlobalISel: Fix crash in regbankselect on non-power-of-2 types

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, llvm-commits, t-tye

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

llvm-svn: 338102

5 years ago[X86] Remove an unnecessary 'if' that prevented treating INT64_MAX and -INT64_MAX...
Craig Topper [Fri, 27 Jul 2018 05:56:27 +0000 (05:56 +0000)]
[X86] Remove an unnecessary 'if' that prevented treating INT64_MAX and -INT64_MAX as power of 2 minus 1 in the multiply expansion code.

Not sure why they were being explicitly excluded, but I believe all the math inside the if works. I changed the absolute value to be uint64_t instead of int64_t so INT64_MIN+1 wouldn't be signed wrap.

llvm-svn: 338101

5 years ago[LTO] Don't internalize declarations
Bob Haarman [Fri, 27 Jul 2018 05:40:29 +0000 (05:40 +0000)]
[LTO] Don't internalize declarations

Summary:
Some links were failing with "Global is external, but doesn't have
external or weak linkage!" in ThinLTO builds with debug
information. This happened when we elide the body of a global that is
referenced by debug info. This results in a declaration, which we
would then internalize - but declarations cannot be internal. This
change avoids the problem by not internalizing these declarations.

Fixes PR38046.

Reviewers: pcc, tejohnson

Subscribers: mehdi_amini, aprantl, hiraditya, JDevlieghere, steven_wu, dexonsmith, llvm-commits

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

llvm-svn: 338100

5 years agoReplace LLVM_ALIGNAS with alignas as a follow-up of r337330
Fangrui Song [Fri, 27 Jul 2018 05:38:14 +0000 (05:38 +0000)]
Replace LLVM_ALIGNAS with alignas as a follow-up of r337330

The minimum required GCC version was raised to 4.8 (which started to support alignas) in r284497.

llvm-svn: 338099

5 years ago[WWW] Fixing file permissions for the .html pages.
Mike Edwards [Fri, 27 Jul 2018 04:41:37 +0000 (04:41 +0000)]
[WWW] Fixing file permissions for the .html pages.

llvm-svn: 338098

5 years ago[X86] Add matching for another pattern of PMADDWD.
Craig Topper [Fri, 27 Jul 2018 04:29:10 +0000 (04:29 +0000)]
[X86] Add matching for another pattern of PMADDWD.

Summary:
This is the pattern you get from the loop vectorizer for something like this

int16_t A[1024];
int16_t B[1024];
int32_t C[512];

void pmaddwd() {
  for (int i = 0; i != 512; ++i)
    C[i] = (A[2*i]*B[2*i]) + (A[2*i+1]*B[2*i+1]);
}

In this case we will have (add (mul (build_vector), (build_vector)), (mul (build_vector), (build_vector))). This is different than the pattern we currently match which has the build_vectors between an add and a single multiply. I'm not sure what C code would get you that pattern.

Reviewers: RKSimon, spatel, zvi

Reviewed By: zvi

Subscribers: llvm-commits

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

llvm-svn: 338097

5 years agoAdd libc++fs to the test deps, and not to the target 'cxx'.
Eric Fiselier [Fri, 27 Jul 2018 03:47:46 +0000 (03:47 +0000)]
Add libc++fs to the test deps, and not to the target 'cxx'.

llvm-svn: 338096