452386 Commits

Author SHA1 Message Date
NAKAMURA Takumi
aeafcbcd75 llvm-tblgen: Add "TableGenBackends.h" to each emitter.
"TableGenBackends.h" has declarations of emitters.
2023-02-19 03:06:32 +09:00
NAKAMURA Takumi
b3405ace95 llvm-tblgen: Add missing includes 2023-02-19 03:06:31 +09:00
NAKAMURA Takumi
655f4cb0e4 llvm-tblgen: Reformat 2023-02-19 03:06:31 +09:00
Amara Emerson
ddf167c442 [GlobalISel] Fix G_ZEXTLOAD being converted to G_SEXTLOAD incorrectly.
The extending loads combine tries to prefer sign-extends folding into loads vs
zexts, and in cases where a G_ZEXTLOAD is first used by a G_ZEXT, and then used
by a G_SEXT, it would select the G_SEXT even though the load is already
zero-extending.

Fixes issue #59630
2023-02-18 10:05:08 -08:00
Florian Hahn
a9a1950115
Revert "[SCCP] Remove legacy SCCP pass."
This reverts commit 5356fefc19df3fbf32d180b1b10e6226e8743541.

It looks like Polly still relies on the legacy SCCP pass. Bring it back
until the best way forward is determined.
2023-02-18 18:01:37 +00:00
Mark de Wever
9adf78d6a7 [NFC][libc++][format] Small improvements.
While working on the formatter for the thread::id several minor issues
where spotted. This fixes them.
2023-02-18 18:59:32 +01:00
Florian Hahn
5356fefc19
[SCCP] Remove legacy SCCP pass.
This is part of the optimization pipeline, of which the legacy pass manager version is deprecated.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D144201
2023-02-18 17:54:30 +00:00
Mark de Wever
c1877e6465 [NFC][libc++][doc] Fixes formatting. 2023-02-18 18:30:56 +01:00
Kelvin Li
838a4d348d [Flang] Add PowerPC intrinsics
This patch adds a subset of PowerPC intrinsics - fmadd,
fmsub, fnmadd and fnmsub.

Differential Revision: https://reviews.llvm.org/D143951
2023-02-18 11:56:03 -05:00
Kristina Bessonova
5dde2bcdd1 [AArch64InstPrinter][llvm-objdump] Print ADR PC-relative label as a target address hexadecimal form
This is similar to ADRP and matches GNU objdump:

GNU objdump:
```
0000000000200100 <_start>:
  200100:    adr    x0, 201000 <_start+0xf00>
```

llvm-objdump (before patch):
```
0000000000200100 <_start>:
  200100:    adr    x0, #3840
```

llvm-objdump (after patch):
```
0000000000200100 <_start>:
  200100:    adr    x0, 0x201000 <_start+0xf00>
```

Reviewed By: simon_tatham, peter.smith

Differential Revision: https://reviews.llvm.org/D144079
2023-02-18 18:31:21 +02:00
DianQK
7be55b0076
[SimplifyCFG] Check if the return instruction causes undefined behavior
This should fix https://github.com/rust-lang/rust/issues/107681.

Return undefined to a noundef return value is undefined.

Example:

```
define noundef i32 @test_ret_noundef(i1 %cond) {
entry:
  br i1 %cond, label %bb1, label %bb2
bb1:
  br label %bb2
bb2:
  %r = phi i32 [ undef, %entry ], [ 1, %bb1 ]
  ret i32 %r
}
```

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D144319
2023-02-18 23:31:57 +08:00
Tue Ly
4d5fd9b79f [libc][bazel] Fix missing dependency in test/src/stdlib targets. 2023-02-18 10:16:13 -05:00
Sanjay Patel
a8831631c7 [InstCombine] add tests for 1<<cttz(x); NFC
issue #60799
issue #60801
2023-02-18 08:34:55 -05:00
Nikolas Klauser
b69963eb3f [libc++] Fix header includes in <__atomic/cxx_atomic_impl.h>
Reviewed By: #libc, philnik

Spies: Mordante, paulkirth, libcxx-commits

Differential Revision: https://reviews.llvm.org/D144307
2023-02-18 14:23:24 +01:00
Mark de Wever
2f2ed47714 [libc++][test] Removes rapid-cxx-test.h.
Depends on D142808

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D143383
2023-02-18 12:51:53 +01:00
eopXD
b531192254 [Doc] Fix type-o under LangRef
Signed-off-by: eop Chen <eop.chen@sifive.com>
2023-02-18 02:12:24 -08:00
Amara Emerson
556657c0fd [NFC][GlobalISel] Regenerate test checks for extending-loads test. 2023-02-18 01:49:08 -08:00
Benjamin Kramer
7ac658a07b [WebAssembly] assert(false) -> llvm_unreachable
Avoids warnings in -asserts builds.

ASTContext.cpp:4098:1: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]
}
^
2023-02-18 09:38:18 +01:00
Ethan Luis McDonough
9ce8eb0fbc
[flang] Remove macro replacement in angular bracket includes
Addresses Github issue [[ https://github.com/llvm/llvm-project/issues/60317 | #60317 ]].

Reviewed By: klausler

Differential Revision: https://reviews.llvm.org/D143469
2023-02-18 01:59:32 -06:00
LLVM GN Syncbot
5e262d58c4 [gn build] Port 79320a0c3f82 2023-02-18 06:30:26 +00:00
Cyndy Ishida
79320a0c3f
Reland "[TextAPI] Implement TBDv5 Reader"
Introduce initial reader for TBDv5 which is in JSON. This captures all
the currently understood fields within the internal structure
`InterfaceFile`.
New fields will be followed up in future PRs.

Reviewed By: pete

Differential Revision: https://reviews.llvm.org/D144156
2023-02-17 22:27:08 -08:00
Shengchen Kan
d3745461da [X86][NFC] Assert MRMr0 format from emitREXPrefix
The only instruction of this format is VEX encoding
2023-02-18 14:15:31 +08:00
Lang Hames
2ec1aba2b6 [llvm-jitlink] Discard allocation actions in -noexec mode.
Allocation actions may run JIT'd code, which isn't permitted in -noexec mode.

Testcases that depend on actions running should be moved to the ORC runtime.
2023-02-17 20:18:23 -08:00
Kirill Stoimenov
b4b5006be5 [LSAN] Mask out tags from pointers on ARM in MaybeUserPointer heuristic
This caused false positives because the existing logic was not taking into account that pointers could have a tag in them.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D144305
2023-02-18 03:37:56 +00:00
Paulo Matos
890146b192 [WebAssembly] Initial support for reference type externref in clang
This patch introduces a new type __externref_t that denotes a WebAssembly opaque
reference type. It also implements builtin __builtin_wasm_ref_null_extern(),
that returns a null value of __externref_t. This lays the ground work
for further builtins and reference types.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D122215
2023-02-17 18:48:48 -08:00
Ye Luo
e2069be83e [OpenMP] Make isDone lightweight without calling synchronize
~TaskAsyncInfoWrapperTy() calls isDone. With synchronize inside isDone, we need to handle the error return from synchronize in the destructor.
The consumers of TaskAsyncInfoWrapperTy, targetDataMapper and targetKernel, both call AsyncInfo.synchronize() before exiting.
For this reason in ~TaskAsyncInfoWrapperTy(), calling synchronize() via isDone() is redundant.
This patch removes synchronize() call inside isDone() and makes it a lightweight check.
__tgt_target_nowait_query needs to call synchronize() before checking isDone().

Differential Revision: https://reviews.llvm.org/D144315
2023-02-17 20:45:43 -06:00
Matt Arsenault
c42eda5d36 IROutliner: cast instead of dyn_cast and assert 2023-02-17 22:28:09 -04:00
Matt Arsenault
e8444078ed CodeExtractor: Fix creating addrspacecasts for lifetime markers
Also stop caring about typed pointers.
2023-02-17 22:27:29 -04:00
Fangrui Song
432caca39a Simplify with hasFeature. NFC 2023-02-17 18:22:24 -08:00
Renaud-K
2c53840199 [flang] Adding fir::getSymbolAttrName attribute to the function corresponding to the main subprogram.
This is because the source name cannot be deconstructed from _QQmain

Differential revision: https://reviews.llvm.org/D144295
2023-02-17 18:20:03 -08:00
Philip Reames
495b653480 [RISCV] Add missing plumbing and tests for zfa
Experimental support for the zfa extension was recently added in https://reviews.llvm.org/D141984. A couple of the normal test changes and clang plumbing got missed in that change. This commit updates the usual suspects.

Differential Revision: https://reviews.llvm.org/D144288
2023-02-17 17:56:30 -08:00
Dave Lee
63c77bf71d [lldb] Make persisting result variables configurable
Context: The `expression` command uses artificial variables to store the expression
result. This result variable is unconditionally kept around after the expression command
has completed. These variables are known as persistent results. These are the variables
`$0`, `$1`, etc, that are displayed when running `p` or `expression`.

This change allows users to control whether result variables are persisted, by
introducing a `--persistent-result` flag.

This change keeps the current default behavior, persistent results are created by
default. This change gives users the ability to opt-out by re-aliasing `p`. For example:

```
command unalias p
command alias p expression --persistent-result false --
```

For consistency, this flag is also adopted by `dwim-print`. Of note, if asked,
`dwim-print` will create a persistent result even for frame variables.

Differential Revision: https://reviews.llvm.org/D144230
2023-02-17 17:50:43 -08:00
Dave Lee
920b46e108 [lldb] Add expression command options in dwim-print
Adopt `expression`'s options in `dwim-print`.

This is primarily added to support the `--language`/`-l` flag.

Differential Revision: https://reviews.llvm.org/D144114
2023-02-17 17:50:08 -08:00
LLVM GN Syncbot
e49b93ef29 [gn build] Port 07e3ca238e68 2023-02-18 00:29:10 +00:00
Cyndy Ishida
07e3ca238e Revert "[TextAPI] Implement TBDv5 Reader"
This reverts commit b861b1225380175a5a724e2a677754f5f74e5b0d.
This reverts commit 4be17641b05df1e63fa8e069af92676f1246eb83.

This patch wont build on some compilers on buildbot.
2023-02-17 16:26:23 -08:00
Cyndy Ishida
4be17641b0 [TextAPI] wrap returned Errors in std::move 2023-02-17 16:16:12 -08:00
LLVM GN Syncbot
347954314c [gn build] Port b861b1225380 2023-02-18 00:06:09 +00:00
Cyndy Ishida
b861b12253 [TextAPI] Implement TBDv5 Reader
[TextAPI] Implement TBDv5 Reader

    Introduce initial reader for TBDv5 which is in JSON. This captures all
    the currently understood fields within the internal structure
    `InterfaceFile`.

    New fields & follow up tests will be followed up in future PRs.

Reviewed By: pete

Differential Revision: https://reviews.llvm.org/D144156
2023-02-17 16:03:01 -08:00
Amara Emerson
b309bc04ee [GlobalISel] Combine out-of-range shifts to undef.
Differential Revision: https://reviews.llvm.org/D144303
2023-02-17 15:05:00 -08:00
Shafik Yaghmour
d6d59e660b [Clang] Fix __VA_OPT__ implementation so that it treats the concatenation of a non-placemaker token and placemaker token as a non-placemaker token
Currently the implementation of __VA_OPT__ will treat the concatenation of a
non-placemaker token and placemaker token as a placemaker token which is not
correct. This will fix the implementation and treat the result as a
non-placemaker token.

This fixes: https://github.com/llvm/llvm-project/issues/60268

Differential Revision: https://reviews.llvm.org/D142604
2023-02-17 14:57:32 -08:00
Craig Topper
34aff47521 [RISCV] Use MCSubtargetInfo::hasFeature where possible. NFC
Rather than using operator[] on getFeatureBits we can use
hasFeature to shorten the code.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D144300
2023-02-17 14:36:48 -08:00
Fangrui Song
d9e4c10440 [AArch64] Simplify with MCSubtargetInfo::hasFeature. NFC 2023-02-17 14:29:21 -08:00
Alex Brachet
c0f3ac1d00 Revert "[Fuchsia] Enable llvm-driver build"
This reverts commit 4eadd19cc423b860f7ce0217000276da769b7809.

Doesn't work on macos. I'll investigate more
2023-02-17 21:29:14 +00:00
Nikolas Klauser
b1e09b5fa6 [libc++][NFC] Remove TODOs that are already done 2023-02-17 22:17:54 +01:00
Daniel Thornburgh
8007bcc13f [llvm-cov] Create syntax to pass source w/o binary.
Since binary ID lookup makes CLI object arguments optional, it should be
possible to pass a list of source files without a binary. Unfortunately,
the current syntax will always interpret the first source file as a
binary. This change adds a `-sources` option to cause all later
positional arguments to be considered sources.

Reviewed By: gulfem

Differential Revision: https://reviews.llvm.org/D144207
2023-02-17 13:11:54 -08:00
Alex Brachet
4eadd19cc4 [Fuchsia] Enable llvm-driver build
Differential Revision: https://reviews.llvm.org/D144287
2023-02-17 21:02:18 +00:00
Nikolas Klauser
ef3a3b0726 [libc++][NFC] Replace _VSTD and _LIBCPP_INLINE_VISIBILITY in <__atomic/*>
Reviewed By: Mordante, #libc

Spies: libcxx-commits

Differential Revision: https://reviews.llvm.org/D144258
2023-02-17 21:54:07 +01:00
Philipp Tomsich
10b7cd660c [RISCV] Select signed and unsigned bitfield extracts for XTHeadBb
The XTHeadBb extension hab both signed and unsigned bitfield
extraction instructions (TH.EXT and TH.EXTU, respectively) which have
previously only been supported for sign extension on byte, halfword,
and word-boundaries.

This adds the infrastructure to use TH.EXT and TH.EXTU for arbitrary
bitfield extraction.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D144229
2023-02-17 21:46:26 +01:00
Alex Langford
2f88c07cf8 [lldb] StructuredData should not truncate uint64_t values
In json::Value, getAsInteger returns an optional<int64_t> and getAsNumber
returns an optional<double>. If a value is larger than what an int64_t
can hold but smaller than what a uint64_t can hold, the getAsInteger
function will fail but the getAsNumber will succeed. However, the value
shouldn't be interpreted as a double.

rdar://105556974

Differential Revision: https://reviews.llvm.org/D144238
2023-02-17 12:39:49 -08:00
Mark de Wever
8caa8d95af [libc++][format] Addresses LWG3810.
LWG3810 CTAD for std::basic_format_args

Reviewed By: #libc, philnik

Differential Revision: https://reviews.llvm.org/D144275
2023-02-17 21:08:24 +01:00