platform/upstream/llvm.git
3 years ago[RISCV] Add zext.h instruction to Zbb.
Craig Topper [Fri, 22 Jan 2021 19:58:03 +0000 (11:58 -0800)]
[RISCV] Add zext.h instruction to Zbb.

zext.h uses the same encoding as pack rd, rs, x0 in rv32 and
packw rd, rs, x0 in rv64. Encodings without x0 as the second source
are not valid in Zbb.

I've added two new instructions with these specific encodings with
predicates that enable them when either Zbb or Zbp is enabled.

The pack spelling will only be accepted with Zbp. The disassembler
will use the zext.h instruction when either feature is enabled.

Using the pack spelling will print as pack when llvm-mc is
emitting text. We could fix this with some custom code in
processInstruction if this is important, but I'm not sure it is.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Move pack instructions to Zbp extension only.
Craig Topper [Fri, 22 Jan 2021 19:47:36 +0000 (11:47 -0800)]
[RISCV] Move pack instructions to Zbp extension only.

Zext.h will need to come back to Zbb, but that only uses specific
encodings of pack.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Change zext.w to be an alias of add.uw rd, rs1, x0 instead of pack.
Craig Topper [Fri, 22 Jan 2021 19:42:18 +0000 (11:42 -0800)]
[RISCV] Change zext.w to be an alias of add.uw rd, rs1, x0 instead of pack.

This didn't make it into the published 0.93 spec, but it was the
intention.

But it is in the tex source as of this commit
https://github.com/riscv/riscv-bitmanip/commit/d172f029c074d47026a0c0d0f12d8b475c86a472

This means zext.w now requires Zba. Not sure if we should still use
pack if Zbp is enabled and Zba isn't. I'll leave that for the future
when pack is closer to being final.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Modify add.uw patterns to put the masked operand in rs1 to match 0.93 bitmani...
Craig Topper [Fri, 22 Jan 2021 19:33:47 +0000 (11:33 -0800)]
[RISCV] Modify add.uw patterns to put the masked operand in rs1 to match 0.93 bitmanip spec.

The 0.93 spec has this implementation for add.uw

uint_xlen_t adduw(uint_xlen_t rs1, uint_xlen_t rs2) {
  uint_xlen_t rs1u = (uint32_t)rs1;
  return rs1u + rs2;
}

The 0.92 spec had the usages of rs1 and rs2 swapped.

Reviewed By: frasercrmck, asb

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

3 years ago[RISCV] Rename Zbs instructions to start with just 'b' instead of 'sb' to match 0...
Craig Topper [Fri, 22 Jan 2021 19:32:33 +0000 (11:32 -0800)]
[RISCV] Rename Zbs instructions to start with just 'b' instead of 'sb' to match 0.93 bitmanip spec.

Also renamed Zbe instructions to resolve name conflict even though
that change is in the 0.94 draft.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Move Shift Ones instructions from Zbb to Zbp to match 0.93 bitmanip spec.
Craig Topper [Fri, 22 Jan 2021 19:24:07 +0000 (11:24 -0800)]
[RISCV] Move Shift Ones instructions from Zbb to Zbp to match 0.93 bitmanip spec.

It's not really clear in the spec that these are in Zbp now, but
that's what I've gather from previous commits to the spec. I've
file an issue to get it documented properly.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Add SH*ADD(.UW) instructions to Zba extension based on 0.93 bitmanip spec.
Craig Topper [Fri, 22 Jan 2021 19:22:49 +0000 (11:22 -0800)]
[RISCV] Add SH*ADD(.UW) instructions to Zba extension based on 0.93 bitmanip spec.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Add Zba feature and move add.uw and slli.uw to it.
Craig Topper [Fri, 22 Jan 2021 18:58:06 +0000 (10:58 -0800)]
[RISCV] Add Zba feature and move add.uw and slli.uw to it.

Still need to add SH*ADD instructions.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Rename mnemonics slliu.w->slli.uw and addu.w->add.uw to match 0.93 bitmanip...
Craig Topper [Fri, 22 Jan 2021 18:57:00 +0000 (10:57 -0800)]
[RISCV] Rename mnemonics slliu.w->slli.uw and addu.w->add.uw to match 0.93 bitmanip spec.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Swap encodings of max and minu to match 0.93 bitmanip spec.
Craig Topper [Fri, 22 Jan 2021 18:47:12 +0000 (10:47 -0800)]
[RISCV] Swap encodings of max and minu to match 0.93 bitmanip spec.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Remove addiwu, addwu, subwu, subuw, clmulw, clmulrw, clmulhw to match 0.93...
Craig Topper [Fri, 22 Jan 2021 18:37:11 +0000 (10:37 -0800)]
[RISCV] Remove addiwu, addwu, subwu, subuw, clmulw, clmulrw, clmulhw to match 0.93 bitmanip spec.

Reviewed By: asb, frasercrmck

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

3 years ago[RISCV] Rename pcnt->cpop to match 0.93 bitmanip spec.
Craig Topper [Fri, 22 Jan 2021 18:23:46 +0000 (10:23 -0800)]
[RISCV] Rename pcnt->cpop to match 0.93 bitmanip spec.

This is the first of multiple patches to bring our 0.92
implementation up to 0.93.

Reviewed By: asb, frasercrmck

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

3 years ago[Tests] Add willreturn to libcalls in some tests
Nikita Popov [Fri, 22 Jan 2021 20:06:06 +0000 (21:06 +0100)]
[Tests] Add willreturn to libcalls in some tests

Willreturn would be inferred by FuncAttrs for these. Annotate them
to preserve test behavior in the future.

3 years ago[NewPM][AMDGPU] Skip adding CGSCCOptimizerLate callbacks at O0
Arthur Eubanks [Fri, 22 Jan 2021 18:47:10 +0000 (10:47 -0800)]
[NewPM][AMDGPU] Skip adding CGSCCOptimizerLate callbacks at O0

The legacy PM's EP_CGSCCOptimizerLate was only used under not-O0.

Fixes clang/test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp under the new PM.

Reviewed By: arsenm

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

3 years ago[libc++] Introduce __bits
Thorsten Schütt [Mon, 18 Jan 2021 12:21:00 +0000 (13:21 +0100)]
[libc++] Introduce __bits

It has the low-level bit fiddling operations from bit. It eliminates a cyclic dependency between __bit_reference, bits, and vector. I want to exploit this in later patches.

Reviewed By: #libc, ldionne

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

3 years ago[CGExpr] Use getCharWidth() more consistently in CCGExprConstant. NFC
Bjorn Pettersson [Tue, 19 Jan 2021 14:24:20 +0000 (15:24 +0100)]
[CGExpr] Use getCharWidth() more consistently in CCGExprConstant. NFC

Most of CGExprConstant.cpp is using the CharUnits abstraction
and is using getCharWidth() (directly of indirectly) when converting
between size of a char and size in bits. This patch is making that
abstraction more consistent by adding CharTy to the CodeGenTypeCache
(honoring getCharWidth() when mapping from char to LLVM IR types,
instead of using Int8Ty directly).

Reviewed By: rjmccall

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

3 years ago[CodeGen] Use getCharWidth() more consistently in CGRecordLowering. NFC
Bjorn Pettersson [Tue, 19 Jan 2021 14:32:35 +0000 (15:32 +0100)]
[CodeGen] Use getCharWidth() more consistently in CGRecordLowering. NFC

When using getByteArrayType the requested size is calculated in
char units, but the type used for the array was hardcoded to the
Int8Ty. This patch is using getCharWIdth a bit more consistently
by using getIntNTy in combination with getCharWidth, instead
of explictly using getInt8Ty.

Reviewed By: rjmccall

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

3 years ago[mlir][OpFormatGen] Add support for anchoring optional groups with types
River Riddle [Fri, 22 Jan 2021 20:07:07 +0000 (12:07 -0800)]
[mlir][OpFormatGen] Add support for anchoring optional groups with types

This revision adds support for using either operand or result types to anchor an optional group. It also removes the arbitrary restriction that type directives must refer to variables in the same group, which is overly limiting for a declarative format syntax.

Fixes PR#48784

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

3 years agoRemove obsolete TODOs
Julian Lettner [Fri, 22 Jan 2021 20:01:54 +0000 (12:01 -0800)]
Remove obsolete TODOs

Remove a few of my own TODOs that I will not have time to fix from lit
code.

3 years ago[SimplifyLibCalls] Skip unused calls in sincos transform
Nikita Popov [Fri, 22 Jan 2021 19:44:44 +0000 (20:44 +0100)]
[SimplifyLibCalls] Skip unused calls in sincos transform

If the call result is unused, we should let it get DCEd rather
than replacing it. Also, don't try to replace an existing sincos
with another one (unless it's as part of combining sin and cos).

This avoids an infinite combine loop if the calls are not DCEd
as expected, which can happen with D94106 and lack of willreturn
annotation in hand-crafted IR.

3 years ago[libc++] Bring back mach_absolute_time implementation of steady_clock
Louis Dionne [Thu, 21 Jan 2021 22:53:29 +0000 (17:53 -0500)]
[libc++] Bring back mach_absolute_time implementation of steady_clock

This is meant to unblock Chrome, as discussed in https://llvm.org/D74489.

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

3 years agoAdd more explicit assert for failures
Jacques Pienaar [Fri, 22 Jan 2021 19:45:25 +0000 (11:45 -0800)]
Add more explicit assert for failures

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

3 years ago[mlir][Linalg] Extend tile+fuse to work on Linalg operation on tensors.
MaheshRavishankar [Fri, 22 Jan 2021 19:32:50 +0000 (11:32 -0800)]
[mlir][Linalg] Extend tile+fuse to work on Linalg operation on tensors.

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

3 years ago[NFC][libc++] Update the implementation status.
Mark de Wever [Fri, 22 Jan 2021 19:24:33 +0000 (20:24 +0100)]
[NFC][libc++] Update the implementation status.

During the review of https://reviews.llvm.org/D93912 we failed to notice
the implementation status wasn't updated. This rectifies the issue.

3 years ago[mlir][Linalg] NFC: Refactor LinalgDependenceGraphElem to allow
MaheshRavishankar [Fri, 22 Jan 2021 19:19:03 +0000 (11:19 -0800)]
[mlir][Linalg] NFC: Refactor LinalgDependenceGraphElem to allow
representing dependence from producer result to consumer.

With Linalg on tensors the dependence between operations can be from
the result of the producer to the consumer. This change just does a
NFC refactoring of the LinalgDependenceGraphElem to allow representing
both OpResult and OpOperand*.

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

3 years ago[CSSPGO] LTO option for pseudo probe
Hongtao Yu [Wed, 20 Jan 2021 17:24:43 +0000 (09:24 -0800)]
[CSSPGO] LTO option for pseudo probe

Adding a lld option to support emitting pseudo probe metadata in LTO mode.

Reviewed By: MaskRay, wmi, wenlei

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

3 years ago[flang][nfc] Fix comments, remove needless API, tweak script
peter klausler [Thu, 21 Jan 2021 22:59:43 +0000 (14:59 -0800)]
[flang][nfc] Fix comments, remove needless API, tweak script

* Remove an unimplemented and unused member function declaration
* Remove a misleading comment about an unrelated constraint number
* Fix a comment
* Add f18 crash message to "flang" driver script

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

3 years ago[SystemZ][z/OS] Fix No such file or directory expression error matching in lit tests...
Abhina Sreeskantharajan [Fri, 22 Jan 2021 18:54:01 +0000 (13:54 -0500)]
[SystemZ][z/OS] Fix No such file or directory expression error matching in lit tests - continued

This is a continuation of https://reviews.llvm.org/D94239. I missed some other spellings of the same error.

Reviewed By: muiez

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

3 years ago[flang] Correct shape analysis for transformational intrinsic functions
peter klausler [Thu, 14 Jan 2021 20:54:31 +0000 (12:54 -0800)]
[flang] Correct shape analysis for transformational intrinsic functions

Correct the analysis of references to transformational intrinsic
functions that have different semantics based on the presence or
absence of a DIM= argument; add shape analysis for UNPACK().

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

3 years ago[InstCombine] narrow abs with sign-extended input
Sanjay Patel [Fri, 22 Jan 2021 18:33:21 +0000 (13:33 -0500)]
[InstCombine] narrow abs with sign-extended input

In the motivating cases from https://llvm.org/PR48816 ,
we have a trailing trunc. But that is not required to
reduce the abs width:
https://alive2.llvm.org/ce/z/ECaz-p
...as long as we clear the int-min-is-poison bit (nsw).

We have some existing tests that are affected, and I'm
not sure what the overall implications are, but in general
we favor narrowing operations over preserving nsw/nuw.

If that causes problems, we could restrict this transform
based on type (shouldChangeType() and/or vector vs. scalar).

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

3 years ago[InstCombine] add tests for abs(sext X); NFC
Sanjay Patel [Fri, 22 Jan 2021 15:02:51 +0000 (10:02 -0500)]
[InstCombine] add tests for abs(sext X); NFC

https://llvm.org/PR48816

3 years ago[mlir][spirv] Define spv.IsNan/spv.IsInf and add lowerings
Lei Zhang [Fri, 22 Jan 2021 18:08:00 +0000 (13:08 -0500)]
[mlir][spirv] Define spv.IsNan/spv.IsInf and add lowerings

spv.Ordered/spv.Unordered are meant for OpenCL Kernel capability.
For Vulkan Shader capability, we should use spv.IsNan to check
whether a number is NaN.

Add a new pattern for converting `std.cmpf ord|uno` to spv.IsNan
and bumped the pattern converting to spv.Ordered/spv.Unordered
to a higher benefit. The SPIR-V target environment will properly
select between these two patterns.

Reviewed By: mravishankar

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

3 years ago[flang] Remove some needless operations in expr rewriting
peter klausler [Thu, 21 Jan 2021 22:38:42 +0000 (14:38 -0800)]
[flang] Remove some needless operations in expr rewriting

Expressions emitted to module files and error messages
sometimes contain conversions of integer results of inquiry
intrinsics; these are usually not needed, and can conflict
with "int" in the user's namespace.  Improve folding so that
these conversions don't appear, and do some other clean-up
in adjacent code.

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

3 years ago[mlir][spirv] Fix script for availability autogen and refresh ops
Lei Zhang [Fri, 22 Jan 2021 18:03:59 +0000 (13:03 -0500)]
[mlir][spirv] Fix script for availability autogen and refresh ops

Previously we only autogen the availability for ops that are
direct instantiating `SPV_Op` and expected other subclasses of
`SPV_Op` to define aggregated availability for all ops. This is
quite error prone and we can miss capabilities for certain ops.
Also it's arguable to have multiple levels of subclasses and try
to deduplicate too much: having the availability directly in the
op can be quite explicit and clear. A few extra lines of
declarative code is fine.

Reviewed By: mravishankar

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

3 years ago[LLDB] Fix how ObjCBOOLSummaryProvider deals with BOOL
Shafik Yaghmour [Fri, 22 Jan 2021 18:04:04 +0000 (10:04 -0800)]
[LLDB] Fix how ObjCBOOLSummaryProvider deals with BOOL

ObjCBOOLSummaryProvider was incorrectly treating BOOL as unsigned and this is now fixed.
Also adding tests for one bit bit-fields of BOOL and unsigned char.

3 years ago[mlir] Add coro intrinsics operations to LLVM dialect
Eugene Zhulenev [Fri, 22 Jan 2021 17:11:26 +0000 (09:11 -0800)]
[mlir] Add coro intrinsics operations to LLVM dialect

This PR only has coro intrinsics needed for the Async to LLVM lowering. Will add other intrinsics as needed in the followup PRs.

Reviewed By: mehdi_amini

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

3 years ago[llvm-mca] Adding local lit config file for X86 targets
Wolfgang Pieb [Fri, 22 Jan 2021 17:51:59 +0000 (09:51 -0800)]
[llvm-mca] Adding local lit config file for X86 targets

3 years ago[libc++] Fix broken build when merging libc++abi into libc++ on Apple
Louis Dionne [Fri, 22 Jan 2021 17:39:17 +0000 (12:39 -0500)]
[libc++] Fix broken build when merging libc++abi into libc++ on Apple

3 years ago[OpenMP] libomp: properly initialize buckets in __kmp_dephash_extend
Joseph Schuchart [Fri, 22 Jan 2021 17:29:31 +0000 (20:29 +0300)]
[OpenMP] libomp: properly initialize buckets in __kmp_dephash_extend

The buckets are initialized in __kmp_dephash_create but when they are extended
the memory is allocated but not NULL'd, potentially leaving some buckets
uninitialized after all entries have been copied into the new allocation.
This commit makes sure the buckets are properly initialized with NULL before
copying the entries.

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

3 years ago[ELF] --wrap: retain __wrap_foo if foo is defined in an object/bitcode file
Fangrui Song [Fri, 22 Jan 2021 17:20:29 +0000 (09:20 -0800)]
[ELF] --wrap: retain __wrap_foo if foo is defined in an object/bitcode file

If foo is referenced in any object file, bitcode file or shared object,
`__wrap_foo` should be retained as the redirection target of sym
(f96ff3c0f8ebd941b3f6b345164c3d858b781484).

If the object file defining foo has foo references, we cannot easily distinguish
the case from cases where foo is not referenced (we haven't scanned
relocations). Retain `__wrap_foo` because we choose to wrap sym references
regardless of whether sym is defined to keep non-LTO/LTO/relocatable links' behaviors similar
https://sourceware.org/bugzilla/show_bug.cgi?id=26358 .

If foo is defined in a shared object, `__wrap_foo` can still be omitted
(`wrap-dynamic-undef.s`).

Reviewed By: andrewng

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

3 years ago[mlir][StandardOps] Fix typos in the td file.
Hanhan Wang [Fri, 22 Jan 2021 17:02:44 +0000 (09:02 -0800)]
[mlir][StandardOps] Fix typos in the td file.

- Fix arguments name for subview and subtensor.
- Fix a typo in a comment of subtensor's method.

Reviewed By: nicolasvasilache

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

3 years ago[MLIR] Add support for extracting an integer sample point (if one exists) from an...
Arjun P [Fri, 22 Jan 2021 15:34:05 +0000 (21:04 +0530)]
[MLIR] Add support for extracting an integer sample point (if one exists) from an unbounded FlatAffineConstraints.

With this, we have complete support for finding integer sample points in FlatAffineConstraints.

Reviewed By: ftynse

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

3 years ago[HIP] Support __managed__ attribute
Yaxun (Sam) Liu [Thu, 15 Oct 2020 12:38:46 +0000 (08:38 -0400)]
[HIP] Support __managed__ attribute

This patch implements codegen for __managed__ variable attribute for HIP.

Diagnostics will be added later.

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

3 years ago[SystemZ][z/OS] Fix No such file or directory expression error
Abhina Sreeskantharajan [Fri, 22 Jan 2021 16:41:36 +0000 (11:41 -0500)]
[SystemZ][z/OS] Fix No such file or directory expression error

On z/OS, the following error message is not matched correctly in lit tests. This patch updates the CHECK expression to match the end period successfully.
```
EDC5129I No such file or directory.
```

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

3 years ago[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - handle vperm2x128(movddup(x)...
Simon Pilgrim [Fri, 22 Jan 2021 16:05:19 +0000 (16:05 +0000)]
[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - handle vperm2x128(movddup(x),movddup(y)) cases

Fold vperm2x128(movddup(x),movddup(y)) -> movddup(vperm2x128(x,y))

3 years ago[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - handle unary vperm2x128(permute...
Simon Pilgrim [Fri, 22 Jan 2021 15:47:06 +0000 (15:47 +0000)]
[X86][AVX] canonicalizeLaneShuffleWithRepeatedOps - handle unary vperm2x128(permute/shift(x,c),undef) cases

Fold vperm2x128(permute/shift(x,c),undef) -> permute/shift(vperm2x128(x,undef),c)

3 years ago[X86][AVX] combineTargetShuffle - simplify the X86ISD::VPERM2X128 subvector matching
Simon Pilgrim [Fri, 22 Jan 2021 15:20:11 +0000 (15:20 +0000)]
[X86][AVX] combineTargetShuffle - simplify the X86ISD::VPERM2X128 subvector matching

Simplify vperm2x128(concat(X,Y),concat(Z,W)) folding.

Use collectConcatOps / ISD::INSERT_SUBVECTOR to find the source subvectors instead of hardcoded immediate matching.

3 years ago[flang] Fix typo in error message
Peter Steinfeld [Fri, 22 Jan 2021 15:09:23 +0000 (07:09 -0800)]
[flang] Fix typo in error message

The title says it all.

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

3 years ago[LoopUnswitch] Fix logic to avoid unswitching with atomic loads.
Florian Hahn [Fri, 22 Jan 2021 15:03:17 +0000 (15:03 +0000)]
[LoopUnswitch] Fix logic to avoid unswitching with atomic loads.

The existing code did not deal with atomic loads correctly. Such loads
are represented as MemoryDefs. Bail out on any MemoryAccess that is not
a MemoryUse.

3 years ago[LoopUnswitch] Add test cases with atomic loads & call
Florian Hahn [Fri, 22 Jan 2021 15:00:31 +0000 (15:00 +0000)]
[LoopUnswitch] Add test cases with atomic loads & call

3 years ago[coro.async] Make sure we process async coroutines
Arnold Schwaighofer [Thu, 21 Jan 2021 16:41:37 +0000 (08:41 -0800)]
[coro.async] Make sure we process async coroutines

Because we were not looking for the llvm.coro.id.async intrinsic in the
early coro pass which triggers follow-up passes we relied on the
llvm.coro.end intrinsic being present. This might not be the case in
functions that end in unreachable code.

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

3 years ago[libomptarget][devicertl] Drop templated atomic functions
Jon Chesterfield [Fri, 22 Jan 2021 14:48:22 +0000 (14:48 +0000)]
[libomptarget][devicertl] Drop templated atomic functions

[libomptarget][devicertl] Drop templated atomic functions

The five __kmpc_atomic templates are instantiated a total of seven times.
This change replaces the template with explictly typed functions, which
have the same prototype for amdgcn and nvptx, and implements them with
the same code presently in use.

Rolls in the accepted but not yet landed D95085.

The unsigned long long type can be replaced with uint64_t when replacing
the cuda function. Until then, clang warns on casting a pointer to one to
a pointer to the other.

Reviewed By: tianshilei1992

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

3 years agoRevert "[NFCI-ish][SimplifyCFG] FoldBranchToCommonDest(): really don't deal with...
Roman Lebedev [Fri, 22 Jan 2021 14:37:11 +0000 (17:37 +0300)]
Revert "[NFCI-ish][SimplifyCFG] FoldBranchToCommonDest(): really don't deal with uncond branches"

Does not build in XCode:
http://green.lab.llvm.org/green/job/clang-stage1-RA/17963/consoleFull#-1704658317a1ca8a51-895e-46c6-af87-ce24fa4cd561

This reverts commit aabed3718ae25476c0f6b7e70c83ba4658f00e5c.

3 years ago[InstCombine] Fold `(~x) | y` --> `~(x & (~y))` iff it is free to do so
Roman Lebedev [Fri, 22 Jan 2021 09:58:45 +0000 (12:58 +0300)]
[InstCombine] Fold `(~x) | y` --> `~(x & (~y))` iff it is free to do so

Iff we know we can get rid of the inversions in the new pattern,
we can thus get rid of the inversion in the old pattern,
this decreasing instruction count.

Note that we could position this transformation as just hoisting
of the `not` (still, iff y is freely negatible), but the test changes
show a number of regressions, so let's not do that.

3 years ago[InstCombine] Fold `(~x) & y` --> `~(x | (~y))` iff it is free to do so
Roman Lebedev [Fri, 22 Jan 2021 09:57:52 +0000 (12:57 +0300)]
[InstCombine] Fold `(~x) & y` --> `~(x | (~y))` iff it is free to do so

Iff we know we can get rid of the inversions in the new pattern,
we can thus get rid of the inversion in the old pattern,
this decreasing instruction count.

3 years ago[NFC][InstCombine] Add tests for `(~x) &/| y` --> `~(x |/& (~y))` fold
Roman Lebedev [Fri, 22 Jan 2021 09:54:16 +0000 (12:54 +0300)]
[NFC][InstCombine] Add tests for `(~x) &/| y` --> `~(x |/& (~y))` fold

Iff y is free to invert, and the users of the expression can be updated,
we can undo De-Morgan fold, and immediately get rid of the `not` op.

3 years ago[NFC][InstCombine] Extract freelyInvertAllUsersOf() out of canonicalizeICmpPredicate()
Roman Lebedev [Fri, 22 Jan 2021 09:51:40 +0000 (12:51 +0300)]
[NFC][InstCombine] Extract freelyInvertAllUsersOf() out of canonicalizeICmpPredicate()

I'd like to use it in an upcoming fold.

3 years ago[NFC][SimplifyCFG] FoldBranchToCommonDest(): extract the actual transform into helper...
Roman Lebedev [Thu, 21 Jan 2021 18:32:20 +0000 (21:32 +0300)]
[NFC][SimplifyCFG] FoldBranchToCommonDest(): extract the actual transform into helper function

I'm intentionally structuring it this way, so that the actual fold only
does the fold, and no legality/correctness checks, all of which must be
done by the caller. This allows for the fold code to be more compact
and more easily grokable.

3 years ago[NFC][SimplifyCFG] FoldBranchToCommonDest(): extract check for destination sharing...
Roman Lebedev [Thu, 21 Jan 2021 18:24:06 +0000 (21:24 +0300)]
[NFC][SimplifyCFG] FoldBranchToCommonDest(): extract check for destination sharing into a helper function

As a follow-up, i'll extract the actual transform into a function,
and this helper will be called from both places,
so this avoids code duplication.

3 years ago[NFC][SimplifyCFG] FoldBranchToCommonDest(): somewhat better structure weight updatin...
Roman Lebedev [Thu, 21 Jan 2021 17:49:26 +0000 (20:49 +0300)]
[NFC][SimplifyCFG] FoldBranchToCommonDest(): somewhat better structure weight updating code

Hoist the successor updating out of the code that deals with branch
weight updating, and hoist the 'has weights' check from the latter,
making code more consistent and easier to follow.

3 years ago[NFC][SimplifyCFG] FoldBranchToCommonDest(): unclutter Cond/CondInPred handling
Roman Lebedev [Thu, 21 Jan 2021 17:21:55 +0000 (20:21 +0300)]
[NFC][SimplifyCFG] FoldBranchToCommonDest(): unclutter Cond/CondInPred handling

We don't need those variables, we can just get the final value directly.

3 years ago[NFCI-ish][SimplifyCFG] FoldBranchToCommonDest(): really don't deal with uncond branches
Roman Lebedev [Thu, 21 Jan 2021 20:23:52 +0000 (23:23 +0300)]
[NFCI-ish][SimplifyCFG] FoldBranchToCommonDest(): really don't deal with uncond branches

While we already ignore uncond branches, we could still potentially
end up with a conditional branches with identical destinations
due to the visitation order, or because we were called as an utility.
But if we have such a disguised uncond branch,
we still probably shouldn't deal with it here.

3 years ago[SimplifyCFG] FoldBranchToCommonDest(): don't deal with unconditional branches
Roman Lebedev [Thu, 21 Jan 2021 16:45:41 +0000 (19:45 +0300)]
[SimplifyCFG] FoldBranchToCommonDest(): don't deal with unconditional branches

The case where BB ends with an unconditional branch,
and has a single predecessor w/ conditional branch
to BB and a single successor of BB is exactly the pattern
SpeculativelyExecuteBB() transform deals with.
(and in this case they both allow speculating only a single instruction)

Well, or FoldTwoEntryPHINode(), if the final block
has only those two predecessors.

Here, in FoldBranchToCommonDest(), only a weird subset of that
transform is supported, and it's glued on the side in a weird way.
  In particular, it took me a bit to understand that the Cond
isn't actually a branch condition in that case, but just the value
we allow to speculate (otherwise it reads as a miscompile to me).
  Additionally, this only supports for the speculated instruction
to be an ICmp.

So let's just unclutter FoldBranchToCommonDest(), and leave
this transform up to SpeculativelyExecuteBB(). As far as i can tell,
this shouldn't really impact optimization potential, but if it does,
improving SpeculativelyExecuteBB() will be more beneficial anyways.

Notably, this only affects a single test,
but EarlyCSE should have run beforehand in the pipeline,
and then FoldTwoEntryPHINode() would have caught it.

This reverts commit rL158392 / commit d33f4efbfdef6ffccf212ab3e40a7673589085fd.

3 years ago[clang][ASTImporter] Add support for importing CXXFoldExpr.
Balázs Kéri [Fri, 22 Jan 2021 11:39:21 +0000 (12:39 +0100)]
[clang][ASTImporter] Add support for importing CXXFoldExpr.

Reviewed By: shafik, martong

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

3 years ago[ARM] Disable sign extended SSAT pattern recognition.
David Green [Fri, 22 Jan 2021 14:07:48 +0000 (14:07 +0000)]
[ARM] Disable sign extended SSAT pattern recognition.

I may have given bad advice, and skipping sext_inreg when matching SSAT
patterns is not valid on it's own. It at least needs to sext_inreg the
input again, but as far as I can tell is still only valid based on
demanded bits. For the moment disable that part of the combine,
hopefully reimplementing it in the future more correctly.

3 years agoAvoid fragile type lookups in GDB pretty printer
Moritz Sichert [Mon, 11 Jan 2021 14:55:20 +0000 (15:55 +0100)]
Avoid fragile type lookups in GDB pretty printer

Instead of using the type llvm::StringMapEntry<{stringified_value_type}>
use only the base class llvm::StringMapEntryBase and calculate the
offsets of the member variables manually. The approach with stringifying
the name of the value type is pretty fragile as it can easily break with
local and dependent types.

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

3 years ago[LTO] Add support for existing Config::Freestanding option.
Florian Hahn [Fri, 22 Jan 2021 13:13:54 +0000 (13:13 +0000)]
[LTO] Add support for existing Config::Freestanding option.

lto::Config has a field to control whether the build is "freestanding"
(no builtins) or not, but it is not hooked up to the code actually
running the passes.

This patch adds support for the flag to both the code that runs
optimization with the new and old pass managers, by explicitly adding a
TargetLibraryInfo instance. If Freestanding is true, all library functions
are disabled.

Reviewed By: steven_wu

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

3 years ago[clangd] Inject context provider rather than config into ClangdServer. NFC
Sam McCall [Wed, 20 Jan 2021 21:34:24 +0000 (22:34 +0100)]
[clangd] Inject context provider rather than config into ClangdServer. NFC

This is a step towards allowing CDB behavior to being configurable.

Previously ClangdServer itself created the configs and installed them into
contexts. This was natural as it knows how to deal with resulting diagnostics.

However this prevents config being used in CDB, which must be created before
ClangdServer. So we extract the context provider (config loader) as a separate
object, which publishes diagnostics to a ClangdServer::Callbacks itself.

Now initialization looks like:
 - First create the config::Provider
 - Then create the ClangdLSPServer, passing config provider
 - Next, create the context provider, passing config provider + diagnostic callbacks
 - now create the CDB, passing context provider
 - finally create ClangdServer, passing CDB, context provider, and diagnostic callbacks

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

3 years ago[clangd][SwapIndex] ensure that the old index is alive while we are using it via...
Aleksandr Platonov [Fri, 22 Jan 2021 13:24:01 +0000 (16:24 +0300)]
[clangd][SwapIndex] ensure that the old index is alive while we are using it via the function returned by `SwapIndex::indexedFiles()` call

Without this patch the old index could be freed, but there still could be tries to access it via the function returned by `SwapIndex::indexedFiles()` call.
This leads to hard to reproduce clangd crashes at code completion.
This patch keeps the old index alive until the function returned by `SwapIndex::indexedFiles()` call is alive.

Reviewed By: sammccall

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

3 years ago[X86][AVX] combineX86ShufflesRecursively - attempt to constant fold before widening...
Simon Pilgrim [Fri, 22 Jan 2021 12:52:01 +0000 (12:52 +0000)]
[X86][AVX] combineX86ShufflesRecursively - attempt to constant fold before widening shuffle inputs

combineX86ShufflesConstants/canonicalizeShuffleMaskWithHorizOp can both handle/earlyout shuffles with inputs of different widths, so delay widening as late as possible to make it easier to match constant folds etc.

The plan is to eventually move the widening inside combineX86ShuffleChain so that we don't create any new nodes unless we successfully combine the shuffles.

3 years ago[SLP] do not traverse constant uses
Anton Rapetov [Fri, 22 Jan 2021 12:57:34 +0000 (07:57 -0500)]
[SLP] do not traverse constant uses

Walking the use list of a Constant (particularly, ConstantData)
is not scalable, since a given constant may be used by many
instructinos in many functions in many modules.

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

3 years ago[clang][Tooling] Get rid of a hack in SymbolOccurrences, NFCI
Mikhail Maltsev [Fri, 22 Jan 2021 13:01:41 +0000 (13:01 +0000)]
[clang][Tooling] Get rid of a hack in SymbolOccurrences, NFCI

The class `SymbolOccurrences` can store either a single `SourceRange`
in-place or multiple `SourceRanges` on the heap. In the latter case
the number of source ranges is stored in the internal representation
of the beginning `SourceLocation` of the in-place `SourceRange`
object.

This change gets rid of such hack by placing `SourceRange` in a union
which holds either a valid `SourceRange` or an `unsigned int` (a number
of ranges).

The change also adds `static_assert`s that check that `SourceRange` and
`SourceLocation` are trivially destructible (this is required for the
current patch and for D94237 which has already been committed).

Reviewed By: MarkMurrayARM, simon_tatham

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

3 years agoDon't delete default constructor of PathDiagnosticConsumerOptions
Moritz Sichert [Fri, 27 Nov 2020 11:26:46 +0000 (12:26 +0100)]
Don't delete default constructor of PathDiagnosticConsumerOptions

This type is used as an aggregate, i.e. it has no member functions.
Starting with C++20 types with deleted default constructors are not
aggregate types anymore which means that aggregate initialization will
not work for this class anymore. This leads to a compile error in
clang::AnalyzerOptions::getDiagOpts() for example.

Also set the boolean flags to false by default to avoid undefined
behavior. Previously this was prevented by deleting the default
constructor, now we explicitly initialize them.

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

3 years agoRevert "[clang] Suppress "follow-up" diagnostics on recovery call expressions."
Haojian Wu [Fri, 22 Jan 2021 11:15:05 +0000 (12:15 +0100)]
Revert "[clang] Suppress "follow-up" diagnostics on recovery call expressions."

This reverts commit efa9aaad703e6b150980ed1a74b4e7c9da7d85a2 and adds a
crash test.

The commit caused a crash in CodeGen with -fms-compatibility, see
https://bugs.llvm.org/show_bug.cgi?id=48690.

3 years ago[NFC] Add CMakeUserPresets.json filename to .gitignore
Balazs Benics [Fri, 22 Jan 2021 11:45:29 +0000 (12:45 +0100)]
[NFC] Add CMakeUserPresets.json filename to .gitignore

CMake 3.19 introduced the `presets`.
Quoting the documentation:
> `CMakePresets.json` may be checked into a version control system, and
> `CMakeUserPresets.json` **should NOT be checked in**.

We will ignore the `CMakeUserPresets.json` file if that is present
at the root of a subproject.

Reviewed By: dblaikie

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

3 years ago[DAG] Commute shuffle(splat(A,u), shuffle(C,D)) -> shuffle'(shuffle(C,D), splat(A,u))
Simon Pilgrim [Fri, 22 Jan 2021 11:43:18 +0000 (11:43 +0000)]
[DAG] Commute shuffle(splat(A,u), shuffle(C,D)) -> shuffle'(shuffle(C,D), splat(A,u))

We only merge shuffles if the inner (LHS) shuffle is a non-splat, so commute these shuffles to improve merging of multiple shuffles.

3 years ago[X86][SSE] Don't fold shuffle(binop(),binop()) -> binop(shuffle(),shuffle()) if the...
Simon Pilgrim [Fri, 22 Jan 2021 10:57:22 +0000 (10:57 +0000)]
[X86][SSE] Don't fold shuffle(binop(),binop()) -> binop(shuffle(),shuffle()) if the shuffle are splats

rGbe69e66b1cd8 added the fold, but DAGCombiner.visitVECTOR_SHUFFLE doesn't merge shuffles if the inner shuffle is a splat, so we need to bail.

The non-fast-horiz-ops paths see some minor regressions, we might be able to improve on this after lowering to target shuffles.

Fix PR48823

3 years ago[ARM] Adjust isSaturatingConditional to return a new SDValue. NFC
David Green [Fri, 22 Jan 2021 11:11:36 +0000 (11:11 +0000)]
[ARM] Adjust isSaturatingConditional to return a new SDValue. NFC

This replaces the isSaturatingConditional function with
LowerSaturatingConditional that directly returns a new SSAT or
USAT SDValue, instead of returning true and the components of it.

3 years ago[clangd] Add documentation for building and testing clangd
Kadir Cetinkaya [Tue, 10 Nov 2020 18:20:52 +0000 (19:20 +0100)]
[clangd] Add documentation for building and testing clangd

Adds minimal cmake configuration required to build and test clangd,
while telling target names. Should be helpful for people unfamiliar with the
LLVM repo.

See https://github.com/clangd/clangd/issues/579 for a request.

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

3 years ago[ARM] Add new and regenerate SSAT tests. NFC
David Green [Fri, 22 Jan 2021 10:42:36 +0000 (10:42 +0000)]
[ARM] Add new and regenerate SSAT tests. NFC

Some of these new tests should be creating SSAT. They will be fixed in a
followup.

3 years ago[IR] Optimize adding attribute to AttributeList (NFC)
Nikita Popov [Fri, 22 Jan 2021 09:38:36 +0000 (10:38 +0100)]
[IR] Optimize adding attribute to AttributeList (NFC)

When adding an enum attribute to an AttributeList, avoid going
through an AttrBuilder and instead directly add the attribute to
the correct set. Going through AttrBuilder is expensive, because
it requires all string attributes to be reconstructed.

This can be further improved by inserting the attribute at the
right position and using the AttributeSetNode::getSorted() API.

This recovers the small compile-time regression from D94633.

3 years ago[gn build] Port 8214982b5042
LLVM GN Syncbot [Fri, 22 Jan 2021 10:24:45 +0000 (10:24 +0000)]
[gn build] Port 8214982b5042

3 years ago[AMDGPU] Implement mir parseCustomPseudoSourceValue
Sebastian Neubauer [Thu, 21 Jan 2021 17:12:27 +0000 (18:12 +0100)]
[AMDGPU] Implement mir parseCustomPseudoSourceValue

Allow parsing generated mir with custom pseudo source value tokens.
Also rename pseudo source values to have more meaningful names.

Relands ba7dcd8542ab, which had memory leaks.

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

3 years ago[X86][SSE] Add PR48823 HSUB test case
Simon Pilgrim [Fri, 22 Jan 2021 10:04:58 +0000 (10:04 +0000)]
[X86][SSE] Add PR48823 HSUB test case

3 years ago[X86][SSE] Add v16i8 02_20_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu shuffle test
Simon Pilgrim [Thu, 21 Jan 2021 14:55:45 +0000 (14:55 +0000)]
[X86][SSE] Add v16i8 02_20_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu_uu shuffle test

3 years agoFix build failure caused by 2e080eb00ad76654313e0e119bb7fa0ffe2f9866
David Sherwood [Fri, 22 Jan 2021 09:56:26 +0000 (09:56 +0000)]
Fix build failure caused by 2e080eb00ad76654313e0e119bb7fa0ffe2f9866

3 years ago[JITLink][ELF/x86-64] Add support for weak and hidden symbols.
Lang Hames [Fri, 22 Jan 2021 09:04:18 +0000 (20:04 +1100)]
[JITLink][ELF/x86-64] Add support for weak and hidden symbols.

3 years ago[LegacyPM] Update InversedLastUser on the fly. NFC.
Jay Foad [Fri, 27 Nov 2020 17:32:01 +0000 (17:32 +0000)]
[LegacyPM] Update InversedLastUser on the fly. NFC.

This speeds up setLastUser enough to give a 5% to 10% speed up on
trivial invocations of opt and llc, as measured by:

perf stat -r 100 opt -S -o /dev/null -O3 /dev/null
perf stat -r 100 llc -march=amdgcn /dev/null -filetype null

Don't dump last use information unless -debug-pass=Details to avoid
printing lots of spam that will break some existing lit tests. Before
this patch, dumping last use information was broken anyway, because it
used InversedLastUser before it had been populated.

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

3 years ago[SVE] Add support for scalable vectorization of loops with selects and cmps
David Sherwood [Tue, 19 Jan 2021 15:38:03 +0000 (15:38 +0000)]
[SVE] Add support for scalable vectorization of loops with selects and cmps

I have removed an unnecessary assert in LoopVectorizationCostModel::getInstructionCost
that prevented a cost being calculated for select instructions when using
scalable vectors. In addition, I have changed AArch64TTIImpl::getCmpSelInstrCost
to only do special cost calculations for fixed width vectors and fall
back to the base version for scalable vectors.

I have added a simple cost model test for cmps and selects:

  test/Analysis/CostModel/sve-cmpsel.ll

and some simple tests that show we vectorize loops with cmp and select:

  test/Transforms/LoopVectorize/AArch64/sve-basic-vec.ll

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

3 years ago[APSInt][NFC] Clean up doxygen comments
Sven van Haastregt [Fri, 22 Jan 2021 09:23:41 +0000 (09:23 +0000)]
[APSInt][NFC] Clean up doxygen comments

Add a Doxygen class comment and clean up other Doxygen comments in
this file while we're at it.

3 years ago[AMDGPU] Fix the inconsistency in soffset for MUBUF stack accesses.
Christudasan Devadasan [Fri, 15 Jan 2021 10:32:29 +0000 (16:02 +0530)]
[AMDGPU] Fix the inconsistency in soffset for MUBUF stack accesses.

During instruction selection, there is an inconsistency in choosing
the initial soffset value. With certain early passes, this value is
getting modified and that brought additional fixup during
eliminateFrameIndex to work for all cases. This whole transformation
looks trivial and can be handled better.

This patch clearly defines the initial value for soffset and keeps it
unchanged before eliminateFrameIndex. The initial value must be zero
for MUBUF with a frame index. The non-frame index MUBUF forms that
use a raw offset from SP will have the stack register for soffset.
During frame elimination, the soffset remains zero for entry functions
with zero dynamic allocas and no callsites, or else is updated to the
appropriate frame/stack register.

Also, did some code clean up and made all asserts around soffset
stricter to match.

Reviewed By: scott.linder

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

3 years ago[RISCV] Fix intrinsic CodeGen test cases for vrgather
ShihPo Hung [Fri, 22 Jan 2021 07:26:32 +0000 (23:26 -0800)]
[RISCV] Fix intrinsic CodeGen test cases for vrgather

1. Op2 type in vrgather.vx should be XLEN instead of SEW
2. Add double type in vrgather-rv32 cases.

Reviewed By: craig.topper

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

3 years ago[clang][cli] Port visibility LangOptions to marshalling system
Jan Svoboda [Fri, 22 Jan 2021 08:13:34 +0000 (09:13 +0100)]
[clang][cli] Port visibility LangOptions to marshalling system

This patch introduces Clang-specific MarshallingInfoVisibility TableGen class.

Reviewed By: dexonsmith

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

3 years ago[TargetLowering] Use getBoolConstant instead of assuming zero or one for boolean...
Craig Topper [Fri, 22 Jan 2021 08:19:13 +0000 (00:19 -0800)]
[TargetLowering] Use getBoolConstant instead of assuming zero or one for boolean contents.

Noticed while I was touching other nearby code. I don't have a
test where this matters because the targets I work on
use zero or one boolean contents. And the tests cases I've seen
this fire on happen before type legalization where the result type
is MVT::i1 so the distinction doesn't matter.

3 years agoNFC: Remove simple_ilist comment mentioning ilist/iplist allocating
Nathan Lanza [Fri, 22 Jan 2021 08:22:50 +0000 (03:22 -0500)]
NFC: Remove simple_ilist comment mentioning ilist/iplist allocating

Allocation was removed from ilist in 2016 in the git commit
b5da00533510.

Reviewed By: dexonsmith

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

3 years agoUpdate filename to workers.py file in documentation
Douglas Yung [Fri, 22 Jan 2021 08:18:09 +0000 (00:18 -0800)]
Update filename to workers.py file in documentation

Commit be9f322e8dc530a56f03356aad31fa9031b27e26 moved the list of workers from
slaves.py to workers.py, but the documentation in "How To Add A Builder" was
never updated and now references a non-existing file. This fixes that.

Reviewed By: gkistanova

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

3 years ago[AMDGPU] Test clean up (NFC)
Christudasan Devadasan [Fri, 22 Jan 2021 07:24:16 +0000 (12:54 +0530)]
[AMDGPU] Test clean up (NFC)

3 years ago[TargetLowering] Simplify some code in SimplifySetCC that tries to handle SIGN_EXTEND...
Craig Topper [Fri, 22 Jan 2021 07:21:05 +0000 (23:21 -0800)]
[TargetLowering] Simplify some code in SimplifySetCC that tries to handle SIGN_EXTEND_INREG operand types that should never happen. NFCI

There was code to handle the first operand being different than
the result type. And code to handle first operand having the
same type as the type to extend from. This should never happen
for a correctly formed SIGN_EXTEND_INREG. I've replace the
code with asserts.

I also noticed we created the same APInt twice so I've reused it.

3 years ago[AArch64][GlobalISel] Implement widenScalar for signed overflow
Cassie Jones [Fri, 22 Jan 2021 06:55:00 +0000 (22:55 -0800)]
[AArch64][GlobalISel] Implement widenScalar for signed overflow

Implement widening for G_SADDO and G_SSUBO. Previously it was only
implemented for G_UADDO and G_USUBO. Also add legalize-add/sub tests for
narrow overflowing add/sub on AArch64.

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

3 years ago[mlir][StandardToSPIRV] Add support for lowering uitofp to SPIR-V
Hanhan Wang [Fri, 22 Jan 2021 06:20:18 +0000 (22:20 -0800)]
[mlir][StandardToSPIRV] Add support for lowering uitofp to SPIR-V

- Extend spirv::ConstantOp::getZero/One to handle float, vector of int, and vector of float.
- Refactor ZeroExtendI1Pattern to use getZero/One methods.
- Add one more test for lowering std.zexti which extends vector<4xi1> to vector<4xi64>.

Reviewed By: antiagainst

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