Commit Graph

422165 Commits

Author SHA1 Message Date
Paul Kirth a0b8ab1ba3 [BOLT][NFC] Fix warning for unqualified call to std::move
Fixes warning from RetpolineInsertion.cpp:171:44:
warning: unqualified call to std::move [-Wunqualified-std-cast-call]

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D124482
2022-04-26 23:18:20 +00:00
Aart Bik 33e8ab8ea0 [mlir][sparse] support pattern-only matrices from Matrix Market
We simply set nonzero entries to the value "1" in this case.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D124475
2022-04-26 15:50:21 -07:00
Martin Sebor 449adafabe [InstCombine] Fold strnlen of constant strings.
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123817
2022-04-26 16:15:28 -06:00
Nico Weber a1bb5719ec try to fix check-llvm on windows after 0a27622a1d 2022-04-26 18:00:37 -04:00
Eric Schweitz 44e58509be [NFC] More synching of sources for upstreaming.
Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D124476
2022-04-26 14:54:43 -07:00
Warren Ristow df08b34938 [NFC] Cleanup miscellaneous header items
- Explain the use of the _MM_SHUFFLE and _MM_SHUFFLE2 macros
- Update some doxygen parameter descriptions to match the implementations
- Add "see also" doxygen tags to some intrinsics
- Minor clang-format changes

Reviewers: RKSimon

Differential Revision: https://reviews.llvm.org/D124469
2022-04-26 14:36:49 -07:00
Ricky Zhou 4041c44853 [InstCombine] Update predicate when canonicalizing comparisons in canonicalizeClampLike.
canonicalizeClampLike canonicalizes the ule/ugt comparisons to ult/uge,
respectively. However, it does not update the variable holding the
comparison predicate type after doing this. Later code fails to handle
the non-canonical predicate type (specifically, the swap of
ThresholdLowIncl and ThresholdHighExcl when Pred0 has been canonicalized
from ugt to uge). This leads to the miscompile reported in PR53252. Fix
this by updating the comparison predicate after canonicalizing.

Fixes #53252

Differential Revision: https://reviews.llvm.org/D119690
2022-04-26 17:35:45 -04:00
Michael Kruse ff289feeba [OpenMPIRBuilder] Remove ContinuationBB argument from Body callback.
The callback is expected to create a branch to the ContinuationBB (sometimes called FiniBB in some lambdas) argument when finishing. This creates problems:

 1. The InsertPoint used for CodeGenIP does not need to be the end of a block. If it is not, a naive callback will insert a branch instruction into the middle of the block.

 2. The BasicBlock the CodeGenIP is pointing to may or may not have a terminator. There is an conflict where to branch to if the block already has a terminator.

 3. Some API functions work only with block having a terminator. Some workarounds have been used to insert a temporary terminator that is removed again.

 4. Some callbacks are sensitive to whether the BasicBlock has a terminator or not. This creates a callback ordering problem where different callback may have different behaviour depending on whether a previous callback created a terminator or not. The problem also exists for FinalizeCallbackTy where some callbacks do create branch to another "continue" block, but unlike BodyGenCallbackTy does not receive the target as argument. This is not addressed in this patch.

With this patch, the callback receives an CodeGenIP into a BasicBlock where to insert instructions. If it has to insert control flow, it can split the block at that position as needed but otherwise no separate ContinuationBB is needed. In particular, a callback can be empty without breaking the emitted IR. If the caller needs the control flow to branch to a specific target, it can insert the branch instruction itself and pass an InsertPoint before the terminator to the callback.

Certain frontends such as Clang may expect the current IRBuilder position to be at the end of a basic block. In this case its callbacks must split the block at CodeGenIP before setting the IRBuilder position such that the instructions after CodeGenIP are moved to another basic block and before returning create a new branch instruction to the split block.

Some utility functions such as `splitBB` are supporting correct splitting of BasicBlocks, independent of whether they have a terminator or not, returning/setting the InsertPoint of an IRBuilder to the end of split predecessor block, and optionally omitting creating a branch to the split successor block to be added later.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D118409
2022-04-26 16:35:01 -05:00
Ricky Zhou 077488a6bf [InstCombine] Add tests reproducing PR53252 (NFC)
This are baseline tests for D119690 ( #53252 )

Differential Revision: https://reviews.llvm.org/D119689
2022-04-26 17:24:40 -04:00
Martin Storsjö 1692c2fdaa Revert "[compiler-rt] Use C_STANDARD instead of custom logic for adding -std=c11"
This reverts commit 2f251925db.

This was reported to break the Builtins-powerpc64le-linux::qdiv_test.c
test on ppc64le buildbots, e.g. these:

https://lab.llvm.org/buildbot/#/builders/105/builds/24538
https://lab.llvm.org/buildbot/#/builders/121/builds/18755
2022-04-27 00:20:44 +03:00
Stanislav Mekhanoshin a9ccc7bc54 [AMDGPU] Properly mark MUBUF and FLAT LDS DMA instructions. NFC.
Add these bits to the MUBUF and FLAT LDS DMA instructions:

- LGKM_CNT - these operate on LDS;
- VALU - SPG 3.9.8: This instruction acts as both a MUBUF and
VALU instruction;

Codegen currently does not produce any of this, so the change is NFC.

Differential Revision: https://reviews.llvm.org/D124472
2022-04-26 14:20:26 -07:00
Vasileios Porpodas fa8a9fea47 Recommit "[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`"
This reverts commit 6a9bbd9f20.

Code review: https://reviews.llvm.org/D124202
2022-04-26 14:02:40 -07:00
Paul Robinson 72adc461cc [PS5] Add debug option testing for the PS5 target
The functionality was added in 7726ad0, catching up on the tests now.

This test mostly runs clang and checks one thing each time, which isn't
very efficient.  I added some -DAG suffixes and combined some checks so
adding PS5 checking didn't actually increase the number of clang runs.
2022-04-26 13:42:38 -07:00
Jeffrey Tan d738d4717f Disable symbol on-demand feature for Windows
Symbol on-demand feature is never tested on Windows so it is not a surprise
that we are getting Buildbot failure from Windows:
https://lab.llvm.org/buildbot/#/builders/83/builds/18228

This patch disables symbol on-demand feature on Windows. I will find a Windows
machine to test and re-enable symbol on-demand feature as follow-up.

Differential Revision: https://reviews.llvm.org/D124471
2022-04-26 13:35:34 -07:00
Kirill Stoimenov aabeb5eb7f Revert "[demangler] Simplify OutputBuffer initialization"
Reverting due to a bot failure:
https://lab.llvm.org/buildbot/#/builders/5/builds/22738

This reverts commit 5b3ca24a35.
2022-04-26 20:24:06 +00:00
Martin Sebor ce8f42d4af [InstCombine] Fold memrchr calls with a constant character.
Reviewed By: nikic

Differential Revision: //reviews.llvm.org/D123629
2022-04-26 14:02:50 -06:00
Martin Sebor 10c99ce67d [InstCombine] Fold memrchr calls with constant size, bail on excessive.
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123626
Differential Revision: https://reviews.llvm.org/D123628
2022-04-26 14:02:50 -06:00
Martin Sebor 25febbd155 [InstCombine] Fold strnlen with a bound of zero and one.
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123816
2022-04-26 14:02:50 -06:00
Martin Sebor 2807c420cd [InstCombine] add a strnlen handler stub.
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D123815
2022-04-26 14:02:49 -06:00
Andrew Savonichev 8628b54038 [NVPTX] Temporary disable dwarf-file-dir.ll on Windows
The test was added in D121299 and it fails on Windows:

    error: CHECK-NODIR: expected string
    not found in input
    ; CHECK-NODIR: .file {{[0-9]+}} "/tmp/dbginfo/a/a.cpp"
		   ^
    <stdin>:1:1: note: scanning from here
    //
    ^
    <stdin>:25:2: note: possible intended match here
     .file 1 "/tmp/dbginfo/a\\a.cpp"
2022-04-26 22:26:00 +03:00
Andrew Savonichev e447950483 [NFC] Fix order of initialization in MCTargetOptions
This patch fixes a compiler warning after D121299:

field 'MCUseDwarfDirectory' will be initialized after field
'MCIncrementalLinkerCompatible'
2022-04-26 22:26:00 +03:00
Artur Pilipenko 5ee0123642 [EarlyCSE] Add tests demonstrating missed opportunitites
Add tests demonstrating missed opportunitites around
invariant.start intrinsic.

NFC.
2022-04-26 11:58:16 -07:00
Andrew Savonichev 0a27622a1d [NVPTX] Disable DWARF .file directory for PTX
Default behavior for .file directory was changed in D105856, but
ptxas (CUDA 11.5 release) refuses to parse it:

    $ llc -march=nvptx64 llvm/test/DebugInfo/NVPTX/debug-file-loc.ll
    $ ptxas debug-file-loc.s
    ptxas debug-file-loc.s, line 42; fatal   : Parsing error near
    '"foo.h"': syntax error

Added a new field to MCAsmInfo to control default value of
UseDwarfDirectory. This value is used if -dwarf-directory command line
option is not specified.

Differential Revision: https://reviews.llvm.org/D121299
2022-04-26 21:40:36 +03:00
Sanjay Patel 903aa5e0f8 [InstCombine] try to fold icmp with mismatched extended operands
If a value is known to be non-negative and zexted,
that's the same thing as sexted.

So for the purpose of looking past the casts with
an icmp, treat it as if it was a sext:
https://alive2.llvm.org/ce/z/_BDsGV

This is necessary, but not enough to solve the
motivating problem:
https://github.com/llvm/llvm-project/issues/55013

Differential Revision: https://reviews.llvm.org/D124419
2022-04-26 14:26:36 -04:00
Vasileios Porpodas 6a9bbd9f20 Revert "[SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`"
This reverts commit 55ce296d6f.
2022-04-26 11:25:26 -07:00
Sanjay Patel c8ed784ee6 [InstCombine] fold freeze of partial undef/poison vector constants
We can always replace the undef elements in a vector constant
with regular constants to get rid of the freeze:
https://alive2.llvm.org/ce/z/nfRb4F

The select diffs show that we might do better by adjusting the
logic for a frozen select condition. We may also want to refine
the vector constant replacement to consider forming a splat.

Differential Revision: https://reviews.llvm.org/D123962
2022-04-26 14:16:11 -04:00
Craig Topper 4c98e18377 [RISCV] Add more out of range immediate tests to rv64zbp-invalid.s. NFC
This tests the Zbp instructions that change immediate range between
riscv32 and riscv64. We were only testing them for riscv32 before.
2022-04-26 11:15:47 -07:00
Vasileios Porpodas 55ce296d6f [SLP][TTI] Refactoring of `getShuffleCost` `Args` to work like `getArithmeticInstrCost`
Before this patch `Args` was used to pass a broadcat's arguments by SLP.
This patch changes this. `Args` is now used for passing the operands of
the shuffle.

Differential Revision: https://reviews.llvm.org/D124202
2022-04-26 11:11:29 -07:00
Augie Fackler a907d36cfe Attributes: add a new `allocptr` attribute
This continues the push away from hard-coded knowledge about functions
towards attributes. We'll use this to annotate free(), realloc() and
cousins and obviate the hard-coded list of free functions.

Differential Revision: https://reviews.llvm.org/D123083
2022-04-26 13:57:11 -04:00
Craig Topper 3a9ae9cf7c [RISCV] Add out of range immediate tests for shifts and rotates on rv64.
We were only testing the shared instruction mnemonics in rv32 tests.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D124460
2022-04-26 10:55:14 -07:00
Peter Klausler f4bb211a3b [flang] Fix crash from PDT component init in module file
Semantics now needs to preserve the parse trees from module files,
in case they contain parameterized derived type definitions with
component initializers that may require re-analysis during PDT
instantiation.  Save them in the SemanticsContext.

Differential Revision: https://reviews.llvm.org/D124467
2022-04-26 10:49:05 -07:00
Jay Foad 6753bb2c41 [AMDGPU] Precommit a test case for D124450 2022-04-26 18:44:50 +01:00
LLVM GN Syncbot 224386679d [gn build] Port 7b81192d46 2022-04-26 17:42:25 +00:00
Jeffrey Tan 7b81192d46 Introduce new symbol on-demand for debug info
This diff introduces a new symbol on-demand which skips
loading a module's debug info unless explicitly asked on
demand. This provides significant performance improvement
for application with dynamic linking mode which has large
number of modules.
The feature can be turned on with:
"settings set symbols.load-on-demand true"

The feature works by creating a new SymbolFileOnDemand class for
each module which wraps the actual SymbolFIle subclass as member
variable. By default, most virtual methods on SymbolFileOnDemand are
skipped so that it looks like there is no debug info for that module.
But once the module's debug info is explicitly requested to
be enabled (in the conditions mentioned below) SymbolFileOnDemand
will allow all methods to pass through and forward to the actual SymbolFile
which would hydrate module's debug info on-demand.

In an internal benchmark, we are seeing more than 95% improvement
for a 3000 modules application.

Currently we are providing several ways to on demand hydrate
a module's debug info:
* Source line breakpoint: matching in supported files
* Stack trace: resolving symbol context for an address
* Symbolic breakpoint: symbol table match guided promotion
* Global variable: symbol table match guided promotion

In all above situations the module's debug info will be on-demand
parsed and indexed.

Some follow-ups for this feature:
* Add a command that allows users to load debug info explicitly while using a
  new or existing command when this feature is enabled
* Add settings for "never load any of these executables in Symbols On Demand"
  that takes a list of globs
* Add settings for "always load the the debug info for executables in Symbols
  On Demand" that takes a list of globs
* Add a new column in "image list" that shows up by default when Symbols On
  Demand is enable to show the status for each shlib like "not enabled for
  this", "debug info off" and "debug info on" (with a single character to
  short string, not the ones I just typed)

Differential Revision: https://reviews.llvm.org/D121631
2022-04-26 10:42:06 -07:00
Vasileios Porpodas 957ada4164 [AArch64][NFC] Deleted llvm/test/Analysis/CostModel/AArch64/splat-load.ll test
This test is no longer necessary as it is a subset of:
llvm/test/Analysis/CostModel/AArch64/shuffle-load.ll

Differential Revision: https://reviews.llvm.org/D124456
2022-04-26 10:22:11 -07:00
Matt Arsenault 7b57ef670c llvm-reduce: Simplify virtual register cloning
Just clone all the virtual registers instead of looking for def
operands. This preserves the register values used, simplifying the
rest of the code. This avoids needing to expose the register map to
target code.
2022-04-26 13:17:13 -04:00
Matt Arsenault a27b9ab391 llvm-reduce: Preserve frame index values when cloning function
Previously the specific values used for fixed frame indexes was in
reverse order in the cloned function from the original, and a map was
used to adjust all frame indexes to the potentially new values. Insert
the fixed objects in reverse to avoid this. This simplifies other
code, since now we don't need to track down all frame indexes. This
will allow targets that store frame indexes in MachineFunctionInfo to
simply copy the values.

Note this isn't directly observable in the test since the resulting
MIR print/parse can shuffle the IDs around (in particular the final
serialization implicitly strips out dead objects).
2022-04-26 13:17:13 -04:00
Yi Zhang e1318078a4 Support non identity layout map for reshape ops in MemRefToLLVM lowering
This change borrows the ideas from `computeExpanded/CollapsedLayoutMap`
and computes the dynamic strides at runtime for the memref descriptors.

Differential Revision: https://reviews.llvm.org/D124001
2022-04-26 13:03:53 -04:00
Peter Klausler e1836123a7 [flang] Get ppc64le build bot back up
A recent change assumed that the native C++ "long double" maps to
a Fortran data type; but this turns out to not be true for ppc64le,
which uses "double-double" for "long double".

This is a quick patch to get the ppc64le flang build bot back up.
A better fix that either uses HostTypeExists<> or replaces "long double"
with "ieee128_t" (or some other solution) is expected to follow soon.

Differential Revision: https://reviews.llvm.org/D124423
2022-04-26 09:40:03 -07:00
Tanya Lattner 6c1a0d5205 Consistently use the same apostrophe in these docs. 2022-04-26 09:29:44 -07:00
Shao-Ce SUN c59473aacc [NFC][RISCV][CodeGen] Use ArrayRef in TargetLowering functions
Based on D123467.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D123653
2022-04-26 23:53:00 +08:00
Mark de Wever 0289c90d70 [NFC][libc++] Fixes some tests on Linux.
The tests are adapted to the output produced on Linux.

Reviewed By: #libc, philnik, ldionne

Differential Revision: https://reviews.llvm.org/D124331
2022-04-26 17:50:17 +02:00
Nikita Popov 257b39fbc7 [InstCombine] Add extra use tests for GEP of GEP fold (NFC) 2022-04-26 17:36:54 +02:00
Jay Foad fb571719d5 [TableGen] Dump RC.AllocationPriority with -register-info-debug 2022-04-26 16:29:26 +01:00
Chris Bieneman 69c66bb211 [SPIRV][NFC] Remove unused variable
This removes an unused local variable that was causing a warning to be
emitted.
2022-04-26 10:17:36 -05:00
Jonas Paulsson 9b38e2efa0 [SystemZ] Fix C++ ABI for passing args of structs containing zero width bitfield.
A struct like { float a; int :0; } should per the SystemZ ABI be passed in a
GPR, but to match a bug in GCC it has been passed in an FPR (see 759449c).

GCC has now corrected the C++ ABI for this case, and this patch for clang
follows suit.

Reviewed By: Ulrich Weigand

Differential Revision: https://reviews.llvm.org/D122388
2022-04-26 17:16:14 +02:00
Nikita Popov f9d5657217 [InstCombine] Add tests for GEP of GEP with opaque pointers (NFC)
Test cases with element type mismatch, some of which can still
be combined.
2022-04-26 17:05:15 +02:00
Chris Bieneman 8631c11590 [SPIRV][NFC] Fix warnings for switch cases
Switch statements that cover all cases should not have a `default`
case. When a switch covers all cases and includes a `default` case,
clang emits a diagnostic. Omitting the `default` case allows the
compiler to instead emit a diagnostic on unhandled enum values.

This change removes default cases from all the places that they
shouldn't be, and adds a missing enum case for one switch statement
that wasn't covering all values.
2022-04-26 09:57:18 -05:00
Chris Bieneman 500d677f1d [SPIRV][NFC] Fix warning on class/struct mismatch
Clang issues a warning on class/struct mismatch because the MSVC ABI
varries for classes and structs.
2022-04-26 09:51:46 -05:00
Joseph Huber 2fb131668f [OpenMP] Fix incorrect path taken when searching for LLD for offloading
Summary:
A previous patch updated the path searching in the linker wrapper. I
made an error and caused `lld`, which is necessary to link AMDGPU
images, to not be found on some systems. This patch fixes this by
correctly searching that linker-wrapper's binary path first again.
2022-04-26 10:51:04 -04:00