Commit Graph

422329 Commits

Author SHA1 Message Date
Lei Zhang bbffece383 [mlir][spirv] Remove layout decoration on unneeded storage classes
Per SPIR-V validation rules, explict layout decorations are only
needed for StorageBuffer, PhysicalStorageBuffer, Uniform, and
PushConstant storage classes. (And even that is for Shader
capabilities). So we don't need such decorations on the rest.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D124543
2022-04-28 08:18:23 -04:00
Lei Zhang 8854b73606 [mlir][spirv] Convert memref.alloca to spv.Variable
Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D124542
2022-04-28 08:13:40 -04:00
Simon Pilgrim 72959f7714 [X86] Add test case for Issue #55158 2022-04-28 13:06:58 +01:00
Andrew Savonichev 0f1b5f115a [NVPTX] Integrate ptxas to LIT tests
ptxas is a proprietary compiler from Nvidia that can compile PTX to
machine code (SASS). It has a lot of diagnostics to catch errors
in PTX, which can be used to verify PTX output from llc.

Set -DPXTAS_EXECUTABLE=/path/to/ptxas CMake option to enable it.
If this option is not set, then ptxas is substituted to true which
effectively disables all ptxas RUN lines.

LLVM_PTXAS_EXECUTABLE environment variable takes precedence over
the CMake option, and allows to override ptxas executable that is used for LIT
without complete re-configuration.

Differential Revision: https://reviews.llvm.org/D121727
2022-04-28 14:59:45 +03:00
Bernhard Manfred Gruber b1f1688e90 [clang-tidy] support --load in clang-tidy-diff.py/run-clang-tidy.py
Support for loading shared objects as plugins into clang-tidy was added
in http://reviews.llvm.org/D111100. Unfortunately, the utility scripts
`clang-tidy-diff.py` and `run-clang-tidy.py` did not receive
corresponding arguments to forward such plugins to clang-tidy.
This diff adds a `-load=plugin` option to both scripts.

Differential Revision: http://reviews.llvm.org/D12306

Reviewed By: aaron.ballman
2022-04-28 13:49:18 +02:00
Simon Pilgrim ed8dffef4c [X86] getFauxShuffle - don't assume an UNDEF src element for AND/ANDNP results in an UNDEF shuffle mask index
The other src element might be zero, guaranteeing zero.

Fixes #55157
2022-04-28 12:32:58 +01:00
Simon Pilgrim ae8143547a Revert rG8680dd5117b0c36f807fecc4360122ae1dd73b6d "[X86] getFauxShuffle - don't assume an UNDEF src element for AND/ANDNP results in an UNDEF shuffle mask index"
I screwed up the merge somehow.
2022-04-28 12:25:14 +01:00
Simon Pilgrim 8680dd5117 [X86] getFauxShuffle - don't assume an UNDEF src element for AND/ANDNP results in an UNDEF shuffle mask index
The other src element might be zero, guaranteeing zero.

Fixes #55157
2022-04-28 11:54:31 +01:00
Michael Forster cfb4e78252 Revert "[llvm-pdbutil] Add options to only dump symbol record at specified offset and its parents or children with spcified depth."
This reverts commit a3b7cb015f.

symbol-offset.test fails under MSAN:

[  1] ; RUN: llvm-pdbutil yaml2pdb %p/Inputs/symbol-offset.yaml --pdb=%t.pdb [FAIL]
llvm-pdbutil yaml2pdb <REDACTED>/llvm/test/tools/llvm-pdbutil/Inputs/symbol-offset.yaml --pdb=<REDACTED>/tmp/symbol-offset.test/symbol-offset.test.tmp.pdb
==9283==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55f975e5eb91 in __libcpp_tls_set <REDACTED>/include/c++/v1/__threading_support:428:12
    #1 0x55f975e5eb91 in set_pointer <REDACTED>/include/c++/v1/thread:196:5
    #2 0x55f975e5eb91 in void* std::__msan::__thread_proxy<std::__msan::tuple<std::__msan::unique_ptr<std::__msan::__thread_struct, std::__msan::default_delete<std::__msan::__thread_struct> >, llvm::parallel::detail::(anonymous namespace)::ThreadPoolExecutor::ThreadPoolExecutor(llvm::ThreadPoolStrategy)::'lambda'()::operator()() const::'lambda'()> >(void*) <REDACTED>/include/c++/v1/thread:285:27
    #3 0x7f74a1e55b54 in start_thread (<REDACTED>/libpthread.so.0+0xbb54) (BuildId: 64752de50ebd1a108f4b3f8d0d7e1a13)
    #4 0x7f74a1dc9f7e in clone (<REDACTED>/libc.so.6+0x13cf7e) (BuildId: 7cfed7708e5ab7fcb286b373de21ee76)
2022-04-28 12:42:31 +02:00
Andrzej Warzynski dcb2ddd6c9 [flang][driver] Fix spelling (nfc)
Merely making sure that we use consistent spelling.
2022-04-28 10:37:27 +00:00
Simon Pilgrim e7435e61e9 [X86] Add test case for Issue #55157 2022-04-28 11:34:45 +01:00
Dmitry Makogon e9b4f2256a [RS4GC] Add tests showing cases in which we could find a better base (NFC) 2022-04-28 17:22:11 +07:00
Mike Kashkarov 35cc2ec4ed [flang] Support FINDLOC/MAXLOC/MINLOC with scalar mask
Previously MASK= elements were accessed in assumption that mask is an array of
input argument rank (and in combination with explicit DIM= argument we had
out-of-bounds access), but for MAXLOC/MINLOC/FINDLOC mask should be be
conformable and could be scalar.

Add new regression tests with scalar mask for verification.

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D124408
2022-04-28 18:59:04 +09:00
Mike Kashkarov 92e22c97e9 [flang] Fix UBOUND() constant folding for parentheses expr
Similarly to LBOUND((x)) in https://reviews.llvm.org/D123838 - fix UBOUND((x))
folding for constant arrays to return shape instead of recurse scan.

Depends on D123520

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D123944
2022-04-28 18:56:54 +09:00
Marco Antognini bf0bcb5e53 [Analyzer] Remove undefined function
This getLValue function was declared in 98db1f990f ([Analyzer] [NFC]
Parameter Regions, 2020-05-11) but was never implemented.

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D124461
2022-04-28 11:54:40 +02:00
Ties Stuij 051deb2d9d [ARM] add Armv9 build attribute
The build attribute number can be found in the Arm ABI addenda32 document:
https://github.com/ARM-software/abi-aa/blob/main/addenda32/addenda32.rst#335target-related-attributes

Reviewed By: tmatheson

Differential Revision: https://reviews.llvm.org/D124090
2022-04-28 10:48:26 +01:00
Ilya Biryukov 2b833d4086 [AST] Improve traversal of concepts and concept requirements
- Do not traverse concept decl inside `AutoType`. We only traverse
  declaration and definitions, not references to a declaration.
- Do not visit implicit AST node the relevant traversal mode.
- Add traversal extension points for concept requirements.
- Renamed `TraverseConceptReference` to mark as helper to share
  the code. Having an extension point there seems confusing given that
  there are many concept refences in the AST that do not call the
  helper. Those are `AutoType`, `AutoTypeLoc` and constraint requirements.

Only clangd code requires an update.

There are no use-cases for concept requirement traversals yet, but
I added them in the earlier version of the patch and decided to keep
them for completeness.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D124532
2022-04-28 09:33:26 +00:00
Krasimir Georgiev be656df187 [clang-format] add a regression test for include sorting
This adds a regression test from the comments
on https://reviews.llvm.org/D121370.

Reviewed By: MyDeveloperDay, curdeius

Differential Revision: https://reviews.llvm.org/D124513
2022-04-28 11:02:14 +02:00
Krasimir Georgiev e8cc7490d2 Revert "[clang-format] SortIncludes should support "@import" lines in Objective-C"
This reverts commit d46fa023ca.
Regressed include order in some cases with trailing comments, see the
comments on https://reviews.llvm.org/D121370. Will add a regression test
in a follow-up commit.
2022-04-28 11:00:32 +02:00
Pavel Labath 57f99d0dc3 [lldb] Reduce duplication in DWARFASTParserClang::CopyUniqueClassMethodTypes
Use lambdas to replace identical bits of code.
2022-04-28 10:58:54 +02:00
Lian Wang dc0ae8ce18 [RISCV] Support VP_SETCC mask operations
Support VP_SETCC mask operations, turn it to logical operation.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D124438
2022-04-28 08:52:29 +00:00
Javier Setoain 6301574206 [mlir][SparseTensor] Enable VLA ops in index value generation
Current index value generation uses fixed-length vector ops, this patch
adds an alterantive codegen path compatible with scalable vectors by
using `LLVM::StepVectorOp`.

Differential Revision: https://reviews.llvm.org/D124454
2022-04-28 09:39:07 +01:00
Jay Foad 515f890033 [CodeGen] Remove an outdated comment in MachinePointerInfo
This comment has been untrue since D39758 changed
MachinePointerInfo to store AddrSpace separately from V.
2022-04-28 09:06:36 +01:00
Nikita Popov b9dc565147 [GVN] Encode GEPs in offset representation
When using opaque pointers, convert GEPs into offset representation
of the form P + V1 * Scale1 + V2 * Scale2 + ... + ConstantOffset.
This allows us to recognize equivalent address calculations even if
the GEPs don't use the same source element type.

This fixes an opaque pointer codegen regression seen in rustc.

Differential Revision: https://reviews.llvm.org/D124527
2022-04-28 09:32:05 +02:00
Luo, Yuanke 942ec5c36d [X86][AMX] combine tile cast and load/store instruction.
The `llvm.x86.cast.tile.to.vector` intrinsic is lowered to
`llvm.x86.tilestored64.internal` and `load <256 x i32>`. The
`llvm.x86.cast.vector.to.tile` is lowered to `store <256 x i32>` and
`llvm.x86.tileloadd64.internal`. When `llvm.x86.cast.tile.to.vector` is
used by `store <256 x i32>` or `load <256 x i32>` is used by
`llvm.x86.cast.vector.to.tile`, they can be combined by
`llvm.x86.tilestored64.internal` and `llvm.x86.tileloadd64.internal`.

Differential Revision: https://reviews.llvm.org/D124378
2022-04-28 14:55:21 +08:00
Brad Smith 3d7da810e4 [Driver][Solaris] -r: imply -nostdlib like GCC
Similar to D116843 for Gnu.cpp

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D124356
2022-04-28 00:19:45 -04:00
Max Kazantsev 35f38583d2 [JumpThreading][NFC][CompileTime] Do not recompute BPI/BFI analyzes
They can already be available, and even if not, DT/LI can be available.
We should not recompute them. Old PM is unchanged because it would
require changing dependencies, and we don't care enough about it.

Differential Revision: https://reviews.llvm.org/D124439
Reviewed By: nikic, aeubanks
2022-04-28 10:46:08 +07:00
Wenju He 96d3be8443 [InferAddressSpaces] Check if AS are the same in isNoopPtrIntCastPair
isNoopAddrSpaceCast is expecting SrcAS is different from DestAS.
If the two AS are the same, consider ptrtoint/inttoptr as noop cast.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D123573
2022-04-28 11:10:55 +08:00
Liqin.Weng 6365bde658 [XCORE][CodeGen][NFC] Use ArrayRef in TargetLowering functions
Reviewed By: nigelp-xmos

Differential Revision: https://reviews.llvm.org/D123661
2022-04-28 02:06:46 +00:00
Shengchen Kan 6a6b0e4a63 [X86] Check the address in machine verifier
1. The scale factor must be 1, 2, 4, 8
2. The displacement must fit in 32-bit signed integer

Noticed by: https://github.com/llvm/llvm-project/issues/55091

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D124455
2022-04-28 10:05:39 +08:00
Arthur Eubanks 4e65291837 [OpaquePtr][GlobalOpt] Don't attempt to evaluate global constructors with arguments
Previously all entries in global_ctors had to have the void()* type and
we'd skip evaluating bitcasted functions. With opaque pointers we may
see the function directly.

Fixes #55147.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D124553
2022-04-27 19:00:44 -07:00
Peixin-Qiao b6b8d34554 [flang] Add lowering stubs for OpenMP/OpenACC declarative constructs
This patch provides the basic infrastructure for lowering declarative
constructs for OpenMP and OpenACC.

This is part of the upstreaming effort from the fir-dev branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project

Reviewed By: kiranchandramohan, shraiysh, clementval

Differential Revision: https://reviews.llvm.org/D124225
2022-04-28 09:40:30 +08:00
Aaron Puchert c9a16e8c3d Drop '* text=auto' from .gitattributes and normalize
Git wants to check in 'text' files with LF endings, so this changes them
in the repository but not in the checkout, where they keep CRLF endings.

Differential Revision: https://reviews.llvm.org/D124563
2022-04-28 03:05:10 +02:00
Douglas Yung 6adb8c2208 Fix test fail-file-open.test on Windows to hopefully fix the Windows buildbots. 2022-04-27 17:28:57 -07:00
Jonas Devlieghere 5205c17749
[lldb] Fix escaping when launching in terminal with AppleScript
Fix escaping when launching in terminal with AppleScript. The invocation
we're building up is wrapped in single quotes when passed to bash and
wrapped in double quotes for AppleScript.

Here's an example invocation with the new escaping:

  tell application "Terminal"
    activate
          do script "/bin/bash -c 'arch -arch arm64 'darwin-debug'
            --unix-socket=/tmp/dL2jSh --arch=arm64 --working-dir
            \"/private/tmp/with spaces\" --disable-aslr --  \"foo\"
            \"bar\" \"baz\" ; echo Process exited with status $?';exit"
  end tell

Previously we were using unescaped single quotes which resulted in the
whole bash invocation being passed in pieces. That works most of the
time but breaks when you have a space in your current working directory
for example.

rdar://91870763

Differential revision: https://reviews.llvm.org/D124568
2022-04-27 16:37:42 -07:00
Jonas Devlieghere 7d67a1e45a
[dsymutil] Fix memory issue in the BinaryHolder
The BinaryHolder has two caches for object and archive entries. These
are implemented as StringMaps of ObjectEntry and ArchiveEntry
respectively. The fact that they're stored by value is problematic
because the BinaryHolder hands out references that become invalidate
when the data structure grows. This patch wraps those object instances
in unique pointers and changes the interface to hand out pointers. This
resulted in transient failures.

rdar://90412671

Differential revision: https://reviews.llvm.org/D124567
2022-04-27 16:35:48 -07:00
Fangrui Song c74a706893 [LegacyPM] Remove ThreadSanitizerLegacyPass
Using the legacy PM for the optimization pipeline was deprecated in 13.0.0.
Following recent changes to remove non-core features of the legacy
PM/optimization pipeline, remove ThreadSanitizerLegacyPass.

Reviewed By: #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D124209
2022-04-27 16:25:41 -07:00
Kirill Stoimenov 761366e6ae Revert "[Debuginfo][LSR] Add salvaging variadic dbg.value intrinsics [2/2]"
This reverts commit 74273d575f.

Buildbot: https://lab.llvm.org/buildbot/#/builders/5/builds/22795
Failing with memory leak.
2022-04-27 23:11:48 +00:00
Zequan Wu 1043eeaf86 [llvm-symbolizer][native-pdb] Don't reset CurLineOffset if NextLineOffset is none 2022-04-27 16:05:19 -07:00
Matt Arsenault 7762a3ce18 Revert "BranchFolder: Assert on SSA functions"
This reverts commit 6ff91d17d6.
2022-04-27 19:02:15 -04:00
Volodymyr Sapsai d32c685e10 [modules] Merge equivalent extensions and diagnose ivar redeclarations for extensions loaded from different modules.
Emitting metadata for the same ivar multiple times can lead to
miscompilations. Objective-C runtime adds offsets to calculate ivar
position in memory and presence of duplicate offsets causes wrong final
position thus overwriting unrelated memory.

Such a situation is impossible with modules disabled as clang diagnoses
ivar redeclarations during sema checks after parsing
(`Sema::ActOnFields`). Fix the case with modules enabled by checking
during deserialization if ivar is already declared. We also support
a use case where the same category ends up in multiple modules. We
don't want to treat this case as ivar redeclaration and instead merge
corresponding ivars.

rdar://83468070

Differential Revision: https://reviews.llvm.org/D121177
2022-04-27 15:52:59 -07:00
Matt Arsenault 717209763e llvm-reduce: Fix incorrect cloning of MachineMemOperands
There were two problems with directly copying the MMOs from the old
function. The MMOs are owned by the function's Allocator, so need to
be reallocated anyways (surprisingly I didn't notice breakage on
this). Second, the PseudoSourceValues are also allocated per function
and need to be reallocated.
2022-04-27 18:51:38 -04:00
Matt Arsenault 6ff91d17d6 BranchFolder: Assert on SSA functions
We probably should have the opposite of getRequiredProperties for this
2022-04-27 18:51:37 -04:00
Paul Robinson 7d2dddce8f [PS5] Enable dead-stripping globals in ASan 2022-04-27 15:44:42 -07:00
Bill Wendling 8f2ec974d1 [X86] Move target-generic code into CodeGen [NFC]
This code is the same for all platforms.

Differential Revision: https://reviews.llvm.org/D124566
2022-04-27 15:37:28 -07:00
Matt Arsenault e39e9d339c llvm-reduce: Fix crashing on file opening error for mir path 2022-04-27 18:15:12 -04:00
Matt Arsenault 7c2db66632 llvm-reduce: Support multiple MachineFunctions
The current testcase I'm trying to reduce only reproduces with IPRA
enabled and requires handling multiple functions.

The only real difference vs. the IR is the extra indirect to look for
the underlying MachineFunction, so treat the ReduceWorkItem as the
module instead of the function.

The ugliest piece of this is really the ugliness of
MachineModuleInfo. It not only tracks actual module state, but has a
number of transient fields used for isel and/or the asm printer. These
shouldn't do any harm for the use here, though they should be
separated out.
2022-04-27 18:11:59 -04:00
Matt Arsenault 49c7534587 llvm-reduce: Try to fix test on windows buildbots 2022-04-27 18:00:18 -04:00
Peter Steinfeld 9df99d8ac2 [flang] Fix MAXLOC/MINLOC when MASK is scalar .FALSE.
When passing a scalar .FALSE. as the MASK argument to MAXLOC, we were getting
bad memory references.  We were falling into the code intended when the MASK
argument was missing.

I fixed this by checking for a scalar MASK with a .FALSE. value and
setting the result to all zeroes in that case.  I also added tests for
MAXLOC and MINLOC with scalar values of .TRUE. and .FALSE. for the MASK
argument.

I also special cased situations where the MASK argument is a scalar with
a .TRUE. value and passed along a nullptr in such cases.

Along the way, I eliminated the unused "chars" argument from the constructor
for ExtremumLocAccumulator.

Differential Revision: https://reviews.llvm.org/D124484
2022-04-27 14:50:00 -07:00
Matt Arsenault 1747a93b28 llvm-reduce: Try to parse triple/datalayout from module
This saves needing to specify -mtriple on nearly every use for MIR
reduction.
2022-04-27 17:47:46 -04:00