Commit Graph

422296 Commits

Author SHA1 Message Date
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
Chris Bieneman 5e096ce6c8 Update PGO and 3-stage cache files
These files are out of date and haven't been updated to work within the
monorepo. This change updates them appropriately so that they build
using the monorepo build infrastructure.
2022-04-27 14:41:56 -05:00
Peter Klausler 84c6dc96ac [flang] Downgrade a fatal error to a warning
A non-CHARACTER expression in a CASE statement is allowed to have
a distinct kind (not type) from the expression in its SELECT CASE.
If a value in a CASE statement is out of range for the SELECT CASE
type, emit a warning, but it should not be a fatal error.

Differential Revision: https://reviews.llvm.org/D124544
2022-04-27 12:31:58 -07:00
Peter Klausler 787ee99d4f [flang] Allow for host association in ConvertTo(Object|Proc)Entity
Name resolution fails with a bogus "is not a variable" error message
when a host-associated object appears in a NAMELIST group.  The root
cause is that ConvertToObjectEntity() returns false for host-associated
objects.  Fix that, and also apply a similar fix to ConvertToProcEntity()
nearby.

Differential Revision: https://reviews.llvm.org/D124541
2022-04-27 12:30:03 -07:00
Blue Gaston 8b574a1e51 [Darwin][UBSan][Sanitizer] abort_on_error ubsan test fix for arm64
The current darwin abort_on_error test specifically tests for a division
by zero undefined behavior. However arm does not trap by default for this
behavior. x86 signals the abort, which is why the test passes on x86.
This patch updates the test to test for a case where the ubsan runtime
specifically calls Die() to trigger an abort by default.

rdar://92108564

Differential Revision: https://reviews.llvm.org/D124480
2022-04-27 12:23:03 -07:00
Petr Hosek 82aa5e2c6f Revert "[Driver] Support for compressed debug info on Fuchsia"
This reverts commit 2d0c897212 which
is still breaking on the sanitizer bots.
2022-04-27 11:41:41 -07:00
Matt Arsenault e617d1a1d7 llvm-reduce: Fix mangling types of generic registers 2022-04-27 14:27:36 -04:00
Petr Hosek 2d0c897212 [Driver] Support for compressed debug info on Fuchsia
Pass the --compress-debug-sections=zlib argument to the linker when
the use of compressed debug info is requested.

Differential Revision: https://reviews.llvm.org/D114115
2022-04-27 11:24:41 -07:00
Matt Arsenault 6d6288f2be llvm-reduce: Preserve subregisters and other fields for top block def 2022-04-27 14:21:43 -04:00
Nicolas Abram Lujan f8a574bf4d [InstCombine] C0 >> (X - C1) --> (C0 << C1) >> X
With the right pre-conditions, we can fold the offset
into the shifted constant:
https://alive2.llvm.org/ce/z/drMRBU
https://alive2.llvm.org/ce/z/cUQv-_

Fixes #55016

Differential Revision: https://reviews.llvm.org/D124369
2022-04-27 14:18:30 -04:00
Craig Topper c2614b31d9 [RISCV] Add isCommutable to scalar FMA instructions.
The default implementation of findCommutedOpIndices picks the
first two source operands. That's exactly what we want for the
scalar FMA instructions.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D124463
2022-04-27 11:07:18 -07:00
Martin Sebor efa0f12c0b [InstCombine] Fold strnlen calls in equality to zero.
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123818
2022-04-27 12:03:24 -06:00
Alexey Bataev 29a470e380 [COST]Improve cost model for shuffles in SLP.
Introduced masks where they are not added and improved target dependent
cost models to avoid returning of the incorrect cost results after
adding masks.

Differential Revision: https://reviews.llvm.org/D100486
2022-04-27 10:56:26 -07:00
Zequan Wu afd639071b [LLDB][NativePDB] Minor fix ParseInlinesite.
- Don't reset cur_line_offset to llvm::None when we don't have next_line_offset, because we may need to reuse it in new range after a code end.
- Don't use CombineConsecutiveEntriesWithEqualData for inline_site_sp->ranges, because that will combine consecutive entries with same data in the vector regardless of the entry's range. Originally, I thought that it only combine consecutive entries if adjacent entries' ranges are adjoining or intersecting with each other.
2022-04-27 10:56:03 -07:00
Andrew Savonichev 1041a9642b [lit] Support %if ... %else syntax for RUN lines
This syntax allows to modify RUN lines based on features
available. For example:

    RUN: ... | FileCheck %s --check-prefix=%if windows %{CHECK-W%} %else %{CHECK-NON-W%}
    CHECK-W: ...
    CHECK-NON-W: ...

The whole command can be put under %if ... %else:

    RUN: %if tool_available %{ %tool %} %else %{ true %}

or:

    RUN: %if tool_available %{ %tool %}

If tool_available feature is missing, we'll have an empty command in
this RUN line.  LIT used to emit an error for empty commands, but now
it treats such commands as nop in all cases.

Multi-line expressions are also supported:

    RUN: %if tool_available %{ \
    RUN:   %tool               \
    RUN: %} %else %{           \
    RUN:   true                \
    RUN: %}

Background and motivation:
D121727 [NVPTX] Integrate ptxas to LIT tests
https://reviews.llvm.org/D121727

Differential Revision: https://reviews.llvm.org/D122569
2022-04-27 20:29:08 +03:00
Wei Wang 26a0d53b15 [CHR] Skip region containing llvm.coro.id
When a block containing llvm.coro.id is cloned during CHR, it inserts an invalid
PHI node with token type to the beginning of the block containing llvm.coro.begin.
To avoid such case, we exclude regions with llvm.coro.id.

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D124418
2022-04-27 10:27:25 -07:00
Aart Bik ccd047cba4 [mlir][sparse] optimize COO index handling
By using a shared index pool, we reduce the footprint of each "Element"
in the COO scheme and, in addition, reduce the overhead of allocating
indices (trading many allocations of vectors for allocations in a single
vector only). When the capacity is known, this means *all* allocation
can be done in advance.

This is a big win. For example, reading matrix SK-2005, with dimensions
50,636,154 x 50,636,154 and 1,949,412,601 nonzero elements improves
as follows (time in ms), or about 3.5x faster overall

```
SK-2005 before        after      speedup
  ---------------------------------------------
read     305,086.65    180,318.12    1.69
sort   2,836,096.23    510,492.87    5.56
pack     364,485.67    312,009.96    1.17
  ---------------------------------------------
TOTAL  3,505,668.56  1,002,820.95    3.50
```

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D124502
2022-04-27 10:20:47 -07:00
Vasileios Porpodas c7bb5ac5ca [NFC] Renamed /test/Analysis/CostModel/X86/splat-load.ll test and added more checks.
Renamed test/Analysis/CostModel/X86/splat-load.ll to shuffle-load.ll
to align it with AArch64's similar test.

Also added a complete list of checks for all vector combinations up to 512-bits.

Differential Revision: https://reviews.llvm.org/D124528
2022-04-27 09:47:43 -07:00
Min-Yih Hsu a75657d66a [mlir][LLVMIR] Do not cache llvm::Constant into instMap
Constants in MLIR are not globally unique, unlike that in LLVM IR.
Therefore, reusing previous-translated constants might cause the user
operations not being dominated by the constant (because the
previous-translated ones can be placed in arbitrary place)

This indeed misses some opportunities where we actually can reuse a
previous-translated constants, but verbosity is not our first priority
here.

Differential Revision: https://reviews.llvm.org/D124404
2022-04-27 09:43:49 -07:00
Min-Yih Hsu ea9bcb8b27 [mlir][LLVMIR] Do not cache Instruction generated on-the-fly
More specifically, the llvm::Instruction generated by
llvm::ConstantExpr::getAsInstruction. Such Instruction will be deleted
right away, but it's possible that when getAsInstruction is called
again, it will create a new Instruction that has the same address with
the one we just deleted. Thus, we shouldn't keep it in the `instMap` to
avoid a conflicting index that triggers an assertion in
processInstruction.

Differential Revision: https://reviews.llvm.org/D124402
2022-04-27 09:42:59 -07:00
Min-Yih Hsu 00fcf9e95a [mlir][LLVMIR] Add support for importing struct-type ConstantAggregate(Zero)
And move importer test files from `test/Target/LLVMIR` into
`test/Target/LLVMIR/Import`.

We simply translate struct-type ConstantAggregate(Zero) into a
serious of `llvm.insertvalue` operations against a `llvm.undef` root.
Note that this doesn't affect the original logics on translating
vector/array-type ConstantAggregate values.

Differential Revision: https://reviews.llvm.org/D124399
2022-04-27 09:42:26 -07:00
Mike Kashkarov d8b4ea486a [flang] Fix UBOUND() folding for constant arrays
Similarly to LBOUND in https://reviews.llvm.org/D123237, fix UBOUND() folding
for constant arrays (for both w/ and w/o DIM=): convert
GetConstantArrayLboundHelper into common helper class for both lower/upper
bounds.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D123520
2022-04-28 01:17:47 +09:00