Commit Graph

401252 Commits

Author SHA1 Message Date
Matthias Springer 56bf688a09 [mlir][linalg][bufferize][NFC] Simplify getAliasingOpResult()
The signature of this function was confusing. Check for hasKnownBufferizationAliasingBehavior separately when needed.

Differential Revision: https://reviews.llvm.org/D110916
2021-10-07 22:41:21 +09:00
Lei Zhang 3964c1db91 [mlir][vector] Split populateVectorContractLoweringPatterns
It was bundling quite a lot of patterns that convert high-D
vector ops into low-D elementary ops. It might not be good
for all of the patterns to happen for a particular downstream
user. For example, `ShapeCastOpRewritePattern` rewrites
`vector.shape_cast` into data movement extract/insert ops.

Instead, split the entry point into multiple ones so users
can pull in patterns on demand.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111225
2021-10-07 09:39:26 -04:00
Saiyedul Islam 2baf7ad6d2 [Clang][OpenMP] Fix fat archive tests for Mac and Windows
Fixes missing libomptarget on Mac and Windows in check lines. Issue
was introduced by D105191.

Differential Revision: https://reviews.llvm.org/D111311
2021-10-07 13:38:46 +00:00
Matthias Springer 1d24b8c603 [mlir][linalg][bufferize][NFC] Change bufferizableInPlaceAnalysis signature
Move getInplaceableOpResult() call into bufferizableInPlaceAnalysis.

Note: The only goal of this change is to make the signature of bufferizableInPlaceAnalysis smaller. (Fewer arguments.)

Differential Revision: https://reviews.llvm.org/D110915
2021-10-07 22:35:40 +09:00
Matthias Springer 6b1f653c94 [mlir][linalg][bufferize] tensor.cast may require a copy
Differential Revision: https://reviews.llvm.org/D110806
2021-10-07 22:24:05 +09:00
Eugene Zhulenev 8276ac13e9 [mlir] Add alignment attribute to memref.global
Revived https://reviews.llvm.org/D102435

Add alignment attribute to `memref.global` and propagate it to llvm global in memref->llvm lowering

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111309
2021-10-07 06:21:57 -07:00
Michael Forster 53801a59eb Fix two unused-variable warnings. 2021-10-07 15:17:58 +02:00
Chen Zheng 1bf05fbc98 [PowerPC] refactor rewriteLoadStores for reusing; nfc
This is split from https://reviews.llvm.org/D108750.
Refactor rewriteLoadStores() so that we can reuse the outlined
functions.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D110314
2021-10-07 12:59:20 +00:00
David Spickett 7ee133d3fc [libcxx][pretty printers] Correct tests run detection
Missing "global" meant that we set a local "has_run_tests"
so the global was False by the time everything has run.
2021-10-07 13:36:01 +01:00
David Green 73346f5848 [ARM] Introduce a MQPRCopy
Currently when creating tail predicated loops, we need to validate that
all the live-outs of a loop will be equivalent with and without tail
predication, and if they are not we cannot legally create a
tail-predicated loop, leaving expensive vctp and vpst instructions in
the loop. These notably can include register-allocation instructions
like stack loads and stores, and copys lowered from COPYs to MVE_VORRs.

Instead of trying to prove this is valid late in the pipeline, this
patch introduces a MQPRCopy pseudo instruction that COPY is lowered to.
This can then either be converted to a MVE_VORR where possible, or to a
couple of VMOVD instructions if not. This way they do not behave
differently within and outside of tail-predications regions, and we can
know by construction that they are always valid. The idea is that we can
do the same with stack load and stores, converting them to VLDR/VSTR or
VLDM/VSTM where required to prove tail predication is always valid.

This does unfortunately mean inserting multiple VMOVD instructions,
instead of a single MVE_VORR, but my experiments show it to be an
improvement in general.

Differential Revision: https://reviews.llvm.org/D111048
2021-10-07 12:52:12 +01:00
Carl Ritson b5d6ad20e1 [MachineCopyPropagation] Handle propagation of undef copies
When propagating undefined copies the undef flag must also be
propagated.

Reviewed By: foad

Differential Revision: https://reviews.llvm.org/D111219
2021-10-07 20:34:27 +09:00
Raphael Isemann 322e13b91a [lldb] Rewrite/expand TestCppTypedef and document a lookup bug.
Just regrouping the checks for the same typedef together and also giving the
different typedefs unique names. We might want to have a second test with
identical names to see how LLDB handle the potential name conflict, but that
should be a separate test and not part of the main typedef test.

Also this test is actually unintentionally passing. LLDB can't lookup typedefs
in a struct/class scope, but in the test the check passes as the local variable
in the expression evaluation scope pulls in the typedef. I added a second check
that makes it clear that this is not working right now.
2021-10-07 13:30:03 +02:00
Pavel Labath 81a2f39307 [lldb/gdb-remote] Delete SendPacketsAndConcatenateResponses
ReadExtFeature provides equivalent functionality. Also fix a but in
ReadExtFeature, which prevented it from being used for auxv data (it
contains nul characters).
2021-10-07 13:09:27 +02:00
Simon Pilgrim 430ab92910 FunctionLoweringInfo.h - remove unused Optional.h include 2021-10-07 12:07:18 +01:00
Simon Pilgrim b4f4bc0a68 TargetSchedule.h - remove unused Optional.h include 2021-10-07 12:07:17 +01:00
Simon Pilgrim bb8dfefb23 MCSchedule.h - remove unused Optional.h include 2021-10-07 12:07:16 +01:00
Simon Pilgrim e5fa68457a [ExecutionEngine] remove unused <string> includes 2021-10-07 12:07:15 +01:00
Simon Pilgrim 05910b6beb ScalarEvolution.h - remove unused Hashing.h include 2021-10-07 12:07:14 +01:00
Jon Chesterfield 0c554a4769 [libomptarget] Move device environment to shared header, remove divergence
Follow on to D110006, related to D110957

Where implementations have diverged this resolves to match the new DeviceRTL

- replaces definitions of this struct in deviceRTL and plugins with include
- changes the dynamic_shared_size field from D110006 to 32 bits
- handles stdint being unavailable in DeviceRTL
- adds a zero initializer for the field to amdgpu
- moves the extern declaration for deviceRTL to target_interface
  (omptarget.h is more natural, but doesn't work due to include order
  with debug.h)
- Renames the fields everywhere to match the LLVM format used in DeviceRTL
- Makes debug_level uint32_t everywhere (previously sometimes int32_t)

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D111069
2021-10-07 12:03:48 +01:00
Balázs Kéri b7ac68d01e [clang][ASTImporter] Simplify code of attribute import [NFC].
The code of `ASTImporter::Import(const Attr *)` was repetitive,
it is now simplified. (There is still room for improvement but
probably only after big changes.)

Reviewed By: martong, steakhal

Differential Revision: https://reviews.llvm.org/D110810
2021-10-07 13:07:21 +02:00
David Green bf916cdbd2 [ARM] Add tests for code that spills in tail predicate loops. 2021-10-07 11:35:02 +01:00
David Spickett 88f08899da [libcxx][pretty printers] Report not being able to trace test program
If you don't have ptrace permissions this test will fail to run
silently, this adds a check for that and anything else that
might do similar things.

The output will now be:
```
FAILED test program did not run correctly, check gdb warnings

/usr/bin/gdb: warning: Couldn't determine a path for the index cache
directory.
No symbol table is loaded.  Use the "file" command.
warning: Error disabling address space randomization: Operation not
permitted
warning: Could not trace the inferior process.
warning: ptrace: Operation not permitted

error: command failed with exit status: 255
```

We already have a feature to check for a compatible python enabled
gdb, so I think it's reasonable to check for this at test runtime.

Note that this is different to the catch all at the end of the test
script. That would be a case where you can trace but something else
made it stop mid way that wasn't our test breakpoints.

Reviewed By: saugustine

Differential Revision: https://reviews.llvm.org/D110936
2021-10-07 11:02:35 +01:00
Pavel Labath 202af507fd Recommit: [lldb] Remove "dwarf dynamic register size expressions" from RegisterInfo
The previous version of the patch did not update the definitions in
conditionally compiled code. This patch includes changes to ARC and
windows targets.

Original commit message was:

These were added to support some mips registers on linux, but linux mips
support has now been removed due.

They are still referenced in the freebds mips implementation, but the
completeness of that implementation is also unknown. All other
architectures just set these fields to zero, which is a cause of
significant bloat in our register info definitions.

Arm also has registers with variable sizes, but they were implemented in
a more gdb-compatible fashion and don't use this feature.

Differential Revision: https://reviews.llvm.org/D110914
2021-10-07 11:15:00 +02:00
Jay Foad df2d4bc4cb [TwoAddressInstruction] Fix ReplacedAllUntiedUses in processTiedPairs
Fix the calculation of ReplacedAllUntiedUses when any of the tied defs
are early-clobber. The effect of this is to fix the placement of kill
flags on an instruction like this (from @f2 in
 test/CodeGen/SystemZ/asm-18.ll):

  INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], killed %4:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit

After TwoAddressInstruction without this patch:

  %3:grh32bit = COPY killed %4:grh32bit
  INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit

Note that the COPY kills %4, even though there is a later use of %4 in
the INLINEASM. This fails machine verification if you force it to run
after TwoAddressInstruction (currently it is disabled for other
reasons).

After TwoAddressInstruction with this patch:

  %3:grh32bit = COPY %4:grh32bit
  INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit

Differential Revision: https://reviews.llvm.org/D110848
2021-10-07 10:10:11 +01:00
Jay Foad 85abedd750 [TwoAddressInstruction] Pre-commit a test case for D110848 2021-10-07 10:10:11 +01:00
Adrian Kuegel 2bb208ddfd [mlir] Don't allow dynamic extent tensor types for ConstShapeOp.
ConstShapeOp has a constant shape, so its type can always be static.
We still allow it to have ShapeType though.

Differential Revision: https://reviews.llvm.org/D111139
2021-10-07 10:56:16 +02:00
Cullen Rhodes 14cb138b15 [AArch64][SME] Update DUP (predicate) instruction
Changes in architecture revision 00eac1:
  * Renamed to PSEL.
  * Copies whole source register.
  * Element type suffix removed from destination.
  * Element index no longer optional and '#' prefix has been removed.

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-09

Depends on D111212.

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D111213
2021-10-07 08:55:11 +00:00
Cullen Rhodes 42ba79b7b0 [AArch64][SME] Update tile slice index offset
Changes in architecture revision 00eac1:
  * Tile slice index offset no longer prefixed with '#'.
  * The syntax for 128-bit (.Q) ZA tile slice accesses must now include
    an explicit zero index.

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2021-09

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D111212
2021-10-07 08:55:10 +00:00
Florian Hahn 09fdfd03ea
[VPlan] Replace hard-coded VPValue ids with patterns in tests.
This makes the tests a bit more robust with respect to small changes in
the value numbering.
2021-10-07 09:52:01 +01:00
David Spickett 17608d345f [libcxx][pretty printers] Correct locale for u16/u32 string tests
When the locale is not some UTF-8 these tests fail.
(different results for python2 linked gdbs vs. python3
but same issue)

Setting the locale just for the test works around this.
By default Ubuntu comes with just C.UTF-8. I've chosen
to use en_US.UTF-8 instead given that my Mac doesn't have
the former and there's a slim chance this test might run there.

This also enables the u16string tests which are now passing.

Reviewed By: #libc, ldionne, saugustine

Differential Revision: https://reviews.llvm.org/D111138
2021-10-07 09:26:26 +01:00
David Spickett da59376546 [libcxx][CI] Install all locales used by the test suite
Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D111235
2021-10-07 09:24:17 +01:00
Tobias Gysi 3fe7fe4424 [mlir][linalg] Add unsigned min/max/cast function to OpDSL.
Update OpDSL to support unsigned integers by adding unsigned min/max/cast signatures. Add tests in OpDSL and on the C++ side to verify the proper signed and unsigned operations are emitted.

The patch addresses an issue brought up in https://reviews.llvm.org/D111170.

Reviewed By: rsuderman

Differential Revision: https://reviews.llvm.org/D111230
2021-10-07 06:27:20 +00:00
Saiyedul Islam 06404d5488 [Clang][OpenMP] Fix windows buildbot failure for D105191
Fixes 4c41170895.
2021-10-07 05:54:56 +00:00
Mikael Holmen 9bf5d91361 [GlobalISel] Silence gcc warning about unused variable 2021-10-07 07:18:04 +02:00
Saiyedul Islam 4c41170895 [Clang][OpenMP] Add partial support for Static Device Libraries
An archive containing device code object files can be passed to
clang command line for linking. For each given offload target
it creates a device specific archives which is either passed to llvm-link
if the target is amdgpu, or to clang-nvlink-wrapper if the target is
nvptx. -L/-l flags are used to specify these fat archives on the command
line. E.g.
  clang++ -fopenmp -fopenmp-targets=nvptx64 main.cpp -L. -lmylib

It currently doesn't support linking an archive directly, like:
  clang++ -fopenmp -fopenmp-targets=nvptx64 main.cpp libmylib.a

Linking with x86 offload also does not work.

Reviewed By: ye-luo

Differential Revision: https://reviews.llvm.org/D105191
2021-10-07 04:45:19 +00:00
hsmahesha 393581d8a5 [CFE][Codegen] Update auto-generated check lines for few GPU lit tests
which is essentially required as a pre-commit for https://reviews.llvm.org/D110257.

Reviewed By: yaxunl

Differential Revision: https://reviews.llvm.org/D110676
2021-10-07 09:05:39 +05:30
Jason Molenda 62d9163830 Don't register mem segments that aren't present in a corefile
A Mach-O corefile has an array of memory segments, representing
the memory of the process at the point of the capture.  Each segment
has a virtual address + size, and a file offset + size.  The file
size may be less than the virtual address size, indicating that
the memory was unavailable. When ProcessMachCore::DoLoadCore scans
this array of memory segments, it builds up a table to translate
virtual addresses to file offsets, for memory read requests.
This lookup table combines contiguous memory segments into a single
entry, to reduce the number of entries (some corefile writers will
emit a separate segement for each virtual meory page).

This contiguous check wasn't taking into account a segment that
isn't present in the corefile, e.g. filesize==0, and every contiguous
memory segment after that point would result in lldb reading the
wrong offset of the file because it didn't account for this.

I'd like to have an error message when someone tries to read memory from
one of these segments, instead of returning all zeroes, so this patch
intentionally leaves these out of the vmaddr -> fileoff table (and
avoids combining them with segments that actually do exist in the
corefile).

I'm a little unsure of writing a test for this one; I'd have to do
a yaml2obj of a corefile with the problem, or add an internal mode
to the Mach-O process save-core where it could write a filesize==0
segment while it was writing one.

rdar://83382487
2021-10-06 20:12:21 -07:00
Jason Molenda 809652c93b Update TODO noting that DriverKit should be added too
When BridgeOS and DriverKit are added to llvm Triple.
2021-10-06 20:12:21 -07:00
Uday Bondhugula 1e39d32c5a [MLIR] Add OrOp folding rule for constant one operand
Add folding rule for std.or op when an operand has all bits set.

or(x, <all bits set>) -> <all bits set>

Differential Revision: https://reviews.llvm.org/D111206
2021-10-07 08:05:39 +05:30
Itay Bookstein 40ec1c0f16 [IR][NFC] Rename getBaseObject to getAliaseeObject
To better reflect the meaning of the now-disambiguated {GlobalValue,
GlobalAlias}::getBaseObject after breaking off GlobalIFunc::getResolverFunction
(D109792), the function is renamed to getAliaseeObject.
2021-10-06 19:33:10 -07:00
Artem Belevich 6707a7d7e9 [CUDA] remove unneeded includes from CUDA-related headers.
This should fix bot failures on PPC and windows.
2021-10-06 17:20:21 -07:00
Mogball 8f0c673d20 [MLIR] fix arith dialect build failure
Missing function defs causes errors on some build configs.
2021-10-06 23:39:10 +00:00
David Blaikie f6a561c4d6 DebugInfo: Use clang's preferred names for integer types
This reverts c7f16ab3e3 / r109694 - which
suggested this was done to improve consistency with the gdb test suite.
Possible that at the time GCC did not canonicalize integer types, and so
matching types was important for cross-compiler validity, or that it was
only a case of over-constrained test cases that printed out/tested the
exact names of integer types.

In any case neither issue seems to exist today based on my limited
testing - both gdb and lldb canonicalize integer types (in a way that
happens to match Clang's preferred naming, incidentally) and so never
print the original text name produced in the DWARF by GCC or Clang.

This canonicalization appears to be in `integer_types_same_name_p` for
GDB and in `TypeSystemClang::GetBasicTypeEnumeration` for lldb.

(I tested this with one translation unit defining 3 variables - `long`,
`long (*)()`, and `int (*)()`, and another translation unit that had
main, and a function that took `long (*)()` as a parameter - then
compiled them with mismatched compilers (either GCC+Clang, or
Clang+(Clang with this patch applied)) and no matter the combination,
despite the debug info for one CU naming the type "long int" and the
other naming it "long", both debuggers printed out the name as "long"
and were able to correctly perform overload resolution and pass the
`long int (*)()` variable to the `long (*)()` function parameter)

Did find one hiccup, identified by the lldb test suite - that CodeView
was relying on these names to map them to builtin types in that format.
So added some handling for that in LLVM. (these could be split out into
separate patches, but seems small enough to not warrant it - will do
that if there ends up needing any reverti/revisiting)

Differential Revision: https://reviews.llvm.org/D110455
2021-10-06 16:02:34 -07:00
Kuba Mracek 7329abf2f8 [GlobalDCE] In VFE, replace the whole 'sub' expression of unused relative-pointer-based vtable slots
Differential Revision: https://reviews.llvm.org/D109114
2021-10-06 15:55:55 -07:00
Stella Laurenzo 56272257f3 Return failure on failure in convertBlockSignature.
This was causing a subsequent assert/crash when a type converter failed to convert a block argument.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D110985
2021-10-06 15:35:31 -07:00
LLVM GN Syncbot ae4c0c7cfc [gn build] Port ccfb0555f7 2021-10-06 22:24:38 +00:00
Artem Belevich ccfb0555f7 [CUDA] Implement experimental support for texture lookups.
The patch implements header-only support for testure lookups.

The patch has been tested on a source file with all possible combinations of
argument types supported by CUDA headers, compiled and verified that the
generated instructions and their parameters match the code generated by NVCC.
Unfortunately, compiling texture code requires CUDA headers and can't be tested
in clang itself.  The test will need to be added to the test-suite later.

While generated code compiles and seems to match NVCC, I do not have any code
that uses textures that I could test correctness of the implementation. Hence
the experimental status.

Differential Revision: https://reviews.llvm.org/D110089
2021-10-06 15:15:53 -07:00
Arthur Eubanks 72dddce652 More size_t -> uint64_t fixes after 05392466
Fixes some bots where the two differ.
2021-10-06 15:13:47 -07:00
Richard Smith 141df74456 Add missing diagnostic for use of _reserved name in extern "C"
declaration.

Names starting with an underscore are reserved at the global scope, so
cannot be used as the name of an extern "C" symbol in any scope because
such usages conflict with a name at global scope.
2021-10-06 15:13:06 -07:00
Richard Smith 7063b76b02 PR50644: Do not warn on a declaration of `operator"" _foo`.
Also do not warn on `#define _foo` or `#undef _foo`.

Only global scope names starting with _[a-z] are reserved, not the use
of such an identifier in any other context.
2021-10-06 15:13:05 -07:00