platform/upstream/llvm.git
23 months ago[Windows] Put init_seg(compiler/lib) in llvm.global_ctors
Arthur Eubanks [Mon, 15 Aug 2022 18:04:50 +0000 (11:04 -0700)]
[Windows] Put init_seg(compiler/lib) in llvm.global_ctors

Currently we treat initializers with init_seg(compiler/lib) as similar
to any other init_seg, they simply have a global variable in the proper
section (".CRT$XCC" for compiler/".CRT$XCL" for lib) and are added to
llvm.used. However, this doesn't match with how LLVM sees normal (or
init_seg(user)) initializers via llvm.global_ctors. This
causes issues like incorrect init_seg(compiler) vs init_seg(user)
ordering due to GlobalOpt evaluating constructors, and the
ability to remove init_seg(compiler/lib) initializers at all.

Currently we use 'A' for priorities less than 200. Use 200 for
init_seg(compiler) (".CRT$XCC") and 400 for init_seg(lib) (".CRT$XCL"),
which do not append the priority to the section name. Priorities
between 200 and 400 use ".CRT$XCC${Priority}". This allows for
some wiggle room for people/future extensions that want to add
initializers between compiler and lib.

Fixes #56922

Reviewed By: rnk

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

23 months agoMSVC compatibility mode: fix error on unqualified templated base class initialization...
Fred Tingaud [Tue, 16 Aug 2022 15:09:55 +0000 (17:09 +0200)]
MSVC compatibility mode: fix error on unqualified templated base class initialization in case of partial specialization

I introduced a patch to handle unqualified templated base class
initialization in MSVC compatibility mode:
https://reviews.llvm.org/rGc894e85fc64dd8d83b460de81080fff93c5ca334
We identified a problem with this patch in the case where the base class
is partially specialized, which can lead to triggering an assertion in
the case of a mix between types and values.
The minimal test case is:

  template <typename Type, int TSize> class Vec {};
  template <int TDim> class Index : public Vec<int, TDim> {
    Index() : Vec() {}
  };
  template class Index<0>;

The detailed problem is that I was using the
`InjectedClassNameSpecialization`, to which the class template arguments
were then applied in order. But in the process, we were losing all the
partial specializations of the base class and creating an index mismatch
between the expected and passed arguments.

Patch By: frederic-tingaud-sonarsource

Reviewed By: rnk

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

23 months ago[RS4GC] Handle vectors of pointers in non-live clobbering
Danila Malyutin [Thu, 4 Aug 2022 07:08:05 +0000 (10:08 +0300)]
[RS4GC] Handle vectors of pointers in non-live clobbering

Fix crash when trying to unconditionally cast alloca type to PointerType

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

23 months ago[InstCombine] known-phi-br.ll - remove multiuse handling from tests
Simon Pilgrim [Tue, 16 Aug 2022 14:34:39 +0000 (15:34 +0100)]
[InstCombine] known-phi-br.ll - remove multiuse handling from tests

Based off discussion with @spatel for D131838 - InstCombine will still canonicalize the predicates enough that the @use() multiuses aren't helping

23 months ago[CodeView] Use non-qualified names for static local variables
Steve Merritt [Mon, 8 Aug 2022 14:40:11 +0000 (10:40 -0400)]
[CodeView] Use non-qualified names for static local variables

Static variables declared within a routine or lexical block should
be emitted with a non-qualified name.  This allows the variables to
be visible to the Visual Studio watch window.

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

23 months ago[SLP]Fix PR51320: Try to vectorize single store operands.
Alexey Bataev [Mon, 15 Aug 2022 14:22:21 +0000 (07:22 -0700)]
[SLP]Fix PR51320: Try to vectorize single store operands.

Currently, we try to vectorize values, feeding into stores, only if
slp-vectorize-hor-store option is provided. We can safely enable
vectorization of the value operand of a single store in the basic block,
if the operand value is used only in store.
It should enable extra vectorization and should not increase compile
time significantly.
Fixes https://github.com/llvm/llvm-project/issues/51320

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

23 months ago[LLVM][Debuginfod] Add missing thread include
David Spickett [Tue, 16 Aug 2022 13:50:37 +0000 (13:50 +0000)]
[LLVM][Debuginfod] Add missing thread include

One of our silent bots is currently failing:
https://lab.llvm.org/staging/#/builders/171/builds/169

With:
<...>/Debuginfod.cpp:298:23: error: no type named 'sleep_for' in namespace 'std::this_thread'
    std::this_thread::sleep_for(Interval);
    ~~~~~~~~~~~~~~~~~~^

Add missing thread include to that file,
which is what all the other users of sleep_for do.

I think we are seeing this now because we disabled
llvm threading for this builder. Maybe debuginfod should account
for that but that's for another time.

23 months ago[clang][Darwin] Re-apply "Always set the default C++ Standard Library to libc++"
Louis Dionne [Fri, 5 Aug 2022 17:49:39 +0000 (13:49 -0400)]
[clang][Darwin] Re-apply "Always set the default C++ Standard Library to libc++"

Newer SDKs don't even provide libstdc++ headers, so it's effectively
never valid to build for libstdc++ unless the user explicitly asks
for it (in which case they will need to provide include paths and more).

This is a re-application of c5ccb78ade81 which had been reverted in
33171df9cc7f because it broke the Fuchsia CI bots. The issue was that
the test was XPASSing because it didn't fail anymore when the
CLANG_DEFAULT_CXX_LIB was set to libc++, which seems to be done for
Fuchsia. Instead, the test only fails if CLANG_DEFAULT_CXX_LIB is
set to libstdc++.

As a fly-by fix, also adjust the triple used by various tests to
something that is supported. Those tests were shown to fail on
internal bots.

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

23 months ago[instcombine] Test for zero initialisation optimisation of a product given fast flags
Zain Jaffal [Tue, 16 Aug 2022 13:07:43 +0000 (14:07 +0100)]
[instcombine] Test for zero initialisation optimisation of a product given fast flags

Precommit tests for D131672.

Reviewed By: fhahn

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

23 months agoFix build error: [FPEnv][EarlyCSE] Support for CSE when exception behavior is "ignore...
Kevin P. Neal [Tue, 16 Aug 2022 12:45:36 +0000 (08:45 -0400)]
Fix build error: [FPEnv][EarlyCSE] Support for CSE when exception behavior is "ignore" or "maytrap" and the rounding mode is known.

This should fix these build bot errors:

Step 6 (build-check-mlir-build-only) failure: build (failure)
C:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\lib\Transforms\Scalar\EarlyCSE.cpp(124): error C2220: the following warning is treated as an error
C:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\lib\Transforms\Scalar\EarlyCSE.cpp(124): warning C4996: 'llvm::Optional<llvm::fp::ExceptionBehavior>::getValue': Use value instead.
C:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\lib\Transforms\Scalar\EarlyCSE.cpp(129): warning C4996: 'llvm::Optional<llvm::RoundingMode>::getValue': Use value instead.
C:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\lib\Transforms\Scalar\EarlyCSE.cpp(1386): warning C4996: 'llvm::Optional<llvm::fp::ExceptionBehavior>::getValue': Use value instead.
C:\buildbot\mlir-x64-windows-ninja\llvm-project\llvm\lib\Transforms\Scalar\EarlyCSE.cpp(1388): warning C4996: 'llvm::Optional<llvm::RoundingMode>::getValue': Use value instead.

23 months ago[Sema] fix false -Wcomma being emitted from void returning functions
YingChi Long [Mon, 15 Aug 2022 14:35:39 +0000 (22:35 +0800)]
[Sema] fix false -Wcomma being emitted from void returning functions

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

Reviewed By: aaron.ballman

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

23 months ago[FPEnv][EarlyCSE] Support for CSE when exception behavior is "ignore" or "maytrap...
Kevin P. Neal [Tue, 16 Aug 2022 12:30:05 +0000 (08:30 -0400)]
[FPEnv][EarlyCSE] Support for CSE when exception behavior is "ignore" or "maytrap" and the rounding mode is known.

Previously we would only CSE constrained FP intrinsics in the default
floating point environment. Exception behavior of "strict" is still not
allowed since we are not allowed to remove any traps in that case.

There are no restrictions on CSE across function calls inside a function.

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

23 months ago[cmake] Fix tablegen exports
Nikita Popov [Tue, 16 Aug 2022 12:16:31 +0000 (14:16 +0200)]
[cmake] Fix tablegen exports

This fixes some fallout from D131282. Currently, add_tablegen() will add the tablegen target to LLVM_EXPORTS and associates the install with LLVMExports. For non-standalone builds, this means that you end up with mlir-tblgen and clang-tblgen in LLVMExports.

However, these projects should instead be using MLIR_EXPORTS/MLIRTargets and CLANG_EXPORTS/ClangTargets. To fix this, add an extra EXPORT option and make use of get_target_export_arg() to create the correct export argument.

Reviewed By: ashay-github

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

23 months ago[AArch64] Add `foldCSELOfCSEl` DAG combine
Karl Meakin [Tue, 16 Aug 2022 11:49:11 +0000 (12:49 +0100)]
[AArch64] Add `foldCSELOfCSEl` DAG combine

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

23 months ago[InstSimplify] Add another and(x,c) case where the mask is redundant (and in fact...
Simon Pilgrim [Tue, 16 Aug 2022 11:05:13 +0000 (12:05 +0100)]
[InstSimplify] Add another and(x,c) case where the mask is redundant (and in fact can constant fold away)

23 months ago[LV] Use variables instead of hard-coded metadata IDs in tests.
Florian Hahn [Tue, 16 Aug 2022 11:21:49 +0000 (12:21 +0100)]
[LV] Use variables instead of hard-coded metadata IDs in tests.

23 months ago[AArch64] Add support for 256-bit non temporal loads
Zain Jaffal [Tue, 16 Aug 2022 11:19:36 +0000 (12:19 +0100)]
[AArch64] Add support for 256-bit non temporal loads

Currenlty all temporal loads are mapped to `LDP` or `LDR`. This patch will map all the non temporal 256-bit loads into `LDNP`. Future patches should address other non-temporal loads.

Reviewed By: fhahn, dmgreen

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

23 months ago[CFG] Fix crash on CFG building when deriving from a template.
Clement Courbet [Wed, 9 Mar 2022 16:20:37 +0000 (17:20 +0100)]
[CFG] Fix crash on CFG building when deriving from a template.

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

23 months ago[ARM] Simplify the creation of escaped build attribute values
Victor Campos [Thu, 11 Aug 2022 14:21:49 +0000 (15:21 +0100)]
[ARM] Simplify the creation of escaped build attribute values

There is an existing mechanism to escape strings, therefore the
functions created to escape Tag_also_compatible_with values are not
really needed. We can simply use the pre-existing utilities.

Reviewed By: pratlucas

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

23 months ago[ARM] Parse Tag_also_compatible_with attribute
Victor Campos [Tue, 12 Jul 2022 15:10:58 +0000 (16:10 +0100)]
[ARM] Parse Tag_also_compatible_with attribute

The ARM Attribute Parser used to parse the value of also_compatible_with
as it is, disregarding the way it is encoded.

This patch does a context aware parsing of the also_compatible_with
attribute. Additionally, some error handling is also done for incorrect
cases.

Reviewed By: pratlucas

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

23 months ago[X86] Fix a lowering issue of mask.compress which has undef float passthrough
Bing1 Yu [Tue, 16 Aug 2022 08:42:08 +0000 (16:42 +0800)]
[X86] Fix a lowering issue of mask.compress which has undef float passthrough

Previously, LegaizeDAG didn't check mask.compress's passthrough might be float, and this lead to getConstant crash since it doesn't support fp

Reviewed By: RKSimon

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

23 months ago[TypePromotion] Only search for PHI + ZExt promotion of Integers
Andre Vieira [Tue, 16 Aug 2022 09:15:32 +0000 (10:15 +0100)]
[TypePromotion] Only search for PHI + ZExt promotion of Integers

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

23 months ago[AArch64] Add tests to check for loop vectorization of non temporal loads
Zain Jaffal [Tue, 16 Aug 2022 08:40:51 +0000 (09:40 +0100)]
[AArch64] Add tests to check for loop vectorization of non temporal loads

Reviewed By: fhahn

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

23 months ago[LLDB][ARM] Remove unused LoadPseudoRegistersFromFrame function
David Spickett [Thu, 11 Aug 2022 09:22:00 +0000 (09:22 +0000)]
[LLDB][ARM] Remove unused LoadPseudoRegistersFromFrame function

https://reviews.llvm.org/D131658 identified a bug in this and
turns out it's not used anywhere.

Reviewed By: JDevlieghere, clayborg

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

23 months ago[pseudo] Style tweaks forgotten in D130337. NFC
Sam McCall [Tue, 16 Aug 2022 08:26:25 +0000 (10:26 +0200)]
[pseudo] Style tweaks forgotten in D130337. NFC

23 months agoReturn "[SCEV] Use context to strengthen flags of BinOps"
Max Kazantsev [Tue, 16 Aug 2022 06:41:59 +0000 (13:41 +0700)]
Return "[SCEV] Use context to strengthen flags of BinOps"

This reverts commit 354fa0b48008eca701a110badd6974bf449df257.

Returning as is. The patch was reverted due to a miscompile, but
this patch is not causing it. This patch made it possible to infer
some nuw flags in code guarded by `false` condition, and then someone
else to managed to propagate the flag from dead code outside.

Returning the patch to be able to reproduce the issue.

23 months ago[test][libcxx] Use own feature for HWAsan
Vitaly Buka [Tue, 16 Aug 2022 04:24:28 +0000 (21:24 -0700)]
[test][libcxx] Use own feature for HWAsan

23 months ago[test][libcxx] Disable new.delete.array tests for HWAsan
Vitaly Buka [Tue, 16 Aug 2022 04:15:18 +0000 (21:15 -0700)]
[test][libcxx] Disable new.delete.array tests for HWAsan

23 months ago[LoongArch] Add codegen support for fabs
gonglingqin [Tue, 16 Aug 2022 06:25:04 +0000 (14:25 +0800)]
[LoongArch] Add codegen support for fabs

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

23 months ago[LoongArch] Encode LoongArch specific ELF e_flags to binary by LoongArchTargetStreamer
Weining Lu [Tue, 16 Aug 2022 05:37:43 +0000 (13:37 +0800)]
[LoongArch] Encode LoongArch specific ELF e_flags to binary by LoongArchTargetStreamer

Reference: https://github.com/loongson/LoongArch-Documentation
The last commit hash (main branch) is:
99016636af64d02dee05e39974d4c1e55875c45b

Note:
There are several PRs [1][2][3] that may affect the e_flags.
After they got closed or merged, we should update the implementation here accordingly.

[1] https://github.com/loongson/LoongArch-Documentation/pull/33
[2] https://github.com/loongson/LoongArch-Documentation/pull/47
[2] https://github.com/loongson/LoongArch-Documentation/pull/61

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

23 months ago[NFC] Add unittest for inline functions in modules
Chuanqi Xu [Tue, 16 Aug 2022 05:33:53 +0000 (13:33 +0800)]
[NFC] Add unittest for inline functions in modules

23 months agoDon't lower log1p(x) to log(1 + x).
Johannes Reifferscheid [Thu, 11 Aug 2022 13:56:07 +0000 (15:56 +0200)]
Don't lower log1p(x) to log(1 + x).

The latter has accuracy issues around 0. The lowering in MathToLLVM is kept for now.

Reviewed By: bkramer

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

23 months ago[BOLT][NFC] Extend debug logging in analyzeJumpTable
Amir Ayupov [Tue, 16 Aug 2022 03:34:25 +0000 (20:34 -0700)]
[BOLT][NFC] Extend debug logging in analyzeJumpTable

Reviewed By: rafauler

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

23 months ago[ExecutionEngine] Fix a warning
Kazu Hirata [Tue, 16 Aug 2022 03:33:10 +0000 (20:33 -0700)]
[ExecutionEngine] Fix a warning

This patch fixes the warning:

  llvm/lib/ExecutionEngine/JITLink/ELF_i386.cpp:66:11: error: unused
  type alias 'Base' [-Werror,-Wunused-local-typedef]

23 months ago[clang-format] Fix aligning of java-style declarations
Danil Sidoruk [Tue, 16 Aug 2022 03:26:56 +0000 (20:26 -0700)]
[clang-format] Fix aligning of java-style declarations

- Modify TokenAnnotator to work fine with java-style array declarations.
- Add test for aligning of java declarations.

Fixes #55931.

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

23 months ago[SelectionDAG][NFC] Fix return type when used isConstantIntBuildVectorOrConstantInt
wanglian [Tue, 16 Aug 2022 02:01:08 +0000 (10:01 +0800)]
[SelectionDAG][NFC] Fix return type when used isConstantIntBuildVectorOrConstantInt
and isConstantFPBuildVectorOrConstantFP

Reviewed By: RKSimon

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

23 months agoRe-apply "[JITLink] Introduce ELF/i386 backend " with correct authorship.
Kshitij Jain [Tue, 16 Aug 2022 01:39:34 +0000 (18:39 -0700)]
Re-apply "[JITLink] Introduce ELF/i386 backend " with correct authorship.

I (lhames) accidentally pushed 5f300397c6ae8fa7ca3547ec2b7a3cd844f3ed59 on
Kshitij Jain's behalf without updating the patch author first (my apologies
Kshitij!).

Re-applying with correct authorship.

https://reviews.llvm.org/D131347

23 months agoRevert "[JITLink] Introduce ELF/i386 backend support for JITLink."
Lang Hames [Tue, 16 Aug 2022 01:38:23 +0000 (18:38 -0700)]
Revert "[JITLink] Introduce ELF/i386 backend support for JITLink."

This reverts commit 5f300397c6ae8fa7ca3547ec2b7a3cd844f3ed59.

No functional issues, I just failed to correctly set authorship on the patch.

23 months ago[gn build] Port 5f300397c6ae
LLVM GN Syncbot [Tue, 16 Aug 2022 01:39:36 +0000 (01:39 +0000)]
[gn build] Port 5f300397c6ae

23 months ago[JITLink] Introduce ELF/i386 backend support for JITLink.
Lang Hames [Mon, 15 Aug 2022 04:13:37 +0000 (21:13 -0700)]
[JITLink] Introduce ELF/i386 backend support for JITLink.

This initial ELF/i386 JITLink backend enables JIT-linking of minimal ELF i386
object files. No relocations are supported yet.

Reviewed By: lhames

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

23 months ago[Driver] Support linking to compiler-rt for target AVR
Ben Shi [Sat, 13 Aug 2022 12:23:25 +0000 (20:23 +0800)]
[Driver] Support linking to compiler-rt for target AVR

Reviewed By: aykevl

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

23 months agoflang: Fix flang build with -Wctad-maybe-unsupported
David Blaikie [Tue, 16 Aug 2022 01:07:38 +0000 (01:07 +0000)]
flang: Fix flang build with -Wctad-maybe-unsupported

Shooting from the hip since I don't have a flang build locally, but
hopefully this works.

23 months ago[lldb] Fetching symbols in the background with dsymForUUID
Jonas Devlieghere [Tue, 16 Aug 2022 00:37:34 +0000 (17:37 -0700)]
[lldb] Fetching symbols in the background with dsymForUUID

On macOS, LLDB uses the DebugSymbols.framework to locate symbol rich
dSYM bundles. [1] The framework uses a variety of methods, one of them
calling into a binary or shell script to locate (and download) dSYMs.
Internally at Apple, that tool is called dsymForUUID and for simplicity
I'm just going to refer to it that way here too, even though it can be
be an arbitrary executable.

The most common use case for dsymForUUID is to fetch symbols from the
network. This can take a long time, and because the calls to the
DebugSymbols.framework are blocking, it takes a while to launch the
process. This is expected and therefore many people don't use this
functionality, but instead use add-dsym when they want symbols for a
given frame, backtrace or module. This is a little faster because you're
only fetching symbols for the module you care about, but it's still a
slow, blocking operation.

This patch introduces a hybrid approach between the two. When
symbols.enable-background-lookup is enabled, lldb will do the equivalent
of add-dsym in the background for every module that shows up in the
backtrace but doesn't have symbols for. From the user's perspective
there is no slowdown, because the process launches immediately, with
whatever symbols are available. Meanwhile, more symbol information is
added over time as the background fetching completes.

[1] https://lldb.llvm.org/use/symbols.html

rdar://76241471

Differential revision: https://reviews.llvm.org/D131328

23 months ago[lldb] Flush the global thread pool in Debugger::Terminate
Jonas Devlieghere [Tue, 16 Aug 2022 00:22:14 +0000 (17:22 -0700)]
[lldb] Flush the global thread pool in Debugger::Terminate

Use the Initialize/Terminate pattern for the global thread pool to make
sure it gets flushed during teardown.

Differential revision: https://reviews.llvm.org/D131407

23 months ago[EHStreamer] Omit @LPStart when function has no landing pads
Rahman Lavaee [Wed, 10 Aug 2022 21:43:06 +0000 (14:43 -0700)]
[EHStreamer] Omit @LPStart when function has no landing pads

When no landing pads exist for a function, `@LPStart` is undefined and must be omitted.

EH table is generally not emitted for functions without landing pads, except when the personality function is uknown (`!isNoOpWithoutInvoke(classifyEHPersonality(Per))`). In that case, we must omit `@LPStart` even when machine function splitting is enabled.

Reviewed By: MaskRay

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

23 months agoRevert "[Driver] Support linking to compiler-rt for target AVR"
Ben Shi [Mon, 15 Aug 2022 23:55:41 +0000 (07:55 +0800)]
Revert "[Driver] Support linking to compiler-rt for target AVR"

This reverts commit 44a647d21d946f8cc3eb7c1fea33311cf778f303.

23 months ago[MLIR][SPIRV] Add intel joint matrix ops
Nirvedh Meshram [Thu, 4 Aug 2022 22:23:27 +0000 (22:23 +0000)]
[MLIR][SPIRV] Add intel joint matrix ops

Reviewed By: antiagainst

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

23 months agoEnable -Wctad-maybe-unsupported in LLVM build
David Blaikie [Thu, 11 Aug 2022 21:55:44 +0000 (21:55 +0000)]
Enable -Wctad-maybe-unsupported in LLVM build

Warns on potentially unintended use of C++17 Class Template Argument
Deduction. Use of this feature with types that aren't intended to
support it may may future refactorings of those types more difficult -
so this warning fires whenever the feature is used with a type that may
not have intended to be used with CTAD (the warning uses the existence
of at least one explicit deduction guide to indicate that a type
intentionally supports CTAD - absent that, it's assumed to not be
intended to support CTAD & produces a warning).

This is disabled in libcxx because lots of the standard library is
assumed to provide ctad-usable APIs and the false positive suppression
in the diagnostic is based on system header classification which doesn't
apply in the libcxx build itself.

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

23 months ago[test][llvm-reduce] Fix simplify-cfg.ll
Arthur Eubanks [Mon, 15 Aug 2022 23:21:39 +0000 (16:21 -0700)]
[test][llvm-reduce] Fix simplify-cfg.ll

D131920 broke some Windows bots with "x6" in the buildbot paths.
https://lab.llvm.org/buildbot#builders/123/builds/12276

23 months ago[libc++] Implement `operator<=>` for `error_{code,condition}`
Adrian Vogelsgesang [Sun, 7 Aug 2022 17:56:09 +0000 (10:56 -0700)]
[libc++] Implement `operator<=>` for `error_{code,condition}`

Implements part of P1614R2 "The Mothership has Landed"

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

23 months ago[libc++] Implement `operator<=>` for `error_category`
Adrian Vogelsgesang [Sun, 7 Aug 2022 17:13:06 +0000 (10:13 -0700)]
[libc++] Implement `operator<=>` for `error_category`

Implements part of P1614R2 "The Mothership has Landed"

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

23 months ago[mlgo] Add ability to create feature-gated development features in regalloc advisor
Aiden Grossman [Mon, 15 Aug 2022 22:48:40 +0000 (15:48 -0700)]
[mlgo] Add ability to create feature-gated development features in regalloc advisor

Currently there is no way to add in development features to the ML
regalloc evict advisor which is useful to have when working on feature
engineering/improving the current model. This patch adds in the ability
to add in development features to the ML regalloc evict advisor which
are gated by a runtime flag and not added in at all if not compiled in
LLVM development mode. This sets the stage for future work where we are
planning on upstreaming some of the newer features that we are currently
experimenting with.

Reviewed By: mtrofin

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

23 months ago[gn build] Port 2f1fa6242a1f
LLVM GN Syncbot [Mon, 15 Aug 2022 22:49:18 +0000 (22:49 +0000)]
[gn build] Port 2f1fa6242a1f

23 months agofix comment typo to cycle bots
Nico Weber [Mon, 15 Aug 2022 22:49:02 +0000 (18:49 -0400)]
fix comment typo to cycle bots

23 months ago[libc] add guard for file pieces of printf
Michael Jones [Mon, 15 Aug 2022 21:25:38 +0000 (14:25 -0700)]
[libc] add guard for file pieces of printf

In the printf_core CMake, the file pieces are defined as object
libraries that depend on the File data structure. If these are added
unconditionally they'll try to evaluate that dependancy even when there
is no File available. This patch adds a guard to prevent that error.

Reviewed By: sivachandra

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

23 months ago[mlir][tosa] Fix clamp float lowering
Thomas Raoux [Mon, 15 Aug 2022 21:59:54 +0000 (21:59 +0000)]
[mlir][tosa] Fix clamp float lowering

min and max were mixed up after switching to using float min/max

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

23 months ago[gn build] Try to unbreak mac after f56e486fdc1d
Nico Weber [Mon, 15 Aug 2022 22:21:56 +0000 (18:21 -0400)]
[gn build] Try to unbreak mac after f56e486fdc1d

23 months ago[RISCV][LV] Add test coverage for upcoming dependence distance handling change
Philip Reames [Mon, 15 Aug 2022 22:16:52 +0000 (15:16 -0700)]
[RISCV][LV] Add test coverage for upcoming dependence distance handling change

23 months ago[gn build] Make ubsan_init_standalone_preinit.cpp syncable
Nico Weber [Mon, 15 Aug 2022 22:17:03 +0000 (18:17 -0400)]
[gn build] Make ubsan_init_standalone_preinit.cpp syncable

...after https://reviews.llvm.org/D131916

23 months ago[AArch64] Fix signed integer overflow in CSINC case
Vitaly Buka [Mon, 15 Aug 2022 21:59:50 +0000 (14:59 -0700)]
[AArch64] Fix signed integer overflow in CSINC case

Followup to D131815, which overlflows on different
values.

23 months ago[InstCombine] Adjust snprintf folding of constant strings (PR #56598)
Martin Sebor [Wed, 27 Jul 2022 21:59:50 +0000 (15:59 -0600)]
[InstCombine] Adjust snprintf folding of constant strings (PR #56598)

Reviewed By: efriedma

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

23 months ago[mlir][spirv] Add a test covering load/store with memory operands
Lei Zhang [Mon, 15 Aug 2022 21:48:16 +0000 (17:48 -0400)]
[mlir][spirv] Add a test covering load/store with memory operands

Reviewed By: kuhar

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

23 months agothis pass calls simplifyCFG on individual basic blocks; we want this
John Regehr [Mon, 15 Aug 2022 21:45:20 +0000 (15:45 -0600)]
this pass calls simplifyCFG on individual basic blocks; we want this
so that we can reduce away incidental parts of the CFG in cases where
the full simplifyCFG pass makes the test case uninteresting

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

23 months ago[LegacyPM] Remove ThinLTO bitcode writer legacy pass
Arthur Eubanks [Mon, 15 Aug 2022 21:21:16 +0000 (14:21 -0700)]
[LegacyPM] Remove ThinLTO bitcode writer legacy pass

Using the legacy PM for the optimization pipeline is deprecated and in
the process of being removed. This is a small step in that direction.

For an example of migrating to the new PM:
https://github.com/llvm/llvm-project/commit/853b57fe80bdb9d6b19697e6f2abc734834e9f6d

23 months ago[NFC][llvm-reduce] Use new pass manager for printing ThinLTO bitcode
Arthur Eubanks [Mon, 15 Aug 2022 21:13:39 +0000 (14:13 -0700)]
[NFC][llvm-reduce] Use new pass manager for printing ThinLTO bitcode

23 months ago[test-release] Add option to build BOLT
Rafael Auler [Thu, 11 Aug 2022 17:57:59 +0000 (10:57 -0700)]
[test-release] Add option to build BOLT

Add a flag to enable BOLT. Should be used in x86-64 and
AArch64 linux builds only, since BOLT doesn't really support other
targets and is mostly tested on these two systems as hosts.

Reviewed By: tstellar

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

23 months ago[mlir][complex] Mark all supported operation illegal explicitly for complex to libm
Kai Sasaki [Mon, 15 Aug 2022 19:54:12 +0000 (15:54 -0400)]
[mlir][complex] Mark all supported operation illegal explicitly for complex to libm

We can mark all supported operations illegal explicitly to ensure no convertible ops remain.

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

23 months ago[gn build] Add ubsan libraries
Arthur Eubanks [Mon, 15 Aug 2022 20:04:09 +0000 (13:04 -0700)]
[gn build] Add ubsan libraries

clang -fsanitize=undefined works with this.

Reviewed By: thakis

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

23 months ago[slp] adjust debug output to include final computed cost
Philip Reames [Mon, 15 Aug 2022 20:51:30 +0000 (13:51 -0700)]
[slp] adjust debug output to include final computed cost

23 months ago[test][libc++][hwasan] Handle hwaddress_sanitizer
Vitaly Buka [Mon, 15 Aug 2022 20:46:26 +0000 (13:46 -0700)]
[test][libc++][hwasan] Handle hwaddress_sanitizer

23 months agochained-fixups.yaml: force little-endian output
Nico Weber [Mon, 15 Aug 2022 20:47:07 +0000 (16:47 -0400)]
chained-fixups.yaml: force little-endian output

`__LINK_EDIT` contents are little-endian, so the whole file must be.
Might fix the test on big-endian systems.

23 months ago[libc] enable s(n)printf without fullbuild
Michael Jones [Mon, 15 Aug 2022 18:51:03 +0000 (11:51 -0700)]
[libc] enable s(n)printf without fullbuild

To use the FILE data structure, LLVM-libc must be in fullbuild mode
since it expects its own implementation. This means that (f)printf can't
be used without fullbuild, but s(n)printf only uses strings. This patch
adjusts the CMake to allow for this.

Reviewed By: sivachandra, lntue

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

23 months ago[SLP][NFC]Add a test for delaying of insertelements vectorization, NFC.
Alexey Bataev [Mon, 15 Aug 2022 20:26:51 +0000 (13:26 -0700)]
[SLP][NFC]Add a test for delaying of insertelements vectorization, NFC.

23 months ago[clang][dataflow] Add an option for context-sensitive depth
Sam Estep [Mon, 15 Aug 2022 19:58:23 +0000 (19:58 +0000)]
[clang][dataflow] Add an option for context-sensitive depth

This patch adds a `Depth` field (default value 2) to `ContextSensitiveOptions`, allowing context-sensitive analysis of functions that call other functions. This also requires replacing the `DeclCtx` field on `Environment` with a `CallString` field that contains a vector of decl contexts, to ensure that the analysis doesn't try to analyze recursive or mutually recursive calls (which would result in a crash, due to the way we handle `StorageLocation`s).

Reviewed By: xazax.hun

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

23 months ago[clang][diagnostics] Don't warn about unreachable code in constexpr if
Alan Zhao [Fri, 12 Aug 2022 23:39:26 +0000 (19:39 -0400)]
[clang][diagnostics] Don't warn about unreachable code in constexpr if

The point of a constexpr if statement is to determine which branch to
take at compile time, so warning on unreachable code is meaningless in
these situations.

Fixes #57123.

Reviewed By: thakis

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

23 months ago[SimplifyCFG] teach simplifycfg not to introduce ptrtoint for NI pointers
Jameson Nash [Mon, 15 Aug 2022 19:09:46 +0000 (15:09 -0400)]
[SimplifyCFG] teach simplifycfg not to introduce ptrtoint for NI pointers

SimplifyCFG expects to be able to cast both sides to an int, if either side can be case to an int, but this is not desirable or legal, in general, per D104547.

Spotted in https://github.com/JuliaLang/julia/issues/45702

Reviewed By: nikic

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

23 months ago[mlir][transforms] Add topological sort analysis
Matthias Springer [Mon, 15 Aug 2022 19:04:25 +0000 (21:04 +0200)]
[mlir][transforms] Add topological sort analysis

This change add a helper function for computing a topological sorting of a list of ops. E.g. this can be useful in transforms where a subset of ops should be cloned without dominance errors.

The analysis reuses the existing implementation in TopologicalSortUtils.cpp.

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

23 months ago[mlir] Minor fixes after removing types from attributes
Diego Caballero [Mon, 15 Aug 2022 18:59:42 +0000 (18:59 +0000)]
[mlir] Minor fixes after removing types from attributes

D130092 removed types from attributes. This patch fixes a minor
issues what was exposed when integrating that change in IREE. An
explicit cast is needed so that the template type of `makeArrayRef`
is automatically deduced.

Co-authored-by: Lei Zhang <antiagainst@google.com>
Reviewed By: Mogball

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

23 months ago[mlir] Make sure that aggregate shared libraries define all of their symbols.
Stella Laurenzo [Mon, 15 Aug 2022 18:20:04 +0000 (11:20 -0700)]
[mlir] Make sure that aggregate shared libraries define all of their symbols.

We were hitting issues on Linux where this was only being caught at runtime, and different linkers (BFD vs LLD) are differently strict in such situations. Such libraries will also fail to build properly on Windows (but test coverage of that is limited, so it is better to enforce globally).

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

23 months ago[SLP][NFC]Replace multiple isa calls with single one where possible,
Alexey Bataev [Mon, 15 Aug 2022 18:30:11 +0000 (11:30 -0700)]
[SLP][NFC]Replace multiple isa calls with single one where possible,
NFC.

23 months ago[mlir][math] Added algebraic simplification for IPowI operation.
Slava Zakharin [Fri, 22 Jul 2022 18:56:20 +0000 (11:56 -0700)]
[mlir][math] Added algebraic simplification for IPowI operation.

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

23 months ago[mlir][python] Fix build on windows
Jeff Niu [Mon, 15 Aug 2022 17:14:15 +0000 (13:14 -0400)]
[mlir][python] Fix build on windows

Reviewed By: stella.stamenova, ashay-github

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

23 months ago[MSAN] clean up style from D131728
Kevin Athey [Mon, 15 Aug 2022 16:32:54 +0000 (09:32 -0700)]
[MSAN] clean up style from D131728

Depends on D131728

Reviewed By: vitalybuka

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

23 months ago[mlir][math] Added constant folding for IPowI operation.
Slava Zakharin [Fri, 22 Jul 2022 18:48:16 +0000 (11:48 -0700)]
[mlir][math] Added constant folding for IPowI operation.

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

23 months agoRevert "antiagainst's fix"
Diego Caballero [Mon, 15 Aug 2022 18:27:35 +0000 (18:27 +0000)]
Revert "antiagainst's fix"

This reverts commit 42d48d09666279bdd05d70ff7c353466ae79711a.

23 months ago[lldb] Fix warning: comparison of integers of different signs
Jonas Devlieghere [Mon, 15 Aug 2022 18:23:33 +0000 (11:23 -0700)]
[lldb] Fix warning: comparison of integers of different signs

Fixes a warning about comparison of integers of different signs
'wchar_t' and 'int' in Editline.cpp:

      return out != (int)WEOF;
             ~~~ ^  ~~~~~~~~~

23 months agoantiagainst's fix
Diego Caballero [Sat, 13 Aug 2022 04:41:24 +0000 (04:41 +0000)]
antiagainst's fix

23 months ago[test][clang] Opaquify pragma-init_seg.cpp
Arthur Eubanks [Mon, 15 Aug 2022 17:45:05 +0000 (10:45 -0700)]
[test][clang] Opaquify pragma-init_seg.cpp

23 months agoRemoving an unused function; NFC
Aaron Ballman [Mon, 15 Aug 2022 17:33:45 +0000 (13:33 -0400)]
Removing an unused function; NFC

It turns out there are zero in-tree callers of CallExpr::getNumCommas()
so it's reasonable to remove.

23 months ago[PowerPC][NFC] Add additional vector_shuffle tests involving scalar_to_vector.
Amy Kwan [Mon, 15 Aug 2022 16:34:02 +0000 (11:34 -0500)]
[PowerPC][NFC] Add additional vector_shuffle tests involving scalar_to_vector.

This patch adds additional test cases involving vector_shuffles where either its
left, right or both inputs are scalar_to_vector nodes. These test cases involve
v16i8, v2i64, v4i32 and v8i16 vector shuffles, and were generated in preparation
for D130487.

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

23 months ago[ExecutionEngine] Fix warnings
Kazu Hirata [Mon, 15 Aug 2022 17:26:03 +0000 (10:26 -0700)]
[ExecutionEngine] Fix warnings

This patch fixes:

  llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp:512:12: error:
  moving a temporary object prevents copy elision
  [-Werror,-Wpessimizing-move]

and:

  llvm/lib/ExecutionEngine/Orc/ExecutionUtils.cpp:515:12: error:
  moving a temporary object prevents copy elision
  [-Werror,-Wpessimizing-move]

23 months ago[mlir][dataflow] Remove the unused AnalysisState::defaultInitialize().
Zhixun Tan [Mon, 15 Aug 2022 17:24:01 +0000 (13:24 -0400)]
[mlir][dataflow] Remove the unused AnalysisState::defaultInitialize().

Depends On D131660

`defaultInitialize()` was introduced for the "nudging" behavior, which has been deleted.

Reviewed By: Mogball, rriddle

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

23 months ago[mlir][dataflow] Remove Abstract{Sparse,Dense}Lattice::isAtFixpoint() and an ineffect...
Zhixun Tan [Mon, 15 Aug 2022 17:20:48 +0000 (13:20 -0400)]
[mlir][dataflow] Remove Abstract{Sparse,Dense}Lattice::isAtFixpoint() and an ineffective optimization to simplify public API

Currently, in the MLIR `{Sparse,Dense}DataFlowAnalysis` API, there is a small optimization:

Before running a transfer function, if the "out state" is already at the pessimistic fixpoint (bottom lattice value), then we know that it cannot possibly be changed, therefore we can skip the transfer function.

I benchmarked and found that this optimization is ineffective, so we can remove it and simplify `{Sparse,Dense}DataFlowAnalysis`. In a subsequent patch, I plan to change/remove the concept of the pessimistic fixpoint so that the API is further simplified.

Benchmark: I ran the following tests 5 times (after 3 warmup runs), and timed the `initializeAndRun()` function.

| Test | Before (us) | After (us) |
| mlir-opt -test-dead-code-analysis mlir/test/Analysis/DataFlow/test-dead-code-analysis.mlir | 181.2536 | 187.7074 |
| mlir-opt -- -test-dead-code-analysis mlir/test/Analysis/DataFlow/test-last-modified-callgraph.mlir | 109.5504 | 105.0654 |
| mlir-opt -- -test-dead-code-analysis mlir/test/Analysis/DataFlow/test-last-modified.mlir | 333.3646 | 322.4224 |
| mlir-opt -- -allow-unregistered-dialect -sccp mlir/test/Analysis/DataFlow/test-combined-sccp.mlir | 1027.1492 | 1081.818 |

Note: `test-combined-sccp.mlir` is crafted by combining `mlir/test/Transforms/sccp.mlir`, `mlir/test/Transforms/sccp-structured.mlir` and `mlir/test/Transforms/sccp-callgraph.mlir`.

Reviewed By: aartbik, Mogball

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

23 months ago[mlir] Simplify is_splat use in MatchAllPred. NFC.
Jakub Kuderski [Mon, 15 Aug 2022 17:17:42 +0000 (13:17 -0400)]
[mlir] Simplify is_splat use in MatchAllPred. NFC.

This is a simple cleanup after https://reviews.llvm.org/D131289.

Reviewed By: antiagainst, Mogball

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

23 months ago[LLDB][NFC] Reliability Fixes for FormatEntity
Slava Gurevich [Sun, 14 Aug 2022 06:46:21 +0000 (23:46 -0700)]
[LLDB][NFC] Reliability Fixes for FormatEntity

 - Remove dead code
 - Fix incorrect null-reference check

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

23 months ago[OpenMP][libomptarget] Fix run region async condition
Kevin Sala Penads [Mon, 15 Aug 2022 17:07:27 +0000 (13:07 -0400)]
[OpenMP][libomptarget] Fix run region async condition

This patch fixes a condition in the openmp/libomptarget/src/device.cpp file. The code was checking if the run_region plugin API function was implemented, but it should actually check the run_region_async function instead.

Reviewed By: tianshilei1992

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

23 months ago[ORC][COFF] Introduce DLLImportDefinitionGenerator.
Sunho Kim [Mon, 15 Aug 2022 16:35:18 +0000 (01:35 +0900)]
[ORC][COFF] Introduce DLLImportDefinitionGenerator.

This class will be used to properly solve the `__imp_` symbol and jump-thunk generation issues. It is assumed to be the last definition generator to be called, and as it's the last generator the only symbols remaining in the lookup set are the symbols that are supposed to be queried outside this jitdylib. Instead of just letting them through, we issue another lookup invocation and fetch the allocated addresses, and then create jitlink graph containing `__imp_` GOT symbols and jump-thunks targetting the fetched addresses.

Reviewed By: lhames

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

23 months ago[InstCombine] reduce sub-with-overflow ==/!= 0
Sanjay Patel [Mon, 15 Aug 2022 16:25:24 +0000 (12:25 -0400)]
[InstCombine] reduce sub-with-overflow ==/!= 0

The basic patterns look like this:
https://alive2.llvm.org/ce/z/MDj9EC

The tests have a use of the overflow value too.
Otherwise, existing folds should reduce already.

This was noted as a missing IR fold in:
926e7312b2f20f2f7b

Hopefully, this makes it easier to implement a backend
fix because we should get the same IR regardless of
whether the source used builtins or inline code.

23 months ago[InstCombine] add tests for compare of sub-with-overflow; NFC
Sanjay Patel [Mon, 15 Aug 2022 15:30:09 +0000 (11:30 -0400)]
[InstCombine] add tests for compare of sub-with-overflow; NFC

23 months ago[InstCombine] known-phi-br.ll - add multiuse of compare results to avoid predicate...
Simon Pilgrim [Mon, 15 Aug 2022 16:53:21 +0000 (17:53 +0100)]
[InstCombine] known-phi-br.ll - add multiuse of compare results to avoid predicate inverse and add negative tests

Feedback from D131838