platform/upstream/llvm.git
3 years ago[lld-macho] Remove unnecessary llvm:: namespace prefixes
Jez Ng [Sat, 9 Jan 2021 16:58:19 +0000 (11:58 -0500)]
[lld-macho] Remove unnecessary llvm:: namespace prefixes

3 years ago[llvm] Drop unnecessary make_range (NFC)
Kazu Hirata [Sat, 9 Jan 2021 17:24:59 +0000 (09:24 -0800)]
[llvm] Drop unnecessary make_range (NFC)

3 years ago[Transforms] Use llvm::find_if (NFC)
Kazu Hirata [Sat, 9 Jan 2021 17:24:58 +0000 (09:24 -0800)]
[Transforms] Use llvm::find_if (NFC)

3 years ago[SCEV] Remove unused getOrInsertCanonicalInductionVariable (NFC)
Kazu Hirata [Sat, 9 Jan 2021 17:24:56 +0000 (09:24 -0800)]
[SCEV] Remove unused getOrInsertCanonicalInductionVariable (NFC)

The last use was removed on Mar 22, 2012 in commit
f47d0af5515bee47dfd000363740fe347bb6cd18.

3 years ago[SelectionDAG] Extend immAll(Ones|Zeros)V to handle ISD::SPLAT_VECTOR
Fraser Cormack [Wed, 6 Jan 2021 08:07:41 +0000 (08:07 +0000)]
[SelectionDAG] Extend immAll(Ones|Zeros)V to handle ISD::SPLAT_VECTOR

The TableGen immAllOnesV and immAllZerosV helpers implicitly wrapped the
ISD::isBuildVectorAll(Ones|Zeros) helper functions. This was inhibiting
their use for targets such as RISC-V which use ISD::SPLAT_VECTOR. In
particular, RISC-V had to define its own 'vnot' fragment.

In order to extend the scope of these nodes to include support for
ISD::SPLAT_VECTOR, two new ISD predicate functions have been introduced:
ISD::isConstantSplatVectorAll(Ones|Zeros). These effectively supersede
the older "isBuildVector" predicates, which are now simple wrappers for
the new functions. They pass a defaulted boolean toggle which preserves
the old behaviour. It is hoped that in time all call-sites can be ported
to the "isConstantSplatVector" functions.

While the use of ISD::isBuildVectorAll(Ones|Zeros) has not changed, the
behaviour of the TableGen immAll(Ones|Zeros)V **has**. To test the new
functionality, the custom RISC-V TableGen fragment has been removed and
replaced with the built-in 'vnot'. To test their use as pattern-roots, two
splat patterns have been updated accordingly.

Reviewed By: craig.topper

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

3 years ago[OpenMP] Added the support for cache line size 256 for A64FX
Shilei Tian [Sat, 9 Jan 2021 16:58:37 +0000 (11:58 -0500)]
[OpenMP] Added the support for cache line size 256 for A64FX

Fugaku supercomputer is built with the Fujitsu A64FX microprocessor, whose cache line is 256. In current libomp, we only have cache line size 128 for PPC64 and otherwise 64. This patch added the support of cache line 256 for A64FX. It's worth noting that although A64FX is a variant of AArch64, this property is not shared. As a result, in light of UCX source code (https://github.com/openucx/ucx/blob/392443ab92626412605dee1572056f79c897c6c3/src/ucs/arch/aarch64/cpu.c#L17), we can only determine by checking whether the CPU is FUJITSU A64FX.

Reviewed By: jdoerfert, Hahnfeld

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

3 years ago[RISCV] Do not grow the stack a second time when we need to realign the stack
Roger Ferrer Ibanez [Sat, 9 Jan 2021 16:49:05 +0000 (16:49 +0000)]
[RISCV] Do not grow the stack a second time when we need to realign the stack

This is a first change needed to fix a crash in which the emergency
spill splot ends being out of reach. This happens when we run the
register scavenger after we have eliminated the frame indexes. The fix
for the actual crash will come in a later change.

This change removes an extra stack size increase we do in
RISCVFrameLowering::determineFrameLayout.

We don't have to change the size of the stack here as
PEI::calculateFrameObjectOffsets is already doing this with the right
size accounting the extra alignment.

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

3 years ago[VPlan] Keep start value of VPWidenPHIRecipe as VPValue.
Florian Hahn [Sat, 9 Jan 2021 16:34:15 +0000 (16:34 +0000)]
[VPlan] Keep start value of VPWidenPHIRecipe as VPValue.

Similar to D92129, update VPWidenPHIRecipe  to manage the start value as
VPValue. This allows adjusting the start value as a VPlan transform,
which will be used in a follow-up patch to support reductions during
epilogue vectorization.

Reviewed By: gilr

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

3 years ago[clang][Sema] Compare SourceLocations directly [NFCI]
Mikhail Maltsev [Sat, 9 Jan 2021 14:13:18 +0000 (14:13 +0000)]
[clang][Sema] Compare SourceLocations directly [NFCI]

The ordered comparison operators are defined for the SourceLocation
class, so SourceLocation objects can be compared directly. There is no
need to extract the internal representation for comparison.

Reviewed By: aprantl

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

3 years ago[mlir][spirv] Replace SPIRVOpLowering with OpConversionPattern
Lei Zhang [Sat, 9 Jan 2021 13:04:49 +0000 (08:04 -0500)]
[mlir][spirv] Replace SPIRVOpLowering with OpConversionPattern

The dialect conversion framework was enhanced to handle type
conversion automatically. OpConversionPattern already contains
a pointer to the TypeConverter. There is no need to duplicate it
in a separate subclass. This removes the only reason for a
SPIRVOpLowering subclass. It adapts to use core infrastructure
and simplifies the code.

Also added a utility function to OpConversionPattern for getting
TypeConverter as a certain subclass.

Reviewed By: hanchung

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

3 years ago[WebAssembly] Remove unreachable EH pads
Heejin Ahn [Sun, 27 Dec 2020 10:52:43 +0000 (02:52 -0800)]
[WebAssembly] Remove unreachable EH pads

This removes unreachable EH pads in LateEHPrepare. This is not for
optimization but for preparation for CFGStackify. In CFGStackify, we
determine where to place `try` marker by computing the nearest common
dominator of all predecessors of an EH pad, but when an EH pad does not
have a predecessor, it becomes tricky. We can insert an empty dummy BB
before the EH pad and place the `try` there, but removing unreachable EH
pads is simpler.

This moves an existing exception label test from eh-label.mir to
exception.mir and adds a new test there.

This also adds some comments to existing methods.

Reviewed By: dschuff, tlively

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

3 years ago[RISCV] Add tests for scalable constant-folding (NFC)
Fraser Cormack [Sat, 9 Jan 2021 10:29:50 +0000 (10:29 +0000)]
[RISCV] Add tests for scalable constant-folding (NFC)

3 years ago[Test][FileCheck] Fix use of undef var
Thomas Preud'homme [Thu, 20 Aug 2020 19:41:43 +0000 (20:41 +0100)]
[Test][FileCheck] Fix use of undef var

The test related to directives with prefix NUMEXPR-CONSTRAINT-NOMATCH
refers to the numeric variable UNSI which is defined by a directive with
prefix CHECK not enabled on the lit command-line. Rather than adding the
prefix CHECK to the lit command-line, this commit defined variable UNSI
in a new NUMEXPR-CONSTRAINT-NOMATCH prefixed directive. The directive
needs to contain more than just the variable otherwise the error message
from FileCheck is about the wrong line being matched.

Reviewed By: jhenderson

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

3 years ago[WebAssembly] Update InstPrinter support for EH
Heejin Ahn [Sun, 27 Dec 2020 09:10:53 +0000 (01:10 -0800)]
[WebAssembly] Update InstPrinter support for EH

- Updates InstPrinter to handle `catch_all`.
- Makes `rethrow` condition an early exit from the function to make the
  rest simpler.
- Unify label and catch counters. They don't need to be counted
  separately and this will help `delegate` instruction later.
- Removes `LastSeenEHInst` field. This was first introduced to handle
  when there are more than one `catch` blocks per `try`, but this was
  not implemented correctly and not being used at the moment anyway.
- Reenables all tests in cfg-stackify-eh.ll that don't deal with unwind
  destination mismatches, which will be handled in a later CL.

Reviewed By: dschuff, tlively, aardappel

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

3 years ago[mlir] AsyncRuntime: use LLVM ThreadPool to run async tasks
Eugene Zhulenev [Fri, 8 Jan 2021 23:23:59 +0000 (15:23 -0800)]
[mlir] AsyncRuntime: use LLVM ThreadPool to run async tasks

Revert https://reviews.llvm.org/D92368 after the dynamic library unloading was fixed in https://reviews.llvm.org/D94312

Reviewed By: mehdi_amini

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

3 years ago[WebAssembly] Remove exnref and br_on_exn
Heejin Ahn [Sat, 26 Dec 2020 04:23:33 +0000 (20:23 -0800)]
[WebAssembly] Remove exnref and br_on_exn

This removes `exnref` type and `br_on_exn` instruction. This is
effectively NFC because most uses of these were already removed in the
previous CLs.

Reviewed By: dschuff, tlively

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

3 years ago[WebAssembly] Update basic EH instructions for the new spec
Heejin Ahn [Sat, 26 Dec 2020 10:27:44 +0000 (02:27 -0800)]
[WebAssembly] Update basic EH instructions for the new spec

This implements basic instructions for the new spec.

- Adds new versions of instructions: `catch`, `catch_all`, and `rethrow`
- Adds support for instruction selection for the new instructions
 - `catch` needs a custom routine for the same reason `throw` needs one,
   to encode `__cpp_exception` tag symbol.
- Updates `WebAssembly::isCatch` utility function to include `catch_all`
  and Change code that compares an instruction's opcode with `catch` to
  use that function.
- LateEHPrepare
  - Previously in LateEHPrepare we added `catch` instruction to both
    `catchpad`s (for user catches) and `cleanuppad`s (for destructors).
    In the new version `catch` is generated from `llvm.catch` intrinsic
    in instruction selection phase, so we only need to add `catch_all`
    to the beginning of cleanup pads.
  - `catch` is generated from instruction selection, but we need to
    hoist the `catch` instruction to the beginning of every EH pad,
    because `catch` can be in the middle of the EH pad or even in a
    split BB from it after various code transformations.
  - Removes `addExceptionExtraction` function, which was used to
    generate `br_on_exn` before.
- CFGStackfiy: Deletes `fixUnwindMismatches` function. Running this
  function on the new instruction causes crashes, and the new version
  will be added in a later CL, whose contents will be completely
  different. So deleting the whole function will make the diff easier to
  read.
- Reenables all disabled tests in exception.ll and eh-lsda.ll and a
  single basic test in cfg-stackify-eh.ll.
- Updates existing tests to use the new assembly format. And deletes
  `br_on_exn` instructions from the tests and FileCheck lines.

Reviewed By: dschuff, tlively

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

3 years agoFix CodeGenCXX/difile_entry.cpp on Windows
Fangrui Song [Sat, 9 Jan 2021 08:46:02 +0000 (00:46 -0800)]
Fix CodeGenCXX/difile_entry.cpp on Windows

3 years agoMake -fno-pic respect -fno-direct-access-external-data
Fangrui Song [Sat, 9 Jan 2021 08:32:02 +0000 (00:32 -0800)]
Make -fno-pic respect -fno-direct-access-external-data

D92633 added -f[no-]direct-access-external-data to supersede -m[no-]pie-copy-relocations.
(The option works for -fpie but is a no-op for -fno-pic and -fpic.)

This patch makes -fno-pic -fno-direct-access-external-data drop dso_local from
global variable declarations. This usually causes the backend to emit a GOT
indirection for external data access. With a GOT relocation, the subsequent
-no-pie link will not have copy relocation even if the data symbol turns out to
be defined by a shared object.

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

3 years agoAdd -f[no-]direct-access-external-data to supersede -mpie-copy-relocations
Fangrui Song [Sat, 9 Jan 2021 08:29:09 +0000 (00:29 -0800)]
Add -f[no-]direct-access-external-data to supersede -mpie-copy-relocations

GCC r218397 "x86-64: Optimize access to globals in PIE with copy reloc" made
-fpie code emit R_X86_64_PC32 to reference external data symbols by default.
Clang adopted -mpie-copy-relocations D19996 as a flexible alternative.

The name -mpie-copy-relocations can be improved [1] and does not capture the
idea that this option can apply to -fno-pic and -fpic [2], so this patch
introduces -f[no-]direct-access-external-data and makes -mpie-copy-relocations
their aliases for compatibility.

[1]
For
```
extern int var;
int get() { return var; }
```
if var is defined in another translation unit in the link unit, there is no copy
relocation.

[2]
-fno-pic -fno-direct-access-external-data is useful to avoid copy relocations.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65888
If a shared object is linked with -Bsymbolic or --dynamic-list and exports a
data symbol, normally the data symbol cannot be accessed by -fno-pic code
(because by default an absolute relocation is produced which will lead to a copy
relocation). -fno-direct-access-external-data can prevent copy relocations.

-fpic -fdirect-access-external-data can avoid GOT indirection. This is like the
undefined counterpart of -fno-semantic-interposition. However, the user should
define var in another translation unit and link with -Bsymbolic or
--dynamic-list, otherwise the linker will error in a -shared link. Generally
the user has better tools for their goal but I want to mention that this
combination is valid.

On COFF, the behavior is like always -fdirect-access-external-data.
`__declspec(dllimport)` is needed to enable indirect access.

There is currently no plan to affect non-ELF behaviors or -fpic behaviors.

-fno-pic -fno-direct-access-external-data will be implemented in the subsequent patch.

GCC feature request https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98112

Reviewed By: tmsriram

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

3 years ago[WebAssembly] Update WasmEHPrepare for the new spec
Heejin Ahn [Sat, 26 Dec 2020 02:38:59 +0000 (18:38 -0800)]
[WebAssembly] Update WasmEHPrepare for the new spec

Clang generates `wasm.get.exception` and `wasm.get.ehselector`
intrinsics, which respectively return a caught exception value (a
pointer to some C++ exception struct) and a selector (an integer value
that tells which C++ `catch` clause the current exception matches, or
does not match any).

WasmEHPrepare is a pass that does some IR-level preparation before
instruction selection. Previously one of things we did in this pass was
to convert `wasm.get.exception` intrinsic calls to
`wasm.extract.exception` intrinsics. Their semantics were the same
except `wasm.extract.exception` did not have a token argument. We
maintained these two separate intrinsics with the same semantics because
instruction selection couldn't handle token arguments. This
`wasm.extract.exception` intrinsic was later converted to
`extract_exception` instruction in instruction selection, which was a
pseudo instruction to implement `br_on_exn`. Because `br_on_exn` pushed
an extracted value onto the value stack after the `end` instruction of a
`block`, but LLVM does not have a way of modeling that kind of behavior,
so this pseudo instruction was used to pull an extracted value out of
thin air, like this:
```
block $l0
  ...
  br_on_exn $cpp_exception $l0
  ...
end
extract_exception ;; pushes values onto the stack
```

In the new spec, we don't need this pseudo instruction anymore because
`catch` itself returns a value and we don't have `br_on_exn` anymore. In
the spec `catch` returns multiple values (like `br_on_exn`), but here we
assume it only returns a single i32, which is sufficient to support C++.

So this renames `wasm.get.exception` intrinsic to `wasm.catch`. Because
this CL does not yet contain instruction selection for `wasm.catch`
intrinsic, all `RUN` lines in exception.ll, eh-lsda.ll, and
cfg-stackify-eh.ll, and a single `RUN` line in wasm-eh.cpp (which is an
end-to-end test from C++ source to assembly) fail. So this CL
temporarily disables those `RUN` lines, and for those test files without
any valid remaining `RUN` lines, adds a dummy `RUN` line to make them
pass. These tests will be reenabled in later CLs.

Reviewed By: dschuff, tlively

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

3 years ago[IR] Delete unused ReplaceLast in DebugLoc::appendInlineAt
Fangrui Song [Sat, 9 Jan 2021 07:28:22 +0000 (23:28 -0800)]
[IR] Delete unused ReplaceLast in DebugLoc::appendInlineAt

Not used after r304488

3 years agoRevert "This adds a new test checking llvm-symbolizer with an object built with basic...
Sriraman Tallam [Sat, 9 Jan 2021 06:33:53 +0000 (22:33 -0800)]
Revert "This adds a new test checking llvm-symbolizer with an object built with basic block sections."

This reverts commit 1816de08232673e97ec41287ad3f6494bceaec43.

This breaks on ppc64 and windows  although x86-registered-target is
mentioned.  I will re-commit after fixing.

3 years agoThis adds a new test checking llvm-symbolizer with an object built with basic block...
Sriraman Tallam [Sat, 9 Jan 2021 05:52:34 +0000 (21:52 -0800)]
This adds a new test checking llvm-symbolizer with an object built with basic block sections.

Build a object with -fbasic-block-sections and reorder the basic blocks to be
non-contiguous. Then check if llvm-symbolizer correctly reports the symbolized
addresses. Included the source to build the object with command lines.

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

3 years agoPR47391: Canonicalize DIFiles
Umesh Kalappa [Sat, 9 Jan 2021 05:41:13 +0000 (21:41 -0800)]
PR47391: Canonicalize DIFiles

Like @aprantl suggested, modify to  use the canonicalized DIFile, if we
don't know the  loc info and filename for the compiler generated
functions for example static initialization functions.

Reviewed By: dblaikie, aprantl

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

3 years ago[DWARFLinker] Link against BinaryFormat
Jonas Devlieghere [Sat, 9 Jan 2021 02:57:36 +0000 (18:57 -0800)]
[DWARFLinker] Link against BinaryFormat

3 years ago[debugserver] Various plist changes
Jonas Devlieghere [Sat, 9 Jan 2021 02:53:08 +0000 (18:53 -0800)]
[debugserver] Various plist changes

 - Remove unused plists that were referenced (but unused) by Xcode.
 - Move all debugserver plists unders tools/debugserver/resources.
 - Add the ability to distinguish between com.apple.security.cs.debugger
   and com.apple.private.cs.debugger.

rdar://66082043

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

3 years ago[DWARFLinker] Print the unsupport DWARF form as part of the warning
Jonas Devlieghere [Fri, 8 Jan 2021 19:35:46 +0000 (11:35 -0800)]
[DWARFLinker] Print the unsupport DWARF form as part of the warning

3 years ago[SCEV] Remove unused getExactExistingExpansion (NFC)
Kazu Hirata [Sat, 9 Jan 2021 02:39:57 +0000 (18:39 -0800)]
[SCEV] Remove unused getExactExistingExpansion (NFC)

The last use was removed on Sep 4, 2018 in commit
2cbba5633753552a984572c8b9a5997e5c96496d.

3 years ago[Tablegen] Use llvm::find_if (NFC)
Kazu Hirata [Sat, 9 Jan 2021 02:39:55 +0000 (18:39 -0800)]
[Tablegen] Use llvm::find_if (NFC)

3 years ago[Target, Transforms] Use *Set::contains (NFC)
Kazu Hirata [Sat, 9 Jan 2021 02:39:53 +0000 (18:39 -0800)]
[Target, Transforms] Use *Set::contains (NFC)

3 years ago[RISCV] Optimize multiplication with constant
Ben Shi [Sat, 9 Jan 2021 02:37:21 +0000 (10:37 +0800)]
[RISCV] Optimize multiplication with constant

1. Break MUL with specific constant to a SLLI and an ADD/SUB on riscv32
   with the M extension.
2. Break MUL with specific constant to two SLLI and an ADD/SUB, if the
   constant needs a pair of LUI/ADDI to construct.

Reviewed by: craig.topper

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

3 years ago[clangd][NFC] Remove unnecessary copy in CodeComplete
Nathan James [Sat, 9 Jan 2021 02:32:23 +0000 (02:32 +0000)]
[clangd][NFC] Remove unnecessary copy in CodeComplete

All tests still pass with ASAN so fairly confident no use-after-free going on here.

3 years ago[X86] Remove IntrArgMemOnly from ldmxcsr intrinsic.
Craig Topper [Sat, 9 Jan 2021 01:47:12 +0000 (17:47 -0800)]
[X86] Remove IntrArgMemOnly from ldmxcsr intrinsic.

Since we're leaving this as ReadWrite with the "write" reflecting
the update to MXCSR, we shouldn't say it only writes arg memory.

Hopefully this fixes the issue reported in post-commit in D93571.

3 years ago[AMDGPU] Add volatile support to SIMemoryLegalizer
Tony [Sat, 19 Dec 2020 02:05:11 +0000 (02:05 +0000)]
[AMDGPU] Add volatile support to SIMemoryLegalizer

Treat a non-atomic volatile load and store as a relaxed atomic at
system scope for the address spaces accessed. This will ensure all
relevant caches will be bypassed.

A volatile atomic is not changed and still only bypasses caches upto
the level specified by the SyncScope operand.

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

3 years agoNever call a destroying operator delete when cleaning up from an
Richard Smith [Sat, 9 Jan 2021 00:41:31 +0000 (16:41 -0800)]
Never call a destroying operator delete when cleaning up from an
exception thrown during construction in a new-expression.

Instead, when performing deallocation function lookup for a
new-expression, ignore all destroying operator delete candidates, and
fall back to global operator delete if there is no member operator
delete other than a destroying operator delete.

Use of destroying operator delete only makes sense when there is an
object to destroy, which there isn't in this case. The language wording
doesn't cover this case; this oversight has been reported to WG21, with
the approach in this patch as the proposed fix.

3 years ago[libc][NFC] add includes for internal headers to all libc functions
Michael Jones [Sat, 9 Jan 2021 00:35:00 +0000 (00:35 +0000)]
[libc][NFC] add includes for internal headers to all libc functions

this will make sure that all of the functions are using the correct
prototypes. Explained much better in the comments of this diff:
https://reviews.llvm.org/D94195

3 years ago[libc] Switch to use a macro which does not insert a section for every libc function.
Michael Jones [Wed, 23 Dec 2020 18:46:09 +0000 (18:46 +0000)]
[libc] Switch to use a macro which does not insert a section for every libc function.

Summary:
The new macro also inserts the C alias for the C++ implementations
without needing an objcopy based post processing step. The CMake
rules have been updated to reflect this. More CMake cleanup can be
taken up in future rounds and appropriate TODOs have been added for them.

Reviewers: mcgrathr, sivachandra

Subscribers:

3 years ago[lld-macho] Fix TLV data initialization
Jez Ng [Fri, 8 Jan 2021 23:47:40 +0000 (18:47 -0500)]
[lld-macho] Fix TLV data initialization

We were mishandling the case where both `__tbss` and `__thread_data` sections were
present.

TLVP relocations should be encoded as offsets from the start of `__thread_data`,
even if the symbol is actually located in `__thread_bss`. Previously, we were
writing the offset from the start of the containing section, which doesn't
really make sense since there's no way `tlv_get_addr()` can know which section a
given `tlv$init` symbol is in at runtime.

In addition, this patch ensures that we place `__thread_data` immediately before
`__thread_bss`. This is what ld64 does, likely for performance reasons. Zerofill
sections must also be at the end of their segments; we were already doing this,
but now we ensure that `__thread_bss` occurs before `__bss`, so that it's always
possible to have it contiguous with `__thread_data`.

Fixes llvm.org/PR48657.

Reviewed By: #lld-macho, thakis

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

3 years ago[NewPM] Run ObjC ARC passes
Arthur Eubanks [Wed, 23 Dec 2020 05:41:25 +0000 (21:41 -0800)]
[NewPM] Run ObjC ARC passes

Match the legacy PM in running various ObjC ARC passes.

This requires making some module passes into function passes. These were
initially ported as module passes since they add function declarations
(e.g. https://reviews.llvm.org/D86178), but that's still up for debate
and other passes do so.

Reviewed By: ahatanak

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

3 years agoUpdate the maximum integer bitwidth in MLIR.
Andrew Lenharth [Tue, 5 Jan 2021 21:15:45 +0000 (15:15 -0600)]
Update the maximum integer bitwidth in MLIR.

Large integers are generated in Circt commonly which exceed 4kbits.  This aligns the maximum bitwidth in MLIR and LLVM.

Reviewed By: rriddle, lattner, mehdi_amini

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

3 years agoAttempt to complete an incomplete expression type when considering a
Richard Smith [Fri, 8 Jan 2021 23:17:54 +0000 (15:17 -0800)]
Attempt to complete an incomplete expression type when considering a
reference binding to an expression.

We need to know the array bound in order to determine whether the
parameter type is reference-compatible with the argument type, so we
need to trigger instantiation in this case.

3 years ago[InitLLVM] Ensure SIGPIPE handler installed before sigaction()
Vedant Kumar [Fri, 8 Jan 2021 19:08:52 +0000 (11:08 -0800)]
[InitLLVM] Ensure SIGPIPE handler installed before sigaction()

The pipe signal handler must be installed before any other handlers are
registered. This is because the Unix RegisterHandlers function does not
perform a sigaction() for SIGPIPE unless a one-shot handler is present,
to allow long-lived processes (like lldb) to fully opt-out of llvm's
SIGPIPE handling and ignore the signal safely.

Fixes a bug introduced in D70277.

Tested by running Nick's test case:

% xcrun ./bin/clang -E -fno-integrated-cc1 x.c | tee foo.txt | head

I verified that child cc1 process exits with IO_ERR, and that the parent
recognizes the error code, exiting cleanly.

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

3 years ago[libc++] NFC: Document the Differential queries to avoid duplicating work
Louis Dionne [Fri, 8 Jan 2021 22:23:16 +0000 (17:23 -0500)]
[libc++] NFC: Document the Differential queries to avoid duplicating work

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

3 years ago[mlir][PassManager] Properly set the initialization generation when cloning a pass...
River Riddle [Fri, 8 Jan 2021 22:41:14 +0000 (14:41 -0800)]
[mlir][PassManager] Properly set the initialization generation when cloning a pass manager

Fixes a bug where dynamic pass pipelines of cloned pass managers weren't being initialized properly.

3 years ago[libc++] Mark [P0809] "LWG2831: Comparing Unordered Containers" as Nothing To Do.
Arthur O'Dwyer [Sat, 26 Dec 2020 01:39:36 +0000 (20:39 -0500)]
[libc++] Mark [P0809] "LWG2831: Comparing Unordered Containers" as Nothing To Do.

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0809r0.pdf

This issue/paper simply removed some library UB because vendors were
already doing the right thing. libc++ has always done the right thing
(in this respect).

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

3 years ago[libc++] Mark [P0475] "LWG2511: guaranteed copy elision for piecewise construction...
Arthur O'Dwyer [Fri, 25 Dec 2020 21:22:54 +0000 (16:22 -0500)]
[libc++] Mark [P0475] "LWG2511: guaranteed copy elision for piecewise construction" as Complete.

The point of LWG2511 is basically just to make sure that we use
`tuple<Args&&...>` instead of `tuple<Args...>` in a couple of places
inside `scoped_allocator_adaptor` and inside `pair`.
As far as I can tell, this has been true for libc++
since EricWF's D27612 (and maybe even earlier than that).

3 years agoRe-enable __cpp_lib_constexpr_functional.
Arthur O'Dwyer [Fri, 8 Jan 2021 22:28:19 +0000 (17:28 -0500)]
Re-enable __cpp_lib_constexpr_functional.

I accidentally disabled this feature-test macro in my D93830,
due to a rebasing conflict. It had been enabled by my D93815,
and should have remained enabled.

3 years ago[libc++/abi] Re-remove unnecessary null pointer checks from operator delete
Louis Dionne [Thu, 17 Dec 2020 18:26:47 +0000 (13:26 -0500)]
[libc++/abi] Re-remove unnecessary null pointer checks from operator delete

In 7cd67904f776, we removed the unnecessary nullptr checks from the libc++abi
definition of operator delete, but we forgot to update the definition in
libc++ (damn code duplication!). Then, in d4a1e03c5fb5, I synced the
definitions across libc++ and libc++abi, but I did it the wrong way around.
I re-added the if() checks to libc++abi instead of removing them from libc++.

In ef74f0fdc339, we re-removed the if() check from operator delete, but
only in libc++abi. This patch corrects this mess and removes it
consistently in libc++ and libc++abi.

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

3 years ago[mlir] AsyncRuntime: disable mlir-runner init/disable for WIN32
Eugene Zhulenev [Fri, 8 Jan 2021 22:02:25 +0000 (14:02 -0800)]
[mlir] AsyncRuntime: disable mlir-runner init/disable for WIN32

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

3 years ago[mlir][vector] generalized masked l/s and compressed l/s with indices
Aart Bik [Fri, 8 Jan 2021 18:26:57 +0000 (10:26 -0800)]
[mlir][vector] generalized masked l/s and compressed l/s with indices

Adding the ability to index the base address brings these operations closer
to the transfer read and write semantics (with lowering advantages), ensures
more consistent use in vector MLIR code (easier to read), and reduces the
amount of code duplication to lower memrefs into base addresses considerably
(making codegen less error-prone).

Reviewed By: ThomasRaoux

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

3 years ago[mlir] Add a hook for initializing passes before execution and use it in the Canonica...
River Riddle [Fri, 8 Jan 2021 21:24:07 +0000 (13:24 -0800)]
[mlir] Add a hook for initializing passes before execution and use it in the Canonicalizer

This revision adds a new `initialize(MLIRContext *)` hook to passes that allows for them to initialize any heavy state before the first execution of the pass. A concrete use case of this is with patterns that rely on PDL, given that PDL is compiled at run time it is imperative that compilation results are cached as much as possible. The first use of this hook is in the Canonicalizer, which has the added benefit of reducing the number of expensive accesses to the context when collecting patterns.

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

3 years agoDon't take the address of a temporary
Adrian Prantl [Fri, 8 Jan 2021 21:14:52 +0000 (13:14 -0800)]
Don't take the address of a temporary

3 years ago[mlir:JitRunner] Use custom shared library init/destroy functions if available
Eugene Zhulenev [Fri, 8 Jan 2021 16:18:39 +0000 (08:18 -0800)]
[mlir:JitRunner] Use custom shared library init/destroy functions if available

Use custom mlir runner init/destroy functions to safely init and destroy shared libraries loaded by the JitRunner.

This mechanism is ignored for Windows builds (for now) because init/destroy functions are not exported, and library unloading relies on static destructors.

Re-submit https://reviews.llvm.org/D94270 with a temporary workaround for windows

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

3 years ago[Driver] Add DWARF64 flag: -gdwarf64
Hongtao Yu [Fri, 8 Jan 2021 20:58:03 +0000 (12:58 -0800)]
[Driver] Add DWARF64 flag: -gdwarf64

@ikudrin enabled support for dwarf64 in D87011.  Adding a clang flag so it can be used through that compilation pass.

Reviewed By: MaskRay

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

3 years ago[compiler-rt] [sanitizer] Silence -Wframe-larger-than= for a few windows functions...
Martin Storsjö [Fri, 20 Nov 2020 09:33:35 +0000 (11:33 +0200)]
[compiler-rt] [sanitizer] Silence -Wframe-larger-than= for a few windows functions with large stack buffers

Also update a documentation url while touching code nearby, as
requested in review.

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

3 years agoAPINotes: annotate dump methods (NFC)
Saleem Abdulrasool [Fri, 8 Jan 2021 20:44:32 +0000 (20:44 +0000)]
APINotes: annotate dump methods (NFC)

This annotates the dump methods in APINotes to indicate that they are
unused as they are meant for debugging purposes.  This avoids an
unnecessary warning.

3 years ago[mlir][PDL] Use ODS for defining PDL types
River Riddle [Fri, 8 Jan 2021 20:29:47 +0000 (12:29 -0800)]
[mlir][PDL] Use ODS for defining PDL types

This removes the need to define these classes and their parser/printers in C++.

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

3 years ago[NFC] Specify C11 in loop-opt-setup.c
Matthew Voss [Fri, 8 Jan 2021 18:29:30 +0000 (10:29 -0800)]
[NFC] Specify C11 in loop-opt-setup.c

This test was failing in our internal CI, since our driver does not default to
C11. Adding this switch fixes the issue.

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

3 years ago[clangd] Add go-to-def metric.
Haojian Wu [Tue, 5 Jan 2021 09:26:20 +0000 (10:26 +0100)]
[clangd] Add go-to-def metric.

to track the number of different "special" go-to-def request.

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

3 years ago[mlir][Linalg] NFC: Refactor fusion of LinalgOp with TensorReshapeOp by expansion.
MaheshRavishankar [Fri, 8 Jan 2021 19:56:48 +0000 (11:56 -0800)]
[mlir][Linalg] NFC: Refactor fusion of LinalgOp with TensorReshapeOp by expansion.

Change the implementation of LinalgOp with TensorReshapeOp by
expansion to be more modular and easier to follow.

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

3 years ago[NFC] Disallow unused prefixes in CodeGen/AMDGPU
Mircea Trofin [Thu, 7 Jan 2021 18:29:39 +0000 (10:29 -0800)]
[NFC] Disallow unused prefixes in CodeGen/AMDGPU

This adds the lit config, and cleans up remaining tests.

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

3 years ago[RISCV] Cleanup a few section comments in RISCVInstrInfoVPseudos.td. NFC
Craig Topper [Fri, 8 Jan 2021 19:36:24 +0000 (11:36 -0800)]
[RISCV] Cleanup a few section comments in RISCVInstrInfoVPseudos.td. NFC

3 years ago[CMake] Fix incorrect rpath for tests if LLVM_LOCAL_RPATH isn't set
Raul Tambre [Fri, 8 Jan 2021 19:19:42 +0000 (21:19 +0200)]
[CMake] Fix incorrect rpath for tests if LLVM_LOCAL_RPATH isn't set

d9ce31ae7d (D94322) removed the check because I thought it was dead
due to checking the existance of a variable (which always existed).

This causes LLDB tests to fail as they set NO_INSTALL_RPATH because
they're never meant to be installed, but we still would end up using
the install rpath.

Add the check back and make it explicitly check for an empty value
to make the purpose clearer and avoid implicit test for a false/true
value.

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

3 years ago[Signal] Re-raise SIGPIPE if the handler is uninstalled
Vedant Kumar [Fri, 8 Jan 2021 19:12:08 +0000 (11:12 -0800)]
[Signal] Re-raise SIGPIPE if the handler is uninstalled

Instead of falling through to RunSignalHandlers after the SIGPIPE
handler is uninstalled and we get a SIGPIPE, re-raise the signal, just
like we do for other IntSigs.

This was discussed and informally OK'd here:

https://reviews.llvm.org/rG9a3f892d018238dce5181e458905311db8e682f5#856804

3 years ago[mlir][Linalg] Add verification checks to disallow illegal reshape ops.
MaheshRavishankar [Fri, 8 Jan 2021 18:52:26 +0000 (10:52 -0800)]
[mlir][Linalg] Add verification checks to disallow illegal reshape ops.

The existing verification of reshape ops in linalg (linalg.reshape and
linalg.tensor_reshape) allows specification of illegal ops, where
- A dynamic dimension is expanded into multiple dynamic
  dimensions. This is ill-specified.
- A static dimension is expanded into dynamic dimension or viceversa,
- The product of extents of the static dimensions in the expanded type
  doesnt match the static dimension of the collapsed type.
Making all of these illegal. This also implies that some pessimization
in canonicalization due to incomplete semantics of the operation can
be dropped.

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

3 years agoRe-land "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"
Raul Tambre [Fri, 8 Jan 2021 18:18:25 +0000 (20:18 +0200)]
Re-land "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"

Reverted check for empty CMAKE_BUILD_RPATH fixed.

When `BUILD_WITH_INSTALL_RPATH` is enabled it prevents using a custom rpath only
for the build tree as the install rpath will be used. This makes it impossible to run a
runtimes build when compiling with Clang and wanting the installed rpath to be
empty (i.e. `-DCMAKE_BUILD_RPATH="<some path>" -DCMAKE_SKIP_INSTALL_RPATH=ON`).

Disable `BUILD_WITH_INSTALL_RPATH` when `CMAKE_BUILD_RPATH` is non-empty to
allow for such build scenarios.

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

3 years ago[TableGen] Fix use of *CurRec when CurRec is null.
Paul C. Anagnostopoulos [Fri, 8 Jan 2021 18:20:27 +0000 (13:20 -0500)]
[TableGen] Fix use of *CurRec when CurRec is null.

I cannot build with the undefined sanitizer on Visual Studio.

3 years ago[ARM] Custom lower i1 vector truncates
David Green [Fri, 8 Jan 2021 18:21:00 +0000 (18:21 +0000)]
[ARM] Custom lower i1 vector truncates

The ISel patterns we have for truncating to i1's under MVE do not seem
to be correct. Instead custom lower to icmp(ne, and(x, 1), 0).

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

3 years ago[flang] Fix bogus message on internal subprogram with alternate return
Peter Steinfeld [Mon, 4 Jan 2021 17:35:15 +0000 (09:35 -0800)]
[flang] Fix bogus message on internal subprogram with alternate return

Internal subprograms have explicit interfaces.  If an internal subprogram has
an alternate return, we check its explicit interface.  But we were not
putting the label values of alternate returns into the actual argument.

I fixed this by changing the definition of actual arguments to be able
to contain a common::Label and putting the label for an alternate return
into the actual argument.

I also verified that we were already doing all of the semantic checking
required for alternate returns and removed a "TODO" for this.

I also added the test altreturn06.f90.

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

3 years ago[lldb] Remove stale LLDB-Info.plist
Jonas Devlieghere [Fri, 8 Jan 2021 17:43:08 +0000 (09:43 -0800)]
[lldb] Remove stale LLDB-Info.plist

Remove the stale LLDB-Info.plist which was only used by TestHelp.py. The
latter would try to parse the version number from the plist and use that
to verify the version in the help output. Of course this never matched
so it would fall back to matching any arbitrary version.

This patch does *not* change the real LLDB-Info.plist.in file which is
used for the LLDB Framework.

3 years ago[libc++] LWG2070: Use Allocator construction for objects created with allocate_shared
Louis Dionne [Fri, 11 Dec 2020 17:22:16 +0000 (12:22 -0500)]
[libc++] LWG2070: Use Allocator construction for objects created with allocate_shared

This patch updates `allocate_shared` to call `allocator_traits::construct`
when creating the object held inside the shared_pointer, and
`allocator_traits::destroy` when destroying it. This resolves
the part of P0674R1 that was originally filed as LWG2070.

This change is landed separately from the rest of P0674R1 because it is
incredibly tricky from an ABI perspective.

This is the reason why this change is so tricky is that we previously
used EBO in a compressed pair to store both the allocator and the object
type stored in the `shared_ptr`. However, starting in C++20, P0674
requires us to use Allocator construction for initializing the object type.
That requirement rules out the use of the EBO for the object type, since
using the EBO implies that the base will be initialized when the control
block is initialized (and hence we can't do it through Allocator construction).
Hence, supporting P0674 requires changing how we store the object type
inside the control block, which we do while being ABI compatible by using
some trickery with a properly aligned char buffer.

Fixes https://llvm.org/PR41900
Supersedes https://llvm.org/D62760

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

3 years ago[libc++] Add basic support for -std=c++2b.
Marek Kurdej [Fri, 8 Jan 2021 17:40:42 +0000 (18:40 +0100)]
[libc++] Add basic support for -std=c++2b.

* Add feature test macros.
* Add buildbot configuration generic-cxx2b that uses clang-tot.

Reviewed By: ldionne, #libc

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

3 years agoRevert "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"
Raul Tambre [Fri, 8 Jan 2021 17:54:52 +0000 (19:54 +0200)]
Revert "[CMake] Don't enable BUILD_WITH_INSTALL_RPATH when using custom build rpath"

This reverts commit 0ebc1fb29f278db0665423f15c53e6ee9601dddb.

The behaviour should have been the same as before unless specifying CMAKE_BUILD_RPATH,
which was previously broken.
However, this seems to have broken builds for some people that don't specify it.
Reverting until I can investigate.

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

3 years ago[VPlan] Move reduction start value creation to widenPHIRecipe.
Florian Hahn [Fri, 8 Jan 2021 17:40:20 +0000 (17:40 +0000)]
[VPlan] Move reduction start value creation to widenPHIRecipe.

This was suggested to prepare for D93975.

By moving the start value creation to widenPHInstruction, we set the
stage to manage the start value directly in VPWidenPHIRecipe, which be
used subsequently to set the 'resume' value for reductions during
epilogue vectorization.

It also moves RdxDesc to the recipe, so we do not have to rely on Legal
to look it up later.

Reviewed By: gilr

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

3 years ago[X86] Add TLBSYNC, INVLPGB and SNP instructions
Ganesh Gopalasubramanian [Fri, 8 Jan 2021 16:40:28 +0000 (22:10 +0530)]
[X86] Add TLBSYNC, INVLPGB and SNP instructions

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

3 years ago[lldb] Bump the required SWIG version to 3
Jonas Devlieghere [Fri, 8 Jan 2021 16:46:19 +0000 (08:46 -0800)]
[lldb] Bump the required SWIG version to 3

Bump the required SWIG version to 3. If my memory serves me well we last
bumped the required SWIG version to 2 for Python 3. At that time SWIG 3
had already been around for a while so everyone I know was already using
that.

It appears that SWIG 3 is the only version that officially supports
C++11 which we're using in the typemap. SWIG 3 was released in 2014 so I
think it's reasonable to make that the minimum required version.

https://bugs.llvm.org/show_bug.cgi?id=48685

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

3 years ago[libc++] Update generate_feature_test_macro_components.py to match SD-6.
Arthur O'Dwyer [Thu, 7 Jan 2021 23:21:07 +0000 (18:21 -0500)]
[libc++] Update generate_feature_test_macro_components.py to match SD-6.

It's still a little confusing because in many cases C++17 and C++20
have different values, and libc++ implements the C++17 behavior but
not the C++20 behavior; 'unimplemented' can't represent that scenario.
Ultimately we probably ought to completely redesign the script to be
in terms of paper numbers, rather than language revisions, and make
it generate the CSV files like "Cxx2aStatusPaperStatus.csv" as well.

Most newly added macros are unimplemented. I've marked a few as implemented,
though, based on my reading of the code; for example I was pretty sure
`__cpp_lib_latch` is implemented since we have `<latch>`.

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

3 years ago[mlir] replace LLVM dialect float types with built-ins
Alex Zinenko [Wed, 6 Jan 2021 15:21:08 +0000 (16:21 +0100)]
[mlir] replace LLVM dialect float types with built-ins

Continue the convergence between LLVM dialect and built-in types by replacing
the bfloat, half, float and double LLVM dialect types with their built-in
counterparts. At the API level, this is a direct replacement. At the syntax
level, we change the keywords to `bf16`, `f16`, `f32` and `f64`, respectively,
to be compatible with the built-in type syntax. The old keywords can still be
parsed but produce a deprecation warning and will be eventually removed.

Depends On D94178

Reviewed By: mehdi_amini, silvas, antiagainst

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

3 years ago[clangd] Add missing "override" to fix the build.
Adam Czachorowski [Fri, 8 Jan 2021 16:21:02 +0000 (17:21 +0100)]
[clangd] Add missing "override" to fix the build.

Follow-up to d4af86581e80ef0f7a6f4a4fff1c97260a726e71

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

3 years ago[ConstProp] Constant propagation for get.active.lane.mask instrinsics
David Green [Fri, 8 Jan 2021 16:10:01 +0000 (16:10 +0000)]
[ConstProp] Constant propagation for get.active.lane.mask instrinsics

Similar to the Arm VCTP intrinsics, if the operands of an
active.lane.mask are both known, the constant lane mask can be
calculated. This can come up after unrolling the loops.

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

3 years ago[clangd] Fix type printing in the presence of qualifiers
Adam Czachorowski [Thu, 7 Jan 2021 20:24:40 +0000 (21:24 +0100)]
[clangd] Fix type printing in the presence of qualifiers

When printing QualType with qualifiers like "const", or pointing to an
elaborated type, we would print garbage like:
  std::const std::vector<int>&
with the initial std:: being calculated correctly, but inserted in the
wrong place and the second std:: not removed (due to elaborated type).

This affected, among others, ExtractFunction and ExpandAuto tweaks.

This change introduces a new callback to PrintingPolicy, which allows us
to influence the printing of namespace qualifiers. In the future, the
same callback can be used to improve handling of "using namespace"
directives as well.

Fixes:
  https://github.com/clangd/clangd/issues/640 (ExtractFunction)
  https://github.com/clangd/clangd/issues/264 (ExpandAuto)
  First point of https://github.com/clangd/clangd/issues/524

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

3 years agoRevert "[mlir:JitRunner] Use custom shared library init/destroy functions if available"
Eugene Zhulenev [Fri, 8 Jan 2021 15:43:54 +0000 (07:43 -0800)]
Revert "[mlir:JitRunner] Use custom shared library init/destroy functions if available"

This reverts commit 84dc9b451bfd62474f44dd1af0e4955a0110d523.

Fix Windows breakage: http://lab.llvm.org:8011/#/builders/13/builds/3658/steps/6/logs/stdio

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

3 years ago[X86][SSE] Fold unpack(hop(),hop()) -> permute(hop())
Simon Pilgrim [Fri, 8 Jan 2021 15:08:12 +0000 (15:08 +0000)]
[X86][SSE] Fold unpack(hop(),hop()) -> permute(hop())

UNPCKL/UNPCKH only uses one op from each hop, so we can merge the hops and then permute the result.

3 years ago[ARM][LV] Additional loop invariant reduction test. NFC
David Green [Fri, 8 Jan 2021 15:15:08 +0000 (15:15 +0000)]
[ARM][LV] Additional loop invariant reduction test. NFC

3 years ago[mlir:JitRunner] Use custom shared library init/destroy functions if available
Eugene Zhulenev [Fri, 8 Jan 2021 11:14:04 +0000 (03:14 -0800)]
[mlir:JitRunner] Use custom shared library init/destroy functions if available

Use custom mlir runner init/destroy functions to safely init and destroy shared libraries loaded by the JitRunner.

Reviewed By: mehdi_amini

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

3 years ago[TableGen] Remove unused declaration that caused build failures.
Paul C. Anagnostopoulos [Fri, 8 Jan 2021 15:10:05 +0000 (10:10 -0500)]
[TableGen] Remove unused declaration that caused build failures.

3 years ago[WebAssembly] Rename wasm_rethrow_in_catch intrinsic/builtin
Heejin Ahn [Sat, 26 Dec 2020 00:14:35 +0000 (16:14 -0800)]
[WebAssembly] Rename wasm_rethrow_in_catch intrinsic/builtin

`wasm_rethrow_in_catch` intrinsic and builtin are used in order to
rethrow an exception when the exception is caught but there is no
matching clause within the current `catch`. For example,
```
try {
  foo();
} catch (int n) {
  ...
}
```
If the caught exception does not correspond to C++ `int` type, it should
be rethrown. These intrinsic/builtin were renamed `rethrow_in_catch`
because at the time I thought there would be another intrinsic for C++'s
`throw` keyword, which rethrows an exception. It turned out that `throw`
keyword doesn't require wasm's `rethrow` instruction, so we rename
`rethrow_in_catch` to just `rethrow` here.

Reviewed By: dschuff, tlively

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

3 years ago[ARM] Update and regenerate test checks. NFC
David Green [Fri, 8 Jan 2021 14:54:16 +0000 (14:54 +0000)]
[ARM] Update and regenerate test checks. NFC

3 years ago[TableGen] Add the assert statement, step 1
Paul C. Anagnostopoulos [Wed, 16 Dec 2020 21:25:54 +0000 (16:25 -0500)]
[TableGen] Add the assert statement, step 1

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

This first step adds the assert statement and supports it at top level
and in record definitions. Later steps will support it in class
definitions and multiclasses.

3 years ago[MLIR][OpenMP] Attribute to include WsLoop upperbound
Kiran Chandramohan [Thu, 7 Jan 2021 15:51:55 +0000 (15:51 +0000)]
[MLIR][OpenMP] Attribute to include WsLoop upperbound

This patch adds an attribute `inclusive` which if present causes
the upperbound to be included in the loop iteration interval.

Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D94235

3 years ago[X86][SSE] Add vphaddd/vphsubd unpack(hop(),hop()) tests
Simon Pilgrim [Fri, 8 Jan 2021 14:37:19 +0000 (14:37 +0000)]
[X86][SSE] Add vphaddd/vphsubd unpack(hop(),hop()) tests

3 years ago[SLP][NFC]Add a test for reused shrink check, NFC.
Alexey Bataev [Fri, 8 Jan 2021 13:31:07 +0000 (05:31 -0800)]
[SLP][NFC]Add a test for reused shrink check, NFC.

3 years ago[NFC] Renaming PackStack to AlignPackStack
Xiangling Liao [Thu, 7 Jan 2021 22:16:33 +0000 (17:16 -0500)]
[NFC] Renaming PackStack to AlignPackStack

This patch renames PackStack and related variable names to also contain align across Clang.
As it is right now, Clang already uses one stack to record the information from both #pragma
align and #pragma pack. Leaving it as PackStack is confusing, and could cause people to
ignore #pragma align when developing code that interacts with PackStack.

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

3 years ago[X86][SSE] Add tests for unpack(hop(),hop())
Simon Pilgrim [Fri, 8 Jan 2021 13:58:46 +0000 (13:58 +0000)]
[X86][SSE] Add tests for unpack(hop(),hop())

We should be able to convert these to permute(hop()) as we only ever use one of the ops from each hop.

3 years ago[MLIR][SPIRV] Add `UsableInSpecConstantOp` trait.
KareemErgawy-TomTom [Fri, 8 Jan 2021 13:48:48 +0000 (14:48 +0100)]
[MLIR][SPIRV] Add `UsableInSpecConstantOp` trait.

Instead of checking explicitly checking for whether an op is usalbe
inside a `SpecConstantOperationOP`, this commit adds a new trait to
filter such ops.

Reviewed By: antiagainst

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

3 years ago[VE] Support pack_f32p and pack_f32a intrinsic instructions
Kazushi (Jam) Marukawa [Fri, 8 Jan 2021 11:10:02 +0000 (20:10 +0900)]
[VE] Support pack_f32p and pack_f32a intrinsic instructions

Support pack_f32p and pack_f32a intrinsic instructions and regression tests.

Reviewed By: simoll

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

3 years ago[WebAssembly] Change label numbers to variables in test
Heejin Ahn [Thu, 24 Dec 2020 11:07:24 +0000 (03:07 -0800)]
[WebAssembly] Change label numbers to variables in test

cfg-stackify-eh.ll contains many `CHECK` lines specifying label / catch
comments with numbers. These numbers are subject to change every time
any block/loop/try is added in the middle in existing functions or any
other function is added in the middle of the file, generating a large
number of lines in diffs. This change converts them to variables so they
can be more resistent to future changes.

Reviewed By: dschuff, tlively

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

3 years ago[OpenCL] Documentation for experimental C++ libs
Anastasia Stulova [Fri, 8 Jan 2021 13:37:27 +0000 (13:37 +0000)]
[OpenCL] Documentation for experimental C++ libs

Started a new doc section about the OpenCL experimental
features and described ongoing work on C++ libraries
e.g. type traits.

Tags: #clang

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

3 years agoRevert "[SLP]Need shrink the load vector after reordering."
Alexander Belyaev [Fri, 8 Jan 2021 13:33:39 +0000 (14:33 +0100)]
Revert "[SLP]Need shrink the load vector after reordering."

This reverts commit 4284afdf9432f7d756f56b0ab21d69191adefa8d.

This changes computed values in fused_batchnorm_test_cpu.

Not equal to tolerance rtol=1e-06, atol=0.001
Mismatched value: a is different from b.
not close where = (array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
       1, 1]), array([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
       1, 1]), array([0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
       1, 1]), array([0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
       4, 5]))
not close lhs = [-0.6636615  -0.9804948  -1.148275   -0.68193716 -0.8572368  -0.65046215
 -0.6993756  -1.2244141  -1.0938729  -0.50369143 -0.51830524 -0.738452
 -0.7214286  -0.48115745 -0.9380924  -0.9341769  -0.5916775  -1.2896856
 -0.7264182  -0.9746917  -0.783249   -0.7659018  -0.86214024 -0.47784212]
not close rhs = [ 0.44102234  0.12418899 -0.04359123  0.42274666  0.24744703  0.45422167
  0.40530816 -0.11973029  0.01081094  0.6009924   0.5863786   0.3662318
  0.38325527  0.62352633  0.1665914   0.1705069   0.5130063  -0.18500176
  0.37826565  0.12999213  0.3214348   0.338782    0.24254355  0.62684166]
not close dif = [1.1046839 1.1046838 1.1046838 1.1046839 1.1046839 1.1046839 1.1046838
 1.1046839 1.1046839 1.1046839 1.1046839 1.1046839 1.1046839 1.1046838
 1.1046839 1.1046839 1.1046839 1.1046839 1.1046839 1.1046839 1.1046839
 1.1046839 1.1046838 1.1046838]
not close tol = [0.00100044 0.00100012 0.00100004 0.00100042 0.00100025 0.00100045
 0.00100041 0.00100012 0.00100001 0.0010006  0.00100059 0.00100037
 0.00100038 0.00100062 0.00100017 0.00100017 0.00100051 0.00100019
 0.00100038 0.00100013 0.00100032 0.00100034 0.00100024 0.00100063]