Commit Graph

372981 Commits

Author SHA1 Message Date
Jay Foad 4926eed59c [AMDGPU] Add a TRANS bit to TSFlags. NFC.
This is used to mark transcendental instructions that execute on a
separate pipeline from the normal VALU pipeline.

Differential Revision: https://reviews.llvm.org/D92042
2020-11-24 17:49:56 +00:00
Tei Jeong 760063267c Fix CalibratedQuantizedType's print function to match parser
Reviewed By: liufengdb

Differential Revision: https://reviews.llvm.org/D92034
2020-11-24 09:35:35 -08:00
Teresa Johnson 6e4c1cf293 [ThinLTO/WPD] Enable -wholeprogramdevirt-skip in ThinLTO backends
Previously this option could be used to skip devirtualizations of the
given functions in regular LTO and in the ThinLTO indexing step. This
change allows them to be skipped in the backend as well, which is useful
when debugging WPD in a distributed ThinLTO backend.

Differential Revision: https://reviews.llvm.org/D91812
2020-11-24 09:35:07 -08:00
Victor Huang 1f5c4a0d04 [PowerPC][PCRelative] Add new pseudo instructions for PCRel TLS to fix R2 clobber issue
New pseudo instructions GETtlsADDRPCREL and GETtlsldADDRPCREL are added for properly
setting REGMASK for tls_get_addr function when using PCRelative address.

Differential Revisien: https://reviews.llvm.org/D91420
Reviewed by: bsaleil
2020-11-24 11:34:32 -06:00
Stella Laurenzo db9713cd77 [mlir] Add Tosa dialect const folder for tosa.const.
* Was missed in the initial submission and is required for a ConstantLike op.
* Also adds a materializeConstant hook to preserve it.
* Tightens up the argument constraint on tosa.const to match what is actually legal.

Differential Revision: https://reviews.llvm.org/D92040
2020-11-24 17:33:00 +00:00
Louis Dionne 0ec73a61cc [libc++] NFC: Fix confusing indentation in <numeric> 2020-11-24 12:30:31 -05:00
Hubert Tong 44174b3d51 [NFC][tests] Replace non-portable grep with FileCheck
After commit 2482648a79, a GNU grep option
is just passed unconditionally to `grep` in general. This patch fixes
the test for platforms where `grep` is not GNU grep.
2020-11-24 12:15:07 -05:00
Yichao Yu a248eca665
Clear NewGEPBases after finish using them in CodeGenPrep pass
AFAICT all other set/map are correctly cleared in `runOnFunction`.

With assertion enabled this causes a crash when the module is freed and potentially if a later pass delete the instruction (not observed in real world though). Without assertion this can potentially cause confusing result when running on a new Function/Module.

Reviewed By: loladiro

Differential Revision: https://reviews.llvm.org/D84031
2020-11-24 12:12:00 -05:00
Arthur Eubanks 2577708054 [test] Merge parallel_region_merging{,_legacy_pm}.ll
These are identical except for the RUN lines.
Also pin legacy RUN line to legacy PM.
2020-11-24 08:56:53 -08:00
Thomas Preud'homme 9c8af93c93 Add support for STRICT_FSETCC promotion
Add missing handling of STRICT_FSETCC promotion. This prevents assert
failure in llvm::TargetLoweringBase::getTypeToPromoteTo().

Reviewed By: uweigand

Differential Revision: https://reviews.llvm.org/D91962
2020-11-24 16:53:49 +00:00
Mark de Wever 1a036e9cc8 [libcxx] Implement P1956 rename low-level bit functions
Implements P1956: On the names of low-level bit manipulation functions.

Users may use older versions of libc++ or other standard libraries with the old names. In order to keep compatibility the old functions are kept, but marked as deprecated.

The patch also adds a new config macro `_LIBCPP_DEPRECATED_MSG`. Do you prefer a this is a separate patch?

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D90551
2020-11-24 17:37:06 +01:00
Nico Weber 11b7625833 [lld/mac] Implement basic typo correction for flags
Also use "unknown flag 'flag'" instead of "unknown flag: flag" for
consistency with the other ports.

Differential Revision: https://reviews.llvm.org/D91970
2020-11-24 11:33:39 -05:00
Masoud Ataei b86a1cd2f8 [PowerPC] dyn_cast should be dyn_cast_or_null in MASSV pass
It is possible that we have different constants in different slots
of second vector double (float) of pow function. So, in this case
Exp->getSplatValue() will return nullptr. Here, I handle it properly.

Reviewed By: steven.zhang, PowerPC

Differential Revision: https://reviews.llvm.org/D91729
2020-11-24 16:21:12 +00:00
Nico Weber 9a8386dba8 clang: Pass -platform-version to new MachO LLD
New MachO LLD doesn't implement the old -macos_version_min (etc)
flags, but it understands the modern platform_version flag.
So make the clang driver pass that when using new MachO LLD.

Also, while here, don't pass -lto_library to LLD, since it
links in LTO libraries statically (which it can because it's
versioned alongside clang).

Differential Revision: https://reviews.llvm.org/D92037
2020-11-24 11:16:03 -05:00
Sergey Dmitriev 1b0ca81a6c [clang-offload-bundler] use std::forward_list for storing temp file names [NFC]
Use a different container that preserves existing elements on modification
for storing temporary file names. Current container can make StringRefs
returned earlier invalid on reallocation.

Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D92010
2020-11-24 08:07:31 -08:00
Nico Weber c8414fa941 lld: Fix darwinnew symlink name added in e16c0a9a68 2020-11-24 11:06:51 -05:00
Arthur O'Dwyer ee95c7020c [libc++] Remove _LIBCPP_CONSTEXPR_AFTER_CXX17_WITH_IS_CONSTANT_EVALUATED.
Zoe Carver says: "We decided that libc++ only supports C++20 constexpr algorithms
when `is_constant_evaluated` is also supported. Here's a link to the discussion."
https://reviews.llvm.org/D65721#inline-735682

Remove _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED from tests, too.
See Louis's 5911e6a885 if needed to fix bots.
I've applied `UNSUPPORTED: clang-8` preemptively to the altered tests;
I don't know for sure that this was needed, because no clang-8 buildbots
are triggered on pull requests.
2020-11-24 11:04:21 -05:00
Sam McCall 9e83d0bcdf [clangd] Mention when CXXThis is implicit in exposed AST.
Seeing an implicit this in the AST is pretty confusing I think.
While here, also mention when `this` is const.

Differential Revision: https://reviews.llvm.org/D91868
2020-11-24 16:57:56 +01:00
Nico Weber 5ce85e6635 Fix driver test from e16c0a9a68
The test failed silently if lld wasn't built alongside clang.
But the test uses -###, so the "invalid linker name in -fuse-ld=lld"
diag didn't make clang fail, and something else happened to match
"-demangle", so the test passed.

To fix, pass -B to a directory with two empty +x files (which works
on non-Windows), and look for `"-demangle"` instead of just `-demangle`.
Also force linker_version to 0 and pass a darwin triple.

Differential Revision: https://reviews.llvm.org/D92028
2020-11-24 10:51:08 -05:00
Evgeny Leviant 9c3b68dc6f [llvm-mca] Fix processing thumb instruction set
Differential revision: https://reviews.llvm.org/D91704
2020-11-24 18:27:59 +03:00
diggerlin c80fbdf291 [NFC][AIX][XCOFF] change function name from getNumofGPRsSaved to getNumOfGPRsSaved
change function name from getNumofGPRsSaved to getNumOfGPRsSaved for class XCOFFTracebackTable

Reviewers: Jason Liu
Differential Revision: https://reviews.llvm.org/D91882
2020-11-24 10:23:57 -05:00
Evgeny Leviant a6a6d11c7b [MC][ARM] Fix number of operands of tMOVSr
Differential revision: https://reviews.llvm.org/D92029
2020-11-24 18:13:10 +03:00
Nicolas Vasilache a8de412f51 [mlir] NFC - Expose an OffsetSizeAndStrideOpInterface
This revision will make it easier to create new ops base on the strided memref abstraction outside of the std dialect.

OffsetSizeAndStrideOpInterface is an interface for ops that allow specifying mixed dynamic and static offsets, sizes and strides variadic operands.
    Ops that implement this interface need to expose the following methods:
      1. `getArrayAttrRanks` to specify the length of static integer
          attributes.
      2. `offsets`, `sizes` and `strides` variadic operands.
      3. `static_offsets`, resp. `static_sizes` and `static_strides` integer
          array attributes.

    The invariants of this interface are:
      1. `static_offsets`, `static_sizes` and `static_strides` have length
          exactly `getArrayAttrRanks()`[0] (resp. [1], [2]).
      2. `offsets`, `sizes` and `strides` have each length at most
         `getArrayAttrRanks()`[0] (resp. [1], [2]).
      3. if an entry of `static_offsets` (resp. `static_sizes`,
         `static_strides`) is equal to a special sentinel value, namely
         `ShapedType::kDynamicStrideOrOffset` (resp. `ShapedType::kDynamicSize`,
         `ShapedType::kDynamicStrideOrOffset`), then the corresponding entry is
         a dynamic offset (resp. size, stride).
      4. a variadic `offset` (resp. `sizes`, `strides`) operand  must be present
         for each dynamic offset (resp. size, stride).

    This interface is useful to factor out common behavior and provide support
    for carrying or injecting static behavior through the use of the static
    attributes.

Differential Revision: https://reviews.llvm.org/D92011
2020-11-24 14:42:47 +00:00
Nico Weber e16c0a9a68 clang+lld: Improve clang+ld.darwinnew.lld interaction, pass -demangle
This patch:
- adds an ld64.lld.darwinnew symlink for lld, to go with f2710d4b57,
  so that `clang -fuse-ld=lld.darwinnew` can be used to test new
  Mach-O lld while it's in bring-up. (The expectation is that we'll
  remove this again once new Mach-O lld is the defauld and only Mach-O
  lld.)
- lets the clang driver know if the linker is lld (currently
  only triggered if `-fuse-ld=lld` or `-fuse-ld=lld.darwinnew` is
  passed). Currently only used for the next point, but could be used
  to implement other features that need close coordination between
  compiler and linker, e.g. having a diag for calling `clang++` instead
  of `clang` when link errors are caused by a missing C++ stdlib.
- lets the clang driver pass `-demangle` to Mach-O lld (both old and
  new), in addition to ld64
- implements -demangle for new Mach-O lld
- changes demangleItanium() to accept _Z, __Z, ___Z, ____Z prefixes
  (and updates one test added in D68014). Mach-O has an extra
  underscore for symbols, and the three (or, on Mach-O, four)
  underscores are used for block names.

Differential Revision: https://reviews.llvm.org/D91884
2020-11-24 08:51:58 -05:00
Ayal Zaks 32d9a386bf [LV] Keep Primary Induction alive when folding tail by masking
Fix PR47390.

The primary induction should be considered alive when folding tail by masking,
because it will be used by said masking; even when it may otherwise appear
useless: feeding only its own 'bump', which is correctly considered dead, and
as the 'bump' of another induction variable, which may wrongfully want to
consider its bump = the primary induction, dead.

Differential Revision: https://reviews.llvm.org/D92017
2020-11-24 15:12:54 +02:00
Yaxun (Sam) Liu cb08558caa [HIP] Fix regressions due to fp contract change
Recently HIP toolchain made a change to use clang instead of opt/llc to do compilation
(https://reviews.llvm.org/D81861). The intention is to make HIP toolchain canonical like
other toolchains.

However, this change introduced an unintentional change regarding backend fp fuse
option, which caused regressions in some HIP applications.

Basically before the change, HIP toolchain used clang to generate bitcode, then use
opt/llc to optimize bitcode and generate ISA. As such, the amdgpu backend takes
the default fp fuse mode which is 'Standard'. This mode respect contract flag of
fmul/fadd instructions and do not fuse fmul/fadd instructions without contract flag.

However, after the change, HIP toolchain now use clang to generate IR, do optimization,
and generate ISA as one process. Now amdgpu backend fp fuse option is determined
by -ffp-contract option, which is 'fast' by default. And this -ffp-contract=fast language option
is translated to 'Fast' fp fuse option in backend. Suddenly backend starts to fuse fmul/fadd
instructions without contract flag.

This causes wrong result for some device library functions, e.g. tan(-1e20), which should
return 0.8446, now returns -0.933. What is worse is that since backend with 'Fast' fp fuse
option does not respect contract flag, there is no way to use #pragma clang fp contract
directive to enforce fp contract requirements.

This patch fixes the regression by introducing a new value 'fast-honor-pragmas' for -ffp-contract
and use it for HIP by default. 'fast-honor-pragmas' is equivalent to 'fast' in frontend but
let the backend to use 'Standard' fp fuse option. 'fast-honor-pragmas' is useful since 'Fast'
fp fuse option in backend does not honor contract flag, it is of little use to HIP
applications since all code with #pragma STDC FP_CONTRACT or any IR from a
source compiled with -ffp-contract=on is broken.

Differential Revision: https://reviews.llvm.org/D90174
2020-11-24 08:10:06 -05:00
Hans Wennborg 38236656ab [docs] Try to make this bullet list in ThinLTO.rst actually be a bullet list 2020-11-24 14:08:42 +01:00
Ulysse Beaugnon 1eded173a9 [MLIR] Fix TableGen generator for attribute interfaces.
Use the correct interface base type name when generating attribute interfaces
with TabeGen.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D92023
2020-11-24 14:06:35 +01:00
Fraser Cormack ca1f2f2716 [RISCV] Combine GREVI sequences
This combine step performs the following type of transformation:

    rev.p a0, a0   # grevi a0, a0, 0b01
    rev2.n a0, a0  # grevi a0, a0, 0b10
    -->
    rev.n a0, a0   # grevi a0, a0, 0b11

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D91877
2020-11-24 12:07:13 +00:00
Kadir Cetinkaya f726101b62
[clangd] Fix shared-lib builds
Differential Revision: https://reviews.llvm.org/D91859
2020-11-24 13:05:20 +01:00
Simon Pilgrim 49e463ff80 [IR] Constant::getAggregateElement - early-out for ScalableVectorType
We can't call getNumElements() for ScalableVectorType types - just bail for now, although ConstantAggregateZero/UndefValue could return a reasonable value.

Fixes crash shown in OSS-Fuzz #25272 https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=25272
2020-11-24 12:03:27 +00:00
Eugene Zhulenev 3d95d1b477 [mlir] AsyncRuntime: fix concurrency bugs + fix exports in methods definitions
1. Move ThreadPool ownership to the runtime, and wait for the async tasks completion in the destructor.
2. Remove MLIR_ASYNCRUNTIME_EXPORT from method definitions because they are unnecessary in .cpp files, as only function declarations need to be exported, not their definitions.
3. Fix concurrency bugs in group emplace and potential use-after-free in token emplace.

Tested internally 10k runs in `async.mlir` and `async-group.mlir`.

Fixed: https://bugs.llvm.org/show_bug.cgi?id=48267

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D91988
2020-11-24 03:53:13 -08:00
Max Kazantsev 02fdbc3567 Revert "[NFC][SCEV] Generalize monotonicity check for full and limited iteration space"
This reverts commit 2734a9ebf4.

This patch appeared to not be a NFC. It introduced an execution path where
monotonicity check on limited space started relying in existing nsw/nuw
flags, which is illegal. The motivating test will follow-up.
2020-11-24 17:56:59 +07:00
Evgeny Leviant a2b59048d9 [SchedModels] Improve diagnostics. NFC 2020-11-24 13:52:32 +03:00
Alexander Belyaev fd92c5dbee [mlir][linalg] Add bufferization pattern for `linalg.indexed_generic`.
Differential Revision: https://reviews.llvm.org/D92014
2020-11-24 11:14:21 +01:00
AndreyChurbanov 7b5254223a [OpenMP] fix asm code for for arm64 (AARCH64) for Darwin/macOS
Adjusted external reference for Darwin/AARCH64 link compatibility.
Made size directive conditional only if __ELF__ defined.

Patch by Michael_Pique <mpique@icloud.com>

Differential Revision: https://reviews.llvm.org/D88252
2020-11-24 13:08:24 +03:00
Marek Kurdej 605be65c8b [libc++] [www] Fix HTML. NFC.
Needed for a future automatic update to RST.
2020-11-24 11:06:08 +01:00
Evgeny Leviant 78caf4f1bb [SchedModels] Limit set of predicates seen by mutuallyExclusive
Patch limits set of predicates seen by mutuallyExclusive to ones which belong
to current processor model. This needs to be done, because same predicate can
be used by multiple processor models which can make mutuallyExclusive over
optimistic.
2020-11-24 12:44:10 +03:00
Kai Luo 5931be60b5 [DAGCombine][PowerPC] Convert negated abs to trivial arithmetic ops
This patch converts `0 - abs(x)` to `Y = sra (X, size(X)-1); sub (Y, xor (X, Y))` for better codegen.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D91120
2020-11-24 09:43:35 +00:00
Georgii Rymar 6b74eabfdd [llvm-readelf/obj] - Refine the implementation of `printGNUVersionSectionProlog`
This:
1) Changes its signature.
2) Refines the name of local variable (`SymTabName`->`LinkedSecName`,
   because SHT_GNU_verneed/SHT_GNU_verdef are linked with the string table, not with the symbol table).
3) Stops using the `unwrapOrError` inside.

Differential revision: https://reviews.llvm.org/D91964
2020-11-24 11:56:22 +03:00
Georgii Rymar 245052ac30 [llvm-readelf/obj] - Improve the error reporting in printStackSize().
This stops using `RelocationRef` API in the `printStackSize` method
and starts using the "regular" API that is used in almost all other places
in ELFDumper.cpp.

This is not only makes the code to be more consistent, but helps to diagnose
issues better, because the `ELFObjectFile` API, which is used
currently to implement stack sized dumping sometimes has a behavior
that just doesn't work well for broken inputs.

E.g see how it gets the `symbol_end` iterator. It will just not work
well for a case when the `sh_size` is broken.

```
template <class ELFT>
basic_symbol_iterator ELFObjectFile<ELFT>::symbol_end() const {
...
  DataRefImpl Sym = toDRI(SymTab, SymTab->sh_size / sizeof(Elf_Sym));
  return basic_symbol_iterator(SymbolRef(Sym, this));
}
```

Differential revision: https://reviews.llvm.org/D91624
2020-11-24 11:49:00 +03:00
Evgeny Leviant 50bd686695 Add support for branch forms of ALU instructions to Cortex-A57 model
Patch fixes scheduling of ALU instructions which modify pc register. Patch
also fixes computation of mutually exclusive predicates for sequences of
variants to be properly expanded

Differential revision: https://reviews.llvm.org/D91266
2020-11-24 11:43:51 +03:00
Georgii Rymar c3914bf28e [[lvm-readelf/obj] - Remove `tryGetSectionName` helper.
D91867 introduced the `tryGetSectionName` helper.
But we have `getPrintableSectionName` member with the similar
behavior which we can reuse. This patch does it.

Differential revision: https://reviews.llvm.org/D91954
2020-11-24 11:34:27 +03:00
Nathan Ridge 5b6f47595b [clangd] Sort results of incomingCalls request by container name
Differential Revision: https://reviews.llvm.org/D92009
2020-11-24 03:29:02 -05:00
Alex Zinenko ee6255d207 [mlir] move lib/Bindings/Python/Attributes.td to include/mlir/Bindings/Python
This file is intended to be included by other files, including
out-of-tree dialects, and makes more sense in `include` than in `lib`.

Depends On D91652

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D91961
2020-11-24 09:19:01 +01:00
Haowei Wu 803745b945 [llvm-elfabi] Emit ELF .dynsym, .dynamic sections
This change makes llvm-elfabi tool to emit .dynsym and .dynamic
sections.

Differential Revision: https://reviews.llvm.org/D89432
2020-11-24 00:17:04 -08:00
Alex Zinenko 029e199dbf [mlir] Make attributes mutable in Python bindings
Attributes represent additional data about an operation and are intended to be
modifiable during the lifetime of the operation. In the dialect-specific Python
bindings, attributes are exposed as properties on the operation class. Allow
for assigning values to these properties. Also support creating new and
deleting existing attributes through the generic "attributes" property of an
operation. Any validity checking must be performed by the op verifier after the
mutation, similarly to C++. Operations are not invalidated in the process: no
dangling pointers can be created as all attributes are owned by the context and
will remain live even if they are not used in any operation.

Introduce a Python Test dialect by analogy with the Test dialect and to avoid
polluting the latter with Python-specific constructs. Use this dialect to
implement a test for the attribute access and mutation API.

Reviewed By: stellaraccident, mehdi_amini

Differential Revision: https://reviews.llvm.org/D91652
2020-11-24 09:16:25 +01:00
Martin Storsjö 0b2d84fba8 [LLD] [COFF] Allow wrapping dllimported functions
GNU ld doesn't seem to do this though, but it looks like a reasonable
use case, is easy to implement, and was requested in
https://bugs.llvm.org/show_bug.cgi?id=47384.

Differential Revision: https://reviews.llvm.org/D91689
2020-11-24 10:15:20 +02:00
Pavel Labath bce2ac9f6d Revert "[DebugInfo] Refactor code for emitting DWARF expressions for FP constants"
The commit introduced a crash when emitting (debug info for) complex
floats (pr48277).
2020-11-24 09:11:33 +01:00
Arthur Eubanks c3a331646e [test] Fix gvn-inline-iteration.ll under NPM 2020-11-23 23:46:31 -08:00