platform/upstream/llvm.git
22 months ago[NFC] Specify template type to fix -Wctad-qmaybe-unsupported
Jordan Rupprecht [Tue, 13 Dec 2022 18:50:20 +0000 (10:50 -0800)]
[NFC] Specify template type to fix -Wctad-qmaybe-unsupported

22 months agoWorkaround an assertion failure during module build
Steven Wu [Tue, 13 Dec 2022 18:42:04 +0000 (10:42 -0800)]
Workaround an assertion failure during module build

After the change in https://reviews.llvm.org/D131858, clang cannot
bootstrap itself with modules due to assertion failure:
(lvaluePath->getType() == elemTy && "Unexpected type reference!")

Workaround the assertion by converting some of the includes into forward
declares.

Reviewed By: arphaman

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

22 months agoRevert "[mlir][sparse] Make some integration tests run with vectorization."
Jakub Kuderski [Tue, 13 Dec 2022 18:40:18 +0000 (13:40 -0500)]
Revert "[mlir][sparse] Make some integration tests run with vectorization."

This reverts commit 2d7e3ec6b5e3d99de6ce79049d4bef96213109ee.

This broke buildbots [1] and I can also reproduce this locally.

[1] https://lab.llvm.org/buildbot#builders/61/builds/36953

22 months ago[NFC][MC] `MCInst`: `Operands` small size optimization: store 10, not 8, inline ...
Roman Lebedev [Tue, 13 Dec 2022 18:19:24 +0000 (21:19 +0300)]
[NFC][MC] `MCInst`: `Operands` small size optimization: store 10, not 8, inline `MCOperand`

This improves the torture test of
```
./bin/llvm-exegesis -mcpu=znver3 -mode=inverse_throughput --opcode-index=-1 --benchmarks-file=/dev/null --dump-object-to-disk=0 --measurements-print-progress --skip-measurements
```
from ~2m16s to ~2min07s, and has the following effect on memory:

```
heaptrack stats:
        allocations:            100828624 -> 77362343 (-23.2%)
        leaked allocations:     1128
        temporary allocations:  24911300  ->  1576308 (-93.7%) !!!

peak heap memory consumption:
        78.2MB after 02.121s    ->   76.4MB after 01.985s (-2.3%)
peak RSS (including heaptrack overhead):
        193.4MB                 ->   192.6MB              (-0.4%)
```

The reasoning is that having more Operands than the SSO is costly,
because we go to global allocator, but having larger SSO is fine,
even if it's not always needed, because MCInst is hopefully pool-allocated.

I'm not sure who is the code owner of this component.

Reviewed By: craig.topper

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

22 months ago[NFC][Costmodel][X86] Replication shuffle: AVX512F can promote i1 to i32.
Roman Lebedev [Tue, 13 Dec 2022 17:09:21 +0000 (20:09 +0300)]
[NFC][Costmodel][X86] Replication shuffle: AVX512F can promote i1 to i32.

As the added codegen test coverage shows,
there isn't that much difference between AVX512DQI and
baseline AVX512F codegen, DQI added `vpmovm2d`/`vpmovd2m`,
but with just the Foundation we can use `vpternlogd`/`vptestmd`
to do the same.

22 months ago[x86][Costmodel] AVX512VL: add missing costs for v8 i1<->i32 casts
Roman Lebedev [Tue, 13 Dec 2022 17:57:56 +0000 (20:57 +0300)]
[x86][Costmodel] AVX512VL: add missing costs for v8 i1<->i32 casts

This would come up as a regression in the follow-up Replication-of-i1 patch.

https://godbolt.org/z/fxr9Mzssr

22 months ago[NFC][X86][Codegen] Add codegen test coverage for i1 mask replication (AVX512 only)
Roman Lebedev [Tue, 13 Dec 2022 16:36:36 +0000 (19:36 +0300)]
[NFC][X86][Codegen] Add codegen test coverage for i1 mask replication (AVX512 only)

Apparently i didn't add it when adding cost model coverage?

22 months ago[LoopFusion] sink second loop PHIs
Joshua Cao [Tue, 13 Dec 2022 17:37:18 +0000 (09:37 -0800)]
[LoopFusion] sink second loop PHIs

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

PHI nodes that are in the second loop only have the first loop as its
predecessor. These PHI nodes should be sunk to the end of the fused
loop. If the second loop uses the PHI, then the loops cannot be fused.

I don't think this should happen in typical compilation workflows.
The PHI will be in a dedicated exit block of the first loop following
LCSSA transformations.

Reviewed By: aeubanks

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

22 months ago[mlir][arith] Clean up arith canonicalization td rules
Jakub Kuderski [Tue, 13 Dec 2022 18:04:37 +0000 (13:04 -0500)]
[mlir][arith] Clean up arith canonicalization td rules

- Use `ConstantLikeMatcher` instead of matching `Arith_ConstantOp`
- Reflow some defs to fit the line limit

Suggested by @jpienaar and @Mogball in https://reviews.llvm.org/D139778.

Reviewed By: Mogball

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

22 months ago[mlir][sparse] Make some integration tests run with vectorization.
bixia1 [Mon, 12 Dec 2022 23:15:46 +0000 (15:15 -0800)]
[mlir][sparse] Make some integration tests run with vectorization.

Reviewed By: Peiming

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

22 months ago[SLP][NFC]Initial redesign of ShuffleInstructionBuilder, NFC.
Alexey Bataev [Thu, 8 Dec 2022 18:04:46 +0000 (10:04 -0800)]
[SLP][NFC]Initial redesign of ShuffleInstructionBuilder, NFC.

The patch redesigns ShuffleInstructionBuilder so it could later be used
for reshuffling of the buildvector sequences and vectorized parts of
  externally used scalars. Also will allow to generalize cost model for
  the gathers/buildvectors.

Part of D110978.

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

22 months ago[mlir] Implement backward dataflow.
Matthias Kramm [Tue, 13 Dec 2022 17:34:58 +0000 (18:34 +0100)]
[mlir] Implement backward dataflow.

This enables interprocedural lifeness analysis, very busy expression
analysis, etc.

Reviewed By: Mogball

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

22 months ago[opt] Do not add verify pass at beginning of pipeline
Arthur Eubanks [Tue, 13 Dec 2022 01:16:11 +0000 (17:16 -0800)]
[opt] Do not add verify pass at beginning of pipeline

We've already verified the input module manually in opt so this is redundant.

Reviewed By: bjope

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

22 months ago[StandardInstrumentations] Handle initial IR before checking if IR is interesting
Arthur Eubanks [Tue, 13 Dec 2022 01:16:11 +0000 (17:16 -0800)]
[StandardInstrumentations] Handle initial IR before checking if IR is interesting

Otherwise we end up in situations where we print thre initial IR after we've already printed some changed IR.

Reviewed By: jamieschmeiser

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

22 months ago[RISCV] Use reduction result type for EXTRACT_VECTOR_ELT in lowerReductionSeq.
Craig Topper [Tue, 13 Dec 2022 17:09:42 +0000 (09:09 -0800)]
[RISCV] Use reduction result type for EXTRACT_VECTOR_ELT in lowerReductionSeq.

Remove the call to getSExtOrTrunc.

Reduction ISD nodes produce a scalar result and that result is
allowed to be larger than the vector element type due to type
legalization. This is the same rule we allow for EXTRACT_VECTOR_ELT
for the same reason.

We can copy the result type over from the reduction node to
EXTRACT_VECTOR_ELT.

Reviewed By: reames

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

22 months ago[RISCV] Add support for call returns to RISCVSExtWRemoval.
Craig Topper [Tue, 13 Dec 2022 17:00:45 +0000 (09:00 -0800)]
[RISCV] Add support for call returns to RISCVSExtWRemoval.

The implementation is inspired by code from PPCInstrInfo.

We look for a copy from X10(A0) preceded by an ADJCALLSTACKUP and
a PseudoCall. We use the PseudoCall to look up the IR function being
called to find it's return attributes.

Reviewed By: asb

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

22 months ago[RISCV] Use lowerScalarInsert when folding op into reduction [nfc]
Philip Reames [Tue, 13 Dec 2022 17:02:01 +0000 (09:02 -0800)]
[RISCV] Use lowerScalarInsert when folding op into reduction [nfc]

This doesn't cause any functional change since this is being applied to a insert generated by the same routine.  This is mostly about consolidating the logic for vmv.s.x into one place to simplify future changes.

22 months ago[RISCV] Use lowerScalarInsert in lowerReductionSeq [nfc]
Philip Reames [Tue, 13 Dec 2022 16:47:49 +0000 (08:47 -0800)]
[RISCV] Use lowerScalarInsert in lowerReductionSeq [nfc]

Use the newly introduced helper routine.  At the moment, this generates the same code (at this call site!) since LMUL is restricted to LMUL1 or less, and VL is hard coded to 1.  In a future patch, I will loosen the second part.

22 months ago[HWASAN] Implemented LsanMetadata in HWASAN.
Kirill Stoimenov [Tue, 6 Dec 2022 22:26:41 +0000 (22:26 +0000)]
[HWASAN] Implemented LsanMetadata in HWASAN.

Please note that that this code is not used. It will be connected at some point when the rest of the code is ready.

Reviewed By: vitalybuka

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

22 months ago[llvm-driver] Just use argv[0]'s filename for finding tool
Alex Brachet [Tue, 13 Dec 2022 17:01:07 +0000 (17:01 +0000)]
[llvm-driver] Just use argv[0]'s filename for finding tool

Usually we want the stem of argv[0] so something like clang-15
will correctly be identified as clang. For lld however, ld.lld
or ld-link would have a stem of just ld, so we also want to
use the full filename. The bug previously was that we were using
all of argv[0] so if you use a full path that happens to include a tool
name then that could be found first. This was the case in 2 stage
build where the binaries are stored in "tools/clang/stage2-bins/"
so some tools would end up as clang and not their intended tool.

22 months ago[AAPointerInfo] track multiple constant offsets for each use
Sameer Sahasrabuddhe [Mon, 12 Dec 2022 08:06:45 +0000 (13:36 +0530)]
[AAPointerInfo] track multiple constant offsets for each use

An expression of the form `gep(base, select(pred, const1, const2))` can result
in a set of offsets instead of just one. PointerInfo can now track these sets
instead of conservatively modeling them as Unknown. In general, AAPointerInfo
now uses AAPotentialConstantValues to examine the operands of the GEP.

Reviewed By: jdoerfert

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

22 months ago[CMake] Add missing tablegen deps
Alex Brachet [Tue, 13 Dec 2022 16:56:08 +0000 (16:56 +0000)]
[CMake] Add missing tablegen deps

22 months ago[gn build] Port 233ca84a25a7
LLVM GN Syncbot [Tue, 13 Dec 2022 16:27:58 +0000 (16:27 +0000)]
[gn build] Port 233ca84a25a7

22 months agoInstCombine: Add baseline tests for and/or of fcmp to class combine
Matt Arsenault [Wed, 30 Nov 2022 04:27:26 +0000 (23:27 -0500)]
InstCombine: Add baseline tests for and/or of fcmp to class combine

This is for patterns like !isfinite || zero.

22 months agoRevert "[mlir][arith] Add canonicalization patterns for 'mul*i_extended'"
Jakub Kuderski [Tue, 13 Dec 2022 16:05:47 +0000 (11:05 -0500)]
Revert "[mlir][arith] Add canonicalization patterns for 'mul*i_extended'"

This reverts commit 834c17f618ce87b14446e42250d924b8d5f01abe.

Revert to properly address post-commit comments by @jpienaar
under https://reviews.llvm.org/D139778.

22 months ago[NVPTX] Backend support for variadic functions
Pavel Kopyl [Tue, 13 Dec 2022 15:31:17 +0000 (18:31 +0300)]
[NVPTX] Backend support for variadic functions

This patch adds lowering for function calls with variadic number of
arguments as well as enables support for the following
instructions/intrinsics:

  - va_arg
  - va_start
  - va_end
  - va_copy

Note that this patch doesn't intent to include clang's support for
variadic functions for CUDA.

According to the docs:

  PTX version 6.0 supports passing unsized array parameter to a
  function which can be used to implement variadic functions. [0]

  The last parameter in the parameter list may be a .param array of
  type .b8 with no size specified. It is used to pass an arbitrary
  number of parameters to the function packed into a single array
  object.

  When calling a function with such an unsized last argument, the last
  argument may be omitted from the call instruction if no parameter is
  passed through it.  Accesses to this array parameter must be within
  the bounds of the array.  The result of an access is undefined if no
  array was passed, or if the access was outside the bounds of the
  actual array being passed. [1]

Note that aggregates passed by value as variadic arguments are not
currently supported.

[0] https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#variadic-functions
[1] https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#kernel-and-function-directives-func

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

22 months ago[libc][bazel] Add missing dependency in string_memory_utils
Guillaume Chatelet [Tue, 13 Dec 2022 16:05:35 +0000 (16:05 +0000)]
[libc][bazel] Add missing dependency in string_memory_utils

22 months ago[ThinLTO] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 15:56:59 +0000 (16:56 +0100)]
[ThinLTO] Convert tests to opaque pointers (NFC)

22 months ago[RISCV] Use vmv.v.i for insertion into lane 0 of undef vector when profitable
Philip Reames [Tue, 13 Dec 2022 15:54:46 +0000 (07:54 -0800)]
[RISCV] Use vmv.v.i for insertion into lane 0 of undef vector when profitable

If we're initializing lane 0 of an undef vector, we can optionally write to other lanes of the vector. Doing so may require additional work, so we don't want to e.g. always use a splat. However, since we don't have an immediate form of vmv.s.x it's useful to use a vmv.v.i if the work required is expected to be equal in practice.  We restrict this to when LMUL <= 1 to a) prevent doing additional work at higher LMULs, and b) avoid overconstraining the register allocator.

At the moment, the new utility is only used by one case in INSERT_VECTOR_ELT lowering. My expectation is that we will reuse this in a couple other places, but each of those deserve individual review.

This change is inspired by D137530, but is not directly related to it. I vaguely remember we discussed the tradeoffs of using vmv.v.i in another recent review, but couldn't find it.

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

22 months ago[RISCV][InsertVSETVLI] Reverse traversal order of block in post pass [nfc]
Philip Reames [Tue, 13 Dec 2022 15:47:53 +0000 (07:47 -0800)]
[RISCV][InsertVSETVLI] Reverse traversal order of block in post pass [nfc]

his unblocks a following change to be more sophisticated during post pass rewriting.

Review wise, I basically just want a second set of eyes. This change should be straight forward, but since it took me an embarrassing number of attempts to get make check to pass. Let's make sure I'm not missing yet another cornercase.

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

22 months agoInstCombine: Fold logic of fp_classes together
Matt Arsenault [Thu, 17 Nov 2022 06:12:22 +0000 (22:12 -0800)]
InstCombine: Fold logic of fp_classes together

Move logical operators on pairs of llvm.is.fpclass on the same value
into the test mask of a single is_fpclass.

or (class x, mask0), (class x, mask1) -> class x, (mask0 | mask1)
and (class x, mask0), (class x, mask1) -> class x, (mask0 & mask1)
xor (class x, mask0), (class x, mask1) -> class x, (mask0 ^ mask1)

The and/or cases should appear frequently in the builtin math
libraries; haven't seen the xor case but handle it for completeness.

22 months agoInstCombine: Perform simpler test of APFloat first
Matt Arsenault [Thu, 1 Dec 2022 15:30:36 +0000 (10:30 -0500)]
InstCombine: Perform simpler test of APFloat first

22 months ago[mlir][arith] Add canonicalization patterns for 'mul*i_extended'
Jakub Kuderski [Tue, 13 Dec 2022 15:49:14 +0000 (10:49 -0500)]
[mlir][arith] Add canonicalization patterns for 'mul*i_extended'

- Add a fold for `mulsi_extended(x, 1)`
- Add folds to demote wide integer multiplication to `mul*i_extended` when the result is shifted
   and truncated: `trunci(shrui(mul(*ext(x), *ext(y)), c)) -> mul*i_extended(x, y)`

Reviewed By: Mogball

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

22 months ago[llvm-stress] Support scalable vectors and out of bounds indices to vector ops
Philip Reames [Tue, 13 Dec 2022 15:31:05 +0000 (07:31 -0800)]
[llvm-stress] Support scalable vectors and out of bounds indices to vector ops

This change does two things.

First, it supports scalable vectors in llvm-stress output.  There's an off-by-default flag -enable-scalable-vectors which generates a scalable vector with 50% probability when a random vector type is selected.  Because of the existing implementation, this tends to skew an entire test towards either scalable or fixed since we most select initial values, not random types.

Second, it selects a random value for the index of an insertelement or extractelement.  As a result, out of bounds indices can not appear for fixed lengh vectors.  Previously, it chose a random constant which was, by construction, in range.

22 months ago[AMDGPU] Add `.workgroup_processor_mode` to v5 MD
Pierre van Houtryve [Tue, 13 Dec 2022 15:20:42 +0000 (10:20 -0500)]
[AMDGPU] Add `.workgroup_processor_mode` to v5 MD

Adds Workgroup Processor Mode (WGP) to the HSA Metadata for Code Object v5/GFX10+.
The field is already present as an asm directive and in the compute program resource register but is also needed in the MD.

Reviewed By: kzhuravl

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

22 months ago[Linker] Convert some tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 15:22:27 +0000 (16:22 +0100)]
[Linker] Convert some tests to opaque pointers (NFC)

22 months ago[AMDGPU] Add bf16 storage support
Pierre van Houtryve [Tue, 13 Dec 2022 14:59:20 +0000 (09:59 -0500)]
[AMDGPU] Add bf16 storage support

- [Clang] Declare AMDGPU target as supporting BF16 for storage-only purposes on amdgcn
  - Add Sema & CodeGen tests cases.
  - Also add cases that D138651 would have covered as this patch replaces it.
- [AMDGPU] Add BF16 storage-only support
  - Support legalization/dealing with bf16 operations in DAGIsel.
  - bf16 as a type remains illegal and is represented as i16 for storage purposes.

Reviewed By: arsenm

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

22 months agoRevert "[RISC-V][HWASAN] Add support for HWASAN code instrumentation for RISC-V"
Krasimir Georgiev [Tue, 13 Dec 2022 15:30:54 +0000 (16:30 +0100)]
Revert "[RISC-V][HWASAN] Add support for HWASAN code instrumentation for RISC-V"

This reverts commit 0eb694bec09df488bb6ab33d0207b6b061718d98.
Temporarily revert as it causes a new warning:
https://reviews.llvm.org/D131575#inline-1351186

22 months agoRevert "Update tests by update_test_checks.py"
Nico Weber [Tue, 13 Dec 2022 15:27:00 +0000 (10:27 -0500)]
Revert "Update tests by update_test_checks.py"

This reverts commit 3a8f4649a0a4b7b9cab93d73c0651a14b0fd1c34.
Broke check-llvm everywhere, see e.g.:
* https://lab.llvm.org/buildbot/#/builders/139/builds/32724
* http://45.33.8.238/linux/94174/step_12.txt
* http://45.33.8.238/macm1/50831/step_11.txt
* http://45.33.8.238/win/71928/step_11.txt

22 months ago[clang][PPC] Checking Unknown Values Passed to -mcpu
Qiongsi Wu [Tue, 13 Dec 2022 14:40:07 +0000 (09:40 -0500)]
[clang][PPC] Checking Unknown Values Passed to -mcpu

Currently `ppc::getPPCTargetCPU` returns an empty string when it encounters an unknown value passed to `-mcpu`. This causes `clang` to ignore unknown `-mcpu` values silently.

This patch changes the behaviour of `ppc::getPPCTargetCPU` so that it passes the unknown option to the target info, so the target info can actually check if the CPU string is supported, and report an error when encountering unknown/unsupported CPU string.

Reviewed By: jamieschmeiser

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

22 months ago[CanonicalizeAliases] Convert test to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 15:15:00 +0000 (16:15 +0100)]
[CanonicalizeAliases] Convert test to opaque pointers (NFC)

Looks like this transform only has a single test :)

22 months ago[FunctionImport] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 15:14:14 +0000 (16:14 +0100)]
[FunctionImport] Convert tests to opaque pointers (NFC)

22 months ago[ThinLTOBitcodeWriter] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 15:10:51 +0000 (16:10 +0100)]
[ThinLTOBitcodeWriter] Convert tests to opaque pointers (NFC)

22 months ago[HIP] support --offload-arch=native
Yaxun (Sam) Liu [Mon, 12 Dec 2022 20:50:44 +0000 (15:50 -0500)]
[HIP] support --offload-arch=native

This patch detects system GPU and use them
in --offload-arch if 'native' is specified. If system GPU
cannot be detected clang will fall back to the default GPU arch.

Reviewed by: Artem Belevich

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

22 months ago[DebugInfo] Convert most tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 15:06:46 +0000 (16:06 +0100)]
[DebugInfo] Convert most tests to opaque pointers (NFC)

22 months ago[BugPoint] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 15:05:27 +0000 (16:05 +0100)]
[BugPoint] Convert tests to opaque pointers (NFC)

22 months agoRevert "Delete sanitizer_common-based ('old') scudo: o7"
Krasimir Georgiev [Tue, 13 Dec 2022 15:03:11 +0000 (16:03 +0100)]
Revert "Delete sanitizer_common-based ('old') scudo: o7"

This reverts commit 512a98e7184e5d48cefbe39da049af3b08ad3919.
We'll need some time to migrate some internal usages off this.
Will sync up with @hctim and @vitalybuka directly.

22 months ago[RISC-V][HWASAN] Add support for HWASAN code instrumentation for RISC-V
Alexey Baturo [Wed, 10 Aug 2022 05:41:26 +0000 (08:41 +0300)]
[RISC-V][HWASAN] Add support for HWASAN code instrumentation for RISC-V

Reviewed by: vitalybuka

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

22 months agoInstCombine: Add baseline test for and/or/xor of is.fpclass
Matt Arsenault [Sat, 10 Dec 2022 17:24:53 +0000 (12:24 -0500)]
InstCombine: Add baseline test for and/or/xor of is.fpclass

22 months agoInstCombine: Add baseline tests for negated fpclass tests
Matt Arsenault [Thu, 17 Nov 2022 05:01:09 +0000 (21:01 -0800)]
InstCombine: Add baseline tests for negated fpclass tests

As suggested in https://reviews.llvm.org/D137811

22 months agoInstCombine: Add tests for is_fpclass with ninf sources
Matt Arsenault [Thu, 17 Nov 2022 04:46:08 +0000 (20:46 -0800)]
InstCombine: Add tests for is_fpclass with ninf sources

22 months agoInstCombine: Add a few tests for daz behavior with is_fpclass
Matt Arsenault [Wed, 30 Nov 2022 15:49:49 +0000 (10:49 -0500)]
InstCombine: Add a few tests for daz behavior with is_fpclass

22 months agoUpdate tests by update_test_checks.py
luxufan [Tue, 13 Dec 2022 14:53:22 +0000 (22:53 +0800)]
Update tests by update_test_checks.py

22 months ago[Tests] Convert Feature tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 14:45:54 +0000 (15:45 +0100)]
[Tests] Convert Feature tests to opaque pointers (NFC)

22 months ago[NFC] Fix duplicated `Src`
Phoebe Wang [Tue, 13 Dec 2022 14:43:50 +0000 (22:43 +0800)]
[NFC] Fix duplicated `Src`

22 months ago[GlobalOpt] Convert remaining tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 14:41:17 +0000 (15:41 +0100)]
[GlobalOpt] Convert remaining tests to opaque pointers (NFC)

22 months ago[GlobalOpt] Regenerate test checks (NFC)
Nikita Popov [Tue, 13 Dec 2022 14:35:26 +0000 (15:35 +0100)]
[GlobalOpt] Regenerate test checks (NFC)

22 months ago[GlobalOpts] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 14:23:47 +0000 (15:23 +0100)]
[GlobalOpts] Convert tests to opaque pointers (NFC)

22 months ago[NFC] Add checks for potential null returns
Phoebe Wang [Tue, 13 Dec 2022 14:28:47 +0000 (22:28 +0800)]
[NFC] Add checks for potential null returns

22 months ago[gn build] Port 7a85192166b5
Nico Weber [Tue, 13 Dec 2022 14:25:17 +0000 (09:25 -0500)]
[gn build] Port 7a85192166b5

22 months ago[IndVarSimplify] Convert last test to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 14:20:13 +0000 (15:20 +0100)]
[IndVarSimplify] Convert last test to opaque pointers (NFC)

After addressing the SCEVExpander issue that caused me pause.

Also delete a redundant test that is no longer needed.

22 months ago[SCEVExpander] Produce canonical constant GEP
Nikita Popov [Tue, 13 Dec 2022 14:05:54 +0000 (15:05 +0100)]
[SCEVExpander] Produce canonical constant GEP

Go through IRBuilder to enable DL-based folding, so that we produce
a canonical constant GEP. Noticed while converting tests to opaque
pointers.

22 months agoAPFloat: Add isPosInfinity and isNegInfinity helpers
Matt Arsenault [Sun, 11 Dec 2022 13:37:26 +0000 (08:37 -0500)]
APFloat: Add isPosInfinity and isNegInfinity helpers

22 months ago[X86] lowerShuffleAsVTRUNC - support offseted truncations
Simon Pilgrim [Tue, 13 Dec 2022 13:42:16 +0000 (13:42 +0000)]
[X86] lowerShuffleAsVTRUNC - support offseted truncations

Extend the <0,Scale,2*Scale,..> pattern to allow for a fixed offset <Offset,Offset+Scale,Offset+2*Scale,..> pattern, which will lower to a single additional bitshift/pshufd.

At the moment I've limited this to cases where the LHS/RHS operands are concatenated for free, but this is only to avoid a couple of regressions that should be easily addressable in followups.

22 months ago[flang] Handle type generation for unlimited polymorphic function result
Valentin Clement [Tue, 13 Dec 2022 13:59:39 +0000 (14:59 +0100)]
[flang] Handle type generation for unlimited polymorphic function result

An unlimited polymorphic entity is considered to have a derived category
in its dynamic type but no type descriptor. Avoid a nullptr dereference when
an unlimited polymorphic type needs to be generated.

Reviewed By: PeteSteinfeld

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

22 months ago[IndVarSimplify] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 13:44:27 +0000 (14:44 +0100)]
[IndVarSimplify] Convert tests to opaque pointers (NFC)

This leaves lftr.ll alone, because there is a suspicious test diff.

22 months ago[clang][dataflow] Change the diagnoser API to receive a correctly typed lattice element
Dani Ferreira Franco Moura [Tue, 13 Dec 2022 13:31:57 +0000 (14:31 +0100)]
[clang][dataflow] Change the diagnoser API to receive a correctly typed lattice element

Previously, the diagnoser could only receive the Environment at a given program point. Now, it receives the complete dataflow state: the environment and lattice element.

This change does not contain any tests because we modify the checkDataflow function to rely on the newly introduced lattice element in PostVisitCFG, and existing tests that verify lattice elements depend on this overload of checkDataflow.

Reviewed By: gribozavr2, ymandel

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

22 months agoConstantFolding: Ignore output denorm mode for canonicalize
Matt Arsenault [Tue, 13 Dec 2022 13:12:36 +0000 (08:12 -0500)]
ConstantFolding: Ignore output denorm mode for canonicalize

Alive2 opt plugin is now happy with the test. Fixes issue 59245

22 months agoConstantFolding: Fix handling of canonicalize for ppc_fp128 0s
Matt Arsenault [Fri, 18 Nov 2022 22:49:15 +0000 (14:49 -0800)]
ConstantFolding: Fix handling of canonicalize for ppc_fp128 0s

22 months ago[Assembler] Convert tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 13:12:34 +0000 (14:12 +0100)]
[Assembler] Convert tests to opaque pointers (NFC)

Some tests are removed because the error conditions can no longer
occur with opaque pointers.

22 months ago[NFC][CMake] Explicitly link to MC when needed
Roman Lebedev [Tue, 13 Dec 2022 13:13:34 +0000 (16:13 +0300)]
[NFC][CMake] Explicitly link to MC when needed

These targets use `MCInst`, but don't explicitly link
to the library providing it (MC), and just rely on it
being pulled transitively through e.g. MCDisassembler,
but that only pulls includes, and does not link to it.

Case in point, when i add explicit destructor to `MCInst`,
defined in `.cpp`, these targets were failing to link.

22 months agoInstCombine: Fold negations of is_fpclass intrinsics
Matt Arsenault [Thu, 17 Nov 2022 05:26:29 +0000 (21:26 -0800)]
InstCombine: Fold negations of is_fpclass intrinsics

Can invert the result by inverting the test mask.

22 months agoInstCombine: Regenerate checks
Matt Arsenault [Tue, 13 Dec 2022 13:01:48 +0000 (08:01 -0500)]
InstCombine: Regenerate checks

update_test_checks has changed what it emits for function labels,
so keep this noise out of a real output change.

22 months agoRemove sentinel argument from dispatchIndexOpFoldResults.
Aliia Khasanova [Tue, 13 Dec 2022 12:35:24 +0000 (13:35 +0100)]
Remove sentinel argument from dispatchIndexOpFoldResults.
Post clean-up after merger of kDynamicSize and kDynamicStrideOrOffset.

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

22 months ago[libc] Add compiler, builtin and feature detection
Guillaume Chatelet [Fri, 9 Dec 2022 14:30:40 +0000 (14:30 +0000)]
[libc] Add compiler, builtin and feature detection

This is a first step to support GCC. This patch adds support for builtin and feature detection.

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

22 months agoReapply [Assignment Tracking][13/*] Account for assignment tracking in SROA
OCHyams [Mon, 12 Dec 2022 09:18:59 +0000 (09:18 +0000)]
Reapply [Assignment Tracking][13/*] Account for assignment tracking in SROA

The Assignment Tracking debug-info feature is outlined in this RFC:

https://discourse.llvm.org/t/
rfc-assignment-tracking-a-better-way-of-specifying-variable-locations-in-ir

Split dbg.assign intrinsics into fragments similarly to what SROA already does
for dbg.declares, except that there's many more intrinsics to split. The
function migrateDebugInfo generates new dbg.assigns intrinsic for each part of
a split store.

Reviewed By: jmorse

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

22 months agore-land [RISC-V][HWASAN] Support tagging global variables for RISC-V HWASAN
Alexey Baturo [Tue, 13 Dec 2022 12:43:49 +0000 (15:43 +0300)]
re-land [RISC-V][HWASAN] Support tagging global variables for RISC-V HWASAN

Now with fix to limit added tagged-globals.ll to risc-v platform
--
[RISC-V][HWASAN] Support tagging global variables for RISC-V HWASAN

Reviewed by: luismarques

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

22 months ago[exegesis] Benchmark: provide optional progress meter / ETA
Roman Lebedev [Tue, 13 Dec 2022 12:22:00 +0000 (15:22 +0300)]
[exegesis] Benchmark: provide optional progress meter / ETA

Now that `--opcode-index=-1` is mostly stable,
and i can migrate off of my custom tooling that emulated it,
there comes a bit of confusion as to the status of the run.

It is normal for the single all-opcode run to take ~3 minutes,
and it's a bit more than one can be comfortable with,
without having some sort of visual indication of the progress.

Thus, i present:
```
$ ./bin/llvm-exegesis -mode=inverse_throughput --opcode-index=-1 --benchmarks-file=/dev/null --dump-object-to-disk=0 --measurements-print-progress --skip-measurements
<...>
XAM_Fp80: unsupported opcode: pseudo instruction
XBEGIN: Unsupported opcode: isPseudo/usesCustomInserter
XBEGIN_2: Unsupported opcode: isBranch/isIndirectBranch
XBEGIN_4: Unsupported opcode: isBranch/isIndirectBranch
XCH_F: unsupported second-form X87 instruction
Processing...   1%, ETA 02:10
Processing...   2%, ETA 02:03
Processing...   3%, ETA 02:00
Processing...   4%, ETA 01:57
Processing...   5%, ETA 01:54
Processing...   6%, ETA 01:53
Processing...   7%, ETA 01:51
Processing...   8%, ETA 01:50
Processing...   9%, ETA 01:49
Processing...  10%, ETA 01:48
Processing...  11%, ETA 01:46
Processing...  12%, ETA 01:45
Processing...  13%, ETA 01:44
Processing...  14%, ETA 01:43
Processing...  15%, ETA 01:42
Processing...  16%, ETA 01:42
Processing...  17%, ETA 01:41
```

As usual, the ETA estimation is statically-insignificant,
and is a lie/does not converge at least until 50% through.
It would be nice to have an actual progress indicator like in LIT,
but i'm not sure we have such a luxury in C++ form in LLVM codebase already.

Reviewed By: courbet

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

22 months ago[rereland][Alignment][NFC] Remove access to deprecated GlobalObject::getAlignment...
Guillaume Chatelet [Tue, 13 Dec 2022 10:31:00 +0000 (10:31 +0000)]
[rereland][Alignment][NFC] Remove access to deprecated GlobalObject::getAlignment from llvm

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

22 months agoRevert "[RISC-V][HWASAN] Support tagging global variables for RISC-V HWASAN"
Alexey Baturo [Tue, 13 Dec 2022 12:17:27 +0000 (15:17 +0300)]
Revert "[RISC-V][HWASAN] Support tagging global variables for RISC-V HWASAN"

This reverts commit 11937ca5642216a67e021e69fc824f709267bada.

22 months ago[OpenMP] Skip extra blank line when parsing /proc/cpuinfo on LoongArch64
gonglingqin [Tue, 13 Dec 2022 11:44:06 +0000 (19:44 +0800)]
[OpenMP] Skip extra blank line when parsing /proc/cpuinfo on LoongArch64

This fixes the following test cases:

* affinity/kmp-affinity.c
* affinity/kmp-hw-subset.c
* affinity/omp-places.c

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

22 months ago[Tests] Convert Other tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 12:06:09 +0000 (13:06 +0100)]
[Tests] Convert Other tests to opaque pointers (NFC)

22 months ago[Bitcode] Convert test to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 11:36:48 +0000 (12:36 +0100)]
[Bitcode] Convert test to opaque pointers (NFC)

22 months ago[RISC-V][HWASAN] Support tagging global variables for RISC-V HWASAN
Alexey Baturo [Tue, 30 Aug 2022 18:05:24 +0000 (21:05 +0300)]
[RISC-V][HWASAN] Support tagging global variables for RISC-V HWASAN

Reviewed by: luismarques

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

22 months ago[AMDGPU][GFX1030][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 11:48:36 +0000 (14:48 +0300)]
[AMDGPU][GFX1030][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable register tuples with 9, 10, 11 and 12 registers (https://reviews.llvm.org/D138205).
- Enable abs and neg modifiers for v_cndmask_b32_dpp (https://reviews.llvm.org/D135900).
- Enable literal operands for permlane16/permlanex16 (https://reviews.llvm.org/D137332).
- Enable omod modifiers for v_max3_f16, v_min3_f16, etc. (https://reviews.llvm.org/D139469).
- Correct v_mov_b32_sdwa (it does not support abs and neg input modifiers yet).
- Enable tfe modifier for MUBUF loads (https://reviews.llvm.org/D137783).
- Enable image_gather4h (https://reviews.llvm.org/D130764).
- Minor corrections and improvements.

22 months ago[AsmWriter] Fix printing of atomicrmw xchg with pointer op
Nikita Popov [Tue, 13 Dec 2022 11:46:09 +0000 (12:46 +0100)]
[AsmWriter] Fix printing of atomicrmw xchg with pointer op

atomicrmw always needs to print all types, even if the xchg value
type happens to be the same as the pointer operand type. This
couldn't occur prior to opaque pointers.

22 months ago[AMDGPU][GFX1013][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 11:44:02 +0000 (14:44 +0300)]
[AMDGPU][GFX1013][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable register tuples with 9, 10, 11 and 12 registers (https://reviews.llvm.org/D138205).

22 months ago[AMDGPU][GFX10][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 11:36:43 +0000 (14:36 +0300)]
[AMDGPU][GFX10][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable register tuples with 9, 10, 11 and 12 registers (https://reviews.llvm.org/D138205).
- Enable abs and neg modifiers for v_cndmask_b32_dpp (https://reviews.llvm.org/D135900).
- Enable literal operands for permlane16/permlanex16 (https://reviews.llvm.org/D137332).
- Enable omod modifiers for v_max3_f16, v_min3_f16, etc. (https://reviews.llvm.org/D139469).
- Correct v_mov_b32_sdwa (it does not support abs and neg input modifiers yet).
- Enable tfe modifier for MUBUF loads (https://reviews.llvm.org/D137783).
- Enable image_gather4h (https://reviews.llvm.org/D130764).
- Minor corrections and improvements.

22 months ago[AMDGPU][GFX940][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 11:26:34 +0000 (14:26 +0300)]
[AMDGPU][GFX940][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable VOP3 variants of dot2c/dot4c/dot8c instructions (https://reviews.llvm.org/D138494).
- Enable abs and neg modifiers for v_cndmask_b32 (https://reviews.llvm.org/D135900).
- Enable omod modifiers for v_max3_f16, v_min3_f16, etc. (https://reviews.llvm.org/D139469).
- Correct v_mov_b32_sdwa (it does not support abs and neg input modifiers yet).
- Enable abs and neg modifiers for v_dot2c_f32_f16_dpp.
- Minor corrections and improvements.

22 months ago[Bitcode] Convert test to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 11:19:35 +0000 (12:19 +0100)]
[Bitcode] Convert test to opaque pointers (NFC)

22 months ago[AMDGPU][GFX90A][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 11:18:20 +0000 (14:18 +0300)]
[AMDGPU][GFX90A][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable register tuples with 9, 10, 11 and 12 registers (https://reviews.llvm.org/D138205).
- Enable VOP3 variants of dot2c/dot4c/dot8c instructions (https://reviews.llvm.org/D138494).
- Enable omod modifiers for v_max3_f16, v_min3_f16, etc. (https://reviews.llvm.org/D139469).
- Enable abs and neg modifiers for v_cndmask_b32 (https://reviews.llvm.org/D135900).
- Correct v_mov_b32_sdwa (it does not support abs and neg input modifiers yet).
- Enable abs and neg modifiers for v_dot2c_f32_f16_dpp.
- Minor corrections and improvements.

22 months ago[clangd] Fix a semantic highlighting crash on dependent code.
Haojian Wu [Tue, 13 Dec 2022 11:15:39 +0000 (12:15 +0100)]
[clangd] Fix a semantic highlighting crash on dependent code.

22 months ago[clang][ExtractAPI] Add support for single symbol SGF and libclang support
Daniel Grumberg [Wed, 26 Oct 2022 17:23:37 +0000 (18:23 +0100)]
[clang][ExtractAPI] Add support for single symbol SGF and libclang support

This is mainly adding an entry point to `SymbolGraphSerializer` at
`serializeSingleSymbolSGF` and exposing the necessary data to make this
possible.  Additionaly there are some changes to how symbol kinds and
path components are serialized to make the usage more ergonomic in
`serializeSingleSymbolSGF`.

On the libclang side this introduces APIs to:
- create an APISet from a TU
- dispose of an APISet
- query an APISet for a single symbol SGF for a given USR.
- generate a single symbol SGF for a given CXCursor, this only traverses
the necessary AST nodes to construct the result as oppposed as going
through the entire AST.

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

22 months ago[Bitcode] Update test to use opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 11:15:55 +0000 (12:15 +0100)]
[Bitcode] Update test to use opaque pointers (NFC)

22 months ago[AMDGPU][GFX908][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 11:12:09 +0000 (14:12 +0300)]
[AMDGPU][GFX908][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable VOP3 variants of dot2c/dot4c/dot8c instructions (https://reviews.llvm.org/D138494).
- Enable abs and neg modifiers for v_dot2c_f32_f16_dpp.
- Minor corrections and improvements.

22 months ago[AMDGPU][GFX9][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 11:01:17 +0000 (14:01 +0300)]
[AMDGPU][GFX9][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable register tuples with 9, 10, 11 and 12 registers (https://reviews.llvm.org/D138205).
- Enable omod modifiers for v_max3_f16, v_min3_f16, etc. (https://reviews.llvm.org/D139469).
- Enable abs and neg modifiers for v_cndmask_b32 (https://reviews.llvm.org/D135900).
- Correct v_mov_b32_sdwa (it does not support abs and neg input modifiers yet).
- Enable tfe modifier for MUBUF loads (https://reviews.llvm.org/D137783).
- Enable image_gather4h (https://reviews.llvm.org/D130764).
- Minor corrections and improvements.

22 months ago[AMDGPU][GFX8][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 10:54:28 +0000 (13:54 +0300)]
[AMDGPU][GFX8][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable register tuples with 9, 10, 11 and 12 registers (https://reviews.llvm.org/D138205).
- Enable abs and neg modifiers for v_cndmask_b32 (https://reviews.llvm.org/D135900).
- Correct v_mov_b32_sdwa (it does not support abs and neg input modifiers yet).
- Enable tfe modifier for MUBUF loads (https://reviews.llvm.org/D137783).
- Minor corrections and improvements.

22 months ago[AMDGPU][GFX7][DOC][NFC] Update assembler syntax description
Dmitry Preobrazhensky [Tue, 13 Dec 2022 10:46:56 +0000 (13:46 +0300)]
[AMDGPU][GFX7][DOC][NFC] Update assembler syntax description

Summary of changes:
- Enable register tuples with 9, 10, 11 and 12 registers (https://reviews.llvm.org/D138205).
- Enable tfe modifier for MUBUF loads (https://reviews.llvm.org/D137783).
- Enable abs and neg modifiers for v_cndmask_b32_e64.
- Minor corrections and improvements.

22 months ago[Clang] Update some CUDA tests to opaque pointers (NFC)
Nikita Popov [Tue, 13 Dec 2022 10:48:14 +0000 (11:48 +0100)]
[Clang] Update some CUDA tests to opaque pointers (NFC)

22 months ago[RS4GC] Add few tests for derived pointer rematerialization. NFC.
Denis Antrushin [Mon, 28 Nov 2022 18:58:47 +0000 (01:58 +0700)]
[RS4GC] Add few tests for derived pointer rematerialization. NFC.

Precommit few tests for the upcoming 'rematerialize derived pointers
at uses' feature.

Reviewed By: skatkov

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