platform/upstream/llvm.git
17 months ago[libc][NFC] Remove allocator definition in the api-test.
Siva Chandra Reddy [Sun, 5 Mar 2023 00:23:48 +0000 (00:23 +0000)]
[libc][NFC] Remove allocator definition in the api-test.

The integration tests already have allocators so we will get all of them
from there.

17 months agoFix broken link on Clang documentation page
Tulio Leao [Sat, 4 Mar 2023 22:56:15 +0000 (00:56 +0200)]
Fix broken link on Clang documentation page

While browsing the latest [clang manual](https://clang.llvm.org/docs/ReleaseNotes.html), I came across this warning and clicked, but it leads to a broken page, apparently because it's missing the trailing `/`. Seems to be the only place where it's missing in the whole of LLVM monorepo.

{F26690053}
{F26690057}

Reviewed By: brenoguim, royjacobson

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

17 months ago[X86] Add non-BMI tests to bit_ceil.ll
Kazu Hirata [Sat, 4 Mar 2023 20:20:04 +0000 (12:20 -0800)]
[X86] Add non-BMI tests to bit_ceil.ll

17 months ago[OpenMP][CUDA] Get rid of redundant macro def
Shao-Ce SUN [Sat, 4 Mar 2023 17:55:55 +0000 (01:55 +0800)]
[OpenMP][CUDA] Get rid of redundant macro def

Resolve warning of `TARGET_NAME` macro redefinition.

Reviewed By: jhuber6

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

17 months agoRevert "[CMake] Bumps minimum version to 3.20.0."
Mark de Wever [Sat, 4 Mar 2023 17:28:13 +0000 (18:28 +0100)]
Revert "[CMake] Bumps minimum version to 3.20.0."

Some build bots have not been updated to the new minimal CMake version.
Reverting for now and ping the buildbot owners.

This reverts commit 44c6b905f8527635e49bb3ea97dea315f92d38ec.

17 months agoRe-land "[clang][Interp] Implement C++ Range-for loops"
Timm Bäder [Thu, 2 Mar 2023 10:05:45 +0000 (11:05 +0100)]
Re-land "[clang][Interp] Implement C++ Range-for loops"

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

17 months ago[libc++][format] Fixes formatting vector<bool>
Mark de Wever [Fri, 17 Feb 2023 17:55:48 +0000 (18:55 +0100)]
[libc++][format] Fixes formatting vector<bool>

Formatting a const qualified vector<bool> fails to work on libc++. This
is due to our non-conforming type for vector<bool>::const_reference. The
type is a __bit_const_reference<vector> instead of a bool. (This is
fixed in ABI v2.)

This fixes this formatter and enables the test written for it.

Reviewed By: #libc, ldionne

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

17 months ago[libc++][format] Addresses LWG3833.
Mark de Wever [Sun, 12 Feb 2023 18:46:13 +0000 (19:46 +0100)]
[libc++][format] Addresses LWG3833.

  LWG3833 Remove specialization template<size_t N> struct formatter<const charT[N], charT>

Depends on D143845

Reviewed By: #libc, ldionne

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

17 months ago[libc++] Addresses LWG3103.
Mark de Wever [Mon, 6 Feb 2023 20:43:35 +0000 (21:43 +0100)]
[libc++] Addresses LWG3103.

  LWG3103 Errors in taking subview of span should be ill-formed where possible

Note that the real work was already done before, including tests.

Reviewed By: #libc, ldionne

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

17 months ago[CMake] Bumps minimum version to 3.20.0.
Mark de Wever [Tue, 21 Feb 2023 19:09:21 +0000 (20:09 +0100)]
[CMake] Bumps minimum version to 3.20.0.

This partly undoes D137724.

This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193

Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.

Reviewed By: mehdi_amini, MaskRay, ChuanqiXu, to268, thieta, tschuett, phosek, #libunwind, #libc_vendors, #libc, #libc_abi, sivachandra, philnik, zibi

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

17 months ago[LoopInterchange] Remove unused RecurrenceDescriptor object. NFC
Craig Topper [Sat, 4 Mar 2023 06:15:32 +0000 (22:15 -0800)]
[LoopInterchange] Remove unused RecurrenceDescriptor object. NFC

17 months agofeat: harden permissions for all github workflows
Joyce Brum [Sat, 4 Mar 2023 05:34:25 +0000 (21:34 -0800)]
feat: harden permissions for all github workflows

Signed-off-by: Joyce Brum <joycebrum@google.com>
Reviewed By: tstellar

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

17 months ago[lldb] Simplify error string in ScriptedInterface (NFC)
Med Ismail Bennani [Sat, 4 Mar 2023 03:44:44 +0000 (19:44 -0800)]
[lldb] Simplify error string in ScriptedInterface (NFC)

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months ago[gn build] Port 3014a1c5a130
LLVM GN Syncbot [Sat, 4 Mar 2023 03:33:20 +0000 (03:33 +0000)]
[gn build] Port 3014a1c5a130

17 months ago[lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementation
Med Ismail Bennani [Fri, 3 Mar 2023 20:35:42 +0000 (12:35 -0800)]
[lldb/swig] Fix ref counting issue in SBProcess::GetScriptedImplementation

When using SBProcess::GetScriptedImplementation in python, if the
process has a valid implementation, we returned a reference of the
object without incrementing the reference counting. That causes the
interpreter to crash after accessing the reference several times.

This patch address this by incrementing the reference count when passing
the valid object reference.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months ago[lldb] Improve error reporting in ScriptedInterface
Med Ismail Bennani [Fri, 17 Feb 2023 01:34:37 +0000 (17:34 -0800)]
[lldb] Improve error reporting in ScriptedInterface

This patch improve error reporting in the Scripted Interface.

Previously, it would only log the content of the Status object and
overwrite it with the error_msg function parameter.

This patch changes that to append the Status object content to the
`error_msg` string.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months ago[lldb/Plugins] Add memory writing capabilities to Scripted Process
Med Ismail Bennani [Sat, 4 Mar 2023 03:30:56 +0000 (19:30 -0800)]
[lldb/Plugins] Add memory writing capabilities to Scripted Process

This patch adds memory writing capabilities to the Scripted Process plugin.

This allows to user to get a target address and a memory buffer on the
python scripted process implementation that the user can make processing
on before performing the actual write.

This will also be used to write trap instruction to a real process
memory to set a breakpoint.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months ago[lldb/Plugins] Clean-up Scripted Process interface requirements (NFC)
Med Ismail Bennani [Thu, 16 Feb 2023 23:15:52 +0000 (15:15 -0800)]
[lldb/Plugins] Clean-up Scripted Process interface requirements (NFC)

The goal of the simple patch is to clean-up the scripted process
interface by removing methods that were introduced with the interface
originally, but that were never really implemented (get_thread_with_id &
get_registers_for_thread).

This patch also changes `get_memory_region_containing_address` to have a
base implementation (that retunrs `None`), instead of forcing the user
to override it in their derived class.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months ago[lldb/Plugins] Add Attach capabilities to ScriptedProcess
Med Ismail Bennani [Fri, 3 Mar 2023 23:17:59 +0000 (15:17 -0800)]
[lldb/Plugins] Add Attach capabilities to ScriptedProcess

This patch adds process attach capabilities to the ScriptedProcess
plugin. This doesn't really expects a PID or process name, since the
process state is already script, however, this allows to create a
scripted process without requiring to have an executuble in the target.

In order to do so, this patch also turns the scripted process related
getters and setters from the `ProcessLaunchInfo` and
`ProcessAttachInfo` classes to a `ScriptedMetadata` instance and moves
it in the `ProcessInfo` class, so it can be accessed interchangeably.

This also adds the necessary SWIG wrappers to convert the internal
`Process{Attach,Launch}InfoSP` into a `SB{Attach,Launch}Info` to pass it
as argument the scripted process python implementation and convert it
back to the internal representation.

rdar://104577406

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months ago[lldb] Add scripted process launch/attach option to {,platform }process commands
Med Ismail Bennani [Fri, 3 Mar 2023 23:27:07 +0000 (15:27 -0800)]
[lldb] Add scripted process launch/attach option to {,platform }process commands

This patch does several things:

First, it refactors the `CommandObject{,Platform}ProcessObject` command
option class into a separate `CommandOptionsProcessAttach` option group.

This will make sure both the `platform process attach` and `process attach`
command options will always stay in sync without having with duplicate
them each time. But more importantly, making this class an `OptionGroup`
allows us to combine with a `OptionGroupPythonClassWithDict` to add
support for the scripted process managing class name and user-provided
dictionary options.

This patch also improves feature parity between `ProcessLaunchInfo` and
`ProcessAttachInfo` with regard to ScriptedProcesses, by exposing the
various getters and setters necessary to use them through the SBAPI.

This is foundation work for adding support to "attach" to a process from
the scripted platform.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months ago[lldb/Plugins] Add ScriptedProcess::GetCapabilities affordance (NFC)
Med Ismail Bennani [Tue, 31 Jan 2023 00:53:39 +0000 (16:53 -0800)]
[lldb/Plugins] Add ScriptedProcess::GetCapabilities affordance (NFC)

This patch introduces a new method to the Scripted Process interface,
GetCapabilities.

This returns a dictionary that contains a list of flags that the
ScriptedProcess instance supports. This can be used for instance, to
force symbol lookup, when loading dynamic libraries in the scripted process.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months ago[lldb] Extend SWIG SBProcess interface with WriteMemoryAsCString method
Med Ismail Bennani [Sat, 4 Mar 2023 02:52:15 +0000 (18:52 -0800)]
[lldb] Extend SWIG SBProcess interface with WriteMemoryAsCString method

This patch tries to address an interoperability issue when writing
python string into the process memory.

Since the python string is not null-terminated, it would still be
written to memory however, when trying to read it again with
`SBProcess::ReadCStringFromMemory`, the memory read would fail, since
the read string doens't contain a null-terminator, and therefore is not
a valid C string.

To address that, this patch extends the `SBProcess` SWIG interface to
expose a new `WriteMemoryAsCString` method that is only exposed to the
SWIG target language. That method checks that the buffer to write is
null-terminated and otherwise, it appends a null byte at the end of it.

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
17 months agoReapply: [WebAssembly] Implement build-id feature
Derek Schuff [Thu, 2 Mar 2023 23:52:25 +0000 (15:52 -0800)]
Reapply: [WebAssembly] Implement build-id feature

Implement the --build-id flag similarly to ELF, and generate a
build_id section according to the WebAssembly tool convention
specified in https://github.com/WebAssembly/tool-conventions/pull/183

The default style ("fast" aka "tree") hashes the contents of the
output and (unlike ELF) generates a v5 UUID based on the hash (using a
random namespace). It also supports generating a random v4 UUID, a
sha1 hash, and a user-specified string (as ELF does).

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

Fix MSVC build by std::copy on the underying buffer rather than
directly from std::array to llvm::MutableArrayRef

17 months ago[mlir] Update signal failure error message
Jacques Pienaar [Sat, 4 Mar 2023 01:06:48 +0000 (17:06 -0800)]
[mlir] Update signal failure error message

User was confused by previous wording when pass was reported as failing
due to signal in unrelated thread being caught.

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

17 months ago[analyzer] Remove the loop from the exploded graph caused by missing information...
isuckatcs [Fri, 10 Feb 2023 17:07:31 +0000 (18:07 +0100)]
[analyzer] Remove the loop from the exploded graph caused by missing information in program points

This patch adds CFGElementRef to ProgramPoints
and helps the analyzer to differentiate between
two otherwise identically looking ProgramPoints.

Fixes #60412

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

17 months ago[StripDebugInfo] Reuse DebugInfoFinder for findind Live CUs
Maksim Sabianin [Fri, 3 Mar 2023 23:20:27 +0000 (15:20 -0800)]
[StripDebugInfo] Reuse DebugInfoFinder for findind Live CUs

Previous search does not take into account @llvm.dbg.* intrinsics
and debug types information while DebugInfoFinder takes into account
such information.

Reviewed By: aprantl

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

17 months ago[lld-macho] Avoid running LTO pipeline for no files
Keith Smiley [Fri, 3 Mar 2023 21:27:03 +0000 (13:27 -0800)]
[lld-macho] Avoid running LTO pipeline for no files

If no bitcode files are given as inputs but -object_path_lto is passed
we should avoid running the LTO pipeline.

This mirrors this patch from the ELF port https://github.com/llvm/llvm-project/commit/f3994e4dfa0214b2a09a0e327ba37e6b38bbcdb3

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

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

17 months ago[gn build] Port 0eb59cab95a0
LLVM GN Syncbot [Fri, 3 Mar 2023 23:01:08 +0000 (23:01 +0000)]
[gn build] Port 0eb59cab95a0

17 months agoAPFloat: Add classify
Matt Arsenault [Thu, 2 Mar 2023 09:44:05 +0000 (05:44 -0400)]
APFloat: Add classify

17 months agoAttributor: Fix typos
Matt Arsenault [Fri, 24 Feb 2023 22:27:40 +0000 (18:27 -0400)]
Attributor: Fix typos

17 months agoAMDGPU: Use static constexpr instead of static const
Matt Arsenault [Fri, 3 Mar 2023 22:50:34 +0000 (18:50 -0400)]
AMDGPU: Use static constexpr instead of static const

Not sure why this was broken, but I was seeing this linker error:

ld64.lld: error: undefined symbol: (anonymous namespace)::AMDGPUInsertDelayAlu::DelayInfo::SALU_CYCLES_MAX
>>> referenced by AMDGPUInsertDelayAlu.cpp:129 (/Users/matt/src/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUInsertDelayAlu.cpp:129)

17 months agoADT: Move some FPClassTest utility functions out of instcombine
Matt Arsenault [Thu, 2 Mar 2023 09:47:52 +0000 (05:47 -0400)]
ADT: Move some FPClassTest utility functions out of instcombine

17 months agoADT: Move FPClassTest printing functions to common place
Matt Arsenault [Fri, 24 Feb 2023 14:35:49 +0000 (10:35 -0400)]
ADT: Move FPClassTest printing functions to common place

17 months ago[mlir][Parser] Make parse{Attribute,Type} null-terminate input
Rahul Kayaith [Thu, 2 Mar 2023 21:06:44 +0000 (16:06 -0500)]
[mlir][Parser] Make parse{Attribute,Type} null-terminate input

`parseAttribute` and `parseType` require null-terminated strings as
input, but this isn't great considering the argument type is
`StringRef`. This changes them to copy to a null-terminated buffer by
default, with a `isKnownNullTerminated` flag added to disable the
copying.

closes #58964

Reviewed By: rriddle, kuhar, lattner

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

17 months ago[AArch64] Add missing bf16 load insert pattern
David Green [Fri, 3 Mar 2023 22:00:41 +0000 (22:00 +0000)]
[AArch64] Add missing bf16 load insert pattern

We have LDRHui load patterns but would fail to select from unscaled offsets.
This adds the missing pattern.

17 months ago[lld-macho] Remove duplicate minimum version info
Keith Smiley [Fri, 3 Mar 2023 20:08:33 +0000 (12:08 -0800)]
[lld-macho] Remove duplicate minimum version info

At some point PlatformInfo's Target changed types to a type that also
has minimum deployment target info. This caused ambiguity if you tried
to get the target triple from the Target, as the actual minimum version
info was being stored separately. This bulk of this change is changing
the parsing of these values to support this.

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

17 months ago[lldb][test] NativePDB/ast-types: fix expected pointer format
Michael Buch [Fri, 3 Mar 2023 21:40:06 +0000 (21:40 +0000)]
[lldb][test] NativePDB/ast-types: fix expected pointer format

Format changed in `b642fd5ee250247ccefb38099169b4ee8ac4112b`

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

17 months ago[AMDGPU] Vectorize misaligned global loads & stores
Jeffrey Byrnes [Thu, 2 Mar 2023 00:29:03 +0000 (16:29 -0800)]
[AMDGPU] Vectorize misaligned global loads & stores

Based on experimentation on gfx906,908,90a and 1030, wider global loads / stores are more performant than multiple narrower ones independent of alignment -- this is especially true when combining 8 bit loads / stores, in which case speedup was usually 2x across all alignments.

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

Change-Id: I6ee6c76e6ace7fc373cc1b2aac3818fc1425a0c1

17 months ago[AMDGPU] Fix invalid instid value in s_delay_alu instruction
Jay Foad [Fri, 3 Mar 2023 12:12:15 +0000 (12:12 +0000)]
[AMDGPU] Fix invalid instid value in s_delay_alu instruction

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

17 months ago[bazel] Fix errno dep location: libc_function_deps -> deps
Jordan Rupprecht [Fri, 3 Mar 2023 20:59:56 +0000 (12:59 -0800)]
[bazel] Fix errno dep location: libc_function_deps -> deps

17 months ago[bazel] Add errno dep to stdlib tests
Jordan Rupprecht [Fri, 3 Mar 2023 20:55:03 +0000 (12:55 -0800)]
[bazel] Add errno dep to stdlib tests

In addition run buildifier.

17 months ago[clang/Diagnostic] Use `optional` to disambiguate between a `StoredDiagMessage` that...
Argyrios Kyrtzidis [Fri, 3 Mar 2023 18:35:23 +0000 (10:35 -0800)]
[clang/Diagnostic] Use `optional` to disambiguate between a `StoredDiagMessage` that is not set vs set as empty string

"But when would you have a completely empty diagnostic message", you ask dear reader?
That is when there is an empty "#warning" in code.

rdar://106155415

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

17 months ago[ELF] Add single quotes around out of range errors
Fangrui Song [Fri, 3 Mar 2023 20:48:16 +0000 (12:48 -0800)]
[ELF] Add single quotes around out of range errors

to match the convention we use for other diagnostics.

17 months ago[ELF] Mention section name for STT_SECTION in reportRangeError()
Fangrui Song [Fri, 3 Mar 2023 20:35:05 +0000 (12:35 -0800)]
[ELF] Mention section name for STT_SECTION in reportRangeError()

D73518 mentioned non-STT_SECTION symbol names. This patch extends the code to
handle STT_SECTION symbols, where we report the section name.
This change helps at least the following cases with very little code.

* Whether a out-of-range relocation is due to code or data.
* For a relocation in .debug_info, which referenced `.debug_*` section (due to DWARF32 limitation) causes the problem.

Reviewed By: peter.smith

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

17 months ago[RISCV][NFC] Add PIC RUN/CHECK lines for jumptable.ll test
Jessica Clarke [Fri, 3 Mar 2023 20:19:15 +0000 (20:19 +0000)]
[RISCV][NFC] Add PIC RUN/CHECK lines for jumptable.ll test

The omission of checking our PIC jump table code generation is a bit of
an oversight, so belatedly add this coverage.

17 months ago[RISCV][NFC] Unify CHECK lines for jumptable.ll @below_threshold test
Jessica Clarke [Fri, 3 Mar 2023 20:18:18 +0000 (20:18 +0000)]
[RISCV][NFC] Unify CHECK lines for jumptable.ll @below_threshold test

These are all identical across XLEN and code model since they're not
using a jump table, so unify them rather than having multiple copies.

17 months ago[RISCV][NFC] Add signext to jumptable.ll tests to avoid irrelevant sext.w
Jessica Clarke [Fri, 3 Mar 2023 20:14:31 +0000 (20:14 +0000)]
[RISCV][NFC] Add signext to jumptable.ll tests to avoid irrelevant sext.w

Sign-extending the input is irrelevant to the test in question, which
merely needs some arbitrary input to switch on. This also removes the
only difference between the RV32I and RV64I cases for @below_threshold
and will allow unifying them.

17 months ago[BOLT][Instrumentation] Preserve red zone for functions with tail calls only
Amir Ayupov [Fri, 3 Mar 2023 19:58:59 +0000 (11:58 -0800)]
[BOLT][Instrumentation] Preserve red zone for functions with tail calls only

Allow a function with tail calls only to clobber its red zone.

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

Reviewed By: #bolt, yota9

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

17 months ago[libc] Fix strspn
Alex Brachet [Fri, 3 Mar 2023 19:51:46 +0000 (19:51 +0000)]
[libc] Fix strspn

17 months ago[llvm-driver] Allow llvm driver binary to be called anything
Alex Brachet [Fri, 3 Mar 2023 19:45:03 +0000 (19:45 +0000)]
[llvm-driver] Allow llvm driver binary to be called anything

17 months ago[VPlan] Add test with intrinsic without side-effects (NFC).
Florian Hahn [Fri, 3 Mar 2023 19:30:30 +0000 (20:30 +0100)]
[VPlan] Add test with intrinsic without side-effects (NFC).

Extra test coverage for mayHaveSideEffects for VPWidenCallRecipe.

17 months ago[RISCV][llvm-tblgen] Support conditional definitions using !exists clauses
Philip Reames [Fri, 3 Mar 2023 19:10:26 +0000 (11:10 -0800)]
[RISCV][llvm-tblgen] Support conditional definitions using !exists clauses

The core part of this change is an extension to the tablegen language to allow conditional definition of records using if-statements based on !exists conditions.

The RISCV td file change is mostly to illustrate the potential use of conditional definitions. I am deliberately not maximally simplifying in this change to make merging with downstream code (or simply rebasing while this on review) easier.

Some background to make the change understandable.

TableGen does not have an if statement internally. It has if expressions - in the form of TernInitOp with IF opcode - and foreach statements. It implements an if-statement as a foreach which iterates either 0 or 1 times.

Foreach nodes are then evaluated via unrolling inside the parser. Specifically, they are evaluated, at latest, when the outermost multiclass or loop containing them reaches end of scope. The unrolled statements remain (potentially) unresolved after unrolling, but the number of iterations must be known at this point.

An !exists clause can only evaluate at final evaluation. (Specifically, forward references to definitions are allowed - up to the end of the containing scope at least.) The existing code did not set the final flag on the resolver, and thus would leave the !exists clause in an unresolved state. This would then cause an error since we don't know how many iterations on which to unroll the (synthetic) foreach loop.

I chose to only finally-evaluate the condition of the if-expression. This allows us to pick an arm at scope exit without inhibiting definitions in the arm from having self references.

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

17 months ago[test] Precommit test for D145210
Arthur Eubanks [Fri, 3 Mar 2023 17:43:53 +0000 (09:43 -0800)]
[test] Precommit test for D145210

17 months ago[libc] move stdlib and stdio to new errno pattern
Michael Jones [Thu, 2 Mar 2023 22:01:41 +0000 (14:01 -0800)]
[libc] move stdlib and stdio to new errno pattern

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

Reviewed By: sivachandra

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

17 months ago[llvm-lib] update ReleaseNotes for llvm-lib's new support for generating
Vadim Paretsky [Fri, 3 Mar 2023 18:54:27 +0000 (10:54 -0800)]
[llvm-lib] update ReleaseNotes for llvm-lib's new support for generating
an import library from a definition file

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

17 months agoAdd HitCount into Breakpoint statistics
Jeffrey Tan [Fri, 3 Mar 2023 00:03:35 +0000 (16:03 -0800)]
Add HitCount into Breakpoint statistics

Turns out breakpoint statistics is missing hitCount.
This patches adds the hitCount field.

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

17 months ago[llvm-cov] Optionally fail on missing binary ID
Daniel Thornburgh [Fri, 17 Feb 2023 21:43:57 +0000 (13:43 -0800)]
[llvm-cov] Optionally fail on missing binary ID

This adds the --check-binary-id flag that makes sure that an object file
is available for every binary ID mentioned in the given profile. This
should help make the tool more robust in CI environments where it's
expected that coverage mappings should be available for every object
contributing to the profile.

Reviewed By: gulfem

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

17 months ago[clang][deps] Fix test failing on AIX
Jan Svoboda [Fri, 3 Mar 2023 18:22:25 +0000 (10:22 -0800)]
[clang][deps] Fix test failing on AIX

Introduced in 86405450, caused by AIX defaulting to `-fno-integrated-as`.

17 months agoRemove extraneous characters when printing the timestamp for an XCOFF object file.
zhijian [Fri, 3 Mar 2023 18:18:58 +0000 (13:18 -0500)]
Remove extraneous characters when printing the timestamp for an XCOFF object file.

Summary:

The llvm-readobj prints extra characters for the timestamp when --file-headers is used with an XCOFF file. This change updates the format string used to print the time. In addition, the timestamp is printed in the local timezone, and a thread-safe call is used to convert the time.

Summit the patch on behalf of Stephen Peckham.

Reviewers: James Henderson, Digger Lin
Differential Revision: https://reviews.llvm.org/D144281

17 months ago[Fuchsia] Add other necessary components to LLDB install.
Daniel Thornburgh [Thu, 2 Mar 2023 19:53:09 +0000 (11:53 -0800)]
[Fuchsia] Add other necessary components to LLDB install.

Reviewed By: phosek

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

17 months ago[Nomination] Adding Nvidia Compiler security representative to the LLVM security...
Ragavan Dasarathan [Fri, 3 Mar 2023 18:01:31 +0000 (10:01 -0800)]
[Nomination] Adding Nvidia Compiler security representative to the LLVM security group.

I'm from Nvidia Corporation. I work primarily on the Security aspect of Compiler toolchains based out of LLVM. I would like to nominate myself to join the LLVM security group as a vendor contact representative of Nvidia.

According to the information on the website, https://llvm.org/docs/Security.html, I fall under the following category: Vendor contacts.

We are particularly interested in the following:
  - Being aware of any security vulnerability that has been found in the compiler in a timely manner.
  - Correctly reporting any vulnerabilities or other security issues we have found in the compiler stack.
  - Discussing our use of static analysis / dynamic analysis / fuzzing / threat modelling with the committee and raising any concerns that have risen from said activities.

Looking forward to participating in further discussions and security sync ups with the rest of the committee
Please let me know if I need to provide any other information required for this nomination.
Thanks,
Ragavan

Reviewed By: ab, apilipenko, george.burgess.iv, kristof.beyls, mattdr, nikhgupt, probinson, peter.smith, pietroalbini

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

17 months ago[lldb][TypeSystemClang] Use the CXXFunctionPointerSummaryProvider for member-function...
Michael Buch [Fri, 3 Mar 2023 14:18:21 +0000 (14:18 +0000)]
[lldb][TypeSystemClang] Use the CXXFunctionPointerSummaryProvider for member-function pointers

With this patch member-function pointers are formatted using
`CXXFunctionPointerSummaryProvider`.

This turns,
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94
```
into
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94 (a.out`Foo::member_func() at main.cpp:3)
```

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

17 months ago[lldb][TypeSystemClang] Format pointers to member functions as eFormatHex
Michael Buch [Fri, 3 Mar 2023 14:21:12 +0000 (14:21 +0000)]
[lldb][TypeSystemClang] Format pointers to member functions as eFormatHex

Before this patch, LLDB used to format pointers to members, such as,
```
void (Foo::*pointer_to_member_func)() = &Foo::member_func;
```
as `eFormatBytes`. E.g.,
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) $1 = 94 3f 00 00 01 00 00 00 00 00 00 00 00 00 00 00
```

This patch makes sure we format pointers to member functions the same
way we do regular function pointers.

After this patch we format member pointers as:
```
(lldb) v pointer_to_member_func
(void (Foo::*)()) ::pointer_to_member_func = 0x00000000000000000000000100003f94
```

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

17 months ago[lldb][TypeSystemClang][NFC] Factor out l/r-value reference logic for IsXXXType APIs
Michael Buch [Fri, 3 Mar 2023 14:04:05 +0000 (14:04 +0000)]
[lldb][TypeSystemClang][NFC] Factor out l/r-value reference logic for IsXXXType APIs

This will be useful as we add more `IsXXXType` APIs for different
function types.

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

17 months ago[lldb] Build fix: variable name typo
Michael Buch [Fri, 3 Mar 2023 17:41:30 +0000 (17:41 +0000)]
[lldb] Build fix: variable name typo

Build failure introduced in `de10c1a824405833a0f49b22e7fa3f32a1393cc3`

17 months ago[lldb] Ignore libcxx std::ranges global variables in frame var
Michael Buch [Fri, 3 Mar 2023 11:28:32 +0000 (11:28 +0000)]
[lldb] Ignore libcxx std::ranges global variables in frame var

The motivation is to avoid cluttering LLDB's global variable view for
std::ranges users.

Before:
```
(lldb) frame var -g
...
(const std::ranges::__end::__fn) std::__1::ranges::__cpo::end = {}
(const std::ranges::views::__all::__fn) std::__1::ranges::views::__cpo::all = {}
(const std::ranges::__begin::__fn) std::__1::ranges::__cpo::begin = {}
(const std::ranges::views::__take::__fn) std::__1::ranges::views::__cpo::take = {}
(const std::ranges::__max_element::__fn) std::__1::ranges::__cpo::max_element = {}
(const std::ranges::__size::__fn) std::__1::ranges::__cpo::size = {}
(const std::ranges::__data::__fn) std::__1::ranges::__cpo::data = {}
```

After this patch none of these __cpo variables would show up.

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

17 months ago[HLSL] add max/min library functions
Joshua Batista [Fri, 3 Mar 2023 00:21:01 +0000 (16:21 -0800)]
[HLSL] add max/min library functions

This change exposes the max and min library functions for HLSL, excluding long, and long long doubles.
The max / min functions are supported for all scalar, vector, and matrix types.
Long and long long double support is missing in this patch because those types
don't exist in HLSL.

The full documentation of the HLSL max / min functions are available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-max
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-min

Reviewed By: python3kgae

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

17 months agoFix bots by adding a triple to the test
Aaron Ballman [Fri, 3 Mar 2023 17:26:04 +0000 (12:26 -0500)]
Fix bots by adding a triple to the test

Resolves the issue found by:
https://lab.llvm.org/buildbot/#/builders/245/builds/5384

17 months ago[BOLT] Remove dependency on StringMap iteration order
Maksim Panchenko [Wed, 1 Mar 2023 23:49:21 +0000 (15:49 -0800)]
[BOLT] Remove dependency on StringMap iteration order

Remove the usage of StringMap in places where the iteration order
affects the output since the iteration over StringMap is
non-deterministic.

Reviewed By: Amir

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

17 months agoPrecommit tests for D145157.
Paul Walker [Fri, 3 Mar 2023 16:45:41 +0000 (16:45 +0000)]
Precommit tests for D145157.

17 months ago[lld-macho] Ignore -debug_variant flag
Keith Smiley [Thu, 2 Mar 2023 23:05:19 +0000 (15:05 -0800)]
[lld-macho] Ignore -debug_variant flag

As far as I can tell all this flag does in ld64 is warn about cases
where you're building dylibs that are going to be part of the shared
cache, which I assume only apple is doing. Strangely I have seen this
flag being passed in the wild so this silences the warning about it.

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

17 months ago[mlir][vector] add support for printing f16 and bf16
Aart Bik [Fri, 3 Mar 2023 01:37:43 +0000 (17:37 -0800)]
[mlir][vector] add support for printing f16 and bf16

Love or hate it, but the vector.print operation was the very
first operation that actually made "end-to-end" CHECK integration
testing possible for MLIR. This revision adds support for
the -until recently- less common but important floating-point
types f16 and bf16.

This will become useful for accelerator specific testing (e.g. NVidia GPUs)

Reviewed By: wrengr

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

17 months ago[C2x] Claim support for WG14 N2838
Aaron Ballman [Fri, 3 Mar 2023 16:56:22 +0000 (11:56 -0500)]
[C2x] Claim support for WG14 N2838

This paper clarifies that complete object types need to be smaller than
SIZE_MAX. We already conformed to that requirement, so this adds some
test coverage to prove it.

17 months ago[NFC][TargetParser] Remove Unused Includes
Archibald Elliott [Fri, 3 Feb 2023 14:48:05 +0000 (14:48 +0000)]
[NFC][TargetParser] Remove Unused Includes

17 months ago[NFC][ARM][AArch64] Cleanup TargetParser includes
Archibald Elliott [Fri, 3 Feb 2023 14:44:39 +0000 (14:44 +0000)]
[NFC][ARM][AArch64] Cleanup TargetParser includes

llvm/TargetParser/TargetParser.h now only includes AMDGPU-specific
functionality, the ARM- and AArch64-specific functionality is in other
headers.

17 months ago[Flang][OpenMP] Fix unused variable warning/error
Kiran Chandramohan [Fri, 3 Mar 2023 16:03:32 +0000 (16:03 +0000)]
[Flang][OpenMP] Fix unused variable warning/error

17 months ago[Flang][OpenMP] NFC: Refactor privatization code in Lowering 1/n
Kiran Chandramohan [Fri, 3 Mar 2023 13:57:41 +0000 (13:57 +0000)]
[Flang][OpenMP] NFC: Refactor privatization code in Lowering 1/n

The code for handing privatization code has grown in complexity.
This patch begins an effort to refactor and simplify the code.
The refactoring will hopefully will make it modular and
enable privatization to be invoked in different places. This
patch moves the privatization related code into a class called
dataSharingProcessor.

Reviewed By: DavidTruby

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

17 months ago[LV] Allow scalarization of function calls when masking is required
Graham Hunter [Fri, 16 Sep 2022 14:23:18 +0000 (15:23 +0100)]
[LV] Allow scalarization of function calls when masking is required

This patch adds support for scalarizing calls to a function when
there is a vector variant that cannot be used, either because there
isn't a masked variant or because the cost model indicated a VF
without a masked variant was better.

Reviewed By: paulwalker-arm

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

17 months ago[ReplaceConstant] Extract code for expanding users of constant (NFC)
Nikita Popov [Fri, 3 Mar 2023 15:07:43 +0000 (16:07 +0100)]
[ReplaceConstant] Extract code for expanding users of constant (NFC)

AMDGPU implements some handy code for expanding all constexpr
users of LDS globals. Extract the core logic into ReplaceConstant,
so that it can be reused elsewhere.

17 months ago[NFCI][AArch64] Use DAG Helper Functions
Archibald Elliott [Fri, 3 Mar 2023 13:17:00 +0000 (13:17 +0000)]
[NFCI][AArch64] Use DAG Helper Functions

This commit is a cleanup of a few things in the SelectionDAG
implementation:
- to have more places use `splitInt128`, rather than duplicating that
  functionality when they are turning a 128-bit value into two 64-bit
  values,
- to refactor `splitInt128` to use EXTRACT_ELEMENT which is for
  splitting wide integers in two (rather than the equivalent with shifts
  and truncs), and
- to use the concise helpers for INSERT_/EXTRACT_SUBREG in more places.

17 months ago[SLP][NFC]Update the test to avoid dead code elimination, NFC.
Alexey Bataev [Fri, 3 Mar 2023 14:09:47 +0000 (06:09 -0800)]
[SLP][NFC]Update the test to avoid dead code elimination, NFC.

17 months ago[mlir][IR] Hash result types in OperationFingerPrint
Matthias Springer [Fri, 3 Mar 2023 14:00:15 +0000 (15:00 +0100)]
[mlir][IR] Hash result types in OperationFingerPrint

Result types were not considered in OperationFingerPrint. This can lead to missing IR dumps when running with `shouldPrintAfterOnlyOnChange` and false positives in D144552.

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

17 months ago[SCEV] Fix control flow warning (NFC)
Nikita Popov [Fri, 3 Mar 2023 14:03:51 +0000 (15:03 +0100)]
[SCEV] Fix control flow warning (NFC)

17 months ago[SCEV] Extract a helper to create a SCEV with new operands (NFC)
Nikita Popov [Fri, 3 Mar 2023 13:50:25 +0000 (14:50 +0100)]
[SCEV] Extract a helper to create a SCEV with new operands (NFC)

17 months ago[SCEV] Remove an unnecessary switch (NFC)
Nikita Popov [Fri, 3 Mar 2023 13:37:05 +0000 (14:37 +0100)]
[SCEV] Remove an unnecessary switch (NFC)

Just the scevUnconditionallyPropagatesPoisonFromOperands() check
is sufficient. Also rename the flag to be more in line with the
more general predicate.

17 months ago[MLIR][OpenMP] Add Lowering support for OpenMP Target Data with region
Akash Banerjee [Fri, 3 Mar 2023 13:04:39 +0000 (13:04 +0000)]
[MLIR][OpenMP] Add Lowering support for OpenMP Target Data with region

This patch adds Fortran Lowering support for the OpenMP Target Data Op with associated region.

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

17 months ago[libc++][spaceship] Implement `operator<=>` for `forward_list`
Hristo Hristov [Fri, 3 Mar 2023 12:41:19 +0000 (13:41 +0100)]
[libc++][spaceship] Implement `operator<=>` for `forward_list`

Implemented `operator<=>` for `forward_list`

Reviewed By: #libc, philnik

Spies: philnik, libcxx-commits, yaxunl

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

17 months ago[libc++][spaceship] Implement `operator<=>` for `deque`
Hristo Hristov [Fri, 3 Mar 2023 12:35:07 +0000 (13:35 +0100)]
[libc++][spaceship] Implement `operator<=>` for `deque`

Based on https://reviews.llvm.org/D132312
Dependes on https://reviews.llvm.org/D132312

Reviewed By: #libc, Mordante, philnik

Spies: philnik, Mordante, yaxunl, libcxx-commits

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

17 months ago[InstCombine] Simplify separate_storage assumptions
David Goldblatt [Fri, 3 Mar 2023 12:23:27 +0000 (13:23 +0100)]
[InstCombine] Simplify separate_storage assumptions

Before this change, we call getUnderlyingObject on each separate_storage
operand on every alias() call (potentially requiring lots of pointer
chasing). Instead, we rewrite the assumptions in instcombine to do this
pointer-chasing once.

We still leave the getUnderlyingObject calls in alias(), just expecting
them to be no-ops much of the time. This is relatively fast (just a
couple dyn_casts with no pointer chasing) and avoids making alias
analysis results depend on whether or not instcombine has been run.

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

17 months ago[Test] Add more tests with min/max loop guards (NFC)
Dmitry Makogon [Fri, 3 Mar 2023 11:11:44 +0000 (18:11 +0700)]
[Test] Add more tests with min/max loop guards (NFC)

This adds more test cases with loop guards involving min/max
and which should be covered by ScalarEvolution::applyLoopGuards.

17 months ago[ScalarEvolution] Factor out RewriteMap utilities in applyLoopGuards (NFC)
Dmitry Makogon [Fri, 3 Mar 2023 11:02:46 +0000 (18:02 +0700)]
[ScalarEvolution] Factor out RewriteMap utilities in applyLoopGuards (NFC)

This factors out two utilities used with RewriteMap in applyLoopGuards:
 - AddRewrite, which puts a rewrite rule in the map and if needed registers
   the rewrite in the list of rewritten expressions,
 - GetMaybeRewritten, which checks whether an expression has already been
   rewritten, and if so, returns the rewrite. Otherwise, returns the given
   expression.

This may be needed when adding new rewrite rules as not to copy-paste this
code.

17 months agoRevert "[ADCE] Only remove debug intrinsics if non debug instructions are removed"
Mikael Holmen [Fri, 3 Mar 2023 12:07:22 +0000 (13:07 +0100)]
Revert "[ADCE] Only remove debug intrinsics if non debug instructions are removed"

This reverts commit 8aa9ab336889ae2eb8e4188036faeb151379ab7b.

Reverting due to compile-time regressions as pointed out in
 https://reviews.llvm.org/D145051#4166656
E.g.
 "In particular tramp3d-v4 with debuginfo regressed by 15%."

17 months ago[NVPTX] Add f16 and v2f16 ldg builtins
Jakub Chlanda [Fri, 3 Mar 2023 07:36:51 +0000 (08:36 +0100)]
[NVPTX] Add f16 and v2f16 ldg builtins

Adds f16 and v2f16 ldg builtins and relevant tests.

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

17 months ago[AMDGPU] Fix error message for illegal copy
Jay Foad [Fri, 3 Mar 2023 11:46:01 +0000 (11:46 +0000)]
[AMDGPU] Fix error message for illegal copy

17 months ago[mlir] Apply ClangTidy readability findings (NFC)
Adrian Kuegel [Fri, 3 Mar 2023 11:41:02 +0000 (12:41 +0100)]
[mlir] Apply ClangTidy readability findings (NFC)

17 months ago[AMDGPU] Add test case for AMDGPUInsertDelayAlu bug
Jay Foad [Fri, 3 Mar 2023 11:03:51 +0000 (11:03 +0000)]
[AMDGPU] Add test case for AMDGPUInsertDelayAlu bug

17 months ago[SimplifyCFG] Handle MD_noundef when hoisting common codes
luxufan [Fri, 3 Mar 2023 10:05:35 +0000 (18:05 +0800)]
[SimplifyCFG] Handle MD_noundef when hoisting common codes

Reviewed By: nikic

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

17 months agoRevert "[libcxx] Temporarily skip Arm configs"
David Spickett [Fri, 3 Mar 2023 10:59:52 +0000 (10:59 +0000)]
Revert "[libcxx] Temporarily skip Arm configs"

This reverts commit 8a023fed2f848031769eae804e55eed719cdd12d.

The machine is back online.

17 months ago[IR][Legalization] Promote illegal deinterleave and interleave vectors
Caroline Concatto [Wed, 1 Mar 2023 13:03:28 +0000 (13:03 +0000)]
[IR][Legalization] Promote illegal deinterleave and interleave vectors

To make legalization easier, the operands and outputs have the same size for
these ISD Nodes. When legalizing the results in PromoteIntegerResult the operands
are legalized to the same size as the outputs.
The ISD Node has two output/results, therefore the legalizing functions update
both results/outputs.

Reviewed By: paulwalker-arm

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

17 months ago[llvm][Uniformity] correctly use a vector as a set by uniqifying elements
Sameer Sahasrabuddhe [Fri, 3 Mar 2023 07:13:14 +0000 (12:43 +0530)]
[llvm][Uniformity] correctly use a vector as a set by uniqifying elements

The search for temporal divergence needs to determine a dominance frontier
defined for a cycle. The implementation uses a temporary vector to store a set
of newly discovered successors. Failing to uniqify the elements in this vector
causes a very large regression in compile time due to an exponential number of
redundant visits.

This fixes github issue #61123

Reviewed By: foad

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