Commit Graph

422317 Commits

Author SHA1 Message Date
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
David Blaikie 0da640cb87 DWP parsing: Use the index by hash when available
Rather than looking up by offset - actually use the hash table to
perform faster lookup where possible. (for DWARFv4 DWP compilation units
the hash isn't in the header - it's in the root DIE, but to parse the
DIE you need the abbrev section and to get the abbrev section you need
the index - so in that case lookup by offset is required)
2022-04-27 21:46:27 +00:00
Zequan Wu a3b7cb015f [llvm-pdbutil] Add options to only dump symbol record at specified offset and its parents or children with spcified depth.
Right now, if we want to dump symbol at specified offset, we need to use `grep`.
And it can only show surrounding symbols in layout (not in lexical scope sense).

This adds similar options to `dump` command as `llvm-dwarfdump` to allow users
to dump symbol record at specified offset and its parents or children with
spcified depth.

`--symbol-offset=` must be used with `--modi` to dump only one symbol at given
offset.

`--show-parents`/`--show-children` must be used with `--symbol-offset` to
dump all symbols that are parents/children of the symbol at given offset.

`--parent-recurse-depth`/`--children-recurse-depth` must be used with
`--show-parents`/`--show-children` to specify the max up/down depth.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D124317
2022-04-27 14:37:35 -07:00
Matt Arsenault 18b9c46370 llvm-reduce: Fix not cloning MachineInstr flags 2022-04-27 17:29:18 -04:00
owenca db57acff26 [clang-format] Adjust editor cursor position past #include blocks
Fixes #55027.

Differential Revision: https://reviews.llvm.org/D124452
2022-04-27 14:26:23 -07:00
David Blaikie 727c590fe9 DebugInfo: Use hash-based unit lookup when available in dwp files
Fix a test case that had a bogus (probably I hand crafted it at some
point) index that didn't point to the right data in the process.
2022-04-27 21:18:14 +00:00
Paul Robinson fd0e60d787 [PS5] Test sanitizer options/lib names
The functionality was added in 7726ad0, catching up on the tests now.
2022-04-27 13:45:41 -07:00
Florian Hahn 25d53aa9a2
[SimpleLoopUnswitch] Fix CHECK lines of tests added in 93182c9ff4.
When generating the tests I accidentally had some other changes applied.
Fix the CHECK lines for current main.
2022-04-27 21:36:53 +01:00
Florian Hahn 93182c9ff4
[SimpleLoopUnswitch] Add test cases where freeze of OR/AND cons needed.
Freezing just the result of the AND/OR here is not enough.
2022-04-27 21:19:14 +01:00
Simon Pilgrim 8032c5f68c [X86] setcc.ll - add bmi2 + tbm test coverage
As discussed on Issue #55138 - BMI2 (fast shrx) shouldn't always fold to BT
2022-04-27 21:09:57 +01:00
Simon Pilgrim edc80e7d43 [X86] setcc.ll - remove unnecessary cpu attributes 2022-04-27 21:09:57 +01:00
Simon Pilgrim 81b38668ff [X86] Add test case for Issue #55138 2022-04-27 21:09:57 +01:00
Simon Pilgrim e378577524 [X86] Use is128BitLaneRepeatedShuffleMask wrapper. NFC.
We don't need to know the actual repeated mask.
2022-04-27 21:09:57 +01:00