Commit Graph

461118 Commits

Author SHA1 Message Date
Valentin Clement
0c4d7d14e9 [mlir][openacc] Add ReturnLike trait to acc.yield operation
Just add the trait as acc.yield is a return like op.

Reviewed By: razvanlupusoru, jeanPerier

Differential Revision: https://reviews.llvm.org/D150617
2023-05-16 08:43:58 -07:00
Juan Manuel MARTINEZ CAAMAÑO
33da608ecc [AMDGPU][InferAddressSpaces] Only rewrite address-spaces that can be trivially casted to flat for llvm.amdgcn.flat.atomic.{fadd,fmax,fmin}
The intrinsic @llvm.amdgcn.flat.atomic.{fadd,fmax,fmin} can only be
selected for flat address spaces (constant, flat and global).

This patch restricts the cases over which GCNTTIImpl::rewriteIntrinsicWithAddressSpace
rewrites the intrinsic.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D149938
2023-05-16 17:32:58 +02:00
Matt Arsenault
fa5e6697c4 LangRef: Clarify behavior of minnum/maxnum
Make it clearer minnum(+0, +0) cannot return -0. Also remove
a note about the result always being quiet which is directly
contradicted by the following paragraph.
2023-05-16 16:32:30 +01:00
Matt Arsenault
6923a67db8 GlobalOpt: Improve addrspacecast handling
Handle addrspacecast when looking at uses.
2023-05-16 16:32:30 +01:00
Matt Arsenault
3121816ab9 GlobalOpt: Add a test for addrspacecast coverage with alloc functions
AllUsesOfValueWillTrapIfNull could handle addrspacecast, but currently
doesn't.
2023-05-16 16:32:30 +01:00
Timm Bäder
5fd35c326a Revert "[clang] Show line numbers in diagnostic code snippets"
This reverts commit e2917311f0.

This caused some problems with lldb testing the diagnostic output:
https://lab.llvm.org/buildbot/#/builders/68/builds/52754
2023-05-16 17:26:48 +02:00
Timm Bäder
8bc0a29f01 [clang][docs] Fix sphinx bot
Breakage:
https://lab.llvm.org/buildbot/#/builders/92/builds/44222
2023-05-16 17:20:40 +02:00
Timm Bäder
e2917311f0 [clang] Show line numbers in diagnostic code snippets
Show line numbers to the left of diagnostic code snippets and increase
the numbers of lines shown from 1 to 16.

Differential Revision: https://reviews.llvm.org/D147875
2023-05-16 17:12:47 +02:00
Phoebe Wang
360d0cd0a2 [LLD] Do not assume /guard:cf always set together with /guard:ehcont
MS link accepts *.obj with ehcont bit set only. LLD should match this
behavoir too.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D150508
2023-05-16 23:12:03 +08:00
Alexey Lapshin
788e6ff4e5 [DWARFLinker][DWARFv5] Add support for .debug_line_str table.
This patch adds support for DWARFv5 .debug_line_str table.
It replaces code generating line table. Instead of copying original
table and patching certain places this patch implements full line table
generation.

Differential Revision: https://reviews.llvm.org/D150554
2023-05-16 16:56:14 +02:00
Bjorn Pettersson
198e0a12f6 [MemCpyOpt] Fix up debug loc for simplified memset in processMemSetMemCpyDependence
Make sure the code comments in processMemSetMemCpyDependence match
with the actual transform. They indicated that the memset being
rewritten was sunk to after a memcpy, while it actually is inserted
just before the memcpy.

Also make sure we use the debug location of the original memset
when creating the new simplified memset. In the past we've been
using the debug location for the memcpy which could be a bit
confusing.

Differential Revision: https://reviews.llvm.org/D135574
2023-05-16 16:54:51 +02:00
Jay Foad
64c938e8e3 [AMDGPU] Avoid RegScavenger::forward in copyPhysReg/indirectCopyToAGPR
RegScavenger::backward is preferred because it does not rely on accurate
kill flags.

Differential Revision: https://reviews.llvm.org/D150571
2023-05-16 15:51:31 +01:00
Bjorn Pettersson
e016fe817c Revert "[GlobalIsel][X86] Legalize G_BSWAP"
This reverts commit 5cafecf9f9.

Buildbots are not happy with the patch.

Lots of crashes and assertion failures such as

  llvm::LegalizeRuleSet &llvm::LegalizerInfo::getActionDefinitionsBuilder(
  std::initializer_list<unsigned int>): Assertion `Opcodes.size() >= 2 &&
  "Initializer list must have at least two opcodes"' failed.
2023-05-16 16:40:16 +02:00
Jon Roelofs
70818f442d tsan-rt: silence a -Wunused-const-variable 2023-05-16 07:25:21 -07:00
Jon Roelofs
cd4ffbe0ff lsan-rt: silence a -Wformat-pedantic 2023-05-16 07:24:54 -07:00
Jon Roelofs
54d227312c asan-rt: silence some more -Wformat-pedantic's 2023-05-16 07:21:00 -07:00
zhijian
d78a723743 [AIX] Fixed malformed big archive when total archive file size is large than 4Gbytes
Summary:

1. we use the unsigned type for NextOffset,PrevOffset ,GlobalSymbolOffset , MemberTableSize, it will caused a malform big archive when the archive file size is large than 4G.
2. also fix a NFC comment on https://reviews.llvm.org/D142479#inline-1443927

Reviewers: James Henderson
Differential Revision: https://reviews.llvm.org/D150462
2023-05-16 10:13:57 -04:00
Bjorn Pettersson
3ce72cd5f6 Remove some includes that shouldn't be needed any longer
This remove a bunch of #include statements in Scalar.cpp. I do not
think those should be needed any longer (assuming that they once
upon a time possibly were needed for legacy PM C bindings, but
that is not supported any longer).

Also removing some other #include statements not needed any longer
due to deprecation of legacy PM.

Differential Revision: https://reviews.llvm.org/D149438
2023-05-16 16:10:51 +02:00
Sander de Smalen
9b5f19714c [AArch64][SME2/SVE2p1] Add predicate-as-counter intrinsics for pext (multi)
These intrinsics are used to implement the pext intrinsics that extract
two predicates (mask) from a predicate-as-counter value, e.g.

  __attribute__((arm_streaming))
   svboolx2_t svpext_lane_c8_x2(svcount_t pnn, uint64_t imm);

As described in https://github.com/ARM-software/acle/pull/217

Reviewed By: kmclaughlin

Differential Revision: https://reviews.llvm.org/D150442
2023-05-16 14:04:16 +00:00
Sander de Smalen
094005eb66 [AArch64][SME2/SVE2p1] Add predicate-as-counter intrinsics for pext (single)
These intrinsics are used to implement the pext intrinsics that extract
a predicate (mask) from a predicate-as-counter value, e.g.

   __attribute__((arm_streaming))
   svbool_t svpext_lane_c8(svcount_t pnn, uint64_t imm);

As described in https://github.com/ARM-software/acle/pull/217

Reviewed By: david-arm

Differential Revision: https://reviews.llvm.org/D150441
2023-05-16 14:04:16 +00:00
Thorsten Schütt
5cafecf9f9 [GlobalIsel][X86] Legalize G_BSWAP
remark: unable to legalize instruction: %95:_(s16) = G_BSWAP %94:_ (in function: _ZNK4llvm13DataExtractor6getU16EPyPtj) [-Rpass-missed=gisel-legalize]

check plan: ninja check-llvm-codegen-x86

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D150667
2023-05-16 16:02:58 +02:00
Qiongsi Wu
1b1f1b9079 [clang][AIX] Adding Revised xcoff-roptr CodeGen Test Case
https://reviews.llvm.org/D150586 removed a problematic test cases that caused failures on non-ppc buildbots. This patch revises the test case and adds it back.

Reviewed By: hubert.reinterpretcast

Differential Revision: https://reviews.llvm.org/D150597
2023-05-16 09:41:24 -04:00
Michael Klein
3b6a368d76 [analyzer] Fix QTimer::singleShot NewDeleteLeaks false positive
Fixes #39713

fferential Revision: https://reviews.llvm.org/D150552
2023-05-16 15:38:55 +02:00
Matt Arsenault
0ee2245ab2 ValueTracking: Restore ordered negative handling for frem
In D148674, the negative condition was weakened to only
checking isKnownNever(fcNegative), instead of cannotBeOrderedLessThanZero().

This avoids a regression when CannotBeOrderedLessThanZero is
replaced with computeKnownFPClass.
2023-05-16 14:38:39 +01:00
Timm Bäder
2dc435a59d [clang][NFC] Use llvm::count_if instead of manual loop 2023-05-16 15:35:05 +02:00
Matt Arsenault
c9f88e5bf0 ValueTracking: fadd/fsub +0 cannot return -0
Copied from CannotBeNegativeZero and extended to cover fsub.
2023-05-16 14:33:34 +01:00
Sergei Barannikov
44e99c75b7 [clang] Regenerate checks in OpenMP tests with opaque-pointers enabled 2023-05-16 16:29:09 +03:00
LLVM GN Syncbot
364e455937 [gn build] Port 7158fd381a 2023-05-16 13:22:38 +00:00
Jun Zhang
7158fd381a Revert "[clang-repl] Introduce Value to capture expression results"
This reverts commit a423b7f1d7.
See https://lab.llvm.org/buildbot/#/changes/95083
2023-05-16 21:21:52 +08:00
David Candler
f2bb57c194 [builtins][test] Use architecture specific float16 check
The COMPILER_RT_HAS_FLOAT16 cmake check is now set per architecture,
which needs to be reflected when building the tests.

Additionally added armhf to the architecture list.

Reviewed By: dim

Differential Revision: https://reviews.llvm.org/D150281
2023-05-16 14:21:22 +01:00
Tobias Gysi
429582d946 [mlir][llvm] Add is constant intrinsic.
The revision adds LLVM's is constant intrinsic.

Depends on D150643

Reviewed By: Dinistro

Differential Revision: https://reviews.llvm.org/D150660
2023-05-16 13:16:02 +00:00
Weining Lu
ddb27b1870 [Clang][LoongArch] Pass the -mabi and -target-abi options to as and cc1as respectively
This change is necessary to set correct EFlags according to the
options (-m*-float and -mabi=) passed to clang when input is assembly.

Note: `-mabi=` is not documented by `as`.
```
$ as --version
GNU assembler (GNU Binutils) 2.40.50.20230316
...
$ as --target-help
LARCH options:
```

But we can see gcc invokes `as` and passes the `-mabi=` option when compiling C or assembly.
```
$ gcc -c a.c -v 2>&1 -msoft-float | grep "as -v"
 as -v -mabi=lp64s -o a.o /tmp/ccFrxzZi.s
$ gcc -c a.s -v 2>&1 -msoft-float | grep "as -v"
 as -v -mabi=lp64s -o a.o a.s
```

Reviewed By: xen0n

Differential Revision: https://reviews.llvm.org/D150537
2023-05-16 21:10:15 +08:00
Weining Lu
2cf0314029 [LoongArch] Move lp64s out of the unimplemented calling conv list
lp64s is same as lp64d execpt that floating point arguments and return
values are always passed via GPRs or stack which means `UseGPRForFloat`
is always `true` in `CC_LoongArch` for lp64s.

One motivation of this change is to build linux which uses
`-msoft-float` and `-mabi=lp64s` [1].

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/loongarch/Makefile?h=v6.4-rc1#n49

Reviewed By: xen0n, hev

Differential Revision: https://reviews.llvm.org/D150417
2023-05-16 21:09:31 +08:00
Sam McCall
8f8479789a [clangd] downgrade missing-includes diagnostic to Information level
In practice, a Warning on every occurrence is very unpopular, even on a codebase
with clear rules about direct inclusion & moderately good compliance.

This change has various practical effects (in vscode for concreteness):
  - makes the diagnostic decoration less striking (blue vs yellow)
  - makes these diagnostics visually distinct from others when reading
  - causes these diagnostics to sort last in the "problems" view
  - allows these diagnostics to be easily filtered from the "problems" view

Differential Revision: https://reviews.llvm.org/D149912
2023-05-16 15:03:50 +02:00
David Green
8178de3273 [AArch64] Change the type of i64 neon shifts to v1i64
This alters the lowering of shifts by a constant, so that the type is lowered
to a v1i64 instead of a i64. This helps communicate that the type will live in
a neon register, and can help clean up surrounding code. Note this is only
currently for the scalar shifts of a constant that go through the nodes in
tryCombineShiftImm.

ssra instructions are no longer being recognized in places, but that can be
cleaned up in a followup patch that combines the i64 add into a v1i64 add.

Differential Revision: https://reviews.llvm.org/D148309
2023-05-16 14:03:15 +01:00
Nico Weber
a7752e85cf [gn build] Port a423b7f1d7 (ClangReplInterpreterTests -rdynamic) 2023-05-16 09:02:36 -04:00
Sergei Barannikov
ef2a823a19 [clang] Convert a few OpenMP tests to opaque pointers
Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D150652
2023-05-16 16:01:50 +03:00
Takuya Shimizu
0e167fc0a2 [clang][AST] Print name instead of type when diagnosing uninitialized subobject in constexpr variables
This patch improves the diagnostic on uninitialized subobjects in constexpr variables by modifying the diagnostic message to display the subobject's name instead of its type.

Fixes https://github.com/llvm/llvm-project/issues/58601
Differential Revision: https://reviews.llvm.org/D146358
2023-05-16 21:49:57 +09:00
Thorsten Schütt
b5f2bc2ddf [GlobalIsel][x86] Legalize G_AND, G_OR, and G_XOR for AVX2
check plan:  ninja check-llvm-codegen-x86

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D150658
2023-05-16 14:40:01 +02:00
Matthias Springer
61223c49dd [mlir][GPU] Rename MLIRGPUOps CMake target to MLIRGPUDialect
This is for consistency with other dialects.

Differential Revision: https://reviews.llvm.org/D150659
2023-05-16 14:25:08 +02:00
David Green
d20afbd902 [AArch64] Additional testing for uqshl and regenerate arm64-vshift.ll. NFC
This tries to fill in some missing testing for neon shift intrinsics, and
regenerates the existing tests. See D148309 and D148311.
2023-05-16 13:16:42 +01:00
Jun Zhang
a423b7f1d7 [clang-repl] Introduce Value to capture expression results
This is the second part of the below RFC:
https://discourse.llvm.org/t/rfc-handle-execution-results-in-clang-repl/68493

This patch implements a Value class that can be used to carry expression
results in clang-repl. In other words, when we see a top expression
without semi, it will be captured and stored to a Value object. You can
explicitly specify where you want to store the object, like:

```
Value V;
llvm::cantFail(Interp->ParseAndExecute("int x = 42;"));
llvm::cantFail(Interp->ParseAndExecute("x", &V));
```

`V` now stores some useful infomation about `x`, you can get its real
value (42), it's `clang::QualType` or anything interesting.

However, if you don't specify the optional argument, it will be captured
to a local variable, and automatically called `Value::dump`, which is
not implemented yet in this patch.

Signed-off-by: Jun Zhang <jun@junz.org>
2023-05-16 20:10:49 +08:00
Jun Zhang
247fa04116 [clang] Add a new annotation token: annot_repl_input_end
This patch is the first part of the below RFC:
https://discourse.llvm.org/t/rfc-handle-execution-results-in-clang-repl/68493

It adds an annotation token which will replace the original EOF token
when we are in the incremental C++ mode. In addition, when we're
parsing an ExprStmt and there's a missing semicolon after the
expression, we set a marker in the annotation token and continue
parsing.

Eventually, we propogate this info in ParseTopLevelStmtDecl and are able
to mark this Decl as something we want to do value printing. Below is a
example:

clang-repl> int x = 42;
clang-repl> x
// `x` is a TopLevelStmtDecl and without a semicolon, we should set
// it's IsSemiMissing bit so we can do something interesting in
// ASTConsumer::HandleTopLevelDecl.

The idea about annotation toke is proposed by Richard Smith, thanks!

Signed-off-by: Jun Zhang <jun@junz.org>

Differential Revision: https://reviews.llvm.org/D148997
2023-05-16 20:10:43 +08:00
Wang, Xin10
8a5450d322 Fix regression after D150436
llvm-clang-x86_64-expensive-checks-debian will fail after D150436 merged.
The fail occurred in X86, I changed the sort rule in AsmMatcher in Patch D150436, so x86 code will arrive line 633 first(will not affect other targets).
The logic here want to use the order record written in source file to make AsmMatcher to first use AVX instructions, it used field HasPositionOrder.
But the condition here just makes sure one of the compared record is subclass of Instruction and has field HasPositionOrder true, and didn't check another.

(Committing on behalf of @XinWang10 to unblock broken expensive-cjhecks builds)

Differential Revision: https://reviews.llvm.org/D150651
2023-05-16 13:04:44 +01:00
Corentin Jabot
d4a6e4c1ee Revert "[Clang] Fix parsing of (auto(x))."
This reverts commit ef47318ec3.

This patch breaks valid code https://reviews.llvm.org/D149276#4345620
2023-05-16 13:56:33 +02:00
Alvin Wong
65abcf6c0c [asan][test][win] Move MSVC-specific tests into a subdir
This moves all but one remaining tests which use clang-cl and test
MSVC-specific behaviour into its own subdirectory. `dll_host.cpp` test
is excluded from the move because other tests also depend on its source
file, making it not MSVC-specific.

Differential Revision: https://reviews.llvm.org/D150271
2023-05-16 19:53:49 +08:00
Alvin Wong
51015af773 [asan][test][win] Remove REQUIRES: asan-rtl-heap-interception
This appears to be a leftover from when these tests were first added in
D62927. Because of this, these tests had never run with `check-asan` or
`check-asan-dynamic`.

I've tested locally that these tests do pass on both i686 MSVC and MinGW
targets. They are disabled for 64-bit though, and I believe no LLVM
buildbots are testing for 32-bit Windows targets.

Differential Revision: https://reviews.llvm.org/D150270
2023-05-16 19:53:49 +08:00
Alvin Wong
fe4a5a08b9 [asan][test][win] Port more tests to not use clang-cl on MinGW (4)
This ports some tests that requires dead stripping or ICF.

Differential Revision: https://reviews.llvm.org/D150269
2023-05-16 19:53:49 +08:00
Alvin Wong
6282315f8a [asan][test][win] Port more tests to not use clang-cl on MinGW (3)
This ports tests which requires additional link flags.

Differential Revision: https://reviews.llvm.org/D150268
2023-05-16 19:53:49 +08:00
Alvin Wong
5ad8bbee23 [asan][test][win] Port more tests to not use clang-cl on MinGW (2)
Continuation of D147432 and D147444.

Differential Revision: https://reviews.llvm.org/D150267
2023-05-16 19:53:49 +08:00