Commit Graph

414875 Commits

Author SHA1 Message Date
Ivan Butygin 5217801dae [mlir][arith] Do not limit arith-expand pass to FuncOp
This pass doesn't have any limitations specific to FuncOp and it will be useful to be able to run it on other ops (e.g. gpu.func).

Differential Revision: https://reviews.llvm.org/D119662
2022-02-14 11:49:19 +03:00
Nikita Popov ad1feef7b2 [lldb] Remove some uses of getPointerElementType()
While in the area, remove some uses of getPointerElementType()
that have obvious replacements.
2022-02-14 09:44:37 +01:00
Marek Kurdej e01f624adb [clang-format] Fix PointerAlignment within lambdas in a multi-variable declaration statement.
Fixes https://github.com/llvm/llvm-project/issues/43115.

Also, handle while loops with initializers (C++20) the same way as for loops.

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D119648
2022-02-14 09:41:24 +01:00
Nikita Popov 2df9430fbf [lldb] Remove uses of PointerType::getElementType()
This method has been deprecated and removed. I missed these usages
in lldb previously.
2022-02-14 09:34:24 +01:00
Dávid Bolvanský 1be1fd735d [AlwaysInliner] Check for callsite noinline attribute simplified 2022-02-14 09:33:30 +01:00
Nikita Popov ff040eca93 [FastISel] Reuse register for bitcast that does not change MVT
The current FastISel code reuses the register for a bitcast that
doesn't change the IR type, but uses a reg-to-reg copy if it
changes the IR type without changing the MVT. However, we can
simply reuse the register in that case as well.

In particular, this avoids unnecessary reg-to-reg copies for pointer
bitcasts. This was found while inspecting O0 codegen differences
between typed and opaque pointers.

Differential Revision: https://reviews.llvm.org/D119432
2022-02-14 09:13:17 +01:00
Nikita Popov d593cf7945 [IR] Remove deprecated PointerType::getElementType()
This was deprecated before the LLVM 14 branch cut, remove the
method now.

As a temporary workaround, Type::getPointerElementType() can be
used instead.

See https://llvm.org/docs/OpaquePointers.html for information on
the opaque pointers migration.
2022-02-14 09:07:50 +01:00
jacquesguan bfb4c0c370 [RISCV] Recover the implication between Zve* extensions and the V extension.
This revision recover the implication between Zve* extensions and the V extension.

Differential Revision: https://reviews.llvm.org/D119210
2022-02-14 15:52:07 +08:00
Simon Moll ce48fe47af [VE] v256i1 and|or|xor isel and tests
Reviewed By: kaz7

Differential Revision: https://reviews.llvm.org/D119239
2022-02-14 08:47:06 +01:00
Balázs Kéri 83028ad934 [clang][AST][ASTImporter] Set record to complete during import of its members.
At import of a member it may require that the record is already set to complete.
(For example 'computeDependence' at create of some Expr nodes.)
The record at this time may not be completely imported, the result of layout
calculations can be incorrect, but at least no crash occurs this way.

A good solution would be if fields of every encountered record are imported
before other members of all records. This is much more difficult to implement.

Differential Revision: https://reviews.llvm.org/D116155
2022-02-14 08:27:44 +01:00
Chuanqi Xu e59d6dc063 [NFC] Precommit for PR53357
Due to there are other required changes in
https://reviews.llvm.org/D118094, precommit these changes to ease
reviewing. Including:
- Remove *_thwart tests.
- Remove test for (x & y) + (~x & ~y)
- Fix incorrect uniitest committeed before
2022-02-14 14:37:12 +08:00
Chuanqi Xu 4ee240b860 [NFC] [ValueTracking] Add unittest for haveNoCommonBitsSet 2022-02-14 14:10:30 +08:00
Phoebe Wang 3e19ba36fc [X86][MS] Add 80bit long double support for Windows
MSVC currently doesn't support 80 bits long double. But ICC does support
it on Windows. Besides, there're also some users asked for this feature.
We can find the discussions from stackoverflow, msdn etc.

Given Clang has already support `-mlong-double-80`, extending it to
support for Windows seems worthwhile.

Reviewed By: rnk, erichkeane

Differential Revision: https://reviews.llvm.org/D115441
2022-02-14 13:32:29 +08:00
Haowei Wu 15dfe03022 [ifs] Allow llvm-ifs to generate text stub from elf stub
ELF stubs generated from llvm-ifs lacks program headers, which prevents
llvm-ifs from parsing them properly as program headers are required by
llvm's own ELF libraries. This patch adds a few workaround bypass this
limitation.

Differential Revision: https://reviews.llvm.org/D116769
2022-02-13 21:05:52 -08:00
Haowei Wu a59bb21bf8 [ifs] Added missing DT_STRSZ to the .dynamic section
This patch adds DT_STRSZ into the dynamic section, which was absent
previously. This was a bug and caused failures in other tools.

Differential Revision: https://reviews.llvm.org/D117058
2022-02-13 21:05:52 -08:00
eopXD 7f51a9e273 [RISCV] Fix RISCVTargetInfo::initFeatureMap, add non-ISA features back after implication
Previously D113336 makes RISCVTargetInfo::initFeatureMap return the results
processed by RISCVISAInfo, which only consists of ISA features and misses
non-ISA features like `relax` and `save-restore`.

This patch fixes the problem.

Reviewed By: junparser

Differential Revision: https://reviews.llvm.org/D119541
2022-02-13 21:05:06 -08:00
Teresa Johnson f4214e1469 [sanitizer] Skip test on Android where chmod is not working
Third attempt to fix a bot failure from
634da7a1c6 on an Android bot:
https://lab.llvm.org/buildbot#builders/77/builds/14339

My last attempt used an approach from another test where chmod was not
working of using a bad character in the path name. But it looks like
this trick only works on Windows.

Instead, restore the original version of this test before my change at
634da7a1c6 and move the bad path test to
a new test file, marking it unsupported on Android.
2022-02-13 19:50:25 -08:00
Shao-Ce SUN 352e19c023 [NFC][RISCV] Remove redundant `Returned` 2022-02-14 11:37:50 +08:00
Lang Hames 887f1e49d0 [llvm-jitlink] Fix a bug in llvm-jitlink's Slab allocator.
The slab delta (used to link as if allocated at a specified address) should
remain constant.The update to the delta was accidentally introduced in
962a2479b5, but hasn't caused any failures as it only breaks in an obvious
way for multi-file exec uses (our regression tests are all -noexec, and tend to
be single-file).

No testcase here: this is an obscure utility for testing support, and an
uncommon use-case. If the slab allocator is ever moved into LLVM we could add
a unit test to catch this.
2022-02-13 19:28:38 -08:00
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