platform/upstream/llvm.git
3 years ago[NFC][libunbind] Fix Sphinx error during CMake invocation
xgupta [Thu, 11 Feb 2021 01:19:13 +0000 (06:49 +0530)]
[NFC][libunbind] Fix Sphinx error during CMake invocation

An error has occurred when I build libunwind with -DLLVM_BUILD_DOCS=ON.

Reviewed By: #libunwind, compnerd

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

3 years ago[Draft] [examples] Move llvm/examples/OCaml-Kaleidoscope/ to llvm-archive
xgupta [Mon, 8 Feb 2021 22:50:02 +0000 (04:20 +0530)]
[Draft] [examples] Move llvm/examples/OCaml-Kaleidoscope/ to llvm-archive

3 years agoFix CMake configuration for MLIR unittests
Mehdi Amini [Thu, 11 Feb 2021 01:17:24 +0000 (01:17 +0000)]
Fix CMake configuration for MLIR unittests

The CMake changes in 2aa1af9b1da to make it possible to build MLIR as a
standalone project unfortunately disabled all unit-tests from the
regular in-tree build.

3 years agoValueMapper: Rename RF_MoveDistinctMDs => RF_ReuseAndMutateDistinctMDs, NFC
Duncan P. N. Exon Smith [Wed, 10 Feb 2021 23:23:53 +0000 (15:23 -0800)]
ValueMapper: Rename RF_MoveDistinctMDs => RF_ReuseAndMutateDistinctMDs, NFC

Rename the `RF_MoveDistinctMDs` flag passed into `MapValue` and
`MapMetadata` to `RF_ReuseAndMutateDistinctMDs` in order to more
precisely describe its effect and clarify the header documentation.

Found this while helping to investigate PR48841, which pointed out an
unsound use of the flag in `CloneModule()`. For now I've just added a
FIXME there, but I'm hopeful that the new (more precise) name will
prevent other similar errors.

3 years ago[flang][fir][NFC] Move ShapeType to TableGen type definition
Valentin Clement [Thu, 11 Feb 2021 00:25:35 +0000 (19:25 -0500)]
[flang][fir][NFC] Move ShapeType to TableGen type definition

This is the first patch of a serie to move FIR types to TableGen format as suggested in D96172.
This patch is setting up the files for FIR types and move the ShapeType to TableGen.

As discussed with @schweitz, I'm taking over this task to help the FIR upstreaming effort.

Reviewed By: mehdi_amini

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

3 years ago[test/ubsan] Allow unused FileCheck prefixes in TypeCheck/vptr.cpp
Vedant Kumar [Thu, 11 Feb 2021 00:06:46 +0000 (16:06 -0800)]
[test/ubsan] Allow unused FileCheck prefixes in TypeCheck/vptr.cpp

This test started failing after https://reviews.llvm.org/D95849
defaulted --allow-unused-prefixes to false.

Taking a look at the test, I didn't see an obvious need to add
OS-specific check lines for each supported value of %os.

rdar://74207657

3 years ago[AArch64][GlobalISel] Don't perform the mul const combine with G_PTR_ADD
Jessica Paquette [Wed, 10 Feb 2021 22:53:10 +0000 (14:53 -0800)]
[AArch64][GlobalISel] Don't perform the mul const combine with G_PTR_ADD

A G_MUL + G_PTR_ADD can also be folded into a madd. So, conservatively, we
shouldn't combine when the G_MUL is used by a G_PTR_ADD either.

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

3 years ago[MLIR][TOSA] Tosa elementwise broadcasting
Rob Suderman [Sat, 6 Feb 2021 00:45:36 +0000 (16:45 -0800)]
[MLIR][TOSA] Tosa elementwise broadcasting

Added support for broadcasting size-1 dimensions for TOSA elemtnwise
operations.

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

3 years ago[docs] Make clearer in WritingAnLLVMPass that the legacy PM isn't the default
Arthur Eubanks [Wed, 10 Feb 2021 22:20:38 +0000 (14:20 -0800)]
[docs] Make clearer in WritingAnLLVMPass that the legacy PM isn't the default

Reviewed By: ychen

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

3 years agoMinor fixes to Type ODS docs.
Sean Silva [Wed, 10 Feb 2021 02:57:58 +0000 (18:57 -0800)]
Minor fixes to Type ODS docs.

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

3 years ago[mlir] Introduce more intuitive wording for attributes.
Sean Silva [Fri, 5 Feb 2021 00:17:45 +0000 (16:17 -0800)]
[mlir] Introduce more intuitive wording for attributes.

After discussion, it seems like we want to go with
"inherent/discardable". These seem to best capture the relationship with
the op semantics and don't conflict with other terms.

Please let me know your preferences. Some of the other contenders are:

```
"intrinsic" side | "annotation" side
-----------------+------------------
characteristic   | annotation
closed           | open
definitional     | advisory
essential        | discardable
expected         | unexpected
innate           | acquired
internal         | external
intrinsic        | extrinsic
known            | unknown
local            | global
native           | foreign
inherent         | acquired
```

Rationale:

- discardable: good. discourages use for stable data.
- inherent: good
- annotation: redundant and doesn't convey difference
- intrinsic: confusable with "compiler intrinsics".
- definitional: too much of a mounthful
- extrinsic: too exotic of a word and hard to say
- acquired: doesn't convey the relationship to the semantics
- internal/external: not immediately obvious: what is internal to what?

- innate: similar to intrinsic but worse
- acquired: we don't typically think of an op as "acquiring" things
- known/unknown: by who?
- local/global: to what?
- native/foreign: to where?
- advisory: confusing distinction: is the attribute itself advisory or
  is the information it provides advisory?
- essential: an intrinsic attribute need not be present.
- expected: same issue as essential
- unexpected: by who/what?
- closed/open: whether the set is open or closed doesn't seem essential
  to the attribute being intrinsic. Also, in theory an op can have an
  unbounded set of intrinsic attributes (e.g. `arg<N>` for func).
- characteristic: unless you have a math background this probably
  doesn't make as much sense

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

3 years ago[lldb] Use internal_dict name over dict in python examples
Dave Lee [Wed, 10 Feb 2021 22:28:13 +0000 (14:28 -0800)]
[lldb] Use internal_dict name over dict in python examples

Follow up to https://reviews.llvm.org/rG483ec136da7193de781a5284f1c37929cc27c05c

3 years ago[mlir] NFC - Extend inferResultType API for SubViewOp and SubTensorOp
Nicolas Vasilache [Wed, 10 Feb 2021 22:53:33 +0000 (22:53 +0000)]
[mlir] NFC - Extend inferResultType API for SubViewOp and SubTensorOp

3 years ago[mlir][Linalg] Fix crash when tileSizeComputationFunction is left unspecified
Nicolas Vasilache [Wed, 10 Feb 2021 22:30:46 +0000 (22:30 +0000)]
[mlir][Linalg] Fix crash when tileSizeComputationFunction is left unspecified

3 years ago[AArch64][GlobalISel] Perform load/store extended reg folding with optsize
Jessica Paquette [Wed, 10 Feb 2021 22:07:36 +0000 (14:07 -0800)]
[AArch64][GlobalISel] Perform load/store extended reg folding with optsize

GlobalISel was only doing this with minsize. SDAG does this with optsize.

(See: `SelectionDAG::shouldOptForSize()`)

This is a 0.3% code size improvement for CTMark at -Os.

(Best: 1.1% improvements on lencod + pairlocalalign)

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

3 years ago[CSSPGO] Restrict pseudo probe tests to x86_64 only.
Hongtao Yu [Wed, 10 Feb 2021 22:40:47 +0000 (14:40 -0800)]
[CSSPGO] Restrict pseudo probe tests to x86_64 only.

3 years ago[SampleFDO] Silence -Wnon-virtual-dtor warning
Benjamin Kramer [Wed, 10 Feb 2021 22:37:15 +0000 (23:37 +0100)]
[SampleFDO] Silence -Wnon-virtual-dtor warning

There's no polymorphic deletion happening here.

3 years ago[asan][test] Fix Linux/odr-violation.cpp after symbolizer change D95927
Fangrui Song [Wed, 10 Feb 2021 22:27:12 +0000 (14:27 -0800)]
[asan][test] Fix Linux/odr-violation.cpp after symbolizer change D95927

3 years ago[opt] Add helpful alternatives for -analyze under new PM
Arthur Eubanks [Wed, 10 Feb 2021 21:31:58 +0000 (13:31 -0800)]
[opt] Add helpful alternatives for -analyze under new PM

Reviewed By: reames

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

3 years ago[Clang, NewPM] Add KMSan support
Vitaly Buka [Tue, 9 Feb 2021 11:26:34 +0000 (03:26 -0800)]
[Clang, NewPM] Add KMSan support

Depends on D96320.

Reviewed By: eugenis

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

3 years ago[NFC] Simplify test
Vitaly Buka [Wed, 10 Feb 2021 21:55:47 +0000 (13:55 -0800)]
[NFC] Simplify test

Redundant check-prefixes is needed for folloup patches.

3 years agoRevert "Make gCrashRecoveryEnabled thread local"
Jacques Pienaar [Wed, 10 Feb 2021 21:36:10 +0000 (13:36 -0800)]
Revert "Make gCrashRecoveryEnabled thread local"

This reverts commit 5e77ea04f214c7a18bd5c782c8b8a7b7c828ad7a.

Causes a breakage on Windows buildbot.

3 years ago[lldb] Minor cleanups to ThreadPlan.h (NFC)
Dave Lee [Mon, 8 Feb 2021 04:16:48 +0000 (20:16 -0800)]
[lldb] Minor cleanups to ThreadPlan.h (NFC)

While learning about ThreadPlan, I did a bit of cleanup:

* Remove unused code
* Move functions to protected where applicable
* Remove virtual for functions that are not overridden

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

3 years ago[SampleFDO][NFC] Refactor SampleProfileLoader to reuse in CodeGen
Rong Xu [Wed, 10 Feb 2021 03:43:26 +0000 (19:43 -0800)]
[SampleFDO][NFC] Refactor SampleProfileLoader to reuse in CodeGen

Break SampleProfileLoader into to a base and a derived class.
Base class (SampleProfileLoaderBaseImpl) includes the common
code for IR and MachineIR (CodeGen) sample loader.
It will be templatelized in the later patch.

Inline and Probe related code will remain in the derived class of
SampleProfileLoader and stays in SampleProfile.cpp.

We need to refactor some functions:
(1) getInstWeight() to enable the code sharing -- put the core into
getInstWeightImpl().
(2) emitAnnotation() and propagateWeights() to carve out the code
specific to SampleProfileLoader.
(3) make getInstWeight() and findFunctionSamples() virtual and override
in SampleProfileLoader as they need to access the fields in the derived
class.

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

3 years ago[AArch64][GlobalISel] Fold G_ADD into the cset for G_ICMP
Jessica Paquette [Wed, 10 Feb 2021 01:06:45 +0000 (17:06 -0800)]
[AArch64][GlobalISel] Fold G_ADD into the cset for G_ICMP

When we have a G_ADD which is fed by a G_ICMP on one side, we can fold it into
the cset for the G_ICMP.

e.g. Given

```
%cmp = G_ICMP ... %x, %y
%add = G_ADD %cmp, %z
```

We would normally emit a cmp, cset, and add.

However, `%add` is either `%z` or `%z + 1`. So, we can just use `%z` as the
source of the cset rather than wzr, saving an instruction.

This would probably be cleaner in AArch64PostLegalizerLowering, but we'd need
to change the way we represent G_ICMP to do that, I think. For now, it's
easiest to implement in selection.

This is a 0.1% code size improvement on CTMark/pairlocalalign at -Os.

Example: https://godbolt.org/z/7KdrP8

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

3 years ago[clangd] Remove redundant -fno-delayed-template-parsing in tests. NFCI
Sam McCall [Wed, 10 Feb 2021 21:20:23 +0000 (22:20 +0100)]
[clangd] Remove redundant -fno-delayed-template-parsing in tests. NFCI

We now (since a while) turn this off centrally in ParsedAST and CodeComplete.

3 years ago[clangd] Remove support for pre-standard semanticHighlighting notification
Sam McCall [Thu, 28 Jan 2021 00:16:47 +0000 (01:16 +0100)]
[clangd] Remove support for pre-standard semanticHighlighting notification

This is obsoleted by the standard semanticTokens request family.
As well as the protocol details, this allows us to remove a bunch of plumbing
around pushing highlights to clients.

This should not land until the new protocol has feature parity, see D77702.

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

3 years agoMake gCrashRecoveryEnabled thread local
Jacques Pienaar [Wed, 10 Feb 2021 20:44:18 +0000 (12:44 -0800)]
Make gCrashRecoveryEnabled thread local

If context is enabled/disabled and queried concurrently then this
results in a data race/TSAN failure with RunSafely (where boolean
variable was not locked).

There doesn't seem to be a reasonable way to enable threads that enable
and disable recovery in parallel (without also keeping
gCrashRecoveryEnabled's lock held during Fn execution which seems
undesirable). This makes enable checking if enabled thread local and
consistent with other thread local usage of crash context here.

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

3 years ago[CSSPGO] Unblock optimizations with pseudo probe instrumentation.
Hongtao Yu [Mon, 8 Feb 2021 06:49:20 +0000 (22:49 -0800)]
[CSSPGO] Unblock optimizations with pseudo probe instrumentation.

The IR/MIR pseudo probe intrinsics don't get materialized into real machine instructions and therefore they don't incur runtime cost directly. However, they come with indirect cost by blocking certain optimizations. Some of the blocking are intentional (such as blocking code merge) for better counts quality while the others are accidental. This change unblocks perf-critical optimizations that do not affect counts quality. They include:

1. IR InstCombine, sinking load operation to shorten lifetimes.
2. MIR LiveRangeShrink, similar to #1
3. MIR TwoAddressInstructionPass, i.e, opeq transform
4. MIR function argument copy elision
5. IR stack protection. (though not perf-critical but nice to have).

Reviewed By: wmi

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

3 years ago[libc++] Use builtins in more math.h functions.
Ilya Tokar [Wed, 10 Feb 2021 18:05:19 +0000 (13:05 -0500)]
[libc++] Use builtins in more math.h functions.

Not using builtins doesn't always imply worse code,
but for e. g. isinf, this is 30%+ faster.

Before:
name        time/op
BM_isinf     2.14ns ± 2%

After:
name        time/op
BM_isinf     1.33ns ± 2%

Reviewed By: #libc, ldionne

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

3 years agoAdd missing nullptr check.
Adrian Prantl [Wed, 10 Feb 2021 20:14:45 +0000 (12:14 -0800)]
Add missing nullptr check.

salvageDebugInfoImpl() may fail and return a nullptr.

3 years ago[SCEV] Add a missing AssumptionCache parameter
Philip Reames [Wed, 10 Feb 2021 20:06:46 +0000 (12:06 -0800)]
[SCEV] Add a missing AssumptionCache parameter

The AssumptionCache mechanism is used to feed assumes into known bits computations.  Most places in SCEV passed it in, but one place appears to have been missed.

Spotted via inspection, don't have a test case which actually exercises this, but it seemed like an obvious fixit.

3 years ago[InstCombine] fold lshr(mul X, SplatC), C2
Sanjay Patel [Wed, 10 Feb 2021 19:57:31 +0000 (14:57 -0500)]
[InstCombine] fold lshr(mul X, SplatC), C2

This is a special-case multiply that replicates bits of
the source operand. We need this fold to avoid regression
if we make canonicalization to `mul` more aggressive for
shl+or patterns.

I did not see a way to make Alive generalize the bit width
condition for even-number-of-bits only, but an example of
the proof is:
  Name: i32
  Pre: isPowerOf2(C1 - 1) && log2(C1) == C2 && (C2 * 2 == width(C2))
  %m = mul nuw i32 %x, C1
  %t = lshr i32 %m, C2
  =>
  %t = and i32 %x, C1 - 2

  Name: i14
  %m = mul nuw i14 %x, 129
  %t = lshr i14 %m, 7
  =>
  %t = and i14 %x, 127

https://rise4fun.com/Alive/e52

3 years ago[InstCombine] add tests for lshr with mul; NFC
Sanjay Patel [Wed, 10 Feb 2021 19:40:08 +0000 (14:40 -0500)]
[InstCombine] add tests for lshr with mul; NFC

3 years agoFix StridedMemRefType operator[] SFINAE to allow correctly selecting the `int64_t...
Mehdi Amini [Wed, 10 Feb 2021 20:01:20 +0000 (20:01 +0000)]
Fix StridedMemRefType operator[] SFINAE to allow correctly selecting the `int64_t` overload for non-container operands

3 years ago[lldb/test] Move and improve TestPlatformProcessConnect.py
Pavel Labath [Wed, 10 Feb 2021 19:45:30 +0000 (20:45 +0100)]
[lldb/test] Move and improve TestPlatformProcessConnect.py

Although it is located under tools/lldb-server, this test is very
different that other lldb-server tests. The most important distinction
is that it does not test lldb-server directly, but rather interacts with
it through the lldb client. It also tests the relevant client
functionality (the platform connect command, which is even admitted in
the test name). The fact that this test is structured as a lldb-server
test means it cannot access most of the goodies available to the
"normal" lldb tests (the runCmd function, which it reimplements; the
run_break_set_by_symbol utility function; etc.).

This patch makes it a full-fledged lldb this, and rewrites the relevant
bits to make use of the standard features. I also move the test into the
"commands" subtree to better reflect its new status.

3 years ago[OpenMP] Add lower and upper bound in num_teams clause
Nawrin Sultana [Fri, 30 Oct 2020 18:04:25 +0000 (13:04 -0500)]
[OpenMP] Add lower and upper bound in num_teams clause

This patch adds lower-bound and upper-bound to num_teams clause
according to OpenMP 5.1 specification. The initial number of teams
created is implementation defined, but it will be greater than or
equal to lower-bound and less than or equal to upper-bound. If
num_teams clause is not specified, the number of teams created is
implementation defined, but it will be greater or equal to 1.

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

3 years agoChange type constraint of the "index" in "shape.split_at" to Shape_SizeOrIndexType
Jing Pu [Wed, 10 Feb 2021 19:58:05 +0000 (11:58 -0800)]
Change type constraint of the "index" in "shape.split_at" to Shape_SizeOrIndexType

Make the type contraint consistent with other shape dialect operations.

Reviewed By: jpienaar

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

3 years ago[mlir][sparse] sparse tensor storage implementation
Aart Bik [Wed, 10 Feb 2021 00:22:22 +0000 (16:22 -0800)]
[mlir][sparse] sparse tensor storage implementation

This revision connects the generated sparse code with an actual
sparse storage scheme, which can be initialized from a test file.
Lacking a first-class citizen SparseTensor type (with buffer),
the storage is hidden behind an opaque pointer with some "glue"
to bring the pointer back to tensor land. Rather than generating
sparse setup code for each different annotated tensor (viz. the
"pack" methods in TACO), a single "one-size-fits-all" implementation
has been added to the runtime support library.  Many details and
abstractions need to be refined in the future, but this revision
allows full end-to-end integration testing and performance
benchmarking (with on one end, an annotated Lingalg
op and, on the other end, a JIT/AOT executable).

Reviewed By: nicolasvasilache, bixia

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

3 years ago[libcxx] adds concepts `std::invocable` and `std::regular_invocable`
Christopher Di Bella [Mon, 8 Feb 2021 05:08:25 +0000 (05:08 +0000)]
[libcxx] adds concepts `std::invocable` and `std::regular_invocable`

Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

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

3 years ago[libcxx] adds concept std::derived_from
Christopher Di Bella [Thu, 4 Feb 2021 03:41:44 +0000 (03:41 +0000)]
[libcxx] adds concept std::derived_from

Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Reviewed By: ldionne, #libc

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

3 years ago[Polly] Added dedicated test for working -O3 pipeline.
Michael Kruse [Wed, 10 Feb 2021 19:21:27 +0000 (13:21 -0600)]
[Polly] Added dedicated test for working -O3 pipeline.

Test the NewPM as well as the legacy PM.

3 years ago[Polly] Do not use -O3 pipeline for single pass test.
Michael Kruse [Wed, 10 Feb 2021 19:04:58 +0000 (13:04 -0600)]
[Polly] Do not use -O3 pipeline for single pass test.

3 years agoRenovate CMake files in the `llvm-exegesis` tool.
Jameson Nash [Wed, 10 Feb 2021 18:31:42 +0000 (13:31 -0500)]
Renovate CMake files in the `llvm-exegesis` tool.

This attempts to move all tools over to using `add_llvm_library` for
better consistency. After doing this, I noticed it ended up as nearly a
reimplementation of https://reviews.llvm.org/rL342148, which later got
reverted in r342336 (b09a8c9bd9b819741b38071a7ccd95042ef2643a).

With ccache and ninja on a large core machine (40), I haven't run into
build errors, so I'm hopeful it's better now, though it doesn't seem to
be any different / new.

Reviewed By: stephenneuendorffer

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

3 years ago[opt][NewPM] Add a --print-passes flag to print all available passes
Arthur Eubanks [Fri, 5 Feb 2021 03:34:09 +0000 (19:34 -0800)]
[opt][NewPM] Add a --print-passes flag to print all available passes

It seems nicer to list passes given a flag rather than displaying all
passes in opt --help.

This is awkwardly structured because a PassBuilder is required, but
reusing the PassBuilder in runPassPipeline() doesn't work because we
read the input IR before getting to runPassPipeline(). So printing the
list of passes needs to happen before reading the input IR. If we remove
the legacy PM code in main() and move everything from NewPMDriver.cpp
into opt.cpp, we can create the PassBuilder before reading IR and check
if we should print the list of passes and exit. But until then this hack
seems fine.

Compared to the legacy PM, the new PM passes are lacking descriptions.
We'll need to figure out a way to add descriptions if we think this is
important.

Also, this only works for passes specified in PassRegistry.def. If we
want to print other custom registered passes, we'll need a different
mechanism.

Reviewed By: asbirlea

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

3 years ago[RISCV] Remove superfluous semicolon. NFC
Craig Topper [Wed, 10 Feb 2021 19:20:07 +0000 (11:20 -0800)]
[RISCV] Remove superfluous semicolon. NFC

3 years ago[libcxx] adds [concepts.arithmetic]
Christopher Di Bella [Thu, 21 Jan 2021 02:33:04 +0000 (02:33 +0000)]
[libcxx] adds [concepts.arithmetic]

Implements parts of:
    * P0898R3 Standard Library Concepts
    * P1754 Rename concepts to standard_case for C++20, while we still can

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

3 years ago[Thumb2] support `movs pc, lr` alias for `subs pc, lr, #0`/`eret`
Nick Desaulniers [Wed, 10 Feb 2021 18:45:12 +0000 (10:45 -0800)]
[Thumb2] support `movs pc, lr` alias for `subs pc, lr, #0`/`eret`

This is used by the Linux kernel built with CONFIG_THUMB2_KERNEL.

Because different operands are not permitted to `movs`, the diagnostics now provide multiple suggestions along the lines of using a non-pc destination operand or lr source operand.

Forked from D95586.

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed By: DavidSpickett

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

3 years agoAdd convenience C++ helper to manipulate ranked strided memref
Mehdi Amini [Wed, 3 Feb 2021 21:45:00 +0000 (21:45 +0000)]
Add convenience C++ helper to manipulate ranked strided memref

Reland 11f32a41c21 that was reverted in e49967fbd90 after fixing the build.

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

3 years agoSpecify that some flags are legacy PM-specific
Arthur Eubanks [Fri, 5 Feb 2021 03:34:09 +0000 (19:34 -0800)]
Specify that some flags are legacy PM-specific

Reviewed By: asbirlea

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

3 years ago[libc++] Remove c++98 Lit features in the test suite
Louis Dionne [Wed, 10 Feb 2021 18:30:38 +0000 (13:30 -0500)]
[libc++] Remove c++98 Lit features in the test suite

We don't populate a Lit feature named c++98 since 31cbe0f240f.

3 years ago[clang] Add support for attribute 'swift_async_error'
Erik Pilkington [Wed, 10 Feb 2021 16:06:23 +0000 (11:06 -0500)]
[clang] Add support for attribute 'swift_async_error'

This attribute specifies how an error is represented for a swift async method.
rdar://71941280

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

3 years ago[RISCV] Add support for matching .vf forms of fadd/fsub/fmul/fdiv/fma for fixed vectors.
Craig Topper [Wed, 10 Feb 2021 18:15:57 +0000 (10:15 -0800)]
[RISCV] Add support for matching .vf forms of fadd/fsub/fmul/fdiv/fma for fixed vectors.

fma+neg will come in a different patch since I haven't done it for .vv
yet either.

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

3 years ago[CMake] Remove some dead code in llvm_install_library_symlink()
Tom Stellard [Wed, 10 Feb 2021 15:36:49 +0000 (07:36 -0800)]
[CMake] Remove some dead code in llvm_install_library_symlink()

Reviewed By: smeenai

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

3 years agoRevert "Add convenience C++ helper to manipulate ranked strided memref"
Mehdi Amini [Wed, 10 Feb 2021 18:09:38 +0000 (18:09 +0000)]
Revert "Add convenience C++ helper to manipulate ranked strided memref"

This reverts commit 11f32a41c2144aeec80d1dce8cc6908fa91794a3.

The build is broken because this commit conflits with the refactoring of
the DialectRegistry APIs in the context. It'll reland shortly after
fixing the API usage.

3 years ago[RISCV] Add support for selecting vrgather.vx/vi for fixed vector splat shuffles.
Craig Topper [Wed, 10 Feb 2021 17:40:28 +0000 (09:40 -0800)]
[RISCV] Add support for selecting vrgather.vx/vi for fixed vector splat shuffles.

The test cases extract a fixed element from a vector and splat it
into a vector. This gets DAG combined into a splat shuffle.

I've used some very wide vectors in the test to make sure we have
at least a couple tests where the element doesn't fit into the
uimm5 immediate of vrgather.vi so we fall back to vrgather.vx.

Reviewed By: frasercrmck

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

3 years ago[libcxx] adds concept `std::copy_constructible`
Christopher Di Bella [Mon, 8 Feb 2021 03:01:27 +0000 (03:01 +0000)]
[libcxx] adds concept `std::copy_constructible`

Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D96230

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

3 years agoDebugInfo/Symbolize: Retrieve filename from the preceding STT_FILE for .symtab symbol...
Fangrui Song [Wed, 10 Feb 2021 17:47:10 +0000 (09:47 -0800)]
DebugInfo/Symbolize: Retrieve filename from the preceding STT_FILE for .symtab symbolization

The ELF spec says:

> STT_FILE: Conventionally, the symbol's name gives the name of the source file associated with the object file. A file symbol has STB_LOCAL binding, its section index is SHN_ABS, and it precedes the other STB_LOCAL symbols for the file, if it is present.

For a local symbol, the preceding STT_FILE symbol is almost always in the same
file[1]. GNU addr2line uses this heuristic to retrieve the filename associated
with a local symbol (e.g. internal linkage functions in C/C++).

GNU addr2line can assign STT_FILE filename to a non-local symbol, too, but the trick
only works if no regular symbol precede STT_FILE. This patch does not implement this corner case
(not useful for most executables which have more than one files).

In case of filename mismatch between .debug_line & .symtab, arbitrarily make .debug_line win.

[1]: LLD does not synthesize STT_FILE symbols
(https://bugs.llvm.org/show_bug.cgi?id=48023 see also
https://sourceware.org/bugzilla/show_bug.cgi?id=26822).  An assembly file
without `.file` directives can cause mis-attribution. This is an edge case.

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

3 years ago[llvm-cfi-verify] Set UseSymbolTable to false
Fangrui Song [Wed, 10 Feb 2021 17:44:13 +0000 (09:44 -0800)]
[llvm-cfi-verify] Set UseSymbolTable to false

parseSectionContents expects to skip regions not described by DWARF.  With my
pending DebugInfo/Symbolize change, the filename can be recovered and there
will be more IndirectInstructions entries.

3 years agoAdd convenience C++ helper to manipulate ranked strided memref
Mehdi Amini [Wed, 3 Feb 2021 21:45:00 +0000 (21:45 +0000)]
Add convenience C++ helper to manipulate ranked strided memref

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

3 years ago[libcxx] adds concept `std::move_constructible`
Christopher Di Bella [Mon, 8 Feb 2021 02:00:42 +0000 (02:00 +0000)]
[libcxx] adds concept `std::move_constructible`

Implements parts of:
    - P0898R3 Standard Library Concepts
    - P1754 Rename concepts to standard_case for C++20, while we still can

Depends on D77961

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

3 years ago[Polly] Fix -Wunused-lambda-capture
Fangrui Song [Wed, 10 Feb 2021 17:19:05 +0000 (09:19 -0800)]
[Polly] Fix -Wunused-lambda-capture

3 years ago[Polly] Fix -DPOLLY_ENABLE_GPGPU_CODEGEN=off build after 222d380d2f57cc71bb613b5c01ec...
Fangrui Song [Wed, 10 Feb 2021 17:17:13 +0000 (09:17 -0800)]
[Polly] Fix -DPOLLY_ENABLE_GPGPU_CODEGEN=off build after 222d380d2f57cc71bb613b5c01ecf17cd1f61fa2

3 years ago[GWP-ASan] Add back some headers removed by IWYU.
Mitch Phillips [Wed, 10 Feb 2021 16:38:34 +0000 (08:38 -0800)]
[GWP-ASan] Add back some headers removed by IWYU.

These headers are required for Android.

Reviewed By: eugenis

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

3 years ago[mlir][Linalg] Fix pad hoisting.
Nicolas Vasilache [Wed, 10 Feb 2021 15:12:05 +0000 (15:12 +0000)]
[mlir][Linalg] Fix pad hoisting.

This revision fixes the indexing logic into the packed tensor that result from hoisting padding. Previously, the index was incorrectly set to the loop induction variable when in fact we need to compute the iteration count (i.e. `(iv - lb).ceilDiv(step)`).

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

3 years agoRevert "Revert "[clang][driver] Only warn once about invalid library values""
Tom Weaver [Wed, 10 Feb 2021 16:40:07 +0000 (16:40 +0000)]
Revert "Revert "[clang][driver] Only warn once about invalid library values""

This reverts commit a743702a1f4880e4492196b1ce9a9a63e0b4c075.

Test was fixed in c6a1b16db7dc7a0af8951b39f29ddbe639a98a3b

3 years agoRevert "[clang][driver] Only warn once about invalid library values"
Tom Weaver [Wed, 10 Feb 2021 16:37:34 +0000 (16:37 +0000)]
Revert "[clang][driver] Only warn once about invalid library values"

This reverts commit a6439b52088b1d58d8e7aa9891c9011648710593.

Caused buildbot failure http://lab.llvm.org:8014/#/builders/125/builds/125

3 years ago[libc++] Fix copy-paste mistake in __threading_support
Colin Finck [Wed, 10 Feb 2021 16:00:04 +0000 (11:00 -0500)]
[libc++] Fix copy-paste mistake in __threading_support

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

3 years agoReland [DWARF] Location-less inlined variables should not have DW_TAG_variable
Jeremy Morse [Wed, 10 Feb 2021 15:40:47 +0000 (15:40 +0000)]
Reland [DWARF] Location-less inlined variables should not have DW_TAG_variable

Originally landed in ddc2f1e3fb4 and reverted in d32deaab4d because of
a Generic test objecting. That was fixed up in 013613964fd9. Original
landing commit message follows:

[DWARF] Location-less inlined variables should not have DW_TAG_variable

Discussed in this thread:

  https://lists.llvm.org/pipermail/llvm-dev/2021-January/148139.html

DwarfDebug::collectEntityInfo accidentally distinguishes between variable
locations that never have a location specified, and variable locations that
have an empty location specified. The latter leads to the creation of an
empty variable referring to the abstract origin.

Fix this by seeking a non-empty location before producing a concrete
entity, to guarantee a DW_AT_location will be produced. Other loops in
collectEntityInfo and endFunctionImpl take care of examining the
retainedNodes collection and ensuring optimised-out variables are created.

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

3 years agoAvoid conflicts between debug-info and pseudo-probe profiling
Paul Robinson [Tue, 9 Feb 2021 22:41:52 +0000 (14:41 -0800)]
Avoid conflicts between debug-info and pseudo-probe profiling

After D93264, using both -fdebug-info-for-profiling and
-fpseudo-probe-for-profiling will cause the compiler to crash.
Diagnose these conflicting options in the driver.

Also, the existing CodeGen test was using the driver when it should be
running cc1.

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

3 years ago[AMDGPU] Add another test case for combining DS reads
Jay Foad [Wed, 10 Feb 2021 14:37:29 +0000 (14:37 +0000)]
[AMDGPU] Add another test case for combining DS reads

3 years ago[AMDGPU] Fix comments in SILoadStoreOptimizer::offsetsCanBeCombined
Jay Foad [Tue, 9 Feb 2021 17:19:47 +0000 (17:19 +0000)]
[AMDGPU] Fix comments in SILoadStoreOptimizer::offsetsCanBeCombined

3 years agoclang: try to fix Driver/undefined-libs.cpp on non-linux
Nico Weber [Wed, 10 Feb 2021 14:45:04 +0000 (09:45 -0500)]
clang: try to fix Driver/undefined-libs.cpp on non-linux

3 years ago[DAGCombiner] Don't fold FCOPYSIGN vector sign operand casts
Luís Marques [Wed, 10 Feb 2021 14:24:15 +0000 (14:24 +0000)]
[DAGCombiner] Don't fold FCOPYSIGN vector sign operand casts

Avoid doing the following combine for vector types:

```
copysign(x, fp_extend(y)) -> copysign(x, y)
copysign(x, fp_round(y)) -> copysign(x, y)
```

That combine seemed to impede the selection of vector instruction and cause
a mess in some circumstances.

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

3 years ago[mlir][Linalg] Add a vectorization pattern for linalg::PadTensorOp
Nicolas Vasilache [Wed, 10 Feb 2021 13:15:23 +0000 (13:15 +0000)]
[mlir][Linalg] Add a vectorization pattern for linalg::PadTensorOp

The new pattern is exercised from the TestLinalgTransforms pass.

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

3 years ago[clang][NFC] Fix undefined-libs tests
Timm Bäder [Wed, 10 Feb 2021 13:34:04 +0000 (14:34 +0100)]
[clang][NFC] Fix undefined-libs tests

Not all platforms accept -stdlib or -rtlib. Instead of complaining about
the wrong argument to these options, clang complains about the option
itself being present.

Pass an appropriate -target to the clang invocations.

3 years ago[gn build] (manually) port e89fcbfad6a3
Nico Weber [Wed, 10 Feb 2021 13:59:07 +0000 (08:59 -0500)]
[gn build] (manually) port e89fcbfad6a3

3 years ago[Sparc] Support relocatable expressions in the assembler
Daniel Cederman [Wed, 10 Feb 2021 13:50:38 +0000 (14:50 +0100)]
[Sparc] Support relocatable expressions in the assembler

Allow assembler expressions to start with an identifier. This allows for expressions such as
```
b symbol + 4
```
and
```
mov symEnd - symStart, %g1
```

The patch builds upon https://reviews.llvm.org/D47136.

Reviewed By: joerg

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

3 years ago[flang][driver] Add missing dependency in unit tests (nfc)
Andrzej Warzynski [Wed, 10 Feb 2021 12:10:07 +0000 (12:10 +0000)]
[flang][driver] Add missing dependency in unit tests (nfc)

The following patch revealed a missing dependency in the CMake script
for Flang driver unit tests:
  * https://reviews.llvm.org/D96032
The following buildbots are failing ("BUILD_SHARED_LIBS" is set to ON):
  * http://lab.llvm.org:8011/#/builders/134/builds/1840
  * http://lab.llvm.org:8011/#/builders/66/builds/1785
  * http://lab.llvm.org:8011/#/builders/33/builds/2436

This patch adds the missing dependency.

From what I can see, FortranSemantics and FortranParser are only
indirect dependencies of FlangFrontendTests and IIUC shouldn't be
required here. This is something that we should revisit at some point.
In this patch I focus on fixing the build.

3 years ago[clang][cli] Declare local variable for marshalling macros
Jan Svoboda [Wed, 10 Feb 2021 12:54:08 +0000 (13:54 +0100)]
[clang][cli] Declare local variable for marshalling macros

Some Windows build bots report `FileSystemOpts` and `MigratorOpts` as undeclared. This fix renames the parameter and declares a local variable with the original name.

3 years ago[clang][cli] Extract FileSystem and Migrator options parsing/generation
Jan Svoboda [Wed, 10 Feb 2021 11:47:06 +0000 (12:47 +0100)]
[clang][cli] Extract FileSystem and Migrator options parsing/generation

This patch splits out the last two option groups (`Filesystem` and `Migrator`) into their own `Parse`/`Generate` functions.

This effectively removes the need for `parseSimpleArgs` and marshalling block in `CompilerInvocation::generateCC1CommandLine`.

The two new `Parse`/`Generate` functions are not part of the round-trip, because they contain no custom code and the very next patch starts round-tripping the whole `CompilerInvocation`.

Reviewed By: dexonsmith

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

3 years ago[clang][cli] Generate and round-trip Diagnostic options
Jan Svoboda [Wed, 10 Feb 2021 11:24:19 +0000 (12:24 +0100)]
[clang][cli] Generate and round-trip Diagnostic options

This patch implements generation of remaining diagnostic options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

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

3 years ago[clang][cli] Generate and round-trip DependencyOutput options
Jan Svoboda [Wed, 10 Feb 2021 10:47:33 +0000 (11:47 +0100)]
[clang][cli] Generate and round-trip DependencyOutput options

This patch implements generation of remaining dependency output options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

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

3 years ago[mlir] avoid exposing mutable DialectRegistry from MLIRContext
Alex Zinenko [Wed, 10 Feb 2021 09:11:50 +0000 (10:11 +0100)]
[mlir] avoid exposing mutable DialectRegistry from MLIRContext

MLIRContext allows its users to access directly to the DialectRegistry it
contains. While sometimes useful for registering additional dialects on an
already existing context, this breaks the encapsulation by essentially giving
raw accesses to a part of the context's internal state. Remove this mutable
access and instead provide a method to append a given DialectRegistry to the
one already contained in the context. Also provide a shortcut mechanism to
construct a context from an already existing registry, which seems to be a
common use case in the wild. Keep read-only access to the registry contained in
the context in case it needs to be copied or used for constructing another
context.

With this change, DialectRegistry is no longer concerned with loading the
dialects and deciding whether to invoke delayed interface registration. Loading
is concentrated in the MLIRContext, and the functionality of the registry
better reflects its name.

Depends On D96137

Reviewed By: mehdi_amini

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

3 years ago[mlir] enable delayed registration of dialect interfaces
Alex Zinenko [Wed, 10 Feb 2021 09:11:40 +0000 (10:11 +0100)]
[mlir] enable delayed registration of dialect interfaces

This introduces a mechanism to register interfaces for a dialect without making
the dialect itself depend on the interface. The registration request happens on
DialectRegistry and, if the dialect has not been loaded yet, the actual
registration is delayed until the dialect is loaded. It requires
DialectRegistry to become aware of the context that contains it and the context
to expose methods for querying if a dialect is loaded.

This mechanism will enable a simple extension mechanism for dialects that can
have interfaces defined outside of the dialect code. It is particularly helpful
for, e.g., translation to LLVM IR where we don't want the dialect itself to
depend on LLVM IR libraries.

Reviewed By: mehdi_amini

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

3 years ago[RISCV] Add support for selecting vid.v from build_vector
Fraser Cormack [Tue, 9 Feb 2021 12:09:10 +0000 (12:09 +0000)]
[RISCV] Add support for selecting vid.v from build_vector

This patch optimizes a build_vector "index sequence" and lowers it to
the existing custom RISCVISD::VID node. This pattern is common in
autovectorized code.

The custom node was updated to allow it to be used by both scalable and
fixed-length vectors, thus avoiding pattern duplication.

Reviewed By: craig.topper

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

3 years agoReapply [DebugInfo] Re-engineer a test to be stricter, add XFails
Jeremy Morse [Wed, 10 Feb 2021 10:27:00 +0000 (10:27 +0000)]
Reapply [DebugInfo] Re-engineer a test to be stricter, add XFails

Was e05c10380ce, reverted in d7d0b17de77, see D95617 for details. I've
added "arm64" to the XFail list (as well as aarch64), will follow up on
the mailing list about whether there's anything else to be done.

3 years ago[clang][cli] Generate and round-trip Target options
Jan Svoboda [Wed, 10 Feb 2021 10:33:24 +0000 (11:33 +0100)]
[clang][cli] Generate and round-trip Target options

This patch implements generation of remaining target options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

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

3 years ago[clang][cli] Generate and round-trip PreprocessorOutput options
Jan Svoboda [Wed, 10 Feb 2021 10:16:10 +0000 (11:16 +0100)]
[clang][cli] Generate and round-trip PreprocessorOutput options

This patch implements generation of remaining preprocessor output options and tests it by performing parse-generate-parse round trip.

Reviewed By: dexonsmith

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

3 years agoRevert rGe1172959226689a "[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - merge...
Simon Pilgrim [Wed, 10 Feb 2021 10:26:30 +0000 (10:26 +0000)]
Revert rGe1172959226689a "[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - merge VPERMILPD ops with different low/high masks."

Revert this while I investigate a downstream breakage report.

3 years ago[flang][driver] Add support for -fopenmp and -fopenacc
Faris Rehman [Wed, 10 Feb 2021 09:24:45 +0000 (09:24 +0000)]
[flang][driver] Add support for -fopenmp and -fopenacc

Add support for the following options:
* -fopenmp
* -fopenacc

Update OpenMP and OpenACC semantics tests to use the new driver if it is built, otherwise use f18.
OpenMP tests that include `use omp_lib` or run `test_symbols.sh` have not been updated as they require options `-intrinsic-module-directory` and `-funparse-with-symbols` which are currently not implemented in the new driver.
Similarly OpenACC tests that run `test_symbols.sh` have not been updated.

This patch also moves semanticsContext to CompilerInvocation and creates it in CompilerInvocation#setSemanticsOpts so that the semantics context can use Fortran::parser::Options#features.

Summary of changes:
- Move semanticsContext to CompilerInvocation.h
- Update OpenMP and OpenACC semantics tests that do not rely on `-intrinsic-module-directory` and `-funparse-with-symbols` to use %flang

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

3 years ago[OpenCL] Add cl_khr_subgroup_clustered_reduce to TableGen BIFs
Sven van Haastregt [Wed, 10 Feb 2021 09:44:52 +0000 (09:44 +0000)]
[OpenCL] Add cl_khr_subgroup_clustered_reduce to TableGen BIFs

Add the builtin functions brought by the
cl_khr_subgroup_clustered_reduce extension to
`-fdeclare-opencl-builtins`.

3 years ago[OpenCL] Add cl_khr_subgroup_non_uniform_arithmetic to TableGen BIFs
Sven van Haastregt [Wed, 10 Feb 2021 09:44:39 +0000 (09:44 +0000)]
[OpenCL] Add cl_khr_subgroup_non_uniform_arithmetic to TableGen BIFs

Add the builtin functions brought by the
cl_khr_subgroup_non_uniform_arithmetic extension to
`-fdeclare-opencl-builtins`.

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

3 years ago[LoopVectorize] NFC: Change computeFeasibleMaxVF to operate on ElementCount.
Sander de Smalen [Wed, 10 Feb 2021 08:52:10 +0000 (08:52 +0000)]
[LoopVectorize] NFC: Change computeFeasibleMaxVF to operate on ElementCount.

This patch is NFC and changes occurrences of `unsigned MaxVectorSize`
to work on type ElementCount.

This patch is a preparatory patch with the ultimate goal of making
`computeMaxVF()` return both a max fixed VF and a max scalable VF,
so that `selectVectorizationFactor()` can pick the most cost-effective
vectorization factor.

Reviewed By: kmclaughlin

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

3 years ago[ValueTypes] Add MVT for nxv1bf16.
Sander de Smalen [Wed, 10 Feb 2021 08:27:03 +0000 (08:27 +0000)]
[ValueTypes] Add MVT for nxv1bf16.

Reviewed By: frasercrmck

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

3 years ago[WebAssembly] Enable loop unrolling
Sam Parker [Wed, 10 Feb 2021 08:22:45 +0000 (08:22 +0000)]
[WebAssembly] Enable loop unrolling

Enable partial and runtime unrolling with a threshold of 30, which
was derived from a large number of kernels running on node and
wasmtime for amd64 and aarch64.

Unrolling is enabled by default at -O2 and -O3 and is disabled at
-Oz and -Os. Compiling with -Os is recommended if the wasm binary
size is the most important factor.

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

3 years ago[AArch64][GlobalISel] Fold selects fed by G_PTR_ADD
Jessica Paquette [Wed, 10 Feb 2021 02:04:44 +0000 (18:04 -0800)]
[AArch64][GlobalISel] Fold selects fed by G_PTR_ADD

Similar to the case for G_ADD.

There was a function in CTMark/pairlocalalign which was missing this case,
causing GlobalISel to emit a add + csel when a csinc is all that is necessary.

https://godbolt.org/z/ax69E9

Minor code size improvements on CTMark at -Os.

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

3 years agoRevert "[analyzer] RetainCountChecker: Add a suppression for OSSymbols."
Artem Dergachev [Wed, 10 Feb 2021 07:21:20 +0000 (23:21 -0800)]
Revert "[analyzer] RetainCountChecker: Add a suppression for OSSymbols."

This reverts commit 3500cc8d891bb3825bb3275affe6db8b12f2f695.

This old commit was made over a completely false premise. OSSymbols
aren't different from other OSObjects and we shouldn't treat them
differently for the purposes of static analysis.

3 years ago[mlir][shape] Generalize broadcast to a variadic number of shapes
Tres Popp [Mon, 1 Feb 2021 08:49:54 +0000 (09:49 +0100)]
[mlir][shape] Generalize broadcast to a variadic number of shapes

Previously broadcast was a binary op. Now it can support more inputs.
This has been changed in such a way that for now, this is an NFC for
all broadcast operations that were previously legal.

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

3 years ago[SelectionDAG] Use range-based for loops (NFC)
Kazu Hirata [Wed, 10 Feb 2021 06:14:30 +0000 (22:14 -0800)]
[SelectionDAG] Use range-based for loops (NFC)