platform/upstream/llvm.git
20 months ago[CUDA, NVPTX] Added basic __bf16 support for NVPTX.
Artem Belevich [Thu, 20 Oct 2022 01:49:32 +0000 (18:49 -0700)]
[CUDA, NVPTX] Added basic __bf16 support for NVPTX.

Recent Clang changes expose _bf16 types for SSE2-enabled host compilations and
that makes those types visible furing GPU-side compilation, where it currently
fails with Sema complaining that __bf16 is not supported.

Considering that __bf16 is a storage-only type, enabling it for NVPTX if it's
enabled on the host should pose no issues, correctness-wise.

Recent NVIDIA GPUs have introduced bf16 support, so we'll likely grow better
support for __bf16 on NVPTX going forward.

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

20 months ago[libc++] Add missing includes to xlocale helpers
Louis Dionne [Mon, 24 Oct 2022 22:23:59 +0000 (18:23 -0400)]
[libc++] Add missing includes to xlocale helpers

Also, make sure those are compatible with _LIBCPP_HAS_NO_WIDE_CHARACTERS.

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

20 months ago[libc] Add Linux implementations of time and clock functions.
Siva Chandra Reddy [Tue, 25 Oct 2022 06:45:45 +0000 (06:45 +0000)]
[libc] Add Linux implementations of time and clock functions.

Reviewed By: michaelrj

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

20 months ago[BOLT] Add mold-style PLT support
Maksim Panchenko [Tue, 25 Oct 2022 00:54:25 +0000 (17:54 -0700)]
[BOLT] Add mold-style PLT support

mold linker creates symbols for PLT entries and that caught BOLT by
surprise. Add the support for marked PLT entries.

Fixes: #58498

Reviewed By: yota9

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

20 months ago[docs] Update clang-formatted-files.txt after bindings/go removal (D135436)
Fangrui Song [Tue, 25 Oct 2022 17:57:19 +0000 (10:57 -0700)]
[docs] Update clang-formatted-files.txt after bindings/go removal (D135436)

20 months ago[LegacyPM] Remove DataFlowSanitizerLegacyPass
Fangrui Song [Tue, 25 Oct 2022 17:55:29 +0000 (10:55 -0700)]
[LegacyPM] Remove DataFlowSanitizerLegacyPass

Using the legacy PM for the optimization pipeline was deprecated in 13.0.0.
Following recent changes to remove non-core features of the legacy
PM/optimization pipeline, remove DataFlowSanitizerLegacyPass.

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

20 months ago[AArch64]SME2 single-multi and multi-multi INT dot product instructions[part2]
Caroline Concatto [Sat, 22 Oct 2022 14:55:02 +0000 (15:55 +0100)]
[AArch64]SME2 single-multi and multi-multi INT dot product  instructions[part2]

This patch adds the assembly/disassembly for the following instructions:
        SDOT: (4-way, multiple and single vector): Multi-vector signed integer dot-product by vector.
              SDOT (4-way, multiple vectors): Multi-vector signed integer dot-product.
        UDOT: (4-way, multiple and single vector): Multi-vector unsigned integer dot-product by vector.
              (4-way, multiple vectors): Multi-vector unsigned integer dot-product.
    for groups of 2 and 4 ZA registers

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

Depends on: D135563

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

20 months ago[flang] Add check for constraints on synchronization-stmts
Katherine Rasmussen [Mon, 17 Oct 2022 19:39:21 +0000 (13:39 -0600)]
[flang] Add check for constraints on synchronization-stmts

In the CoarrayChecker, add checks for the constraints C1172 and
C1173, which constrain sync-stat-list. Add these checks to
sync-all-stmt, sync-images-stmt, sync-memory-stmt, and
sync-team-stmt. Also add a check for the constraint C1174 in
sync-images-stmt. Update semantics tests for these stmts.

Reviewed By: klausler

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

20 months ago[AArch64]SME2 single-multi and multi-multi INT/FP dot product instructions
Caroline Concatto [Sat, 22 Oct 2022 11:13:49 +0000 (12:13 +0100)]
[AArch64]SME2 single-multi and multi-multi INT/FP dot product instructions

This patch adds the assembly/disassembly for the following instruction:
INT:
  SDOT (2-way, multiple and single vector): Multi-vector signed integer dot-product by vector.
       (2-way, multiple vectors): Multi-vector signed integer dot-product.
  UDOT (2-way, multiple and single vector): Multi-vector unsigned integer dot-product by vector.
       (2-way, multiple vectors): Multi-vector unsigned integer dot-product.
  SUDOT (multiple and indexed vector): Multi-vector signed by unsigned integer dot-product by indexed elements.
        (multiple and single vector): Multi-vector signed by unsigned integer dot-product by vector.
  USDOT (multiple and single vector): Multi-vector unsigned by signed integer dot-product by vector.
        (multiple vectors): Multi-vector unsigned by signed integer dot-product.
FP:
  BFDOT(multiple and single vector): Multi-vector BFloat16 floating-point dot-product by vector.
        (multiple vectors): Multi-vector BFloat16 floating-point dot-product.

  FDOT (multiple and single vector): Multi-vector half-precision floating-point dot-product by vector.
       (multiple vectors): Multi-vector half-precision floating-point dot-product.
For set of 2 and 4 ZA registers

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

Depends on:D135455

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

20 months ago[SelectionDAG] Add missing semicolon after return.
Craig Topper [Tue, 25 Oct 2022 17:18:46 +0000 (10:18 -0700)]
[SelectionDAG] Add missing semicolon after return.

I'm unsure what the code does without the semicolon. On the surface it
seems like the assert below it would be considered part of the if
and thus the assert would only execute if DestReg is 0. But 0 isn't
considered a virtual register so the assert should fail.

Found by PVS Studio.
Reported https://pvs-studio.com/en/blog/posts/cpp/1003/ (N7)

20 months ago[trace][intel pt] Simple detection of infinite decoding loops
Walter Erquinigo [Sun, 23 Oct 2022 17:04:46 +0000 (10:04 -0700)]
[trace][intel pt] Simple detection of infinite decoding loops

The low-level decoder might fall into an infinite decoding loop for
various reasons, the simplest being an infinite direct loop reached due
to wrong handling of self-modified code in the kernel, e.g. it might
reach

```
0x0A: pause
0x0C: jump to 0x0A
```

In this case, all the code is sequential and requires no packets to be
decoded. The low-level decoder would produce an output like the
following

```
0x0A: pause
0x0C: jump to 0x0A
0x0A: pause
0x0C: jump to 0x0A
0x0A: pause
0x0C: jump to 0x0A
... infinite amount of times
```

These cases require stopping the decoder to avoid infinite work and signal this
at least as a trace error.

- Add a check that breaks decoding of a single PSB once 500k instructions have been decoded since the last packet was processed.
- Add a check that looks for infinite loops after certain amount of instructions have been decoded since the last packet was processed.
- Add some `settings` properties for tweaking the thresholds of the checks above. This is also nice because it does the basic work needed for future settings.
- Add an AnomalyDetector class that inspects the DecodedThread and the libipt decoder in search for anomalies. These anomalies are then signaled as fatal errors in the trace.
- Add an ErrorStats class that keeps track of all the errors in a DecodedThread, with a special counter for fatal errors.
- Add an entry for decoded thread errors in the `dump info` command.

Some notes are added in the code and in the documention of the settings,
so please read them.

Besides that, I haven't been unable to create a test case in LLVM style, but
I've found an anomaly in the thread #12 of the trace
72533820-3eb8-4465-b8e4-4e6bf0ccca99 at Meta. We have to figure out how to
artificially create traces with this kind of anomalies in LLVM style.

With this change, that anomalous thread now shows:

```
(lldb)thread trace dump instructions 12 -e -i 23101

thread #12: tid = 8
    ...missing instructions
    23101: (error) anomalous trace: possible infinite loop detected of size 2
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 5 [inlined] rep_nop at processor.h:13:2
    23100: 0xffffffff81342785    pause
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 7 at panic.c:87:2
    23099: 0xffffffff81342787    jmp    0xffffffff81342785        ; <+5> [inlined] rep_nop at processor.h:13:2
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 5 [inlined] rep_nop at processor.h:13:2
    23098: 0xffffffff81342785    pause
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 7 at panic.c:87:2
    23097: 0xffffffff81342787    jmp    0xffffffff81342785        ; <+5> [inlined] rep_nop at processor.h:13:2
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 5 [inlined] rep_nop at processor.h:13:2
    23096: 0xffffffff81342785    pause
  vmlinux-5.12.0-0_fbk8_clang_6656_gc85768aa64da`panic_smp_self_stop + 7 at panic.c:87:2
    23095: 0xffffffff81342787    jmp    0xffffffff81342785        ; <+5> [inlined] rep_nop at processor.h:13:2
```

It used to be in an infinite loop where the decoder never stopped.

Besides that, the dump info command shows

```
(lldb) thread trace dump info 12

 Errors:
    Number of individual errors: 32
      Number of fatal errors: 1
      Number of other errors: 31
```

and in json format

```
(lldb) thread trace dump info 12 -j

 "errors": {
      "totalCount": 32,
      "libiptErrors": {},
      "fatalErrors": 1,
      "otherErrors": 31
    }
```

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

20 months agoRevert "[mlir] Add vectorization tests for linalg.map,reduce,transpose."
Alexander Belyaev [Tue, 25 Oct 2022 17:17:17 +0000 (19:17 +0200)]
Revert "[mlir] Add vectorization tests for linalg.map,reduce,transpose."

This reverts commit 2f88268fc109a1845285e125dfc19b8b75c137a0.

I will take a look what's happening with vectorization.mlir and why it
works on my machine and not upstream. Reverting for now.

20 months ago[Tooling] Avoid StandardLibrary.h including Decl. NFC
Sam McCall [Tue, 25 Oct 2022 17:11:51 +0000 (19:11 +0200)]
[Tooling] Avoid StandardLibrary.h including Decl. NFC

So you can use the enum in a header without pulling in half the AST.

20 months ago[clang-format] Correctly annotate UDLs as OverloadedOperator
Emilia Dreamer [Thu, 29 Sep 2022 07:10:47 +0000 (10:10 +0300)]
[clang-format] Correctly annotate UDLs as OverloadedOperator

While the opening parenthesis of an user-defined literal operator was
correctly annotated as OverloadedOperatorLParen, the "" and its suffix
wasn't annotated as OverloadedOperator.

Fixes https://github.com/llvm/llvm-project/issues/58035

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

20 months ago[AMDGPU] Fix delay alu for VOPD with src2acc
Joe Nash [Thu, 20 Oct 2022 19:03:46 +0000 (15:03 -0400)]
[AMDGPU] Fix delay alu for VOPD with src2acc

V_FMAC_F32 and V_DOT2C_F32_F16 have a dummy src2 operand tied to vdst to
inform passes that the instructions read the dst operand. The VOPD
versions of these instructions lacked the dummy operand, which was a
problem for inserting s_delay_alu.
Introduce the dummy src2 operand on the VOPD versions, and fix the VOPD operand
tracking logic to account for it.

Reviewed By: dp

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

20 months ago[include-cleaner] Move vocabulary types into separate header for layering. NFC
Sam McCall [Tue, 25 Oct 2022 17:01:46 +0000 (19:01 +0200)]
[include-cleaner] Move vocabulary types into separate header for layering. NFC

20 months ago[SystemZInstPrinter] Introduce markup tags emission
Ulrich Weigand [Tue, 25 Oct 2022 16:58:33 +0000 (18:58 +0200)]
[SystemZInstPrinter] Introduce markup tags emission

SystemZ assembly syntax emission now leverages markup tags, if enabled.

Author: Antonio Frighetto

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

20 months ago[SDAG] refactor folds for scalar-to-vector; NFCI
Sanjay Patel [Tue, 25 Oct 2022 16:48:46 +0000 (12:48 -0400)]
[SDAG] refactor folds for scalar-to-vector; NFCI

Fix typos, add comments, improve variable names,
rearrange code, add early exits.

20 months ago[Clang][NFC] Fix UnicodeData.txt parsing.
Corentin Jabot [Tue, 25 Oct 2022 16:41:41 +0000 (18:41 +0200)]
[Clang][NFC] Fix UnicodeData.txt parsing.

Fix the UnicodeNameToCodepoint tool misshandling
the case of a line containing a single semi-colon
(which does not happens in practice)

20 months ago[lldb] Host::ShellExpandArguments - fix error check for valid dictionary
Simon Pilgrim [Tue, 25 Oct 2022 16:43:47 +0000 (17:43 +0100)]
[lldb] Host::ShellExpandArguments - fix error check for valid dictionary

Fix repeated check for a valid JSON parse and actually check the dictionary pointer

Reported here: https://pvs-studio.com/en/blog/posts/cpp/1003/ (N40)

20 months agoWhitespace fix in a comment; NFC
Aaron Ballman [Tue, 25 Oct 2022 16:35:18 +0000 (12:35 -0400)]
Whitespace fix in a comment; NFC

20 months ago[lit] Define keyword used by MCJIT test
Paul Robinson [Tue, 25 Oct 2022 16:22:35 +0000 (09:22 -0700)]
[lit] Define keyword used by MCJIT test

test/ExecutionEngine/MCJIT/2005-12-02-TailCallBug.ll has
'XFAIL: mcjit-ia32' but that feature isn't defined anywhere, so
the XFAIL can't have any effect.  This has not been a problem
because apparently there are no 32-bit x86 bots out there.

I found this as part of other work to clean up lit keywords, so
I figured I would go ahead and fix it.  Verified by hacking my
lit.site.cfg.py so host_triple = target_triple = "i686-pc-windows-msvc"
and the test correctly reported XFAIL.

20 months ago[Transforms] classifyArgUse - don't deference pointer before null test
Simon Pilgrim [Tue, 25 Oct 2022 16:23:25 +0000 (17:23 +0100)]
[Transforms] classifyArgUse - don't deference pointer before null test

Reported here: https://pvs-studio.com/en/blog/posts/cpp/1003/ (N11)

20 months agoRevert "[clang] Fix missing diagnostic of declaration use when accessing TypeDecls...
Nico Weber [Tue, 25 Oct 2022 16:23:10 +0000 (12:23 -0400)]
Revert "[clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access"

This reverts commit dc170433137aeda5e5276bd292cac12aa93fee7c.
Breaks building LLVM on mac when targeting macOS before 10.15, see
comments on https://reviews.llvm.org/D136533

20 months agoRevert "reland e5581df60a35 [SimplifyCFG] accumulate bonus insts cost"
Yaxun (Sam) Liu [Tue, 25 Oct 2022 16:15:39 +0000 (12:15 -0400)]
Revert "reland e5581df60a35 [SimplifyCFG] accumulate bonus insts cost"

This reverts commit bd7949bcd86633bd4203b2ba6f891aea00fce4d1.

Revert this patch since reviwers have different opinions regarding
the approach in post-commit review.

Will open RFC for further discussion.

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

20 months ago[ORC] Allow EPCDebugObjectRegistrar clients to specify registration fn dylib.
Lang Hames [Tue, 25 Oct 2022 15:44:32 +0000 (08:44 -0700)]
[ORC] Allow EPCDebugObjectRegistrar clients to specify registration fn dylib.

Similar to the EPCEHFrameRegistrar change in c977251ef6f, this allows clients
who have sourced a dylib handle via a side-channel to search that dylib to
find the registration functions.

This patch defaults to the existing behavior in the case where the client does
not specify a handle to use.

20 months ago[ORC] Update SelfExecutorProcessControl to allow user-supplied handles.
Lang Hames [Tue, 25 Oct 2022 15:23:27 +0000 (08:23 -0700)]
[ORC] Update SelfExecutorProcessControl to allow user-supplied handles.

SelfExecutorProcessControl no longer requires that handles passed to
lookupSymbols be ones that were previously returned from loadDylib. This brings
SelfExecutorPRocessControl into alignment with SimpleRemoteEPC, which was
updated in 6613f4aff85.

20 months agoSpeculatively fix the test bots
Aaron Ballman [Tue, 25 Oct 2022 15:34:46 +0000 (11:34 -0400)]
Speculatively fix the test bots

This should hopefully fix the issues found on Linux hosts like:
https://lab.llvm.org/buildbot#builders/109/builds/49321
https://lab.llvm.org/buildbot/#/builders/139/builds/30061

20 months ago[mlgo] More wildcarding in extra features logging for regalloc
Mircea Trofin [Tue, 25 Oct 2022 15:19:58 +0000 (08:19 -0700)]
[mlgo] More wildcarding in extra features logging for regalloc

May need a different testing approach for opcodes.

20 months ago[OpenMP] [OMPIRBuilder] Create a new datatype to hold the unique target region info
Jan Sjodin [Mon, 24 Oct 2022 13:36:30 +0000 (09:36 -0400)]
[OpenMP] [OMPIRBuilder] Create a new datatype to hold the unique target region info

This patch puts the individual target region information attributes into a
struct so that the nested mappings are not needed and passing the information
around is simplified.

Reviewed By: jdoerfert, mikerice

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

20 months agoAdd more C99 DR test cases and update the status page
Aaron Ballman [Tue, 25 Oct 2022 15:13:55 +0000 (11:13 -0400)]
Add more C99 DR test cases and update the status page

This mostly completes the C99 set of DRs, though there are a few still
marked as "unknown".

20 months ago[mlir] Add lower-to-loops tests for linalg.map/reduce/transpose.
Alexander Belyaev [Tue, 25 Oct 2022 15:05:40 +0000 (17:05 +0200)]
[mlir] Add lower-to-loops tests for linalg.map/reduce/transpose.

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

20 months ago[mlir] Add vectorization tests for linalg.map,reduce,transpose.
Alexander Belyaev [Tue, 25 Oct 2022 15:04:44 +0000 (17:04 +0200)]
[mlir] Add vectorization tests for linalg.map,reduce,transpose.

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

20 months ago[llvm-lit][test] Fix regex to capture scientific notation
gbreynoo [Tue, 25 Oct 2022 14:29:58 +0000 (15:29 +0100)]
[llvm-lit][test] Fix regex to capture scientific notation

We were seeing an intermittent local test failure of
utils\lit\tests\test-output.py in which the elapsed time output was
being given in scientific notation. Python automatically represents
small floating-point values in scientific notation so I have altered
these tests regex to capture output in that format.

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

20 months ago[InstCombine] Fold series of instructions into mull for more types
zhongyunde [Tue, 25 Oct 2022 15:02:08 +0000 (23:02 +0800)]
[InstCombine] Fold series of instructions into mull for more types

Relax the constraint of wide/vectors types.
Address the comment https://reviews.llvm.org/D136015?id=469189#inline-1314520

Reviewed By: spatel, chfast
Differential Revision: https://reviews.llvm.org/D136661

20 months ago[LLDB] Fix RISCV build
Emmmer [Tue, 25 Oct 2022 11:18:24 +0000 (19:18 +0800)]
[LLDB] Fix RISCV build

After https://reviews.llvm.org/D135670

Reviewed By: DavidSpickett

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

20 months ago[X86] combineConcatVectorOps - fold v4i64/v8x32 concat(broadcast(),broadcast()) ...
Simon Pilgrim [Tue, 25 Oct 2022 14:34:23 +0000 (15:34 +0100)]
[X86] combineConcatVectorOps - fold v4i64/v8x32 concat(broadcast(),broadcast()) -> permilps(concat())

Extend the existing v4f64 fold to handle v4i64/v8f32/v8i32 as well

Fixes #58585

20 months ago[lit][REQUIRES] Fix llvm-debuginfod.test so it will run
Paul Robinson [Mon, 24 Oct 2022 16:13:17 +0000 (09:13 -0700)]
[lit][REQUIRES] Fix llvm-debuginfod.test so it will run

The test was added in D114846 but missed one place to introduce the
'httplib' feature keyword, so it has been UNSUPPORTED everywhere.

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

20 months ago[gn build] Port a3be778ed09b
LLVM GN Syncbot [Tue, 25 Oct 2022 14:17:26 +0000 (14:17 +0000)]
[gn build] Port a3be778ed09b

20 months ago[gn build] Port 791fe26d7581
LLVM GN Syncbot [Tue, 25 Oct 2022 14:17:24 +0000 (14:17 +0000)]
[gn build] Port 791fe26d7581

20 months ago[DebugInfo] getMergedLocation: Maintain the line number if they match
Juan Manuel MARTINEZ CAAMAÑO [Tue, 25 Oct 2022 07:29:30 +0000 (07:29 +0000)]
[DebugInfo] getMergedLocation: Maintain the line number if they match

getMergedLocation returns a 'line 0' DILocaiton if the two locations
being merged don't perfecly match, even if they are in the same line but
a different column.

This commit adds support to keep the line number if it matches (but only
the column differs). The merged column number is the leftmost between the
two.

Reviewed By: dblaikie, orlando

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

20 months ago[AMDGPU] Use Register in more places in SIInstrInfo. NFC.
Jay Foad [Tue, 25 Oct 2022 13:47:35 +0000 (14:47 +0100)]
[AMDGPU] Use Register in more places in SIInstrInfo. NFC.

Also avoid using AMDGPU::NoRegister when it's not neeeded.

20 months ago[X86] Add v4i64 test coverage for #58585
Simon Pilgrim [Tue, 25 Oct 2022 14:02:59 +0000 (15:02 +0100)]
[X86] Add v4i64 test coverage for #58585

Turns out we fail to do this for concat_v4i64(broadcast_v2i64,broadcast_v2i64) as well

20 months ago[AArch64][ARM] Alter v8.3a complex neon intrinsics to be target-based, not preprocess...
David Green [Tue, 25 Oct 2022 13:35:11 +0000 (14:35 +0100)]
[AArch64][ARM] Alter v8.3a complex neon intrinsics to be target-based, not preprocessor based

This alters the 8.3 complex intrinsics to be target-gated, as opposed to
hidden behind preprocessor macros. This is the last of arm_neon.h, and
follows the same formula as before.

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

20 months ago[X86] Add test coverage for #58585
Simon Pilgrim [Tue, 25 Oct 2022 13:33:43 +0000 (14:33 +0100)]
[X86] Add test coverage for #58585

20 months ago[mlir][llvm] Don't return a dangling reference in getCallableResults().
Johannes de Fine Licht [Tue, 25 Oct 2022 12:52:59 +0000 (15:52 +0300)]
[mlir][llvm] Don't return a dangling reference in getCallableResults().

Use the `getReturnTypes()` API (which returns an `ArrayRef<Type>`)
rather than the `getReturnType()` API (which returns a `Type`) to avoid
returning a dangling reference in `LLVMFuncOp::getCallableResults()`.

Reviewed By: ftynse

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

20 months ago[X86] Fold vbroadcast(bitcast(vbroadcast(src))) -> bitcast(vbroadcast(vbroadcast...
Simon Pilgrim [Tue, 25 Oct 2022 13:03:35 +0000 (14:03 +0100)]
[X86] Fold vbroadcast(bitcast(vbroadcast(src))) -> bitcast(vbroadcast(vbroadcast(src)))

If the inner broadcast scalar type is smaller/same width as the outer broadcast scalar type then we can broadcast using the same inner type directly. Works for vbroadcast_load as well.

20 months ago[LLDB] [LoongArch] Add minimal LoongArch support
Tiezhu Yang [Tue, 25 Oct 2022 12:19:06 +0000 (12:19 +0000)]
[LLDB] [LoongArch] Add minimal LoongArch support

Add as little code as possible to allow compiling lldb on LoongArch.
Actual functionality will be implemented later.

Reviewed By: SixWeining, DavidSpickett

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

20 months agoRevert "[PGO] Make emitted symbols hidden"
Nico Weber [Tue, 25 Oct 2022 12:54:47 +0000 (08:54 -0400)]
Revert "[PGO] Make emitted symbols hidden"

This reverts commit 04877284b4592e9286cab43467662c1b4ff81861.
Looks like this is still breaking the test
Profile-x86_64 :: instrprof-darwin-dead-strip.c
(see comment on https://reviews.llvm.org/D135340).

20 months ago[LLDB][Docs][NFC] Fix formatting in -gmodules documentation
Michael Buch [Tue, 25 Oct 2022 11:32:49 +0000 (12:32 +0100)]
[LLDB][Docs][NFC] Fix formatting in -gmodules documentation

20 months ago[LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV
Emmmer [Thu, 20 Oct 2022 15:05:37 +0000 (23:05 +0800)]
[LLDB][RISCV] Add RV64C instruction support for EmulateInstructionRISCV

Add:

- RV64C instructions sets.
- corresponding unittests.
- `c.break` code for lldb and lldb-server

Fix:
- wrong decoding of imm in `DecodeSType`

Reviewed By: DavidSpickett

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

20 months ago[libc] Switch to new implementation of mem* functions
Guillaume Chatelet [Mon, 24 Oct 2022 13:10:53 +0000 (13:10 +0000)]
[libc] Switch to new implementation of mem* functions

The new framework makes it explicit which processor feature is being
used and allows for easier per platform customization:
 - ARM cpu now uses trivial implementations to reduce code size.
 - Memcmp, Bcmp and Memmove have been optimized for x86
 - Bcmp has been optimized for aarch64.

This is a reland of https://reviews.llvm.org/D135134 (b3f1d58)

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

20 months ago[clang][ExtractAPI] Allow users to specify a list of symbols to ignore
Daniel Grumberg [Fri, 21 Oct 2022 13:49:46 +0000 (14:49 +0100)]
[clang][ExtractAPI] Allow users to specify a list of symbols to ignore

Adds a `--extract-api-ignores=` command line option that allows users to
provide a file containing a new line separated list of symbols to
unconditionally ignore when extracting API information.

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

20 months ago[AArch64][SVE2] Add the SVE2.1 signed and unsigned 2-way dot instructions
David Sherwood [Wed, 19 Oct 2022 13:59:58 +0000 (13:59 +0000)]
[AArch64][SVE2] Add the SVE2.1 signed and unsigned 2-way dot instructions

This patch adds the assembly/disassembly for the following instructions:

SDOT : Signed integer 2-way dot product indexed and non-indexed
UDOT : Unsigned integer 2-way dot product, indexed and non-indexed

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

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

20 months ago[LLDB] Add missing breaks to current frame row in command map
David Spickett [Tue, 25 Oct 2022 10:19:29 +0000 (10:19 +0000)]
[LLDB] Add missing breaks to current frame row in command map

Without these it was rendering as one line for all three commands.

20 months ago[Clang][AArch64] Add TargetParser support for defining CPU aliases
Sjoerd Meijer [Mon, 24 Oct 2022 15:32:26 +0000 (21:02 +0530)]
[Clang][AArch64] Add TargetParser support for defining CPU aliases

This adds AArch64 TargetParser support to define CPU aliases, and
ports the definition of Grace over to that. This is following up
on D136425.

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

20 months ago[AArch64] Add precommit test for bcmp; NFC
chenglin.bi [Tue, 25 Oct 2022 09:23:03 +0000 (17:23 +0800)]
[AArch64] Add precommit test for bcmp; NFC

20 months ago[clang-format] Move bracket to correct line.
Adrian Kuegel [Tue, 25 Oct 2022 09:04:59 +0000 (11:04 +0200)]
[clang-format] Move bracket to correct line.

20 months ago[AArch64][SVE] Use more flag-setting instructions
Cullen Rhodes [Tue, 25 Oct 2022 08:29:09 +0000 (08:29 +0000)]
[AArch64][SVE] Use more flag-setting instructions

If OP in PTEST(PG, OP(PG, ...)) has a flag-setting variant change the
opcode so the PTEST becomes redundant. This patch extends this existing
optimization in AArch64::optimizePTestInstr to cover all flag-setting
opcodes.

Reviewed By: peterwaller-arm

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

20 months ago[AArch64][SVE] NFC: extend tests for flag-setting predicate instructions
Cullen Rhodes [Tue, 25 Oct 2022 08:28:12 +0000 (08:28 +0000)]
[AArch64][SVE] NFC: extend tests for flag-setting predicate instructions

A follow on patch will extend existing

  PTEST(PG, OP(PG, ...)) -> OP_FLAG_SETTING(PG, ...)

optimization in AArch64InstrInfo::optimizePTestInstr to cover more of
the flag-setting instructions

Reviewed By: peterwaller-arm

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

20 months ago[NFC][AMDGPU] Pre-commit test for D136432
Thomas Symalla [Tue, 25 Oct 2022 08:51:37 +0000 (10:51 +0200)]
[NFC][AMDGPU] Pre-commit test for D136432

Nested BFI instruction with multiple uses.

20 months ago[AArch64][SVE2] Add the SVE2.1 bfmlslb and bfmlslt instructions
David Sherwood [Wed, 19 Oct 2022 11:53:21 +0000 (11:53 +0000)]
[AArch64][SVE2] Add the SVE2.1 bfmlslb and bfmlslt instructions

This patch adds the assembly/disassembly for the following instructions:

BFMLSLB : BFloat16 floating-point multiply-subtract long
          from single-precision (bottom)
BFMLSLT : BFloat16 floating-point multiply-subtract long
          from single-precision (top)

Both the vector and indexed forms are added for each.

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

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

20 months ago[AArch64]SME2 Multi-vector ternary indexed DOT and FMLA instructions
Caroline Concatto [Fri, 21 Oct 2022 16:09:35 +0000 (17:09 +0100)]
[AArch64]SME2 Multi-vector ternary indexed DOT and FMLA instructions

This patch adds the assembly/disassembly for the following instruction:
FP:
  FMLA (multiple and indexed vector): Multi-vector floating-point fused multiply-add by indexed element.
  FMLS(multiple and indexed vector): Multi-vector floating-point fused multiply-subtract by indexed element.

  BFDOT (multiple and indexed vector): Multi-vector BFloat16 floating-point dot-product by indexed element.
  FDOT (multiple and indexed vector): Multi-vector half-precision floating-point dot-product by indexed element.
  BFVDOT: Multi-vector BFloat16 floating-point vertical dot-product by indexed element.
  FVDOT: Multi-vector half-precision floating-point vertical dot-product by indexed element.

INT:
  SDOT (2-way, multiple and indexed vector): Multi-vector signed integer dot-product by indexed element.
       (4-way, multiple and indexed vector): Multi-vector signed integer dot-product by indexed element.
  SUDOT (multiple and indexed vector): Multi-vector signed by unsigned integer dot-product by indexed elements.
  SUVDOT: Multi-vector signed by unsigned integer vertical dot-product by indexed element.
  UDOT (2-way, multiple and indexed vector): Multi-vector unsigned integer dot-product by indexed element.
       (4-way, multiple and indexed vector): Multi-vector unsigned integer dot-product by indexed element.
  USDOT (multiple and indexed vector): Multi-vector unsigned by signed integer dot-product by indexed element.
  USVDOT: Multi-vector unsigned by signed integer vertical dot-product by indexed element.

For the multi-vec ternary indexed with 2 and 4 ZA single-vectors for
32 and 64 bits according to the instruction

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

Depends on:D135563

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

20 months ago[MachineVerifier] Try harder to verify LiveVariables
Jay Foad [Wed, 6 Jul 2022 13:00:32 +0000 (14:00 +0100)]
[MachineVerifier] Try harder to verify LiveVariables

Verify the LiveVariables analysis after a pass that claims to preserve
it, even if there are no further passes (apart from the verifier itself)
that would use the analysis.

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

20 months ago[X86] Update LiveVariables in more cases in convertToThreeAddress
Jay Foad [Mon, 24 Oct 2022 14:00:36 +0000 (15:00 +0100)]
[X86] Update LiveVariables in more cases in convertToThreeAddress

Following on from D129634, this patch fixes more X86 CodeGen test
failures with D129213 applied, which adds verification of LiveIntervals
after the TwoAddressInstruction pass runs. These failures only showed up
with LLVM_ENABLE_EXPENSIVE_CHECKS=ON which adds the equivalent of an
implicit -verify-machineinstrs on all tests.

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

20 months ago[AArch64][SME] Fix chain for arm_locally_streaming functions.
Sander de Smalen [Tue, 25 Oct 2022 07:53:31 +0000 (07:53 +0000)]
[AArch64][SME] Fix chain for arm_locally_streaming functions.

The Chain wasn't set correctly in the DAG for functions marked
with aarch64_pstate_sm_body, which meant that SelectionDAG would
dead-code some of the CopyToReg's. This didn't show up in the
existing tests because all uses were in the same block, but when
adding some control-flow, suddenly things would break.

Reviewed By: kmclaughlin

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

20 months ago[AArch64]SME2 Multiple vectors Int/FP clamp instructions for two/four registers
Caroline Concatto [Fri, 21 Oct 2022 15:44:23 +0000 (16:44 +0100)]
[AArch64]SME2 Multiple vectors Int/FP clamp instructions for two/four registers

This patch adds the assembly/disassembly for the following instruction:
Int:
  SCLAMP:Multi-vector signed clamp to minimum/maximum vector.
  UCLAMP:Multi-vector unsigned clamp to minimum/maximum vector.
FP:
  FCLAMP: Multi-vector floating-point clamp to minimum/maximum number.

  The reference can be found here:

    https://developer.arm.com/documentation/ddi0602/2022-09

    Depends on: D135563

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

20 months ago[NFC] Fix merge mistake in TokenAnnotator.cpp
Tobias Hieta [Tue, 25 Oct 2022 08:08:28 +0000 (10:08 +0200)]
[NFC] Fix merge mistake in TokenAnnotator.cpp

20 months ago[AArch64]SME2 Single and multiple vectors SVE Destructive two/four registers[part2]
Caroline Concatto [Fri, 21 Oct 2022 14:59:18 +0000 (15:59 +0100)]
[AArch64]SME2 Single and multiple vectors SVE Destructive two/four registers[part2]

This patch adds the assembly/disassembly for the following instruction:
INT:
  SMAX (multiple and single vector): Multi-vector signed maximum by vector.
       (multiple vectors): Multi-vector signed maximum.
  SMIN (multiple and single vector): Multi-vector signed minimum by vector.
       (multiple vectors): Multi-vector signed minimum.
  UMAX (multiple and single vector): Multi-vector unsigned maximum by vector.
       (multiple vectors): Multi-vector unsigned maximum.
  UMIN (multiple and single vector): Multi-vector unsigned minimum by vector.
       (multiple vectors): Multi-vector unsigned minimum.
  SRSHL (multiple and single vector): Multi-vector signed rounding shift left by vector.
        (multiple vectors): Multi-vector signed rounding shift left.
  URSHL (multiple and single vector): Multi-vector unsigned rounding shift left by vector.
        (multiple vectors): Multi-vector unsigned rounding shift left.
FP:
  FMAX (multiple and single vector): Multi-vector floating-point maximum by vector.
       (multiple vectors): Multi-vector floating-point maximum.
  FMAXNM (multiple and single vector): Multi-vector floating-point maximum number by vector.
         (multiple vectors): Multi-vector floating-point maximum number.
  FMIN (multiple and single vector): Multi-vector floating-point minimum by vector.
       (multiple vectors): Multi-vector floating-point minimum.
  FMINNM (multiple and single vector): Multi-vector floating-point minimum number by vector.
         (multiple vectors): Multi-vector floating-point minimum number.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

It also updates ADD and SQDMULH

Depends on: D135563

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

20 months ago[AArch64][ARM] Alter v8.1a neon intrinsics to be target-based, not preprocessor based
David Green [Tue, 25 Oct 2022 08:02:52 +0000 (09:02 +0100)]
[AArch64][ARM] Alter v8.1a neon intrinsics to be target-based, not preprocessor based

As a continuation of D132034, this switches the QRDMX v8.1a neon
intrinsics over from preprocessor defines to be target-gated. As there
is no "rdma" or "qrdmx" target feature, they use the "v8.1a"
architecture feature directly.

This works well for AArch64, but something needs to be done for Arm at
the same time, as they both use the same header and tablegen emitter.
This patch opts for adding "v8.1a" and all dependant target features to
the Arm TargetParser, similar to what was recently done for AArch64 but
through initFeatureMap when the Architecture is parsed. I attempted to
make the code similar to the AArch64 backend.

Otherwise this is similar to the changes made in D132034.

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

20 months ago[clang-format] Mark pragma region lines as StringLiterals
Tobias Hieta [Tue, 25 Oct 2022 07:59:10 +0000 (09:59 +0200)]
[clang-format] Mark pragma region lines as StringLiterals

In our code-base we auto-generate pragma regions the regions
look like method signatures like:

`#pragma region MYREGION(Foo: bar)`

The problem here was that the rest of the line after region
was not marked as stringliteral as in the case of pragma mark
so clang-format tried to change the formatting based on the
method signature.

Added test and mark it similar as pragma mark.

Reviewed By: owenpan

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

20 months ago[IncludeCleaner] Handle more C++ constructs
Kadir Cetinkaya [Wed, 17 Aug 2022 14:54:04 +0000 (16:54 +0200)]
[IncludeCleaner] Handle more C++ constructs

Summary:
This brings IncludeCleaner's reference discovery from AST to the parity
with current implementation in clangd. Some highlights:
- Handling of MemberExprs, only the member declaration is marked as
  referenced and not the container, unlike clangd.
- Constructor calls, only the constructor and not the container, unlike
  clangd.
- All the possible candidates for unresolved overloads, same as clangd.
- All the shadow decls for using-decls, same as clangd.
- Declarations for definitions of enums with an underlying type and
  functions, same as clangd.
- Using typelocs, using templatenames and typedefs only reference the
  found decl, same as clangd.
- Template specializations only reference the primary template, not the
  explicit specializations, to be fixed.
- Expr types aren't marked as used, unlike clangd.

Going forward, we can consider having signals to indicate type of a
reference (e.g. `implicit` signal for type of an expr) so that the
applications can perform a filtering based on their needs.
At the moment the biggest discrepancy is around type of exprs, i.e. not
marking containers for member/constructor accesses. I believe this is
the right model since the declaration of the member and the container
should be available in a single file (modulo macros).

Reviewers: sammccall

Subscribers:

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

20 months ago[clang] Replace BACKEND_PACKAGE_STRING with LLVM_VERSION_STRING
Fangrui Song [Tue, 25 Oct 2022 07:24:25 +0000 (00:24 -0700)]
[clang] Replace BACKEND_PACKAGE_STRING with LLVM_VERSION_STRING

420d7ccbac0f499a6ff9595bdbfa99cd3376df22 introduced BACKEND_PACKAGE_STRING to
replace `PACKAGE_VERSION` (llvm/Config/config.h) to support standalone builds.
This is used in the output of `clang -cc1 -v`.

Since llvm-config.h is available for both standalone and non-standalone builds,
we can just use `LLVM_VERSION_STRING` from llvm-config.h.

clang/cmake/modules/AddClang.cmake uses `VERSION_STRING "${CLANG_VERSION} (${BACKEND_PACKAGE_STRING})"`.
Just simplify it to `"${CLANG_VERSION}"` so that we can remove the CMake
variable BACKEND_PACKAGE_STRING.

Reviewed By: tstellar

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

20 months ago[ObjCARC][NFC] Fix defined but not used warning from D135041
LiaoChunyu [Tue, 25 Oct 2022 07:01:57 +0000 (15:01 +0800)]
[ObjCARC][NFC] Fix defined but not used warning from D135041

Reviewed By: MaskRay

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

20 months ago[gn build] Port fdac4c4e92e5
LLVM GN Syncbot [Tue, 25 Oct 2022 06:57:59 +0000 (06:57 +0000)]
[gn build] Port fdac4c4e92e5

20 months ago[X86] Add CMPCCXADD instructions.
Freddy Ye [Tue, 25 Oct 2022 05:49:14 +0000 (13:49 +0800)]
[X86] Add CMPCCXADD instructions.

For more details about these instructions, please refer to the latest ISE document: https://www.intel.com/content/www/us/en/develop/download/intel-architecture-instruction-set-extensions-programming-reference.html

Reviewed By: pengfei, skan

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

20 months ago[flang] Allow all OSes in fir::CodeGenSpecifics::get
Fangrui Song [Tue, 25 Oct 2022 05:45:28 +0000 (22:45 -0700)]
[flang] Allow all OSes in fir::CodeGenSpecifics::get

This allows all ELF operating systems to use target specifics tuned for Linux,
since they use mostly the same ABIs. If some triples are to excluded, it's
better done at the driver layer.

Reviewed By: emaste

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

20 months agollvm-reduce: Remove unnecessary arguments from test
Matt Arsenault [Mon, 24 Oct 2022 19:24:45 +0000 (12:24 -0700)]
llvm-reduce: Remove unnecessary arguments from test

20 months agollvm-reduce: Remove pointless template arguments
Matt Arsenault [Mon, 24 Oct 2022 17:55:29 +0000 (10:55 -0700)]
llvm-reduce: Remove pointless template arguments

20 months ago[mlir:LLVM] Rewrite the LLVMIR export to use the debug info attributes
River Riddle [Sat, 22 Oct 2022 23:28:32 +0000 (16:28 -0700)]
[mlir:LLVM] Rewrite the LLVMIR export to use the debug info attributes

This has been a long standing TODO, and actually enables users to generate
debug information for LLVM using the LLVM dialect; as opposed to our
dummy placeholder that generated just enough for line table information.

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

20 months ago[ompd] Fix gdb-plugin warnings after D100185
Fangrui Song [Tue, 25 Oct 2022 05:28:27 +0000 (22:28 -0700)]
[ompd] Fix gdb-plugin warnings after D100185

20 months ago[RISCV] Add shift amount operands of shift, rotate, and Zbs instructions to hasAllNBi...
Craig Topper [Tue, 25 Oct 2022 05:02:48 +0000 (22:02 -0700)]
[RISCV] Add shift amount operands of shift, rotate, and Zbs instructions to hasAllNBitUsers.

20 months agoAdd a document on side effects & speculation in MLIR
Sanjoy Das [Thu, 13 Oct 2022 18:08:04 +0000 (11:08 -0700)]
Add a document on side effects & speculation in MLIR

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

20 months ago[RISCV] Add ORI to hasAllNBitUsers.
Craig Topper [Tue, 25 Oct 2022 04:32:48 +0000 (21:32 -0700)]
[RISCV] Add ORI to hasAllNBitUsers.

If the immediate is negative with sufficient leading ones, then
the upper bits of the other operand aren't demanded.

20 months ago[RISCV] Move vector cost table lookup out of the switch in getIntrinsicInstrCost...
Craig Topper [Tue, 25 Oct 2022 03:30:54 +0000 (20:30 -0700)]
[RISCV] Move vector cost table lookup out of the switch in getIntrinsicInstrCost. NFC

This allows vectors to be looked up if the switch is used for the
scalar version of an intrinsic.

Extracted from D136508.

20 months ago[RISCV] Rename lowerFTRUNC_FCEIL_FFLOOR_FROUND to lowerVectorFTRUNC_FCEIL_FFLOOR_FROU...
Craig Topper [Tue, 25 Oct 2022 00:14:53 +0000 (17:14 -0700)]
[RISCV] Rename lowerFTRUNC_FCEIL_FFLOOR_FROUND to lowerVectorFTRUNC_FCEIL_FFLOOR_FROUND. NFC

Extracted from D136508.

20 months ago[clang-format] Insert closing braces after an unaffected line
owenca [Sun, 23 Oct 2022 08:28:43 +0000 (01:28 -0700)]
[clang-format] Insert closing braces after an unaffected line

The token that records the number of closing braces to be inserted
may be on an unaffected line. Extra work is required in order to
actually insert the closing braces after inserting the matching
opening braces of affected lines.

Fixes #58161.

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

20 months ago[flang] Add two semantic checks about BIND(C) attribute
Peixin-Qiao [Tue, 25 Oct 2022 02:19:54 +0000 (10:19 +0800)]
[flang] Add two semantic checks about BIND(C) attribute

As Fortran 2018 C1546, an elemental procedure shall not have the BIND
attribute.

As 18.3.6, it does not mention that an array with VALUE can be
interoperable. It is not reasonable to pass an array by value when the
array is too large. Forbid it to be consistent with gfortran/ifort.

Reviewed By: jeanPerier

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

20 months ago[flang] Make default quad precision kind target dependent
Peixin-Qiao [Tue, 25 Oct 2022 02:15:34 +0000 (10:15 +0800)]
[flang] Make default quad precision kind target dependent

The quad precision kind is defined as 8 by default in
flang/include/flang/Common/default-kinds.h. However, it should be target
dependent. This fixes the default quad precision kind when the target
is on X86_64.

Reviewed By: klausler

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

20 months ago[memprof] Respect COMPILER_RT_BUILD_MEMPROF when install memprof headers
Enna1 [Tue, 25 Oct 2022 01:34:50 +0000 (09:34 +0800)]
[memprof] Respect COMPILER_RT_BUILD_MEMPROF when install memprof headers

When COMPILER_RT_BUILD_MEMPROF is disabled, the memprof headers should not be installed.

Reviewed By: mgorny, tejohnson

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

20 months agoFix LazyInitialization in tsan
zijunzhao [Tue, 25 Oct 2022 00:19:03 +0000 (00:19 +0000)]
Fix LazyInitialization in tsan

In Android, further initialization is always necessary whether preinit_array can be used.
LazyInitialize is needed regardless of .preinit_array support on platforms where runtime is loaded as dynamic library, e.g. Android.

Reviewed By: dvyukov, vitalybuka

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

20 months ago[Polly][docs] Avoid use of code-block:: guess.
Michael Kruse [Mon, 24 Oct 2022 23:45:38 +0000 (18:45 -0500)]
[Polly][docs] Avoid use of code-block:: guess.

The 'guess' language triggers a warning in the polly-sphinx-docs:
https://lab.llvm.org/staging/#/builders/199/builds/209
which is treated as an error by default.

This might be related to the Sphinx bug
https://github.com/sphinx-doc/sphinx/issues/7139

20 months ago[clang] Fix missing diagnostic of declaration use when accessing TypeDecls through...
Matheus Izvekov [Sat, 22 Oct 2022 13:51:54 +0000 (15:51 +0200)]
[clang] Fix missing diagnostic of declaration use when accessing TypeDecls through typename access

Fixes GH58547.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136533

20 months ago[ASAN] Remove asserts introduced in https://reviews.llvm.org/D136197
Roy Sundahl [Mon, 24 Oct 2022 23:01:40 +0000 (16:01 -0700)]
[ASAN] Remove asserts introduced in https://reviews.llvm.org/D136197

Additional calls were introduced for outlining (opposite of inlining)
in https://reviews.llvm.org/D136197 which contain asserts that partial
poisoning of a single byte wouldn't happen consecutively but this is
too strong and actually does occur in Windows. Removing those asserts
as they are unnecessary

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

20 months ago[MSAN] Add handleCountZeroes for ctlz and cttz.
Kevin Athey [Tue, 25 Oct 2022 00:08:52 +0000 (17:08 -0700)]
[MSAN] Add handleCountZeroes for ctlz and cttz.

This addresses a bug where vector versions of ctlz are creating false positive reports.

Depends on D136369

Reviewed By: vitalybuka

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

20 months ago[libc] Add the header sys/types.h.
Siva Chandra Reddy [Mon, 24 Oct 2022 22:18:58 +0000 (22:18 +0000)]
[libc] Add the header sys/types.h.

Reviewed By: michaelrj

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

20 months ago[MSAN] Count Zeroes test for covering ctlz and cttz under MSAN. (NFC)
Kevin Athey [Sat, 22 Oct 2022 09:12:53 +0000 (02:12 -0700)]
[MSAN] Count Zeroes test for covering ctlz and cttz under MSAN. (NFC)

Reviewed By: vitalybuka

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

20 months agoFix breakpoint setting so it always works when there is a line entry in a compile...
Greg Clayton [Tue, 18 Oct 2022 21:59:26 +0000 (14:59 -0700)]
Fix breakpoint setting so it always works when there is a line entry in a compile unit's line table.

Prior to this fix, if the compile unit function:

  void CompileUnit::ResolveSymbolContext(const SourceLocationSpec &src_location_spec, SymbolContextItem resolve_scope, SymbolContextList &sc_list);

was called with a resolve scope that wasn't just eSymbolContextLineEntry, we would end up calling:

  line_entry.range.GetBaseAddress().CalculateSymbolContext(&sc, resolve_scope);

This is ok as long as the line entry's base address is able to be resolved back to the same information, but there were problems when it didn't. The example I found was we have a file with a bad .debug_aranges section where the address to compile unit mapping was incomplete. When this happens, the above function call to calculate the symbol context would end up matching the module and it would NULL out the compile unit and line entry, which means we would fail to set this breakpoint. We have many other clients that ask for eSymbolContextEverything as the resolve_scope, so all other locations could end up failing as well.

The solutions is to make sure the compile unit matches the current compile unit after calling the calculate symbol context. If the compile unit is NULL, then we report an error via the module/debugger as this indicates an entry in the line table fails to resolve back to any compile unit. If the compile unit is not NULL and it differs from the current compile unit, we restore the current compile unit and line entry to ensure the call to .CalculateSymbolContext doesn't match something completely different, as can easily happen if LTO or other link time optimizations are enabled that could end up outlining or merging functions.

This patch allows breakpoint succeeding to work as expected and not get short circuited by our address lookup logic failing.

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

20 months ago[libc] Build fix.
Raman Tenneti [Mon, 24 Oct 2022 23:16:40 +0000 (16:16 -0700)]
[libc] Build fix.

Build fix.

Reviewed By: rtenneti

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

20 months agoNFC: [clang] Template argument cleanups.
Matheus Izvekov [Mon, 24 Oct 2022 12:18:46 +0000 (14:18 +0200)]
NFC: [clang] Template argument cleanups.

Removes a bunch of obsolete methods in favor of a single one returning
an ArrayRef of TemplateArgument.

Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Differential Revision: https://reviews.llvm.org/D136602