Commit Graph

430548 Commits

Author SHA1 Message Date
Simon Pilgrim ccc2a60bc8 [AArch64] Regenerate arm64-mul.ll test checks 2022-07-16 15:27:47 +01:00
Markus Böck 3dccac09a6 [mlir][NFC] Fully qualify typenames in SymbolInterfaces.td 2022-07-16 14:39:00 +02:00
David Green 4b7913c357 [VectorCombine] Only consider shuffle uses with the same type.
The backend getShuffleCosts do not currently handle shuffles that change
size very well. Limit the shuffles we collect to the same type to make
sure they do not cause issues as reported in D128732.
2022-07-16 13:23:39 +01:00
Simon Pilgrim 2bb6b03d71 Fix signed/unsigned mismatch 2022-07-16 11:48:41 +01:00
Simon Pilgrim a5d0122f75 [DAG] Canonicalize non-inlane shuffle -> AND if all non-inlane referenced elements are known zero
As mentioned on D127115, this patch that attempts to recognise shuffle masks that could be simplified to a AND mask - we already have a similar transform that will fold AND -> 'clear mask' shuffle, but this patch handles cases where the referenced elements are not from the same lane indices but are known to be zero.

Differential Revision: https://reviews.llvm.org/D129150
2022-07-16 11:38:24 +01:00
Tim Besard c71d77876f [MC] Avoid UAF in WinCOFFObjectWriter with weak symbols.
When using weak symbols, the WinCOFFObjectWriter keeps a list (`WeakDefaults`)
that's used to make names unique. This list should be reset when the object
writer is reset, because otherwise reuse of the object writer can result in
freed symbols being accessed. With some added output, this becomes clear when
using `llc` in `--run-twice` mode:

```
$ ./llc --compile-twice -mtriple=x86_64-pc-win32 trivial.ll -filetype=obj

DefineSymbol::WeakDefaults
 - .weak.foo.default
 - .weak.bar.default

DefineSymbol::WeakDefaults
 - .weak.foo.default
 - áÑJij⌂  p§┼Ø┐☺
 - .debug_macinfo.dw
 - .weak.bar.default
```

This does not seem to leak into the output object file though, so I couldn't
come up with a test. I added one that just does `--run-twice` (and verified
that it does access freed memory), which should result in detecting the
invalid memory accesses when running under ASAN.

Observed in a Julia PR where we started using weak symbols:
https://github.com/JuliaLang/julia/pull/45649

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D129840
2022-07-16 13:24:08 +03:00
Simon Pilgrim 1cb7416ee3 [DAG] combineShiftAnd1ToBitTest - match "and (srl (not X), C)), 1 --> (and X, 1<<C) == 0" patterns
combineShiftAnd1ToBitTest already matches "and (not (srl X, C)), 1 --> (and X, 1<<C) == 0" patterns, but we can end up with situations where the not is before the shift.

Part of some yak shaving for D127115 to generalise the "xor (X >> ShiftC), XorC --> (not X) >> ShiftC" fold.
2022-07-16 11:00:07 +01:00
Markus Böck 884d310d87 [mlir][LLVM] Add OpBuilder for opaque pointer GEPs without struct indices
An OpBuilder already exists for GEPs that does not have any struct indices for existing typed pointers, but no such builder exists for GEPs utilizing opaque pointers that has an explicit `basePtrType`.

Differential Revision: https://reviews.llvm.org/D129376
2022-07-16 10:55:49 +02:00
Fangrui Song f9d6f37201 [LegacyPM] Remove ControlHeightReductionLegacyPass
This pass tries to reduce the number of conditional branches in the hot path
based on profile. It's mostly a no-op after legacy PGO passes are moved.
2022-07-16 01:35:56 -07:00
Fangrui Song 3a42c499c2 [LegacyPM] Remove createInstrProfilingLegacyPass
Follow the steps of removing non-core instrumentation passes like PGO.
2022-07-16 01:26:40 -07:00
Fangrui Song 8658cf999d [test] Migrate PGO related -instrprof tests to new PM 2022-07-16 01:21:12 -07:00
Fangrui Song 59fafdd815 [test] Migrate FunctionImport/cg_profile.ll to new PM 2022-07-16 01:10:39 -07:00
Fangrui Song acead46a10 [test] Migrate legacy InstrProfiling tests to new PM 2022-07-16 01:10:08 -07:00
Kazu Hirata c715e2ff92 [flang] Use value_or (NFC) 2022-07-16 00:51:54 -07:00
Fangrui Song 685775bbab [LegacyPM] Remove CGProfileLegacyPass
It's mostly a no-op after I removed legacy PGO passes in D123834.
2022-07-16 00:39:56 -07:00
Itay Bookstein dcfaaef105 [SDAG] Add test for DAGCombiner multiple result commutative CSE
This commit adds a test for DAGCombiner commutative CSE on
nodes with multiple results (UMUL_LOHI). In this commit it
asserts the lack of CSE, a later commit will demonstrate
the CSE in the changed assertions.

Signed-off-by: Itay Bookstein <ibookstein@gmail.com>

Reviewed By: barannikov88

Differential Revision: https://reviews.llvm.org/D129905
2022-07-16 10:39:17 +03:00
Matthias Springer afb1def876 [mli][sparse] Remove manual dense dealloc from test case
Differential Revision: https://reviews.llvm.org/D129834
2022-07-16 09:28:27 +02:00
Uday Bondhugula 9819cbda0c [MLIR] Clean up checks for alloc-like ops in analysis
Clean up checks for alloc-like ops in analysis. Use the analysis
utility to properly check for the desired kind of effects. The previous
locality utility worked for all practical purposes but wasn't sound and
was locally duplicate code. Instead, use mlir::hasSingleEffect.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D129439
2022-07-16 12:54:47 +05:30
Kazu Hirata 009ab1728d [flang] Use *X instead of X.getValue() (NFC)
Per Flang C++ Style Guide, this patch replaces X.getValue() with *X
where *X is protected by a presence test.
2022-07-16 00:24:02 -07:00
Uday Bondhugula 9f7d80145a [MLIR] NFC. Clean up logic of hasSingleEffect
Clean up conditional logic of hasSingleEffect. NFC.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D129438
2022-07-16 12:39:32 +05:30
Kazu Hirata 5605a1eedd Use drop_begin (NFC) 2022-07-15 23:58:11 -07:00
Nimish Mishra 58753dea15 [flang][OpenMP] Fix warning due to uninitialized pointer dereference during atomic update lowering
Reviewed By: kiranchandramohan, kazu

Differential Revision: https://reviews.llvm.org/D129914
2022-07-16 12:23:37 +05:30
Stella Laurenzo 1d6a90418e Example:
```
// -----// IR Dump Before LowerLinalgMicrokernels (iree-vmvx-lower-linalg-microkernels) //----- //
```

I've been meaning to suggest this for a long time, and I think the only reason we don't have it is because we didn't used to have the `getArgument()` handy when printing these comments. When debugging or putting a pipeline together based on such dumps, I often find myself grepping for the argument name of the pass (which is often related but not universally).
2022-07-15 23:27:14 -07:00
Kazu Hirata 246bf08db3 Use drop_begin (NFC) 2022-07-15 23:24:59 -07:00
bzcheeseman f382dfc06b [MLIR][Liveness] Add `currentlyLiveValues`, a way to get a set of values that are live as of a given operation.
This change allows the user of LivenessBlockInfo to specify an op within the block and get a set of all values that are live as of that op. Semantically it relies on having a dominance-based region that has ordered operations. For DFG regions, computing liveness statically this way doesn't really make sense, it likely needs to be done at runtime.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D129447
2022-07-15 22:10:53 -07:00
Rainer Orth 74f6672e59 [sanitizer_common] Several Solaris procmaps fixes
Since the introduction of GoogleTest sharding in D122251
<https://reviews.llvm.org/D122251>, some of the Solaris sanitizer tests
have been running extremly long (up to an hour) while they took mere
seconds before.  Initial investigation suggests that massive lock
contention in Solaris procfs is involved here.

However, there's an easy way to somewhat reduce the impact: while the
current `ReadProcMaps` uses `ReadFileToBuffer` to read `/proc/self/xmap`,
that function primarily caters to Linux procfs reporting file sizes of 0
while the size on Solaris is accurate.  This patch makes use of that,
reducing the number of syscalls involved and reducing the runtime of
affected tests by a factor of 4.

Besides, it handles shared mappings and doesn't call `readlink` for unnamed
map entries.

Tested on `sparcv9-sun-solaris2.11` and `amd64-pc-solaris2.11`.

Differential Revision: https://reviews.llvm.org/D129837
2022-07-16 06:59:00 +02:00
Jez Ng fe47cfb324 [lld-macho][nfc] Add more tests + comments around ICF + unwind info interaction
While working on {D129830}, I realized that our handling of ICF +
eh_frame combined was untested. Additionally I realized that the comment
explaining why we were safely slicing away the functionAddress reloc
from our compact unwind entries was... insufficient and slightly
misleading. I've tried to clarify it.

Reviewed By: #lld-macho, thevinster

Differential Revision: https://reviews.llvm.org/D129894
2022-07-16 00:52:47 -04:00
Kazu Hirata 1a5d007659 Use has_value/value instead of hasValue/getValue (NFC) 2022-07-15 21:48:17 -07:00
Amir Ayupov 77b72fbc71 [BOLT][TEST] Add icp-inline.s test
Add a test for `-icp-inline` knob, which ensures that ICP is only performed for
functions that can be subsequently inlined.

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D129803
2022-07-15 20:49:26 -07:00
Kazu Hirata 5cff5142a8 Use value instead of getValue (NFC) 2022-07-15 20:03:13 -07:00
Kazu Hirata 3b0dce5b8b Use value_or (NFC) 2022-07-15 19:46:29 -07:00
Fangrui Song df8f5be596 [LegacyPM] Remove ModuleSanitizerCoverageLegacyPass
Follow the steps of various other legacy instrumentation passes removed for
15.0.0.
2022-07-15 19:01:20 -07:00
Ashay Rane 179588ea39
[mlir] remove unnecessary statements in test
A previous commit (f2b94bd) added some unnecessary statements that
dereferenced operations only to get the operations back.  This patch
removes the unnecessary statements.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D129913
2022-07-15 18:57:07 -07:00
Phoebe Wang f187948162 [X86][FP16] Enable vector support for FP16 emulation
This is follow up of D107082, which enable vector support according to psABI.

Reviewed By: skan

Differential Revision: https://reviews.llvm.org/D127982
2022-07-16 09:38:58 +08:00
Yuanfang Chen e97b2d4138 [lit][unit] add a test for sanitizer-only test failures
Follow-up for 6b02c53936.
2022-07-15 18:36:38 -07:00
Jeff Niu 7fe2294e47 [mlir][ods] Allow specifying return types of builders
This patch allows custom attribute and type builders to return
something other than the C++ type of the attribute or type.

This is useful for attributes or types that may perform extra work during
construction (e.g. canonicalization) that could result in a different
kind of attribute or type being returned.

Reviewed By: rriddle, lattner

Differential Revision: https://reviews.llvm.org/D129792
2022-07-15 18:00:35 -07:00
owenca a7789d6315 [clang-format][NFC] Replace SmallVector parameter with ArrayRef
Addresses https://reviews.llvm.org/D129466#3654410.
2022-07-15 17:26:22 -07:00
LLVM GN Syncbot c9e8c690ea [gn build] Port 4162aefad1 2022-07-16 00:15:08 +00:00
Mitch Phillips 4162aefad1 Revert "Re-apply 5acd471698, Add a shared-memory based orc::MemoryMapper, with fixes."
This reverts commit 32d8d23cd0.

Reason: Broke the UBSan buildbots. See more details on Phabricator:
https://reviews.llvm.org/D128544
2022-07-15 17:11:55 -07:00
Vitaly Buka 00b5a6eba1 [test] Fix old memory leak in a test 2022-07-15 16:56:20 -07:00
Yuanfang Chen ea7968bf76 [lit][test] explicitly use utf-8 encoding to write testing json file
Related test failure:
https://lab.llvm.org/buildbot/#/builders/178/builds/2527/steps/13/logs/FAIL__lit___googletest-timeout_py
2022-07-15 16:42:50 -07:00
Julian Lettner 32a425ec0c [Sanitizer][Darwin][NFC] Small SANITIZER_APPLE cleanup
We introduced `SANITIZER_APPLE` here: https://reviews.llvm.org/D126263
2022-07-15 16:31:35 -07:00
Argyrios Kyrtzidis 46a6989736 [unittests/Tooling/DependencyScannerTest.cpp] Use `using namespace` instead of wrapping the `.cpp` file contents in namespaces, NFC
This makes the file consistent with the coding style of the rest of LLVM.
2022-07-15 16:10:36 -07:00
Naje George 42129b66d7 [flang] Add semantics test for EVENT POST statement
Reviewed By: ktras

Differential Revision: https://reviews.llvm.org/D129515
2022-07-15 16:03:29 -07:00
Mahesh Ravishankar 3139cc766c [mlir][Linalg] Add a pattern to decompose `linalg.generic` ops.
This patch adds a pattern to decompose a `linalg.generic` operations
that
- has only parallel iterator types
- has more than 2 statements (including the yield)

into multiple `linalg.generic` operation such that each operation has
a single statement and a yield.
The pattern added here just splits the matching `linalg.generic` into
two `linalg.generic`s, one containing the first statement, and the
other containing the remaining. The same pattern can be applied
repeatedly on the second op to ultimately fully decompose the generic
op.

Differential Revision: https://reviews.llvm.org/D129704
2022-07-15 23:01:18 +00:00
Jon Chesterfield eda2bcad02 [nfc][amdgpu] Remove dead variable and function 2022-07-15 23:56:43 +01:00
Yuanfang Chen 6b02c53936 [lit][unit] make sure to include failed shard in test summary report
For sanitizer only failures, the tests all pass but still need to
put the shard in failed test summary.
2022-07-15 15:43:33 -07:00
Rong Xu 5e0443292b [PGO] Report number of counts being dropped when a hash-mismatch happens
This patch reports number of counts being dropped when a hash-mismatch
happens. This information will be helpful to the users -- if the dropped
counts are large, the user should redo the instrumentation build and
recollect the profile.

Differential Revision: https://reviews.llvm.org/D129001
2022-07-15 14:53:59 -07:00
Ashay Rane f2b94bd7ea
[mlir] check whether region and block visitors are interrupted
The visitor functions for `Region` and `Block` types did not always
check the value returned by recursive calls.  This caused the top-level
visitor invocation to return `WalkResult::advance()` even if one or more
recursive invocations returned `WalkResult::interrupt()`.  This patch
fixes the problem by check if any recursive call is interrupted, and if
so, return `WalkResult::interrupt()`.

Reviewed By: dcaballe

Differential Revision: https://reviews.llvm.org/D129718
2022-07-15 14:50:42 -07:00
Joseph Huber bb957a8d52 [CUDA] Make the new driver properly ignore non-CUDA inputs
The new driver generated offloadinga actions for each active toolchain.
However, for CUDA and HIP it is possible for the toolchain to be active
but one of the files is not a valid input. This can occur if the user
compiles both a CUDA and C source file in the same compiler invocation.
This patch adds some simple logic to quit if the input is not valid as
well.

Reviewed By: tra, MaskRay

Differential Revision: https://reviews.llvm.org/D129885
2022-07-15 17:38:34 -04:00