platform/upstream/llvm.git
5 years ago[VE] add, sub, left/right shift isel patterns
Kazushi (Jam) Marukawa [Thu, 23 Jan 2020 15:00:25 +0000 (16:00 +0100)]
[VE] add, sub, left/right shift isel patterns

Summary: Add, sub, left/right shift isel patterns and tests for i32/i64 and fp32/fp64.

Reviewed By: arsenm

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

5 years agoRevert "Resubmit: [JumpThreading] Thread jumps through two basic blocks"
Kazu Hirata [Thu, 23 Jan 2020 14:26:33 +0000 (06:26 -0800)]
Revert "Resubmit: [JumpThreading] Thread jumps through two basic blocks"

This reverts commit 53b68e676faf208b4a8f817e9bd4ddd522cc6006.

Our internal tests are showing breakage with this patch.

5 years ago[clang][CodeComplete] Make completion work after initializer lists
Kadir Cetinkaya [Wed, 22 Jan 2020 13:10:01 +0000 (14:10 +0100)]
[clang][CodeComplete] Make completion work after initializer lists

Summary:
CodeCompletion was not being triggered after successfully parsed
initializer lists, e.g.

```cpp
void foo(int, bool);
void bar() {
  foo({1}^, false);
}
```

CodeCompletion would suggest the function foo as an overload candidate up until
the point marked with `^` but after that point we do not trigger signature help
since parsing succeeds.

This patch handles that case by failing in parsing expression lists whenever we
see a codecompletion token, in addition to getting an invalid subexpression.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

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

5 years ago[VE][NFC] re-write RR* isel class using null_frag
Simon Moll [Thu, 23 Jan 2020 14:17:19 +0000 (15:17 +0100)]
[VE][NFC] re-write RR* isel class using null_frag

Summary: Re-write RR* using null_frag to avoid duplication in upcoming patches.

Reviewed By: arsenm

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

5 years ago[ARM,MVE] Make the MVE intrinsics work in C++!
Simon Tatham [Thu, 23 Jan 2020 14:10:24 +0000 (14:10 +0000)]
[ARM,MVE] Make the MVE intrinsics work in C++!

Summary:
Apparently nobody has tried this in months of development. It turns
out that `FunctionDecl::getBuiltinID` will never consider a function
to be a builtin if it is in C++ and not extern "C". So none of the
function declarations in <arm_mve.h> are recognized as builtins when
clang is compiling in C++ mode: it just emits calls to them as
ordinary functions, which then turn out not to exist at link time.

The trivial fix is to wrap most of arm_mve.h in an extern "C".

Added a test in clang/test/CodeGen/arm-mve-intrinsics which checks
basic functioning of the MVE header file in C++ mode. I've filled it
with copies of existing test functions from other files in that
directory, including a few moderately tricky cases of overloading (in
particular one that relies on the strict-polymorphism attribute added
in D72518).

(I considered making //every// test in that directory compile in both
C and C++ mode and check the code generation was identical. But I
think that would increase testing time by more than the value it adds,
and also update_cc_test_checks gets confused when the output function
name varies between RUN lines.)

Reviewers: LukeGeeson, MarkMurrayARM, miyuki, dmgreen

Reviewed By: MarkMurrayARM

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

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

5 years ago[tablegen] Emit string literals instead of char arrays
Luke Drummond [Wed, 15 Jan 2020 14:14:01 +0000 (14:14 +0000)]
[tablegen] Emit string literals instead of char arrays

This changes the generated (Instr|Asm|Reg|Regclass)Name tables from this
form:
    extern const char HexagonInstrNameData[] = {
      /* 0 */ 'G', '_', 'F', 'L', 'O', 'G', '1', '0', 0,
      /* 9 */ 'E', 'N', 'D', 'L', 'O', 'O', 'P', '0', 0,
      /* 18 */ 'V', '6', '_', 'v', 'd', 'd', '0', 0,
      /* 26 */ 'P', 'S', '_', 'v', 'd', 'd', '0', 0,
      [...]
    };

...to this:

    extern const char HexagonInstrNameData[] = {
      /* 0 */ "G_FLOG10\0"
      /* 9 */ "ENDLOOP0\0"
      /* 18 */ "V6_vdd0\0"
      /* 26 */ "PS_vdd0\0"
      [...]
    };

This should make debugging and exploration a lot easier for mortals,
while providing a significant compile-time reduction for common compilers.

To avoid issues with low implementation limits, this is disabled by
default for visual studio or when cross-compiling.

To force output one way or the other, pass
`--long-string-literals=<bool>` to `tablegen`

Reviewers: mstorsjo, rnk

Subscribers: llvm-commit

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

5 years agoRevert "[mlir] Add baseAttr to TypedArrayAttrBase."
Alex Zinenko [Thu, 23 Jan 2020 13:47:11 +0000 (14:47 +0100)]
Revert "[mlir] Add baseAttr to TypedArrayAttrBase."

This reverts commit eec36909c18b8788773abc95d199e6acde6eb42c.

This modeling is incorrect. baseAttr is intended for attribute
decorators that are not backed by C++ attribute classes. It essentially
says DerivedAttr isa BaseAttr, which is wrong for ArrayAttr classes.
If one needs to store the element type, it should be stored as a
separate filed in the tablegen class.

5 years ago[CodeGen] Make use of MachineInstrBuilder::getReg
Jay Foad [Thu, 23 Jan 2020 11:51:35 +0000 (11:51 +0000)]
[CodeGen] Make use of MachineInstrBuilder::getReg

Reviewers: arsenm

Subscribers: wdng, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

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

5 years ago[gn build] Port 2f6987ba61c
LLVM GN Syncbot [Thu, 23 Jan 2020 13:34:12 +0000 (13:34 +0000)]
[gn build] Port 2f6987ba61c

5 years ago[NFC][RDA] Make the interface const
Sam Parker [Thu, 23 Jan 2020 13:22:13 +0000 (13:22 +0000)]
[NFC][RDA] Make the interface const

Make all the public query methods const.

5 years ago[SelectionDAG] Compute Known + Sign Bits - merge INSERT_VECTOR_ELT known/unknown...
Simon Pilgrim [Thu, 23 Jan 2020 12:35:29 +0000 (12:35 +0000)]
[SelectionDAG] Compute Known + Sign Bits - merge INSERT_VECTOR_ELT known/unknown index paths

Match the approach in SimplifyDemandedBits where we calculate the demanded elts and then have a common path for the ComputeKnownBits/ComputeNumSignBits call.

5 years ago[LoopRotate] add ability to repeat loop rotation until non-deoptimizing exit is found
Fedor Sergeev [Thu, 23 Jan 2020 12:55:32 +0000 (15:55 +0300)]
[LoopRotate] add ability to repeat loop rotation until non-deoptimizing exit is found

In case of loops with multiple exit where all-but-one exit are deoptimizing
it might happen that the first rotation will end up with latch having a deoptimizing
exit. This makes the loop unsuitable for trip-count analysis (say, getLoopEstimatedTripCount)
as well as for loop transformations that know how to handle multple deoptimizing exits.

It pretty much means that canonical form in multple-deoptimizing-exits case should be
with non-deoptimizing exit at latch.
Teach loop-rotation to reach this canonical form by repeating rotation.

-loop-rotate-multi option introduced to control this behavior, currently disabled by default.

Reviewers: skatkov, asbirlea, reames, fhahn
Reviewed By: skatkov

Tags: #llvm

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

5 years ago[Alignement][NFC] Deprecate untyped CreateAlignedLoad
Guillaume Chatelet [Thu, 23 Jan 2020 10:33:12 +0000 (11:33 +0100)]
[Alignement][NFC] Deprecate untyped CreateAlignedLoad

Summary:
This is patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790

Reviewers: courbet

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

Tags: #llvm

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

5 years agoTreat C# `using` as a control statement
Krasimir Georgiev [Thu, 23 Jan 2020 12:19:08 +0000 (13:19 +0100)]
Treat C# `using` as a control statement

Contributed by jbcoe!

Summary: Unless SpaceBeforeParensOptions is set to SBPO_Never, a space will be put between `using` and `(` in C# code.

Reviewers: klimek, MyDeveloperDay, krasimir

Reviewed By: krasimir

Subscribers: MyDeveloperDay, cfe-commits

Tags: #clang-format, #clang

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

5 years ago[AArch64][SVE] Add first-faulting load intrinsic
Kerry McLaughlin [Thu, 23 Jan 2020 10:01:36 +0000 (10:01 +0000)]
[AArch64][SVE] Add first-faulting load intrinsic

Summary:
Implements the llvm.aarch64.sve.ldff1 intrinsic and DAG
combine rules for first-faulting loads with sign & zero extends

Reviewers: sdesmalen, efriedma, andwar, dancgr, rengolin

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, cameron.mcinally, cfe-commits, llvm-commits

Tags: #llvm

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

5 years ago[ARM,MVE] Support immediate vbicq,vorrq,vmvnq intrinsics.
Simon Tatham [Thu, 23 Jan 2020 11:53:42 +0000 (11:53 +0000)]
[ARM,MVE] Support immediate vbicq,vorrq,vmvnq intrinsics.

Summary:
Immediate vmvnq is code-generated as a simple vector constant in IR,
and left to the backend to recognize that it can be created with an
MVE VMVN instruction. The predicated version is represented as a
select between the input and the same constant, and I've added a
Tablegen isel rule to turn that into a predicated VMVN. (That should
be better than the previous VMVN + VPSEL: it's the same number of
instructions but now it can fold into an adjacent VPT block.)

The unpredicated forms of VBIC and VORR are done by enabling the same
isel lowering as for NEON, recognizing appropriate immediates and
rewriting them as ARMISD::VBICIMM / ARMISD::VORRIMM SDNodes, which I
then instruction-select into the right MVE instructions (now that I've
also reworked those instructions to use the same MC operand encoding).
In order to do that, I had to promote the Tablegen SDNode instance
`NEONvorrImm` to a general `ARMvorrImm` available in MVE as well, and
similarly for `NEONvbicImm`.

The predicated forms of VBIC and VORR are represented as a vector
select between the original input vector and the output of the
unpredicated operation. The main convenience of this is that it still
lets me use the existing isel lowering for VBICIMM/VORRIMM, and not
have to write another copy of the operand encoding translation code.

This intrinsic family is the first to use the `imm_simd` system I put
into the MveEmitter tablegen backend. So, naturally, it showed up a
bug or two (emitting bogus range checks and the like). Fixed those,
and added a full set of tests for the permissible immediates in the
existing Sema test.

Also adjusted the isel pattern for `vmovlb.u8`, which stopped matching
because lowering started turning its input into a VBICIMM. Now it
recognizes the VBICIMM instead.

Reviewers: dmgreen, MarkMurrayARM, miyuki, ostannard

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

5 years ago[ARM,MVE] Revise immediate VBIC/VORR to look more like NEON.
Simon Tatham [Thu, 23 Jan 2020 11:53:27 +0000 (11:53 +0000)]
[ARM,MVE] Revise immediate VBIC/VORR to look more like NEON.

Summary:
In NEON, the immediate forms of VBIC and VORR are each represented as
a single MC instruction, which takes its immediate operand already
encoded in a NEON-friendly format: 8 data bits, plus some control bits
indicating how to expand them into a full vector.

In MVE, we represented immediate VBIC and VORR as four separate MC
instructions each, for an 8-bit immediate shifted left by 0, 8, 16 or
24 bits. For each one, the value of the immediate operand is in the
'natural' form, i.e. the numerical value that would actually be BICed
or ORRed into each vector lane (and also the same value shown in
assembly). For example, MVE_VBICIZ16v4i32 takes an operand such as
0xab0000, which NEON would represent as 0xab | (control bits << 8).

The MVE approach is superficially nice (it makes assembly input and
output easy, and it's also nice if you're manually constructing
immediate VBICs). But it turns out that it's better for isel if we
make the NEON and MVE instructions work the same, because the
ARMISD::VBICIMM and VORRIMM node types already encode their immediate
into the NEON format, so it's easier if we can just use it.

Also, this commit reduces the total amount of code rather than
increasing it, which is surely an indication that it really is simpler
to do it this way!

Reviewers: dmgreen, ostannard, miyuki, MarkMurrayARM

Reviewed By: dmgreen

Subscribers: kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

5 years ago[llvm-exegesis] Don't use unsupported aliasing instructions
Miloš Stojanović [Thu, 23 Jan 2020 11:28:50 +0000 (12:28 +0100)]
[llvm-exegesis] Don't use unsupported aliasing instructions

Since some instruction types aren't allowed as the main instruction also
don't allow them for aliasing instructions.

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

5 years ago[FileCheck] Strengthen error checks in unit tests
Thomas Preud'homme [Thu, 16 Jan 2020 12:14:13 +0000 (12:14 +0000)]
[FileCheck] Strengthen error checks in unit tests

Summary:
This commit adds error checking beyond UndefVarError and fix a number of
Error/Expected related idioms:
- use (EXPECT|ASSERT)_THAT_(ERROR|EXPECTED) instead of errorToBool or
  boolean operator
- ASSERT when a further check require the check to be successful to give
  a correct result

Reviewers: jhenderson, jdenny, probinson, grimar, arichardson, rnk

Reviewed By: jhenderson

Subscribers: llvm-commits

Tags: #llvm

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

5 years ago[SelectionDAG] ComputeKnownBits - merge EXTRACT_VECTOR_ELT known/unknown index paths
Simon Pilgrim [Thu, 23 Jan 2020 11:28:00 +0000 (11:28 +0000)]
[SelectionDAG] ComputeKnownBits - merge EXTRACT_VECTOR_ELT known/unknown index paths

Match the approach in SimplifyDemandedBits/ComputeNumSignBits where we calculate the demanded elts and then have a common path for the ComputeKnownBits call.

5 years ago[SelectionDAG] Compute Known + Sign Bits - merge INSERT_SUBVECTOR known/unknown index...
Simon Pilgrim [Thu, 23 Jan 2020 11:14:44 +0000 (11:14 +0000)]
[SelectionDAG] Compute Known + Sign Bits - merge INSERT_SUBVECTOR known/unknown index paths

Match the approach in SimplifyDemandedBits where we calculate the demanded elts and then have a common path for the ComputeKnownBits/ComputeNumSignBits call, additionally we only ever need original demanded elts of the base vector even if the index is unknown.

5 years ago[LLD] [COFF] Silence a GCC warning about an unused variable. NFC.
Martin Storsjö [Thu, 23 Jan 2020 11:23:12 +0000 (13:23 +0200)]
[LLD] [COFF] Silence a GCC warning about an unused variable. NFC.

5 years ago[NFC][DwarfDebug] Use proper analog GNU attribute for the pc address
Djordje Todorovic [Wed, 22 Jan 2020 12:08:56 +0000 (13:08 +0100)]
[NFC][DwarfDebug] Use proper analog GNU attribute for the pc address

The low_pc is analog to the DW_AT_call_return_pc, since it describes
the return address after the call. The DW_AT_call_pc is the address
of the call instruction, and we don't use it at the moment.

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

5 years ago[mlir] Shrink-wrap anonymous namespaces around the classes it's supposed to enclose...
Benjamin Kramer [Thu, 23 Jan 2020 10:46:10 +0000 (11:46 +0100)]
[mlir] Shrink-wrap anonymous namespaces around the classes it's supposed to enclose. NFC.

The coding standards prefer smaller anonymous namespaces with free
functions just being static and in the global namespace.

5 years ago[llvm-exegesis] Allow the randomizer to fail nicely...
Clement Courbet [Wed, 22 Jan 2020 14:49:10 +0000 (15:49 +0100)]
[llvm-exegesis] Allow the randomizer to fail nicely...

Summary:
... instead of crashing.
On typical exmaple is when there are no available registers.

Reviewers: gchatelet

Subscribers: tschuett, mstojanovic, llvm-commits

Tags: #llvm

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

5 years agoRevert "[Concepts] Placeholder constraints and abbreviated templates"
Sam McCall [Thu, 23 Jan 2020 09:38:59 +0000 (10:38 +0100)]
Revert "[Concepts] Placeholder constraints and abbreviated templates"

This reverts commit e57a9abc4b01fa69fe81ace8df70517983b6cbac.

Parser/cxx2a-placeholder-type-constraint.cpp has MSan failures.

Present at 7b81c3f8793d30a4285095a9b67dcfca2117916c:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/17133/steps/check-clang%20msan/logs/stdio
not present at eaa594f4ec54eba52b03fd9f1c789b214c66a753:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/17132/steps/check-clang%20msan/logs/stdio

Stack trace:
```
==57032==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0xccfe016 in clang::AutoTypeLoc::getLocalSourceRange() const /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/include/clang/AST/TypeLoc.h:2036:19
    #1 0xcc56758 in CheckDeducedPlaceholderConstraints(clang::Sema&, clang::AutoType const&, clang::AutoTypeLoc, clang::QualType) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:4505:56
    #2 0xcc550ce in clang::Sema::DeduceAutoType(clang::TypeLoc, clang::Expr*&, clang::QualType&, llvm::Optional<unsigned int>, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:4707:11
    #3 0xcc52407 in clang::Sema::DeduceAutoType(clang::TypeSourceInfo*, clang::Expr*&, clang::QualType&, llvm::Optional<unsigned int>, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaTemplateDeduction.cpp:4457:10
    #4 0xba38332 in clang::Sema::deduceVarTypeFromInitializer(clang::VarDecl*, clang::DeclarationName, clang::QualType, clang::TypeSourceInfo*, clang::SourceRange, bool, clang::Expr*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaDecl.cpp:11351:7
    #5 0xba3a8a9 in clang::Sema::DeduceVariableDeclarationType(clang::VarDecl*, bool, clang::Expr*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaDecl.cpp:11385:26
    #6 0xba3c520 in clang::Sema::AddInitializerToDecl(clang::Decl*, clang::Expr*, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Sema/SemaDecl.cpp:11725:9
    #7 0xb39c498 in clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::ForRangeInit*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseDecl.cpp:2399:17
    #8 0xb394d80 in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseDecl.cpp:2128:21
    #9 0xb383bbf in clang::Parser::ParseSimpleDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, bool, clang::Parser::ForRangeInit*, clang::SourceLocation*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseDecl.cpp:1848:10
    #10 0xb383129 in clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::Parser::ParsedAttributesWithRange&, clang::SourceLocation*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/llvm/include/llvm/ADT/PointerUnion.h
    #11 0xb53a388 in clang::Parser::ParseStatementOrDeclarationAfterAttributes(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*, clang::Parser::ParsedAttributesWithRange&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseStmt.cpp:221:13
    #12 0xb539309 in clang::Parser::ParseStatementOrDeclaration(llvm::SmallVector<clang::Stmt*, 32u>&, clang::Parser::ParsedStmtContext, clang::SourceLocation*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseStmt.cpp:106:20
    #13 0xb55610e in clang::Parser::ParseCompoundStatementBody(bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseStmt.cpp:1079:11
    #14 0xb559529 in clang::Parser::ParseFunctionStatementBody(clang::Decl*, clang::Parser::ParseScope&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseStmt.cpp:2204:21
    #15 0xb33c13e in clang::Parser::ParseFunctionDefinition(clang::ParsingDeclarator&, clang::Parser::ParsedTemplateInfo const&, clang::Parser::LateParsedAttrList*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:1339:10
    #16 0xb394703 in clang::Parser::ParseDeclGroup(clang::ParsingDeclSpec&, clang::DeclaratorContext, clang::SourceLocation*, clang::Parser::ForRangeInit*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseDecl.cpp:2068:11
    #17 0xb338e52 in clang::Parser::ParseDeclOrFunctionDefInternal(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec&, clang::AccessSpecifier) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:1099:10
    #18 0xb337674 in clang::Parser::ParseDeclarationOrFunctionDefinition(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*, clang::AccessSpecifier) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:1115:12
    #19 0xb334a96 in clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:935:12
    #20 0xb32f12a in clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/Parser.cpp:686:12
    #21 0xb31e193 in clang::ParseAST(clang::Sema&, bool, bool) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Parse/ParseAST.cpp:158:20
    #22 0x80263f0 in clang::FrontendAction::Execute() /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Frontend/FrontendAction.cpp:936:8
    #23 0x7f2a257 in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/Frontend/CompilerInstance.cpp:965:33
    #24 0x8288bef in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:290:25
    #25 0xad44c2 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/driver/cc1_main.cpp:239:15
    #26 0xacd76a in ExecuteCC1Tool(llvm::ArrayRef<char const*>) /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/driver/driver.cpp:325:12
    #27 0xacc9fd in main /b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm-project/clang/tools/driver/driver.cpp:398:12
    #28 0x7f7d82cdb2e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)
    #29 0xa4dde9 in _start (/b/sanitizer-x86_64-linux-bootstrap-msan/build/llvm_build_msan/bin/clang-11+0xa4dde9)
```

5 years ago[lldb][NFC] Delete empty file source/Host/linux/ProcessLauncherLinux.cpp
Raphael Isemann [Thu, 23 Jan 2020 09:36:01 +0000 (10:36 +0100)]
[lldb][NFC] Delete empty file source/Host/linux/ProcessLauncherLinux.cpp

This was renamed in 816ae4b0dfac9a2bd964e8c4dae6dd7183ceb92a but it seems
the commit only emptied the file instead of deleting it.

5 years ago[test] Avoid loop-unroll.c test getting confused by fadd in git revision
Russell Gallop [Thu, 23 Jan 2020 09:27:16 +0000 (09:27 +0000)]
[test] Avoid loop-unroll.c test getting confused by fadd in git revision

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

5 years ago[llvm-readobj][test] - Add a check for --dyn-syms.
Georgii Rymar [Wed, 22 Jan 2020 10:14:04 +0000 (13:14 +0300)]
[llvm-readobj][test] - Add a check for --dyn-syms.

We have a `-dyn-symbols` option. It has a `--dyn-syms` alias
that is not tested in llvm-readobj tests currently.

There was a Object/readobj-elf-versioning.test where it is used,
but I've removed it in D73163. And also it is not the
right place to test it anyways.

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

5 years ago[Object][test] - Remove readobj-elf-versioning.test and support files.
Georgii Rymar [Wed, 22 Jan 2020 09:50:52 +0000 (12:50 +0300)]
[Object][test] - Remove readobj-elf-versioning.test and support files.

`readobj-elf-versioning.test` was added in rL152436 and
checks how llvm-readobj --dyn-syms prints versioned symbols.
We test the same in `llvm-readobj\ELF\dyn-symbols.test` currently.

This patch removes the test and 4 more support files from Inputs.

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

5 years ago[lldb][NFC] Rename ClangASTContext to TypeSystemClang
Raphael Isemann [Thu, 23 Jan 2020 09:04:13 +0000 (10:04 +0100)]
[lldb][NFC] Rename ClangASTContext to TypeSystemClang

Summary:
This commit renames ClangASTContext to TypeSystemClang to better reflect what this class is actually supposed to do
(implement the TypeSystem interface for Clang). It also gets rid of the very confusing situation that we have both a
`clang::ASTContext` and a `ClangASTContext` in clang (which sometimes causes Clang people to think I'm fiddling
with Clang's ASTContext when I'm actually just doing LLDB work).

I also have plans to potentially have multiple clang::ASTContext instances associated with one ClangASTContext so
the ASTContext naming will then become even more confusing to people.

Reviewers: #lldb, aprantl, shafik, clayborg, labath, JDevlieghere, davide, espindola, jdoerfert, xiaobai

Reviewed By: clayborg, labath, xiaobai

Subscribers: wuzish, emaste, nemanjai, mgorny, kbarton, MaskRay, arphaman, jfb, usaxena95, jingham, xiaobai, abidh, JDevlieghere, lldb-commits

Tags: #lldb

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

5 years ago[llvm-exegesis] Restrict to allowed back-to-back instructions in SerialSnippetGenerator.
Clement Courbet [Thu, 23 Jan 2020 07:58:58 +0000 (08:58 +0100)]
[llvm-exegesis] Restrict to allowed back-to-back instructions in SerialSnippetGenerator.

Summary: Followup to D73161.

Reviewers: gchatelet, mstojanovic

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

5 years ago[LLD][COFF] Enable linking of __declspec(selectany) symbols from Clang and GCC
Markus Böck [Thu, 23 Jan 2020 08:43:56 +0000 (10:43 +0200)]
[LLD][COFF] Enable linking of __declspec(selectany) symbols from Clang and GCC

When annotating a symbol with __declspec(selectany), Clang assigns it
comdat 2 while GCC assigns it comdat 3. This patch enables two object
files that contain a __declspec(selectany) symbol, one created by gcc
and the other by clang, to be linked together instead of issuing a
duplicate symbol error.

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

5 years ago[SSAUpdater] Don't call ValueIsRAUWd upon single use replacement
Daniil Suchkov [Tue, 21 Jan 2020 05:21:53 +0000 (12:21 +0700)]
[SSAUpdater] Don't call ValueIsRAUWd upon single use replacement

It is incorrect to call ValueHandleBase::ValueIsRAUWd when only one use
is replaced since it simply violates semantics of the callback and leads
to bugs like PR44320.

Previously this call was used specifically to keep LICM's cache of
AliasSetTrackers up to date across passes (as PR36801 showed, even for
that purpose it didn't work properly), but since LICM doesn't have that
cache anymore, we can safely remove this incorrect call with no
repercussions.

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

Reviewers: asbirlea, fhahn, efriedma, reames

Reviewed-By: asbirlea
Differential Revision: https://reviews.llvm.org/D73089

5 years ago[DWARF] Eliminate the DWARFDebugNames::Header::Padding field.
Igor Kudrin [Mon, 20 Jan 2020 09:44:00 +0000 (16:44 +0700)]
[DWARF] Eliminate the DWARFDebugNames::Header::Padding field.

The padding field is reserved for DWARF and does not contain any useful
information. No need to read, store and report it.

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

5 years ago[DWARF] Get rid of DWARFDebugNames::HeaderPOD. NFC.
Igor Kudrin [Mon, 20 Jan 2020 05:58:03 +0000 (12:58 +0700)]
[DWARF] Get rid of DWARFDebugNames::HeaderPOD. NFC.

This structure was used to get the size of the fixed-size part of a Name
Index header for 32-bit DWARF. It is unsuitable for 64-bit DWARF because
the size of the unit length field is different.

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

5 years ago[Concepts] Profile TypeConstraints in ProfileTemplateParameterList
Saar Raz [Thu, 23 Jan 2020 07:47:55 +0000 (09:47 +0200)]
[Concepts] Profile TypeConstraints in ProfileTemplateParameterList

Profile TypeConstraints in ProfileTemplateParameterList so we can distinguish
between partial specializations which differ in their TemplateParameterList
type constraints.

Recommit, now profiling the IDC so that we can deal with situations where the
TemplateArgsAsWritten are nullptr (happens when canonicalizing type constraints).

5 years agoRevert "[Concepts] Profile TypeConstraints in ProfileTemplateParameterList"
Saar Raz [Thu, 23 Jan 2020 07:57:20 +0000 (09:57 +0200)]
Revert "[Concepts] Profile TypeConstraints in ProfileTemplateParameterList"

This temporarily reverts commit 0e3ae353a47273825cd2f20f4777dcb5731cf8ec because
of a potential bug.

5 years ago[DWARF] Support 64-bit DWARF in .debug_pubnames and similar tables.
Igor Kudrin [Fri, 17 Jan 2020 11:59:32 +0000 (18:59 +0700)]
[DWARF] Support 64-bit DWARF in .debug_pubnames and similar tables.

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

5 years ago[Concepts] Profile TypeConstraints in ProfileTemplateParameterList
Saar Raz [Thu, 23 Jan 2020 07:47:55 +0000 (09:47 +0200)]
[Concepts] Profile TypeConstraints in ProfileTemplateParameterList

Profile TypeConstraints in ProfileTemplateParameterList so we can distinguish
between partial specializations which differ in their TemplateParameterList
type constraints

5 years ago[lldb/Test] Don't add a check-* target as dependency in add_lit_testsuite
Martin Storsjö [Thu, 23 Jan 2020 07:42:43 +0000 (09:42 +0200)]
[lldb/Test] Don't add a check-* target as dependency in add_lit_testsuite

This causes the toplevel "test-depends" target, which should only build
all the dependencies necessary for running tests, to suddenaly also run
the check-lldb-repro-capture tests.

Instead add check-lldb-repro-capture as a dependency to check-lldb-repro
with a separate explicit add_dependencies call.

5 years agoNFC. Add PR44320 IR test case.
Daniil Suchkov [Fri, 10 Jan 2020 11:40:16 +0000 (18:40 +0700)]
NFC. Add PR44320 IR test case.

5 years agoNFC. Remove obsolete SimpleAnalysis infrastructure
Daniil Suchkov [Mon, 20 Jan 2020 06:21:46 +0000 (13:21 +0700)]
NFC. Remove obsolete SimpleAnalysis infrastructure

Apparently cache of AliasSetTrackers held by LICM was the only user of
SimpleAnalysis infrastructure. Now, given that we no longer have that
cache, this infrastructure is obsolete and, taking into account its
nature, we don't want any new solutions to be based on it.

Reviewers: asbirlea, fhahn, efriedma, reames

Reviewed-By: asbirlea
Differential Revision: https://reviews.llvm.org/D73085

5 years agoFix build bot failures.
Igor Kudrin [Thu, 23 Jan 2020 06:06:03 +0000 (13:06 +0700)]
Fix build bot failures.

Unfortunately, not all compilers allow using llvm_unreachable
in a constexpr function.

5 years ago[gn build] Port dcff3961c2d
LLVM GN Syncbot [Thu, 23 Jan 2020 05:43:56 +0000 (05:43 +0000)]
[gn build] Port dcff3961c2d

5 years ago[DWARF] Better detect errors in Address Range Tables.
Igor Kudrin [Thu, 26 Dec 2019 12:53:06 +0000 (19:53 +0700)]
[DWARF] Better detect errors in Address Range Tables.

The patch tries to cover most remaining cases of wrong data.

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

5 years ago[DWARF] Support DWARF64 in DWARFDebugArangeSet.
Igor Kudrin [Mon, 23 Dec 2019 14:17:34 +0000 (21:17 +0700)]
[DWARF] Support DWARF64 in DWARFDebugArangeSet.

This allows parsing Address Range Tables in the 64-bit DWARF format.

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

5 years ago[DWARF] Make dwarf::getDwarfOffsetByteSize() a free function. NFC.
Igor Kudrin [Mon, 20 Jan 2020 04:52:07 +0000 (11:52 +0700)]
[DWARF] Make dwarf::getDwarfOffsetByteSize() a free function. NFC.

This will help simplify code in upcoming patches and make some
expressions constexpr.

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

5 years ago[DWARF] Make dwarf::getUnitLengthFieldByteSize() constexpr. NFC.
Igor Kudrin [Mon, 20 Jan 2020 04:37:37 +0000 (11:37 +0700)]
[DWARF] Make dwarf::getUnitLengthFieldByteSize() constexpr. NFC.

This will help make some expressions in upcoming patches constexpr.

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

5 years ago[DWARF] Return Error from DWARFDebugArangeSet::extract().
Igor Kudrin [Wed, 25 Dec 2019 07:05:56 +0000 (14:05 +0700)]
[DWARF] Return Error from DWARFDebugArangeSet::extract().

This helps to detect and report parsing errors better.
The patch follows the ideas of LLDB's patches D59370 and D59381.

It adds tests for valid and some invalid cases. More checks and
tests to come. Note that the patch fixes validation of the Length
field because the value does not include the field itself.

The existing users are updated to show the error messages.

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

5 years ago[DWARF] Allow empty address range tables.
Igor Kudrin [Fri, 27 Dec 2019 09:51:02 +0000 (16:51 +0700)]
[DWARF] Allow empty address range tables.

Empty address range tables are allowed by the DWARF standard;
Moreover, generating them is recommended as a best practice, see
http://wiki.dwarfstd.org/index.php?title=Best_Practices#Generating_.debug_aranges_data

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

5 years ago[LICM] NFC. Remove AST caching infrastructure
Daniil Suchkov [Mon, 20 Jan 2020 06:20:07 +0000 (13:20 +0700)]
[LICM] NFC. Remove AST caching infrastructure

Since LICM doesn't use AST caching any more (see D73081), this
infrastructure is now obsolete and we can remove it.

Reviewers: asbirlea, fhahn, efriedma, reames

Reviewed-By: asbirlea
Differential Revision: https://reviews.llvm.org/D73084

5 years ago[libcxx] [test] Don't assert that moved-from containers with non-POCMA allocators...
Billy Robert O'Neal III [Thu, 23 Jan 2020 05:15:16 +0000 (21:15 -0800)]
[libcxx] [test] Don't assert that moved-from containers with non-POCMA allocators are empty.

5 years agoAMDGPU/GlobalISel: Fix generated wave64 checks
Matt Arsenault [Thu, 23 Jan 2020 03:05:54 +0000 (22:05 -0500)]
AMDGPU/GlobalISel: Fix generated wave64 checks

This inexplicably managed to pass locally without the updated wave64
checks.

5 years agoAMDGPU/GlobalISel: Remove redundant or patterns
Matt Arsenault [Thu, 23 Jan 2020 02:36:26 +0000 (21:36 -0500)]
AMDGPU/GlobalISel: Remove redundant or patterns

These ended up with higher priority than or3 patterns in a future
patch. This also fixes the using VOP2 forms.

5 years ago[LV] Fix predication for branches with matching true and false succs.
Florian Hahn [Thu, 23 Jan 2020 02:30:33 +0000 (18:30 -0800)]
[LV] Fix predication for branches with matching true and false succs.

Currently due to the edge caching, we create wrong predicates for
branches with matching true and false successors. We will cache the
condition for the edge from the true successor, and then lookup the same
edge (src and dst are the same) for the edge to the false successor.

If both successors match, the condition should always be true. At the
moment, we cannot really create constant VPValues, but we can just
create a true condition as X | !X. Later passes will clean that up.

Fixes PR44488.

Reviewers: rengolin, hsaito, fhahn, Ayal, dorit, gilr

Reviewed By: Ayal

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

5 years ago[test] Fix lld/test/ELF/riscv-pcrel-hilo-error.s after D73211
James Clarke [Thu, 23 Jan 2020 02:30:10 +0000 (02:30 +0000)]
[test] Fix lld/test/ELF/riscv-pcrel-hilo-error.s after D73211

5 years ago[llvm/Transforms] Fix warning: private field 'MSSA' is not used
Jonas Devlieghere [Thu, 23 Jan 2020 02:07:03 +0000 (18:07 -0800)]
[llvm/Transforms] Fix warning: private field 'MSSA' is not used

5 years ago[RISCV] Fix evaluating %pcrel_lo against global and weak symbols
James Clarke [Thu, 23 Jan 2020 02:05:46 +0000 (02:05 +0000)]
[RISCV] Fix evaluating %pcrel_lo against global and weak symbols

Summary:
Previously, we would erroneously turn %pcrel_lo(label), where label has
a %pcrel_hi against a weak symbol, into %pcrel_lo(label + offset), as
evaluatePCRelLo would believe the target independent logic was going to
fold it. Moreover, even if that were fixed, shouldForceRelocation lacks
an MCAsmLayout and thus cannot evaluate the %pcrel_hi fixup to a value
and check the symbol, so we would then erroneously constant-fold the
%pcrel_lo whilst leaving the %pcrel_hi intact. After D72197, this same
sequence also occurs for symbols with global binding, which is triggered
in real-world code.

Instead, as discussed in D71978, we introduce a new FKF_IsTarget flag to
avoid these kinds of issues. All the resolution logic happens in one
place, with no coordination required between RISCAsmBackend and
RISCVMCExpr to ensure they implement the same logic twice. Although the
implementation of %pcrel_hi can be left as target independent, we make
it target dependent to ensure that they are handled identically to
%pcrel_lo, otherwise we risk one of them being constant folded but the
other being preserved. This also allows us to properly support fixup
pairs where the instructions are in different fragments.

Reviewers: asb, lenary, efriedma

Reviewed By: efriedma

Subscribers: arichardson, hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, llvm-commits

Tags: #llvm

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

5 years ago[lldb/Docs] Document testing strategies for the reproducers
Jonas Devlieghere [Thu, 23 Jan 2020 02:00:25 +0000 (18:00 -0800)]
[lldb/Docs] Document testing strategies for the reproducers

Document the different ways we test the reproducers. This is mostly to
describe the new check-lldb-repro target.

5 years ago[lldb/Test] Fix type in add_lit_testsuite
Jonas Devlieghere [Thu, 23 Jan 2020 01:51:55 +0000 (17:51 -0800)]
[lldb/Test] Fix type in add_lit_testsuite

The new test suite should be called check-lldb-repro rather than
check-lldb.

5 years ago[lldb/Test] Add check-lldb-repro target
Jonas Devlieghere [Thu, 23 Jan 2020 01:31:43 +0000 (17:31 -0800)]
[lldb/Test] Add check-lldb-repro target

This adds a new target check-lldb-repro which runs the shell tests with
the lldb-repo utility. It runs the shell tests twice, once while
capturing a reproducer and then again by replaying that reproducer.

5 years agoReplace old-style cast of null pointer with nullptr
Joerg Sonnenberger [Thu, 23 Jan 2020 01:20:09 +0000 (02:20 +0100)]
Replace old-style cast of null pointer with nullptr

5 years ago[lldb/Reproducer] Mark some driver tests as unsupported for lldb-repro
Jonas Devlieghere [Thu, 23 Jan 2020 00:53:09 +0000 (16:53 -0800)]
[lldb/Reproducer] Mark some driver tests  as unsupported for lldb-repro

These test are checking for diagnostics printed by the driver. During
replay we only replay the SB API calls made by the driver, so it's
expected that these messages aren't displayed.

5 years ago[AArch64TTI] AArch64 supports NT vector stores through STNP.
Florian Hahn [Thu, 23 Jan 2020 00:41:08 +0000 (16:41 -0800)]
[AArch64TTI] AArch64 supports NT vector stores through STNP.

This patch adds a custom implementation of isLegalNTStore to AArch64TTI
that supports vector types that can be directly stored by STNP. Note
that the implementation may not catch all valid cases (e.g. because the
vector is a multiple of 256 and could be broken down to multiple valid 256 bit
stores), but it is good enough for LV to vectorize loops with NT stores,
as LV only passes in a vector with 2 elements to check. LV seems to also
be the only user of isLegalNTStore.

We should also do the same for NT loads, but before that we need to
ensure that we properly lower LDNP of vectors, similar to D72919.

Reviewers: dmgreen, samparker, t.p.northover, ab

Reviewed By: dmgreen

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

5 years ago[IndVarSimplify] Teach IndVarSimplify to preserve MemorySSA.
Alina Sbirlea [Wed, 22 Jan 2020 23:26:58 +0000 (15:26 -0800)]
[IndVarSimplify] Teach IndVarSimplify to preserve MemorySSA.

5 years ago[lldb/Reproducer] Disable buffering of stdout during replay
Jonas Devlieghere [Thu, 23 Jan 2020 00:15:06 +0000 (16:15 -0800)]
[lldb/Reproducer] Disable buffering of stdout during replay

Different buffering behavior during capture and replay caused some of
the shell tests to fail when run from a reproducer. By disabling stdout
buffering we get a better approximation of how things get flushed during
an regular debug session. There is a performance impact but since this
only affects replay this is acceptable.

5 years agoRevert "[cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ON"
Tom Stellard [Thu, 23 Jan 2020 00:12:45 +0000 (16:12 -0800)]
Revert "[cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ON"

This reverts commit df839cfda09dbadc26b8be635f27da75f1f27190.

This change used cmake's list filter operation which was not added
until cmake 3.6.

5 years ago[cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ON
Tom Stellard [Wed, 22 Jan 2020 22:06:56 +0000 (22:06 +0000)]
[cmake] Fix clang builds with BUILD_SHARED=ON and CLANG_LINK_CLANG_DYLIB=ON

Summary:
We were linking all the clang objects and shared libraries into
libclang-cpp.so, which was causing the command line options to be
registered twice.

Reviewers: beanz, mgorny

Reviewed By: beanz, mgorny

Subscribers: mgorny, cfe-commits

Tags: #clang

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

5 years ago[nfc][libomptarget] Remove SHARED annotation from local variables
Jon Chesterfield [Thu, 23 Jan 2020 00:00:23 +0000 (00:00 +0000)]
[nfc][libomptarget] Remove SHARED annotation from local variables

Summary:
[nfc][libomptarget] Remove SHARED annotation from local variables

A few local variables in reduction.cu were marked SHARED. This patch leaves
all per-kernel global state localised in omp_data.cu.

Reviewers: ABataev, jdoerfert, grokos

Reviewed By: jdoerfert

Subscribers: openmp-commits

Tags: #openmp

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

5 years agoEmbed a zero-length /dev/null in darwin-debug for the special section.
Jason Molenda [Wed, 22 Jan 2020 23:50:33 +0000 (15:50 -0800)]
Embed a zero-length /dev/null in darwin-debug for the special section.

Fred suggested that instead of embedded CMakeLists.txt in the binary as
the contents of a special section, see if /dev/null would work.  It
does.

5 years ago[IndVarSimplify] Cleanup spaces and reduce variable scope [NFCI]
Alina Sbirlea [Wed, 22 Jan 2020 23:26:12 +0000 (15:26 -0800)]
[IndVarSimplify] Cleanup spaces and reduce variable scope [NFCI]

Minor clean-ups + clang-format.

5 years ago[LoopIdiomRecognize] Reduce variable scope. [NFCI]
Alina Sbirlea [Wed, 22 Jan 2020 19:45:33 +0000 (11:45 -0800)]
[LoopIdiomRecognize] Reduce variable scope. [NFCI]

5 years ago[lldb/Test] Skip script interpreter tests reading from stdin for lldb-repro
Jonas Devlieghere [Wed, 22 Jan 2020 23:14:50 +0000 (15:14 -0800)]
[lldb/Test] Skip script interpreter tests reading from stdin for lldb-repro

The reproducers currently only shadow the command interpreter. It would
be possible to make it work for the Lua interpreter which uses the
IOHandlerEditline under the hood, but the Python one runs a REPL in
Python itself so there's no (straightforward) way to shadow that.

Given that we already capture any API calls, this isn't super high on my
list of priorities.

5 years ago[lldb/Utility] Don't forward directories to the file collector
Jonas Devlieghere [Wed, 22 Jan 2020 22:51:26 +0000 (14:51 -0800)]
[lldb/Utility] Don't forward directories to the file collector

The VFS mapping writer assumes that all the paths it gets are files.
When passed a directory, it ends up as a file in the VFS mapping twice,
once as a file and once as a directory.

  {
    'type': 'file',
    'name': "Output",
    'external-contents': "/root/path/to/Output"
  },
  {
    'type': 'directory',
    'name': "Output",
    'contents': [ ... ]
  }

5 years ago[www] Update cxx_status page to list changes on the Clang 10 branch as
Richard Smith [Wed, 22 Jan 2020 22:48:56 +0000 (14:48 -0800)]
[www] Update cxx_status page to list changes on the Clang 10 branch as
"Clang 10" not "SVN".

5 years ago[InstCombine] Combine neg of shl of sub (PR44529)
Nikita Popov [Sat, 18 Jan 2020 15:54:43 +0000 (16:54 +0100)]
[InstCombine] Combine neg of shl of sub (PR44529)

Fixes https://bugs.llvm.org/show_bug.cgi?id=44529. We already have
a combine to sink a negation through a left-shift, but it currently
only works if the shift operand is negatable without creating any
instructions. This patch introduces freelyNegateValue() as a more
powerful extension of dyn_castNegVal(), which allows negating a
value as long as this doesn't end up increasing instruction count.
Specifically, this patch adds support for negating A-B to B-A.

This mechanism could in the future be extended to handle general
negation chains that a) start at a proper 0-X negation and b) only
require one operand to be freely negatable. This would end up as a
weaker form of D68408 aimed at the most obviously profitable subset
that eliminates a negation entirely.

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

5 years ago[InstCombine] Add test for PR44529; NFC
Nikita Popov [Sat, 18 Jan 2020 15:54:25 +0000 (16:54 +0100)]
[InstCombine] Add test for PR44529; NFC

5 years ago[X86] Cast to __v4hi instead of __m64 in the implementation of _mm_extract_pi16 and...
Craig Topper [Wed, 22 Jan 2020 21:59:14 +0000 (15:59 -0600)]
[X86] Cast to __v4hi instead of __m64 in the implementation of _mm_extract_pi16 and _mm_insert_pi16.

__m64 is a vector of 1 long long. But the builtins these intrinsics
are calling expect a vector of 4 shorts.

Fixes PR44589

5 years ago[mlir][Linalg] Add tensor support to Linalg EDSC Builders
Nicolas Vasilache [Wed, 22 Jan 2020 00:48:31 +0000 (19:48 -0500)]
[mlir][Linalg] Add tensor support to Linalg EDSC Builders

Summary:
This diff extends the Linalg EDSC builders so we can easily create mixed
tensor/buffer linalg.generic ops. This is expected to be useful for
HLO -> Linalg lowering.

The StructuredIndexed struct is made to derive from ValueHandle and can
now capture a type + indexing expressions. This is used to represent return
tensors.

Pointwise unary and binary builders are extended to allow both output buffers
and return tensors. This has implications on the number of region arguments.

Reviewers: ftynse, hanchung, asaadaldien

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits

Tags: #llvm

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

5 years ago[TestStdModuleSysroot] Only run locally.
Davide Italiano [Wed, 22 Jan 2020 21:56:11 +0000 (13:56 -0800)]
[TestStdModuleSysroot] Only run locally.

5 years ago[PatternMatch] Make m_c_ICmp swap the predicate (PR42801)
Nikita Popov [Sat, 18 Jan 2020 12:08:49 +0000 (13:08 +0100)]
[PatternMatch] Make m_c_ICmp swap the predicate (PR42801)

This addresses https://bugs.llvm.org/show_bug.cgi?id=42801.
The m_c_ICmp() matcher is changed to provide the swapped predicate
if the operands are swapped.

Existing uses of m_c_ICmp() fall in one of two categories: Working
on equality predicates only, where swapping is irrelevant.
Or performing a manual swap, in which case this patch removes it.

The only exception is the foldICmpWithLowBitMaskedVal() fold, which
does not swap the predicate, and instead reasons about whether
a swap occurred or not for each predicate. Getting the swapped
predicate allows us to merge the logic for pairs of predicates,
instead of duplicating it.

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

5 years ago[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
Sean Fertile [Tue, 21 Jan 2020 20:24:50 +0000 (15:24 -0500)]
[PowerPC] Collect some CallLowering arguments into a struct. [NFC]

Collect the calling convention and a number of boolean arguments into a
structure to slightly reduces the number of arguments passed around between
LowerCall_<Subtarget>, FinishCall and a few of the helpers. Also
calulates if a call is indirect once using the exisitng helper and caches the
result replacing several instances where we duplicated the logic determining if
a call is indirect.

5 years agoClang] Fix expansion of response files in -Wp after integrated-cc1 change
Alexandre Ganea [Wed, 22 Jan 2020 21:53:38 +0000 (16:53 -0500)]
Clang] Fix expansion of response files in -Wp after integrated-cc1 change

After rGb4a99a061f517e60985667e39519f60186cbb469, passing a response file such as -Wp,@a.rsp wasn't working anymore because .rsp expansion happens inside clang's main() function.

This patch adds response file expansion in the -cc1 tool.

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

5 years ago[PatternMatch] Add m_APInt/m_APFloat matchers accepting undef
Nikita Popov [Sat, 18 Jan 2020 11:21:14 +0000 (12:21 +0100)]
[PatternMatch] Add m_APInt/m_APFloat matchers accepting undef

The current m_APInt() and m_APFloat() matchers do not accept splats
that include undefs (unlike m_Zero() and other matchers for specific
values). We can't simply change the default behavior, as there are
existing transforms that would not be safe with undefs.

For this reason, I'm introducing new m_APIntAllowUndef() and
m_APFloatAllowUndef() matchers, that allow splats with undefs.
Additionally, m_APIntForbidUndef() and m_APFloatForbidUndef() are
added. These have the same behavior as the existing m_APInt() and
m_APFloat(), but serve as an explicit indication that undefs were
considered and found unsound for this transform. This helps
distinguish them from existing uses of m_APInt() where we do not
know whether undefs can or cannot be allowed without additional review.

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

5 years ago[ODRHash] Factor out functionality for CXXRecord ODR diagnostics (NFCI)
Bruno Cardoso Lopes [Wed, 22 Jan 2020 20:43:19 +0000 (12:43 -0800)]
[ODRHash] Factor out functionality for CXXRecord ODR diagnostics (NFCI)

There's going to be a lot of common code between RecordDecl and
CXXRecordDecl, factor out some of the logic in preparation for
adding the RecordDecl side.

5 years ago[lldb/Reproducer] Correctly instrument enum values
Jonas Devlieghere [Wed, 22 Jan 2020 21:22:58 +0000 (13:22 -0800)]
[lldb/Reproducer] Correctly instrument enum values

Enum values can be serialized trivially and should not go through the
object registry.

5 years ago[lldb/Test] Use lit's capabilities to skip lldb-repro tests.
Jonas Devlieghere [Wed, 22 Jan 2020 20:15:14 +0000 (12:15 -0800)]
[lldb/Test] Use lit's capabilities to skip lldb-repro tests.

This allows us to skip the reproducer tests themselves as a whole as
well as individual tests with the UNSUPPORTED keyword.

5 years ago[lldb/Util] Fix lldb-repro now it doesn't take a path to lldb
Jonas Devlieghere [Wed, 22 Jan 2020 18:46:43 +0000 (10:46 -0800)]
[lldb/Util] Fix lldb-repro now it doesn't take a path to lldb

The indices into the arguments array were off because we no longer pass
the path to lldb as the first argument.

5 years agoConvert AssertTrue( A == B) to AssertEqual(A, B) in TestObjCStepping.py.
Jim Ingham [Wed, 22 Jan 2020 21:20:15 +0000 (13:20 -0800)]
Convert AssertTrue( A == B) to AssertEqual(A, B) in TestObjCStepping.py.

5 years agoR600: Fix failing testcase
Matt Arsenault [Wed, 22 Jan 2020 21:01:15 +0000 (16:01 -0500)]
R600: Fix failing testcase

5 years ago[libFuzzer] Add INFO output when LLVMFuzzerCustomMutator is found.
Max Moroz [Wed, 22 Jan 2020 20:56:16 +0000 (12:56 -0800)]
[libFuzzer] Add INFO output when LLVMFuzzerCustomMutator is found.

Summary:
there is an ongoing work on interchangeable custom mutators
(https://github.com/google/clusterfuzz/pull/1333/files#r367706283)
and having some sort of signalling from libFuzzer that it has loaded
a custom mutator would be helpful.

The initial idea was to make the mutator to print something, but given
the anticipated variety of different mutators, it does not seem possible
to make all of them print the same message to signal their execution.

Reviewers: kcc, metzman

Reviewed By: metzman

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

5 years ago[llvm-cov] Add support for -skip-functions to lcov
Keith Smiley [Wed, 22 Jan 2020 20:48:25 +0000 (12:48 -0800)]
[llvm-cov] Add support for -skip-functions to lcov

Summary:
This flag was added for the json format to exclude functions from the
output. This mirrors that behavior in lcov (where it was previously
accepted but ignored). This makes the output file smaller which can be
beneficial depending on how you consume it, especially if you don't use
this data anyways.

Patch by Keith Smiley (@keith).

Reviewers: kastiglione, Dor1s, vsk, allevato

Reviewed By: Dor1s, allevato

Subscribers: llvm-commits

Tags: #llvm

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

5 years ago[x86] fold vperm2x128 to concat of 128-bit high half vectors
Sanjay Patel [Wed, 22 Jan 2020 19:48:28 +0000 (14:48 -0500)]
[x86] fold vperm2x128 to concat of 128-bit high half vectors

vperm (ins ?, X, C), (ins ?, Y, C), 0x31 --> concat X, Y

This is another shuffle problem seen with PR42024:
https://bugs.llvm.org/show_bug.cgi?id=42024

We have this small crack in legalization/lowering/combining/demanded
that allows forming a vperm2f128 of high halves with AVX1 when we
could do better by peeking through the insert_subvector nodes.
AFAICT, it requires IR as shown in the diffs - much larger than legal
vectors - to avoid all of the usual folds.

Another option would prevent forming the 256-bit vperm in lowering.

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

5 years ago[SVE] Pass Scalable argument to VectorType::get in Bitcode Reader
Chris Tetreault [Wed, 22 Jan 2020 19:50:10 +0000 (11:50 -0800)]
[SVE] Pass Scalable argument to VectorType::get in Bitcode Reader

Pass the Scalability test to VectorType::get in order to be able to
deserialize bitcode that contains scalable vector operations

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

5 years agoExtend misc-misplaced-const to detect using declarations as well as typedef
Alexander Lanin [Wed, 22 Jan 2020 20:26:11 +0000 (15:26 -0500)]
Extend misc-misplaced-const to detect using declarations as well as typedef

5 years agoAdd a bit of documentation on attribute spellings that were missing.
Aaron Ballman [Wed, 22 Jan 2020 20:21:43 +0000 (15:21 -0500)]
Add a bit of documentation on attribute spellings that were missing.

5 years ago[LoopDeletion] Teach LoopDeletion to preserve MemorySSA if available.
Alina Sbirlea [Wed, 22 Jan 2020 00:56:39 +0000 (16:56 -0800)]
[LoopDeletion] Teach LoopDeletion to preserve MemorySSA if available.

If MemorySSA analysis is analysis, LoopDeletion now preserves it.

5 years ago[mlir] Add baseAttr to TypedArrayAttrBase.
Abdurrahman Akkas [Wed, 22 Jan 2020 19:35:12 +0000 (19:35 +0000)]
[mlir] Add baseAttr to TypedArrayAttrBase.

Element type is useful in code generators but it is lost after construction.

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

5 years agoAMDGPU/R600: Emit rodata in text segment
Jan Vesely [Sun, 19 Jan 2020 05:29:30 +0000 (00:29 -0500)]
AMDGPU/R600: Emit rodata in text segment

R600 relies on this behaviour.
Fixes: 6e18266aa4dd78953557b8614cb9ff260bad7c65 ('Partially revert D61491 "AMDGPU: Be explicit about whether the high-word in SI_PC_ADD_REL_OFFSET is 0"')
Fixes ~100 piglit regressions since 6e18266

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