platform/upstream/llvm.git
3 years ago[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.
Alexey Bataev [Wed, 12 Aug 2020 14:54:36 +0000 (10:54 -0400)]
[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.

In untied tasks, need to allocate the space for local variales, declared
in task region, when the memory for task data is allocated. THe function
can be interrupted and we can exit from the function in untied task
switch. Need to keep the state of the local variables in this case.
Also, the compiler should not call cleanup when exiting in untied task
switch until the real exit out of the declaration scope is met during
 execution.

Reviewed By: jdoerfert

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

3 years ago[OpenCL] Remove warning for variadic macros in C++ for OpenCL.
Anastasia Stulova [Wed, 12 Aug 2020 09:01:46 +0000 (10:01 +0100)]
[OpenCL] Remove warning for variadic macros in C++ for OpenCL.

Patch by Ole Strohm (olestrohm)!

Tags: #clang

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

3 years ago[Hexagon] Return scalar size in getMinVectorRegisterBitWidth() when no HVX
Krzysztof Parzyszek [Wed, 12 Aug 2020 15:11:12 +0000 (10:11 -0500)]
[Hexagon] Return scalar size in getMinVectorRegisterBitWidth() when no HVX

This fixes https://llvm.org/PR47128.

3 years ago[ARM][MVE] Enable tail predication for loops containing MVE gather/scatters
Anna Welker [Wed, 12 Aug 2020 12:44:18 +0000 (13:44 +0100)]
[ARM][MVE] Enable tail predication for loops containing MVE gather/scatters

Widen the scope of memory operations that are allowed to be tail predicated
to include gathers and scatters, such that loops that are auto-vectorized
with the option -enable-arm-maskedgatscat (and actually end up containing
an MVE gather or scatter) can be tail predicated.

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

3 years ago[analyzer] StdLibraryFunctionsChecker: Add support for new functions
Zurab Tsinadze [Wed, 12 Aug 2020 14:18:42 +0000 (16:18 +0200)]
[analyzer] StdLibraryFunctionsChecker: Add support for new functions

`toupper`, `tolower`, `toascii` functions were added to
StdLibraryFunctionsChecker to fully cover CERT STR37-C rule:
https://wiki.sei.cmu.edu/confluence/x/BNcxBQ

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

3 years ago[OPENMP]Do not add TGT_OMP_TARGET_PARAM flag to non-captured mapped arguments.
Alexey Bataev [Tue, 11 Aug 2020 16:30:45 +0000 (12:30 -0400)]
[OPENMP]Do not add TGT_OMP_TARGET_PARAM flag to non-captured mapped arguments.

If the arguments are mapped, but are actually not used in the target
region, the compiler still adds attribute TGT_OMP_TARGET_PARAM for such
arguments. It makes the libomptarget to add such parameters to the list
of arguments, passed to the kernel at the runtime, and may lead to
incorrect results/crashes during execution.

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

3 years agoAMDGPU/GlobalISel: Select llvm.amdgcn.global.atomic.fadd
Matt Arsenault [Thu, 6 Aug 2020 03:21:16 +0000 (23:21 -0400)]
AMDGPU/GlobalISel: Select llvm.amdgcn.global.atomic.fadd

Remove the intermediate transform in the DAG path. I believe this is
the last non-deprecated intrinsic that needs handling.

3 years agoAMDGPU: Handle intrinsics in performMemSDNodeCombine
Matt Arsenault [Mon, 10 Aug 2020 16:25:48 +0000 (12:25 -0400)]
AMDGPU: Handle intrinsics in performMemSDNodeCombine

This avoids a possible regression in a future patch

3 years agoRevert "[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks."
Alexey Bataev [Wed, 12 Aug 2020 13:49:59 +0000 (09:49 -0400)]
Revert "[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks."

This reverts commit ec9563c54ed25e9f9cbe60985399212d50bd801d to
investigate compiler crash revelaed by the buildbots.

3 years ago[DWARFYAML] Make the address size of compilation units optional.
Xing GUO [Wed, 12 Aug 2020 13:47:27 +0000 (21:47 +0800)]
[DWARFYAML] Make the address size of compilation units optional.

This patch makes the 'AddrSize' field optional. If the address size is
missing, yaml2obj will infer it from the object file.

Reviewed By: jhenderson

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

3 years ago[MachOYAML] Simplify the section data emitting function. NFC.
Xing GUO [Wed, 12 Aug 2020 13:44:56 +0000 (21:44 +0800)]
[MachOYAML] Simplify the section data emitting function. NFC.

This patch helps simplify some codes in writeSectionData() function.

Reviewed By: jhenderson, grimar

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

3 years ago[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.
Alexey Bataev [Tue, 21 Jul 2020 19:20:16 +0000 (15:20 -0400)]
[OPENMP]Fix PR37671: Privatize local(private) variables in untied tasks.

Summary:
In untied tasks, need to allocate the space for local variales, declared
in task region, when the memory for task data is allocated. THe function
can be interrupted and we can exit from the function in untied task
switch. Need to keep the state of the local variables in this case.
Also, the compiler should not call cleanup when exiting in untied task
switch until the real exit out of the declaration scope is met during
 execution.

Reviewers: jdoerfert

Subscribers: yaxunl, guansong, cfe-commits, sstefan1, caomhin

Tags: #clang

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

3 years agoLimit Max Vector alignment on COFF targets to 8192.
Erich Keane [Fri, 7 Aug 2020 19:05:24 +0000 (12:05 -0700)]
Limit Max Vector alignment on COFF targets to 8192.

COFF targets have a max object alignment of 8192, so trying to create
one with a larger size results in an unreachable in WinCOFFObjectWriter.

For the reproducer I have uses thread local storage, however other
alignments are likely affected as well.

This patch sets the MaxVectorAlign for COFF to 8192.  Additionally,
though there is no longer a way to reproduce that I could find, it
correctly sets the MaxTLSAlign for COFF to that value as well, so that
if anyone comes up with a situation where this is true, it will cause an
error.

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

3 years ago[VectorCombine] early exit if target has no vector registers
Sanjay Patel [Wed, 12 Aug 2020 13:20:59 +0000 (09:20 -0400)]
[VectorCombine] early exit if target has no vector registers

Based on post-commit discussion in:
D81766

Other vectorization passes (SLP and Loop) use this TTI API similarly.

3 years ago[VectorCombine] add test for x86 target with SSE disabled; NFC
Sanjay Patel [Wed, 12 Aug 2020 13:15:11 +0000 (09:15 -0400)]
[VectorCombine] add test for x86 target with SSE disabled; NFC

3 years ago[ARM] Add additional predicated VFMA tests. NFC
David Green [Wed, 12 Aug 2020 13:20:20 +0000 (14:20 +0100)]
[ARM] Add additional predicated VFMA tests. NFC

3 years ago[InstCombine] eliminate a pointer cast around insertelement
Sanjay Patel [Wed, 12 Aug 2020 13:08:17 +0000 (09:08 -0400)]
[InstCombine] eliminate a pointer cast around insertelement

I'm not sure if this solves PR46839 completely, but reducing the casting should help:
https://bugs.llvm.org/show_bug.cgi?id=46839

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

3 years ago[VectorCombine] add test for Hexagon that would crash; NFC
Sanjay Patel [Wed, 12 Aug 2020 12:36:02 +0000 (08:36 -0400)]
[VectorCombine] add test for Hexagon that would crash; NFC

This test verifies the code change from:
rGb0b95dab1ce2
(although that would not be true if PR47128 is fixed)

3 years ago[SystemZ/ZOS] Implement computeHostNumPhysicalCores
Kai Nacke [Tue, 28 Jul 2020 08:33:50 +0000 (10:33 +0200)]
[SystemZ/ZOS] Implement computeHostNumPhysicalCores

On z/OS, the information is stored in the Common System Data Area
(CSD). It is the number of CPs allocated to the current LPAR.

Reviewers: aganea, hubert.reinterpertcast, MaskRay

Reviewed By: hubert.reinterpertcast

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

3 years ago[LoopUnroll] Adjust CostKind query
Sam Parker [Tue, 11 Aug 2020 13:19:35 +0000 (14:19 +0100)]
[LoopUnroll] Adjust CostKind query

When TTI was updated to use an explicit cost, TCK_CodeSize was used
although the default implicit cost would have been the hand-wavey
cost of size and latency. So, revert back to this behaviour. This is
not expected to have (much) impact on targets since most (all?) of
them return the same value for SizeAndLatency and CodeSize.

When optimising for size, the logic has been changed to query
CodeSize costs instead of SizeAndLatency.

This patch also adds a testing option in the unroller so that
OptSize thresholds can be specified.

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

3 years agoRevert "[lldb] Display autosuggestion part in gray if there is one possible suggestion"
Raphael Isemann [Wed, 12 Aug 2020 11:52:03 +0000 (13:52 +0200)]
Revert "[lldb] Display autosuggestion part in gray if there is one possible suggestion"

This reverts commit 246afe0cd17fce935a01171f3cca548e02523e5c. This broke
the following tests on Linux it seems:
  lldb-api :: commands/expression/multiline-completion/TestMultilineCompletion.py
  lldb-api :: iohandler/completion/TestIOHandlerCompletion.py

3 years ago[ARM] Commutative vmin/maxnma tests. NFC
David Green [Wed, 12 Aug 2020 11:50:18 +0000 (12:50 +0100)]
[ARM] Commutative vmin/maxnma tests. NFC

3 years ago[clang-tidy] prevent generated checks from triggering assertions on anonymous functions
Bogdan Serea [Tue, 11 Aug 2020 13:41:48 +0000 (14:41 +0100)]
[clang-tidy] prevent generated checks from triggering assertions on anonymous functions

Skeleton checks generated by clang-tidy add_check.py cause assertions to fail when run over anonymous functions(lambda functions). This patch introduces an additional check to verify that the target function is not anonymous before calling getName().
The code snippet from the [[ https://clang.llvm.org/extra/clang-tidy/Contributing.html | clang-tidy tutorial  ]]is also updated.

Reviewed By: alexfh, DavidTruby

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

3 years ago[X86][SSE] Fold HOP(SHUFFLE(X),SHUFFLE(Y)) --> SHUFFLE(HOP(X,Y))
Simon Pilgrim [Wed, 12 Aug 2020 11:11:08 +0000 (12:11 +0100)]
[X86][SSE] Fold HOP(SHUFFLE(X),SHUFFLE(Y)) --> SHUFFLE(HOP(X,Y))

This is beginning to look like a canonicalization stage that could be performed as part of shuffle combining

Another step towards PR41813

3 years ago[lldb] Display autosuggestion part in gray if there is one possible suggestion
Shu Anzai [Wed, 12 Aug 2020 10:54:28 +0000 (12:54 +0200)]
[lldb] Display autosuggestion part in gray if there is one possible suggestion

I implemented autosuggestion if there is one possible suggestion.
I set the keybinds for every character. When a character is typed, Editline::TypedCharacter is called.
Then, autosuggestion part is displayed in gray, and you can actually input by typing C-k.
Editline::Autosuggest is a function for finding completion, and it is like Editline::TabCommand now, but I will add more features to it.

Testing does not work well in my environment, so I can't confirm that it goes well, sorry. I am dealing with it now.

Reviewed By: teemperor, JDevlieghere, #lldb

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

3 years ago[mlir] Expose printing functions in C API
Alex Zinenko [Tue, 11 Aug 2020 16:25:09 +0000 (18:25 +0200)]
[mlir] Expose printing functions in C API

Provide printing functions for most IR objects in C API (except Region that
does not have a `print` function, and Module that is expected to be printed as
Operation instead). The printing is based on a callback that is called with
chunks of the string representation and forwarded user-defined data.

Reviewed By: stellaraccident, Jing, mehdi_amini

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

3 years ago[llvm-readobj] - Refine logic of the symbol table locating in printRelocationsHelper().
Georgii Rymar [Thu, 6 Aug 2020 12:42:39 +0000 (15:42 +0300)]
[llvm-readobj] - Refine logic of the symbol table locating in printRelocationsHelper().

This removes the last `unwrapOrError` call from the `printRelocationsHelper`.

There is a little additional complexity because of `SHT_RELR/SHT_ANDROID_RELR` sections.
Such sections contains only relative relocations and they do not have a
symbol table associated with them, hence we should not try to treat
their `sh_link` field as a reference to a symbol table.

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

3 years ago[X86][AVX] Fold CONCAT(HOP(X,Y),HOP(Z,W)) -> HOP(CONCAT(X,Z),CONCAT(Y,W)) for float...
Simon Pilgrim [Wed, 12 Aug 2020 10:21:20 +0000 (11:21 +0100)]
[X86][AVX] Fold CONCAT(HOP(X,Y),HOP(Z,W)) -> HOP(CONCAT(X,Z),CONCAT(Y,W)) for float types

Only do this for AVX2+ targets as we still get some regressions on AVX1 without PERMPD/PERMQ

3 years ago[lldb] Add support for checking children in expect_expr
Raphael Isemann [Wed, 12 Aug 2020 09:27:21 +0000 (11:27 +0200)]
[lldb] Add support for checking children in expect_expr

expect_expr currently can't verify the children of the result SBValue.

This patch adds the ability to check them. The idea is to have a CheckValue
class where one can specify what attributes of a SBValue should be checked.
Beside the properties we already check for (summary, type, etc.) this also
has a list of children which is again just a list of CheckValue object (which
can also have children of their own).

The main motivation is to make checking the children no longer based
on error-prone substring checks that allow tests to pass just because
for example the error message contains the expected substrings by accident.

I also expect that we can just have a variant of `expect_expr` for LLDB's
expression paths (aka 'frame var') feature.

Reviewed By: labath

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

3 years ago[Transforms][SROA] Skip uses of allocas where the type is scalable
Cullen Rhodes [Tue, 11 Aug 2020 11:51:24 +0000 (11:51 +0000)]
[Transforms][SROA] Skip uses of allocas where the type is scalable

When visiting load and store instructions in SROA skip scalable vectors.
This is relevant in the implementation of the 'arm_sve_vector_bits'
attribute that is used to define VLS types, where an alloca of a
fixed-length vector could be bitcasted to scalable. See D85128 for more
information.

Reviewed By: efriedma

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

3 years agoAdd missing dependency on Doc generation for the OpenMP dialect
Mehdi Amini [Wed, 12 Aug 2020 09:11:32 +0000 (09:11 +0000)]
Add missing dependency on Doc generation for the OpenMP dialect

This is fixing the bot building the MLIR website.

3 years ago[mlir] use intptr_t in C API
Alex Zinenko [Tue, 11 Aug 2020 16:34:32 +0000 (18:34 +0200)]
[mlir] use intptr_t in C API

Using intptr_t is a consensus for MLIR C API, but the change was missing
from 75f239e9756b (that was using unsigned initially) due to a
misrebase.

Reviewed By: stellaraccident, mehdi_amini

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

3 years ago[SCEV] Look through single value PHIs.
Florian Hahn [Wed, 12 Aug 2020 07:46:07 +0000 (08:46 +0100)]
[SCEV] Look through single value PHIs.

Now that SCEVExpander can preserve LCSSA form,
we do not have to worry about LCSSA form when
trying to look through PHIs. SCEVExpander will take
care of inserting LCSSA PHI nodes as required.

This increases precision of the analysis in some cases.

Reviewed By: mkazantsev, bmahjour

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

3 years ago[llvm-dwarfdump] Avoid crashing if an abbreviation offset is invalid.
Igor Kudrin [Wed, 12 Aug 2020 08:37:16 +0000 (15:37 +0700)]
[llvm-dwarfdump] Avoid crashing if an abbreviation offset is invalid.

Note that DWARFUnit::getAbbreviations() returns nullptr if the
abbreviations could not be read, but callers used the returned
pointer without checking.

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

3 years ago[ARM][MVE] tail-predication: overflow checks for backedge taken count.
Sjoerd Meijer [Tue, 11 Aug 2020 14:48:29 +0000 (15:48 +0100)]
[ARM][MVE] tail-predication: overflow checks for backedge taken count.

This pick ups the work on the overflow checks for get.active.lane.mask,
which ensure that it is safe to insert the VCTP intrinisc that enables
tail-predication. For a 2d auto-correlation kernel and its inner loop j:

  M = Size - i;
  for (j = 0; j < M; j++)
    Sum += Input[j] * Input[j+i];

For this inner loop, the SCEV backedge taken count (BTC) expression is:

  (-1 + (sext i16 %Size to i32)),+,-1}<nw><%for.body>

and LoopUtil cannotBeMaxInLoop couldn't calculate a bound on this, thus "BTC
cannot be max" could not be determined. So overflow behaviour had to be assumed
in the loop tripcount expression that uses the BTC. As a result
tail-predication had to be forced (with an option) for this case.

This change solves that by using ScalarEvolution's helper
getConstantMaxBackedgeTakenCount which is able to determine the range of BTC,
thus can determine it is safe, so that we no longer need to force tail-predication
as reflected in the changed test cases.

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

3 years ago[SyntaxTree] Unbox operators into tokens for nodes generated from `CXXOperatorCallExpr`
Eduardo Caldas [Tue, 11 Aug 2020 16:28:00 +0000 (16:28 +0000)]
[SyntaxTree] Unbox operators into tokens for nodes generated from `CXXOperatorCallExpr`

For an user define `<`, `x < y` would yield the syntax tree:
```
BinaryOperatorExpression
|-IdExpression
| `-UnqualifiedId
|   `-x
|-IdExpression
| `-UnqualifiedId
|   `-<
`-IdExpression
  `-UnqualifiedId
    `-y
```
But there is no syntatic difference at call site between call site or
built-in `<`. As such they should generate the same syntax tree, namely:
```
BinaryOperatorExpression
|-IdExpression
| `-UnqualifiedId
|   `-x
|-<
`-IdExpression
  `-UnqualifiedId
    `-y
```

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

3 years ago[SVE][CodeGen] Fix issues with EXTRACT_SUBVECTOR when using scalable FP vectors
David Sherwood [Fri, 7 Aug 2020 10:45:25 +0000 (11:45 +0100)]
[SVE][CodeGen] Fix issues with EXTRACT_SUBVECTOR when using scalable FP vectors

In this patch I have fixed two issues:

1. Our SVE tuple get/set intrinsics were using the wrong constant type
for the index passed to EXTRACT_SUBVECTOR. I have fixed this by using the
function SelectionDAG::getVectorIdxConstant to create the value. Also, I
have updated the documentation for EXTRACT_SUBVECTOR describing what type
the constant index should be and we now enforce this when creating the
node.
2. The AArch64 backend was missing the appropriate patterns for
extracting certain subvectors (nxv4f16 and nxv2f32) from legal SVE types.
I have added them as part of this patch.

The only way that I could find to test the new patterns was to use the
SVE tuple get intrinsics, although I realise it looks a bit unusual.
Tests added here:

  test/CodeGen/AArch64/sve-extract-subvector.ll

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

3 years ago[VE] Change to promote i32 AND/OR/XOR operations
Kazushi (Jam) Marukawa [Tue, 11 Aug 2020 12:37:12 +0000 (21:37 +0900)]
[VE] Change to promote i32 AND/OR/XOR operations

VE has only 64 bits AND/OR/XOR instructions.  We pretended that VE has 32 bits
instructions also, but doing it increase the number of generated instructions.
Therefore, we decide to promote 32 bits operations and use only 64 bits
instructions in back end.  We also avoid pretending that VE has 32 bits LEA
instruction.  Update regression tests also.

Reviewed By: simoll

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

3 years ago[libc][obvious] Switch copysign[f|l] and fabs[f|l] to the new test matchers.
Siva Chandra [Wed, 12 Aug 2020 06:54:00 +0000 (23:54 -0700)]
[libc][obvious] Switch copysign[f|l] and fabs[f|l] to the new test matchers.

3 years ago[AST] Fix the CXXFoldExpr source range when parentheses range is invalid.
Haojian Wu [Wed, 12 Aug 2020 07:20:23 +0000 (09:20 +0200)]
[AST] Fix the CXXFoldExpr source range when parentheses range is invalid.

The CXXFoldExpr's range is invalid if the cxxfoldexpr is formed via the
Concept's TypeContraints (because the parentheses are not written in the
source code). We fallback to use the range from the pattern.

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

3 years ago[MLIR,OpenMP] Lowering of parallel operation: proc_bind clause 2/n
Kiran Chandramohan [Wed, 22 Jul 2020 16:28:04 +0000 (17:28 +0100)]
[MLIR,OpenMP] Lowering of parallel operation: proc_bind clause 2/n

This patch adds the translation of the proc_bind clause in a
parallel operation.

The values that can be specified for the proc_bind clause are
specified in the OMP.td tablegen file in the llvm/Frontend/OpenMP
directory. From this single source of truth enumeration for
proc_bind is generated in llvm and mlir (used in specification of
the parallel Operation in the OpenMP dialect). A function to return
the enum value from the string representation is also generated.
A new header file (DirectiveEmitter.h) containing definitions of
classes directive, clause, clauseval etc is created so that it can
be used in mlir as well.

Reviewers: clementval, jdoerfert, DavidTruby

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

3 years ago[X86][GlobalISel] Replace a misuse of SUBREG_TO_REG with INSERT_SUBREG.
Craig Topper [Wed, 12 Aug 2020 06:39:13 +0000 (23:39 -0700)]
[X86][GlobalISel] Replace a misuse of SUBREG_TO_REG with INSERT_SUBREG.

SUBREG_TO_REG is supposed to be used when we know the producing
instruction already zeroed the bits we're extending. But that's
not the case here. So INSERT_SUBREG with an IMPLICIT_DEF is the
correct thing to use.

3 years ago[MLIR][SPIRVToLLVM] Conversion for global and addressof
George Mitenkov [Wed, 12 Aug 2020 06:10:39 +0000 (09:10 +0300)]
[MLIR][SPIRVToLLVM] Conversion for global and addressof

Inital conversion of `spv._address_of` and `spv.globalVariable`.
In SPIR-V, the global returns a pointer, whereas in LLVM dialect
the global holds an actual value. This difference is handled by
`spv._address_of` and `llvm.mlir.addressof`ops that both return
a pointer. Moreover, only current invocation is in conversion's
scope.

Reviewed By: antiagainst, mravishankar

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

3 years ago[libc][obvious] Switch nearest integer function tests to the new matchers.
Siva Chandra [Wed, 12 Aug 2020 05:13:59 +0000 (22:13 -0700)]
[libc][obvious] Switch nearest integer function tests to the new matchers.

3 years ago[NFC] Factor out hasForceAttributes
Kyungwoo Lee [Wed, 12 Aug 2020 06:14:35 +0000 (02:14 -0400)]
[NFC] Factor out hasForceAttributes

This is a preparation for https://reviews.llvm.org/D85586.

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

3 years ago[Attributor][NFC] Reformat tests after D85099
Johannes Doerfert [Tue, 11 Aug 2020 01:31:30 +0000 (20:31 -0500)]
[Attributor][NFC] Reformat tests after D85099

Reviewed By: sstefan1

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

3 years ago[UpdateTestChecks] Match unnamed values like "@[0-9]+" and "![0-9]+"
Johannes Doerfert [Mon, 10 Aug 2020 18:59:07 +0000 (13:59 -0500)]
[UpdateTestChecks] Match unnamed values like "@[0-9]+" and "![0-9]+"

With this patch we will match most *uses* of "temporary" named things in
the IR via regular expressions, not their name at creation time. The new
"values" we match are:
  - "unnamed" globals: `@[0-9]+`
  - debug metadata: `!dbg ![0-9]+`
  - loop metadata: `!loop ![0-9]+`
  - tbaa metadata: `!tbaa ![0-9]+`
  - range metadata: `!range ![0-9]+`
  - generic metadata: `metadata ![0-9]+`
  - attributes groups: `#[0-9]`

We still don't match the declarations but that can be done later. This
patch can introduce churn when existing check lines contain the old
hardcoded versions of the above "values". We can add a flag to opt-out,
or opt-in, if necessary.

Reviewed By: arichardson, MaskRay

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

3 years ago[CMake] Simplify CMake handling for zlib
Petr Hosek [Thu, 30 Apr 2020 20:07:13 +0000 (13:07 -0700)]
[CMake] Simplify CMake handling for zlib

Rather than handling zlib handling manually, use find_package from CMake
to find zlib properly. Use this to normalize the LLVM_ENABLE_ZLIB,
HAVE_ZLIB, HAVE_ZLIB_H. Furthermore, require zlib if LLVM_ENABLE_ZLIB is
set to YES, which requires the distributor to explicitly select whether
zlib is enabled or not. This simplifies the CMake handling and usage in
the rest of the tooling.

This is a reland of abb0075 with all followup changes and fixes that
should address issues that were reported in PR44780.

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

3 years ago[NFC] Inline variable only used in debug builds
Jordan Rupprecht [Wed, 12 Aug 2020 02:38:01 +0000 (19:38 -0700)]
[NFC] Inline variable only used in debug builds

3 years ago[VectorCombine] add safety check for 0-width register
Sanjay Patel [Wed, 12 Aug 2020 00:27:50 +0000 (20:27 -0400)]
[VectorCombine] add safety check for 0-width register

Based on post-commit discussion in D81766, Hexagon sets this to "0".
I'll see if I can come up with a test, but making the obvious
code fix first to unblock that target.

3 years ago[WebAssembly][AsmParser] Name missing features in error message
Thomas Lively [Wed, 12 Aug 2020 00:26:14 +0000 (17:26 -0700)]
[WebAssembly][AsmParser] Name missing features in error message

Rather than just saying that some feature is missing, report the exact
features to make the error message more useful and actionable.

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

3 years ago[Diagnostics] Reworked -Wstring-concatenation
Dávid Bolvanský [Wed, 12 Aug 2020 00:17:04 +0000 (02:17 +0200)]
[Diagnostics] Reworked -Wstring-concatenation

3 years ago[flang] Fix interpretation of intrinsic names as arguments
Tim Keith [Tue, 11 Aug 2020 23:52:49 +0000 (16:52 -0700)]
[flang] Fix interpretation of intrinsic names as arguments

If an unrestricted specific intrinsic function name is first encountered
as an actual argument, it should be interpreted as an object entity,
not a procedure entity.

Fix some tests that depended on the previous interpretation by adding
explicit INTRINSIC statements.

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

3 years ago[libcxx/variant] Add a few benchmarks for `std::visit`.
Michael Park [Tue, 11 Aug 2020 22:48:02 +0000 (15:48 -0700)]
[libcxx/variant] Add a few benchmarks for `std::visit`.

This patch adds a few `std::visit` benchmarks as a starting point.

Reviewed By: ldionne, #libc

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

3 years agoRevert "[Instruction] Add updateLocationAfterHoist helper"
Vedant Kumar [Tue, 11 Aug 2020 21:53:42 +0000 (14:53 -0700)]
Revert "[Instruction] Add updateLocationAfterHoist helper"

This reverts commit 4a646ca9e2caf70d6312714770f516fb83b7e3cb.

This is causing some bots to fail with "!dbg attachment points at wrong
subprogram for function", like:

http://lab.llvm.org:8011/builders/sanitizer-windows/builds/67958/steps/stage%201%20check/logs/stdio

3 years ago[globalopt] Change so that emitting fragments doesn't use the type size of DIVariables
Amy Huang [Tue, 11 Aug 2020 21:50:56 +0000 (14:50 -0700)]
[globalopt] Change so that emitting fragments doesn't use the type size of DIVariables

When turning on -debug-info-kind=constructor we ran into a "fragment covers
entire variable" error during thinlto. The fragment is currently always
emitted if there is no type size, but sometimes the variable has a
forward declared struct type which doesn't have a size.

This changes the code to get the type size from the GlobalVariable instead.

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

3 years ago[Analyzer] Support note tags for smart ptr checker
Nithin Vadukkumchery Rajendrakumar [Tue, 11 Aug 2020 18:33:54 +0000 (20:33 +0200)]
[Analyzer] Support note tags for smart ptr checker

Summary:
Added support for note tags for null smart_ptr reporting

Reviewers: NoQ, Szelethus, vsavchenko, xazax.hun

Reviewed By: NoQ, vsavchenko, xazax.hun

Subscribers: martong, cfe-commits
Tags: #clang

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

3 years ago[Instcombine] Fix uses of undef (PR46940)
Kazu Hirata [Tue, 11 Aug 2020 21:13:26 +0000 (14:13 -0700)]
[Instcombine] Fix uses of undef (PR46940)

Without this patch, we attempt to distribute And over Xor even in
unsafe circumstances like so:

  undef & (true ^ true)  ==>  (undef & true) ^ (undef & true)

and evaluate it to undef instead of false.  Note that "true ^ true"
may show up implicitly with one true being part of a PHI node.

This patch fixes the problem by teaching SimplifyUsingDistributiveLaws
to not use undef as part of simplifications.

Reviewers: spatel, aqjune, nikic, lebedev.ri, fhahn, jdoerfert

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

3 years ago[drr] Add $_loc special directive for NativeCodeCall
Jacques Pienaar [Tue, 11 Aug 2020 21:06:16 +0000 (14:06 -0700)]
[drr] Add $_loc special directive for NativeCodeCall

Allows propagating the location to ops created via NativeCodeCall.

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

3 years ago[Instruction] Add updateLocationAfterHoist helper
Vedant Kumar [Mon, 10 Aug 2020 17:44:13 +0000 (10:44 -0700)]
[Instruction] Add updateLocationAfterHoist helper

Introduce a helper on Instruction which can be used to update the debug
location after hoisting.

Use this in GVN and LICM, where we were mistakenly introducing new line
0 locations after hoisting (the docs recommend dropping the location in
this case).

For more context, see the discussion in https://reviews.llvm.org/D60913.

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

3 years ago[LLDB] Improve PDB discovery
Adrian McCarthy [Wed, 29 Jul 2020 00:45:33 +0000 (17:45 -0700)]
[LLDB] Improve PDB discovery

When loading a PE/COFF target, the associated PDB file often wasn't
found.  The executable module contains a path for the associated PDB
file, but people often debug from a different directory than the one
their build system uses.  (This is especially common in post-mortem
and cross platform debugging.)

Suppose the COFF executable being debugged is `~/proj/foo.exe`, but
it was built elsewhere and refers to `D:\remote\build\env\foobar.pdb`,
LLDB wouldn't find it.

With this change, if no file exists at the PDB path, LLDB will look
in the executable directory for a PDB file that matches the name of
the one it expected (e.g., `~/proj/foobar.pdb`).  If found, the PDB
is subject to the same matching criteria (GUIDs and age) as would
have been used had it been in the original location.

This same-directory-as-the-binary rule is commonly used by debuggers
on Windows.

Differential Review: https://reviews.llvm.org/D84815

3 years ago[libc][obvious] Remove a commented out block.
Siva Chandra [Tue, 11 Aug 2020 20:27:24 +0000 (13:27 -0700)]
[libc][obvious] Remove a commented out block.

3 years ago[AARCH64] [MC] add memtag as an alias of mte architecture extension
Jian Cai [Tue, 11 Aug 2020 19:19:32 +0000 (12:19 -0700)]
[AARCH64] [MC] add memtag as an alias of mte architecture extension

Add memtag as an alis of met architectture extesion to be consistent
with GNU as.

LINK:https://sourceware.org/bugzilla/show_bug.cgi?id=26339

Reviewed By: nickdesaulniers, MaskRay

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

3 years ago[libFuzzer] Fix minimizing timeouts
Ilya Leoshkevich [Tue, 11 Aug 2020 20:16:08 +0000 (22:16 +0200)]
[libFuzzer] Fix minimizing timeouts

When one tries to minimize timeouts using -minimize_crash=1,
minimization immediately fails. The following sequence of events is
responsible for this:

[parent] SIGALRM occurs
[parent] read() returns -EINTR (or -ERESTARTSYS according to strace)
[parent] fgets() returns NULL
[parent] ExecuteCommand() closes child's stdout and returns
[child ] SIGALRM occurs
[child ] AlarmCallback() attempts to write "ALARM: ..." to stdout
[child ] Dies with SIGPIPE without calling DumpCurrentUnit()
[parent] Does not see -exact_artifact_path and exits

When minimizing, the timer in parent is not necessary, so fix by not
setting it in this case.

Reviewed By: morehouse

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

3 years ago[InstSimplify] Respect CanUseUndef in more places
Nikita Popov [Tue, 11 Aug 2020 19:50:14 +0000 (21:50 +0200)]
[InstSimplify] Respect CanUseUndef in more places

Similar to what we do in IIQ, add an isUndefValue() helper that
checks for undef values while respective CanUseUndef. This makes
it much easier to search for places that don't respect the flag
yet.

3 years ago[lldb] Fix the last remaining tests not inheriting TCC permissions
Jonas Devlieghere [Tue, 11 Aug 2020 19:47:54 +0000 (12:47 -0700)]
[lldb] Fix the last remaining tests not inheriting TCC permissions

After this patch all test should have the inferior inheriting the TCC
permissions from its parent.

3 years ago[NFC][InstCombine] Add tests for PHI merging/aggregate reconstruction (PR47060)
Roman Lebedev [Tue, 11 Aug 2020 19:40:08 +0000 (22:40 +0300)]
[NFC][InstCombine] Add tests for PHI merging/aggregate reconstruction (PR47060)

We should be able to see that the new aggregate we have produced
is identical to the source aggregate from which we've extracted
the elements that we used to form a new aggregate.

This happens (a lot) in clang C++ exception code on unwind branch.

3 years ago[libunwind] Fix incorrect check for out-of-boundedness
Louis Dionne [Tue, 11 Aug 2020 19:29:00 +0000 (15:29 -0400)]
[libunwind] Fix incorrect check for out-of-boundedness

If the personalityIndex (which is 0-based) is equal to the length of
the personality array, we should error out.

rdar://18013273

3 years ago[gn build] Fix CodeGenTests
Arthur Eubanks [Mon, 10 Aug 2020 19:55:46 +0000 (12:55 -0700)]
[gn build] Fix CodeGenTests

Missing dependency required by https://reviews.llvm.org/D67687.

Fixes
lld-link: error: undefined symbol: public: __cdecl llvm::PipelineTuningOptions::PipelineTuningOptions(void)
>>> referenced by C:\src\llvm-project\llvm\unittests\CodeGen\PassManagerTest.cpp:215
>>>               obj/llvm/unittests/CodeGen/CodeGenTests.PassManagerTest.obj:(private: virtual void __cdecl `anonymous namespace'::PassManagerTest_Basic_Test::TestBody(void))

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

3 years ago[WebAssembly][NFC] Replace WASM with standard Wasm
Thomas Lively [Tue, 11 Aug 2020 19:27:59 +0000 (12:27 -0700)]
[WebAssembly][NFC] Replace WASM with standard Wasm

The officially specified abbreviation for WebAssembly is Wasm and the
spec explicitly calls out WASM as being an incorrect spelling. This
patch fixes a few comments and error messages to use the
spec-compliant abbreviation.

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

3 years ago[AIX][XCOFF] change the operand of branch instruction from symbol name to qualified...
diggerlin [Tue, 11 Aug 2020 19:26:19 +0000 (15:26 -0400)]
[AIX][XCOFF] change the operand of branch instruction from symbol name to qualified symbol name for function declarations

SUMMARY:

1. in the patch  , remove setting storageclass in function .getXCOFFSection and construct function of class MCSectionXCOFF
there are

XCOFF::StorageMappingClass MappingClass;
XCOFF::SymbolType Type;
XCOFF::StorageClass StorageClass;
in the MCSectionXCOFF class,
these attribute only used in the XCOFFObjectWriter, (asm path do not need the StorageClass)

we need get the value of StorageClass, Type,MappingClass before we invoke the getXCOFFSection every time.

actually , we can get the StorageClass of the MCSectionXCOFF  from it's delegated symbol.

2. we also change the oprand of branch instruction from symbol name to qualify symbol name.
for example change
bl .foo
extern .foo
to
bl .foo[PR]
extern .foo[PR]

3. and if there is reference indirect call a function bar.
we also add
  extern .bar[PR]

Reviewers:  Jason liu, Xiangling Liao

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

3 years ago[libunwind][NFC] Fix typo in comment
Louis Dionne [Tue, 11 Aug 2020 19:24:21 +0000 (15:24 -0400)]
[libunwind][NFC] Fix typo in comment

3 years agoReland "[SLPVectorizer] Pre-commit a test for D85759"
Thomas Lively [Tue, 11 Aug 2020 19:18:33 +0000 (12:18 -0700)]
Reland "[SLPVectorizer] Pre-commit a test for D85759"

This reverts commit 52b71aa8b1a019403b0ecc184744b2f8ca2f7cba.

The problem was a missing lit.local.cfg file, which was causing the
test to be incorrectly run on bots that had not built the WebAssembly
target.

3 years agoRevert "[SLPVectorizer] Pre-commit a test for D85759"
Thomas Lively [Tue, 11 Aug 2020 19:11:24 +0000 (12:11 -0700)]
Revert "[SLPVectorizer] Pre-commit a test for D85759"

This reverts commit 94791970de109eb9a6b296825ddb0fc2a196b366.

The test is failing on multiple bots, event though it passes for me
locally. Reverting while I investigate further.

3 years agoNFC. Constify MachineVerifier::verify parameter
Yuanfang Chen [Tue, 11 Aug 2020 18:59:13 +0000 (11:59 -0700)]
NFC. Constify MachineVerifier::verify parameter

3 years ago[compiler-rt] XFAIL test on iOS
Julian Lettner [Mon, 10 Aug 2020 18:45:51 +0000 (11:45 -0700)]
[compiler-rt] XFAIL test on iOS

On iOS, when we `longjmp()` out of the signal handler, a subsequent call
to `sigaltstack()` still reports that we are executing on the signal
handler stack.
Tracking rdar://66789814

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

3 years ago[OpenMP] split execution of a long test into smaller parts.
Artem Belevich [Mon, 10 Aug 2020 22:36:09 +0000 (15:36 -0700)]
[OpenMP] split execution of a long test into smaller parts.

This test is bottlenecked by heavy regex use (~0.6s per FileCHeck run) with the
content that can't be further fragmented. Instead, the test body is moved into a
common .inc file and test execution has been split into four roughly equal
parts. This reduces wall time for the test from 14s to ~3.5s.

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

3 years ago[BPI] Teach BPI about bcmp function
Dávid Bolvanský [Tue, 11 Aug 2020 18:42:58 +0000 (20:42 +0200)]
[BPI] Teach BPI about bcmp function
bcmp is similar to memcmp

3 years ago[lldb] Enable inheriting TCC permissions in lldb-test
Jonas Devlieghere [Tue, 11 Aug 2020 18:36:35 +0000 (11:36 -0700)]
[lldb] Enable inheriting TCC permissions in lldb-test

Like the rest of the test suite, also set the target.inherit-tcc option
to true in lldb-test.

3 years agoUpdate AMDGPU testcases after bebe6a6449811e877f7eba3f1798ddd1fa83e440
Jessica Paquette [Tue, 11 Aug 2020 17:56:58 +0000 (10:56 -0700)]
Update AMDGPU testcases after bebe6a6449811e877f7eba3f1798ddd1fa83e440

I didn't build AMDGPU locally so I didn't see this.

```
(logic_op (op x...), (op y...)) -> (op (logic_op x, y))
```

kicks in here.

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

3 years ago[SLPVectorizer] Pre-commit a test for D85759
Thomas Lively [Tue, 11 Aug 2020 18:30:09 +0000 (11:30 -0700)]
[SLPVectorizer] Pre-commit a test for D85759

8cc911fa5b06 refactored the `getIntrinsicInstrCost` function and was
meant to be a nonfunctional change, but it accidentally changed how
costs were calculated in the SLP vectorizer, which regressed
WebAssembly codegen and resulted in a downstream bug report at
https://github.com/emscripten-core/emscripten/issues/11449.

The fix for this regression is in D85759, and this patch just
pre-commits the test from that patch to demonstrate the regressed
behavior first.

3 years ago[lldb] Look beyond the first line to find the PID in TestAppleSimulatorOSType
Jonas Devlieghere [Tue, 11 Aug 2020 18:04:53 +0000 (11:04 -0700)]
[lldb] Look beyond the first line to find the PID in TestAppleSimulatorOSType

The current code fails when the first stderr line doesn't match the
given regex to parse the PID. This patch changes the code to read the
first 10 lines before giving up. It also adds tracing for the simctl
commands.

3 years ago[Flang] Fix release blocker issue #46931 related to documentation.
sameeran joshi [Thu, 6 Aug 2020 19:33:54 +0000 (01:03 +0530)]
[Flang] Fix release blocker issue #46931 related to documentation.

Summary:
Fixes bug : https://bugs.llvm.org/show_bug.cgi?id=46931
This commit add a new flag -DLLVM_ENABLE_SPHINX=ON to cmake command to generate sphinx documentation,
along with new cmake targets `docs-flang-html`.
`ninja docs-flang-html` - generates sphinx documentation.
Generated release notes are present in <builddir>/tools/flang/docs/html/ folder.

Reviewers: richard.barton.arm, DavidTruby

Tags: #flang

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

3 years ago[libc] Add strtok implementation.
cgyurgyik [Tue, 11 Aug 2020 17:38:16 +0000 (13:38 -0400)]
[libc] Add strtok implementation.

Reviewed By: sivachandra

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

3 years ago[GlobalISel] Combine (logic_op (op x...), (op y...)) -> (op (logic_op x, y))
Jessica Paquette [Mon, 10 Aug 2020 20:31:41 +0000 (13:31 -0700)]
[GlobalISel] Combine (logic_op (op x...), (op y...)) -> (op (logic_op x, y))

This implements

```
(logic_op (op x...), (op y...)) -> (op (logic_op x, y))
```

when `op` is an extend, a shift, or an and.

This is similar to `DAGCombiner::hoistLogicOpWithSameOpcodeHands`
(with a bunch of missing cases, e.g. G_TRUNC, G_BITCAST, etc.)

This is implemented so it works both pre and post-legalization.

This also adds a general way to add a series of instructions in a combine.
(`applyBuildInstructionSteps`).

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

3 years ago[NFC][llvm-objcopy] Fix redundant config checks.
Jordan Rupprecht [Tue, 11 Aug 2020 17:37:19 +0000 (10:37 -0700)]
[NFC][llvm-objcopy] Fix redundant config checks.

The check for unsupported options checks some configs twice in a || expression. Fixes PR47107.

3 years ago[XCOFF][llvm-readobj] Move XCOFF test to XCOFF directory
jasonliu [Mon, 10 Aug 2020 18:22:30 +0000 (18:22 +0000)]
[XCOFF][llvm-readobj] Move XCOFF test to XCOFF directory

Summary:
COFF and XCOFF in llvm are very different and serves different platform.
Since we have different Dumper.cpp file in llvm-readobj's
implementation, we should have separate testing directory for them too.

Reviewed By: jhenderson, DiggerLin

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

3 years agoFix MSVC "not all control paths return a value" warning. NFC.
Simon Pilgrim [Tue, 11 Aug 2020 17:12:29 +0000 (18:12 +0100)]
Fix MSVC "not all control paths return a value" warning. NFC.

3 years ago[X86][SSE] combineShuffleWithHorizOp - canonicalize SHUFFLE(HOP(X,Y),HOP(Y,X)) -...
Simon Pilgrim [Tue, 11 Aug 2020 17:06:00 +0000 (18:06 +0100)]
[X86][SSE] combineShuffleWithHorizOp - canonicalize SHUFFLE(HOP(X,Y),HOP(Y,X)) -> SHUFFLE(HOP(X,Y))

Attempt to canonicalize binary shuffles of HOPs with commuted operands to an unary shuffle.

3 years agoGlobalISel: Fix typo
Matt Arsenault [Sat, 8 Aug 2020 13:20:19 +0000 (09:20 -0400)]
GlobalISel: Fix typo

3 years ago[ORC] Move file-descriptor based raw byte channel into a public header.
Lang Hames [Tue, 11 Aug 2020 04:41:01 +0000 (21:41 -0700)]
[ORC] Move file-descriptor based raw byte channel into a public header.

This will enable re-use in other llvm tools.

3 years ago[llvm-jitlink] Fix a file comment.
Lang Hames [Tue, 11 Aug 2020 01:48:30 +0000 (18:48 -0700)]
[llvm-jitlink] Fix a file comment.

3 years ago[libTooling] Move RewriteRule include edits to ASTEdit granularity.
Yitzhak Mandelbaum [Tue, 11 Aug 2020 13:45:08 +0000 (13:45 +0000)]
[libTooling] Move RewriteRule include edits to ASTEdit granularity.

Currently, changes to includes are applied to an entire rule. However,
include changes may be specific to particular edits within a rule (for example,
they may apply to one file but not another). Also, include changes may need to
carry metadata, just like other changes. So, we make include changes first-class
edits.

Reviewed By: tdl-g

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

3 years ago[InstSimplify] Forbid undef folds in expandBinOp
Nikita Popov [Mon, 10 Aug 2020 20:06:48 +0000 (22:06 +0200)]
[InstSimplify] Forbid undef folds in expandBinOp

This is the replacement for D84250 based on D84792. As we recursively
fold with the same value twice, we need to disable undef folds,
to prevent an undef from being folded to two different values.

Reverting rG00f3579aea6e3d4a4b7464c3db47294f71cef9e4 and using the
test case from https://reviews.llvm.org/D83360#2145793, it no longer
performs the incorrect fold.

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

3 years ago[clangd][ObjC] Improve xrefs for protocols and classes
David Goldman [Thu, 9 Jul 2020 18:29:15 +0000 (14:29 -0400)]
[clangd][ObjC] Improve xrefs for protocols and classes

Summary:
Previously clangd would jump to forward declarations for protocols
and classes instead of their definition/implementation.

Reviewers: sammccall

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

Tags: #clang

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

3 years ago[libTooling] Cleanup and reorder `RewriteRule.h`.
Yitzhak Mandelbaum [Tue, 11 Aug 2020 16:35:36 +0000 (16:35 +0000)]
[libTooling] Cleanup and reorder `RewriteRule.h`.

This patch lifts `RootID` out of the `RewriteRule` class so that constructs
(e.g. inline functions) can that refer to the root id don't need to depend on
the `RewriteRule` class.

With this dependency, the patch is able to collect all `ASTEdit` helper function
declarations together with the class declaration, before the introduction of the
`RewriteRule` class. In the process, we also adjust some of the comments.

This patch is essentially a NFC.

Reviewed By: gribozavr2

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

3 years agoFold Opcode into assert uses to fix an unused variable warning without asserts.
Eric Christopher [Tue, 11 Aug 2020 16:30:51 +0000 (09:30 -0700)]
Fold Opcode into assert uses to fix an unused variable warning without asserts.

3 years ago[DWARFYAML] Teach yaml2obj emit the correct line table program.
Xing GUO [Tue, 11 Aug 2020 14:46:46 +0000 (22:46 +0800)]
[DWARFYAML] Teach yaml2obj emit the correct line table program.

The following issues are addressed in this patch.

1. The operands of DW_LNE_set_discriminator should be an ULEB128 number
   rather than an address.
2. Test the emitted opcodes.

Reviewed By: jhenderson

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

3 years ago[X86][SSE] combineShuffleWithHorizOp - avoid unnecessary subtraction. NFCI.
Simon Pilgrim [Tue, 11 Aug 2020 15:42:37 +0000 (16:42 +0100)]
[X86][SSE] combineShuffleWithHorizOp - avoid unnecessary subtraction. NFCI.

We can safely replace ((M - NumElts) % NumEltsPerLane) with (M % NumEltsPerLane) as the modulo result will be the same.

3 years ago[lldb/CMake] Separate CMake code for Lua and Python (NFC)
Jonas Devlieghere [Tue, 11 Aug 2020 15:43:44 +0000 (08:43 -0700)]
[lldb/CMake] Separate CMake code for Lua and Python (NFC)

Separate the CMake logic for Lua and Python to clearly distinguish
between code specific to either scripting language and the code shared
by both.

What this patch does is:

 - Move Python specific code into the bindings/python subdirectory.
 - Move the Lua specific code into the bindings/lua subdirectory.
 - Add the _python suffix to Python specific functions/targets.
 - Fix a dependency issue that would check the binding instead of
   whether the scripting language is enabled.

Note that this patch also changes where the bindings are generated,
which might affect downstream projects that check them in.

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