platform/upstream/llvm.git
20 months ago[AMDGPU] Use Register in more places in SIInstrInfo. NFC.
Jay Foad [Tue, 25 Oct 2022 13:47:35 +0000 (14:47 +0100)]
[AMDGPU] Use Register in more places in SIInstrInfo. NFC.

Also avoid using AMDGPU::NoRegister when it's not neeeded.

20 months ago[X86] Add v4i64 test coverage for #58585
Simon Pilgrim [Tue, 25 Oct 2022 14:02:59 +0000 (15:02 +0100)]
[X86] Add v4i64 test coverage for #58585

Turns out we fail to do this for concat_v4i64(broadcast_v2i64,broadcast_v2i64) as well

20 months ago[AArch64][ARM] Alter v8.3a complex neon intrinsics to be target-based, not preprocess...
David Green [Tue, 25 Oct 2022 13:35:11 +0000 (14:35 +0100)]
[AArch64][ARM] Alter v8.3a complex neon intrinsics to be target-based, not preprocessor based

This alters the 8.3 complex intrinsics to be target-gated, as opposed to
hidden behind preprocessor macros. This is the last of arm_neon.h, and
follows the same formula as before.

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

20 months ago[X86] Add test coverage for #58585
Simon Pilgrim [Tue, 25 Oct 2022 13:33:43 +0000 (14:33 +0100)]
[X86] Add test coverage for #58585

20 months ago[mlir][llvm] Don't return a dangling reference in getCallableResults().
Johannes de Fine Licht [Tue, 25 Oct 2022 12:52:59 +0000 (15:52 +0300)]
[mlir][llvm] Don't return a dangling reference in getCallableResults().

Use the `getReturnTypes()` API (which returns an `ArrayRef<Type>`)
rather than the `getReturnType()` API (which returns a `Type`) to avoid
returning a dangling reference in `LLVMFuncOp::getCallableResults()`.

Reviewed By: ftynse

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

20 months ago[X86] Fold vbroadcast(bitcast(vbroadcast(src))) -> bitcast(vbroadcast(vbroadcast...
Simon Pilgrim [Tue, 25 Oct 2022 13:03:35 +0000 (14:03 +0100)]
[X86] Fold vbroadcast(bitcast(vbroadcast(src))) -> bitcast(vbroadcast(vbroadcast(src)))

If the inner broadcast scalar type is smaller/same width as the outer broadcast scalar type then we can broadcast using the same inner type directly. Works for vbroadcast_load as well.

20 months ago[LLDB] [LoongArch] Add minimal LoongArch support
Tiezhu Yang [Tue, 25 Oct 2022 12:19:06 +0000 (12:19 +0000)]
[LLDB] [LoongArch] Add minimal LoongArch support

Add as little code as possible to allow compiling lldb on LoongArch.
Actual functionality will be implemented later.

Reviewed By: SixWeining, DavidSpickett

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

20 months agoRevert "[PGO] Make emitted symbols hidden"
Nico Weber [Tue, 25 Oct 2022 12:54:47 +0000 (08:54 -0400)]
Revert "[PGO] Make emitted symbols hidden"

This reverts commit 04877284b4592e9286cab43467662c1b4ff81861.
Looks like this is still breaking the test
Profile-x86_64 :: instrprof-darwin-dead-strip.c
(see comment on https://reviews.llvm.org/D135340).

20 months ago[LLDB][Docs][NFC] Fix formatting in -gmodules documentation
Michael Buch [Tue, 25 Oct 2022 11:32:49 +0000 (12:32 +0100)]
[LLDB][Docs][NFC] Fix formatting in -gmodules documentation

20 months ago[LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV
Emmmer [Thu, 20 Oct 2022 15:05:37 +0000 (23:05 +0800)]
[LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV

Add:

- RV64C instructions sets.
- corresponding unittests.
- `c.break` code for lldb and lldb-server

Fix:
- wrong decoding of imm in `DecodeSType`

Reviewed By: DavidSpickett

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

20 months ago[libc] Switch to new implementation of mem* functions
Guillaume Chatelet [Mon, 24 Oct 2022 13:10:53 +0000 (13:10 +0000)]
[libc] Switch to new implementation of mem* functions

The new framework makes it explicit which processor feature is being
used and allows for easier per platform customization:
 - ARM cpu now uses trivial implementations to reduce code size.
 - Memcmp, Bcmp and Memmove have been optimized for x86
 - Bcmp has been optimized for aarch64.

This is a reland of https://reviews.llvm.org/D135134 (b3f1d58)

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

20 months ago[clang][ExtractAPI] Allow users to specify a list of symbols to ignore
Daniel Grumberg [Fri, 21 Oct 2022 13:49:46 +0000 (14:49 +0100)]
[clang][ExtractAPI] Allow users to specify a list of symbols to ignore

Adds a `--extract-api-ignores=` command line option that allows users to
provide a file containing a new line separated list of symbols to
unconditionally ignore when extracting API information.

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

20 months ago[AArch64][SVE2] Add the SVE2.1 signed and unsigned 2-way dot instructions
David Sherwood [Wed, 19 Oct 2022 13:59:58 +0000 (13:59 +0000)]
[AArch64][SVE2] Add the SVE2.1 signed and unsigned 2-way dot instructions

This patch adds the assembly/disassembly for the following instructions:

SDOT : Signed integer 2-way dot product indexed and non-indexed
UDOT : Unsigned integer 2-way dot product, indexed and non-indexed

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09

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

20 months ago[LLDB] Add missing breaks to current frame row in command map
David Spickett [Tue, 25 Oct 2022 10:19:29 +0000 (10:19 +0000)]
[LLDB] Add missing breaks to current frame row in command map

Without these it was rendering as one line for all three commands.

20 months ago[Clang][AArch64] Add TargetParser support for defining CPU aliases
Sjoerd Meijer [Mon, 24 Oct 2022 15:32:26 +0000 (21:02 +0530)]
[Clang][AArch64] Add TargetParser support for defining CPU aliases

This adds AArch64 TargetParser support to define CPU aliases, and
ports the definition of Grace over to that. This is following up
on D136425.

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

20 months ago[AArch64] Add precommit test for bcmp; NFC
chenglin.bi [Tue, 25 Oct 2022 09:23:03 +0000 (17:23 +0800)]
[AArch64] Add precommit test for bcmp; NFC

20 months ago[clang-format] Move bracket to correct line.
Adrian Kuegel [Tue, 25 Oct 2022 09:04:59 +0000 (11:04 +0200)]
[clang-format] Move bracket to correct line.

20 months ago[AArch64][SVE] Use more flag-setting instructions
Cullen Rhodes [Tue, 25 Oct 2022 08:29:09 +0000 (08:29 +0000)]
[AArch64][SVE] Use more flag-setting instructions

If OP in PTEST(PG, OP(PG, ...)) has a flag-setting variant change the
opcode so the PTEST becomes redundant. This patch extends this existing
optimization in AArch64::optimizePTestInstr to cover all flag-setting
opcodes.

Reviewed By: peterwaller-arm

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

20 months ago[AArch64][SVE] NFC: extend tests for flag-setting predicate instructions
Cullen Rhodes [Tue, 25 Oct 2022 08:28:12 +0000 (08:28 +0000)]
[AArch64][SVE] NFC: extend tests for flag-setting predicate instructions

A follow on patch will extend existing

  PTEST(PG, OP(PG, ...)) -> OP_FLAG_SETTING(PG, ...)

optimization in AArch64InstrInfo::optimizePTestInstr to cover more of
the flag-setting instructions

Reviewed By: peterwaller-arm

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

20 months ago[NFC][AMDGPU] Pre-commit test for D136432
Thomas Symalla [Tue, 25 Oct 2022 08:51:37 +0000 (10:51 +0200)]
[NFC][AMDGPU] Pre-commit test for D136432

Nested BFI instruction with multiple uses.

20 months ago[AArch64][SVE2] Add the SVE2.1 bfmlslb and bfmlslt instructions
David Sherwood [Wed, 19 Oct 2022 11:53:21 +0000 (11:53 +0000)]
[AArch64][SVE2] Add the SVE2.1 bfmlslb and bfmlslt instructions

This patch adds the assembly/disassembly for the following instructions:

BFMLSLB : BFloat16 floating-point multiply-subtract long
          from single-precision (bottom)
BFMLSLT : BFloat16 floating-point multiply-subtract long
          from single-precision (top)

Both the vector and indexed forms are added for each.

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09

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

20 months ago[AArch64]SME2 Multi-vector ternary indexed DOT and FMLA instructions
Caroline Concatto [Fri, 21 Oct 2022 16:09:35 +0000 (17:09 +0100)]
[AArch64]SME2 Multi-vector ternary indexed DOT and FMLA instructions

This patch adds the assembly/disassembly for the following instruction:
FP:
  FMLA (multiple and indexed vector): Multi-vector floating-point fused multiply-add by indexed element.
  FMLS(multiple and indexed vector): Multi-vector floating-point fused multiply-subtract by indexed element.

  BFDOT (multiple and indexed vector): Multi-vector BFloat16 floating-point dot-product by indexed element.
  FDOT (multiple and indexed vector): Multi-vector half-precision floating-point dot-product by indexed element.
  BFVDOT: Multi-vector BFloat16 floating-point vertical dot-product by indexed element.
  FVDOT: Multi-vector half-precision floating-point vertical dot-product by indexed element.

INT:
  SDOT (2-way, multiple and indexed vector): Multi-vector signed integer dot-product by indexed element.
       (4-way, multiple and indexed vector): Multi-vector signed integer dot-product by indexed element.
  SUDOT (multiple and indexed vector): Multi-vector signed by unsigned integer dot-product by indexed elements.
  SUVDOT: Multi-vector signed by unsigned integer vertical dot-product by indexed element.
  UDOT (2-way, multiple and indexed vector): Multi-vector unsigned integer dot-product by indexed element.
       (4-way, multiple and indexed vector): Multi-vector unsigned integer dot-product by indexed element.
  USDOT (multiple and indexed vector): Multi-vector unsigned by signed integer dot-product by indexed element.
  USVDOT: Multi-vector unsigned by signed integer vertical dot-product by indexed element.

For the multi-vec ternary indexed with 2 and 4 ZA single-vectors for
32 and 64 bits according to the instruction

The reference can be found here:
    https://developer.arm.com/documentation/ddi0602/2022-09

Depends on:D135563

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

20 months ago[MachineVerifier] Try harder to verify LiveVariables
Jay Foad [Wed, 6 Jul 2022 13:00:32 +0000 (14:00 +0100)]
[MachineVerifier] Try harder to verify LiveVariables

Verify the LiveVariables analysis after a pass that claims to preserve
it, even if there are no further passes (apart from the verifier itself)
that would use the analysis.

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

20 months ago[X86] Update LiveVariables in more cases in convertToThreeAddress
Jay Foad [Mon, 24 Oct 2022 14:00:36 +0000 (15:00 +0100)]
[X86] Update LiveVariables in more cases in convertToThreeAddress

Following on from D129634, this patch fixes more X86 CodeGen test
failures with D129213 applied, which adds verification of LiveIntervals
after the TwoAddressInstruction pass runs. These failures only showed up
with LLVM_ENABLE_EXPENSIVE_CHECKS=ON which adds the equivalent of an
implicit -verify-machineinstrs on all tests.

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

20 months ago[AArch64][SME] Fix chain for arm_locally_streaming functions.
Sander de Smalen [Tue, 25 Oct 2022 07:53:31 +0000 (07:53 +0000)]
[AArch64][SME] Fix chain for arm_locally_streaming functions.

The Chain wasn't set correctly in the DAG for functions marked
with aarch64_pstate_sm_body, which meant that SelectionDAG would
dead-code some of the CopyToReg's. This didn't show up in the
existing tests because all uses were in the same block, but when
adding some control-flow, suddenly things would break.

Reviewed By: kmclaughlin

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

20 months ago[AArch64]SME2 Multiple vectors Int/FP clamp instructions for two/four registers
Caroline Concatto [Fri, 21 Oct 2022 15:44:23 +0000 (16:44 +0100)]
[AArch64]SME2 Multiple vectors Int/FP clamp instructions for two/four registers

This patch adds the assembly/disassembly for the following instruction:
Int:
  SCLAMP:Multi-vector signed clamp to minimum/maximum vector.
  UCLAMP:Multi-vector unsigned clamp to minimum/maximum vector.
FP:
  FCLAMP: Multi-vector floating-point clamp to minimum/maximum number.

  The reference can be found here:

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

    Depends on: D135563

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

20 months ago[NFC] Fix merge mistake in TokenAnnotator.cpp
Tobias Hieta [Tue, 25 Oct 2022 08:08:28 +0000 (10:08 +0200)]
[NFC] Fix merge mistake in TokenAnnotator.cpp

20 months ago[AArch64]SME2 Single and multiple vectors SVE Destructive two/four registers[part2]
Caroline Concatto [Fri, 21 Oct 2022 14:59:18 +0000 (15:59 +0100)]
[AArch64]SME2 Single and multiple vectors SVE Destructive two/four registers[part2]

This patch adds the assembly/disassembly for the following instruction:
INT:
  SMAX (multiple and single vector): Multi-vector signed maximum by vector.
       (multiple vectors): Multi-vector signed maximum.
  SMIN (multiple and single vector): Multi-vector signed minimum by vector.
       (multiple vectors): Multi-vector signed minimum.
  UMAX (multiple and single vector): Multi-vector unsigned maximum by vector.
       (multiple vectors): Multi-vector unsigned maximum.
  UMIN (multiple and single vector): Multi-vector unsigned minimum by vector.
       (multiple vectors): Multi-vector unsigned minimum.
  SRSHL (multiple and single vector): Multi-vector signed rounding shift left by vector.
        (multiple vectors): Multi-vector signed rounding shift left.
  URSHL (multiple and single vector): Multi-vector unsigned rounding shift left by vector.
        (multiple vectors): Multi-vector unsigned rounding shift left.
FP:
  FMAX (multiple and single vector): Multi-vector floating-point maximum by vector.
       (multiple vectors): Multi-vector floating-point maximum.
  FMAXNM (multiple and single vector): Multi-vector floating-point maximum number by vector.
         (multiple vectors): Multi-vector floating-point maximum number.
  FMIN (multiple and single vector): Multi-vector floating-point minimum by vector.
       (multiple vectors): Multi-vector floating-point minimum.
  FMINNM (multiple and single vector): Multi-vector floating-point minimum number by vector.
         (multiple vectors): Multi-vector floating-point minimum number.

The reference can be found here:

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

It also updates ADD and SQDMULH

Depends on: D135563

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

20 months ago[AArch64][ARM] Alter v8.1a neon intrinsics to be target-based, not preprocessor based
David Green [Tue, 25 Oct 2022 08:02:52 +0000 (09:02 +0100)]
[AArch64][ARM] Alter v8.1a neon intrinsics to be target-based, not preprocessor based

As a continuation of D132034, this switches the QRDMX v8.1a neon
intrinsics over from preprocessor defines to be target-gated. As there
is no "rdma" or "qrdmx" target feature, they use the "v8.1a"
architecture feature directly.

This works well for AArch64, but something needs to be done for Arm at
the same time, as they both use the same header and tablegen emitter.
This patch opts for adding "v8.1a" and all dependant target features to
the Arm TargetParser, similar to what was recently done for AArch64 but
through initFeatureMap when the Architecture is parsed. I attempted to
make the code similar to the AArch64 backend.

Otherwise this is similar to the changes made in D132034.

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

20 months ago[clang-format] Mark pragma region lines as StringLiterals
Tobias Hieta [Tue, 25 Oct 2022 07:59:10 +0000 (09:59 +0200)]
[clang-format] Mark pragma region lines as StringLiterals

In our code-base we auto-generate pragma regions the regions
look like method signatures like:

`#pragma region MYREGION(Foo: bar)`

The problem here was that the rest of the line after region
was not marked as stringliteral as in the case of pragma mark
so clang-format tried to change the formatting based on the
method signature.

Added test and mark it similar as pragma mark.

Reviewed By: owenpan

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

20 months ago[IncludeCleaner] Handle more C++ constructs
Kadir Cetinkaya [Wed, 17 Aug 2022 14:54:04 +0000 (16:54 +0200)]
[IncludeCleaner] Handle more C++ constructs

Summary:
This brings IncludeCleaner's reference discovery from AST to the parity
with current implementation in clangd. Some highlights:
- Handling of MemberExprs, only the member declaration is marked as
  referenced and not the container, unlike clangd.
- Constructor calls, only the constructor and not the container, unlike
  clangd.
- All the possible candidates for unresolved overloads, same as clangd.
- All the shadow decls for using-decls, same as clangd.
- Declarations for definitions of enums with an underlying type and
  functions, same as clangd.
- Using typelocs, using templatenames and typedefs only reference the
  found decl, same as clangd.
- Template specializations only reference the primary template, not the
  explicit specializations, to be fixed.
- Expr types aren't marked as used, unlike clangd.

Going forward, we can consider having signals to indicate type of a
reference (e.g. `implicit` signal for type of an expr) so that the
applications can perform a filtering based on their needs.
At the moment the biggest discrepancy is around type of exprs, i.e. not
marking containers for member/constructor accesses. I believe this is
the right model since the declaration of the member and the container
should be available in a single file (modulo macros).

Reviewers: sammccall

Subscribers:

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

20 months ago[clang] Replace BACKEND_PACKAGE_STRING with LLVM_VERSION_STRING
Fangrui Song [Tue, 25 Oct 2022 07:24:25 +0000 (00:24 -0700)]
[clang] Replace BACKEND_PACKAGE_STRING with LLVM_VERSION_STRING

420d7ccbac0f499a6ff9595bdbfa99cd3376df22 introduced BACKEND_PACKAGE_STRING to
replace `PACKAGE_VERSION` (llvm/Config/config.h) to support standalone builds.
This is used in the output of `clang -cc1 -v`.

Since llvm-config.h is available for both standalone and non-standalone builds,
we can just use `LLVM_VERSION_STRING` from llvm-config.h.

clang/cmake/modules/AddClang.cmake uses `VERSION_STRING "${CLANG_VERSION} (${BACKEND_PACKAGE_STRING})"`.
Just simplify it to `"${CLANG_VERSION}"` so that we can remove the CMake
variable BACKEND_PACKAGE_STRING.

Reviewed By: tstellar

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

20 months ago[ObjCARC][NFC] Fix defined but not used warning from D135041
LiaoChunyu [Tue, 25 Oct 2022 07:01:57 +0000 (15:01 +0800)]
[ObjCARC][NFC] Fix defined but not used warning from D135041

Reviewed By: MaskRay

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

20 months ago[gn build] Port fdac4c4e92e5
LLVM GN Syncbot [Tue, 25 Oct 2022 06:57:59 +0000 (06:57 +0000)]
[gn build] Port fdac4c4e92e5

20 months ago[X86] Add CMPCCXADD instructions.
Freddy Ye [Tue, 25 Oct 2022 05:49:14 +0000 (13:49 +0800)]
[X86] Add CMPCCXADD 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: pengfei, skan

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

20 months ago[flang] Allow all OSes in fir::CodeGenSpecifics::get
Fangrui Song [Tue, 25 Oct 2022 05:45:28 +0000 (22:45 -0700)]
[flang] Allow all OSes in fir::CodeGenSpecifics::get

This allows all ELF operating systems to use target specifics tuned for Linux,
since they use mostly the same ABIs. If some triples are to excluded, it's
better done at the driver layer.

Reviewed By: emaste

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

20 months agollvm-reduce: Remove unnecessary arguments from test
Matt Arsenault [Mon, 24 Oct 2022 19:24:45 +0000 (12:24 -0700)]
llvm-reduce: Remove unnecessary arguments from test

20 months agollvm-reduce: Remove pointless template arguments
Matt Arsenault [Mon, 24 Oct 2022 17:55:29 +0000 (10:55 -0700)]
llvm-reduce: Remove pointless template arguments

20 months ago[mlir:LLVM] Rewrite the LLVMIR export to use the debug info attributes
River Riddle [Sat, 22 Oct 2022 23:28:32 +0000 (16:28 -0700)]
[mlir:LLVM] Rewrite the LLVMIR export to use the debug info attributes

This has been a long standing TODO, and actually enables users to generate
debug information for LLVM using the LLVM dialect; as opposed to our
dummy placeholder that generated just enough for line table information.

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

20 months ago[ompd] Fix gdb-plugin warnings after D100185
Fangrui Song [Tue, 25 Oct 2022 05:28:27 +0000 (22:28 -0700)]
[ompd] Fix gdb-plugin warnings after D100185

20 months ago[RISCV] Add shift amount operands of shift, rotate, and Zbs instructions to hasAllNBi...
Craig Topper [Tue, 25 Oct 2022 05:02:48 +0000 (22:02 -0700)]
[RISCV] Add shift amount operands of shift, rotate, and Zbs instructions to hasAllNBitUsers.

20 months agoAdd a document on side effects & speculation in MLIR
Sanjoy Das [Thu, 13 Oct 2022 18:08:04 +0000 (11:08 -0700)]
Add a document on side effects & speculation in MLIR

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

20 months ago[RISCV] Add ORI to hasAllNBitUsers.
Craig Topper [Tue, 25 Oct 2022 04:32:48 +0000 (21:32 -0700)]
[RISCV] Add ORI to hasAllNBitUsers.

If the immediate is negative with sufficient leading ones, then
the upper bits of the other operand aren't demanded.

20 months ago[RISCV] Move vector cost table lookup out of the switch in getIntrinsicInstrCost...
Craig Topper [Tue, 25 Oct 2022 03:30:54 +0000 (20:30 -0700)]
[RISCV] Move vector cost table lookup out of the switch in getIntrinsicInstrCost. NFC

This allows vectors to be looked up if the switch is used for the
scalar version of an intrinsic.

Extracted from D136508.

20 months ago[RISCV] Rename lowerFTRUNC_FCEIL_FFLOOR_FROUND to lowerVectorFTRUNC_FCEIL_FFLOOR_FROU...
Craig Topper [Tue, 25 Oct 2022 00:14:53 +0000 (17:14 -0700)]
[RISCV] Rename lowerFTRUNC_FCEIL_FFLOOR_FROUND to lowerVectorFTRUNC_FCEIL_FFLOOR_FROUND. NFC

Extracted from D136508.

20 months ago[clang-format] Insert closing braces after an unaffected line
owenca [Sun, 23 Oct 2022 08:28:43 +0000 (01:28 -0700)]
[clang-format] Insert closing braces after an unaffected line

The token that records the number of closing braces to be inserted
may be on an unaffected line. Extra work is required in order to
actually insert the closing braces after inserting the matching
opening braces of affected lines.

Fixes #58161.

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

20 months ago[flang] Add two semantic checks about BIND(C) attribute
Peixin-Qiao [Tue, 25 Oct 2022 02:19:54 +0000 (10:19 +0800)]
[flang] Add two semantic checks about BIND(C) attribute

As Fortran 2018 C1546, an elemental procedure shall not have the BIND
attribute.

As 18.3.6, it does not mention that an array with VALUE can be
interoperable. It is not reasonable to pass an array by value when the
array is too large. Forbid it to be consistent with gfortran/ifort.

Reviewed By: jeanPerier

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

20 months ago[flang] Make default quad precision kind target dependent
Peixin-Qiao [Tue, 25 Oct 2022 02:15:34 +0000 (10:15 +0800)]
[flang] Make default quad precision kind target dependent

The quad precision kind is defined as 8 by default in
flang/include/flang/Common/default-kinds.h. However, it should be target
dependent. This fixes the default quad precision kind when the target
is on X86_64.

Reviewed By: klausler

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

20 months ago[memprof] Respect COMPILER_RT_BUILD_MEMPROF when install memprof headers
Enna1 [Tue, 25 Oct 2022 01:34:50 +0000 (09:34 +0800)]
[memprof] Respect COMPILER_RT_BUILD_MEMPROF when install memprof headers

When COMPILER_RT_BUILD_MEMPROF is disabled, the memprof headers should not be installed.

Reviewed By: mgorny, tejohnson

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

20 months agoFix LazyInitialization in tsan
zijunzhao [Tue, 25 Oct 2022 00:19:03 +0000 (00:19 +0000)]
Fix LazyInitialization in tsan

In Android, further initialization is always necessary whether preinit_array can be used.
LazyInitialize is needed regardless of .preinit_array support on platforms where runtime is loaded as dynamic library, e.g. Android.

Reviewed By: dvyukov, vitalybuka

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

20 months ago[Polly][docs] Avoid use of code-block:: guess.
Michael Kruse [Mon, 24 Oct 2022 23:45:38 +0000 (18:45 -0500)]
[Polly][docs] Avoid use of code-block:: guess.

The 'guess' language triggers a warning in the polly-sphinx-docs:
https://lab.llvm.org/staging/#/builders/199/builds/209
which is treated as an error by default.

This might be related to the Sphinx bug
https://github.com/sphinx-doc/sphinx/issues/7139

20 months ago[clang] Fix missing diagnostic of declaration use when accessing TypeDecls through...
Matheus Izvekov [Sat, 22 Oct 2022 13:51:54 +0000 (15:51 +0200)]
[clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access

Fixes GH58547.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136533

20 months ago[ASAN] Remove asserts introduced in https://reviews.llvm.org/D136197
Roy Sundahl [Mon, 24 Oct 2022 23:01:40 +0000 (16:01 -0700)]
[ASAN] Remove asserts introduced in https://reviews.llvm.org/D136197

Additional calls were introduced for outlining (opposite of inlining)
in https://reviews.llvm.org/D136197 which contain asserts that partial
poisoning of a single byte wouldn't happen consecutively but this is
too strong and actually does occur in Windows. Removing those asserts
as they are unnecessary

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

20 months ago[MSAN] Add handleCountZeroes for ctlz and cttz.
Kevin Athey [Tue, 25 Oct 2022 00:08:52 +0000 (17:08 -0700)]
[MSAN] Add handleCountZeroes for ctlz and cttz.

This addresses a bug where vector versions of ctlz are creating false positive reports.

Depends on D136369

Reviewed By: vitalybuka

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

20 months ago[libc] Add the header sys/types.h.
Siva Chandra Reddy [Mon, 24 Oct 2022 22:18:58 +0000 (22:18 +0000)]
[libc] Add the header sys/types.h.

Reviewed By: michaelrj

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

20 months ago[MSAN] Count Zeroes test for covering ctlz and cttz under MSAN. (NFC)
Kevin Athey [Sat, 22 Oct 2022 09:12:53 +0000 (02:12 -0700)]
[MSAN] Count Zeroes test for covering ctlz and cttz under MSAN. (NFC)

Reviewed By: vitalybuka

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

20 months agoFix breakpoint setting so it always works when there is a line entry in a compile...
Greg Clayton [Tue, 18 Oct 2022 21:59:26 +0000 (14:59 -0700)]
Fix breakpoint setting so it always works when there is a line entry in a compile unit's line table.

Prior to this fix, if the compile unit function:

  void CompileUnit::ResolveSymbolContext(const SourceLocationSpec &src_location_spec, SymbolContextItem resolve_scope, SymbolContextList &sc_list);

was called with a resolve scope that wasn't just eSymbolContextLineEntry, we would end up calling:

  line_entry.range.GetBaseAddress().CalculateSymbolContext(&sc, resolve_scope);

This is ok as long as the line entry's base address is able to be resolved back to the same information, but there were problems when it didn't. The example I found was we have a file with a bad .debug_aranges section where the address to compile unit mapping was incomplete. When this happens, the above function call to calculate the symbol context would end up matching the module and it would NULL out the compile unit and line entry, which means we would fail to set this breakpoint. We have many other clients that ask for eSymbolContextEverything as the resolve_scope, so all other locations could end up failing as well.

The solutions is to make sure the compile unit matches the current compile unit after calling the calculate symbol context. If the compile unit is NULL, then we report an error via the module/debugger as this indicates an entry in the line table fails to resolve back to any compile unit. If the compile unit is not NULL and it differs from the current compile unit, we restore the current compile unit and line entry to ensure the call to .CalculateSymbolContext doesn't match something completely different, as can easily happen if LTO or other link time optimizations are enabled that could end up outlining or merging functions.

This patch allows breakpoint succeeding to work as expected and not get short circuited by our address lookup logic failing.

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

20 months ago[libc] Build fix.
Raman Tenneti [Mon, 24 Oct 2022 23:16:40 +0000 (16:16 -0700)]
[libc] Build fix.

Build fix.

Reviewed By: rtenneti

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

20 months agoNFC: [clang] Template argument cleanups.
Matheus Izvekov [Mon, 24 Oct 2022 12:18:46 +0000 (14:18 +0200)]
NFC: [clang] Template argument cleanups.

Removes a bunch of obsolete methods in favor of a single one returning
an ArrayRef of TemplateArgument.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136602

20 months ago[libc] Add implementation of difftime function.
Raman Tenneti [Mon, 24 Oct 2022 18:42:43 +0000 (11:42 -0700)]
[libc] Add implementation of difftime function.

The difftime function computes the difference between two calendar
times: time1 - time0 as per as per 7.27.2.2 section in
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2478.pdf.

  double difftime(time_t time1, time_t time0);

Tested:
Unit tests

Co-authored-by: Jeff Bailey <jeffbailey@google.com>
Reviewed By: jeffbailey

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

20 months ago[DirectX backend] set target triple to "dxil-ms-dx"
Xiang Li [Mon, 24 Oct 2022 17:58:05 +0000 (10:58 -0700)]
[DirectX backend] set target triple to "dxil-ms-dx"

Set target triple to "dxil-ms-dx" for DXIL at the end of DXILTranslateMetadata.

Reviewed By: beanz

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

20 months ago[ASAN] Don't inline when -asan-max-inline-poisoning-size=0
Roy Sundahl [Tue, 18 Oct 2022 18:52:52 +0000 (14:52 -0400)]
[ASAN] Don't inline when -asan-max-inline-poisoning-size=0

When -asan-max-inline-poisoning-size=0, all shadow memory access should be
outlined (through asan calls). This was not occuring when partial poisoning
was required on the right side of a variable's redzone. This diff contains
the changes necessary to implement and utilize  __asan_set_shadow_01() through
__asan_set_shadow_07(). The change is necessary for the full abstraction of
the asan implementation and will enable experimentation with alternate strategies.

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

20 months ago[ORC] Allow EPCEHFrameRegistrar clients to specify registration function dylib.
Lang Hames [Mon, 24 Oct 2022 20:46:10 +0000 (13:46 -0700)]
[ORC] Allow EPCEHFrameRegistrar clients to specify registration function dylib.

Previously, EPCEHFrameRegistrar always used the
ExecutorProcessControl::loadDylib(nullptr) method to obtain a handle for the
process, but this doesn't work if the registration functions aren't visible in
a standard search of the process (e.g. if the JIT is in a plugin that is loaded
with RTLD_LOCAL).

This patch retains the old behavior by default, but allows clients to supply
their own handle for the library containing the registration functions if they
need to (e.g. to work around limitations like RDLD_LOCAL above, which aren't
expressible within the existing loadDylib / DynamicLibrary APIs).

20 months ago[ORC] Use raw OS handle values, ExecutorAddr for EPC dylib handles.
Lang Hames [Mon, 24 Oct 2022 19:41:45 +0000 (12:41 -0700)]
[ORC] Use raw OS handle values, ExecutorAddr for EPC dylib handles.

Updates tpctypes::DylibHandle to be an ExecutorAddr (rather than a uint64_t),
and SimpleExecutorDylibManager to hold and return raw OS handle values (as
ExecutorAddrs) rather than index values into a map of DynamicLibrary instances.

This will allow clients to use EPCGenericDylibManager in contexts where the
existing DynamicLibrary interface is too limited to be used. (e.g. to look up
JIT symbols in a dylib that was loaded with RTLD_LOCAL).

20 months ago[InstCombine] allow more commutative matches for logical-and to select fold
Sanjay Patel [Mon, 24 Oct 2022 20:21:53 +0000 (16:21 -0400)]
[InstCombine] allow more commutative matches for logical-and to select fold

This is a sibling transform to the fold just above it. That was changed
to allow the corresponding commuted patterns with:
307307456277
e1bd759ea567
8628e6df7000

20 months agoFix a failing C DR test case found by post-commit CI
Aaron Ballman [Mon, 24 Oct 2022 20:24:11 +0000 (16:24 -0400)]
Fix a failing C DR test case found by post-commit CI

This should address the failure found by:
https://lab.llvm.org/buildbot/#/builders/231/builds/4152

20 months ago[Instcombine] Add coverage for demanded bits of insertelement
Philip Reames [Mon, 24 Oct 2022 20:13:36 +0000 (13:13 -0700)]
[Instcombine] Add coverage for demanded bits of insertelement

20 months agoreland e5581df60a35 [SimplifyCFG] accumulate bonus insts cost
Yaxun (Sam) Liu [Sat, 17 Sep 2022 21:57:35 +0000 (17:57 -0400)]
reland e5581df60a35 [SimplifyCFG] accumulate bonus insts cost

Fixed compile time increase due to always constructing LocalCostTracker.
Now only construct LocalCostTracker when needed.

20 months ago[clang][CodeGen] Consistently return nullptr Values for void builtins and scalar...
Markus Böck [Mon, 24 Oct 2022 18:55:52 +0000 (20:55 +0200)]
[clang][CodeGen] Consistently return nullptr Values for void builtins and scalar initalization

A common post condition of the various visitor functions in CodeGen is that instructions, that do not return any values, simply return a nullptr Value as a sentinel. This has not been the case however for calls to some builtins returning void, as well as for an initializer expression of the form `void()`. This would then lead to ICEs in CodeGen on code relying on nullptr being returned for void values, which is eg. the case for conditional expressions [0].
This patch fixes that by returning nullptr Values for intrinsics known not to return any values as well as for a scalar initializer returning void.

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

[0] https://github.com/llvm/llvm-project/blob/266ec801fb23f9f5f1d61ca9466e0805fbdb78a7/clang/lib/CodeGen/CGExprScalar.cpp#L4849-L4892

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

20 months ago[RISCV][clang] Support RISC-V vectors in UninitializedValues.
Craig Topper [Mon, 24 Oct 2022 19:30:36 +0000 (12:30 -0700)]
[RISCV][clang] Support RISC-V vectors in UninitializedValues.

RISC-V vectors are basically vectors, but we use builtin types to
restrict the possible types. Treat them the same as vectors and scalars
for this analysis.

Reviewed By: reames

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

20 months ago"Reapply "GH58368: Correct concept checking in a lambda defined in concept""
Erich Keane [Mon, 24 Oct 2022 19:20:36 +0000 (12:20 -0700)]
"Reapply "GH58368: Correct concept checking in a lambda defined in concept""

This reverts commit cecc9a92cfca71c1b6c2a35c5e302ab649496d11.

The problem ended up being how we were handling the lambda-context in
code generation: we were assuming any decl context here would be a
named-decl, but that isn't the case.  Instead, we just replace it with
the concept's owning context.

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

20 months ago[mlir] Update Location to use new casting infra
Nick Kreeger [Mon, 24 Oct 2022 19:32:12 +0000 (14:32 -0500)]
[mlir] Update Location to use new casting infra

This allows for using the llvm namespace cast methods instead of the ones on the Location class. The Location class method are kept for now, but we'll want to remove these eventually (with a really long lead time).

Related change: https://reviews.llvm.org/D135870

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

20 months ago[clang][Toolchains][Gnu] pass -g through to assembler
Nick Desaulniers [Mon, 24 Oct 2022 19:21:12 +0000 (12:21 -0700)]
[clang][Toolchains][Gnu] pass -g through to assembler

We've been working around this for a long time in the Linux kernel; we
bend over backwards to continue to support CC=clang (w/
-fno-integrated-as) for architectures where clang can't yet be used to
assemble the kernel's assembler sources. Supporting debug info for the
combination of CC=clang w/ GNU binutils as "GAS" has been painful.

Fix this in clang so that we can work towards dropping complexity in the
Linux kernel's build system, Kbuild, for supporting this combination of
tools.

GAS added support for -g in 2004 2.16 release via
commit 329e276daf98 ("Add support for a -g switch to GAS")

Reviewed By: MaskRay

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

20 months ago[InstCombine] Explicitly check for scalable TypeSize.
Craig Topper [Mon, 24 Oct 2022 18:35:24 +0000 (11:35 -0700)]
[InstCombine] Explicitly check for scalable TypeSize.

Instead of assuming it is a fixed size.

Reviewed By: peterwaller-arm

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

20 months ago[clang-format][NFC] Handle language specific stuff at the top...
Björn Schäpers [Mon, 10 Oct 2022 13:01:51 +0000 (15:01 +0200)]
[clang-format][NFC] Handle language specific stuff at the top...

... of TokenAnnotator::splitPenalty. That is in my eyes a bit clearer
in the workflow.

As a drive-by introduce (but not adapt anywhere else) isProto().

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

20 months ago[clang-format] Handle unions like structs and classes
Björn Schäpers [Tue, 11 Oct 2022 07:04:28 +0000 (09:04 +0200)]
[clang-format] Handle unions like structs and classes

There is no reason why unions should be handled differently, I think
they are just forgotten since they are not used that often.

No test case added, since that would be complicated to produce.

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

20 months ago[clang-format][NFC] Fix comment grammer in ContinuationIndenter
Björn Schäpers [Mon, 10 Oct 2022 12:54:54 +0000 (14:54 +0200)]
[clang-format][NFC] Fix comment grammer in ContinuationIndenter

Now all comments (for which id makes sense) end with a punctuation.

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

20 months ago[AArch64]]SME2 multi-vec to multi-vec FP/INT down convert 2/4 registers
Caroline Concatto [Mon, 10 Oct 2022 15:34:27 +0000 (16:34 +0100)]
[AArch64]]SME2 multi-vec to multi-vec FP/INT down convert 2/4 registers

This patch implements:
 FCVTZS: Multi-vector floating-point convert to signed integer, rounding
         toward zero.
 FCVTZU: Multi-vector floating-point convert to unsigned integer,
        rounding toward zero.
 SCVTF: Multi-vector signed integer convert to floating-point.
 UCVTF: Multi-vector unsigned integer convert to floating-point.
for 2 and 4 registers

The reference can be found here:
    https://developer.arm.com/documentation/ddi0602/2022-09

    Depends on: D135563

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

20 months agoRevert "Reapply "GH58368: Correct concept checking in a lambda defined in concept"""
Erich Keane [Mon, 24 Oct 2022 19:15:05 +0000 (12:15 -0700)]
Revert "Reapply "GH58368: Correct concept checking in a lambda defined in concept"""

This reverts commit b876f6e2f28779211a829d7d4e841fe68885ae20.

Still getting build failures on PPC AIX that aren't obvious what is causing
them, so reverting while I try to figure this out.

20 months agoFix failing test case
Aaron Ballman [Mon, 24 Oct 2022 19:18:38 +0000 (15:18 -0400)]
Fix failing test case

This amends f43ef6b2dced4c5fa4fa7676142d9a20f7dbe733 with some warnings
that got dropped before I commit the test.

20 months ago[mlir][NVGPU] Documentation only update to nvgpu dialect (NFC).
Manish Gupta [Wed, 19 Oct 2022 04:33:09 +0000 (21:33 -0700)]
[mlir][NVGPU] Documentation only update to nvgpu dialect (NFC).

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

20 months ago[lldb] Skip TestFullLtoStepping in older clangs
Augusto Noronha [Mon, 24 Oct 2022 19:11:56 +0000 (12:11 -0700)]
[lldb] Skip TestFullLtoStepping in older clangs

20 months agoUpdate the status of more C99 DRs
Aaron Ballman [Mon, 24 Oct 2022 19:09:36 +0000 (15:09 -0400)]
Update the status of more C99 DRs

This adds test coverage and updates the related entries for five more
C99 DRs.

20 months agoCorrect a typo in the release notes; NFC
Aaron Ballman [Mon, 24 Oct 2022 19:01:46 +0000 (15:01 -0400)]
Correct a typo in the release notes; NFC

I intended to fix this when landing the changes, but forgot to add the
file to the commit.

20 months ago[PGO] Make emitted symbols hidden
Alex Brachet [Mon, 24 Oct 2022 19:05:10 +0000 (19:05 +0000)]
[PGO] Make emitted symbols hidden

This was reverted because it was breaking when targeting Darwin which
tried to export these symbols which are now hidden. It should be safe
to just stop attempting to export these symbols in the clang driver,
though Apple folks will need to change their TAPI allow list described
in the commit where these symbols were originally exported
https://github.com/llvm/llvm-project/commit/f5380185623be243ba0f1b18d4bd594ac5cc7163

Bug: https://github.com/llvm/llvm-project/issues/58265

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

20 months ago[mlir][sparse] add some APIs for merger to query the tensor id for output tensor...
Peiming Liu [Mon, 24 Oct 2022 18:41:19 +0000 (18:41 +0000)]
[mlir][sparse] add some APIs for merger to query the tensor id for output tensor and synthetic tensor.

Reviewed By: aartbik

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

20 months agoReapply "GH58368: Correct concept checking in a lambda defined in concept""
Erich Keane [Mon, 24 Oct 2022 18:16:28 +0000 (11:16 -0700)]
Reapply "GH58368: Correct concept checking in a lambda defined in concept""

This reverts commit 52930162870fee52d0d9c07c5d66e5dce32b08e8.

Now with updating the ASTBitcodes to show that this AST is incompatible
from the last.

20 months ago[flang] Carry dynamic type in fir.rebox code generation
Valentin Clement [Mon, 24 Oct 2022 18:42:31 +0000 (20:42 +0200)]
[flang] Carry dynamic type in fir.rebox code generation

Load the pointer of the dynamic type descriptor from the
original box and update the destination descriptor with this pointer.

Reviewed By: PeteSteinfeld

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

20 months ago[ARM] Support -mexecute-only with -mlong-calls.
Zhiyao Ma [Mon, 24 Oct 2022 18:01:10 +0000 (11:01 -0700)]
[ARM] Support -mexecute-only with -mlong-calls.

Instead of using constant pools, use movw movt pair.

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

20 months ago[mlir][Translation] Make commandline option registration optional
rkayaith [Sun, 23 Oct 2022 19:35:18 +0000 (15:35 -0400)]
[mlir][Translation] Make commandline option registration optional

This moves the commandline option registration into its own function, so
that users can register translations without registering the options.

Reviewed By: cota

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

20 months ago[ARM] Add a test demonstrating reductions with reused extend. NFC
David Green [Mon, 24 Oct 2022 18:38:19 +0000 (19:38 +0100)]
[ARM] Add a test demonstrating reductions with reused extend. NFC

D136227 showed that tests for this case in getReductionPatternCost were
missing.

20 months ago[libc] add performance options for string to float
Michael Jones [Fri, 21 Oct 2022 20:57:01 +0000 (13:57 -0700)]
[libc] add performance options for string to float

This allows the client to set compile flags to disable the passes that
the string to float function uses. A client may be willing to trade off
performance for a reduction in code size, and this allows for that
fine-tuning.

Reviewed By: sivachandra

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

20 months ago[mlir] Fix INSTALL_INTERFACE path for MLIRSparseTensorEnums
Michał Górny [Mon, 24 Oct 2022 11:08:00 +0000 (13:08 +0200)]
[mlir] Fix INSTALL_INTERFACE path for MLIRSparseTensorEnums

Fix INSTALL_INTERFACE path for exported MLIRSparseTensorEnums target
to include the include directory.  Otherwise, CMake attempts to find it
relatively to CMAKE_INSTALL_PREFIX rather than the include directory,
resulting in flang failing to configure with the following error:

    CMake Error at /usr/lib/llvm/16/lib64/cmake/llvm/AddLLVM.cmake:581 (add_library):
      Cannot find source file:

        /usr/lib/llvm/16/mlir/Dialect/SparseTensor/IR/Enums.h

      Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
      .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
    Call Stack (most recent call first):
      cmake/modules/AddFlang.cmake:64 (llvm_add_library)
      lib/Lower/CMakeLists.txt:3 (add_flang_library)

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

20 months ago[llvm-debuginfo-analyzer] (07/09) - Compare elements
Carlos Alberto Enciso [Mon, 24 Oct 2022 11:28:52 +0000 (12:28 +0100)]
[llvm-debuginfo-analyzer] (07/09) - Compare elements

The test case 'CompareElements' caused a failure in:

  https://lab.llvm.org/buildbot#builders/5/builds/28502
  https://lab.llvm.org/buildbot#builders/168/builds/9671
  SUMMARY: AddressSanitizer: 2144 byte(s) leaked in 14 allocation(s).

The 'Insert' function conditionally adds the 'Child' logical
element to a logical scope. The not added logical elements,
caused the memory leak. Just record them to be destroyed
when the logical reader is destroyed.

Changed 'EXPECT_NE' with 'ASSERT_NE'.
Missing in the main review.

20 months ago[lldb] Fix stale diagnostic event comments (NFC)
Jonas Devlieghere [Mon, 24 Oct 2022 18:13:51 +0000 (11:13 -0700)]
[lldb] Fix stale diagnostic event comments (NFC)

The diagnostic events were heavily inspired by the progress events and
several comments incorrectly referenced "progress" rather than
"diagnostic" events.

20 months ago[mlir][Tensor] Add a helper build method for pad operations with constant padding.
Mahesh Ravishankar [Mon, 24 Oct 2022 17:31:06 +0000 (17:31 +0000)]
[mlir][Tensor] Add a helper build method for pad operations with constant padding.

Drop the `createPadScalarOp` from Utils.h since it is a duplicate of
the `build` method added here.

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

20 months ago[ELF] Add --no-warnings/-w
Fangrui Song [Mon, 24 Oct 2022 17:54:09 +0000 (10:54 -0700)]
[ELF] Add --no-warnings/-w

Mach-O ld64 supports -w to suppress warnings. GNU ld 2.40 will support the
option as well (https://sourceware.org/bugzilla/show_bug.cgi?id=29654).

This feature has some small value. E.g. when analyzing a large executable with
relocation overflow issues, we may use --noinhibit-exec --emit-relocs to get an
output file with static relocations despite relocation overflow issues. -w can
significantly improve the link time as printing the massive warnings is slow.

Reviewed By: peter.smith

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

20 months ago[X86] New test case for reassociation of ADD instructions.
Guozhi Wei [Mon, 24 Oct 2022 17:46:46 +0000 (17:46 +0000)]
[X86] New test case for reassociation of ADD instructions.

This is a pre-commit test case for D136396.

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

20 months ago[XCOFF] llvm-readobj support decoding the loader section header field for XCOFF objec...
zhijian [Mon, 24 Oct 2022 17:31:01 +0000 (13:31 -0400)]
[XCOFF] llvm-readobj support decoding the loader section header field for XCOFF object file.

Reviewers: James Henderson, Esme Yi

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

20 months ago[X86] `DAGTypeLegalizer::ModifyToType()`: when widening w/ zeros, insert into undef...
Roman Lebedev [Mon, 24 Oct 2022 17:11:19 +0000 (20:11 +0300)]
[X86] `DAGTypeLegalizer::ModifyToType()`: when widening w/ zeros, insert into undef and `and`-mask the padding away

We can expect that the sequence of inserting-of-extracts-into-undef
will be successfully lowered back into widening of the source vector,
but it seems that at least for X86 mask vectors, we have a really hard time
recovering from inserting-into-zero.

I've looked into alternative fix injection points, and they are much more
involved, by the time of `LowerBUILD_VECTORvXi1()`/`LowerINSERT_VECTOR_ELT()`
the constants might be obscured, so it does not seem like we can easily
deal with this by lowering into bit math later on,
some other pieces are missing.

Instead, it seems like just clearing the padding away via an `AND`-mask
is at least not a worse choice. Why create a problem where there wasn't one.
Though yes, it is possible that there are cases where constants originate
from the source IR, so some other fix may still be needed.

Reviewed By: pengfei

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