Commit Graph

433651 Commits

Author SHA1 Message Date
River Riddle 96fd3f2d5b [mlir:Bytecode] Fix asan failure
We were accessing the region state after it got popped from the stack.
2022-08-22 10:02:42 -07:00
Dmitry Preobrazhensky 0a8dd8ef79 [AMDGPU][MC][GFX10][NFC] Consolidate tests by encoding
Differential Revision: https://reviews.llvm.org/D132235
2022-08-22 19:53:56 +03:00
Philip Reames 5cd427106d [TTI] Start process of merging OperandValueKind and OperandValueProperties [nfc]
OperandValueKind and OperandValueProperties both provide facts about the operands of an instruction for purposes of cost modeling.  We've discussed merging them several times; before I plumb through more flags, let's go ahead and do so.

This change only adds the client side interface for getArithmeticInstrCost and makes a couple of minor changes in client code to prove that it works.  Target TTI implementations still use the split flags.  I'm deliberately splitting what could be one big change into a series of smaller ones so that I can lean on the compiler to catch errors along the way.
2022-08-22 09:48:15 -07:00
Arthur Eubanks 9a83f38408 [bazel] Add note about using -c opt for CI 2022-08-22 09:36:23 -07:00
Matthias Braun b2542c40b9 RegisterClassInfo: Fix CSR cache invalidation
`RegisterClassInfo` caches information like allocation orders and reuses
it for multiple machine functions where possible. However the `MCPhysReg
*CalleeSavedRegs` field used to test whether the set of callee saved
registers changed did not work: After D28566
`MachineRegisterInfo::getCalleeSavedRegs()` can return dynamically
computed CSR sets that are only valid while the `MachineRegisterInfo`
object of the current function exists.

This changes the code to make a copy of the CSR list instead of keeping
a possibly invalid pointer around.

Differential Revision: https://reviews.llvm.org/D132080
2022-08-22 09:28:26 -07:00
Nico Weber 3affbae530 clang/apple: Infer simulator env from -mios-simulator-version-min= flag
Before this patch, open-source clang would consider
`-target x86_64-apple-darwin -mios-simulator-version-min=11.0` as
targeting the iOS simulator, due to the mios flag informing it
that we want to target iOS, and logic in the driver then realizing
that x86 iOS builds must be the simulator.

However, for `-target arm64-apple-darwin -mios-simulator-version-min=11.0`
that didn't work and clang thought that it's building for actual iOS,
and not for the simulator.

Due to this, building compiler-rt for arm64 iossim would lead to
all .o files in RTSanitizerCommonSymbolizer.iossim.dir being built
for iOS instead of for iOS simulator, and clang would ask ld64 to
link for iOS, but using the iPhoneSimulator sysroot. This would then
lead to many warnings from ld64 looking like:

    ld: warning: building for iOS, but linking in .tbd file
        (.../iPhoneSimulator.sdk/usr/lib/libc++abi.tbd) built for iOS Simulator

Worse, with ld64.lld, this diagnostic is currently an error instead
of a warning.

This patch makes it so that the presence of -mios-simulator-version-min=
now informs clang that we're building for simulator. That way, all the
.o files are built for simulator, the linker is informed that we're
building for simulator, and everything Just Works.

(Xcode's clang already behaves like this, so this makes open-source clang
match Xcode clang.)

We can now likely remove the hack to treat non-mac darwin x86 as
simulator, but doing that feels slightly risky, so I'm leaving that
for a follow-up patch.

(This patch is made necessary by the existence of arm64 macs.)

Differential Revision: https://reviews.llvm.org/D132258
2022-08-22 12:19:34 -04:00
Goran Flegar 59548fe873 [mlir] Fix compile errors with bytecode support 2022-08-22 17:59:51 +02:00
Guillaume Chatelet 41d4067d0b [NFC][libc] clarify CPP folder documentation 2022-08-22 15:41:41 +00:00
Stephen Tozer 11ce014a12 [DebugInfo][NFC] Update LDV to use generic DBG_VALUE* MI interface
Currently, InstrRefLDV only handles DBG_VALUE instructions, not
DBG_VALUE_LIST, and as a result of this it handles these instructions
using functions that only work for that type of debug value, i.e. using
getOperand(0) to get the debug operand. This patch changes this to use
the generic debug value functions, such as getDebugOperand and
isDebugOffsetImm, as well as adding an IsVariadic field to the
DbgValueProperties class and a few other minor changes to acknowledge
DBG_VALUE_LISTs. Note that this patch does not add support for
DBG_VALUE_LIST here, but is a precursor to other patches that do add
that support.

Differential Revision: https://reviews.llvm.org/D128174
2022-08-22 16:28:12 +01:00
Guillaume Chatelet aa59c9810a [libc][NFC] Use STL case for string_view 2022-08-22 15:25:14 +00:00
Matthias Springer 9ee12f4778 [mlir][tensor][bufferize] Bufferize tensor.pad
tensor.pad is lowered to tensor.generate + tensor.insert_slice during bufferization. For best performance with constant padding values, users should vectorize the IR before bufferizing it.

This change also relaxes tje restriction that no new ops that bufferize to a memory write should be added during bufferization. Since bufferization has been split into two steps a while ago (tensor copy insertion + bufferization), it is reasonable to allow this now.

Differential Revision: https://reviews.llvm.org/D132355
2022-08-22 17:00:33 +02:00
Matthias Springer 416ba2256d [mlir][linalg][transform] Support dynamic tile sizes in TileToForeachThreadOp
TileToForeachThreadOp now accepts mixed SSA value operands / index attributes for tile_sizes and num_threads. (Reusing OperandsOrIntegersSizesList.) In case of an operand, a PDL_Operation must be specified that is mapped to a payload op that returns the tile size or number of threads.

Differential Revision: https://reviews.llvm.org/D131949
2022-08-22 16:48:45 +02:00
Denis Antrushin 45e80d9801 Reapply "[NFC] Precommit test for D132255".
Changed check line to accomodate assertion text difference on
mac and windows; added 'REQUIRES: asserts' line.

This reverts commit 89aaae57ea.
2022-08-22 21:41:11 +07:00
Chuanqi Xu 210a4197b4 [docs] Adjust the example command line in DebuggingCoroutines.rst
The original commandline example was not correct in some environments.
Adjust the example to avoid any misunderstanding.
2022-08-22 22:15:47 +08:00
Phoebe Wang df23fc4f7f [X86][AVX512FP16] Add the missing const modifiers. NFCI
This patch fixes lit fails after D132342.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D132372
2022-08-22 22:07:42 +08:00
Stephen Tozer 53125e7d91 [DebugInfo] Handle joins PHI+Def values in InstrRef LiveDebugValues
In the InstrRefBasedImpl for LiveDebugValues, we attempt to propagate
debug values through basic blocks in part by checking to see whether all
a variable's incoming debug values to a BB "agree", i.e. whether their
properties match and they refer to the same underlying value.

Prior to this patch, the check for agreement between incoming values
relied on exact equality, which meant that a VPHI and a Def DbgValue
that referred to the same underlying value would be seen as disagreeing.
This patch changes this behaviour to treat them as referring to the same
value, allowing the shared value to propagate into the BB.

Differential Revision: https://reviews.llvm.org/D125953
2022-08-22 14:51:27 +01:00
Aaron Ballman e2ab6061a9 Add N2562 to the C status page
It was originally left off thinking the paper only impacts the C
standard library, but Clang supports diagnostics for incorrect use of
a format specifier, so this paper has some frontend impacts as well.
2022-08-22 09:46:12 -04:00
Michael Buch 09f608fda5 [lldb][ClangExpression] Remove storage-class check when creating AsmLabel
This check was put in place to prevent static functions
from translation units outside the one that the current
expression is evaluated from taking precedence over functions
in the global namespace. However, this is really a different
bug. LLDB lumps functions from all CUs into a single AST and
ends up picking the file-static even when C++ context rules
wouldn't allow that to happen.

This patch removes the check so we apply the AsmLabel to all
FunctionDecls we create from DWARF if we have a linkage name
available. This makes the code-path easier to reason about and
allows calling static functions in contexts where we previously
would've chosen the wrong function.

We also flip the XFAILs in the API test to reflect what effect
this change has.

**Testing**

* Fixed API tests and added XFAIL

Differential Revision: https://reviews.llvm.org/D132231
2022-08-22 13:22:20 +01:00
Michael Buch 6f19f98710 [lldb][Test] Replace expect() with expect_expr() in TestNamespaceLookup.py
This will be useful in preparation for some reshuffling
of assertions in this file since we won't have to
adjust the persitent variable names during the process.

sed commands:
```
s/expect("expr -- /expect_expr("/g
s/startstr="(int) [$0-9]* = /result_type="int", result_value="/g
```

**Testing**

* API tests still pass

Differential Revision: https://reviews.llvm.org/D132271
2022-08-22 13:22:19 +01:00
Florian Hahn 494b6c46d6
[LAA] Add test cases where BTC can be used to rule out dependences.
Test cases for using the backedge-taken-count to rule out dependencies between
an invariant and strided accesses.
2022-08-22 13:11:26 +01:00
isuckatcs c81bf940c7 [analyzer] Handling non-POD multidimensional arrays in ArrayInitLoopExpr
This patch makes it possible for lambdas, implicit copy/move ctors
and structured bindings to handle non-POD multidimensional arrays.

Differential Revision: https://reviews.llvm.org/D131840
2022-08-22 13:53:53 +02:00
Martin Storsjö b21de9b38f [lldb] Silence a GCC warning about missing returns after a fully covered switch. NFC. 2022-08-22 14:53:29 +03:00
David Green 0cf9e47f27 [AArch64] Add SK_Splice fixed-width costs
A fixed length SK_Splice shuffle vector is lowered to a Ext under
AArch64, which should have a cost of 1.

Differential Revision: https://reviews.llvm.org/D132299
2022-08-22 12:44:57 +01:00
Simon Pilgrim d0397dbdae [CostModel][X86] Fix a off-by-one typo in the v64i8 splice shuffle test 2022-08-22 12:40:15 +01:00
isuckatcs 3c482632e6 [analyzer] Remove pattern matching of lambda capture initializers
Prior to this patch we handled lambda captures based on their
initializer expression, which resulted in pattern matching. With
C++17 copy elision the initializer expression can be anything,
and this approach proved to be fragile and a source of crashes.
This patch removes pattern matching and only checks whether the
object is under construction or not.

Differential Revision: https://reviews.llvm.org/D131944
2022-08-22 13:00:31 +02:00
Guillaume Chatelet c860fd3f25 [NFC][libc] Remove ArrayRef which is replaced with span 2022-08-22 10:52:28 +00:00
Simon Pilgrim 541e24ef76 [CostModel][X86] Add some basic SK_Splice shuffle test coverage
These are currently recognised as SK_PermuteTwoSrc
2022-08-22 11:39:31 +01:00
Guillaume Chatelet 4d2319123a [NFC][libc] Switch File impl to span instead of ArrayRef 2022-08-22 10:27:07 +00:00
Goran Flegar 1d9b1427f4 [mlir][Bazel] Fix bazel build
Add fixes for https://reviews.llvm.org/D131747
2022-08-22 12:07:55 +02:00
Emmmer 65f6a8c23b [LLDB] Fix: make m_target_arch private
Using GetTargetArchitecture() instead of m_target_arch, and set m_target_arch to private.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D132353
2022-08-22 18:01:44 +08:00
Guillaume Chatelet 22bc0fde55 [NFC][libc] Switch mem* tests from ArrayRef to span 2022-08-22 09:58:35 +00:00
David Green 04a68fce13 [ARM] Add a couple of MVE fixed-order-reduction tests. NFC 2022-08-22 10:58:14 +01:00
Simon Pilgrim dd5b48976c [CostModel][X86] getShuffleCost - treat SK_Splice as SK_PermuteTwoSrc
SK_Splice should be equivalent to a PALIGNR instruction etc. - but as discussed on D132308, until full fixed vector support for SK_Splice is in place, just assume its a SK_PermuteTwoSrc.
2022-08-22 10:51:08 +01:00
Guillaume Chatelet f890f80d67 [libc] Allow span views over mutable data 2022-08-22 09:43:08 +00:00
Kadir Cetinkaya 3c2cb8e2f0
[clangd] Disable IncludeCleaner for ObjC 2022-08-22 11:28:06 +02:00
Florian Hahn b3125ad3d6
[DSE] Add additional uses to tests to ensure stores be removed.
Make some tests a bit more robust with respect to future changes.
2022-08-22 10:21:50 +01:00
Christian Sigg 459fd3fb34 [MLIR][GPU] Detect bounds with `arith.minsi ` in loops-to-gpu
Previously, `arith.constant`, `arith.muli` and `affine.min` were supported when deriving upper loop bounds when converting parallel loops to GPU.

Reviewed By: akuegel

Differential Revision: https://reviews.llvm.org/D132354
2022-08-22 11:14:04 +02:00
Valentin Clement a6e155fd9a
[flang] Add bind(C) to buitlin C_PTR
D131585 Adds couple of semantics check for the components of BIND(C)
derived-type. This would raise an error when a component is of C_PTR
type. Add `bind(c)` to the `__builtin_c_ptr` type so the wrong error
is not triggered.

Reviewed By: peixin, jeanPerier

Differential Revision: https://reviews.llvm.org/D132350
2022-08-22 11:12:37 +02:00
Guillaume Chatelet e5d5146323 [libc] Allow construction of const span from mutable span 2022-08-22 08:54:31 +00:00
Victor Campos 1d66c5ebbc [ARM] Fix bug in also_compatible_with attribute parser
Check ScopedPrinter pointer before attempting to print the attribute's
parsed information.

Patch by Michael Platings and Victor Campos

Reviewed By: pratlucas

Differential Revision: https://reviews.llvm.org/D132214
2022-08-22 09:40:37 +01:00
River Riddle 93cf0e8a28 [mlir] Fix bots after bytecode support was added in D131747
* Fix ambiguous Twine constructor call
* Ensure shift is 64-bit (for MSVC)
* Disable bytecode tests on s390x (we don't support big endian right now)
2022-08-22 01:31:39 -07:00
Guillaume Chatelet a1c42cb803 [reland][NFC][libc] Use span instead of ArrayRef 2022-08-22 08:22:38 +00:00
Guillaume Chatelet 70ca9a6600 Revert "[NFC][libc] Use span instead of ArrayRef"
This reverts commit e7b250b8a6.
2022-08-22 08:14:22 +00:00
Guillaume Chatelet e7b250b8a6 [NFC][libc] Use span instead of ArrayRef 2022-08-22 08:09:57 +00:00
River Riddle f3acb54c1b [mlir] Add initial support for a binary serialization format
This commit adds a new bytecode serialization format for MLIR.
The actual serialization of MLIR to binary is relatively straightforward,
given the very very general structure of MLIR. The underlying basis for
this format is a variable-length encoding for integers, which gets heavily
used for nearly all aspects of the encoding (given that most of the encoding
is just indexing into lists).

The format currently does not provide support for custom attribute/type
serialization, and thus always uses an assembly format fallback. It also
doesn't provide support for resources. These will be added in followups,
the intention for this patch is to provide something that supports the
basic cases, and can be built on top of.

https://discourse.llvm.org/t/rfc-a-binary-serialization-format-for-mlir/63518

Differential Revision: https://reviews.llvm.org/D131747
2022-08-22 00:36:26 -07:00
Max Kazantsev e587199a50 [SCEV] Prove condition invariance via context, try 2
Initial implementation had too weak requirements to positive/negative
range crossings. Not crossing zero with nuw is not enough for two reasons:

- If ArLHS has negative step, it may turn from positive to negative
  without crossing 0 boundary from left to right (and crossing right to
  left doesn't count for unsigned);
- If ArLHS crosses SINT_MAX boundary, it still turns from positive to
  negative;

In fact we require that ArLHS always stays non-negative or negative,
which an be enforced by the following set of preconditions:

- both nuw and nsw;
- positive step (looks liftable);

Because of positive step, boundary crossing is only possible from left
part to the right part. And because of no-wrap flags, it is guaranteed
to never happen.
2022-08-22 14:31:19 +07:00
Guillaume Chatelet 5541e6bc05 [libc] Add a span facility
This is intended to replace ArrayRef.

Differential Revision: https://reviews.llvm.org/D132254
2022-08-22 07:27:00 +00:00
owenca d90c1bcdf9 Revert "[clang-format][NFC] Fix a bug in setting type FunctionLBrace"
This reverts commit 35f7dd601d.

Fixes #57200.
2022-08-21 23:26:51 -07:00
Max Kazantsev 7d6e7d5445 [Test] And one more test for PR57247 2022-08-22 13:02:01 +07:00
Vitaly Buka aaa987ddfb [clang] Fix warning after D116203
The warning was:
SemaType.cpp:9469:3: error: default label in switch
which covers all enumeration values
[-Werror,-Wcovered-switch-default]
2022-08-21 22:39:23 -07:00