Commit Graph

434288 Commits

Author SHA1 Message Date
Benjamin Kramer 766f5d8c3c [bazel] Port a235562c0a 2022-08-26 19:17:19 +02:00
Philip Reames 2d5f025779 [LV] Extract utility for checking if VPValue is uniform [nfc] 2022-08-26 09:56:13 -07:00
Mircea Trofin 0184889e0d [mlgo] Don't set the source permissions when copying over tf files
This is akin to the `install` behavior. It should make build directory
deletable on certain build bots.
2022-08-26 09:49:53 -07:00
Shafik Yaghmour 21dfe482e1 [Clang] Fix assert in Sema::LookupTemplateName so that it does not attempt an unconditional cast to TagType
In Sema::LookupTemplateName(...) seeks to assert that the ObjectType is complete
or being defined. If the type is incomplete it will attempt to unconditionally
cast it to a TagType and not all incomplete types are a TagType. For example the
type could be void or it could be an IncompleteArray.

This change adds an additional check to confirm it is a TagType before attempting
to check if it is incomplete or being defined

Differential Revision: https://reviews.llvm.org/D132712
2022-08-26 09:40:43 -07:00
Simon Pilgrim f9445ae75c [CostModel][X86] Add CodeSize handling for fneg ops
Eventually this will be part of the cost table lookup
2022-08-26 17:34:52 +01:00
Simon Pilgrim 7790518c1f [CostModel][X86] getArithmeticInstrCost - use the cost tables for all cost kinds
The tables currently only have TCK_RecipThroughput costs, but we should now be able to add individual entries without any further refactoring
2022-08-26 17:34:52 +01:00
Mahesh Ravishankar a235562c0a [mlir][TilingInterface] Enabling tiling `tensor.pad` using `TilingInterface`.
Update the implementation of `TilingInterface` for `tensor.pad`
operations to allow tiling the op using the existing patterns for the
interface. Verify that tests that pass with existing pad tiling
patterns producer the same results through TilingInterface patterns.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D132720
2022-08-26 16:29:32 +00:00
Florian Hahn e117137af0
[LV] Add another test for incorrect runtime check generation.
Add a variation of @nested_loop_outer_iv_addrec_invariant_in_inner with
the dependence sink and source swapped to extend test coverage.

Also simplifies the test by removing an unneeded reduction.
2022-08-26 17:28:55 +01:00
Xiang Li a0ecb4a299 [HLSL] Move DXIL validation version out of ModuleFlags
Put DXIL validation version into separate NamedMetadata to avoid update ModuleFlags.

Currently DXIL validation version is saved in ModuleFlags in clang codeGen.
Then in DirectX backend, the data will be extracted from ModuleFlags and cause rebuild of ModuleFlags.
This patch will build NamedMetadata for DXIL validation version and remove the code to rebuild ModuleFlags.

Reviewed By: beanz

Differential Revision: https://reviews.llvm.org/D130207
2022-08-26 09:20:45 -07:00
Mahesh Ravishankar 7744253f12 [mlir][Linalg] Drop check for output indexing maps.
The current check for form of the output indexing maps disallows
generic ops that return both a reduced and unreduced value. Such an op
seems like it could fall within the scope of a Strucutred op. Drop the
check. The only load-bearing place this was found to cause isseus was
during vectorization, but the fix for that seems to be simple.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D132716
2022-08-26 16:15:55 +00:00
Nicolas Vasilache 325426d72c [mlir][MemRef] Introduce a memref.extract_metadata op.
This is the counterpart of `memref.reinterpret_cast` and is useful to lift
strided memref manipulation out of the LLVM dialect.

Discussion: https://discourse.llvm.org/t/extracting-dynamic-offsets-strides-from-memref/64170

Differential Revision: https://reviews.llvm.org/D132243
2022-08-26 09:09:15 -07:00
Corentin Jabot 463e30f51f [Clang] Fix crash in coverage of if consteval.
Clang crashes when encountering an `if consteval` statement.
This is the minimum fix not to crash.
The fix is consistent with the current behavior of if constexpr,
which does generate coverage data for the discarded branches.
This is of course not correct and a better solution is
needed for both if constexpr and if consteval.
See https://github.com/llvm/llvm-project/issues/54419.

Fixes #57377

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D132723
2022-08-26 17:46:53 +02:00
Nikolas Klauser 98f6a56f5e [libc++] Enable hash only for the correct types
Also implement LWG3705.
Fixes https://github.com/llvm/llvm-project/issues/55823

Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132338
2022-08-26 17:40:23 +02:00
Nikolas Klauser 56e1f0f056 [libc++][NFC] Remove reserved names from support/constexpr_char_traits.h
Reviewed By: ldionne, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D132341
2022-08-26 17:37:47 +02:00
Akira Hatanaka 2e9df86046 [compiler-rt][builtins] Add compiler flags to catch potential errors
that can lead to security vulnerabilities

Also, fix a few places that were causing -Wshadow and
-Wformat-nonliteral warnings to be emitted.

This reapplies the patch that was reverted in caaafe4ae2 because it
broke Fuchsia builders.

I reverted the changes I made to InstrProfData.inc and instead renamed
the variables in InstrProfilingWriter.c. Also fixed a bug in function
add_security_warnings that was causing it to pass -Wformat-nonliteral
when the compiler doesn't support it.
2022-08-26 08:35:19 -07:00
Florian Hahn 6e56779e6b
[LV] Add test for incorrect runtime check generation #57315.
Test for PR57315 based on a test provided by @kpdev42.
2022-08-26 16:29:20 +01:00
Thomas Raoux 1ee0d60a9b [mlir][tensor] Remove incorrect parallel_insert_slice folder
parallel_insert_slice doesn't return a value therefore we shouldn't try
to fold the result. The insert folding don't apply to this op.
The current folding would cause pattern rewrite to not be able to
converge.

Differential Revision: https://reviews.llvm.org/D132668
2022-08-26 15:27:54 +00:00
Aaron Ballman be19952720 Fix the lldb test bots
This addresses an accidental change in behavior from
41667a8b9b to get the bots back to green.
However, I think there's an issue with LLDB assuming it's valid to
enable support for keywords in language modes that don't support the
keyword (as other parts of Clang are not expecting to be able to do
that).

This should fix (and others):
https://lab.llvm.org/buildbot/#/builders/68/builds/38374
2022-08-26 11:19:42 -04:00
Simon Pilgrim fef3eeef48 [CostModel][X86] Convert AVX2 SRA by uniform constant to cost table
When adding cost kind support it will be easier to maintain these if we're not calculating on the fly
2022-08-26 16:14:13 +01:00
Simon Pilgrim f3590b6440 [CostModel][X86] getArithmeticInstrCost - move SLM reduceVMULWidth cost handling into the generic MUL handling
This is still SLM specific atm, but converting this to more closely match the codegen from reduceVMULWidth should be straightforward
2022-08-26 16:14:12 +01:00
Simon Pilgrim 9c29b4a0ac [CostModel][X86] Convert AVX1/SSE41 SREM/SDIV by constants to cost tables
When adding cost kind support it will be easier to maintain these if we're not calculating on the fly
2022-08-26 16:14:12 +01:00
Paul Walker 3bb228729f [CostModel][SVE] Correct cost model of SK_Splice shuffles for <vscale x 1 x Ty> vector types.
AArch64TTIImpl::getSpliceCost() is now used more aggressively and
LNT (MultiSource/Benchmarks/mafft) exposed a failure case for
<vscale x 1 x i1>. I've tested other element types and whilst they
can be costed they cannot be code generated, so this patch returns
InstructionCost::getInvalid() for all cases.
2022-08-26 16:06:01 +01:00
Florian Hahn 3b135ef446
[LV] Convert runtime diff check test to use opaque pointers.
Modernize the test to make it easier to extend with up-to-date IR.
2022-08-26 16:02:38 +01:00
Thomas Raoux 2e34599bfd [mlir][tensor] Remove folding of tensor.extract_slice during tiling
Blindly folding tensor.extract_slice makes the bufferization
transformation harder. This kind of transformation should happen
separatley if needed rather than doing it within makeShape that is
called during tiling.
Also removed makeComposedExtractSliceOp as it is not tested outside of
this code.

Differential Revision: https://reviews.llvm.org/D132666
2022-08-26 14:30:39 +00:00
Michael Liao e84784e4ae [CSKY] Fix warnings on the use of deprecated methods. NFC. 2022-08-26 10:23:16 -04:00
Jean Perier db77b18887 [flang] Adding a guideline for flang design documentation
The goal of this document is to:
- Allow the community to contribute to flang design by defining the
  expectations.
- Ensure there is a minimum of consistency between future design docs.

Differential Revision: https://reviews.llvm.org/D130166
2022-08-26 16:18:16 +02:00
Florian Hahn ec37ecbc62
[LCSSA] Skip updating users in unreachable blocks.
Don't waste time trying to update users in unreachable blocks.
2022-08-26 15:09:46 +01:00
Aaron Ballman 8360174fb1 Fix the Sphinx build bot
This addresses an accidental break from
41667a8b9b
2022-08-26 10:04:57 -04:00
Benjamin Kramer 01bebedaf0 [Basic] Drop header-only dependency from Basic to Lex
It's still a bit weird for IdentifierTable to depend on Lex diagnostics,
but we can get away with including the enum info that's in Basic already.
2022-08-26 16:03:22 +02:00
Daniil Fukalov 9c710ebbdb [TTI] NFC: Reduce InstructionCost::getValue() usage...
in order to propagate `InstructionCost` value upper.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D103406
2022-08-26 16:37:32 +03:00
Alexey Bataev af8477f2bc [SLP][NFC]Add a test for incorrectly calculated cost for extracted
buildvector sequence, NFC.
2022-08-26 06:29:15 -07:00
Simon Pilgrim 488861d0e3 [X86] Add SimplifyMultipleUseDemandedBitsForTargetNode X86ISD::ANDNP handling
See if we can remove X86ISD::ANDNP nodes by checking the state of the knownbits of the demanded elements.

This is equivalent to the generic ISD::AND handling, but flips the bits of the LHS operand to account for ANDNP.

Differential Revision: https://reviews.llvm.org/D128216
2022-08-26 14:28:35 +01:00
Simon Pilgrim 9f94240fe1 [CostModel][X86] getArithmeticInstrCost - use cost kind specific look up tables
Building on D132216, use CostKindTblEntry cost tables to simplify the transition to supporting cost kinds other than recip-throughput

Adding full cost kinds support is going to take a while, but by converting to CostKindTblEntry first it will make it easier to support the costs on a per-ISD basis.
2022-08-26 14:28:35 +01:00
Pavel Labath 59656c0492 [lldb] Make CommunicationTest compatible with windows
Our (TCP) socket support is in a much better state than pipes. Use that
for testing the Communication class.

Move the CreateTCPConnectedSockets function
(SocketTestUtilities.{h,cpp}) to a place where it can be used from
Communication tests.
2022-08-26 15:25:46 +02:00
Muhammad Usman Shahid 41667a8b9b Diagnosing the Future Keywords
The patch diagnoses an identifier as a future keyword if it exists in a
future language mode, such as:

int restrict;

in C modes earlier than C99. We now give a warning to the user that
such an identifier is a future keyword. Handles keywords from C as well
as C++.

Differential Revision: https://reviews.llvm.org/D131683
2022-08-26 09:20:05 -04:00
Adrian Vogelsgesang 5af06ba7dc [Coro][Debuginfo] Add debug info to `__NoopCoro_ResumeDestroy` function
With this commit, we now attach an `DISubprogram` to the LLVM-generated
`_NoopCoro_ResumeDestroy` function. Thereby, lldb can show a
`std::coroutine_handle` to a `std::noop_coroutine` as

```
continuation = coro frame = 0x555555560d98 {
  resume = 0x0000555555555c50 (a.out`__NoopCoro_ResumeDestroy)
  destroy = 0x0000555555555c50 (a.out`__NoopCoro_ResumeDestroy)
}
```

instead of

```
continuation = coro frame = 0x555555560d98 {
  resume = 0x0000555555555c50 (a.out`___lldb_unnamed_symbol211)
  destroy = 0x0000555555555c50 (a.out`___lldb_unnamed_symbol211)
}
```

I renamed the function from `NoopCoro.ResumeDestroy` to
`_NoopCoro_ResumeDestroy` because:
* the leading `_` makes sure this is a reserved name and should not
  clash with any user-provided names
* the `.` was replaced by a `_`, so the name is now a valid identifier
  in C, making it allows me to type its name in the debugger

Differential Revision: https://reviews.llvm.org/D132580
2022-08-26 05:49:52 -07:00
Utkarsh Saxena 80e7dec561 Typo fix in Release notes. 2022-08-26 14:36:45 +02:00
Alexey Lapshin 7a64e636af [dsymutil][DWARFv5] fix DW_FORM_addrx attribute offset calculation.
DWARFLinker::DIECloner::cloneAddressAttribute() contains call to
relocateIndexedAddr(StartOffset, EndOffset). StartOffset is
incorrectly calculated. Val.getRawUValue() is an index into the
.debug_addr table, so it should be multiplied
by Unit.getOrigUnit().getAddressByteSize().

Differential Revision: https://reviews.llvm.org/D132644
2022-08-26 15:26:06 +03:00
Benjamin Kramer 2c1796b3d6 [ADT] GCC 7 doesn't have constexpr char_traits, add a workaround
LLVM still supports GCC 7. This workaround can be removed when GCC 8
becomes the oldest supported GCC version.

Fixes #57057
2022-08-26 14:11:21 +02:00
Pavel Labath afdfb3ae6b [lldb] Skip TestCoroutineHandle.py on libstdc++<11 2022-08-26 14:04:04 +02:00
LLVM GN Syncbot df46c78078 [gn build] Port 56c54cf66b 2022-08-26 11:23:06 +00:00
LLVM GN Syncbot 66f180edd7 [gn build] Port 3e39b27101 2022-08-26 11:23:05 +00:00
Nico Weber 217eb9f75a [gn build] port bb26ebb4d1 2022-08-26 07:22:35 -04:00
Sam McCall 56c54cf66b [pseudo] Placeholder disambiguation strategy: always choose second
Mostly mechanics here. Interesting decisions:
 - apply disambiguation in-place instead of copying the forest
   debatable, but even the final tree size is significant
 - split decide/apply into different functions - this allows the hard part
   (decide) to be tested non-destructively and combined with HTML forest easily
 - add non-const accessors to forest to enable apply
 - unit tests but no lit tests: my plan is to test actual C++ disambiguation
   heuristics with lit, generic disambiguation mechanics without the C++ grammar

Differential Revision: https://reviews.llvm.org/D132487
2022-08-26 13:16:09 +02:00
Matheus Izvekov 4a56470d0d
Revert "Clang: fix AST representation of expanded template arguments."
This reverts commit 1d1a56929b.
2022-08-26 13:09:55 +02:00
Matthias Gehre 3e39b27101 [llvm/CodeGen] Add ExpandLargeDivRem pass
Adds a pass ExpandLargeDivRem to expand div/rem instructions
with more than 128 bits into a loop computing that value.

As discussed on https://reviews.llvm.org/D120327, this approach has the advantage
that it is independent of the runtime library. This also helps the clang driver,
which otherwise would need to understand enough about the runtime library
to know whether to allow _BitInts with more than 128 bits.

Targets are still free to disable this pass and instead provide a faster
implementation in a runtime library.

Fixes https://github.com/llvm/llvm-project/issues/44994

Differential Revision: https://reviews.llvm.org/D126644
2022-08-26 11:55:15 +01:00
Felipe de Azevedo Piovezan bb26ebb4d1 [lldb] Fix dotest argument order
When running LLDB API tests, a user can override test arguments with
LLDB_TEST_USER_ARGS. However, these flags used to be concatenated with a
CMake-derived variable LLDB_TEST_COMMON_ARGS, as below:

```
set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS}
    CACHE INTERNAL STRING)
```

This is problematic, because LLDB_TEST_COMMON_ARGS must be processed
first, while LLDB_TEST_USER_ARGS args must be processed last, so that
user overrides are respected. Currently, if a user attempts to override
one of the "inferred" flags, the user's request is ignored. This is the
case, for example, with `--libcxx-include-dir` and
`--libcxx-library-dir`. Both flags are needed by the greendragon bots.

This commit removes the concatenation above, keeping the two original
variables throughout the entire flow, processing the user's flag last.

The variable LLDB_TEST_COMMON_ARGS needs to be a CACHE property, but it
is modified throughout the CMake file with `set` or `list` or `string`
commands, which don't work with properties. As such, a temporary
variable `LLDB_TEST_COMMON_ARGS_VAR` is created.

This was tested locally by invoking CMake with:
-DLLDB_TEST_USER_ARGS="--libcxx-include-dir=blah --libcxx-library-dir=blah2"
and checking that tests failed appropriately.

Differential Revision: https://reviews.llvm.org/D132642
2022-08-26 06:52:40 -04:00
Simon Pilgrim 88c7b16bed [DAG] Strip poison generating flags in freeze(op()) -> op(freeze()) fold
This patch follows the InstCombine approach of stripping poison generating flags (nsw/nuw from add/sub etc.) to allow us to push a freeze() through the op. Unlike InstCombine it doesn't retain any flags, but we have plenty of DAG folds that do the same thing already. We assert that the newly generated op isGuaranteedNotToBeUndefOrPoison.

Similar to the ValueTracking approach, isGuaranteedNotToBeUndefOrPoison has been updated to confirm that if an op can't create undef/poison and its operands are guaranteed not to be undef/poison - then its not undef/poison. This is just for the generic opcodes - target specific opcodes will need to do this manually just in case they have some special cases.

Differential Revision: https://reviews.llvm.org/D132333
2022-08-26 11:47:51 +01:00
Pavel Samolysov f964417c32 Revert "[Pipelines] Introduce DAE after ArgumentPromotion"
The commit breaks the compiler when a function is used as a function
parameter (hm... for a function from the standard C library?):

```
static float strtof(char *, char *) {}
void a() { strtof(a, 0); }
```

This reverts commit 879f5118fc.
2022-08-26 13:43:09 +03:00
Nicolas Vasilache 6e81eae2f7 [mlir][Vector] Support 0-D vectors in TransposeOp
Co-authored-by: Michal Terepeta <michalt@google.com>

Reviewed-by: ftynse

Differential Revision: https://reviews.llvm.org/D115743
2022-08-26 03:40:21 -07:00