Commit Graph

414856 Commits

Author SHA1 Message Date
Craig Topper e72fe654b7 [DAGCombiner] Use getShiftAmountConstant in DAGCombiner::foldSelectOfConstants.
This enables fshl to be matched earlier on X86

  %6 = lshr i32 %3, 1
  %7 = select i1 %4, i32 -2147483648, i32 0
  %8 = or i32 %6, %7

X86 uses i8 for shift amounts. SelectionDAGBuilder creates the
ISD::SRL with an i8 shift type. DAGCombiner turns the select into
an ISD::SHL. Prior to this patch it would use i32 for the shift
amount. fshl matching failed because the shift amounts have different
types. LegalizeDAG fixes the ISD::SHL shift amount to i8. This
allowed fshl matching to succeed.

With this patch, the ISD::SHL will be created with an i8 shift
amount. This allows the fshl to match immediately.

No test case beause we still end up with a fshl either way.
2022-02-13 19:09:26 -08:00
zhongyunde b2f5164deb [IVDescriptors] Support FOR where we have multiple sink pointed
Handles the case where Previous doesn't come before LastPrev incorrectly.
Fix https://github.com/llvm/llvm-project/issues/53483

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D118558
2022-02-14 09:30:35 +08:00
Teresa Johnson 273600b6e3 [sanitizer] Second test fix to tolerate chmod not working as intended
Second attempt to fix a bot failure from
634da7a1c6 on an Android bot:
https://lab.llvm.org/buildbot#builders/77/builds/14339

With the fix in 986afe8479 there was a
different issue, because we need the fully qualified path name to the
binary, which is only available in arg[0]. New failure:
https://lab.llvm.org/buildbot/#/builders/77/builds/14346/steps/16/logs/stdio

Restructure the test so both attempts are made from the same invocation,
which sets up the bad paths directly.
2022-02-13 17:03:04 -08:00
Simon Pilgrim 890beda4e1 [X86] combineArithReduction - pull out (near) duplicate v4i8/v8i8 widening code. NFC. 2022-02-13 21:02:50 +00:00
Marek Kurdej 09559bc59a Avoid a vulgarism. NFC. 2022-02-13 22:01:06 +01:00
Marek Kurdej 25282bd6c4 [clang-format] Handle PointerAlignment in `if` and `switch` statements with initializers (C++17) the same way as in `for` loops.
Reviewed By: MyDeveloperDay, owenpan

Differential Revision: https://reviews.llvm.org/D119650
2022-02-13 21:36:58 +01:00
Marek Kurdej 9cb9445979 [clang-format] Correctly format loops and `if` statements even if preceded with comments.
Fixes https://github.com/llvm/llvm-project/issues/53758.

Braces in loops and in `if` statements with leading (block) comments were formatted according to `BraceWrapping.AfterFunction` and not `AllowShortBlocksOnASingleLine`/`AllowShortLoopsOnASingleLine`/`AllowShortIfStatementsOnASingleLine`.

Previously, the code:
```
while (true) {
  f();
}
/*comment*/ while (true) {
  f();
}
```

was incorrectly formatted to:
```
while (true) {
  f();
}
/*comment*/ while (true) { f(); }
```

when using config:
```
BasedOnStyle: LLVM
BreakBeforeBraces: Custom
BraceWrapping:
  AfterFunction: false
AllowShortBlocksOnASingleLine: false
AllowShortLoopsOnASingleLine: false
```

and it was (correctly but by chance) formatted to:
```
while (true) {
  f();
}
/*comment*/ while (true) {
  f();
}
```

when using enabling brace wrapping after functions:
```
BasedOnStyle: LLVM
BreakBeforeBraces: Custom
BraceWrapping:
  AfterFunction: true
AllowShortBlocksOnASingleLine: false
AllowShortLoopsOnASingleLine: false
```

Reviewed By: MyDeveloperDay, HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D119649
2022-02-13 21:22:17 +01:00
Teresa Johnson 986afe8479 [sanitizer] Fix test to tolerate chmod not working as intended
Attempts to fix a bot failure from
634da7a1c6 on an Android bot:
https://lab.llvm.org/buildbot#builders/77/builds/14339

It appears that the chmod is not making the directory unwritable as
expected on this system for some reason. Adopt an approach used in
compiler-rt/test/fuzzer/fuzzer-dirs.test for systems with
non-functioning chmod by including illegal characters in directory.
2022-02-13 11:56:08 -08:00
Simon Pilgrim 06df1a2eff [X86] vector-reduce-add-sext - add sum of (sign-extended) bool vector tests 2022-02-13 19:40:07 +00:00
Markus Böck e101eb5c7b [llvm][doc] Add Aarch64 to list of architectures supporting statepoints
Fixes https://github.com/llvm/llvm-project/issues/53655

Differential Revision: https://reviews.llvm.org/D119659
2022-02-13 20:35:15 +01:00
Simon Pilgrim 22e2c72b15 [X86] Add AVX512 tests to AVX common check prefix 2022-02-13 19:23:16 +00:00
Dmitry Vassiliev d97d4d8d75 [NFC][IR] Value: assert this->takeName(this)
Need to add an assert about this->takeName(this). This restriction is already documented, so this is just an NFC check.
Without this assertion (as prescribed by original comments for this API), name deletion or down-stream assert failures may occur in other routines: e.g. at the beginning of replaceAllUsesWith() below.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D119636
2022-02-13 21:47:37 +03:00
Ivan Butygin cd0d095c07 [mlir][tensor] Check ops generated by InsertSliceOpCastFolder are valid
Fixes https://github.com/llvm/llvm-project/issues/53099

Differential Revision: https://reviews.llvm.org/D119663
2022-02-13 21:37:31 +03:00
Arthur Eubanks a9029a33ff [OpaquePtr][ValueTracking] Check GEP source element type in isPointerOffset()
Fixes a MemCpyOpt miscompile with opaque pointers.
This function can be further cleaned up, but let's just fix the miscompile first.

Reviewed By: #opaque-pointers, nikic

Differential Revision: https://reviews.llvm.org/D119652
2022-02-13 10:35:38 -08:00
Kazu Hirata d5f7ae7bfe [IR] Use default member initialization in IRBuilderBase (NFC) 2022-02-13 10:34:05 -08:00
Kazu Hirata befeb5acf6 [Transforms] Use default member initialization in MemmoveVerifier (NFC) 2022-02-13 10:34:03 -08:00
Kazu Hirata fd3e8044cd [Transforms] Use default member initialization in Prefetch (NFC) 2022-02-13 10:34:02 -08:00
Kazu Hirata 0b9a610a75 [Transforms] Use default member initialization in ConditionInfo (NFC) 2022-02-13 10:34:00 -08:00
Kazu Hirata 930bf4e7bd [Support] Use default member initialization in circular_raw_ostream (NFC) 2022-02-13 10:33:58 -08:00
Kazu Hirata fda6a1ad42 [Transforms] Use default member initialization in CHRStats (NFC) 2022-02-13 10:33:56 -08:00
Keith Smiley 0782778c9e [test][ObjectYAML][MachO] Fix assertion syntax
This wasn't running because of the missing colon
2022-02-13 10:06:53 -08:00
Nathan Chancellor 22eb1dae3f
Revert "[AArch64] Adds SUBS and ADDS instructions to the MIPeepholeOpt."
This reverts commit af45d0fd94.

This causes assertions failures when compiling the Linux kernel. See
https://reviews.llvm.org/D118663 for a reduced reproducer.
2022-02-13 10:40:23 -07:00
Keith Smiley a6e1b3c5c2 [ObjectYAML][MachO] Add LC_FUNCTION_STARTS support
This adds support for encoding and decoding the LC_FUNCTION_STARTS load
command payload.

Differential Revision: https://reviews.llvm.org/D119205
2022-02-13 09:24:47 -08:00
Benjamin Kramer c45c53bbae [Shape] Simplify getShapeVec a bit. NFCI. 2022-02-13 16:58:16 +01:00
Teresa Johnson 634da7a1c6 [sanitizer] Check if directory exists before trying to create
Add a DirExists mechanism, modeled after FileExists. Use it to guard
creation of the report path directory.

This should avoid failures running the sanitizer in a sandbox where the
file creation attempt causes hard failures, even for an existing
directory. Problem reported on D109794 for ChromeOS in sandbox
(https://issuetracker.google.com/209296420).

Differential Revision: https://reviews.llvm.org/D119495
2022-02-13 06:59:32 -08:00
Simon Pilgrim 0e4ecfaf5a [X86] Add test for PR38788 missing PTEST fold 2022-02-13 13:43:42 +00:00
Sanjay Patel c486b82cfb [x86] try harder to scalarize a vector load with extracted integer op uses
This is a retry of b4b97ec813 - that was reverted because it
could cause miscompiles by illegally reordering memory operations.
A new test based on #53695 is added here to verify we do not have
that same problem.

extract_vec_elt (load X), C --> scalar load (X+C)

As noted in the comment, DAGCombiner has this fold -- and the code in this
patch is adapted from DAGCombiner::scalarizeExtractedVectorLoad() -- but
x86 should benefit even if the loaded vector has other uses as long as we
apply some other x86-specific conditions. The motivating example from #50310
is shown in vec_int_to_fp.ll.

Fixes #50310
Fixes #53695

Differential Revision: https://reviews.llvm.org/D118376
2022-02-13 08:32:21 -05:00
Simon Pilgrim 83ccce6ced [X86] Add some add reduction tests when we're extending from a smaller type
This often occurs when the accumulator is larger than the source vector element, such as some of the tests mentioned in Issue #42019
2022-02-13 13:27:00 +00:00
Simon Pilgrim 4b43209683 [clang][sema] Use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointers are referenced immediately, so assert the cast is correct instead of returning nullptr
2022-02-13 13:14:05 +00:00
Aaron Ballman 1ea584377e A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,

  void func();

becomes

  void func(void);

This is the ninth batch of tests being updated (there are a
significant number of other tests left to be updated).
2022-02-13 08:03:40 -05:00
Florian Hahn d462e64754
[LV] Drop noalias from check lines from test (NFC).
The noalias metadata checks re not really relevant for the test and
slight changes to metadata numbering can have large knock-on effects
causing large noise in test diff.
2022-02-13 11:36:54 +00:00
Harshil Jain bea53eead1 The device expression must evaluate to a non-negative integer value.
Device clause when it occurs with **target enter data** and **target exit data** must be declared with some non negative value. So some changes were made to evaluate the device clause argument to non negative value and throw the expected error when it takes negative value as argument.

Reviewed By: clementval

Differential Revision: https://reviews.llvm.org/D119141
2022-02-13 16:51:19 +05:30
Florian Hahn 446e7c64c7
[LV] Add real uses in some tests, to make them more robust.
Add real uses to some tests, to ensure dead instructions cannot be directly
removed.
2022-02-13 09:52:59 +00:00
Sheng bf7f8d6fa6 [NFC][RFC][TableGen] Improve the comment about variable len encoder
When, for example, using "ascend" operator, I was wondering whether
the bit order of the dag argument will be reversed in ascend order
as well.

This patch clarifies it.

Reviewed By: myhsu

Differential Revision: https://reviews.llvm.org/D119653
2022-02-13 13:15:17 +08:00
Sheng 5fd28e4de1 [NFC][M68k] Fix typo 2022-02-13 13:10:11 +08:00
Fangrui Song 8b01b638d0 [ELF] demoteSharedSymbols: make binding more appropriate for lazy symbols. NFC
The binding will matter if we remove the `sym->replace(und)` kludge from
initializeSymbols.
While here, rename the function to be more appropriate.
2022-02-12 20:43:40 -08:00
Sheng b9a18aa63b [NFC][M68k] Fix indentation 2022-02-13 11:47:35 +08:00
Shilei Tian c27f530d4c [OpenMP][Offloading] Fix infinite loop in applyToShadowMapEntries
This patch fixes the issue that the for loop in `applyToShadowMapEntries`
is infinite because `Itr` is not incremented in `CB`. Fixes #53727.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D119471
2022-02-12 22:02:53 -05:00
Phoebe Wang 2aa732a918 [X86][MS] Fix the wrong alignment of vector variable arguments on Win32
D108887 fixed alignment mismatch by changing the caller's alignment in
ABI. However, we found some cases that still assume the alignment is
vector size. This patch fixes them to avoid the runtime crash.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D114536
2022-02-13 10:23:18 +08:00
Arthur Eubanks d050010ea2 [test][MemCpyOpt] Rename test function 2022-02-12 17:44:51 -08:00
Arthur Eubanks 12ba0659b4 [test][MemCpyOpt] Precommit test 2022-02-12 17:38:45 -08:00
Joe Loser 861386dbd6
[libc++] Remove <experimental/filesystem> header
`<filesystem>` header has been around for a while now, so we can safely remove
`<experimental/filesystem>` header. `_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`
suggests we were going to remove `<experimental/filesystem>` in llvm 11 release,
but we never did. So, remove the experimental header now, its associated tests,
and the `_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM` macro.

Differential Revision: https://reviews.llvm.org/D119603
2022-02-12 19:43:57 -05:00
Simon Pilgrim ea071884b0 [SLP][X86] Add common check prefix for horizontal reduction tests 2022-02-12 21:48:31 +00:00
Craig Topper 478c237e21 [RISCV] Fix incorrect extend type in vwmulsu combine.
While matching widening multiply, if we matched an extend from i8->i32,
i16->i64 or i8->i64, we need to reintroduce a narrower extend. If we're
matching a vwmulsu we need to use a sext for op0 and a zext for op1.

This bug exists in LLVM 14 and will need to be backported.

Differential Revision: https://reviews.llvm.org/D119618
2022-02-12 12:47:20 -08:00
Marek Kurdej 7d5062c6ac [clang-format] Remove unnecessary parentheses in return statements. NFC. 2022-02-12 21:25:52 +01:00
Simon Pilgrim abe1bb763e [clang] MicrosoftCXXNameMangler::mangleObjCKindOfType - use castAs<> instead of getAs<> to avoid dereference of nullptr
The pointer is referenced in the mangleType call, so assert the cast is correct instead of returning nullptr
2022-02-12 20:11:21 +00:00
Simon Pilgrim 5d1e3ed3e2 [clang-tidy] SimplifyBooleanExprCheck - use cast<> instead of dyn_cast<> to avoid dereference of nullptr
The IfStmt pointer is always referenced inside the replaceCompoundReturnWithCondition call, so assert the cast is correct instead of returning nullptr
2022-02-12 19:59:30 +00:00
Joseph Huber a0e8077d28 [OpenMP][NFC] Simplify identifying the device bitcode library
Now that the old device runtime has been deleted there is only a single
target that differs by the triple and the architecture. Simplify the
scheme for identifying the library but directly using the triple.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D119638
2022-02-12 14:55:47 -05:00
Mark de Wever 5ffb1047cd [libc++][nfc] Add TEST_HAS_NO_INT128.
This avoids using an libc++ internal macro in our tests.

D117992 removed them, but it seems new occurrences have been introduced.
2022-02-12 20:07:58 +01:00
Nico Weber c07bbbcef9 Revert "[asan] Always skip first object from dl_iterate_phdr"
This reverts commit d75a5650db.
Breaks asan_dlopen_test.cpp on several bots, see comments on
https://reviews.llvm.org/D119515
2022-02-12 14:05:59 -05:00