Commit Graph

436398 Commits

Author SHA1 Message Date
Martin Storsjö fe7244feb6 [LLD] [test] Add a missing REQUIRES: x86
This was missed in 365d0a5cd8.
2022-09-20 12:39:57 +03:00
Simon Pilgrim 70582bc4d3 Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warnings. NFCI. 2022-09-20 10:35:32 +01:00
Dmitri Gribenko 5d7ff0d87c Fix an unused warning in release build 2022-09-20 11:29:39 +02:00
David Spickett ec3e290502 [lldb] Log when we cannot find an equivalent for a gdb register type
This happens if the type is described elsewhere in target xml as a
<flags> or <struct>.

Also hardcode the function names into the log messages because
if you use __FUNCTION__ in a lambda you just get "operator()".

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D134043
2022-09-20 09:26:55 +00:00
David Spickett 01d8270a15 [LLDB] Make instruction emulation context type private
This is the first step to being able to handle non
trivial types in the union.

info_type effects the lifetime of the objects in the union,
so making it private means we know you have to call one of the
Set<...> functions to change it.

Reviewed By: clayborg

Differential Revision: https://reviews.llvm.org/D134039
2022-09-20 09:10:14 +00:00
Dmitry Polukhin 41dbee1e66 [clang] Update ReleaseNotes about a crash fix (Issue 53628)
Update ReleaseNotes about a crash fix (Issue 53628)

Test Plan: none

Differential Revision: https://reviews.llvm.org/D134112
2022-09-20 02:05:36 -07:00
David Spickett ba822e248d [LLDB] Format lldb-server's target XML
So that the XML isn't one giant line. Which wasn't
a problem for lldb but was for me trying to troubleshoot
it using the logs.

It now looks like:
```
<?xml version="1.0"?>
<target version="1.0">
  <architecture>aarch64</architecture>
  <feature>
    <...>
    <reg name="fpcr" .../>
  </feature>
</target>
```

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D134035
2022-09-20 09:02:17 +00:00
Caroline Concatto 2aad9093ac [AArch64][NFC] Correctly rename mangling name for ldN.sret
Remove from the function name the predicate type and pointer type, because:
 The predicate type in the name(nxvNi1)  can be deduced from the overloaded
element count(nxvNEltTy).
 The pointer type(p0EltTy) can be deduced from the overloaded element type.

Differential Revision: https://reviews.llvm.org/D133023
2022-09-20 09:56:44 +01:00
John McIver 2e6c50855b [Utils] Refactor update_cc_test_checks.py to use shutil
The package distutils is deprecated and removal is planned for Python 3.12.
All calls to distutils.spawn.find_executable are replaced with shutil.which.

Differential Revision: https://reviews.llvm.org/D134015
2022-09-20 09:42:06 +01:00
Jean Perier e6238ab525 [flang] Deallocate WHERE masks after all assignments
Allocatable assignments were triggering lowering to clean-up
any WHERE mask temporaries, even if some assignments where left
in the WHERE construct.

This is because allocatable assignments lowering was being passed the
wrong statement context. Fix this by selecting the where/forall statement
context instead of a local one when there is one.

Differential Revision: https://reviews.llvm.org/D134197
2022-09-20 10:40:30 +02:00
eopXD 3b2011fd4f [LSR] Fold terminating condition to other IV when possible
When the IV is only used by the terminating condition (say IV-A) and the loop
has a predictable back-edge count and we have another IV (say IV-B) that is an
affine add recursion, we will be able to calculate the terminating value of
IV-B in the loop pre-header. This patch adds attempts to replace IV-B as the
new terminating condition and remove IV-A. It is safe to do so since IV-A is
only used as the terminating condition.

This transformation is suitable to be appended after LSR as it may optimize the
loop into the situation mentioned above. The transformation can reduce number of
IV-s in the loop by one.

A cli option `lsr-term-fold` is added and default disabled.

Reviewed By: mcberg2021, craig.topper

Differential Revision: https://reviews.llvm.org/D132443
2022-09-20 01:38:47 -07:00
Jean Perier b668de2de2 [flang] fix optional pointer TARGET argument lowering in ASSOCIATED
The TARGET argument of ASSOCIATED has a special lowering to deal with
POINTER and ALLOCATABLE optional actual arguments because they may be
dynamically absent. The previous code was doing a ternary
(mlir::SelectOp) to deal with this case, but generated invalid
code for the unused argument (loading a nullptr fir.ref<fir.box>). This
was not detected until D133779 was merged and modified how fir.load are
lowered to LLVM for fir.box types.

Replace the select by a proper if to prevent the fir.load from being
reachable in context where it should not.

Differential Revision: https://reviews.llvm.org/D134174
2022-09-20 10:16:58 +02:00
LLVM GN Syncbot 613c429bbf [gn build] Port 55158efe10 2022-09-20 08:12:06 +00:00
Nikolas Klauser 55158efe10 [libc++] Remove MSVC code
It's been one and a half months now and nobody said anything, so I guess this code can be removed.

Reviewed By: ldionne, #libc

Spies: Mordante, libcxx-commits, mgorny, mstorsjo

Differential Revision: https://reviews.llvm.org/D132943
2022-09-20 10:11:42 +02:00
Nikolas Klauser 54150e8257 [libc++][NFC] Refactor enable_ifs in vector
Using the `enable_if_t<..., int> = 0` style has the benefit that it works in all cases and makes function declarations easier to read because the function arguments and return type and SFINAE are separated. Unifying the style also makes it easier for people not super familiar with SFINAE to make sense of the code.

Reviewed By: Mordante, var-const, #libc, huixie90

Spies: huixie90, libcxx-commits

Differential Revision: https://reviews.llvm.org/D131868
2022-09-20 10:06:34 +02:00
Mateusz Mikuła 4f30c5808a [TargetLibraryInfo] Mark memrchr as unavailable on Windows
Otherwise LLVM will optimise strrchr into memrchr on Windows resulting in linker error:
```
$ cat memrchr_test.c
int main(int argc, char **argv) {
    return (long)strrchr("KkMm", argv[argc-1][0]);
}

$ clang memrchr_test.c -O
memrchr_test.c:3:12: warning: cast to smaller integer type 'long' from 'char *' [-Wpointer-to-int-cast]
    return (long)strrchr("KkMm", argv[argc-1][0]);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
ld.lld: error: undefined symbol: memrchr
>>> referenced by D:/msys64/tmp/memrchr_test-e7aabd.o:(main)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

Example taken from MSYS2 Discord and tested with windows-gnu target.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D134134
2022-09-20 10:50:31 +03:00
Alvin Wong 365d0a5cd8 [LLD][COFF] Add load config checks to warn if incorrect for CFGuard
Control Flow Guard requires specific flags and VA's be included in the
load config directory to be functional. In case CFGuard is enabled via
linker flags, we can check to make sure this is the case and give the
user a warning if otherwise.

MSVC provides a proper `_load_config_used` by default, so this is more
relevant for the MinGW target in which current versions of mingw-w64
does not provide this symbol.

The checks (only if CFGuard is enabled) include:

- The `_load_config_used` struct shall exist.
- Alignment of the `_load_config_used` struct (shall be aligned to
  pointer size.)
- The `_load_config_used` struct shall be large enough to contain the
  required fields.
- The values of the following fields are checked against the expected
  values:
  - GuardCFFunctionTable
  - GuardCFFunctionCount
  - GuardFlags
  - GuardAddressTakenIatEntryTable
  - GuardAddressTakenIatEntryCount
  - GuardLongJumpTargetTable
  - GuardLongJumpTargetCount
  - GuardEHContinuationTable
  - GuardEHContinuationCount

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D133099
2022-09-20 10:49:01 +03:00
Alvin Wong 9509f4e657 [LLD][COFF] Improve symbol table info for import thunk
Import thunks themselves contain a jump or branch, which is code by
nature. Therefore the import thunk symbol should be marked as function
type in the symbol table to help with debugging.

The `__imp_` import symbol associated to the import thunk is also useful
for debugging. However, when the import symbol isn't directly referenced
outside of the import thunk, it doesn't normally get added to the symbol
table. This change teaches LLD to add the import symbol explicitly.

Reviewed By: mstorsjo

Differential Revision: https://reviews.llvm.org/D134169
2022-09-20 10:44:45 +03:00
Martin Storsjö 9a2b69764e [llvm-rc] [test] Fix the windres-preproc test with other mingw triple forms. NFC.
When invoking the preprocessor, llvm-windres produces a mingw
triple; if the llvm default target triple is a mingw target, it
is used as is - if not, a mingw style triple is generated.

Relax the testcase, to not strictly require "w64" as vendor (allow
the vendor field to be missing entirely), and allow both
"mingw32" and "windows-gnu" as OS/environment (where both forms are
common, while the latter is the normalized form).

Differential Revision: https://reviews.llvm.org/D134148
2022-09-20 10:43:37 +03:00
Michał Górny a7d2409bac [clang] [Driver] Do not transform explicit --config filename
Disable transformations (e.g. attempting to replace target architecture)
in the config filename that is passed explicitly via `--config`.  This
behavior is surprising and confusing -- if user passes an explicit
config filename, Clang should use it as is.  The transformations are
still applied when the name is deduced from filename.

Update the tests accordingly.  This primarily ensures that full filename
with .cfg suffix is passed to --config (appending `.cfg` implicitly is
not documented, and would collide with use of filenames with other
suffixes).  The config-file2.c suite is removed entirely as it tested
the transformations on the argument to --config.  However, the aspects
of that that were not tested as part of config-file3.c are now added
there (based on config filename deduced from executable).

This change streamlines the code in Driver::loadConfigFile(), opening
the possibility of further changes, including support for handling
multiple --config options and refactoring of filename deduction.

Differential Revision: https://reviews.llvm.org/D134208
2022-09-20 07:58:27 +02:00
wlei 1ea43e601a remove the internal signatures from perf binaries 2022-09-19 22:32:31 -07:00
Jonas Devlieghere 3b4db10f34
[lldb] Actually support more than 32 logging categories
In January, Greg put up a patch (D117382) to support, among other
things, more than 32 log categories. That led to a bunch of nice
cleanups, but categories remained constrained because different parts of
the code were still using uint32_t. This patch fixes the remaining
issues and makes it possible to add a 32nd log category.

Differential revision: https://reviews.llvm.org/D134245
2022-09-19 22:31:20 -07:00
Serge Pavlov 181279ffcd [X86][GlobalISel] Add support for sret demotion
The change add support for the cases when return value is passed in
memory rathen than in registers.

Differential Revision: https://reviews.llvm.org/D134181
2022-09-20 11:47:53 +07:00
Jonathon Penix bfcd536a8e [flang] Give explicit convert= specifiers precedence over FORT_CONVERT
Currently, the FORT_CONVERT environment variable has the highest priority when
setting the endianness conversion for unformatted files. In discussing the
appropriate priority for the fconvert option, convert specifiers were decided
to take highest priority.

This patch also initializes the open statement convert state to unknown
to disambiguate cases where the convert specifier was not provided from
cases where convert=native was set. This makes it possible to defer to the
environment setting where appropriate.

Differential Revision: https://reviews.llvm.org/D133237
2022-09-19 20:40:51 -07:00
luxufan 67c482e0b4 [MemorySSA] Add test that all incoming values of phi node could be translated
Differential Revision: https://reviews.llvm.org/D134160
2022-09-20 02:46:43 +00:00
luxufan bfd31c6f12 [MemorySSA][NFC] Use const whenever possible
Differential Revision: https://reviews.llvm.org/D134162
2022-09-20 02:21:02 +00:00
eopXD eff5c3e6c6 [LSR] Precommit test for D132443
Pre-commit test for D132443

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D132452
2022-09-19 19:06:52 -07:00
Ron Lieberman d5b5289561 revert 684f76643 [Clang][OpenMP] Codegen generation for has_device_addr claues.
breaks amdgpu buildbot
2022-09-20 01:37:27 +00:00
Phoebe Wang 46bb4b99ae [X86][fastcall][vectorcall] Move capability check before free register update
When passing arguments with `__fastcall` or `__vectorcall` in 32-bit MSVC, the following arguments have chance to be passed by register if the current one failed. `__regcall` from ICC is on the contrary: https://godbolt.org/z/4MPbzhaMG
All the three calling conversions are not supported in GCC.

Fixes: #57737

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D133920
2022-09-20 09:18:23 +08:00
Vitaly Buka 4fa8df20ff [msan] Handle shadow of masked instruction
Origin handling is not implemented yet.

Reviewed By: kda

Differential Revision: https://reviews.llvm.org/D133682
2022-09-19 17:57:43 -07:00
Jonas Devlieghere d3a536fa93
[lldb] Appease the MSCV compiler
Fix error C2027: use of undefined type 'llvm::MemoryBuffer'.
2022-09-19 17:37:27 -07:00
Jennifer Yu a1df13ecd6 Fix test case which is not working for AMDGPU.
This is for the change of
Differential Revision: https://reviews.llvm.org/D134186
2022-09-19 17:07:01 -07:00
Matt Arsenault a4b1f7a8b5 AMDGPU: Add some tests for atomics with excess alignment 2022-09-19 19:27:21 -04:00
Matt Arsenault 2adae8e1b7 VectorCombine: Pass through AssumptionCache 2022-09-19 19:25:22 -04:00
Matt Arsenault c867401407 MemCpyOpt: Pass through AssumptionCache 2022-09-19 19:25:22 -04:00
Matt Arsenault 555af0274c SLPVectorizer: Pass through AssumptionCache 2022-09-19 19:25:22 -04:00
Matt Arsenault b609741958 LoopVectorize: Pass through AssumptionCache 2022-09-19 19:25:22 -04:00
Matt Arsenault 84a2e48ce6 GVN: Pass through AssumptionCache to queries 2022-09-19 19:25:22 -04:00
Matt Arsenault ce44357216 Analysis: Add AssumptionCache to isSafeToSpeculativelyExecute
Does not update any of the uses.
2022-09-19 19:25:22 -04:00
Jennifer Yu 684f766431 [Clang][OpenMP] Codegen generation for has_device_addr claues.
Summary: This patch add codegen support for the has_device_addr clause.  It
use the same logic of is_device_ptr.

Differential Revision: https://reviews.llvm.org/D134186
2022-09-19 16:14:57 -07:00
Matt Arsenault fd37ab6cf6 InstCombine: Pass AssumptionCache through isDereferenceablePointer 2022-09-19 19:10:51 -04:00
Matt Arsenault 34fb7803f8 GlobalISel: Pass through AssumptionCache 2022-09-19 19:10:51 -04:00
Matt Arsenault bcb931c484 SelectionDAG: Add AssumptionCache analysis dependency
Fixes compile time regression after
bb70b5d406
2022-09-19 19:10:51 -04:00
Craig Topper 94049db913 [RISCV] Make computeIncomingVLVTYPE more conservative when merging predecessor state.
If we have already calculated the incoming state before, use that
as our starting point to ensure we are conservative.

This fixes an infinite loop found in our downstream where we
we allowed two waves of updates to propagate through a loop and
the merge points allowed us to toggle back and forth between states.
No small reproducer right now.

Differential Revision: https://reviews.llvm.org/D134229
2022-09-19 15:57:55 -07:00
Matt Arsenault 0d8ffcc532 Analysis: Add AssumptionCache argument to isDereferenceableAndAlignedPointer
This does not try to pass it through from the end users.
2022-09-19 18:57:33 -04:00
Matt Arsenault 3f77df8e29 AMDGPU: Update baseline test checks 2022-09-19 18:57:33 -04:00
SignKirigami 6772987fc3 [OpenMP] Add LoongArch64 support
GCC, glibc, binutils, and LLVM have added support for LoongArch64.
This patch adds support for LLVM OpenMP following D59880 for RISCV64.

Reviewed By: MaskRay, SixWeining

Differential Revision: https://reviews.llvm.org/D132925
2022-09-19 22:49:15 +00:00
Cyndy Ishida e6cdb00315 [llvm][TextAPI] add driverkit as supported platform for older tbd
versions

 It looks like being able to write it was added, but missed the ability
  to read it.
2022-09-19 15:08:29 -07:00
owenca 7349084e7a [clang-format] Update removed brace's next token's WhitespaceRange
Fixes #57803.

Differential Revision: https://reviews.llvm.org/D134146
2022-09-19 15:02:08 -07:00
Brett Wilson eaa7b324d5 [clang-doc] Add support for explicitly typed enums
Add support for explicitly typed enums:
  enum Foo : unsigned { ... };
to the internal representation and to the YAML output.

Add support for getting the value of an enum constant, as well as accessing the original expression that produced it. This changes the YAML output of enums from an array of strings for the enum members to an array of dictionaries. These dictionaries now report the name, value, and original expression.

The markdown and HTML outputs are unchanged, they still output the name from the new enhanced internal schema.

Reviewed By: paulkirth

Differential Revision: https://reviews.llvm.org/D134055
2022-09-19 21:54:41 +00:00