platform/upstream/llvm.git
3 years ago[mlir] factor out ConvertToLLVMPattern
Alex Zinenko [Wed, 7 Jul 2021 09:45:27 +0000 (11:45 +0200)]
[mlir] factor out ConvertToLLVMPattern

This class and classes that extend it are general utilities for any dialect
that is being converted into the LLVM dialect. They are in no way specific to
Standard-to-LLVM conversion and should not make their users depend on it.

Reviewed By: nicolasvasilache

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

3 years ago[AMDGPU] Fix typo
Sebastian Neubauer [Thu, 8 Jul 2021 08:07:33 +0000 (10:07 +0200)]
[AMDGPU] Fix typo

3 years ago[lld/mac] Fix warning about unused variable [NFC]
Mikael Holmen [Thu, 8 Jul 2021 07:46:30 +0000 (09:46 +0200)]
[lld/mac] Fix warning about unused variable [NFC]

Change "dyn_cast" to "isa" to get rid of the unused
variable "bitcodeFile".

gcc warned with

lld/MachO/Driver.cpp:531:17: warning: unused variable 'bitcodeFile' [-Wunused-variable]
531 |       if (auto *bitcodeFile = dyn_cast<BitcodeFile>(file)) {
    |                 ^~~~~~~~~~~

3 years ago[mlir][linalg] Tighter StructuredOp Verification.
Tobias Gysi [Thu, 8 Jul 2021 06:23:55 +0000 (06:23 +0000)]
[mlir][linalg] Tighter StructuredOp Verification.

Verify the number of results matches exactly the number of output tensors. Simplify the FillOp verification since part of it got redundant.

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

3 years ago[ORC] Introduce ExecutorAddress type, fix broken LLDB bot.
Lang Hames [Thu, 8 Jul 2021 06:29:39 +0000 (16:29 +1000)]
[ORC] Introduce ExecutorAddress type, fix broken LLDB bot.

ExecutorAddressRange depended on JITTargetAddress, but JITTargetAddress is
defined in ExecutionEngine, which OrcShared should not depend on.

This seems like as good a time as any to introduce a new ExecutorAddress type
to eventually replace JITTargetAddress. For now it's just another uint64_t
alias, but it will soon be changed to a class type to provide greater type
safety.

3 years ago[ORC] Improve computeLocalDeps / computeNamedSymbolDependencies performance.
Lang Hames [Thu, 8 Jul 2021 05:29:47 +0000 (15:29 +1000)]
[ORC] Improve computeLocalDeps / computeNamedSymbolDependencies performance.

The computeNamedSymbolDependencies and computeLocalDeps methods on
ObjectLinkingLayerJITLinkContext are responsible for computing, for each symbol
in the current MaterializationResponsibility, the set of non-locally-scoped
symbols that are depended on. To calculate this we have to consider the effect
of chains of dependence through locally scoped symbols in the LinkGraph. E.g.

        .text
        .globl  foo
foo:
        callq   bar                    ## foo depneds on external 'bar'
        movq    Ltmp1(%rip), %rcx      ## foo depends on locally scoped 'Ltmp1'
        addl    (%rcx), %eax
        retq

        .data
Ltmp1:
        .quad   x                      ## Ltmp1 depends on external 'x'

In this example symbol 'foo' depends directly on 'bar', and indirectly on 'x'
via 'Ltmp1', which is locally scoped.

Performance of the existing implementations appears to have been mediocre:
Based on flame graphs posted by @drmeister (in #jit on the LLVM discord server)
the computeLocalDeps function was taking up a substantial amount of time when
starting up Clasp (https://github.com/clasp-developers/clasp).

This commit attempts to address the performance problems in three ways:

1. Using jitlink::Blocks instead of jitlink::Symbols as the nodes of the
dependencies-introduced-by-locally-scoped-symbols graph.

Using either Blocks or Symbols as nodes provides the same information, but since
there may be more than one locally scoped symbol per block the block-based
version of the dependence graph should always be a subgraph of the Symbol-based
version, and so faster to operate on.

2. Improved worklist management.

The older version of computeLocalDeps used a fixed worklist containing all
nodes, and iterated over this list propagating dependencies until no further
changes were required. The worklist was not sorted into a useful order before
the loop started.

The new version uses a variable work-stack, visiting nodes in DFS order and
only adding nodes when there is meaningful work to do on them.

Compared to the old version the new version avoids revisiting nodes which
haven't changed, and I suspect it converges more quickly (due to the DFS
ordering).

3. Laziness and caching.

Mappings of...

jitlink::Symbol* -> Interned Name (as SymbolStringPtr)
jitlink::Block* -> Immediate dependencies (as SymbolNameSet)
jitlink::Block* -> Transitive dependencies (as SymbolNameSet)

are all built lazily and cached while running computeNamedSymbolDependencies.

According to @drmeister these changes reduced Clasp startup time in his test
setup (averaged over a handful of starts) from 4.8 to 2.8 seconds (with
ORC/JITLink linking ~11,000 object files in that time), which seems like
enough to justify switching to the new algorithm in the absence of any other
perf numbers.

3 years ago[WebAssembly][lld] Fix segfault on .bss sections in mapfile
Thomas Lively [Thu, 8 Jul 2021 06:31:48 +0000 (23:31 -0700)]
[WebAssembly][lld] Fix segfault on .bss sections in mapfile

When memory is declared in the Wasm module, we rely on the implicit zero
initialization behavior and do not explicitly output .bss sections. The means
that they do not have associated `outputSec` entries, which was causing
segfaults in the mapfile support. Fix the issue by guarding against null
`outputSec` and falling back to using a zero offset.

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

3 years ago[WebAssembly] Optimize out shift masks
Thomas Lively [Thu, 8 Jul 2021 06:14:31 +0000 (23:14 -0700)]
[WebAssembly] Optimize out shift masks

WebAssembly's shift instructions implicitly masks the shift count, so optimize
out redundant explicit masks of the shift count. For vector shifts, this
currently only works if the mask is applied before splatting the shift count,
but this should be addressed in a future commit. Resolves PR49655.

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

3 years ago[ORC] Replace MachOJITDylibInitializers::SectionExtent with ExecutorAddressRange
Lang Hames [Thu, 8 Jul 2021 04:10:15 +0000 (14:10 +1000)]
[ORC] Replace MachOJITDylibInitializers::SectionExtent with ExecutorAddressRange

MachOJITDylibInitializers::SectionExtent represented the address range of a
section as an (address, size) pair. The new ExecutorAddressRange type
generalizes this to an address range (for any object, not necessarily a section)
represented as a (start-address, end-address) pair.

The aim is to express more of ORC (and the ORC runtime) in terms of simple types
that can be serialized/deserialized via SPS. This will simplify SPS-based RPC
involving arguments/return-values of these types.

3 years ago[ORC] Fix file comments.
Lang Hames [Wed, 7 Jul 2021 11:16:06 +0000 (21:16 +1000)]
[ORC] Fix file comments.

3 years agoRevert "[MCA] [AMDGPU] Adding an implementation to AMDGPUCustomBehaviour for handling...
Patrick Holland [Thu, 8 Jul 2021 03:48:42 +0000 (20:48 -0700)]
Revert "[MCA] [AMDGPU] Adding an implementation to AMDGPUCustomBehaviour for handling s_waitcnt instructions."

Build failures when building with shared libraries. Reverting until I can fix.

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

3 years ago[PowerPC] Fix i64 to vector lowering on big endian
Qiu Chaofan [Thu, 8 Jul 2021 03:05:09 +0000 (11:05 +0800)]
[PowerPC] Fix i64 to vector lowering on big endian

Lowering for scalar to vector would skip if current subtarget is big
endian and the scalar is larger or equal than 64 bits. However there's
some issue in implementation that SToVRHS may refer to SToVLHS's scalar
size if SToVLHS is present, which leads to some crash.o

Reviewed By: nemanjai, shchenz

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

3 years ago[AIX] Don't pass no-integrated-as by default
Jinsong Ji [Thu, 8 Jul 2021 02:24:48 +0000 (02:24 +0000)]
[AIX] Don't pass no-integrated-as by default

D105314 added the abibility choose to use AsmParser for parsing inline
asm. -no-intergrated-as will override this default if specified
explicitly.

If toolchain choose to use MCAsmParser for inline asm, don't pass
the option to disable integrated-as explictly unless set by user.

Reviewed By: #powerpc, shchenz

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

3 years ago[gn build] (manually) port ef16c8eaa5cd5679759 (MCACustomBehaviorAMDGPU)
Nico Weber [Thu, 8 Jul 2021 01:59:07 +0000 (21:59 -0400)]
[gn build] (manually) port ef16c8eaa5cd5679759 (MCACustomBehaviorAMDGPU)

3 years ago[Bazel] Fixes for b5d847b1b95750d0af40cfc8c71a8fec50bb8613 and 6412a13539ab2914eed8e1...
Jordan Rupprecht [Wed, 7 Jul 2021 23:50:23 +0000 (16:50 -0700)]
[Bazel] Fixes for b5d847b1b95750d0af40cfc8c71a8fec50bb8613 and 6412a13539ab2914eed8e1df83c399b9a16e3408

3 years ago[gn build] (semi-manually) port 966386514bec
Nico Weber [Wed, 7 Jul 2021 23:27:19 +0000 (19:27 -0400)]
[gn build] (semi-manually) port 966386514bec

3 years ago[AMDGPU] Disable garbage collection passes
Stanislav Mekhanoshin [Wed, 7 Jul 2021 21:25:24 +0000 (14:25 -0700)]
[AMDGPU] Disable garbage collection passes

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

3 years ago[compiler-rt][Fuchsia] Disable interceptors while enabling new/delete replacements
Leonard Chan [Wed, 2 Jun 2021 18:33:49 +0000 (11:33 -0700)]
[compiler-rt][Fuchsia] Disable interceptors while enabling new/delete replacements

This disables use of hwasan interceptors which we do not use on Fuchsia. This
explicitly sets the macro for defining the hwasan versions of new/delete.

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

3 years ago[clang] disable P2266 simpler implicit moves under -fms-compatibility
Matheus Izvekov [Wed, 7 Jul 2021 00:22:45 +0000 (02:22 +0200)]
[clang] disable P2266 simpler implicit moves under -fms-compatibility

The Microsoft STL currently has some issues with P2266.
We disable it for now in that mode, but we might come back later with a
more targetted approach.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: aaron.ballman

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

3 years ago[compiler-rt][hwasan] Setup hwasan thread handling on Fuchsia
Leonard Chan [Fri, 11 Jun 2021 17:32:04 +0000 (10:32 -0700)]
[compiler-rt][hwasan] Setup hwasan thread handling on Fuchsia

This patch splits up hwasan thread creation between `__sanitizer_before_thread_create_hook`,
`__sanitizer_thread_create_hook`, and `__sanitizer_thread_start_hook`.
The linux implementation creates the hwasan thread object inside the
new thread. On Fuchsia, we know the stack bounds before thread creation,
so we can initialize part of the thread object in `__sanitizer_before_thread_create_hook`,
then initialize the stack ring buffer in `__sanitizer_thread_start_hook`
once we enter the thread.

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

3 years ago[llvm-nm][test] Fix just-symbols.test
Fangrui Song [Wed, 7 Jul 2021 22:04:18 +0000 (15:04 -0700)]
[llvm-nm][test] Fix just-symbols.test

3 years ago[OpaquePtr] Use ArgListEntry::IndirectType for lowering ABI attributes
Arthur Eubanks [Wed, 7 Jul 2021 21:50:30 +0000 (14:50 -0700)]
[OpaquePtr] Use ArgListEntry::IndirectType for lowering ABI attributes

Consolidate PreallocatedType and ByValType into IndirectType, and use that for inalloca.

3 years ago[PowerPC] Add P7 RUN line for load and splat test
Jinsong Ji [Wed, 7 Jul 2021 21:35:56 +0000 (21:35 +0000)]
[PowerPC] Add P7 RUN line for load and splat test

3 years ago[OpaquePtr] Remove checking pointee type for byval/preallocated type
Arthur Eubanks [Wed, 7 Jul 2021 21:28:41 +0000 (14:28 -0700)]
[OpaquePtr] Remove checking pointee type for byval/preallocated type

These currently always require a type parameter. The bitcode reader
already upgrades old bitcode without the type parameter to use the
pointee type.

In cases where the caller does not have byval but the callee does, we
need to follow CallBase::paramHasAttr() and also look at the callee for
the byval type so that CallBase::isByValArgument() and
CallBase::getParamByValType() are in sync. Do the same for preallocated.

While we're here add a corresponding version for inalloca since we'll
need it soon.

Reviewed By: nikic

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

3 years agoutils: add a revert checker
George Burgess IV [Wed, 7 Jul 2021 18:00:27 +0000 (11:00 -0700)]
utils: add a revert checker

Chrome OS and Android have found it useful to have an automated revert
checker. It was requested to upstream it, since other folks in the LLVM
community may also find value in it.

The tests depend on having a full (non-shallow) checkout of LLVM. This
seems reasonable to me, since:

- the tests should only be run if the user is developing on this script
- it's kind of hard to develop on this script without local git history
  :)

If people really want, the tests' dependency on LLVM's history can be
removed. It's mostly just effort/complexity that doesn't seem necessary.

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

3 years ago[MCA] [AMDGPU] Adding an implementation to AMDGPUCustomBehaviour for handling s_waitc...
Patrick Holland [Sat, 19 Jun 2021 00:33:19 +0000 (17:33 -0700)]
[MCA] [AMDGPU] Adding an implementation to AMDGPUCustomBehaviour for handling s_waitcnt instructions.

This commit also makes some slight changes to the scheduling model for AMDGPU to set the RetireOOO flag for all scheduling classes.

This flag is only used by llvm-mca and allows instructions to retire out of order.

See the differential link below for a deeper explanation of everything.

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

3 years ago[ARM] Add some opaque pointer gather/scatter tests. NFC
David Green [Wed, 7 Jul 2021 21:03:53 +0000 (22:03 +0100)]
[ARM] Add some opaque pointer gather/scatter tests. NFC

They seem to work OK. Some other test cleanups at the same time.

3 years ago[AsmWriter] Simplify type attribute printing (NFC)
Nikita Popov [Wed, 7 Jul 2021 20:46:57 +0000 (22:46 +0200)]
[AsmWriter] Simplify type attribute printing (NFC)

Avoid enumerating all supported type attributes, instead fetch
their name from the attribute kind.

3 years ago[IR] Simplify Attribute::getAsString() (NFC)
Nikita Popov [Wed, 7 Jul 2021 20:41:12 +0000 (22:41 +0200)]
[IR] Simplify Attribute::getAsString() (NFC)

Avoid enumerating all attributes here and instead use
getNameFromAttrKind(), which is based on the tablegen data.

This only leaves us with custom handling for int attributes,
which don't have uniform printing.

3 years ago[llvm-nm] Switch command line parsing from llvm::cl to OptTable
Fangrui Song [Wed, 7 Jul 2021 20:34:33 +0000 (13:34 -0700)]
[llvm-nm] Switch command line parsing from llvm::cl to OptTable

Part of https://lists.llvm.org/pipermail/llvm-dev/2021-July/151622.html
"Binary utilities: switch command line parsing from llvm::cl to OptTable"

Users should generally observe no difference as long as they only use intended
option forms. Behavior changes:

* `-t=d` is removed. Use `-t d` instead.
* `--demangle=0` cannot be used. Omit the option or use `--no-demangle` instead.
* `--help-list` is removed. This is a `cl::` specific option.

Note:

* `-t` diagnostic gets improved.
* This patch avoids cl::opt collision if we decide to support multiplexing for binary utilities
* One-dash long options are still supported.
* The `-s` collision (`-s segment section` for Mach-O) is unfortunate. `-s` means `--print-armap` in GNU nm.
* This patch removes the last `cl::multi_val` use case from the `llvm/lib/Support/CommandLine.cpp` library

`-M` (`--print-armap`), `-U` (`--defined-only`), and `-W` (`--no-weak`)
are now deprecated. They could conflict with future GNU nm options.
(--print-armap has an existing alias -s, so GNU will unlikely add a new one.
--no-weak (not in GNU nm) is rarely used anyway.)

`--just-symbol-name` is now deprecated in favor of
`--format=just-symbols` and `-j`.

Reviewed By: jhenderson

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

3 years ago[IR] Make some pointer element type accesses explicit (NFC)
Nikita Popov [Wed, 7 Jul 2021 19:56:32 +0000 (21:56 +0200)]
[IR] Make some pointer element type accesses explicit (NFC)

Explicitly fetch the pointer element type in various deprecated
methods, so we can hopefully remove support from this from the
base GEP constructor.

3 years agoGlobalISel/AArch64: don't optimize away redundant branches at -O0
Adrian Prantl [Wed, 30 Jun 2021 22:40:45 +0000 (15:40 -0700)]
GlobalISel/AArch64: don't optimize away redundant branches at -O0

This patch prevents GlobalISel from optimizing out redundant branch
instructions when compiling without optimizations.

The motivating example is code like the following common pattern in
Swift, where users expect to be able to set a breakpoint on the early
exit:

public func f(b: Bool) {
  guard b else {
    return // I would like to set a breakpoint here.
  }
  ...
}

The patch modifies two places in GlobalISEL: The first one is in
IRTranslator.cpp where the removal of redundant branches is made
conditional on the optimization level. The second one is in
AArch64InstructionSelector.cpp where an -O0 *only* optimization is
being removed.

Disabling these optimizations increases code size at -O0 by
~8%. However, doing so improves debuggability, and debug builds are
the primary reason why developers compile without optimizations. We
thus concluded that this is the right trade-off.

rdar://79515454

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

3 years ago[AArch64] Simplify sve-breakdown-scalable-vectortype.ll.
Eli Friedman [Wed, 7 Jul 2021 19:27:33 +0000 (12:27 -0700)]
[AArch64] Simplify sve-breakdown-scalable-vectortype.ll.

Fix the calling convention so we don't spill every SVE register.

3 years ago[SCF] Handle lowering of Execute region to Standard CFG
William S. Moses [Wed, 7 Jul 2021 18:27:35 +0000 (14:27 -0400)]
[SCF] Handle lowering of Execute region to Standard CFG

Lower SCF.executeregionop to llvm by essentially inlining the region and replacing the return

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

3 years ago[MLIR] Provide lowering of std switch to llvm switch
William S. Moses [Wed, 7 Jul 2021 19:14:36 +0000 (15:14 -0400)]
[MLIR] Provide lowering of std switch to llvm switch

This patch allows lowering of std switch to llvm switch

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

3 years ago[CodeView] Add missing cases for new enum values
Martin Storsjö [Wed, 7 Jul 2021 19:15:33 +0000 (22:15 +0300)]
[CodeView] Add missing cases for new enum values

This fixes warnings while building llvm-pdbutil after
d20b013b490e0603ba21b5ccff966d7e11025775.

3 years ago[LLD] [COFF] Avoid thread exhaustion on 32-bit Windows host
Jeremy Drake [Wed, 7 Jul 2021 18:45:00 +0000 (21:45 +0300)]
[LLD] [COFF] Avoid thread exhaustion on 32-bit Windows host

LLD on 32-bit Windows would frequently fail on large projects with
an exception "thread constructor failed: Exec format error".  The stack
trace pointed to this usage of std::async, and looking at the
implementation in libc++ it seems using std::async with
std::launch::async results in the immediate creation of a new thread
for every call.  This could result in a potentially unbounded number
of threads, depending on the number of input files.  This seems to
be hitting some limit in 32-bit Windows host.

I took the easy route, and only use threads on 64-bit Windows, not all
Windows as before.  I was thinking a more proper solution might
involve using a thread pool rather than blindly spawning any number
of new threads, but that may have other unforeseen consequences.

Reviewed By: rnk

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

3 years ago[COFF] [CodeView] Add a few new enum values
Martin Storsjö [Tue, 6 Jul 2021 21:21:05 +0000 (00:21 +0300)]
[COFF] [CodeView] Add a few new enum values

These are undocumented, but are visible in the SDK headers since some
versions ago.

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

3 years ago[PowerPC] Disable permuted SCALAR_TO_VECTOR on LE without direct moves
Nemanja Ivanovic [Wed, 7 Jul 2021 18:38:47 +0000 (13:38 -0500)]
[PowerPC] Disable permuted SCALAR_TO_VECTOR on LE without direct moves

There are some patterns involving the permuted scalar to vector node
for which we don't have patterns without direct moves on little endian
subtargets. This causes selection errors. While we can of course add
the missing patterns, any additional effort to make this work is not
useful since there is no support for any CPU that can run in
little endian mode and does not support direct moves.

3 years ago[SCEVExpander] Support opaque pointers
Nikita Popov [Sat, 3 Jul 2021 16:09:19 +0000 (18:09 +0200)]
[SCEVExpander] Support opaque pointers

This adds support for opaque pointers to expandAddToGEP() by always
generating an i8 GEP for opaque pointers. After looking at some other
cases (constexpr GEP folding, SROA GEP generation), I've come around
to the idea that we should use i8 GEPs for opaque pointers, because
the alternative would be to guess a GEP type from surrounding code,
which will not be reliable. Ultimately, i8 GEPs is where we want to
end up anyway, and opaque pointers just make that the natural choice.

There are a couple of other places in SCEVExpander that check pointer
element types, I plan to update those when I run across usable test
coverage that doesn't assert elsewhere.

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

3 years ago[SLP] rename variable to not be misleading; NFC
Sanjay Patel [Wed, 7 Jul 2021 13:33:15 +0000 (09:33 -0400)]
[SLP] rename variable to not be misleading; NFC

The reduction matching was probably only dealing with binops
when it was written, but we have now generalized it to handle
select and intrinsics too, so assert on that too.

3 years ago[mlir] Allow conversion to LLVM for ElementsAttr's with size 0
Sean Silva [Fri, 2 Jul 2021 22:54:46 +0000 (15:54 -0700)]
[mlir] Allow conversion to LLVM for ElementsAttr's with size 0

The code seems to correctly handle the case that this assertion was
guarding.

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

3 years ago[dfsan][NFC] Add Origin Tracking into doc
Jianzhou Zhao [Fri, 2 Jul 2021 22:17:26 +0000 (22:17 +0000)]
[dfsan][NFC] Add Origin Tracking into doc

Reviewed By: morehouse

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

3 years ago[mlir][vector] Refactor Vector Unrolling and remove Tuple ops
thomasraoux [Fri, 2 Jul 2021 22:58:52 +0000 (15:58 -0700)]
[mlir][vector] Refactor Vector Unrolling and remove Tuple ops

Simplify vector unrolling pattern to be more aligned with rest of the
patterns and be closer to vector distribution.
The new implementation uses ExtractStridedSlice/InsertStridedSlice
instead of the Tuple ops. After this change the ops based on Tuple don't
have any more used so they can be removed.

This allows removing signifcant amount of dead code and will allow
extending the unrolling code going forward.

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

3 years agoFix a failing assertion with -Wcast-align
Queen Dela Cruz [Wed, 7 Jul 2021 18:00:31 +0000 (14:00 -0400)]
Fix a failing assertion with -Wcast-align

When there is unknown type in a struct in code compiled with
-Wcast-align, the compiler crashes due to
clang::ASTContext::getASTRecordLayout() failing an assert.

Added check that the RecordDecl is valid before calling
getASTRecordLayout().

3 years ago[lldb/lua] Add scripted watchpoints for Lua
Siger Yang [Sun, 4 Jul 2021 22:38:12 +0000 (19:38 -0300)]
[lldb/lua] Add scripted watchpoints for Lua

Add support for Lua scripted watchpoints, with basic tests.

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

3 years ago[lldb][docs] Force documentation emission of special Python class members
Raphael Isemann [Wed, 7 Jul 2021 17:28:47 +0000 (19:28 +0200)]
[lldb][docs] Force documentation emission of special Python class members

The current LLDB Python docs are missing documentation for all the special
members such as conversion functions (`__int__`) and other special functions
(`__len__`).

The reason for that is that the `automodapi` plugin we're using to generate the
*.rst files simply doesn't emit them. There doesn't seem to be any config option
to enable those in `automodapi` and it's not even clear why they are filtered. I
assume the leading underscore in their names makes them look like private
methods.

This patch just forcibly adds a few selected special members functions to the
list of functions that sphinx should always document.  This will cause sphinx to
warn if a class doesn't have one of those functions but it's better than not
having them documented.

The main motivation here is that since `SBAddress.__int__` is one of the few
functions that is only available in the embedded Python REPL which would be good
to have in the public documentation.

Fixes rdar://64647665

Reviewed By: JDevlieghere

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

3 years ago[libTooling] Add support for implicit `this` to `buildAddressOf`.
Yitzhak Mandelbaum [Wed, 7 Jul 2021 14:26:06 +0000 (14:26 +0000)]
[libTooling] Add support for implicit `this` to `buildAddressOf`.

Changes `buildAddressOf` to return `this` when given an implicit `this` expression.

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

3 years ago[ScalarEvolution] Make sure getMinusSCEV doesn't negate pointers.
Eli Friedman [Wed, 7 Jul 2021 17:27:10 +0000 (10:27 -0700)]
[ScalarEvolution] Make sure getMinusSCEV doesn't negate pointers.

Add a function removePointerBase that returns, essentially, S -
getPointerBase(S).  Use it in getMinusSCEV instead of actually
subtracting pointers.

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

3 years ago[lld-macho][nfc] Rename test file to be more descriptive (rather than referencing...
Vy Nguyen [Wed, 7 Jul 2021 16:36:56 +0000 (12:36 -0400)]
[lld-macho][nfc] Rename test file to be more descriptive (rather than referencing the bug number)

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

3 years ago[lld/mac] Don't crash when dead-stripping removes all unwind info
Nico Weber [Wed, 7 Jul 2021 15:28:27 +0000 (11:28 -0400)]
[lld/mac] Don't crash when dead-stripping removes all unwind info

If the input has compact unwind info but all of it is removed
after dead stripping, we would crash. Now we don't write any
__unwind_info section at all, like ld64.

This is a bit awkward to implement because we only know the final
state of unwind info after UnwindInfoSectionImpl<Ptr>::finalize(),
which is called after sections are added. So add a small amount of
bookkeeping to relocateCompactUnwind() instead (which runs earlier)
so that we can predict what finalize() will do before it runs.

Fixes PR51010.

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

3 years ago[NFC][lldb-vscode] Fix launch test
Walter Erquinigo [Wed, 7 Jul 2021 16:59:41 +0000 (09:59 -0700)]
[NFC][lldb-vscode] Fix launch test

Using br for creating breakpoints fails if there are other commands that
start with br.

3 years agoFix broken libc test
Guillaume Chatelet [Wed, 7 Jul 2021 16:47:49 +0000 (16:47 +0000)]
Fix broken libc test

3 years ago[X86][Atom] Fix vector fp<->int resource/throughputs
Simon Pilgrim [Wed, 7 Jul 2021 14:27:14 +0000 (15:27 +0100)]
[X86][Atom] Fix vector fp<->int resource/throughputs

Match whats documented in the Intel AOM - almost all the conversion instructions requires BOTH ports (apart from the MMX cvtpi2ps/cvtpi2ps instructions which we already override) - this was being incorrectly modelled as EITHER port.

Now that we can use in-order models in llvm-mca, the atom model is a good "worst case scenario" analysis for x86.

3 years ago[lld/mac] Tweak reserve() argument in unwind code
Nico Weber [Wed, 7 Jul 2021 15:44:22 +0000 (11:44 -0400)]
[lld/mac] Tweak reserve() argument in unwind code

addEntriesForFunctionsWithoutUnwindInfo() can add entries to cuVector, so
cuCount can be stale. Use cuVector.size() instead.

No behavior change.

3 years ago[Flang][Docs] Update meeting URL
Johannes Doerfert [Wed, 7 Jul 2021 15:34:17 +0000 (10:34 -0500)]
[Flang][Docs] Update meeting URL

3 years ago[LLDB][GUI] Add initial forms support
Omar Emara [Wed, 7 Jul 2021 15:14:13 +0000 (17:14 +0200)]
[LLDB][GUI] Add initial forms support

This patch adds initial support for forms for the LLDB GUI. The currently
supported form elements are Text fields, Integer fields, Boolean fields, Choices
fields, File fields, Directory fields, and List fields.

A form can be created by subclassing FormDelegate. In the constructor, field
factory methods can be used to add new fields, storing the returned pointer in a
member variable. One or more actions can be added using the AddAction method.
The method takes a function with an interface void(Window &). This function will
be executed whenever the user executes the action.

Example form definition:

```lang=cpp
class TestFormDelegate : public FormDelegate {
public:
  TestFormDelegate() {
    m_text_field = AddTextField("Text", "The big brown fox.");
    m_file_field = AddFileField("File", "/tmp/a");
    m_directory_field = AddDirectoryField("Directory", "/tmp/");
    m_integer_field = AddIntegerField("Number", 5);
    std::vector<std::string> choices;
    choices.push_back(std::string("Choice 1"));
    choices.push_back(std::string("Choice 2"));
    choices.push_back(std::string("Choice 3"));
    choices.push_back(std::string("Choice 4"));
    choices.push_back(std::string("Choice 5"));
    m_choices_field = AddChoicesField("Choices", 3, choices);
    m_bool_field = AddBooleanField("Boolean", true);
    TextFieldDelegate default_field =
        TextFieldDelegate("Text", "The big brown fox.");
    m_text_list_field = AddListField("Text List", default_field);

    AddAction("Submit", [this](Window &window) { Submit(window); });
  }

  void Submit(Window &window) { SetError("An example error."); }

protected:
  TextFieldDelegate *m_text_field;
  FileFieldDelegate *m_file_field;
  DirectoryFieldDelegate *m_directory_field;
  IntegerFieldDelegate *m_integer_field;
  BooleanFieldDelegate *m_bool_field;
  ChoicesFieldDelegate *m_choices_field;
  ListFieldDelegate<TextFieldDelegate> *m_text_list_field;
};
```

Reviewed By: clayborg

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

3 years ago[coro async] Cap the alignment of spilled values (vs. allocas) at the max frame...
Arnold Schwaighofer [Wed, 7 Jul 2021 13:21:08 +0000 (06:21 -0700)]
[coro async] Cap the alignment of spilled values (vs.  allocas) at the max frame alignment

Before this patch we would normally use the ABI alignment which can be
to high for the context alginment.

For spilled values we don't need ABI alignment, since the frame entry's
address is not escaped.

rdar://79664965

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

3 years ago[LIBC] Add an optimized memcmp implementation for AArch64
Andre Vieira [Wed, 7 Jul 2021 14:57:15 +0000 (15:57 +0100)]
[LIBC] Add an optimized memcmp implementation for AArch64

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

3 years ago[SystemZ][z/OS][libcxx] mark aligned allocation tests UNSUPPORTED on z/OS
Daniel McIntosh [Wed, 28 Apr 2021 16:15:42 +0000 (12:15 -0400)]
[SystemZ][z/OS][libcxx] mark aligned allocation tests UNSUPPORTED on z/OS

zOS doesn't support aligned allocation, so these tests are failing.
For more details on aligned allocation in zOS, see
https://reviews.llvm.org/D87611 and https://reviews.llvm.org/D90178

Reviewed By: ldionne, #libc

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

3 years ago[LV] Unconditionally branch from middle to scalar preheader if the scalar loop must...
Philip Reames [Wed, 7 Jul 2021 14:40:36 +0000 (07:40 -0700)]
[LV] Unconditionally branch from middle to scalar preheader if the scalar loop must execute (try 4)

Resubmit after the following changes:

* Fix a latent bug related to unrolling with required epilogue (see e49d65f). I believe this is the cause of the prior PPC buildbot failure.
* Disable non-latch exits for epilogue vectorization to be safe (9ffa90d)
* Split out assert movement (600624a) to reduce churn if this gets reverted again.

Previous commit message (try 3)

Resubmit after fixing test/Transforms/LoopVectorize/ARM/mve-gather-scatter-tailpred.ll

Previous commit message...

This is a resubmit of 3e5ce4 (which was reverted by 7fe41ac).  The original commit caused a PPC build bot failure we never really got to the bottom of.  I can't reproduce the issue, and the bot owner was non-responsive.  In the meantime, we stumbled across an issue which seems possibly related, and worked around a latent bug in 80e8025.  My best guess is that the original patch exposed that latent issue at higher frequency, but it really is just a guess.

Original commit message follows...

If we know that the scalar epilogue is required to run, modify the CFG to end the middle block with an unconditional branch to scalar preheader. This is instead of a conditional branch to either the preheader or the exit block.

The motivation to do this is to support multiple exit blocks. Specifically, the current structure forces us to identify immediate dominators and *which* exit block to branch from in the middle terminator. For the multiple exit case - where we know require scalar will hold - these questions are ill formed.

This is the last change needed to support multiple exit loops, but since the diffs are already large enough, I'm going to land this, and then enable separately. You can think of this as being NFCIish prep work, but the changes are a bit too involved for me to feel comfortable tagging the review that way.

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

3 years ago[AArch64][GlobalISel] Lower vector types for min/max
Irina Dobrescu [Mon, 5 Jul 2021 14:06:20 +0000 (15:06 +0100)]
[AArch64][GlobalISel] Lower vector types for min/max

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

3 years ago[SVE] Fix ShuffleVector cast<FixedVectorType> in truncateToMinimalBitwidths
Dylan Fleming [Wed, 7 Jul 2021 13:28:13 +0000 (14:28 +0100)]
[SVE] Fix ShuffleVector cast<FixedVectorType> in truncateToMinimalBitwidths

Depends on D104239

Reviewed By: sdesmalen

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

3 years ago[Polly][Isl] Use isl::union_set::unite() instead of isl::union_set::add_set(). NFC
patacca [Wed, 7 Jul 2021 14:26:44 +0000 (16:26 +0200)]
[Polly][Isl] Use isl::union_set::unite() instead of isl::union_set::add_set(). NFC

This is part of an effort to reduce the differences between the custom C++ bindings used right now by polly in `lib/External/isl/include/isl/isl-noxceptions.h` and the official isl C++ interface.

Changes made:
 - Use `isl::union_set::unite()` instead of `isl::union_set::add_set()`
 - `isl-noexceptions.h` has been generated by this https://github.com/patacca/isl/commit/390c44982b5cee7eb43f8f7a80e185e6d21466b2

Depends on D104994

Reviewed By: Meinersbur

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

3 years agounittests: Fix library dependency name
Tom Stellard [Wed, 7 Jul 2021 13:56:15 +0000 (06:56 -0700)]
unittests: Fix library dependency name

Corrects the library name of LLVMAsmParser added in
2e4ec3e5d6a3bf7f61bea6898286cba64be7b764.

3 years agounittests: Fix build with LLVM_LINK_LLVM_DYLIB=ON
Tom Stellard [Wed, 7 Jul 2021 02:46:21 +0000 (19:46 -0700)]
unittests: Fix build with LLVM_LINK_LLVM_DYLIB=ON

The build system was linking the PluginsTests unittest against libLLVM.so
and LLVMAsmParser which was causing the test to fail with this error:

LLVM ERROR: inconsistency in registered CommandLine options

We need to add llvm libraries to LLVM_LINK_COMPONENTS so that
they are dropped from the linker arguments when linking with
LLVM_LINK_LLVM_DYLIB=ON

Reviewed By: aeubanks

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

3 years ago[libc++] NFC: Fix incorrect comments in CMake
Louis Dionne [Wed, 7 Jul 2021 13:45:26 +0000 (09:45 -0400)]
[libc++] NFC: Fix incorrect comments in CMake

3 years ago[CostModel] Express cost(urem) as cost(div+mul+sub) when set to Expand.
Sander de Smalen [Wed, 7 Jul 2021 12:19:59 +0000 (13:19 +0100)]
[CostModel] Express cost(urem) as cost(div+mul+sub) when set to Expand.

The Legalizer expands the operations of urem/srem into a div+mul+sub or divrem
when those are legal/custom. This patch changes the cost-model to reflect that
cost.

Since there is no 'divrem' Instruction in LLVM IR, the cost of divrem
is assumed to be the same as div+mul+sub since the three operations will
need to be executed at runtime regardless.

Patch co-authored by David Sherwood (@david-arm)

Reviewed By: RKSimon, paulwalker-arm

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

3 years ago[mlir] Use indices instead of affine maps when composing 2 reshape ops.
Alexander Belyaev [Wed, 7 Jul 2021 13:09:59 +0000 (15:09 +0200)]
[mlir] Use indices instead of affine maps when composing 2 reshape ops.

https://llvm.discourse.group/t/rfc-reshape-ops-restructuring/3310

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

3 years ago[coro async] Move code to proper switch
Arnold Schwaighofer [Tue, 6 Jul 2021 18:26:17 +0000 (11:26 -0700)]
[coro async] Move code to proper switch

While upstreaming patches this code somehow was applied to the wrong switch statement.

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

3 years ago[AIX] Use VSSRC/VSFRC Register classes for f32/f64 callee arguments on P8 and above
Zarko Todorovski [Wed, 7 Jul 2021 12:42:50 +0000 (08:42 -0400)]
[AIX] Use VSSRC/VSFRC Register classes for f32/f64 callee arguments on P8 and above

Adding usage of VSSRC and VSFRC when adding the live in registers on AIX.
This matches the behaviour of the rest of PPC Subtargets.

Reviewed By: nemanjai, #powerpc

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

3 years ago[IndVarSimplify][X86] Regenerate loop-invariant-conditions.ll test checks
Simon Pilgrim [Wed, 7 Jul 2021 12:52:39 +0000 (13:52 +0100)]
[IndVarSimplify][X86] Regenerate loop-invariant-conditions.ll test checks

3 years ago[CostModel][X86] Adjust sext/zext SSE/AVX legalized costs based on llvm-mca reports.
Simon Pilgrim [Wed, 7 Jul 2021 11:55:07 +0000 (12:55 +0100)]
[CostModel][X86] Adjust sext/zext SSE/AVX legalized costs based on llvm-mca reports.

Update costs based on the worst case costs from the script in D103695.

Move to using legalized types wherever possible, which allows us to prune the cost tables.

3 years ago[OPENMP]Remove const firstprivate allocation as a variable in a constant space.
Alexey Bataev [Fri, 2 Jul 2021 20:45:56 +0000 (13:45 -0700)]
[OPENMP]Remove const firstprivate allocation as a variable in a constant space.

Current implementation is not compatible with asynchronous target
regions, need to remove it.

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

3 years ago[mlir] Move common reshapeops-related code to ReshapeOpsUtils.h.
Alexander Belyaev [Wed, 7 Jul 2021 11:45:33 +0000 (13:45 +0200)]
[mlir] Move common reshapeops-related code to ReshapeOpsUtils.h.

This is a first step to move (Tensor)Expand/CollapseShapeOp to tensor/memref
dialects.

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

3 years ago[mlir][Linalg] Rewrite PadTensorOp to enable its comprehensive bufferization.
Nicolas Vasilache [Wed, 7 Jul 2021 08:08:20 +0000 (08:08 +0000)]
[mlir][Linalg] Rewrite PadTensorOp to enable its comprehensive bufferization.

Add the rewrite of PadTensorOp to InitTensor + InsertSlice before the
bufferization analysis starts.

This is exercised via a more advanced integration test.

Since the new behavior triggers folding, 2 tests need to be updated.
One of those seems to exhibit a folding issue with `switch` and is modified.

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

3 years agoRefactor GenericPadTensorOpVectorizationPattern
Yi Zhang [Tue, 6 Jul 2021 16:01:11 +0000 (16:01 +0000)]
Refactor GenericPadTensorOpVectorizationPattern

Refactor the original code to rewrite a PadTensorOp into a
sequence of InitTensorOp, FillOp and InsertSliceOp without
vectorization by default. `GenericPadTensorOpVectorizationPattern`
provides a customized OptimizeCopyFn to vectorize the
copying step.

Reviewed By: silvas, nicolasvasilache, springerm

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

3 years ago[mlir][Linalg] Proper handling of ForOp and TiledLoopOp
Nicolas Vasilache [Wed, 7 Jul 2021 08:02:02 +0000 (08:02 +0000)]
[mlir][Linalg] Proper handling of ForOp and TiledLoopOp

The `bufferizesToMemoryRead` condition was too optimistics in the case
of operands that map to a block argument.
This is the case for ForOp and TiledLoopOp.
For such ops, forward the call to all uses of the matching BBArg.

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

3 years ago[CostModel][X86] Adjust sitofp/uitofp SSE/AVX legalized costs based on llvm-mca reports.
Simon Pilgrim [Tue, 6 Jul 2021 18:49:01 +0000 (19:49 +0100)]
[CostModel][X86] Adjust sitofp/uitofp SSE/AVX legalized costs based on llvm-mca reports.

Update (mainly) vXi8/vXi16 -> vXf32/vXf64 sitofp/uitofp costs based on the worst case costs from the script in D103695.

Move to using legalized types wherever possible, which allows us to prune the cost tables.

3 years ago[gn build] Port 6829db727e9e
LLVM GN Syncbot [Wed, 7 Jul 2021 10:14:59 +0000 (10:14 +0000)]
[gn build] Port 6829db727e9e

3 years ago[libc++] Implement copyable-box from Ranges
Louis Dionne [Thu, 24 Jun 2021 17:29:35 +0000 (13:29 -0400)]
[libc++] Implement copyable-box from Ranges

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

3 years ago[NFC] Remove duplicate function calls
Max Kazantsev [Wed, 7 Jul 2021 10:00:48 +0000 (17:00 +0700)]
[NFC] Remove duplicate function calls

Removed repeated call of L->getHeader(). Now using previously stored return value.

Patch by Dmitry Makogon!

Differential Revision: https://reviews.llvm.org/D105535
Reviewed By: mkazantsev

3 years ago[SVE] Fixed cast<FixedVectorType> on scalable vector in SelectionDAGBuilder::getUnifo...
Dylan Fleming [Wed, 7 Jul 2021 09:21:46 +0000 (10:21 +0100)]
[SVE] Fixed cast<FixedVectorType> on scalable vector in SelectionDAGBuilder::getUniformBase

Reviewed By: sdesmalen

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

3 years agoAdd Log1pOp to complex dialect.
Adrian Kuegel [Wed, 7 Jul 2021 08:32:56 +0000 (10:32 +0200)]
Add Log1pOp to complex dialect.

Also add a lowering pattern from Complex to Standard/Math dialect.

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

3 years ago[mlir][CAPI] Export mlirValueEqual in C API
Bairen Yi [Wed, 7 Jul 2021 09:26:50 +0000 (11:26 +0200)]
[mlir][CAPI] Export mlirValueEqual in C API

Somehow it is not exported in C API.

Reviewed By: ftynse

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

3 years ago[DAG] Reassociate Add with Or
David Green [Wed, 7 Jul 2021 09:21:07 +0000 (10:21 +0100)]
[DAG] Reassociate Add with Or

We already have reassociation code for Adds and Ors separately in DAG
combiner, this adds it for the combination of the two where Ors act like
Adds. It reassociates (add (or (x, c), y) -> (add (add (x, y), c)) where
we know that the Ors operands have no common bits set, and the Or has
one use.

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

3 years ago[Clang] Add test dependency on llvm-ar
Saiyedul Islam [Thu, 1 Jul 2021 14:06:35 +0000 (19:36 +0530)]
[Clang] Add test dependency on llvm-ar

Following clang driver tests invoke llvm-ar, so ensure that
check-clang rebuilds llvm-ar.

 * test/Driver/clang-offload-bundler.c
 * test/Driver/hip-link-save-temps.hip
 * test/Driver/hip-link-static-library.hip
 * test/Driver/hip-toolchain-rdc-static-lib.hip

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

3 years ago[SVE] Fix cast<FixedVectorType> in truncateToMinimalBitwidths
Dylan Fleming [Wed, 7 Jul 2021 08:33:52 +0000 (09:33 +0100)]
[SVE] Fix cast<FixedVectorType> in truncateToMinimalBitwidths

Reviewed By: sdesmalen

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

3 years ago[mlir] factor out common parts of the converstion to the LLVM dialect
Alex Zinenko [Wed, 7 Jul 2021 07:46:27 +0000 (09:46 +0200)]
[mlir] factor out common parts of the converstion to the LLVM dialect

"Standard-to-LLVM" conversion is one of the oldest passes in existence. It has
become quite large due to the size of the Standard dialect itself, which is
being split into multiple smaller dialects. Furthermore, several conversion
features are useful for any dialect that is being converted to the LLVM
dialect, which, without this refactoring, creates a dependency from those
conversions to the "standard-to-llvm" one.

Put several of the reusable utilities from this conversion to a separate
library, namely:
- type converter from builtin to LLVM dialect types;
- utility for building and accessing values of LLVM structure type;
- utility for building and accessing values that represent memref in the LLVM
  dialect;
- lowering options applicable everywhere.

Additionally, remove the type wrapping/unwrapping notion from the type
converter that is no longer relevant since LLVM types has been reimplemented as
first-class MLIR types.

Reviewed By: pifon2a

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

3 years ago[mlir][Linalg] Add an InitTensor -> DimOp canonicalization pattern.
Nicolas Vasilache [Wed, 7 Jul 2021 06:59:23 +0000 (06:59 +0000)]
[mlir][Linalg] Add an InitTensor -> DimOp canonicalization pattern.

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

3 years ago[AMDGPU] Simplify tablegen files. NFC.
Jay Foad [Tue, 6 Jul 2021 16:46:39 +0000 (17:46 +0100)]
[AMDGPU] Simplify tablegen files. NFC.

There is no need to cast records to strings before comparing them.

3 years ago[flang] Create HostAssocDetails symbols when needed for mis-parsed ArrayRef
Jean Perier [Wed, 7 Jul 2021 08:06:43 +0000 (10:06 +0200)]
[flang] Create HostAssocDetails symbols when needed for mis-parsed ArrayRef

Name resolution is always creating symbols with HostAssocDetails
for host variable names inside internal procedures. This helps lowering
identifying and dealing with such variables inside internal procedures.

However, the case where the variable appears in an ArrayRef mis-parsed
as a FunctionRef goes through a different name resolution path that did
not create such HostAssocDetails when needed. Pointer assignment RHS
are also skipping this path.

Add the logic to create HostAssocDetails for host symbols inisde internal
procedures that appear in mis-parsed ArrayRef or in pointer assignment RHS.

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

3 years ago[MLIR] Simplify affine.if having yield values and trivial conditions
Srishti Srivastava [Wed, 7 Jul 2021 07:31:38 +0000 (13:01 +0530)]
[MLIR] Simplify affine.if having yield values and trivial conditions

When an affine.if operation is returning/yielding results and has a
trivially true or false condition, then its 'then' or 'else' block,
respectively, is promoted to the affine.if's parent block and then, the
affine.if operation is replaced by the correct results/yield values.
Relevant test cases are also added.

Signed-off-by: Srishti Srivastava <srishti.srivastava@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D105418

3 years ago[llvm-readobj][test] Improve grouped option test
Fangrui Song [Wed, 7 Jul 2021 06:02:33 +0000 (23:02 -0700)]
[llvm-readobj][test] Improve grouped option test

3 years ago[MLIR] Split out GPU ops library from Transforms
Uday Bondhugula [Wed, 23 Jun 2021 04:47:46 +0000 (10:17 +0530)]
[MLIR] Split out GPU ops library from Transforms

Split out GPU ops library from GPU transforms. This allows libraries to
depend on GPU Ops without needing/building its transforms.

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

3 years ago[Clang][RISCV] Implement vlseg and vlsegff.
Hsiangkai Wang [Tue, 25 May 2021 08:13:34 +0000 (16:13 +0800)]
[Clang][RISCV] Implement vlseg and vlsegff.

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

3 years ago[AMDGPU] isPassEnabled() helper to check cl::opt and OptLevel
Stanislav Mekhanoshin [Tue, 6 Jul 2021 22:37:18 +0000 (15:37 -0700)]
[AMDGPU] isPassEnabled() helper to check cl::opt and OptLevel

We have several checks for both cl::opt and OptLevel over our
pass config, although these checks do not properly work if
default value of a cl::opt will be false. Create a helper to
use instead and properly handle it. NFC for now.

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

3 years ago[Attributor][FIX] Replace uses first, then values
Johannes Doerfert [Sat, 26 Jun 2021 00:01:31 +0000 (19:01 -0500)]
[Attributor][FIX] Replace uses first, then values

Before we replaced value by registering all their uses. However, as we
replace a value old uses become stale. We now replace values explicitly
and keep track of "new values" when doing so to avoid replacing only
uses in stale/old values but not their replacements.

3 years ago[Attriibutor][NFC] Precommit heap-2-stack test case
Johannes Doerfert [Sat, 26 Jun 2021 05:12:41 +0000 (00:12 -0500)]
[Attriibutor][NFC] Precommit heap-2-stack test case

3 years ago[Attributor] Introduce a helper function to deal with undef + none
Johannes Doerfert [Sat, 8 May 2021 04:18:24 +0000 (23:18 -0500)]
[Attributor] Introduce a helper function to deal with undef + none

We often need to deal with the value lattice that contains none and
undef as special values. A simple helper makes this much nicer.

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