Commit Graph

432830 Commits

Author SHA1 Message Date
Martin Storsjö 5d89f90443 [clang] [HLSL] Fix GCC warnings about virtual methods that are hidden
This fixes the following warnings produced by GCC 9:

In file included from ../tools/clang/include/clang/Sema/ExternalSemaSource.h:15,
                 from ../tools/clang/include/clang/Sema/HLSLExternalSemaSource.h:17,
                 from ../tools/clang/lib/Sema/HLSLExternalSemaSource.cpp:12:
../tools/clang/include/clang/AST/ExternalASTSource.h:211:16: warning: ‘virtual void clang::ExternalASTSource::CompleteType(clang::ObjCInterfaceDecl*)’ was hidden [-Woverloaded-virtual]
  211 |   virtual void CompleteType(ObjCInterfaceDecl *Class);
      |                ^~~~~~~~~~~~
In file included from ../tools/clang/lib/Sema/HLSLExternalSemaSource.cpp:12:
../tools/clang/include/clang/Sema/HLSLExternalSemaSource.h:49:8: warning:   by  virtual void clang::HLSLExternalSemaSource::CompleteType(clang::TagDecl*)’ [-Woverloaded-virtual]
   49 |   void CompleteType(TagDecl *Tag) override;
      |        ^~~~~~~~~~~~

Differential Revision: https://reviews.llvm.org/D130969
2022-08-11 10:15:13 +03:00
Martin Storsjö b8717d19cf [libcxx] [test] Merge the experimental-lib-exports testcases into static-lib-exports
Since bb939931a1, the c++experimental
library is always built, so these tested files should always be built
(even if they aren't used in tests).

Differential Revision: https://reviews.llvm.org/D129399
2022-08-11 10:15:12 +03:00
Timm Bäder ebe0674acb [clang] Try to fix builders
Try to fix these errors:

SemaDeclCXX.cpp:16666:19: error: declaration of ‘const clang::Expr* clang::Sema::DiagnoseStaticAssertDetails(const clang::Expr*)::<unnamed struct>::Expr’ changes meaning of ‘Expr’ [-fpermissive]
16666 |       const Expr *Expr;
      |                   ^~~~
2022-08-11 09:07:44 +02:00
Vitaly Buka c615411d82 [test][asan] Disable symbolization
Reduces runtime of the test.
Unrelated pre-merge checks often timeouts here.
2022-08-11 00:02:02 -07:00
Martin Storsjö 5563c38fde [JITLink] Silence GCC warnings about parentheses around && and || operators
This silences the following warnings:

../include/llvm/ExecutionEngine/JITLink/JITLink.h:1108:56: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
 1105 |     assert(S == Scope::Local || llvm::count_if(AbsoluteSymbols,
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1106 |                                                [&](const Symbol *Sym) {
      |                                                ~~~~~~~~~~~~~~~~~~~~~~~~
 1107 |                                                  return Sym->getName() == Name;
      |                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1108 |                                                }) == 0 &&
      |                                                ~~~~~~~~^~
 1109 |                                     "Duplicate absolute symbol");
      |                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-08-11 09:58:11 +03:00
Tom Praschan 15bf2aa44a [clangd][test] Fix error message in SerializationTest.BinaryConversions
I noticed this when adding a new type to the index for
https://github.com/clangd/clangd/issues/529. When the assertion failed,
this actually caused a crash, because llvm::expected would complain that
we did not take the error.
2022-08-11 08:50:23 +02:00
Fangrui Song 96850003d2 [PowerPC] Change a double Log2 for localentry to integral Log2. NFC 2022-08-10 23:45:13 -07:00
Timm Bäder 09117b2189 [clang][sema] Print more information about failed static assertions
For failed static assertions, try to take the expression apart and print
useful information about why it failed. In particular, look at binary
operators and print the compile-time evaluated value of the LHS/RHS.

Differential Revision: https://reviews.llvm.org/D130894
2022-08-11 08:44:38 +02:00
Sunho Kim 2813151730 [ORC] Add missing std::move. 2022-08-11 15:41:06 +09:00
LLVM GN Syncbot e04f8c81d5 [gn build] Port 7bece0f03b 2022-08-11 06:28:14 +00:00
LLVM GN Syncbot a5656496f0 [gn build] Port 7260cdd2e1 2022-08-11 06:28:12 +00:00
Sunho Kim 7260cdd2e1 [ORC][COFF] Introduce COFFVCRuntimeBootstrapper.
Introduces COFFVCRuntimeBootstrapper that loads/initialize vc runtime libraries. In COFF, we *must* jit-link vc runtime libraries as COFF relocation types have no proper way to deal with out-of-reach data symbols ragardless of linking mode. (even dynamic version msvcrt.lib have tons of static data symbols that must be jit-linked) This class tries to load vc runtime library files from msvc installations with an option to override the path.

There are some complications when dealing with static version of vc runtimes. First, they need static initializers to be ran that requires COFFPlatform support but orc runtime will not be usable before vc runtimes are fully initialized. (as orc runtime will use msvc stl libraries) COFFPlatform that will be introduced in a following up patch will collect static initializers and run them manually in host before boostrapping itself. So, the user will have to do the following.
1. Create COFFPlatform that addes static initializer collecting passes.
2. LoadVCRuntime
3. InitializeVCRuntime
4. COFFPlatform.bootstrap()
Second, the internal crt initialization function had to be reimplemented in orc side. There are other ways of doing this, but this is the simplest implementation that makes platform fully responsible for static initializer. The complication comes from the fact that crt initialization functions (such as acrt_initialize or dllmain_crt_process_attach) actually run all static initializers by traversing from `__xi_a` symbol to `__xi_z`. This requires symbols to be contiguously allocated in sections alphabetically sorted in memory, which is not possible right now and not practical in jit setting. We might ignore emission of `__xi_a` and `__xi_z` symbol and allocate them ourselves, but we have to take extra care after orc runtime boostrap has been done -- as that point orc runtime should be the one running the static initializers.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D130456
2022-08-11 15:27:47 +09:00
Emmmer 0247b5aaae [LLDB][RISCV] Add riscv software breakpoint trap code
Added:
- Take RISC-V `ebreak` instruction as breakpoint trap code, so our breakpoint works as expected now.

Further work:
- RISC-V does not support hardware single stepping yet. A software implementation may come in future PR.
- Add support for RVC extension (the trap code, etc.).

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D131566
2022-08-11 14:26:22 +08:00
Corentin Jabot bcc90f6268 [Clang] Update cxx_dr_status [NFC]
Update the DR status page with the C++ Standard Core
Issues List revision 109.
2022-08-11 08:24:31 +02:00
Emmmer 7bece0f03b [LLDB][RISCV] Add riscv register definition and read/write
This patch is based on the minimal extract of D128250.

What is implemented:
- Use the same register layout as Linux kernel and mock read/write for `x0` register (the always zero register).
- Refactor some duplicate code, and delete unused register definitions.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D130342
2022-08-11 14:24:06 +08:00
Sunho Kim 9381de0952 [JITLink][COFF][x86_64] Stub SECREL relocation to external symbol.
Stubs SECREL relocation to external symbol. In order to correctly deal with this, we want to requrest memory manager to keep track of address of first block of sepecific section and keep address to be only increased from that point. We also should give jitlink to get information about global section. The relocation is only used for debug and tls info which we don't support yet anyways, so just stubbing it for now.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D130451
2022-08-11 15:12:25 +09:00
Sunho Kim 5cf0082ae3 [JITLink][COFF][x86_64] Implement SECTION/SECREL relocation.
Implements SECTION/SECREL relocation. These are used by debug info (pdb) data.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D130275
2022-08-11 15:12:24 +09:00
Clement Courbet 156c0754bc [clang][transformer] Finish plumbing `Note` all the way to the output.
Right now we can only add a single warning, notes are not possible.

Apparently some provisions were made to allow notes, but they were never
propagated all the way to the diagnostics.

Differential Revision: https://reviews.llvm.org/D128807
2022-08-11 07:54:44 +02:00
Yeting Kuo 7050f2102e [RISCV][test] Precommitted test for optimization for vmerge and unmasked intrinsics.
Precommitted test cases for D130442.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D130753
2022-08-11 13:23:08 +08:00
esmeyi 7a70e6e224 [XCOFF] ignore the cold attribute.
Summary: AIX XCOFF doesn't support the cold feature.
    While it shouldn't be a function error when XCOFF catching the cold attribute.
    As with the behavior of other formats, we just ignore the attribute for now.

Reviewed By: DiggerLin

Differential Revision: https://reviews.llvm.org/D131473
2022-08-11 01:13:05 -04:00
Jeff Niu 4e0a2bd627 [fir] Fix build 2022-08-11 01:10:33 -04:00
Craig Topper bc1f78cc3b [RISCV] Rename PROC_ALIAS to TUNE_ALIAS to reflect it's usage. NFC
This is not used as general CPU alias. Only to support -mtune. Name it as such.

Reviewed By: kito-cheng

Differential Revision: https://reviews.llvm.org/D131602
2022-08-10 21:44:08 -07:00
aqjune 02e56e2533 [CodeGen] Generate efficient assembly for freeze(poison) version of `mm*_cast*` intel intrinsics
This patch makes the variants of `mm*_cast*` intel intrinsics that use `shufflevector(freeze(poison), ..)` emit efficient assembly.
(These intrinsics are planned to use `shufflevector(freeze(poison), ..)` after shufflevector's semantics update; relevant thread: D103874)

To do so, this patch

1. Updates `LowerAVXCONCAT_VECTORS` in X86ISelLowering.cpp to recognize `FREEZE(UNDEF)` operand of `CONCAT_VECTOR` in addition to `UNDEF`
2. Updates X86InstrVecCompiler.td to recognize `insert_subvector` of `FREEZE(UNDEF)` vector as its first operand.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D130339
2022-08-11 13:36:21 +09:00
Jeff Niu 5e0c3b4309 [mlir][LLVMIR] Clean up the definitions of ReturnOp/CallOp 2022-08-11 00:35:02 -04:00
Vitaly Buka af77e5e4c0 [msan] Extract SetAllocaOrigin 2022-08-10 20:53:02 -07:00
Vitaly Buka d1040c455f [msan] Another try for powerpc fix after D131205 2022-08-10 20:39:25 -07:00
wanglei c437412fbc [LoongArch] Override TargetLowering::isOffsetFoldingLegal()
This patch disable GlobalAddress+Offset folding.

Differential Revision: https://reviews.llvm.org/D131491
2022-08-11 11:26:54 +08:00
jacquesguan 21bf59c92a [RISCV] Add cost model for mask vector extend and truncate instruction.
As extending from or truncating to mask vector do not use the same instructions as the normal cast, this path changed it to 2 which is the number of instructions we used.

Differential Revision: https://reviews.llvm.org/D131552
2022-08-11 10:55:43 +08:00
WANG Xuerui 0c8bfbb374 [LoongArch] Define the new-style reloc types
Differential Revision: https://reviews.llvm.org/D131467
2022-08-11 10:37:30 +08:00
Gergely Meszaros 3f801e07fa [clang-format] git-clang-format --staged should format the index
When --staged (or --cached) use the index for formatting as well, not just
for the line numbers to format. Without this change git-clang-format gets
the changed line numbers based on the index, but then formats these lines on
the working tree version of the file.

This is a problem when the working tree and index differ. One common case
would be (and is the motivation behind this patch) when applying the
suggested changes git-clang-format --staged, then forgetting to add the
applied changes. When git-clang-format --staged --diff is used in a
pre-commit hook in this scenario, then the hook would allow committing the
improperly formatted changes, as the file is correctly formatted in the work
tree.

Fixes #56797.

Differential Revision: https://reviews.llvm.org/D130108
2022-08-10 19:30:41 -07:00
Vitaly Buka 05b3374925 [msan] Try to fix powerpc after D131205 2022-08-10 19:28:30 -07:00
WANG Xuerui ed078c48f0 [LoongArch] Add insn aliases `jr` and `ret`
Differential Revision: https://reviews.llvm.org/D131512
2022-08-11 10:02:45 +08:00
Phoebe Wang f061cfb317 [compiler-rt][BF16] Provide __truncdfbf2 and __truncsfbf2 only when __bf16 is available
Differential Revision: https://reviews.llvm.org/D131147
2022-08-11 09:20:08 +08:00
Uday Bondhugula 3d93885f7c [MLIR][NFC] Refactor affine analysis helpers
Refactor affine analysis helpers: the existing ones were using
unnecessary or improperly named arguments. NFC.

Differential Revision: https://reviews.llvm.org/D131557
2022-08-11 06:28:59 +05:30
WANG Xuerui 326f7aed38 [LoongArch] Add codegen support for bitreverse
Differential Revision: https://reviews.llvm.org/D131378
2022-08-11 08:55:14 +08:00
Uday Bondhugula b6164ec9c2 [MLIR] Add missing check for unsupported affine dependence analysis
Add missing check in affine dependence analysis when dependence analysis
isn't possible due to the ops being in different affine scopes.  The
lack of such a check could lead to a crash or incorrect behavior in
several dependent utilities.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D131556
2022-08-11 06:02:39 +05:30
Uday Bondhugula 82973067ac [MLIR] Fix build breakage due to 5c5af910fe
Fix build breakage due to 5c5af910fe.

```commit 5c5af910fe
Author: Jeff Niu <jeff@modular.com>
Date:   Tue Aug 9 22:07:35 2022 -0400

    [mlir][LLVMIR] "Modernize" Insert/ExtractValueOp ```

results in

```lib/Conversion/LLVMCommon/MemRefBuilder.cpp:170:70: error: call of overloaded ‘makeArrayRef<int64_t>(<brace-enclosed initializer list>)’ is ambiguous
       llvm::makeArrayRef<int64_t>({kStridePosInMemRefDescriptor,
       pos}));

llvm/include/llvm/ADT/ArrayRef.h:505:15: note: candidate: ‘llvm::ArrayRef<T> llvm::makeArrayRef(const std::vector<T>&) [with T = long int]’
   ArrayRef<T> makeArrayRef(const std::vector<T> &Vec) {
               ^~~~~~~~~~~~
llvm/include/llvm/ADT/ArrayRef.h:516:37: note: candidate: ‘llvm::ArrayRef<T> llvm::makeArrayRef(const llvm::ArrayRef<T>&) [with T = long int]’
   template <typename T> ArrayRef<T> makeArrayRef(const ArrayRef<T> &Vec) {
                                                                      ^

Differential Revision: https://reviews.llvm.org/D131637
2022-08-11 05:58:38 +05:30
Keith Smiley 3c24fae398
[lld-macho] Add support for objc_msgSend stubs
Apple Clang in Xcode 14 introduced a new feature for reducing the
overhead of objc_msgSend calls by deduplicating the setup calls for each
individual selector. This works by clang adding undefined symbols for
each selector called in a translation unit, such as `_objc_msgSend$foo`
for calling the `foo` method on any `NSObject`. There are 2
different modes for this behavior, the default directly does the setup
for `_objc_msgSend` and calls it, and the smaller option does the
selector setup, and then calls the standard `_objc_msgSend` stub
function.

The general overview of how this works is:

- Undefined symbols with the given prefix are collected
- The suffix of each matching undefined symbol is added as a string to
  `__objc_methname`
- A pointer is added for every method name in the `__objc_selrefs`
  section
- A `got` entry is emitted for `_objc_msgSend`
- Stubs are emitting pointing to the synthesized locations

Notes:

- Both `__objc_methname` and `__objc_selrefs` can also exist from object
  files, so their contents are merged with our synthesized contents
- The compiler emits method names for defined methods, but not for
  undefined symbols you call, but stubs are used for both
- This only implements the default "fast" mode currently just to reduce
  the diff, I also doubt many folks will care to swap modes
- This only implements this for arm64 and x86_64, we don't need to
  implement this for 32 bit iOS archs, but we should implement it for
  watchOS archs in a later diff

Differential Revision: https://reviews.llvm.org/D128108
2022-08-10 17:17:17 -07:00
Vitaly Buka ad5f7895ef [test][sanitizer] Fix REQUIRES of the test
getnetent is availible from API 28
2022-08-10 16:59:40 -07:00
Vitaly Buka e87ee2f4a9 [test][sanitizer] Switch test to a different group 2022-08-10 16:59:40 -07:00
Tom Stellard 9c6c4d675b lldb: Disable unittests if llvm_gtest target does not exist
This fixes the stand-alone build configuration where LLVM_MAIN_SRC_DIR
does not exist.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D124314
2022-08-10 16:56:08 -07:00
Slava Zakharin 1d5e7a498f [flang] Support DOT_PRODUCT in late inlining.
This change inlines DOT_PRODUCT calls for real and integer types.

Differential Revision: https://reviews.llvm.org/D131538
2022-08-10 16:30:35 -07:00
Vitaly Buka 58063c8ade [test][sanitizer] Change exit code to debug llvm-avr-linux 2022-08-10 16:29:28 -07:00
Med Ismail Bennani 3f3db13525 [lldb/crashlog] Add `-V|--version` option
This patch introduces a new option to the crashlog command to get the
the script version.

Since `crashlog.py` is not actually versioned, this returns lldb's
version instead.

rdar://98392669

Differential Revision: https://reviews.llvm.org/D131542

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-10 16:18:46 -07:00
Vitaly Buka 27b1a8273d [test][sanitizer] Fix REQUIRES in few tests 2022-08-10 16:17:12 -07:00
Aart Bik 6b7459115f [mlir][sparse][bf16] disable two bf16 tests
Supposedly our ABI issues were fixed, per issue:
https://github.com/llvm/llvm-project/issues/55992

However, with a recent changes to bf16, these tests
fail again; not sure why yet:
https://reviews.llvm.org/D130832
https://lab.llvm.org/buildbot/#/builders/61/builds/30600

So we disable the tests for now. Issue is tracked in:
https://github.com/llvm/llvm-project/issues/57042

Differential Revision: https://reviews.llvm.org/D131621
2022-08-10 15:50:27 -07:00
Vitaly Buka 6b12043beb [test][sanitizer] Fix getgrouplist test 2022-08-10 15:48:44 -07:00
Kevin Athey 057cabd997 Remove function name from sanitize-memory-track-origins binary.
This work is being done to reduce the size of MSAN with track origins binary.

Builds upon: https://reviews.llvm.org/D131205

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D131415
2022-08-10 15:45:40 -07:00
Jan Svoboda d5fcf8a5e2 [clang][deps] NFC: Move dependency consumer into header file 2022-08-10 15:25:09 -07:00
Slava Gurevich f4c21ab8b3 [LLDB][NFC] Clean up dead code
Remove unreachable code that will never execute.

Differential Revision: https://reviews.llvm.org/D131613
2022-08-10 15:22:15 -07:00