Commit Graph

432706 Commits

Author SHA1 Message Date
Dominik Adamski 98ed6e1069 [Flang][OpenMP] Fix conversion of nested loops for SIMD directive
Flang was not able to convert simd directive which contains nested
Fortran loops. The nested Fortran loops inside SIMD directive
are modelled as FIR loops and they need to be translated into LLVM
MLIR dialect.

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

Reviewed by: peixin

Signed-off-by: Dominik Adamski <dominik.adamski@amd.com>
2022-08-10 03:54:30 -05:00
David Spickett 5e538c669c [LLDB] Add multi value test for const static enum
1438639a2f removed a test
that was using undefined behaviour setting a non-typed enum
to a value outside its known range.

That test also checked if we formatted the value properly
when it could contain >1 valid enum value.

I don't think there's anything special about how we format
typed vs non-typed enums so I'm adding a test for ScopedEnum
that will expect to see 2 enum values plus extra.

Reviewed By: labath, Michael137, shafik

Differential Revision: https://reviews.llvm.org/D131472
2022-08-10 08:50:12 +00:00
Nikita Popov 32017d5efe [Attributor] Check for noalias call in AAInstanceInfo
The relevant property of allocation functions of interest here is
their uniqueness (in the sense of disjoint provenance), which is
encoded by the noalias return attribute.

Differential Revision: https://reviews.llvm.org/D130225
2022-08-10 10:27:14 +02:00
Nikita Popov 3bba12a81e [Flang] Use find_program() to find clang-tblgen
Use find_program() to find the clang-tblgen executable. The current
code ends up using docs/clang-tblgen for me...

This is the same way that mlir-tblgen is obtained in:
2724143551/flang/CMakeLists.txt (L95-L96).

Differential Revision: https://reviews.llvm.org/D131475
2022-08-10 10:26:36 +02:00
Tobias Hieta 46a315a331
[workflow] Run release tasks for me (tru) as well.
Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D131493
2022-08-10 10:02:26 +02:00
Tobias Hieta 70165c55dc
[release] Use threaded compression with xz
Use xz -T0 to use your threads

Reviewed By: tstellar

Differential Revision: https://reviews.llvm.org/D131470
2022-08-10 10:01:47 +02:00
Fangrui Song 0e08061229 tsan: update Go rules to use -std=c++17
llvm-project has switched to require C++17.

Reviewed By: dvyukov

Differential Revision: https://reviews.llvm.org/D131536
2022-08-10 00:32:40 -07:00
Clement Courbet 5331e1229a [clang][transformer] Fix crash on replacement-less ASTEdit.
Given that we provide an EditGenerator edit(ASTEdit), we can't ever be
sure that the user won't give us an empty replacement.

Differential Revision: https://reviews.llvm.org/D128887
2022-08-10 09:08:05 +02:00
Siva Chandra Reddy 0071a79532 [libc] Add implementation of pthread_exit and thrd_exit.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D131451
2022-08-10 06:28:47 +00:00
Phoebe Wang 0729d00135 Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
Disable the build on macOS due to the bot fail.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D131147
2022-08-10 13:27:21 +08:00
Fangrui Song e3fcf2e06f [ELF] Simplify llvm::enumerate with structured binding. NFC 2022-08-09 21:52:08 -07:00
Fangrui Song 596f490ab9 [ELF] De-template BitcodeFile::parse. NFC 2022-08-09 21:46:28 -07:00
Med Ismail Bennani 5990cf3806 Revert "Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available""
This reverts commit ab4e5ed441 since it
causes a build failure on macOS:

https://green.lab.llvm.org/green/job/lldb-cmake/45984/
2022-08-09 21:45:21 -07:00
Fangrui Song dc55ab3840 [ELF] De-template createBitcodeSymbol. NFC 2022-08-09 21:43:36 -07:00
Med Ismail Bennani 66f8819c50 [lldb/crashlog] Refactor the CrashLogParser logic
This patch changes the CrashLogParser class to be both the base class
and a Factory for the JSONCrashLogParser & TextCrashLogParser.

That should help remove some code duplication and ensure both class
have a parse method.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09 21:01:37 -07:00
Med Ismail Bennani 355be8cf80 [lldb/crashlog] Skip null image dsym fetching on interactive mode
Sometimes, it can happen that a crash report has null images in its list
of used binaries. This manifests like such:

```
    0x0 - 0xffffffffffffffff ??? (*) <00000000-0000-0000-0000-000000000000> ???
```

When fetching debug symbols to symbolicate the crashlog stackframe,
having null images causes `dsymForUUID` to hang for few seconds.

This patch addresses that by skipping null images from being load by the
scripted process.

rdar://97419487

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09 21:01:37 -07:00
Med Ismail Bennani 41c1a5f9bd [lldb/crashlog] Add `-s|--skip-status` option to interactive mode
This patch introduces a new option for the interactive crashlog mode,
that will prevent it from dumping the `process status` & `thread backtrace`
output to the debugger console.

This is necessary when lldb in running from an IDE, to prevent flooding
the console with information that should be already present in the UI.

rdar://96813296

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09 21:01:37 -07:00
Med Ismail Bennani 13aa780f37 [lldb/crashlog] Remove 'process_path' parsing logic
In can happen when creating stackshot crash report that that key is missing.

Moreover, we try to parse that key but don't use it, or need it, since we
fetch images and symbolicate the stackframes using the binaries UUIDs.

This is why this patch removes everything that is related to the
`process_path`/`procPath` parsing.

rdar://95054188

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09 21:01:37 -07:00
Med Ismail Bennani 81cbc29457 [lldb/crashlog] Update frame regex matcher
This patch updates the regular expression matching stackframes in
crashlog to allow addresses that are 7 characters long and more (vs. 8
characters previously).

It changes the `0x[0-9a-fA-F]{7}[0-9a-fA-F]+` by `0x[0-9a-fA-F]{7,}`.

rdar://97684839

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09 21:01:37 -07:00
Med Ismail Bennani a07a75180c [lldb/crashlog] Surface error using SBCommandReturnObject argument
This patch allows the crashlog script to surface its errors to lldb by
using the provided SBCommandReturnObject argument.

rdar://95048193

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09 21:01:37 -07:00
Med Ismail Bennani a633c5e11b [lldb/crashlog] Add '-t|--target' option to interactive mode
This patch introduces a new flag for the interactive crashlog mode, that
allow the user to specify, which target to use to create the scripted
process.

This can be very useful when lldb already have few targets created:
Instead of taking the first one (zeroth index), we will use that flag to
create a new target. If the user didn't provide a target path, we will rely
on the symbolicator to create a targer.If that fails and there are already
some targets loaded in lldb, we use the first one.

rdar://94682869

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09 21:01:37 -07:00
John Demme d44f8a50d5 [MLIR] [Python] Fix the Windows build broken by d747a17
Windows builds require all control paths return. Since we don't have
`llvm_unreachable` in the Python bindings, just return `None`.
2022-08-09 20:07:33 -07:00
John Demme d747a170a4 [MLIR] [Python] Fix `Value.owner` to handle BlockArgs
Previously, calling `Value.owner()` would C++ assert in debug builds if
`Value` was a block argument. Additionally, the behavior was just wrong
in release builds. This patch adds support for BlockArg Values.
2022-08-09 19:37:04 -07:00
Phoebe Wang ab4e5ed441 Reland "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
Fix the mising change for truncdfbf2.c

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D131147
2022-08-10 10:22:15 +08:00
Phoebe Wang 00c0a34f6c Revert "[compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available"
This reverts commit 0ae2a41d80.

Revert due to buildbot fail.
2022-08-10 10:05:12 +08:00
Vitaly Buka 4a87afe25f
[sanitizer] Let internal symbolizer to use posix_memalign 2022-08-09 18:44:00 -07:00
Phoebe Wang 0ae2a41d80 [compiler-rt][BF16] Provide __truncsfbf2 only when __bf16 is available
#56854 shows a backwards compatibility problem when builtins of compiler-rt don't follow ABI. We need to prevent to fall into the trap again for BF16.

Reviewed By: bkramer

Differential Revision: https://reviews.llvm.org/D131147
2022-08-10 09:13:44 +08:00
Freddy Ye e4888a37d3 [X86][BF16] Enable __bf16 for x86 targets.
X86 psABI has updated to support __bf16 type, the ABI of which is the
same as FP16. See https://discourse.llvm.org/t/patch-add-optional-bfloat16-support/63149

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D130964
2022-08-10 09:00:47 +08:00
Phoebe Wang c7ec6e19d5 [X86][BF16] Make backend type bf16 to follow the psABI
X86 psABI has updated to support __bf16 type, the ABI of which is the
same as FP16. See https://discourse.llvm.org/t/patch-add-optional-bfloat16-support/63149

This is an alternative of D129858, which has less code modification and
supports the vector type as well.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D130832
2022-08-10 08:58:56 +08:00
Fangrui Song dfe2a3f3eb [COFF] Change a llvm::StringSet<> to llvm::DenseSet<StringRef>. NFC
The former stores strings and is therefore more expensive.
2022-08-09 17:50:42 -07:00
YingChi Long 55d3b79d15
[clang] add APValue type check in `TryPrintAsStringLiteral`
Fixes https://github.com/llvm/llvm-project/issues/57013

https://reviews.llvm.org/D115031 improved printing of non-type template
parameter args. But checking if the end of Inits is 0 without checking
if APValue is an integer, causes clang to segfault. This patch adds
the code to check the type. (May not be a proper bugfix.)

Reviewed By: aaron.ballman, lichray

Differential Revision: https://reviews.llvm.org/D131466
2022-08-10 08:42:59 +08:00
malavikasamak c74a204826 [analyzer] Fix false positive in use-after-move checker
Differential Revision: https://reviews.llvm.org/D131525
2022-08-09 17:26:30 -07:00
Aart Bik 5110eb8b67 [mlir][sparse] fix doc
Reviewed By: Peiming

Differential Revision: https://reviews.llvm.org/D131527
2022-08-09 17:19:39 -07:00
Adrian Prantl af4a39f800 Fix modeline 2022-08-09 16:35:24 -07:00
Adrian Vogelsgesang 9df5892804 [libc++] Implement `operator<=>` for `type_index`
Implements part of P1614R2 "The Mothership has Landed"

Differential Revision: https://reviews.llvm.org/D131357
2022-08-09 16:35:17 -07:00
Med Ismail Bennani 4c2fb2e551 [lldb/crashlog] Fix interactive crashlog test
This patch should fix the interactive crashlog test by checking in the
binary as a yaml to regeneate the binary with the addresses and offsets
when running the test.

rdar://93655633

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-08-09 16:33:31 -07:00
Adrian Vogelsgesang cfefee87c2 [libc++][NFC] Remove TEST_HAS_NO_SPACESHIP_OPERATOR
The corresponding _LIBCPP_HAS_NO_SPACESHIP_OPERATOR macro was already
removed in commit c0f87e8382

Differential Revision: https://reviews.llvm.org/D131215
2022-08-09 16:32:54 -07:00
Kazu Hirata a044d0491e [llvm-profdata] Support JSON as as an output-only format
This patch teaches llvm-profdata to output the sample profile in the
JSON format.  The new option is intended to be used for research and
development purposes.  For example, one can write a Python script to
take a JSON file and analyze how similar different inline instances of
a given function are to each other.

I've chosen JSON because Python can parse it reasonably fast, and it
just takes a couple of lines to read the whole data:

  import json
  with open ('profile.json') as f:
    profile = json.load(f)

Differential Revision: https://reviews.llvm.org/D130944
2022-08-09 16:24:53 -07:00
Adrian Vogelsgesang df9a23e2fe [libunwind] Use `_dl_find_object` if available
As shown in P2544R0 [1] and the accompanying benchmark [2], the
current unwinding logic does not scale for multi-threaded programs.
This is because `dl_iterate_phdr` takes a global lock.

glibc 2.35 added `_dl_find_object` which directly returns the unwind
info for a given target address. `_dl_find_object` is fully lock-free
and hence allows parallel exception unwinding on multiple threads.

With this commit, libunwind now takes advantage of `_dl_find_object`.
Thereby, this commit improves libunwind's performance on benchmark [2]
for unwinding exception on 20 threads from 1103ms to 78ms.
(measured on Intel Xeon Silver 4114 with 20 physical cores)

[1] https://isocpp.org/files/papers/P2544R0.html
[2] https://github.com/neumannt/exceptionperformance

Detailed performance numbers from the benchmark:

Before:
> Testing unwinding performance: sqrt computation with occasional errors
>
> testing baseline using 1 2 4 8 16 20 threads
> failure rate 0%: 34 35 34 35 35 36
> testing exceptions using 1 2 4 8 16 20 threads
> failure rate 0%: 16 32 33 34 35 36
> failure rate 0.1%: 16 32 34 36 35 36
> failure rate 1%: 20 40 40 43 90 113
> failure rate 10%: 59 92 140 304 880 1103
> [...]
>
> Testing invocation overhead: recursive fib with occasional errors
>
> testing exceptions using 1 2 4 8 16 20 threads
> failure rate 0%: 19 32 37 38 39 36
> failure rate 0.1%: 22 32 40 40 39 34
> failure rate 1%: 20 28 38 39 48 40
> failure rate 10%: 25 39 44 50 92 113

After:
> Testing unwinding performance: sqrt computation with occasional errors
>
> testing baseline using 1 2 4 8 16 20 threads
> failure rate 0%: 19 30 35 38 39 35
> testing baseline using 1 2 4 8 16 20 threads
> failure rate 0%: 32 35 33 34 34 36
> testing exceptions using 1 2 4 8 16 20 threads
> failure rate 0%: 16 35 33 37 35 35
> failure rate 0.1%: 16 32 36 33 34 37
> failure rate 1%: 21 37 39 40 40 41
> failure rate 10%: 72 75 76 80 80 78
> [...]
>
> Testing invocation overhead: recursive fib with occasional errors
>
> testing baseline using 1 2 4 8 16 20 threads
> failure rate 0%: 18 35 37 34 38 37
> testing exceptions using 1 2 4 8 16 20 threads
> failure rate 0%: 19 33 40 40 41 39
> failure rate 0.1%: 21 33 39 38 39 38
> failure rate 1%: 20 36 39 40 41 40
> failure rate 10%: 25 45 41 42 44 43

Differential Revision: https://reviews.llvm.org/D130668
2022-08-09 16:19:13 -07:00
alex-t 3f8ae7efa8 [AMDGPU] SIFixSGPRCopies refactoring
This change finalizes the series of patches aiming to replace old
strategy of VGPR to SGPR copies loweriong.  Following the
https://reviews.llvm.org/D128252 and https://reviews.llvm.org/D130367 code
parts that are no longer used were removed.  Pass main loop is no longer used
for the MIR changes but collect information for further analysis.  Actual MIR
lowering happens further according the analysys result in the set of separate
functions. Another important change concerns the order of lowering: VGPR to
SGPR copies lowering is done first to have priority on the rest of the MIR
changes.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D131246
2022-08-10 00:51:57 +02:00
Evgenii Stepanov cf1d9a1fdc [sanitizer] Use C++17 to build the symbolizer. 2022-08-09 15:33:03 -07:00
Siva Chandra Reddy 80652d270a [libc][NFC] Fix a few compiler warnings. 2022-08-09 22:30:40 +00:00
Philip Reames 46fe24e2fb [RISCV] Split check lines for fpclamptosat_vec test
This is currently exercising scalarization code path; with vectors enabled, we hit a different code path.  Explicitly exercise both so that both configurations have testing.
2022-08-09 15:03:29 -07:00
Pengxuan Zheng 9bb6622423 [ARM] Do not use LOAD_STACK_GUARD with ROPI/RWPI
ROPI/RWPI are not supported with LOAD_STACK_GUARD currently.

Reviewed By: nickdesaulniers, rengolin

Differential Revision: https://reviews.llvm.org/D131427
2022-08-09 14:59:08 -07:00
Jim Ingham 36a461b8c2 @skipIfAsan for the other long test in TestMemoryRegion.py
These two tests were each of them too long when running under ASAN,
so we have to skip both to get a clean ASAN bot run.
2022-08-09 14:55:20 -07:00
Siva Chandra Reddy c6dcc359ac [libc] Add __cxa_atexit support to the atexit function.
Reviewed By: abrachet

Differential Revision: https://reviews.llvm.org/D131219
2022-08-09 21:42:41 +00:00
Siva Chandra Reddy daa44a2309 [libc] Add a utility data structure named FixedVector.
This data structure uses a backing cpp::array object and supports a
vector like push_back API. In comparison with a traditional vector
data structure, it is of a fixed capacity and cannot be resized.

Differential Revision: https://reviews.llvm.org/D131377
2022-08-09 21:29:54 +00:00
Dinar Temirbulatov cab6cd6834 [AArch64][LoopVectorize] Introduce trip count minimal value threshold to ignore tail-folding.
After D121595 was commited, I noticed regressions assosicated with small trip
count numbersvectorisation by tail folding with scalable vectors. As a solution
for those issues I propose to introduce the minimal trip count threshold value.

  Differential Revision: https://reviews.llvm.org/D130755
2022-08-09 22:10:17 +01:00
Jeff Niu 65923012b3 [flang] Revert changes (NFC) 2022-08-09 16:10:21 -04:00
Jeff Niu 2f0e50c69b [mlir] Fix build of toyc-ch6 (NFC) 2022-08-09 15:58:49 -04:00