platform/upstream/llvm.git
2 years ago[mlir][sparse] support foreach on dense tensor.
Peiming Liu [Thu, 20 Oct 2022 22:05:28 +0000 (22:05 +0000)]
[mlir][sparse] support foreach on dense tensor.

Reviewed By: aartbik

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

2 years ago[libc][Obvious] Add few missing license headers.
Siva Chandra Reddy [Fri, 21 Oct 2022 00:01:16 +0000 (00:01 +0000)]
[libc][Obvious] Add few missing license headers.

2 years ago[mlir][sparse] Fix getUnorderedCOOFromType for rank 1 tensor.
bixia1 [Thu, 20 Oct 2022 22:43:03 +0000 (15:43 -0700)]
[mlir][sparse] Fix getUnorderedCOOFromType for rank 1 tensor.

Previously, it used DimLevelType::SingletonNo to represent an unorder COO
tensor of rank 1 while it should use DimLevelType::CompressedNuNo.

Reviewed By: Peiming, wrengr

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

2 years ago[libc][obvious] fix comparison test cmake
Michael Jones [Thu, 20 Oct 2022 22:39:55 +0000 (15:39 -0700)]
[libc][obvious] fix comparison test cmake

The name of the libc target changed, this patch updates the cmake for
the string to float comparison test to use the correct name.

Reviewed By: sivachandra

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

2 years ago[mlir-opt] Add a '-dump-pass-pipeline' option
rkayaith [Tue, 11 Oct 2022 21:39:34 +0000 (17:39 -0400)]
[mlir-opt] Add a '-dump-pass-pipeline' option

Add an option to dump the pipeline that will be run to stderr. A
dedicated option is needed since the existing `test-dump-pipeline`
pipeline won't be usable with `-pass-pipeline` after D135745.

Reviewed By: rriddle, mehdi_amini

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

2 years ago[X86][AVX] Eliminate redundant movzbl instruction.
Luo, Yuanke [Wed, 19 Oct 2022 00:32:13 +0000 (08:32 +0800)]
[X86][AVX] Eliminate redundant movzbl instruction.

The movzbl instruction can be combined to vpinsrb or vmovd, when it is
actual lowered from anyext.

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

2 years ago[mlir] Include anchor op when printing pass managers
rkayaith [Sun, 25 Sep 2022 20:47:39 +0000 (16:47 -0400)]
[mlir] Include anchor op when printing pass managers

Previously a pipeline nested on `anchor-op` would print as just
`'pipeline'`, now it will print as `'anchor-op(pipeline)'`. This ensures
the text form includes all information needed to reconstruct the pass
manager.

Reviewed By: rriddle, mehdi_amini

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

2 years ago[clang][lex] Avoid `DirectoryLookup` copies
Jan Svoboda [Sat, 15 Oct 2022 15:42:27 +0000 (08:42 -0700)]
[clang][lex] Avoid `DirectoryLookup` copies

This patch fixes a performance regression introduced in D121685 that was caused by copying `DirectoryLookup`.

rdar://101206790

Reviewed By: ributzka

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

2 years ago[clang] Correct sanitizer behavior in union FAMs
Bill Wendling [Thu, 20 Oct 2022 23:08:01 +0000 (16:08 -0700)]
[clang] Correct sanitizer behavior in union FAMs

Clang doesn't have the same behavior as GCC does with union flexible
array members. (Technically, union FAMs are probably not acceptable in
C99 and are an extension of GCC and Clang.)

Both Clang and GCC treat *all* arrays at the end of a structure as FAMs.
GCC does the same with unions. Clang does it for some arrays in unions
(incomplete, '0', and '1'), but not for all. Instead of having this
half-supported feature, sync Clang's behavior with GCC's.

Reviewed By: kees

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

2 years ago[HLSL] Disable integer promotion to avoid int16_t being promoted to int for HLSL.
Xiang Li [Tue, 18 Oct 2022 16:22:46 +0000 (09:22 -0700)]
[HLSL] Disable integer promotion to avoid int16_t being promoted to int for HLSL.

short will be promoted to int in UsualUnaryConversions.
Disable it for HLSL to keep int16_t as 16bit.

Reviewed By: aaron.ballman, rjmccall

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

2 years ago[mlir][tosa] Add broadcasting case for tosa.resize degenerate case
Rob Suderman [Thu, 20 Oct 2022 21:16:10 +0000 (14:16 -0700)]
[mlir][tosa] Add broadcasting case for tosa.resize degenerate case

When the resize is ?x1x1x?, the tosa.resize operation broadcasts the
input and (when quantized) applies a scaling factor. Updated the resize
operation to not use a tensor.extract operation, instead broadcasting
the only positional value as necessary.

Moved the tosa.resize tests to their own mlir test due to increased
complexity. Also corrected a bug where tosa.resize for bilinear-floating
point was not applying the correct scaling.

Reviewed By: jpienaar

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

2 years agoRevert "[lldb] Fix member access in GetExpressionPath"
Jonas Devlieghere [Thu, 20 Oct 2022 22:20:50 +0000 (15:20 -0700)]
Revert "[lldb] Fix member access in GetExpressionPath"

This reverts commit 0205aa4a02570dfeda5807f66756ebdbb102744b because it
breaks TestArray.py:

  a->c = <parent failed to evaluate: parent is NULL>

I decided to revert instead of disable the test because it looks like a
legitimate issue with the patch.

2 years ago[Arm64EC] Refer to dllimport'ed functions correctly.
Eli Friedman [Thu, 20 Oct 2022 22:06:20 +0000 (15:06 -0700)]
[Arm64EC] Refer to dllimport'ed functions correctly.

Arm64EC has two different ways to refer to dllimport'ed functions in an
object file. One is using the usual __imp_ prefix, the other is using an
Arm64EC-specific prefix __imp_aux_. As far as I can tell, if a function
is in an x64 DLL, __imp_aux_ refers to the actual x64 address, while
__imp_ points to some linker-generated code that calls the exit thunk.
So __imp_aux_ is used to refer to the address in non-call contexts,
while __imp_ is used for calls to avoid the indirect call checker.

There's one twist to this, though: if an object refers to a symbol using
the __imp_aux_ prefix, the object file's symbol table must also contain
the symbol with the usual __imp_ prefix. The symbol doesn't actually
have to be used anywhere, it just has to exist; otherwise, the linker's
symbol lookup in x64 import libraries doesn't work correctly. Currently,
this is handled by emitting a .globl __imp_foo directive; we could try
to design some better way to handle this.

One minor quirk I haven't figured out: apparently, in Arm64EC mode, MSVC
prefers to use a linker-synthesized stub to call dllimport'ed functions,
instead of branching directly. The linker stub appears to do the same
thing that inline code would do, so not sure if it's just a code-size
optimization, or if the synthesized stub can actually do something other
than just load from the import table in some circumstances.

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

2 years ago[mlir][sparse] introduce new op for querying number of stored entries
Aart Bik [Thu, 20 Oct 2022 21:39:34 +0000 (14:39 -0700)]
[mlir][sparse] introduce new op for querying number of stored entries

Reviewed By: bixia

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

2 years ago[clang-tidy] Skip private default ctors in modernize-use-equals-default
Alexander Shaposhnikov [Thu, 20 Oct 2022 21:45:22 +0000 (21:45 +0000)]
[clang-tidy] Skip private default ctors in modernize-use-equals-default

For c++17 (i.e. before c++20) making a private default ctor explicitly defaulted
might expose the previously intentionally disallowed initializations, e.g.
class Tag { Tag() {} friend class Widget; }; is not equivalent to
class Tag { Tag() = default; friend class Widget; };
since in the latter case Tag is treated as an aggregate despite having a declaration
of the default constructor. This diff makes modernize-use-equals-default skip
in-class empty nonpublic default ctors to avoid code breakages.

Test plan: ninja check-all

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

2 years ago[lldb] Don't check environment default char signedness when creating clang type for...
Arthur Eubanks [Sat, 15 Oct 2022 04:07:49 +0000 (21:07 -0700)]
[lldb] Don't check environment default char signedness when creating clang type for "char"

With -f(un)signed-char, the die corresponding to "char" may be the opposite DW_ATE_(un)signed_char from the default platform signedness.
Ultimately we should determine whether a type is the unspecified signedness char by looking if its name is "char" (as opposed to "signed char"/"unsigned char") and not care about DW_ATE_(un)signed_char matching the platform default.

Fixes #23443

Reviewed By: labath

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

2 years ago[MachineFrameInfo][RISCV] Call ensureStackAlignment for objects created with scalable...
Craig Topper [Thu, 20 Oct 2022 21:05:22 +0000 (14:05 -0700)]
[MachineFrameInfo][RISCV] Call ensureStackAlignment for objects created with scalable vector stack id.

This is an alternative to fix PR57939 for RISC-V. It definitely
can be argued that the stack temporaries for RISC-V are being created
with an unnecessarily large alignment. But ignoring the alignment
in MachineFrameInfo also seems bad.

Looking at the test update that go with the current ID==0 check,
it was intending to exclude things like the NoAlloc stackid. So I'm
not sure if scalable vectors are intentionally being excluded.

Reviewed By: reames

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

2 years ago[mlir][sparse] attach bufferizableOpInterface to InsertOp
Peiming Liu [Thu, 20 Oct 2022 19:40:24 +0000 (19:40 +0000)]
[mlir][sparse] attach bufferizableOpInterface to InsertOp

To fix D136286

Reviewed By: aartbik

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

2 years ago[lldb][trace] Correctly treat kernel CPUs as individual threads
Sujin Park [Thu, 20 Oct 2022 20:35:45 +0000 (13:35 -0700)]
[lldb][trace] Correctly treat kernel CPUs as individual threads

Resolved a bug in kernel decoding and correctly treat kernel CPUs as
individual threads.

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

2 years ago[NFC] [DirectX backend] move ResourceClass into llvm.
Xiang Li [Wed, 19 Oct 2022 23:23:39 +0000 (16:23 -0700)]
[NFC] [DirectX backend] move ResourceClass into llvm.

Move ResourceClass into llvm/Frontend/HLSL/HLSLResource.h so it could be shared between clang and DirectX backend.

Reviewed By: beanz

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

2 years ago[clang][AIX] Fix mcount name and call arguments
Michael Francis [Tue, 18 Oct 2022 15:47:53 +0000 (15:47 +0000)]
[clang][AIX] Fix mcount name and call arguments

Currently, compiling a program with the `-pg` flag will result in an
undefined symbol error for `.mcount`. This revision fixes the call to
use `__mcount`, which requires a pointer argument to a pointer-sized
object (unique per inserted call) on AIX.

This is only a partial fix. This patch should fix the `-pg` flag's
behaviour on AIX to work with code you are compiling, but it will not
link against standard libraries with `mcount` instrumentation calls. The
next step is to add profiled libraries to the linker search paths in the
Clang driver for the AIX toolchain when linking with `-pg`.

Differential Review: https://reviews.llvm.org/D135384

2 years ago[mlir][sparse] Fix the codegen for the convert operator to handle hidden nop convert.
bixia1 [Thu, 20 Oct 2022 19:05:36 +0000 (12:05 -0700)]
[mlir][sparse] Fix the codegen for the convert operator to handle hidden nop convert.

Reviewed By: aartbik

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

2 years ago[clang][AIX] Omitting Explicit Debugger Tuning Option
Qiongsi Wu [Thu, 20 Oct 2022 19:16:31 +0000 (15:16 -0400)]
[clang][AIX] Omitting Explicit Debugger Tuning Option

On AIX, the default debugger is `dbx` so it is not necessary to explicitly set `-debugger-tuning=dbx` in the presence of `-g`.

Reviewed By: shchenz

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

2 years ago[clang][Sema] Use correct array size for diagnostic
Bill Wendling [Thu, 20 Oct 2022 18:55:38 +0000 (11:55 -0700)]
[clang][Sema] Use correct array size for diagnostic

The diagnostic was confusing and reporting that an array contains far
more elements than it is defined to have, due to casting.

For example, this code:

  double foo[4096];
  ((char*)foo)[sizeof(foo)];

warns that the "index 32768 is past the end of the array (which contains
32768 elements)."

Reviewed By: serge-sans-paille, aaron.ballman

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

2 years agoRevert "[AArch64]SME2 Multi-single vector SVE Destructive 2 and 4 Registers"
Caroline Concatto [Thu, 20 Oct 2022 18:38:18 +0000 (19:38 +0100)]
Revert "[AArch64]SME2 Multi-single vector SVE Destructive 2 and 4 Registers"

This reverts commit 4c4909703d74883e5cc49edcbd22b783135d2897.

This patch was breaking this test:

llvm/test/MC/Mips/mips64r6/valid.s

I will push again when fixed

2 years agoRevert "[AArch64]SME2 Multi-vector - Index/Single/Multi Array Vectors FMA sources"
Caroline Concatto [Thu, 20 Oct 2022 18:37:56 +0000 (19:37 +0100)]
Revert "[AArch64]SME2 Multi-vector - Index/Single/Multi Array Vectors FMA sources"

This reverts commit 3fee9358baab54e4ed646a106297e7fb6f1b4cff.

2 years ago[Polly] Ensure -polly-detect-keep-going still eventually rejects invalid regions.
Michael Kruse [Thu, 20 Oct 2022 16:49:38 +0000 (11:49 -0500)]
[Polly] Ensure -polly-detect-keep-going still eventually rejects invalid regions.

Fixes #58484

2 years ago[AArch64]SME2 Multi-vector - Index/Single/Multi Array Vectors FMA sources
Caroline Concatto [Thu, 20 Oct 2022 17:57:33 +0000 (18:57 +0100)]
[AArch64]SME2 Multi-vector - Index/Single/Multi Array Vectors FMA sources

This patch adds the assembly/disassembly for the following instructions:
  INT:
     SMLAL
     SMLSL
     UMLAL
     UMLSL
  FP:
    BFMLAL
    BFMLSL
    FMLAL
    FMLSL
For multiple and indexed vector, Multiple and Single vector and
Multi vectors, for 1, 2 and 4 ZA registers.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

It also adds a new immediate:
  uimm3s2range for off3
  uimm2s2range for off2
to represent the vector select offset.
The new operands have the range between the first and the last vector position.

Depends on: D135563

Reviewed By: aemerson, sdesmalen

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

2 years ago[mlir][sparse] add source materizalization callback for sparse tensor codegen type...
Peiming Liu [Thu, 20 Oct 2022 16:53:56 +0000 (16:53 +0000)]
[mlir][sparse] add source materizalization callback for sparse tensor codegen type converter.

Required by scf.for to achieve 1:N type conversion (See D136314).

Reviewed By: aartbik

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

2 years ago[AArch64]SME2 Multi-single vector SVE Destructive 2 and 4 Registers
Caroline Concatto [Mon, 17 Oct 2022 10:46:32 +0000 (11:46 +0100)]
[AArch64]SME2 Multi-single vector SVE Destructive 2 and 4 Registers

This patch adds the assembly/disassembly for the following instructions:
  ADD (to vector): Add replicated single vector to multi-vector with multi-vector result.
  SQDMULH (multiple and single vector): Multi-vector signed saturating doubling multiply high by vector.
for 2 and 4 ZA SVE registers.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

It also adds more size for the multiple register tuple:
  ZZ_b_mul_r,  ZZ_h_mul_r,
  ZZZZ_b_mul_r,  ZZZZ_h_mul_r,
for 8 bits and 16 bits with 2 and 4 ZA registers.

Depends on: D135468

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

2 years ago[tblgen-lsp-server] Fix various ASAN issues
River Riddle [Wed, 19 Oct 2022 23:21:10 +0000 (16:21 -0700)]
[tblgen-lsp-server] Fix various ASAN issues

* Properly use virtual destructors for index symbols
* Clear the index before initializing it

2 years ago[AArch64] Fix scheduler crash in fusion code.
Eli Friedman [Thu, 20 Oct 2022 17:47:44 +0000 (10:47 -0700)]
[AArch64] Fix scheduler crash in fusion code.

Make sure we don't call getReg() on the first operand of instruction
without knowing that operand is actually a register.

(This codepath isn't enabled for most CPUs; only triggers on certain
CPUs, like Cortex-X1.)

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

2 years ago[AArch64]SME2 Multiple vector ternary int/float 2 and 4 registers
Caroline Concatto [Mon, 17 Oct 2022 09:27:12 +0000 (10:27 +0100)]
[AArch64]SME2 Multiple vector ternary int/float 2 and 4 registers

This patch adds the assembly/disassembly for the following instructions:
       For INT:
               ADD(array results, multiple vectors): Add multi-vector to multi-vector with ZA array vector results.
               SUB(array results, multiple vectors): Subtract multi-vector from multi-vector with ZA array vector results.
       For FP:
              FMLA (multiple vectors): Multi-vector floating-point fused multiply-add.
              FMLS (multiple vectors): Multi-vector floating-point fused multiply-subtract.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

   This patch also adds a  register operand to represent multiples of ZA multi-vectors.
They are:
        ZZ_s_mul_r, ZZ_d_mul_r, ZZZZ_s_mul_r and ZZZZ_d_mul_r
and represent the Zn or Zm times 2 or 4 according to the vector group.

Depends on: D135455

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

2 years ago[InstCombine] Canonicalize GEP of GEP by swapping constant-indexed GEP to the back
William Huang [Wed, 12 Oct 2022 17:49:24 +0000 (17:49 +0000)]
[InstCombine] Canonicalize GEP of GEP by swapping constant-indexed GEP to the back

Canonicalize GEP of GEP by swapping GEP with some suffix constant indices to the back (and GEP with all constant indices to the back of that), this allows more constant index GEP merging to happen. Exceptions are: If swapping violates use-def relations, or anti-optimizes LICM

For constant indexed GEP of GEP, if they cannot be merged directly, they will be casted to i8* and merged.

Reviewed By: nikic

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

2 years ago[mlir] Set pattern that resolves tensor dimensions as having bounded recursion.
Mahesh Ravishankar [Thu, 20 Oct 2022 16:59:10 +0000 (16:59 +0000)]
[mlir] Set pattern that resolves tensor dimensions as having bounded recursion.

Reviewed By: springerm

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

2 years ago[AArch64][SelectionDAG] Lower multiplication by a constant to shl+add+shl+add
zhongyunde [Thu, 20 Oct 2022 16:33:28 +0000 (00:33 +0800)]
[AArch64][SelectionDAG] Lower multiplication by a constant to shl+add+shl+add

Change the costmodel to lower a = b * C where C = (1 + 2^m) * (1 + 2^n) to
      add   w8, w0, w0, lsl #m
      add   w0, w8, w8, lsl #n
Note: The latency can vary depending on the shirt amount

Reviewed By: efriedma, dmgreen
Differential Revision: https://reviews.llvm.org/D135441

2 years ago[HLSL] Add groupshare address space.
Xiang Li [Wed, 19 Oct 2022 19:40:39 +0000 (12:40 -0700)]
[HLSL] Add groupshare address space.

Added keyword, LangAS and TypeAttrbute for groupshared.

Tanslate it to LangAS with asHLSLLangAS.

Make sure it translated into address space 3 for DirectX target.

Reviewed By: aaron.ballman

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

2 years ago[OpenMP] Remove `-Bsymbolic` flag for device linking in the GNU toolchain
Joseph Huber [Thu, 20 Oct 2022 15:38:27 +0000 (10:38 -0500)]
[OpenMP] Remove `-Bsymbolic` flag for device linking in the GNU toolchain

Previously, OpenMP linking would be done explicitly in a linker stage.
For `x86_64` offloading this would just use the host linker, which could
be the `bfd` linker. This linker had problems linking relocations
against variables with protected visibility so we force `-Bsymbolic`
when linking. After the deprecation of the old offloading driver this
code is no longer used and can be removed.

Reviewed By: tianshilei1992

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

2 years ago[Libomptarget] Build plugins with protected visibility by default
Joseph Huber [Thu, 20 Oct 2022 15:51:46 +0000 (10:51 -0500)]
[Libomptarget] Build plugins with protected visibility by default

The plugins all define the same interface symbols. This is generally not
a problem when calling the plugin directly from the dynamic library's
handle. However, when calling from within the plugin itself it is
possible for another plugin's symbols to preempt the symbols. This was
observed with the `__tgt_rtl_is_valid_binary` call in the
`__tgt_rtl_is_valid_binary_info` function being mapped to the x86_64
plugin.

This patch changes the default visibility to `protected` intead. This
visibility ensures that these symbols are all externally visible from
the plugin, but ensures their definitions are fixed within the shared
library. Having protected visiiblity makes such symbol preemption
impossible.

Reviewed By: tianshilei1992

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

2 years ago[mlir] Fix incorrect temporary file handling on windows
Denys Shabalin [Thu, 20 Oct 2022 15:50:26 +0000 (17:50 +0200)]
[mlir] Fix incorrect temporary file handling on windows

Reviewed By: ftynse

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

2 years ago[gn build] Port a48007355a03
LLVM GN Syncbot [Thu, 20 Oct 2022 15:30:49 +0000 (15:30 +0000)]
[gn build] Port a48007355a03

2 years ago[libc++][format] Implements string escaping.
Mark de Wever [Thu, 5 May 2022 06:03:58 +0000 (08:03 +0200)]
[libc++][format] Implements string escaping.

Implements parts of
- P2286R8 Formatting Ranges

Reviewed By: #libc, tahonermann

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

2 years ago[libc++][CI] Reorder jobs.
Mark de Wever [Wed, 19 Oct 2022 18:01:57 +0000 (20:01 +0200)]
[libc++][CI] Reorder jobs.

In the second leg of the CI the steps take about:
- C++2b              10m
- C++11              8m
- C++03              6m
- Modular build      10m
- GCC 12 / C++latest 20m
So the slowest job is scheduled last. The CI will wait to start the
third leg until that job is done. The current order increases the
latency of the current job, instead start the slow jobs earlier.

Reviewed By: #libc, ldionne

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

2 years ago[RISCV] Remove EEW from some sched classes.
Craig Topper [Thu, 20 Oct 2022 15:13:25 +0000 (08:13 -0700)]
[RISCV] Remove EEW from some sched classes.

This removes the EEW from unit stride load/store and whole register
load, store, move.

It seems reasonable that implementations of these instructions wouldn't
usually be affected by element width.

We likely need to add LMUL information to our scheduling classes so
I thought it might be good to remove a few before they got multiplied
by LMUL.

Reviewed By: reames, michaelmaitland

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

2 years ago[mlgo] Fix test post-D136040
Mircea Trofin [Thu, 20 Oct 2022 15:21:19 +0000 (08:21 -0700)]
[mlgo] Fix test post-D136040

Instruction opcodes bumped, trivial fix.

2 years ago[NFC] Fix a few whitespace inconsistencies.
Paul Walker [Thu, 20 Oct 2022 11:53:58 +0000 (11:53 +0000)]
[NFC] Fix a few whitespace inconsistencies.

2 years ago[ModRef] Default to ModRef in MemoryEffects ctors (NFC)
Nikita Popov [Thu, 20 Oct 2022 14:40:38 +0000 (16:40 +0200)]
[ModRef] Default to ModRef in MemoryEffects ctors (NFC)

Allow writing something like MemoryEffects::argMemOnly() implying
MemoryEffects::argMemOnly(ModRefInfo::ModRef). Having to write this
out is a bit of an annoying than porting code using the existing
attributes in D135780.

2 years agoDetect Visual Studio automatically in Windows packaging script
Pierrick Bouvier [Thu, 20 Oct 2022 14:29:15 +0000 (16:29 +0200)]
Detect Visual Studio automatically in Windows packaging script

Instead of hardcoding several VS paths, use vswhere.exe (available from
VS 2017) to get latest version available.

Reviewed By: hans, thieta

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

2 years ago[NFC] Add DebugVariable constructor that takes DbgVariableIntrinsic pointer
OCHyams [Thu, 20 Oct 2022 14:26:40 +0000 (15:26 +0100)]
[NFC] Add DebugVariable constructor that takes DbgVariableIntrinsic pointer

Note: The constructor definition cannot be inline without some refactoring as
it introduces a circular dependency between the headers
llvm/IR/DebugInfoMetadata.h (this file) and llvm/IR/IntrinsicInst.h (where
DbgVariableIntrinsic is defined).

Reviewed By: jryans

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

2 years ago[DebugInfo][NFC] Refactor debug intrinsic copy and delete to instead just move
OCHyams [Thu, 20 Oct 2022 13:17:47 +0000 (14:17 +0100)]
[DebugInfo][NFC] Refactor debug intrinsic copy and delete to instead just move

Reviewed By: jryans

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

2 years agoRevert D136292 "[libc] mem* framework v3"
Guillaume Chatelet [Thu, 20 Oct 2022 13:52:30 +0000 (13:52 +0000)]
Revert D136292 "[libc] mem* framework v3"

This breaks llvm-libc build bots:
 - libc-x86_64-debian-dbg-asan
 - libc-x86_64-debian-fullbuild-dbg-asan
Address sanitizers fail with "AddressSanitizer: invalid alignment requested in aligned_alloc: 64, alignment must be a power of two and the requested size 0x41 must be a multiple of alignment (thread T0)"
 - libc-aarch64-ubuntu-dbg
 - libc-aarch64-ubuntu-fullbuild-dbg
https://lab.llvm.org/buildbot/#/builders/223/builds/8877/steps/7/logs/stdio
 - libc-arm32-debian-dbg
https://lab.llvm.org/buildbot/#/builders/229/builds/5201/steps/7/logs/stdio

This reverts commit 903cc71a82431d79e5fb541946a9e7c93750e374.

2 years ago[mlir][nfc] Clean-up usage of kDynamicSize.
Aliia Khasanova [Thu, 20 Oct 2022 12:39:03 +0000 (12:39 +0000)]
[mlir][nfc] Clean-up usage of kDynamicSize.

This patch prepares MLIR code base to change the value of kDynamicSize.
https://discourse.llvm.org/t/rfc-unify-kdynamicsize-and-kdynamicstrideoroffset/64534/4

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

2 years ago[mlir] Fix and test python bindings for dump_to_object_file
Denys Shabalin [Thu, 20 Oct 2022 10:58:49 +0000 (12:58 +0200)]
[mlir] Fix and test python bindings for dump_to_object_file

Reviewed By: ftynse

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

2 years ago[libc] mem* framework v3
Guillaume Chatelet [Wed, 19 Oct 2022 20:52:45 +0000 (20:52 +0000)]
[libc] mem* framework v3

This version is more composable and also simpler at the expense of being more explicit and more verbose.

This patch provides rationale for the framework, implementation and unit tests but the functions themselves are still using the previous version. The change in implementation will come in a follow up patch.

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

2 years ago[LV] Use buildScalarSteps to also handle VF = 1. (NFCI)
Florian Hahn [Thu, 20 Oct 2022 13:30:01 +0000 (14:30 +0100)]
[LV] Use buildScalarSteps to also handle VF = 1. (NFCI)

The code in buildScalarSteps already properly handles creating the
scalar induction values with VF = 1. Use it directly instead of using
extra code to handle that case.

Suggested by @Ayal in D133760.

2 years agoReapply [FunctionAttrs] Make location classification more precise
Nikita Popov [Wed, 19 Oct 2022 14:57:41 +0000 (16:57 +0200)]
Reapply [FunctionAttrs] Make location classification more precise

Reapplying after the fix for volatile modelling in D135863.

-----

Don't add argmem if the pointer is clearly not an argument (e.g.
a global). I don't think this makes a difference right now, but
gives more obvious results with D135780.

2 years agolibcxxabi [PR58117][NFC]: Open code lower bound
Nathan Sidwell [Thu, 20 Oct 2022 11:10:47 +0000 (07:10 -0400)]
libcxxabi [PR58117][NFC]: Open code lower bound

This open codes the use of lower-bound when looking for an operator
encoding. Using std::lower_bound can result in symbol references to
the C++ library and that breaks the ABI demangler, which mandates no
such dependency.

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

Fixes: https://github.com/llvm/llvm-project/issues/58117

2 years ago[llvm-debuginfo-analyzer] (04/09) - Locations and ranges
Carlos Alberto Enciso [Thu, 20 Oct 2022 10:29:57 +0000 (11:29 +0100)]
[llvm-debuginfo-analyzer] (04/09) - Locations and ranges

The test case 'LocationCoverage' caused a failure in:

  https://lab.llvm.org/buildbot/#/builders/5/builds/28385
  https://lab.llvm.org/buildbot/#/builders/168/builds/9585
  SUMMARY: AddressSanitizer: 176 byte(s) leaked in 2 allocation(s).

The logical debug locations 'LocationThree' and 'LocationFour'
are not added to any logical scope.

The test case is checking the logical symbol coverage and
it does not use those 2 debug locations.

Reviewed By: probinson

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

2 years ago[memprof] Support installation of memprof headers
Enna1 [Thu, 20 Oct 2022 12:30:08 +0000 (20:30 +0800)]
[memprof] Support installation of memprof headers

This change allows users manually calling memprof public C API (e.g. __memprof_profile_dump).

Reviewed By: tejohnson

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

2 years ago[AArch64][SME] Remove get.pstatesm intrinsic.
Sander de Smalen [Thu, 20 Oct 2022 11:17:34 +0000 (12:17 +0100)]
[AArch64][SME] Remove get.pstatesm intrinsic.

This intrinsic can be removed in favour of using a call to
__arm_sme_state() directly and testing the LSB of X0.

In IR that would look like:

   %pstate = call aarch64_sme_preservemost_from_x2 {i64, i64} @__arm_sme_state()
   %pstate.x0 = extractvalue {i64, i64} %pstate, 0
   %pstate.sm = and i64 %pstate.x0, 1

2 years ago[AMDGPU][MC][GFX11][NFC] Fix trivial typos in tests
Dmitry Preobrazhensky [Thu, 20 Oct 2022 12:17:22 +0000 (15:17 +0300)]
[AMDGPU][MC][GFX11][NFC] Fix trivial typos in tests

2 years ago[analyzer] Move unexecuted test block into it's own source file
isuckatcs [Fri, 14 Oct 2022 16:03:13 +0000 (18:03 +0200)]
[analyzer] Move unexecuted test block into it's own source file

Inside lambdas.cpp a block of code wasn't executed,
because it required the standard to be at least c++14.
This patch moves this block of code into it's own
source file and makes sure it's tested.

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

2 years ago[AMDGPU][MC][GFX11][NFC] Improve error message when a VOPD opcode is used with WS64
Dmitry Preobrazhensky [Thu, 20 Oct 2022 12:12:54 +0000 (15:12 +0300)]
[AMDGPU][MC][GFX11][NFC] Improve error message when a VOPD opcode is used with WS64

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

2 years agoIntroduce options for Windows packaging script
Pierrick Bouvier [Thu, 20 Oct 2022 12:12:28 +0000 (14:12 +0200)]
Introduce options for Windows packaging script

Options:
--version: [required] version to build
--help: display this help
--x86: build and test x86 variant
--x64: build and test x64 variant

Note: At least one variant to build is required.

Example: build_llvm_release.bat --version 15.0.0 --x64

Reviewed By: hans, thieta

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

2 years ago[InstCombine] Fix assert condition in `foldSelectShuffleOfSelectShuffle`
Nabeel Omer [Thu, 20 Oct 2022 12:06:01 +0000 (12:06 +0000)]
[InstCombine] Fix assert condition in `foldSelectShuffleOfSelectShuffle`

Bug introduced in e239198cdbbf.

The assert() is making an assumption that the resulting shuffle mask
will always select elements from both vectors, this is untrue in the
case of two shuffles being folded if the former shuffle has a mask with
undef elements in it. In such a case folding the shuffles might result
in a mask which only selects from one of the vectors because the other
elements (in the mask) are undef.

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

2 years ago[AMDGPU][MC] Correct v_cndmask operand types
Dmitry Preobrazhensky [Thu, 20 Oct 2022 12:05:40 +0000 (15:05 +0300)]
[AMDGPU][MC] Correct v_cndmask operand types

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

2 years ago[mlir][llvm] Handle llvm.noundef attribute when converting to LLVM IR
Victor Perez [Thu, 20 Oct 2022 11:58:43 +0000 (12:58 +0100)]
[mlir][llvm] Handle llvm.noundef attribute when converting to LLVM IR

Translate LLVMIR llvm.noundef attribute to its equivalent in LLVM IR.

Reviewed By: ftynse

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

2 years ago[libc][automemcpy] fix build after change in Arg enum
Guillaume Chatelet [Thu, 20 Oct 2022 11:58:54 +0000 (11:58 +0000)]
[libc][automemcpy] fix build after change in Arg enum

2 years ago[LoopSimplifyCFG] Forget loop and block dispos after merging blocks.
Florian Hahn [Thu, 20 Oct 2022 10:23:29 +0000 (11:23 +0100)]
[LoopSimplifyCFG] Forget loop and block dispos after merging blocks.

This fixes another case where block and loop dispositions weren't
properly invalidate after changing the CFG.

Fixes #58489.

2 years ago[FuncAttrs] Extract code for adding a location access (NFC)
Nikita Popov [Wed, 19 Oct 2022 14:55:24 +0000 (16:55 +0200)]
[FuncAttrs] Extract code for adding a location access (NFC)

This code is the same for accesses from call arguments and for
accesses from other (single-location) instructions. Extract i
into a common function.

2 years ago[FunctionAttrs] Volatile operations can access inaccessible memory
Nikita Popov [Thu, 13 Oct 2022 10:16:26 +0000 (12:16 +0200)]
[FunctionAttrs] Volatile operations can access inaccessible memory

Per LangRef, volatile operations are allowed to access the location
of their pointer argument, plus inaccessible memory:

> Any volatile operation can have side effects, and any volatile
> operation can read and/or modify state which is not accessible
> via a regular load or store in this module.
> [...]
> The allowed side-effects for volatile accesses are limited. If
> a non-volatile store to a given address would be legal, a volatile
> operation may modify the memory at that address. A volatile
> operation may not modify any other memory accessible by the
> module being compiled. A volatile operation may not call any
> code in the current module.

FunctionAttrs currently does not model this and ends up marking
functions with volatile accesses on arguments as argmemonly,
even though they should be inaccessiblemem_or_argmemonly.

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

2 years ago[LoongArch] Fix 32-bit and 64-bit atomicrmw nand operand order errors
gonglingqin [Thu, 20 Oct 2022 09:25:58 +0000 (17:25 +0800)]
[LoongArch] Fix 32-bit and 64-bit atomicrmw nand operand order errors

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

2 years ago[libc][NFC] add missing static qualifiers in tests
Guillaume Chatelet [Thu, 20 Oct 2022 08:52:56 +0000 (08:52 +0000)]
[libc][NFC] add missing static qualifiers in tests

2 years ago[libc][NFC] remove unneeded -lpthread for utils_test
Guillaume Chatelet [Thu, 20 Oct 2022 08:48:22 +0000 (08:48 +0000)]
[libc][NFC] remove unneeded -lpthread for utils_test

2 years agoFix crash in constraining partial specialization on nested template.
Utkarsh Saxena [Wed, 19 Oct 2022 14:29:42 +0000 (16:29 +0200)]
Fix crash in constraining partial specialization on nested template.

Fixes: https://github.com/llvm/llvm-project/issues/53354

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

2 years ago[flang] optionally lower scalar and explicit shape with fir.declare
Jean Perier [Thu, 20 Oct 2022 08:30:42 +0000 (10:30 +0200)]
[flang] optionally lower scalar and explicit shape with fir.declare

Lower scalar and explicit shape arrays to fir.declare under the -hlfir option.
Update the SymMap so that it can hold fir::FortranVariableInterface.

The plan is to go towards a SymMap that only contains fir::FortranVariableInterface
once current expression lowering can be replaced. This should make the SymMap lighter
than it is today (SymBox/ExtendedValue are above 256 bytes).

Assumed shape, allocatable and pointer are left TODOs for now. Anything with a
specification expression that is not a constant expression will only be able to
be lowered when the HLFIR expression lowering skeleton is added.

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

2 years ago[flang] add fir.declare codegen support
Jean Perier [Thu, 20 Oct 2022 08:15:14 +0000 (10:15 +0200)]
[flang] add fir.declare codegen support

For now, nothing is done about debug info and the fir.declare is simply
replaced by the memref argument. This is done in the PreCGRewrite in
order to avoid requiring adding support for fir.shape codegen, which
would still be useless and undesired at that point.

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

2 years ago[gn build] Port 3c397c90c183
LLVM GN Syncbot [Thu, 20 Oct 2022 07:32:37 +0000 (07:32 +0000)]
[gn build] Port 3c397c90c183

2 years ago[llvm-debuginfo-analyzer] (04/09) - Locations and ranges
Carlos Alberto Enciso [Thu, 20 Oct 2022 06:01:31 +0000 (07:01 +0100)]
[llvm-debuginfo-analyzer] (04/09) - Locations and ranges

llvm-debuginfo-analyzer is a command line tool that processes debug
info contained in a binary file and produces a debug information
format agnostic “Logical View”, which is a high-level semantic
representation of the debug info, independent of the low-level
format.

The code has been divided into the following patches:

1) Interval tree
2) Driver and documentation
3) Logical elements
4) Locations and ranges
5) Select elements
6) Warning and internal options
7) Compare elements
8) ELF Reader
9) CodeView Reader

Full details:
https://discourse.llvm.org/t/llvm-dev-rfc-llvm-dva-debug-information-visual-analyzer/62570

This patch:

Locations and ranges
- All functionality for logical debug locations and ranges:
  LVLocation, LVRanges.

Reviewed By: psamolysov, probinson

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

2 years ago[mlir][aarch64] Disable bf16 tests on AArch64
Andrzej Warzynski [Wed, 19 Oct 2022 17:22:58 +0000 (17:22 +0000)]
[mlir][aarch64] Disable bf16 tests on AArch64

This patch disables 2 bf16 tests that are currently not supported on
AArch64. I've triaged these failures and opened [1] to track this. I
don't have a simple reproducer for dense_output_bf16.mlir, but it's
rather clear that both tests fail due to missing support for `bfloat`
operations in the AArch64 backend.

I'm not sure what the path forward to enable these tests on AArch64
should be. I think that there are two options:
  * AArch64 backened gains capability to legalize these nodes containing
    `bfloat` operands, or
  * MLIR (similarly to Clang) is taught not to emit such nodes in the
    first place.

[1] https://github.com/llvm/llvm-project/issues/58465

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

2 years ago[libc][Obvious] Fix incomplete spec definition of sys/random.h.
Siva Chandra Reddy [Thu, 20 Oct 2022 06:57:00 +0000 (06:57 +0000)]
[libc][Obvious] Fix incomplete spec definition of sys/random.h.

2 years ago[X86] Move 128/256-bit FP16/BF16 typedef to emmintrin.h or avxintrin.h, NFCI
Phoebe Wang [Thu, 20 Oct 2022 06:12:19 +0000 (14:12 +0800)]
[X86] Move 128/256-bit FP16/BF16 typedef to emmintrin.h or avxintrin.h, NFCI

2 years ago[mlir][llvm] Use longer variable names in LLVM IR import (NFC).
Tobias Gysi [Thu, 20 Oct 2022 05:26:10 +0000 (08:26 +0300)]
[mlir][llvm] Use longer variable names in LLVM IR import (NFC).

Rename single letter member variables and function arguments to use
longer names in ConvertFromLLVMIR.cpp. Also drop some uses of auto in
favor our spelling out the type and refactor some llvm::enumerate loops.

Reviewed By: ftynse

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

2 years ago[gn build] Port e28b9357b14c
LLVM GN Syncbot [Thu, 20 Oct 2022 05:20:35 +0000 (05:20 +0000)]
[gn build] Port e28b9357b14c

2 years ago[llvm-debuginfo-analyzer] (03/09) - Logical elements
Carlos Alberto Enciso [Wed, 19 Oct 2022 10:01:14 +0000 (11:01 +0100)]
[llvm-debuginfo-analyzer] (03/09) - Logical elements

llvm-debuginfo-analyzer is a command line tool that processes debug
info contained in a binary file and produces a debug information
format agnostic “Logical View”, which is a high-level semantic
representation of the debug info, independent of the low-level
format.

The code has been divided into the following patches:

1) Interval tree
2) Driver and documentation
3) Logical elements
4) Locations and ranges
5) Select elements
6) Warning and internal options
7) Compare elements
8) ELF Reader
9) CodeView Reader

Full details:
https://discourse.llvm.org/t/llvm-dev-rfc-llvm-dva-debug-information-visual-analyzer/62570

This patch:

Logical elements
- All basic functionality for the logical elements:
  LVScope, LVLine, LVSymbol, LVType.
- The logical reader:
  LVReader.h

Reviewed By: psamolysov, probinson

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

2 years ago[MLIR] Enable distribution target in standalone builds
Michał Górny [Wed, 19 Oct 2022 17:14:59 +0000 (19:14 +0200)]
[MLIR] Enable distribution target in standalone builds

Invoke llvm_distribution_add_targets() when doing standalone build
explicitly in order to create the `distribution` target.

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

2 years ago[testcase][OpenMP] Fix the testcase error of check-all when DCLANG_DEFAULT_OPENMP_RUN...
Zi Xuan Wu (Zeson) [Thu, 20 Oct 2022 01:44:38 +0000 (09:44 +0800)]
[testcase][OpenMP] Fix the testcase error of check-all when DCLANG_DEFAULT_OPENMP_RUNTIME is not libomp

When DCLANG_DEFAULT_OPENMP_RUNTIME is set to libgomp, there is some check-all error.
The expected CHECK result only displays when fopenmp=libomp is specified explicitly.

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

2 years ago[X86] Remove redundant static from constexpr. NFC
Phoebe Wang [Thu, 20 Oct 2022 01:29:22 +0000 (09:29 +0800)]
[X86] Remove redundant static from constexpr. NFC

2 years ago[CMake] Disable BOLT instrumentation of Clang on instrumented build
Amir Ayupov [Thu, 20 Oct 2022 01:23:43 +0000 (18:23 -0700)]
[CMake] Disable BOLT instrumentation of Clang on instrumented build

This enables multi-stage PGO build optimized by BOLT using BOLT.cmake cache.

The issue is that `-DPGO_BUILD_CONFIGURATION` cache file is passed to both
stage2-instrumented and stage2-optimized builds (for them to be identical),
but in case of BOLT.cmake, it doesn't make sense to BOLT-instrument the
instrumented binary (it's not going to be optimized). Hence turn off
`CLANG_BOLT_INSTRUMENT` code if `LLVM_BUILD_INSTRUMENTED` is enabled.

The final workflow that enables multi-stage InstrPGO+ThinLTO+BOLT Clang build:
```
cmake <llvm-project>/llvm -GNinja -DLLVM_ENABLE_LLD=ON \
  -DBOOTSTRAP_LLVM_ENABLE_LLD=ON -DBOOTSTRAP_BOOTSTRAP_LLVM_ENABLE_LLD=ON \
  -DPGO_INSTRUMENT_LTO=Thin -C llvm-project/clang/cmake/caches/BOLT-PGO.cmake
ninja stage2-clang++-bolt
```

Reviewed By: rafauler

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

2 years ago[gn build] Port 62ca79102cf9
LLVM GN Syncbot [Thu, 20 Oct 2022 01:14:27 +0000 (01:14 +0000)]
[gn build] Port 62ca79102cf9

2 years ago[X86][1/2] Support PREFETCHI instructions
Phoebe Wang [Thu, 20 Oct 2022 00:44:52 +0000 (08:44 +0800)]
[X86][1/2] Support PREFETCHI instructions

For more details about these instructions, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html

Reviewed By: craig.topper

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

2 years ago[docs] Update compiler-rt/CODE_OWNERS.TXT
Vitaly Buka [Mon, 10 Oct 2022 21:06:01 +0000 (14:06 -0700)]
[docs] Update compiler-rt/CODE_OWNERS.TXT

Reviewed By: compnerd, kcc, lhames, phosek, tejohnson, dvyukov, MaskRay

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

2 years ago[mlir][NVGPU] Handle native mma.sync and ldmatrix(x4) sizes
Manish Gupta [Wed, 12 Oct 2022 05:17:32 +0000 (05:17 +0000)]
[mlir][NVGPU] Handle native mma.sync and ldmatrix(x4) sizes

This patch handles native `mma.sync` sizes and enables issuing `ldmatrix` on
largest possible tiles for matrixB. It requires handling
`vector.extract_strided_slice` from vector to ngpu lowering.

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

2 years ago[test][asan][Darwin] Pass -mlinker-version=133 to linker invocation in odr-lto.cpp
Arthur Eubanks [Wed, 19 Oct 2022 23:33:30 +0000 (16:33 -0700)]
[test][asan][Darwin] Pass -mlinker-version=133 to linker invocation in odr-lto.cpp

When building clang with lld, we don't get a default mlinker-version [1]. This causes us to not pass -lto_library to ld64 [2].
Explicitly pass -mlinker-version=133 so we properly pass -lto_library to ld64 and don't get LLVM bitcode version mismatches due to LTO.

[1] https://github.com/llvm/llvm-project/blob/55ae180a4cb7fc68b3ac153f07752c8c6a2d92f0/clang/CMakeLists.txt#L345
[2] https://github.com/llvm/llvm-project/blob/55ae180a4cb7fc68b3ac153f07752c8c6a2d92f0/clang/lib/Driver/ToolChains/Darwin.cpp#L262-L270

2 years ago[VP] Teach isVPBinaryOp to recognize vp.smin/smax/umin/umax/minnum/maxnum.
Yeting Kuo [Wed, 12 Oct 2022 07:44:09 +0000 (15:44 +0800)]
[VP] Teach isVPBinaryOp to recognize vp.smin/smax/umin/umax/minnum/maxnum.

Those vp intrinsics should be vp binary operations.

Reviewed By: craig.topper

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

2 years ago[clang][RISCV] Set vscale_range attribute based on VLEN
Philip Reames [Wed, 19 Oct 2022 23:05:39 +0000 (16:05 -0700)]
[clang][RISCV] Set vscale_range attribute based on VLEN

Follow up on D135894, restructure code to work in terms of minimum and maximum VLEN coming from RISCVISAInfo.cpp. In the original review, I'd mentioned that MinVLEN was sometimes zero. This turns out to be a case of human error, combined with really bad (lack of) error reporting.

This patch adds appropriate tests for various vector extension combinations to show the mechanism works, but doesn't try to provide exhaustive coverage of the extension interactions. Presumably, that is already covered in existing tests elsewhere.

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

2 years ago[VE] Change the way to lower selectcc
Kazushi (Jam) Marukawa [Fri, 14 Oct 2022 23:04:00 +0000 (08:04 +0900)]
[VE] Change the way to lower selectcc

Change to use VEISD::CMPI/CMPU/CMPF/CMPQ and VEISD::CMOV in combineSelectCC
for better optimization.  Support VEISD::CMPI/CMPU in combineTRUNCATE also
to optimize truncate.  Remove obsolete lower patterns from VEInstrInfo.td.
Update regression tests also.

Reviewed By: efocht

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

2 years ago[libc][Obvious] Add termios.h to the list of x86_64 linux headers.
Siva Chandra Reddy [Wed, 19 Oct 2022 22:59:50 +0000 (22:59 +0000)]
[libc][Obvious] Add termios.h to the list of x86_64 linux headers.

2 years ago[RISCV] Remove -enable-unsafe-fp-math from machine combiner tests. NFC
Craig Topper [Wed, 19 Oct 2022 22:54:28 +0000 (15:54 -0700)]
[RISCV] Remove -enable-unsafe-fp-math from machine combiner tests. NFC

The optimization is using fast math flags on the instructions instead.

2 years ago[clang] Disable assertion that can "easily happen"
Jonas Devlieghere [Wed, 19 Oct 2022 20:32:31 +0000 (13:32 -0700)]
[clang] Disable assertion that can "easily happen"

Disable the assertion for getting a module ID for non-local,
non-imported module. According to the FIXME this can "easily happen" and
indeed, we're hitting this assertion regularly. Disable it until it can
be properly investigated.

rdar://99352728

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