platform/upstream/llvm.git
2 years ago[InstCombine] Precommit new and-xor-or.ll tests. NFC.
Stanislav Mekhanoshin [Thu, 21 Oct 2021 22:15:54 +0000 (15:15 -0700)]
[InstCombine] Precommit new and-xor-or.ll tests. NFC.

2 years ago[modules] Update visibility for merged ObjCInterfaceDecl definitions.
Volodymyr Sapsai [Fri, 24 Sep 2021 21:51:21 +0000 (14:51 -0700)]
[modules] Update visibility for merged ObjCInterfaceDecl definitions.

We keep using the first encountered definition and need to take into
account visibility from subsequent definitions. For example, if the
first definition is hidden and the second is visible, we need to make
the first one visible too.

rdar://82263843

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

2 years ago[libcxx] [test] Convert an XFAIL: LIBCXX-WINDOWS-FIXME into XFAIL: msvc with explanation
Martin Storsjö [Mon, 31 May 2021 09:32:21 +0000 (09:32 +0000)]
[libcxx] [test] Convert an XFAIL: LIBCXX-WINDOWS-FIXME into XFAIL: msvc with explanation

This test doesn't fail in mingw mode (which uses the same Itanium
name mangling and ABI as other platforms).

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

2 years agoPR18733: Remove -Wweak-template-vtables
David Blaikie [Sun, 25 Jul 2021 18:47:01 +0000 (11:47 -0700)]
PR18733: Remove -Wweak-template-vtables

It isn't really pulling its weight and I think splitting it out from
-Wweak-vtables was the wrong call: I think it was just a bug in the
original warning, which was trying to not diagnose template
instantiations, implicit or explicit.

2 years ago[MLIR] Fix FloorDivSIOpConverter that was failing for index type after the arithmetic...
Mogball [Thu, 21 Oct 2021 21:42:10 +0000 (21:42 +0000)]
[MLIR] Fix FloorDivSIOpConverter that was failing for index type after the arithmetic op refactor

ConstantOp should be used instead of ConstantIntOp to be able to support index type.

Reviewed By: Mogball

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

2 years agoMake genAttributeVerifier escape the summary.
Matthias Kramm [Thu, 21 Oct 2021 21:41:15 +0000 (21:41 +0000)]
Make genAttributeVerifier escape the summary.

The summary can contain references to e.g. attribute defaults, which
can contain special characters. So these strings need to be C++
escaped.

Reviewed By: Mogball

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

2 years agoRemove unused parallel-libs project
David Blaikie [Thu, 21 Oct 2021 20:40:29 +0000 (13:40 -0700)]
Remove unused parallel-libs project

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

2 years ago[TargetLowering][RISCV] Prevent scalarization of fixed vector bswap.
Craig Topper [Thu, 21 Oct 2021 21:31:43 +0000 (14:31 -0700)]
[TargetLowering][RISCV] Prevent scalarization of fixed vector bswap.

It's better to do the ands, shifts, ors in the vector domain than
to scalarize it and do those operations on each element.

Reviewed By: RKSimon

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

2 years agoFix escaping in RewriterGen.cpp.
Matthias Kramm [Thu, 21 Oct 2021 21:30:31 +0000 (21:30 +0000)]
Fix escaping in RewriterGen.cpp.

When we escape strings for C++, make sure we use C++ escape
sequences. (In particular, \x22 instead of \22)

Reviewed By: Mogball

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

2 years agoFix buildbots after https://reviews.llvm.org/D111686
Greg Clayton [Thu, 21 Oct 2021 21:21:36 +0000 (14:21 -0700)]
Fix buildbots after https://reviews.llvm.org/D111686

2 years ago[mlir][linalg] Remove special case for contraction vectorization
thomasraoux [Thu, 21 Oct 2021 21:05:27 +0000 (14:05 -0700)]
[mlir][linalg] Remove special case for contraction vectorization

Handle contraction op like all the other generic op reductions. This
simpifies the code. We now rely on contractionOp canonicalization to
keep the same code quality.

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

2 years ago[mlir][vector] Add patterns to convert multidimreduce to vector.contract
thomasraoux [Thu, 21 Oct 2021 20:20:52 +0000 (13:20 -0700)]
[mlir][vector] Add patterns to convert multidimreduce to vector.contract

add several patterns that will simplify contraction vectorization in the
future. With those canonicalizationns we will be able to remove the special
case for contration during vectorization and rely on those transformations to
avoid materizalizing broadcast ops.

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

2 years ago[AArch64][GlobalISel] Fold 64-bit cmps with 64-bit adds
Jessica Paquette [Mon, 4 Oct 2021 18:53:37 +0000 (11:53 -0700)]
[AArch64][GlobalISel] Fold 64-bit cmps with 64-bit adds

G_ICMP is selected to an arithmetic overflow op (ADDS/SUBS/etc) with a dead
destination + a CSINC instruction.

We have a fold which allows us to combine 32-bit adds with G_ICMP.

The problem with G_ICMP is that we model it as always having a 32-bit
destination even though it can be a 64-bit operation. So, we were missing some
opportunities for 64-bit folds.

This patch teaches the fold to recognize 64-bit G_ICMPs + refactors some of
the code surrounding CSINC accordingly.

(Later down the line, I think we should probably change the way we handle G_ICMP
in general.)

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

2 years ago[fir] Remove createConcatenate test temporarily
Valentin Clement [Thu, 21 Oct 2021 20:40:09 +0000 (22:40 +0200)]
[fir] Remove createConcatenate test temporarily

This test is makeing one buildbot fail for unknown reason. Remove
it until we can investifate further.

2 years ago[libcxx] [test] Add a specific XFAIL for a MinGW env failure that is fixed in Clang 14
Martin Storsjö [Fri, 1 Oct 2021 21:29:46 +0000 (00:29 +0300)]
[libcxx] [test] Add a specific XFAIL for a MinGW env failure that is fixed in Clang 14

This issue only occurs when linked statically in MinGW configurations,
and has been fixed for Clang 14 by https://reviews.llvm.org/D109651.

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

2 years ago[libcxx] [test] Add an XFAIL for the timespec test for MinGW targets
Martin Storsjö [Fri, 27 Aug 2021 10:12:53 +0000 (10:12 +0000)]
[libcxx] [test] Add an XFAIL for the timespec test for MinGW targets

MinGW headers/libs lack timespec_get.

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

2 years agoFollow-up fixes for aee49255074fd4ef38d97e6e70cbfbf2f9fd0fa7
David Blaikie [Thu, 21 Oct 2021 20:00:35 +0000 (13:00 -0700)]
Follow-up fixes for aee49255074fd4ef38d97e6e70cbfbf2f9fd0fa7

2 years agoAdd test to check we can instcombine after reassociate. NFC.
Stanislav Mekhanoshin [Thu, 21 Oct 2021 18:45:42 +0000 (11:45 -0700)]
Add test to check we can instcombine after reassociate. NFC.

The pattern became optimized after b92412fb286b.

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

2 years ago[gn build] Port d7b338537cf3
LLVM GN Syncbot [Thu, 21 Oct 2021 19:18:49 +0000 (19:18 +0000)]
[gn build] Port d7b338537cf3

2 years agoModify "statistics dump" to dump JSON.
Greg Clayton [Wed, 20 Oct 2021 21:49:09 +0000 (14:49 -0700)]
Modify "statistics dump" to dump JSON.

This patch is a smaller version of a previous patch https://reviews.llvm.org/D110804.

This patch modifies the output of "statistics dump" to be able to get stats from the current target. It adds 3 new stats as well. The output of "statistics dump" is now emitted as JSON so that it can be used to track performance and statistics and the output could be used to populate a database that tracks performance. Sample output looks like:

(lldb) statistics dump
{
  "expressionEvaluation": {
    "failures": 0,
    "successes": 0
  },
  "firstStopTime": 0.34164492800000001,
  "frameVariable": {
    "failures": 0,
    "successes": 0
  },
  "launchOrAttachTime": 0.31969605400000001,
  "targetCreateTime": 0.0040863039999999998
}

The top level keys are:

"expressionEvaluation" which replaces the previous stats that were emitted as plain text. This dictionary contains the success and fail counts.
"frameVariable" which replaces the previous stats for "frame variable" that were emitted as plain text. This dictionary contains the success and fail counts.
"targetCreateTime" contains the number of seconds it took to create the target and load dependent libraries (if they were enabled) and also will contain symbol preloading times if that setting is enabled.
"launchOrAttachTime" is the time it takes from when the launch/attach is initiated to when the first private stop occurs.
"firstStopTime" is the time in seconds that it takes to stop at the first stop that is presented to the user via the LLDB interface. This value will only have meaning if you set a known breakpoint or stop location in your code that you want to measure as a performance test.

This diff is also meant as a place to discuess what we want out of the "statistics dump" command before adding more funcionality. It is also meant to clean up the previous code that was storting statistics in a vector of numbers within the lldb_private::Target class.

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

2 years agoBPF: emit BTF_KIND_DECL_TAG for typedef types
Yonghong Song [Tue, 21 Sep 2021 06:35:58 +0000 (23:35 -0700)]
BPF: emit BTF_KIND_DECL_TAG for typedef types

If a typedef type has __attribute__((btf_decl_tag("str"))) with
bpf target, emit BTF_KIND_DECL_TAG for that type in the BTF.

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

2 years ago[modules] Fix tracking ObjCInterfaceType decl when there are multiple definitions.
Volodymyr Sapsai [Fri, 24 Sep 2021 20:57:23 +0000 (13:57 -0700)]
[modules] Fix tracking ObjCInterfaceType decl when there are multiple definitions.

With the old approach we were updating `ObjCInterfaceType.Decl` to the
last encountered definition. But during loading modules
`ASTDeclReader::VisitObjCInterfaceDecl` keeps the *first* encountered
definition. So with multiple definitions imported there would be a
disagreement between expected definition in `ObjCInterfaceType.Decl` and
actual definition `ObjCInterfaceDecl::getDefinition` which can lead to
incorrect diagnostic.

Fix by not tracking definition in `ObjCInterfaceType` explicitly but by
getting it from redeclaration chain.

Partially reverted 919fc50034b44c48aae8b80283f253ec2ee17f45 keeping the
modified test case as the correct behavior is achieved in a different
way.

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

2 years ago[OpenMP][NFC] skip atomic tests for non-x86 arch
AndreyChurbanov [Thu, 21 Oct 2021 18:51:33 +0000 (21:51 +0300)]
[OpenMP][NFC] skip atomic tests for non-x86 arch

2 years ago[InstCombine] Add additional store forwarding test (NFC)
Nikita Popov [Thu, 21 Oct 2021 18:47:13 +0000 (20:47 +0200)]
[InstCombine] Add additional store forwarding test (NFC)

Variant where the load is larger than the store. Make sure we
don't forward this.

2 years ago[test] Make sure plugin actually runs in clear-ast-before-backend-plugins.c
Arthur Eubanks [Thu, 21 Oct 2021 18:14:29 +0000 (11:14 -0700)]
[test] Make sure plugin actually runs in clear-ast-before-backend-plugins.c

Reviewed By: dblaikie

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

2 years agoEnable libc++ in the build for libcxx initializerlist pretty printers
David Blaikie [Wed, 20 Oct 2021 18:05:40 +0000 (11:05 -0700)]
Enable libc++ in the build for libcxx initializerlist pretty printers

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

2 years agoRecommit: Compress formatting of array type names (int [4] -> int[4])
David Blaikie [Thu, 14 Oct 2021 21:52:47 +0000 (14:52 -0700)]
Recommit: Compress formatting of array type names (int [4] -> int[4])

Based on post-commit review discussion on
2bd84938470bf2e337801faafb8a67710f46429d with Richard Smith.

Other uses of forcing HasEmptyPlaceHolder to false seem OK to me -
they're all around pointer/reference types where the pointer/reference
token will appear at the rightmost side of the left side of the type
name, so they make nested types (eg: the "int" in "int *") behave as
though there is a non-empty placeholder (because the "*" is essentially
the placeholder as far as the "int" is concerned).

This was originally committed in 277623f4d5a672d707390e2c3eaf30a9eb4b075c

Reverted in f9ad1d1c775a8e264bebc15d75e0c6e5c20eefc7 due to breakages
outside of clang - lldb seems to have some strange/strong dependence on
"char [N]" versus "char[N]" when printing strings (not due to that name
appearing in DWARF, but probably due to using clang to stringify type
names) that'll need to be addressed, plus a few other odds and ends in
other subprojects (clang-tools-extra, compiler-rt, etc).

2 years ago[Triple] Don't repeat the function name in comments. NFC
Fangrui Song [Thu, 21 Oct 2021 18:32:29 +0000 (11:32 -0700)]
[Triple] Don't repeat the function name in comments. NFC

2 years ago[CodeMetrics] Don't require speculatability for ephemeral values
Nikita Popov [Tue, 19 Oct 2021 19:05:09 +0000 (21:05 +0200)]
[CodeMetrics] Don't require speculatability for ephemeral values

As discussed in D112016, our current requirement of speculatability
for ephemeral is overly strict: What we really care about is that
the instruction will be DCEd once the assume is dropped. For that
it is sufficient that the instruction is side-effect free and not
a terminator.

In particular, this allows non-dereferenceable loads to be ephemeral
values.

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

2 years agoFollow-up on https://github.com/llvm/llvm-project/commit/88303693ce97cf842f0714068c2c...
Kirill Bobyrev [Thu, 21 Oct 2021 18:13:37 +0000 (20:13 +0200)]
Follow-up on https://github.com/llvm/llvm-project/commit/88303693ce97cf842f0714068c2cae44cd6515e1

Use hash code instead of unsigned for the hash return value.

2 years agoRevert "[compiler-rt/profile] Hide __llvm_profile_raw_version"
Pirama Arumuga Nainar [Thu, 21 Oct 2021 17:56:43 +0000 (10:56 -0700)]
Revert "[compiler-rt/profile] Hide __llvm_profile_raw_version"

This reverts commit 69708477be258dbea2711f6a35c02685659b49d3 to unblock
instrprof-darwin-exports.c failure on MacOS bots.

2 years ago[RISCV] Expand scalable vector CTTZ/CTLZ/CTPOP.
Craig Topper [Thu, 21 Oct 2021 16:44:59 +0000 (09:44 -0700)]
[RISCV] Expand scalable vector CTTZ/CTLZ/CTPOP.

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

2 years agoRevert "[IPT] Restructure cache to allow lazy update following invalidation [NFC]"
Arthur Eubanks [Thu, 21 Oct 2021 17:48:41 +0000 (10:48 -0700)]
Revert "[IPT] Restructure cache to allow lazy update following invalidation [NFC]"

This reverts commit baea663a6e9bc52f80995d02bb8149934c825612.

Causes crashes, e.g. https://lab.llvm.org/buildbot/#/builders/77/builds/10715.

2 years agoAdd the papers that were applied to the latest C2x working draft
Aaron Ballman [Thu, 21 Oct 2021 17:38:02 +0000 (13:38 -0400)]
Add the papers that were applied to the latest C2x working draft

2 years agoRevert "[CMake] Cache the compiler-rt library search results"
Petr Hosek [Thu, 21 Oct 2021 17:32:01 +0000 (10:32 -0700)]
Revert "[CMake] Cache the compiler-rt library search results"

This reverts commit 0eed292fbae22a8856682b07e1cb968424b49941, there
are compiler-rt build failures that appear to have been introduced
by this change.

2 years ago[SLP] Add additional tests which caused crashes with versioning.
Florian Hahn [Thu, 16 Sep 2021 15:49:52 +0000 (16:49 +0100)]
[SLP] Add additional tests which caused crashes with versioning.

2 years ago[mlir:GreedyPatternRewriter] Add debug logging for pattern rewriter actions
River Riddle [Thu, 21 Oct 2021 17:07:18 +0000 (17:07 +0000)]
[mlir:GreedyPatternRewriter] Add debug logging for pattern rewriter actions

This effectively mirrors the logging in dialect conversion, which has proven
very useful for understanding the pattern application process.

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

2 years ago[NFC] Clean up a few methods within GreedyPatternRewriter
River Riddle [Thu, 21 Oct 2021 17:07:07 +0000 (17:07 +0000)]
[NFC] Clean up a few methods within GreedyPatternRewriter

Move a few methods out of line and clean up comments.

2 years agoAvoid infinity arithmetics when computing exp approximations
Ahmed Taei [Wed, 20 Oct 2021 00:56:55 +0000 (17:56 -0700)]
Avoid infinity arithmetics when computing exp approximations

Otherwise this can result a poison value on some platforms see https://bugs.llvm.org/show_bug.cgi?id=51204

Reviewed By: ezhulenev

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

2 years ago[test][ORC-RT] Disable x86_64 tests when target arch does not match
Ben Langmuir [Thu, 21 Oct 2021 17:01:23 +0000 (10:01 -0700)]
[test][ORC-RT] Disable x86_64 tests when target arch does not match

When cross-compiling, these tests will fail. For now leave the host arch
check that was already there since I don't know why it was added.

2 years ago[fir] Add Character helper
Valentin Clement [Thu, 21 Oct 2021 16:44:47 +0000 (18:44 +0200)]
[fir] Add Character helper

This patch is extracted from D111337. It introduce the
CharacterExprHelper that helps dealing with character in FIR.

Reviewed By: schweitz, awarzynski

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2 years ago[VectorCombine] fold shuffle-of-binops with common operand
Sanjay Patel [Thu, 21 Oct 2021 16:21:37 +0000 (12:21 -0400)]
[VectorCombine] fold shuffle-of-binops with common operand

shuf (bo X, Y), (bo X, W) --> bo (shuf X), (shuf Y, W)

This is motivated by an example in D111800
(although that patch avoids the problem for that particular example).

The pattern is shown in reduced form with:
https://llvm.org/PR52178
https://alive2.llvm.org/ce/z/d8zB4D

There is no difference on the PhaseOrdering test from D111800
because the aarch64 cost model says that the shuffle cost is 3 while
the fadd cost is 2.

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

2 years agoReland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()
Arthur Eubanks [Wed, 6 Oct 2021 20:57:29 +0000 (13:57 -0700)]
Reland [clang] Pass -clear-ast-before-backend in Clang::ConstructJob()

This clears the memory used for the Clang AST before we run LLVM passes.

https://llvm-compile-time-tracker.com/compare.php?from=d0a5f61c4f6fccec87fd5207e3fcd9502dd59854&to=b7437fee79e04464dd968e1a29185495f3590481&stat=max-rss
shows significant memory savings with no slowdown (in fact -O0 slightly speeds up).

For more background, see
https://lists.llvm.org/pipermail/cfe-dev/2021-September/068930.html.

Turn this off for the interpreter since it does codegen multiple times.

Relanding with fix for -print-stats: D111973

Relanding with fix for plugins: D112190

If you'd like to use this even with plugins, consider using the features
introduced in D112096.

This can be turned off with -Xclang -no-clear-ast-before-backend.

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

2 years ago[RISCV] Add a test showing incorrect VSETVLI insertion
Fraser Cormack [Thu, 21 Oct 2021 14:21:38 +0000 (15:21 +0100)]
[RISCV] Add a test showing incorrect VSETVLI insertion

This test case, reduced from an internal test failure, shows how we may
incorrectly skip the insertion of VSETVLI instructions when doing
cross-basic-block analysis.

The entry block ends in a `e32,mf2`. Its single successor, %bb.1, ends with a
`e8,mf8`, but for a mask-type instruction, so is considered compatible.
This means that the info %bb.1 is merged into its predecessor so
produces a `e32,mf2`. When it comes to the last block, which requires a
`e32,mf2`, we skip the insertion of a vsetvli because all predecessors
were determined to preserve the right vtype.

However, when %bb.1 is actually laid out it does actually need a
`e8,mf8` vsetvli, since the previous instruction has a different tail
policy. This means that when execution flows from %bb.1 to %bb.3, the
`vadd.vx` is misconfigured.

Reviewed By: craig.topper

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

2 years ago[IPT] Restructure cache to allow lazy update following invalidation [NFC]
Philip Reames [Thu, 21 Oct 2021 16:15:08 +0000 (09:15 -0700)]
[IPT] Restructure cache to allow lazy update following invalidation [NFC]

This change restructures the cache used in IPT to point not to the first special instruction, but to the first instruction which *could* be special. That is, the cached reference is always equal to the first special, or comes before it in the block.

This avoids expensive block scans when we are removing special instructions from the beginning of the block. At the moment, this case is not heavily used, though it does trigger in GVN when doing CSE of calls. The main motivation was a change I'm no longer planning to move forward with, but the cache optimization seemed worthwhile as a minor perf win at low cost.

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

2 years agoUpdate the title and encoding for the C++ status page
Aaron Ballman [Thu, 21 Oct 2021 16:14:44 +0000 (12:14 -0400)]
Update the title and encoding for the C++ status page

2 years agoUpdate the C++ and C status pages now that Clang 13 has been released
Aaron Ballman [Thu, 21 Oct 2021 16:13:19 +0000 (12:13 -0400)]
Update the C++ and C status pages now that Clang 13 has been released

2 years ago[clang] Don't clear AST if we have consumers running after the main action
Arthur Eubanks [Wed, 20 Oct 2021 22:43:10 +0000 (15:43 -0700)]
[clang] Don't clear AST if we have consumers running after the main action

Downstream users may have Clang plugins. By default these plugins run
after the main action if they are specified on the command line.

Since these plugins are ASTConsumers, presumably they inspect the AST.
So we shouldn't clear it if any plugins run after the main action.

Reviewed By: dblaikie, hans

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

2 years agoReapply [ORC-RT] Configure the ORC runtime for more architectures and platforms
Ben Langmuir [Wed, 20 Oct 2021 17:37:32 +0000 (10:37 -0700)]
Reapply [ORC-RT] Configure the ORC runtime for more architectures and platforms

Reapply 5692ed0cce8c95, but with the ORC runtime disabled explicitly on
CrossWinToARMLinux to match the other compiler-rt runtime libraries.

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

---

Enable building the ORC runtime for 64-bit and 32-bit ARM architectures,
and for all Darwin embedded platforms (iOS, tvOS, and watchOS). This
covers building the cross-platform code, but does not add TLV runtime
support for the new architectures, which can be added independently.

Incidentally, stop building the Mach-O TLS support file unnecessarily on
other platforms.

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

2 years ago[clang] Use StringRef::contains (NFC)
Kazu Hirata [Thu, 21 Oct 2021 15:58:19 +0000 (08:58 -0700)]
[clang] Use StringRef::contains (NFC)

2 years ago[DebugInfo] Support typedef with btf_decl_tag attributes
Yonghong Song [Tue, 21 Sep 2021 00:08:46 +0000 (17:08 -0700)]
[DebugInfo] Support typedef with btf_decl_tag attributes

Clang patch ([1]) added support for btf_decl_tag attributes with typedef
types. This patch added llvm support including dwarf generation.
For example, for typedef
   typedef unsigned * __u __attribute__((btf_decl_tag("tag1")));
   __u u;
the following shows llvm-dwarfdump result:
   0x00000033:   DW_TAG_typedef
                   DW_AT_type      (0x00000048 "unsigned int *")
                   DW_AT_name      ("__u")
                   DW_AT_decl_file ("/home/yhs/work/tests/llvm/btf_tag/t.c")
                   DW_AT_decl_line (1)

   0x0000003e:     DW_TAG_LLVM_annotation
                     DW_AT_name    ("btf_decl_tag")
                     DW_AT_const_value     ("tag1")

   0x00000047:     NULL

  [1] https://reviews.llvm.org/D110127

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

2 years ago[Clang] Support typedef with btf_decl_tag attributes
Yonghong Song [Tue, 21 Sep 2021 02:53:19 +0000 (19:53 -0700)]
[Clang] Support typedef with btf_decl_tag attributes

Previously, btf_del_tag attribute supports record, field, global variable,
function and function parameter ([1], [2]). This patch added support for typedef.
The main reason is for typedef of an anonymous struct/union, we can only apply
btf_decl_tag attribute to the anonymous struct/union like below:
  typedef struct { ... } __btf_decl_tag target_type
In this case, the __btf_decl_tag attribute applies to anonymous struct,
which increases downstream implementation complexity. But if
typedef with btf_decl_tag attribute is supported, we can have
  typedef struct { ... } target_type __btf_decl_tag
which applies __btf_decl_tag to typedef "target_type" which make it
easier to directly associate btf_decl_tag with a named type.
This patch permitted btf_decl_tag with typedef types with this reason.

 [1] https://reviews.llvm.org/D106614
 [2] https://reviews.llvm.org/D111588

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

2 years ago[libc++] Use addressof in vector.
Mark de Wever [Sun, 10 Oct 2021 13:40:50 +0000 (15:40 +0200)]
[libc++] Use addressof in vector.

This addresses the usage of `operator&` in `<vector>`.

I now added tests for the current offending cases. I wonder whether it
would be better to add one addressof test per directory and test all
possible violations. Also to guard against possible future errors?

(Note there are still more headers with the same issue.)

Reviewed By: #libc, ldionne

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

2 years ago[lld-macho] Simplify lc-linker-option.ll and re-enable it on Windows
Jez Ng [Thu, 21 Oct 2021 15:23:34 +0000 (11:23 -0400)]
[lld-macho] Simplify lc-linker-option.ll and re-enable it on Windows

While attempting to simplify it, I discovered a concerning discrepancy
between our handling of LC_LINKER_OPTION vs ld64's. In particular, ld64
does not appear to check for `-all_load` nor `-ObjC` when processing
those options. Thus, if/when we fix this behavior, no duplicate symbol
error will be expected regardless of the use-after-free. As such, I've
removed the test logic that tries to induce the duplicate symbol error.
We can just rely on ASAN to do the verification.

In order to make the test run on Windows, I've removed the symlink
logic. Both ld64 and LLD handle this un-symlinked framework just fine.

I also capitalized the framework name, since that's the typical
convention.

Reviewed By: #lld-macho, oontvoo

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

2 years ago[ORC-RT] Remove stray printf debugging output.
Lang Hames [Wed, 20 Oct 2021 20:51:50 +0000 (13:51 -0700)]
[ORC-RT] Remove stray printf debugging output.

These were accidentally picked up in an earlier commit.

2 years ago[mlir][Linalg] Improve conv vectorization for the stride==1 case.
Nicolas Vasilache [Wed, 20 Oct 2021 19:51:21 +0000 (19:51 +0000)]
[mlir][Linalg] Improve conv vectorization for the stride==1 case.

In the stride == 1 case, conv1d reads contiguous data along the input dimension. This can be advantageaously used to bulk memory transfers and compute while avoiding unrolling. Experimentally, this can yield speedups of up to 50%.

Reviewed By: antiagainst

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

2 years ago[libomptarget][DeviceRTL] Generalise and simplify cmakelists
Jon Chesterfield [Thu, 21 Oct 2021 15:14:28 +0000 (16:14 +0100)]
[libomptarget][DeviceRTL] Generalise and simplify cmakelists

Step towards building the DeviceRTL for amdgpu.

Mostly replaces cuda-specific toolchain finding logic with the
generic logic currently found in the amdgpu deviceRTL cmake. Also
deletes dead code and changes the default to build on systems
without cuda installed, as the library doesn't use cuda and the
amdgpu-only systems generally won't have cuda installed.

Reviewed By: Meinersbur

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

2 years ago[InstCombine] generalize reassociated Demorgan folds
Sanjay Patel [Thu, 21 Oct 2021 14:37:16 +0000 (10:37 -0400)]
[InstCombine] generalize reassociated Demorgan folds

This updates the recent D112108 / b92412fb286be26d
to handle the flipped logic ('or') sibling:
https://alive2.llvm.org/ce/z/Y2L6Ch

2 years ago[InstCombine] add tests for DeMorgan with reassociation; NFC
Sanjay Patel [Thu, 21 Oct 2021 14:07:01 +0000 (10:07 -0400)]
[InstCombine] add tests for DeMorgan with reassociation; NFC

These are direct mutations of the tests added for D112108 -
we should handle the sibling folds for 'or'.

2 years agoDo not downcast uint64_t to unsigned in UniqueID hash computation
Kirill Bobyrev [Thu, 21 Oct 2021 14:21:10 +0000 (16:21 +0200)]
Do not downcast uint64_t to unsigned in UniqueID hash computation

Context: https://reviews.llvm.org/D110925#inline-1070046

2 years ago[runtimes] Properly handle the sysroot/triple/gcc-toolchain
Louis Dionne [Tue, 12 Oct 2021 19:59:08 +0000 (15:59 -0400)]
[runtimes] Properly handle the sysroot/triple/gcc-toolchain

In 395271a, I simplified how we handled the target triple for the
runtimes. However, in doing so, we stopped considering the default
in CMAKE_CXX_COMPILER_TARGET, so we'd use the LLVM_DEFAULT_TARGET_TRIPLE
(which is the host triple) even if CMAKE_CXX_COMPILER_TARGET was specified.
This commit fixes that problem and also refactors the code so that it's
easy to see what the default value is.

The fact that nobody seems to have been broken by this makes me think
that perhaps nobody is using CMAKE_CXX_COMPILER_TARGET to specify the
triple -- but it should still work.

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

2 years ago[SystemZ][z/OS] Initial implementation for lowerCall on z/OS
Anirudh Prasad [Thu, 21 Oct 2021 13:48:21 +0000 (09:48 -0400)]
[SystemZ][z/OS] Initial implementation for lowerCall on z/OS

- This patch provides the initial implementation for lowering a call on z/OS according to the XPLINK64 calling convention
- A series of changes have been made to SystemZCallingConv.td to account for these additional XPLINK64 changes including adding a new helper function to shadow the stack along with allocation of a register wherever appropriate
- For the cases of copying a f64 to a gr64 and a f128 / 128-bit vector type to a gr64, a `CCBitConvertToType` has been added and has been bitcasted appropriately in the lowering phase
- Support for the ADA register (R5) will be provided in a later patch.

Reviewed By: uweigand

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

2 years ago[DAGCombiner] fold bit-hack form of usubsat
Sanjay Patel [Thu, 21 Oct 2021 13:06:37 +0000 (09:06 -0400)]
[DAGCombiner] fold bit-hack form of usubsat

(i8 X ^ 128) & (i8 X s>> 7) --> usubsat X, 128

I haven't found a generalization of this identity:
https://alive2.llvm.org/ce/z/_sriEQ

Note: I was actually looking at the first form of the pattern in that link,
but that's part of a long chain of potential missed transforms in codegen
and IR....that I hope ends here!

The predicates for when this is profitable are a bit tricky. This version of
the patch excludes multi-use but includes custom lowering (as opposed to
legal only).

On x86 for example, we have custom lowering for some vector types, and that
uses umax and sub. So to enable that fold, we need add use checks to avoid
regressions. Even with legal-only lowering, we could see code with extra
reg move instructions for extra uses, so that constraint would have to be
eased very carefully to avoid penalties.

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

2 years ago[SystemZ][z/OS] Additional test coverage for validating dialect instructions for...
Anirudh Prasad [Thu, 21 Oct 2021 13:45:33 +0000 (09:45 -0400)]
[SystemZ][z/OS] Additional test coverage for validating dialect instructions for SystemZ

- There are certain instructions most notably those with extended mnemonics that restricted to only the gnu/att variant
- There are also certain instruction aliases/mnemonic aliases that are restricted only to the HLASM variant (see https://reviews.llvm.org/D97581, https://reviews.llvm.org/D94250 and https://reviews.llvm.org/D92185 for reference)
- This patch adds a few tests to check for the behaviour introduced in the above patches. The testing coverage could not be added in at the same time, due to parallel work being done introducing the HLASM syntax

Reviewed By: uweigand, abhina.sreeskantharajan

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

2 years ago[SLP]Unify vectorization of PHI and store nodes with improved tiny tree vectorization.
Alexey Bataev [Wed, 15 Sep 2021 14:47:17 +0000 (07:47 -0700)]
[SLP]Unify vectorization of PHI and store nodes with improved tiny tree vectorization.

Vectorization of PHIs and stores very similar, it might be beneficial to
try to revectorize stores (like PHIs) if the total number of stores with
the same/alternate opcode is less than the vector size but number of
stores with the same type is larger than the vector size.

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

2 years ago[mlir][linalg][bufferize] Fix bufferizesToMemoryWrite for TiledLoopOp
Matthias Springer [Thu, 21 Oct 2021 13:16:36 +0000 (22:16 +0900)]
[mlir][linalg][bufferize] Fix bufferizesToMemoryWrite for TiledLoopOp

This is the same fix as for scf.for.

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

2 years ago[mlir][linalg][bufferize] Fix bug in getInplaceableOpResult
Matthias Springer [Thu, 21 Oct 2021 12:54:54 +0000 (21:54 +0900)]
[mlir][linalg][bufferize] Fix bug in getInplaceableOpResult

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

2 years ago[mlir][linalg][bufferize] Avoid creating copies that are never read
Matthias Springer [Thu, 21 Oct 2021 12:45:34 +0000 (21:45 +0900)]
[mlir][linalg][bufferize] Avoid creating copies that are never read

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

2 years ago[mlir][linalg][bufferize] Eliminate InitTensorOps of InsertSliceOp sources
Matthias Springer [Thu, 21 Oct 2021 12:33:07 +0000 (21:33 +0900)]
[mlir][linalg][bufferize] Eliminate InitTensorOps of InsertSliceOp sources

An InitTensorOp is replaced with an ExtractSliceOp on the InsertSliceOp's destination. This optimization is applied after analysis and only to InsertSliceOps that were decided to bufferize inplace. Another analysis on the new ExtractSliceOp is needed after the rewrite.

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

2 years agoRelax assert in ExprConstant to a return None.
Jon Chesterfield [Thu, 21 Oct 2021 12:09:55 +0000 (13:09 +0100)]
Relax assert in ExprConstant to a return None.

Fixes a compiler assert on passing a compile time integer to atomic builtins.

Assert introduced in D61522
Function changed from ->bool to ->Optional in D76646
Simplifies call sites to getIntegerConstantExpr to elide the now-redundant
isValueDependent checks.

Reviewed By: aaron.ballman

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

2 years ago[clang][deps] Make resource directory deduction configurable
Jan Svoboda [Thu, 21 Oct 2021 11:10:18 +0000 (13:10 +0200)]
[clang][deps] Make resource directory deduction configurable

The `clang-scan-deps` CLI tool invokes the compiler with `-print-resource-dir` in case the `-resource-dir` argument is missing from the compilation command line. This is to enable running the tool on compilation databases that use compiler from a different toolchain than `clang-scan-deps` itself. While this doesn't make sense when scanning modular builds (due to the `-cc1` arguments the tool generates), the tool can can be used to efficiently scan for file dependencies of non-modular builds too.

This patch stops deducing the resource directory by invoking the compiler by default. This mode can still be enabled by invoking `clang-scan-deps` with `--resource-dir-recipe invoke-compiler`. The new default is `--resource-dir-recipe modify-compiler-path` which relies on the resource directory deduction taking place in `Driver::Driver` which is based on the compiler path. This makes the default more aligned with the intended usage of the tool while still allowing it to serve other use-cases.

Note that this functionality was also influenced by D108979, where the dependency scanner stopped going through `ClangTool::run`. The function tried to deduce the resource directory based on the current executable path, which might not be what the users expect when invoked from within a shared library.

Depends on D108979.

Reviewed By: dexonsmith

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

2 years ago[lldb] Fix a thinko in 2ace1e57
Pavel Labath [Thu, 21 Oct 2021 12:01:24 +0000 (14:01 +0200)]
[lldb] Fix a thinko in 2ace1e57

An empty plugin name means we should try everything.

Picked up by the windows bot.

2 years ago[SVE] Fix selection failure when splitting extended masked loads
Kerry McLaughlin [Thu, 21 Oct 2021 10:30:31 +0000 (11:30 +0100)]
[SVE] Fix selection failure when splitting extended masked loads

When splitting a masked load, `GetDependentSplitDestVTs` is used to get the
MemVTs of the high and low parts. If the masked load is extended, this
may return VTs with different element types which are used to create the
high & low masked load instructions.
This patch changes `GetDependentSplitDestVTs` to ensure we return VTs with
the same element type.

Reviewed By: david-arm

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

2 years ago[MIPS] Fix switching between 32/64-bit variants of r6 target triples
YunQiang Su [Thu, 21 Oct 2021 07:46:22 +0000 (10:46 +0300)]
[MIPS] Fix switching between 32/64-bit variants of r6 target triples

If clang driver gets 64-bit r6 target triple like `mipsisa64r6` and
additional option forces switching to generation of 32-bit code, it
loses r6 abi and generates 32-bit r2-r5 abi code.

```
$ clang -target mipsisa64r6-linux-gnu -mabi=32
```

This patch fixes the problem.

- Add optional `SubArchType` argument to the `Triple::setArch()` method.
- Implement generation of mips r6 target triples in the
  `Triple::getArchName()` method.

Differential Revision: https://reviews.llvm.org/D110514.diff

2 years ago[ARM] Add new abs test. NFC
David Green [Thu, 21 Oct 2021 12:03:18 +0000 (13:03 +0100)]
[ARM] Add new abs test. NFC

2 years ago[clang][deps] NFC: Rename building CompilerInvocation
Jan Svoboda [Thu, 21 Oct 2021 11:51:22 +0000 (13:51 +0200)]
[clang][deps] NFC: Rename building CompilerInvocation

The dependency scanner works with multiple instances of `Compiler{Instance,Invocation}`. From names of the variables/members, their purpose is not obvious.

This patch gives descriptive name to the generated `CompilerInvocation` that can be used to derive the command-line to build a modular dependency.

Depends on D111725.

Reviewed By: dexonsmith

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

2 years ago[clang][deps] NFC: Rename scanning CompilerInstance
Jan Svoboda [Thu, 21 Oct 2021 11:50:57 +0000 (13:50 +0200)]
[clang][deps] NFC: Rename scanning CompilerInstance

The dependency scanner works with multiple instances of `Compiler{Instance,Invocation}`. From names of the variables/members, their purpose is not obvious.

This patch gives a distinct name to the `CompilerInstance` that's used to run the implicit build during dependency scan.

Depends on D111724.

Reviewed By: dexonsmith

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

2 years ago[clang][deps] NFC: Remove redundant CompilerInstance reference
Jan Svoboda [Thu, 21 Oct 2021 11:50:42 +0000 (13:50 +0200)]
[clang][deps] NFC: Remove redundant CompilerInstance reference

The `ModuleDepCollectorPP` class holds a reference to `ModuleDepCollector` as well as `ModuleDepCollector`'s `CompilerInstance`. The fact that these refer to the same object is non-obvious.

This patch removes the `CompilerInvocation` reference from `ModuleDepCollectorPP` and accesses it through `ModuleDepCollector` instead.

Reviewed By: dexonsmith

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

2 years ago[clang][deps] Ensure reported context hash is strict
Jan Svoboda [Thu, 21 Oct 2021 11:28:05 +0000 (13:28 +0200)]
[clang][deps] Ensure reported context hash is strict

One of main goals of the dependency scanner is to be strict about module compatibility. This is achieved through strict context hash. This patch ensures that strict context hash is enabled not only during the scan itself (and its minimized implicit build), but also when actually reporting the dependency.

Reviewed By: dexonsmith

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

2 years agoRevert "AddGlobalAnnotations for function with or without function body."
Aaron Ballman [Thu, 21 Oct 2021 11:08:18 +0000 (07:08 -0400)]
Revert "AddGlobalAnnotations for function with or without function body."

This reverts commit 121b2252de0eed68f2ddf5f09e924a6c35423d47.

The following code causes a crash in some circumstances:

  struct k {
    ~k() __attribute__((annotate(""))) {}
  };
  void m() { k(); }

2 years ago[lldb] Silence -Wpessimizing-move warning
Benjamin Kramer [Thu, 21 Oct 2021 10:58:10 +0000 (12:58 +0200)]
[lldb] Silence -Wpessimizing-move warning

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:3635:10: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
  return std::move(merged);
         ^

2 years ago[lldb] Remove ConstString from GetPluginNameStatic of some plugins
Pavel Labath [Mon, 18 Oct 2021 08:39:58 +0000 (10:39 +0200)]
[lldb] Remove ConstString from GetPluginNameStatic of some plugins

This patch deals with ObjectFile, ObjectContainer and OperatingSystem
plugins. I'll convert the other types in separate patches.

In order to enable piecemeal conversion, I am leaving some ConstStrings
in the lowest PluginManager layers. I'll convert those as the last step.

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

2 years ago[mlir] Fix a crash when creating a 1d zero element LLVM constant
Benjamin Kramer [Thu, 21 Oct 2021 09:57:16 +0000 (11:57 +0200)]
[mlir] Fix a crash when creating a 1d zero element LLVM constant

Fixes a regression introduced in f9be7a7afda3c90b99c9f50e5eff1624da5a6511

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

2 years ago[mlir] Use empty() calls where possible.
Adrian Kuegel [Thu, 21 Oct 2021 10:45:37 +0000 (12:45 +0200)]
[mlir] Use empty() calls where possible.

These are based on findings from the ClangTidy
readability-container-size-empty check.

2 years ago[lldb] Add omitted abstract formal parameters in DWARF symbol files
Jaroslav Sevcik [Sat, 25 Sep 2021 17:29:04 +0000 (19:29 +0200)]
[lldb] Add omitted abstract formal parameters in DWARF symbol files

This patch fixes a problem introduced by clang change
https://reviews.llvm.org/D95617 and described by
https://bugs.llvm.org/show_bug.cgi?id=50076#c6, where inlined functions
omit unused parameters both in the stack trace and in `frame var`
command. With this patch, the parameters are listed correctly in the
stack trace and in `frame var` command.

Specifically, we parse formal parameters from the abstract version of
inlined functions and use those formal parameters if they are missing
from the concrete version.

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

2 years ago[NFC][LoopIdiom] Make for loops more readable
Dawid Jurczak [Thu, 21 Oct 2021 10:07:07 +0000 (12:07 +0200)]
[NFC][LoopIdiom] Make for loops more readable

Patch simplifies for loops in LIR following LLVM guidelines: https://llvm.org/docs/CodingStandards.html#use-range-based-for-loops-wherever-possible.

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

2 years ago[libcxx] Throw correct exception from std::vector::reserve
Mikhail Maltsev [Thu, 21 Oct 2021 09:40:05 +0000 (10:40 +0100)]
[libcxx] Throw correct exception from std::vector::reserve

According to the standard [vector.capacity]/5, std::vector<T>::reserve
shall throw an exception of type std::length_error when the requested
capacity exceeds max_size().

This behavior is not implemented correctly: the function 'reserve'
simply propagates the exception from allocator<T>::allocate. Before
D110846 that exception used to be of type std::length_error (which is
correct for vector<T>::reserve, but incorrect for
allocator<T>::allocate).

This patch fixes the issue and adds regression tests.

Reviewed By: Quuxplusone, ldionne, #libc

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

2 years ago[libcxx] Support allocators with explicit c-tors in vector<bool>
Mikhail Maltsev [Thu, 21 Oct 2021 09:38:56 +0000 (10:38 +0100)]
[libcxx] Support allocators with explicit c-tors in vector<bool>

std::vector<bool> rebinds the supplied allocator to construct objects
of type '__storage_type' rather than 'bool'. Allocators are allowed to
use explicit conversion constructors, so care must be taken when
performing conversions.

Reviewed By: ldionne, #libc

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

2 years agoRevert "[fir] Add Character helper"
Valentin Clement [Thu, 21 Oct 2021 09:36:10 +0000 (11:36 +0200)]
Revert "[fir] Add Character helper"

This reverts commit e4ce92245c96cea9492767d7149eb9e30dee0d16.

Buildbots not happy with the tests.

2 years ago[clang] Support __float128 on DragonFlyBSD.
Frederic Cambus [Thu, 21 Oct 2021 09:18:52 +0000 (11:18 +0200)]
[clang] Support __float128 on DragonFlyBSD.

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

2 years ago[docs] Fix broken link rendering in the LLVM Coding Standards.
Frederic Cambus [Thu, 21 Oct 2021 09:10:18 +0000 (11:10 +0200)]
[docs] Fix broken link rendering in the LLVM Coding Standards.

2 years ago[lldb] [Host/SerialPort] Add std::moves for better compatibility
Michał Górny [Thu, 21 Oct 2021 09:08:05 +0000 (11:08 +0200)]
[lldb] [Host/SerialPort] Add std::moves for better compatibility

2 years ago[lldb] [Host/Terminal] Add missing #ifdef for baudRateToConst()
Michał Górny [Thu, 21 Oct 2021 09:00:17 +0000 (11:00 +0200)]
[lldb] [Host/Terminal] Add missing #ifdef for baudRateToConst()

2 years ago[lldb] [unittest] Disable SetParity() tests on Linux entirely
Michał Górny [Thu, 21 Oct 2021 08:54:02 +0000 (10:54 +0200)]
[lldb] [unittest] Disable SetParity() tests on Linux entirely

Attempting to enable PARENB causes tcsetattr() to fail on the Debian
and Ubuntu buildbots, so let's skip these tests on Linux entirely.

2 years ago[lldb] Add serial:// protocol for connecting to serial port
Michał Górny [Thu, 7 Oct 2021 21:14:23 +0000 (23:14 +0200)]
[lldb] Add serial:// protocol for connecting to serial port

Add a new serial:// protocol along with SerialPort that provides a new
API to open serial ports.  The URL consists of serial device path
followed by URL-style options, e.g.:

    serial:///dev/ttyS0?baud=115200&parity=even

If no options are provided, the serial port is only set to raw mode
and the other attributes remain unchanged.  Attributes provided via
options are modified to the specified values.  Upon closing the serial
port, its original attributes are restored.

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

2 years ago[NARY-REASSOCIATE][NFC] Simplify min/max handling
Evgeniy Brevnov [Wed, 20 Oct 2021 09:42:19 +0000 (16:42 +0700)]
[NARY-REASSOCIATE][NFC] Simplify min/max handling

In order to explore different variants of reassociation current implementation uses "swap in a loop" approach. Unfortunately, the implementation is more complicated than it could be. This is an attempt to streamline the code. New approach is to extract core functionality into a helper function and call it explicitly as many times as required.

Reviewed By: nikic

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

2 years ago[mlir][linalg][bufferize][NFC] Change findValueInReverseUseDefChain signature
Matthias Springer [Thu, 21 Oct 2021 08:29:02 +0000 (17:29 +0900)]
[mlir][linalg][bufferize][NFC] Change findValueInReverseUseDefChain signature

This commit is in preparation for scf.if support.

* `condition` in findValueInReverseUseDefChain takes a Value instead of OpOperand*.
* Return a SetVector<Value> instead of a single Value. This SetVector always contains exactly one Value at the moment.

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

2 years ago[SVE][Analysis] Tune the cost model according to the tune-cpu attribute
David Sherwood [Wed, 22 Sep 2021 09:54:05 +0000 (10:54 +0100)]
[SVE][Analysis] Tune the cost model according to the tune-cpu attribute

This patch introduces a new function:

  AArch64Subtarget::getVScaleForTuning

that returns a value for vscale that can be used for tuning the cost
model when using scalable vectors. The VScaleForTuning option in
AArch64Subtarget is initialised according to the following rules:

1. If the user has specified the CPU to tune for we use that, else
2. If the target CPU was specified we use that, else
3. The tuning is set to "generic".

For CPUs of type "generic" I have assumed that vscale=2.

New tests added here:

  Analysis/CostModel/AArch64/sve-gather.ll
  Analysis/CostModel/AArch64/sve-scatter.ll
  Transforms/LoopVectorize/AArch64/sve-strict-fadd-cost.ll

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

2 years ago[lldb] [Host] Add setters for common teletype properties to Terminal
Michał Górny [Sun, 3 Oct 2021 18:25:01 +0000 (20:25 +0200)]
[lldb] [Host] Add setters for common teletype properties to Terminal

Add setters for common teletype properties to the Terminal class:

- SetRaw() to enable common raw mode options

- SetBaudRate() to set the baud rate

- SetStopBits() to select the number of stop bits

- SetParity() to control parity bit in the output

- SetHardwareControlFlow() to enable or disable hardware control flow
  (if supported)

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

2 years ago[MLIR][OpenMP] Add support for ordered construct
Peixin-Qiao [Thu, 21 Oct 2021 08:30:46 +0000 (16:30 +0800)]
[MLIR][OpenMP] Add support for ordered construct

This patch supports the ordered construct in OpenMP dialect following
Section 2.19.9 of the OpenMP 5.1 standard. Also lowering to LLVM IR
using OpenMP IRBduiler. Lowering to LLVM IR for ordered simd directive
is not supported yet since LLVM optimization passes do not support it
for now.

Reviewed By: kiranchandramohan, clementval, ftynse, shraiysh

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