Commit Graph

406005 Commits

Author SHA1 Message Date
Zarko Todorovski c379911a94 [NFC][Clang]Inclusive language: Replace uses of whitelist in clang/test 2021-11-30 15:06:04 -05:00
Snehasish Kumar 1cf11df591 [memprof] Disable pedantic warnings, suppress variadic macro warning.
The memprof unit tests use an older version of gmock (included in the
repo) which does not build cleanly with -pedantic:
https://github.com/google/googletest/issues/2650
For now just silence the warning by disabling pedantic and add the
appropriate flags for gcc and clang.
2021-11-30 12:03:19 -08:00
not-jenni 13bdb7ab4a [mlir][tosa] Add tosa.conv2d as fully_connected canonicalization
For a 1x1 weight and stride of 1, the input/weight can be reshaped and passed into a fully connected op then reshaped back

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D114757
2021-11-30 12:01:14 -08:00
Jameson Nash 2e114e3fda fix inverted logic for HideUnrelatedOptions
It seems clearer to me that this would check for *any of* instead of
*all of* these option categories, as it looks to me like that was the
intent. But apparently this logic has always has been inverted, and
possibly never fully used?

Differential Revision: https://reviews.llvm.org/D114572
2021-11-30 14:56:22 -05:00
Michael Jones 155f5a6dac [libc][clang-tidy] fix namespace check for externals
Up until now, all references to `errno` were marked with `NOLINT`, since
it was technically calling an external function. This fixes the lint
rules so that `errno`, as well as `malloc`, `calloc`, `realloc`, and
`free` are all allowed to be called as external functions. All of the
relevant `NOLINT` comments have been removed, and the documentation has
been updated.

Reviewed By: sivachandra, lntue, aaron.ballman

Differential Revision: https://reviews.llvm.org/D113946
2021-11-30 11:44:24 -08:00
Snehasish Kumar a2ce97cc3f [memprof] Fix unit test build after refactoring shared header.
The memprof unittest also needs to include the MemProfData.inc header
directly to have access to MEMPROF_RAW_MAGIC and MEMPROF_RAW_VERSION
globals.
2021-11-30 11:35:42 -08:00
Fangrui Song ad45df91ad [ELF][PPC64] Remove unneeded PPC64PCRelLongBranchThunk
This reverts the PPC64PCRelLongBranchThunk part from D86706.
PPC64PCRelLongBranchThunk is the same as PPC64R12SetupStub.

Use `__gep_setup_` instead of `__long_branch_pcrel_` for the stub symbol name
as it more closely indicates the operation.
(Note: GNU ld uses `*.long_branch.*` and `*.plt_branch.*`).

Reviewed By: NeHuang, nemanjai

Differential Revision: https://reviews.llvm.org/D114656
2021-11-30 11:33:17 -08:00
Jonas Devlieghere 4fa9e43520 [lldb] Fix indentation in builders/darwin.py 2021-11-30 11:28:52 -08:00
Jonas Devlieghere 0a302f6667 [lldb] Search PrivateFrameworks when using an internal SDK
Make sure to add the PrivateFrameworks directory to the frameworks path
when using an internal SDK. This is necessary for the "on-device" test
suite.

rdar://84519268

Differential revision: https://reviews.llvm.org/D114742
2021-11-30 11:28:19 -08:00
Sanjay Patel 4b30076f16 [InstSimplify] add logic fold for 'or'
https://alive2.llvm.org/ce/z/4PaPDy

There's a related fold where the inner 'or' is replaced by 'and',
but that needs to be more careful about matching a 'not'.
2021-11-30 14:08:54 -05:00
Sanjay Patel c49ef1448d [InstSimplify] reduce code duplication for 'or' logic folds; NFC 2021-11-30 14:08:54 -05:00
Sanjay Patel 6076c1dc1c [InstSimplify] make 'or' test names more descriptive; NFC
Also, vary the types in a couple of tests for better coverage.
2021-11-30 14:08:54 -05:00
Fangrui Song 8c3641d03e [ELF] Change -z unknown from error to warning
There is a trend of having more optional options (usually security
hardening related) like -z cet-report=, -z bti-report=, -z force-bti.
If ld.lld 14.0.0 uses a warning, in 15/16/17/... timeframe when people
add new options to software, they can worry less about linker errors on ld.lld 14.0.0.

In some cases `-z foo` does essential work where a silent ignore can be
problematic, but the user has received a warning. From my observation, the
doing-essential-work `-z foo` is much fewer than the converse. In addition,
the user who cares can use `--fatal-warnings` (Note: GNU ld doesn't upgrade warnings to errors).
It is unclear whether we need something like `clang -Wunknown-warning-option`.

If we ever run into unfortunate transition like `-z start-stop-gc`, the
affected software (e.g. ldc is a compiler which passes linker options to the underlying ld)
can blindly add the `-z` option, without worrying it may cause a linker error to LLD 14.0.0.

Reviewed By: jrtc27, peter.smith

Differential Revision: https://reviews.llvm.org/D114748
2021-11-30 11:06:28 -08:00
LLVM GN Syncbot 299cec3c51 [gn build] Port 7cca33b40f 2021-11-30 18:46:43 +00:00
Snehasish Kumar 7cca33b40f [memprof] Extend llvm-profdata to display MemProf profile summaries.
This commit adds initial support to llvm-profdata to read and print
summaries of raw memprof profiles.
Summary of changes:
* Refactor shared defs to MemProfData.inc
* Extend show_main to display memprof profile summaries.
* Add a simple raw memprof profile reader.
* Add a couple of tests to tools/llvm-profdata.

Differential Revision: https://reviews.llvm.org/D114286
2021-11-30 10:45:26 -08:00
Peter Klausler 8bc593cbbb [flang] Address TODO from previous changes to IsSaved()
An earlier fix to evaluate::IsSaved() needed to preserve its
treatment of named constants in modules and main programs -- i.e.
they would appear to be saved -- until a correction was added
to the lowering code.  This TODO can now be resolved.

Differential Revision: https://reviews.llvm.org/D114756
2021-11-30 10:39:51 -08:00
Hans Wennborg c0b33a65f2 Typo fix 2021-11-30 19:26:59 +01:00
Alexey Bataev dce6c434ea [SLP]Improve isFixedVectorShuffle and its use.
Extended support for undefined source vector/extract indices/non-fixed
vector types, also no need to check for the parent of the extractelement
instructions with the constant indicies.

Differential Revision: https://reviews.llvm.org/D114121
2021-11-30 10:10:20 -08:00
Sanjay Patel 7a7c059d86 [InstSimplify] reduce code duplication for 'or' logic fold; NFC 2021-11-30 12:55:37 -05:00
Sanjay Patel 33f8c1168f [InstSimplify] adjust tests for 'or' of logic ops; NFC
Half of the tests had an extra instruction so were not testing the minimal patterns.
2021-11-30 12:55:37 -05:00
Sanjay Patel 8dec0b23da [InstSimplify] refactor 'or' logic folds; NFC
Reduce duplication for handling the top-level commuted operands.
There are several other folds that should be moved in here, but
we need to make sure there's good test coverage.
2021-11-30 12:55:36 -05:00
Sanjay Patel 1fdb0f6ffd [InstSimplify] add tests for 'or' with logic ops; NFC
The code for these transforms can be refactored,
but the existing tests are incomplete.
2021-11-30 12:55:36 -05:00
Sanjay Patel 746e632daf [InstSimplify] add tests for 'or' logic folds; NFC
The tests are adapted from the xor patterns used with:
892648b18a
b326c05814
2021-11-30 12:55:36 -05:00
Alexey Bataev fc57cfad3c [SLP][NFC]Move static function to make it visible in member function,
NFC.
2021-11-30 09:38:46 -08:00
Nikita Popov 40d5eeac6c Revert "Use VersionTuple for parsing versions in Triple. This makes it possible to distinguish between "16" and "16.0" after parsing, which previously was not possible."
This reverts commit 1e82864670.

llvm/test/Transforms/LoopStrengthReduce/X86/2009-11-10-LSRCrash.ll fails
with assertion failure:

llc: /home/nikic/llvm-project/llvm/include/llvm/ADT/Optional.h:196: T& llvm::optional_detail::OptionalStorage<T, true>::getValue() & [with T = unsigned int]: Assertion `hasVal' failed.
...
 #8 0x00005633843af5cb llvm::MCStreamer::emitVersionForTarget(llvm::Triple const&, llvm::VersionTuple const&)
 #9 0x0000563383b47f14 llvm::AsmPrinter::doInitialization(llvm::Module&)
2021-11-30 18:36:32 +01:00
kpyzhov a356dae74c [RegionPass] Added check for -filter-print-funcs option to the region IR dumps.
Differential Revision: https://reviews.llvm.org/D114310
2021-11-30 12:30:15 -05:00
Nikita Popov 37d72991c1 [SCEV] Track and invalidate ValuesAtScopes users
ValuesAtScopes maps a SCEV and a Loop to another SCEV. While we
invalidate entries if the left-hand SCEV is invalidated, we
currently don't do this for the right-hand SCEV. Fix this by
tracking users in a reverse map and using it for invalidation.

This is conceptually the same change as D114738, but using the
reverse map to avoid performance issues.

Differential Revision: https://reviews.llvm.org/D114788
2021-11-30 18:21:14 +01:00
Steven Wu c737d4d203 [JITLink][ELF] Don't skip sections of size 0
Size 0 sections can have symbols that have size 0. Build those sections
and symbols into the LinkGraph so they can be used properly if needed.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D114749
2021-11-30 09:19:14 -08:00
Steven Wu 5e3200f3ce [JITLink][ELF] Add support for reading extended table
Add support for reading extended table in ELF object file. This allows
JITLink to support ELF object files with many sections.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D114747
2021-11-30 09:18:42 -08:00
Hongtao Yu bf317f6698 [CSSPGO] Sorting nodes in a cycle of profiled call graph.
For nodes that are in a cycle of a profiled call graph, the current order the underlying scc_iter computes purely depends on how those nodes are reached from outside the SCC and inside the SCC, based on the Tarjan algorithm. This does not honor profile edge hotness, thus does not gurantee hot callsites to be inlined prior to cold callsites. To mitigate that, I'm adding an extra sorter on top of scc_iter to sort scc functions in the order of callsite hotness, instead of changing the internal of scc_iter.

Sorting on callsite hotness can be optimally based on detecting cycles on a directed call graph, i.e, to remove the coldest edge until a cycle is broken. However, detecting cycles isn't cheap. I'm using an MST-based approach which is faster and appear to deliver some performance wins.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D114204
2021-11-30 09:01:08 -08:00
Paul Robinson b8e03be88d [PS4][DWARF] Explicitly set default DWARF version to 4 2021-11-30 08:58:40 -08:00
Benjamin Kramer fd1d8e45f4 [clang][dataflow] Make header parse
Looks like this is actually dead code?
2021-11-30 17:53:19 +01:00
Philip Reames c41b318423 [LV] Remove unneeded cast to Operator [NFC] 2021-11-30 08:45:13 -08:00
Ryan Mansfield 455a2b824d Fix file extension of alignment-assumption-ignorelist.cppp test
During the renaming of blacklist to ignorelist this test got renamed
incorrectly.

Differential revision: https://reviews.llvm.org/D114710
2021-11-30 17:21:46 +01:00
Mateja Marjanovic ca57b80cd6 Code quality: Combine V_RSQ
Combine V_RCP and V_SQRT into V_RSQ on AMDGPU for GlobalISel.

Change-Id: I93c5dcb412483156a6e8b68c4085cbce83ac9703
2021-11-30 17:17:15 +01:00
Valentin Clement 3cc21ee6b9
Revert "[fir] Add fir reduction builder"
This reverts commit cf3422d3df.

This fails on some buildbots
2021-11-30 17:15:42 +01:00
Valentin Clement eb97c89cac
[fir] Remove unused fct recordTypeCanBeMemCopied
Remove unused fct added with 47f759309e
2021-11-30 17:02:25 +01:00
gysit c8f2139eb0 [mlir][linalg] Add decompose to CodegenStrategy.
Add the decompose patterns that lower higher dimensional convolutions to lower dimensional ones to CodegenStrategy and use CodegenStrategy to test the decompose patterns. Additionally, remove the assertion that checks the anchor op name is set in the CodegenStrategyTest pass. Removing the assertion allows us to simplify the pipelines used in the interchange and decompose tests.

Depends On D114797

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114798
2021-11-30 15:48:29 +00:00
gysit 98dbcff19c [mlir][linalg] Adapt the decompose patterns to use a filter (NFC).
The revision updates the convolution decomposition patterns to take a linalg transformation filter. The transformation filter in a later revision allows use the patterns from CodegenStrategy.

Depends On D114690

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114797
2021-11-30 15:46:10 +00:00
James Farrell 1e82864670 Use VersionTuple for parsing versions in Triple. This makes it possible to distinguish between "16" and "16.0" after parsing, which previously was not possible.
See also https://github.com/android/ndk/issues/1455.

Differential Revision: https://reviews.llvm.org/D114163
2021-11-30 15:44:23 +00:00
Florian Hahn c9ad356266
[DSE] Use optimized access if available for redundant store elimination.
Using the optimized access enables additional optimizations in cases
where the defining access is a non-aliasing store.

Alternatively we could also walk upwards and skip non-aliasing defs
here, but my experiments so far showed that this will noticeably
increase compile-time for little extra gain compared to just using the
optimized access.

Improvements of dse.NumRedundantStores on MultiSource/CINT2006/CPF2006
on X86 with -O3:

     test-suite...-typeset/consumer-typeset.test     1.00                  76.00              7500.0%
     test-suite.../Benchmarks/Bullet/bullet.test     3.00                  12.00              300.0%
     test-suite...006/453.povray/453.povray.test     3.00                   6.00              100.0%
     test-suite...telecomm-gsm/telecomm-gsm.test     1.00                   2.00              100.0%
     test-suite...ediabench/gsm/toast/toast.test     1.00                   2.00              100.0%
     test-suite...marks/7zip/7zip-benchmark.test     1.00                   2.00              100.0%
     test-suite...ications/JM/lencod/lencod.test     7.00                  10.00              42.9%
     test-suite...6/464.h264ref/464.h264ref.test     6.00                   8.00              33.3%
     test-suite...ications/JM/ldecod/ldecod.test     6.00                   7.00              16.7%
     test-suite...006/447.dealII/447.dealII.test    33.00                  33.00               0.0%
     test-suite...6/471.omnetpp/471.omnetpp.test    NaN                     1.00               nan%
     test-suite...006/450.soplex/450.soplex.test    NaN                     2.00               nan%
     test-suite.../CINT2006/403.gcc/403.gcc.test    NaN                     7.00               nan%
     test-suite...lications/ClamAV/clamscan.test    NaN                     1.00               nan%
     test-suite...CI_Purple/SMG2000/smg2000.test    NaN                     3.00               nan%

Follow-up to D111727.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D112315
2021-11-30 15:40:14 +00:00
gysit 316e627c2b [mlir][linalg] Support the empty anchor op string when padding.
Add support for an empty anchor op string in vectorization. An empty anchor op string is useful after fusion when there are multiple different operations to vectorize.

Depends On D114689

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114690
2021-11-30 15:32:13 +00:00
Yitzhak Mandelbaum 3e32f827e2 [clang][dataflow] Fix broken build in ClangStaticAnalyzer
Adds a missing virtual destructor.
2021-11-30 15:31:49 +00:00
gysit 7f7103cd06 [mlir][linalg] Use top down traversal for padding.
Pad the operation using a top down traversal. The top down traversal unlocks folding opportunities and dim op canonicalizations due to the introduced extract slice operation after the padded operation.

Depends On D114585

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114689
2021-11-30 15:30:45 +00:00
David Green 9e8a71caf0 [DAG] Create fptosi.sat from clamped fptosi
This adds a fold in DAGCombine to create fptosi_sat from sequences for
smin(smax(fptosi(x))) nodes, where the min/max saturate the output of
the fp convert to a specific bitwidth (say INT_MIN and INT_MAX). Because
it is dealing with smin(/smax) in DAG they may currently be ISD::SMIN,
ISD::SETCC/ISD::SELECT, ISD::VSELECT or ISD::SELECT_CC nodes which need
to be handled similarly.

A shouldConvertFpToSat method was added to control when converting may
be profitable. The original fptosi will have a less strict semantics
than the fptosisat, with less values that need to produce defined
behaviour.

This especially helps on ARM/AArch64 where the vcvt instructions
naturally saturate the result.

Differential Revision: https://reviews.llvm.org/D111976
2021-11-30 15:29:14 +00:00
gysit 1ae7342a7d [mlir][linalg] Fix windows build issue in hoist padding.
Iterating backwardSlice and removing elements at the same time can fail on windows for specific build configurations (the code was introduced in https://reviews.llvm.org/D114420). This revision introduces a second vector to collect all operations and removes them after finishing the reverse iteration.

Reviewed By: hpmorgan

Differential Revision: https://reviews.llvm.org/D114775
2021-11-30 15:21:53 +00:00
Joseph Huber 7986a5f23e [OpenMP] Add RTL function to externalization RAII
This patch adds the `__kmpc_get_warp_size` OpenMP RTL function to the
externalization RAII struct. This was getting optimized out and then
being replaced with an undefined value once added back in, causing bugs
for complex reductions.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D114802
2021-11-30 10:19:06 -05:00
gysit 914e72d400 [mlir][linalg] Run CSE after every CodegenStrategy transformation.
Add CSE after every transformation. Transformations such as tiling introduce redundant computation, for example, one AffineMinOp for every operand dimension pair. Follow up transformations such as Padding and Hoisting benefit from CSE since comparing slice sizes simplifies to comparing SSA values instead of analyzing affine expressions.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114585
2021-11-30 15:07:51 +00:00
Vy Nguyen 74cbd71072 [lld-macho] Mark dylib symbols coming from -weak_framework as weak-ref.
PR:52564

Differential Revision: https://reviews.llvm.org/D114397
2021-11-30 09:54:59 -05:00
Valentin Clement cf3422d3df
[fir] Add fir reduction builder
This patch introduces a bunch of builder functions
to create function calls to runtime reduction functions.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: mleair <leairmark@gmail.com>

Differential Revision: https://reviews.llvm.org/D114460

Reviewed By: awarzynski
2021-11-30 15:52:30 +01:00