platform/upstream/llvm.git
22 months agoManagedStatic: remove from DebugCounter
Nicolai Hähnle [Mon, 4 Jul 2022 10:52:08 +0000 (12:52 +0200)]
ManagedStatic: remove from DebugCounter

Follow the pattern used in MLIR for the cl::opt instances.

v2:
- make DebugCounter::isCountingEnabled public so that the
  DebugCounterOwner doesn't have to be a nested class. This simplifies
  later changes

v3:
- remove the indirection via DebugCounterOwner::instance()

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

22 months ago[mlir][Bazel] Fix wrong dependency to //llvm:Support
Adrian Kuegel [Fri, 26 Aug 2022 07:06:40 +0000 (09:06 +0200)]
[mlir][Bazel] Fix wrong dependency to //llvm:Support

22 months ago[mlir][Bazel] Fix bazel build.
Adrian Kuegel [Fri, 26 Aug 2022 07:04:50 +0000 (09:04 +0200)]
[mlir][Bazel] Fix bazel build.

22 months ago[NFC][M68k][test] Fix incorrect use of `getelementptr`
Sheng [Fri, 26 Aug 2022 06:42:15 +0000 (14:42 +0800)]
[NFC][M68k][test] Fix incorrect use of `getelementptr`

Reviewers: RKSimon

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

22 months ago[RISCV] Generate correct ELF abi flag when empty .ll file has target-abi attribute
Yunze Zhu [Fri, 26 Aug 2022 06:05:15 +0000 (14:05 +0800)]
[RISCV] Generate correct ELF abi flag when empty .ll file has target-abi attribute

In patch D121183, target abi is get from .ll file's target-abi
attribute and set in RISCVAsmPrinter::emitFunctionEntryLabel
function. In https://github.com/llvm/llvm-project/issues/57242,
an api mismatch error may be caused by failing to call function
RISCVAsmPrinter::emitFunctionEntryLabel to set target-abi to
correct one when the .ll is empty or a module has no function.

This patch move setting target-abi part to function
RISCVAsmPrinter::emitStartOfAsmFile, make sure all .ll file and
module in LTO read target-abi from module flag and set, with or
without function.

Signed-off-by: xiaojing.zhang <xiaojing.zhang@xcalibyte.com>
Signed-off-by: jianxin.lai <jianxin.lai@xcalibyte.com>
Reviewed By: luismarques

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

22 months ago[RISCV] : Add support for simm10_lsb0000nonzero operand.
LiaoChunyu [Fri, 26 Aug 2022 06:18:53 +0000 (14:18 +0800)]
[RISCV] : Add support for simm10_lsb0000nonzero operand.

Running on RISCV machine llvm-exegesis I faced with trouble: can't measure C_ADDI16SP, beacuse immediate has type simm10_lsb0000nonzero.

Patch adds support for processing this immediate operand type.

Reviewed By: craig.topper

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

22 months ago[Coroutines] Store the index for final suspend point if there is unwind coro end
Chuanqi Xu [Fri, 26 Aug 2022 05:49:00 +0000 (13:49 +0800)]
[Coroutines] Store the index for final suspend point if there is unwind coro end

Closing https://github.com/llvm/llvm-project/issues/57339

The root cause for this issue is an pre-mature optimization to eliminate
the index for the final suspend point since we feel like we can judge
if a coroutine is suspended at the final suspend by if resume_fn_addr is
null. However this is not true if the coroutine exists via an exception
in promise.unhandled_exception(). According to
[dcl.fct.def.coroutine]p14:

> If the evaluation of the expression promise.unhandled_exception()
> exits via an exception, the coroutine is considered suspended at the
> final suspend point.

But from the perspective of the implementation, we can't set the coro
index to the final suspend point directly since it breaks the states.

To fix the issue, we block the optimization if we find there is any
unwind coro end, which indicates that it is possible that the coroutine
exists via an exception from promise.unhandled_exception().

Test Plan: folly

22 months ago[clang-format][NFC] Call eof() and isEOF() in UnwrappedLineParser
owenca [Fri, 26 Aug 2022 04:57:40 +0000 (21:57 -0700)]
[clang-format][NFC] Call eof() and isEOF() in UnwrappedLineParser

22 months ago[Object] Support LoongArch in RelocationResolver
WANG Xuerui [Fri, 26 Aug 2022 03:42:17 +0000 (11:42 +0800)]
[Object] Support LoongArch in RelocationResolver

Similar to the RISCV logic added in D62062.

With this patch applied, llvm-dwarfdump works on existing LoongArch
object files, but generation of debuginfo on LoongArch is still pending
on proper support for relocations, so no test cases this time. They will
come later.

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

22 months ago[LoongArch] Support register-register-addressed FPR load and store
gonglingqin [Fri, 26 Aug 2022 02:14:30 +0000 (10:14 +0800)]
[LoongArch] Support register-register-addressed FPR load and store

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

22 months ago[mlir][math] Added math::IPowI conversion to calls of outlined implementations.
Slava Zakharin [Tue, 12 Jul 2022 23:07:38 +0000 (16:07 -0700)]
[mlir][math] Added math::IPowI conversion to calls of outlined implementations.

Power functions are implemented as linkonce_odr scalar functions
for integer types used by IPowI operations met in a module.
Vector form of IPowI is linearized into a sequence of calls
of the scalar functions.

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

22 months ago[libc++][test] Use TEST_HAS_NO_CHAR8_T to simplify #ifdefs. NFCI.
Joe Loser [Thu, 25 Aug 2022 00:50:28 +0000 (18:50 -0600)]
[libc++][test] Use TEST_HAS_NO_CHAR8_T to simplify #ifdefs. NFCI.

Many tests in `libcxx/test/std/strings` use
`#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L`
which can be replaced with the more terse `#ifndef TEST_HAS_NO_CHAR8_T`.

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

22 months ago[ADT] Make `llvm::identity` a transparent function object
Joe Loser [Thu, 25 Aug 2022 01:31:15 +0000 (19:31 -0600)]
[ADT] Make `llvm::identity` a transparent function object

`llvm::identity` is similar to `std::identity` from C++20, but one surprising
thing is that `llvm::identity` is not a transparent function object. Add the
`is_transparent` type alias to denote it can be used as a transparent function
object.

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

22 months ago[RISCV][NFC] Use common prefix to simplify test.
jacquesguan [Thu, 25 Aug 2022 08:43:43 +0000 (16:43 +0800)]
[RISCV][NFC] Use common prefix to simplify test.

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

22 months ago[Driver][test] Replace legacy -target with --target=
Fangrui Song [Fri, 26 Aug 2022 02:30:21 +0000 (19:30 -0700)]
[Driver][test] Replace legacy -target with --target=

22 months ago[lldb][test] Fix nullptr test expctation for 32-bit system
Adrian Vogelsgesang [Thu, 25 Aug 2022 23:29:06 +0000 (16:29 -0700)]
[lldb][test] Fix nullptr test expctation for 32-bit system

Follow-up to https://reviews.llvm.org/D132415

Fixes https://lab.llvm.org/buildbot/#/builders/17/builds/26630

22 months ago[BOLT][DWARF] Fix updating CU that has no entry in .debug_addr
Alexander Yermolovich [Fri, 26 Aug 2022 00:01:41 +0000 (17:01 -0700)]
[BOLT][DWARF] Fix updating CU that has no entry in .debug_addr

We were trying to process .debug_addr for CU that doesn't have it. This resulted
in assert. Example came from GCC that also doesn't use DW_OP_addrx in
DW_FORM_exprloc.

Reviewed By: maksfb

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

22 months ago[HLSL] Add abs library function
Chris Bieneman [Thu, 25 Aug 2022 23:25:20 +0000 (18:25 -0500)]
[HLSL] Add abs library function

This change exposes the abs library function for HLSL scalar types. Abs
is supported for all scalar, vector and matrix types. This patch only
adds a subset of scalar type support.

Fixes #57100 (https://llvm.org/pr57100)

The full documentation of the HLSL abs function is available here:
https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-abs

Reviewed By: bogner

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

22 months ago[flang] Fold DOT_PRODUCT()
Peter Klausler [Thu, 28 Oct 2021 16:37:43 +0000 (09:37 -0700)]
[flang] Fold DOT_PRODUCT()

Implement constant folding of the intrinsic function DOT_PRODUCT().

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

22 months ago[lldb] Computer the slide when and apply it to each fileset's vm addr
Jonas Devlieghere [Thu, 25 Aug 2022 23:36:16 +0000 (16:36 -0700)]
[lldb] Computer the slide when and apply it to each fileset's vm addr

Computer the slide when and apply it to each entry's vm addr when
reading from memory.

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

22 months ago[AArch64] Filter out invalid code model in frontend.
Hsiangkai Wang [Wed, 24 Aug 2022 08:25:32 +0000 (08:25 +0000)]
[AArch64] Filter out invalid code model in frontend.

AArch64 only supports tiny, small, and large code model. Show error
messages when users specify other code model.

Fix https://github.com/llvm/llvm-project/issues/53402

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

22 months ago[flang] Allow NULL() actual argument for procedure pointer dummy argument with unspec...
Peter Klausler [Thu, 25 Aug 2022 17:27:32 +0000 (10:27 -0700)]
[flang] Allow NULL() actual argument for procedure pointer dummy argument with unspecified intent

A NULL() pointer is a valid actual argument for a procedure pointer dummy
argument whose intent is INTENT(IN); it should also be acceptable for a
procedure pointer dummy argument with unspecified intent.

Also make it possible to discern null object pointers from null procedure
pointers, so that an attempt to use one in place of the other in a context
where the distinction matters will still elicit an error.

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

22 months ago[SLP][NFC] Add a coverage test for horizontal reductions.
Valery N Dmitriev [Thu, 25 Aug 2022 23:02:22 +0000 (16:02 -0700)]
[SLP][NFC] Add a coverage test for horizontal reductions.

Reduction feeds single insertelement instruction.

22 months ago[flang] Fix module file issue with renamed shadowed specific procedures
Peter Klausler [Tue, 23 Aug 2022 21:31:18 +0000 (14:31 -0700)]
[flang] Fix module file issue with renamed shadowed specific procedures

A specific procedure in the list of specific procedures associated with
a generic interface needs to be a symbol that is not inadvertently
resolved to its ultimate symbol in another module when it is also
shadowed by a generic interface of the same name.

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

22 months ago[flang] Make C_F_POINTER a generic interface
Peter Klausler [Thu, 25 Aug 2022 17:24:53 +0000 (10:24 -0700)]
[flang] Make C_F_POINTER a generic interface

The intrinsic procedure C_F_POINTER needs to be a generic interface
in intrinsic module ISO_C_BINDING.  (It also needs to be implemented,
but that remains a TODO for either lowering or the runtime.)

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

22 months ago[gn build] Port 48506fbbbf27
LLVM GN Syncbot [Thu, 25 Aug 2022 22:25:21 +0000 (22:25 +0000)]
[gn build] Port 48506fbbbf27

22 months ago[lldb] Teach LLDB about Mach-O filesets
Jonas Devlieghere [Thu, 25 Aug 2022 22:11:32 +0000 (15:11 -0700)]
[lldb] Teach LLDB about Mach-O filesets

This patch teaches LLDB about Mach-O filesets. Filsets are Mach-O files
that contain a bunch of other Mach-O files. Unlike universal binaries,
which have a different header, Filesets use load commands to describe
the different entries it contains.

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

22 months ago[flang] Allow non-definable actual arguments to volatile/asynchronous dummy arguments
Peter Klausler [Thu, 25 Aug 2022 17:23:19 +0000 (10:23 -0700)]
[flang] Allow non-definable actual arguments to volatile/asynchronous dummy arguments

Semantic checking for calls was requiring an actual argument that corresponds
to an ASYNCHRONOUS or VOLATILE dummy argument to be definable, but this is not
a constraint or requirement in the standard and doesn't even make sense
as a warning; these two attributes are "scopable" in the context of BLOCK
constructs.   Remove the checks and adjust the tests.

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

22 months ago[flang] Emit missing IMPORTs in module file interfaces
Peter Klausler [Thu, 25 Aug 2022 17:22:10 +0000 (10:22 -0700)]
[flang] Emit missing IMPORTs in module file interfaces

When a symbol from the enclosing scope is necessary to declare
a procedure or procedure pointer dummy argument or function result
for a procedure interface, note it in the collection of symbols to
be imported when scanning that interface.

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

22 months ago[flang] Accept unambiguous USE name clashes
Peter Klausler [Thu, 25 Aug 2022 17:20:41 +0000 (10:20 -0700)]
[flang] Accept unambiguous USE name clashes

When, due to one or more USE associations, possibly with renaming,
a symbol conflicts with another of the same name in the same scope,
don't raise an error if both symbols resolve to the same intrinsic
procedure or to the same non-generic external procedure interface --
the usage is unambiguous and safe, and (14.2.2 p8) standard.

(Generic interfaces already work by way of combining their sets of
specific procedures.)

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

22 months ago[flang] Allow a construct entity as a concurrent-header index
Peter Klausler [Thu, 25 Aug 2022 17:19:20 +0000 (10:19 -0700)]
[flang] Allow a construct entity as a concurrent-header index

A construct entity of an ASSOCIATE or SELECT TYPE construct
should be acceptable as an index variable of a concurrent-header in
a FORALL or DO CONCURRENT, so long as it also satisfies other
requirements.

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

22 months ago[flang] Add nested scoping to label distinctness checking
Peter Klausler [Thu, 25 Aug 2022 17:17:25 +0000 (10:17 -0700)]
[flang] Add nested scoping to label distinctness checking

Fortran defines derived type definitions and explicit interface
blocks for subroutines and functions to be nestable scopes for
statement labels, even though such labels are useless for all
purposes.  Handle these scopes in label resolution so that bogus
errors about conflicting labels in "real" code don't come out.

Note that BLOCK constructs could have also been defined as scopes
for statement labeling, but were not.

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

22 months ago[Clang] Implement P0848 (Conditionally Trivial Special Member Functions)
Roy Jacobson [Thu, 25 Aug 2022 21:51:06 +0000 (00:51 +0300)]
[Clang] Implement P0848 (Conditionally Trivial Special Member Functions)

This patch implements P0848 in Clang.

During the instantiation of a C++ class, in `Sema::ActOnFields`, we evaluate constraints for all the SMFs and compare the constraints to compute the eligibility. We defer the computation of the type's [copy-]trivial bits from addedMember to the eligibility computation, like we did for destructors in D126194. `canPassInRegisters` is modified as well to better respect the ineligibility of functions.

Note: Because of the non-implementation of DR1734 and DR1496, I treat deleted member functions as 'eligible' for the purpose of [copy-]triviallity. This is unfortunate, but I couldn't think of a way to make this make sense otherwise.

Reviewed By: #clang-language-wg, cor3ntin, aaron.ballman

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

22 months agoDon't index the skeleton CU when we have a fission compile unit.
Greg Clayton [Mon, 8 Aug 2022 19:30:20 +0000 (12:30 -0700)]
Don't index the skeleton CU when we have a fission compile unit.

When fission is enabled, we were indexing the skeleton CU _and_ the .dwo CU. Issues arise when users enable compiler options that add extra data to the skeleton CU (like -fsplit-dwarf-inlining) and there can end up being types in the skeleton CU due to template parameters. We never want to index this information since the .dwo file has the real definition, and we really don't want function prototypes from this info since all parameters are removed. The index doesn't work correctly if it does index the skeleton CU as the DIE offset will assume it is from the .dwo file, so even if we do index the skeleton CU, the index entries will try and grab information from the .dwo file using the wrong DIE offset which can cause errors to be displayed or even worse, if the DIE offsets is valid in the .dwo CU, the wrong DIE will be used.

We also fix DWO ID detection to use llvm::Optional<uint64_t> to make sure we can load a .dwo file with a DWO ID of zero.

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

22 months ago[libc++] Allow specifying conditional compile flags dependent on basic Lit features
Louis Dionne [Wed, 24 Aug 2022 17:22:42 +0000 (13:22 -0400)]
[libc++] Allow specifying conditional compile flags dependent on basic Lit features

This patch adds support for passing basic Lit features to the
ADDITIONAL_COMPILE_FLAGS keyword by enclosing them in parentheses.
This is done to support https://llvm.org/D131836.

In the future, we should instead add proper support for conditional
keywords in Lit, so that we can evaluate arbitrary Lit boolean
expressions such as `ADDITIONAL_COMPILE_FLAGS(x && !y): -flag`.

Note that I can see this being exceptionally useful when combined
with RUN commands, which would allow using different commands on
different systems. For example:

     RUN(!buildhost=windows): something
     RUN(buildhost=windows): something-else

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

22 months ago[flang][runtime] Fix MINVAL([CHARACTER(2)::])
Peter Klausler [Fri, 19 Aug 2022 19:33:00 +0000 (12:33 -0700)]
[flang][runtime] Fix MINVAL([CHARACTER(2)::])

The result of MINVAL over an empty default character array should
(per the standard) have a 127 in every character position, not just
the first.

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

22 months ago[LAA] Prune dependencies with distance large than access implied by trip count
Philip Reames [Thu, 25 Aug 2022 21:16:34 +0000 (14:16 -0700)]
[LAA] Prune dependencies with distance large than access implied by trip count

When we have a dependency with a dependence distance which can only be hit on an iteration beyond the actual trip count of the loop, we can ignore that dependency when analyzing said loop. We already had this code, but had restricted it solely to unknown dependence distances. This change applies it to all dependence distances.

Without this code, we relied on the vectorizer reducing VF such that our infeasible dependence was respected. This usually worked out to about the same result, but not always. For fixed length vectorization, this could mean a smaller VF than optimal being chosen or additional runtime checks. For scalable vectorization - where the bounds on access implied by VF are broader - we could often not find a feasible VF at all.

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

22 months ago[MC][ELF] Mark GNU ABI if ifunc are used
Adhemerval Zanella [Thu, 25 Aug 2022 20:25:34 +0000 (17:25 -0300)]
[MC][ELF] Mark GNU ABI if ifunc are used

Similar to D107861.  Some tools required the GNU ABI mark to output
the symbol is a IFUNC type correctly (for instance binutils readelf).

Reviewed By: MaskRay

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

22 months ago[mlir][LLVMIR] Fix oneToOneRewrite for zero-result ops
Jeff Niu [Thu, 25 Aug 2022 20:36:37 +0000 (13:36 -0700)]
[mlir][LLVMIR] Fix oneToOneRewrite for zero-result ops

`oneToOneRewrite` segfaulted for zero result-ops because a null type was being
passed to the op builders.

Reviewed By: rriddle

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

22 months ago[mlir] Add convenience builder for arith.addui_carry
Jakub Kuderski [Thu, 25 Aug 2022 21:00:07 +0000 (17:00 -0400)]
[mlir] Add convenience builder for arith.addui_carry

This is so that future conversions do not have to figure out how to
create matching boolean types for the second result.

Reviewed By: Mogball

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

22 months ago[mlir][spirv] Add convenience builders for AddICarry and SubIBorrow
Jakub Kuderski [Thu, 25 Aug 2022 20:54:26 +0000 (16:54 -0400)]
[mlir][spirv] Add convenience builders for AddICarry and SubIBorrow

This is so that we do not have to spell out long structure types every
time we create these ops.

Reviewed By: antiagainst

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

22 months ago[ValueTracking][InstCombine] restrict FP min/max matching to avoid miscompile
Sanjay Patel [Thu, 25 Aug 2022 19:43:39 +0000 (15:43 -0400)]
[ValueTracking][InstCombine] restrict FP min/max matching to avoid miscompile

This is a long-standing FIXME with a non-FMF test that exposes
the bug as shown in issue #57357.

It's possible that there's still a way to miscompile by
mis-identifying/mis-folding FP min/max patterns, but
this patch only exposes a couple of seemingly minor
regressions while preventing the broken transform.

22 months agoRemove TODO related to adding assert from Sparse Tensor Pipeline code
Rajas Vanjape [Thu, 25 Aug 2022 19:05:58 +0000 (19:05 +0000)]
Remove TODO related to adding assert from Sparse Tensor Pipeline code

Removing the TODO related to asserting that original `pm` is for ModuleOp.
The TODO is removed for following reasons:
1. There is no easy way to do this. We currently don't have this information stored in OpPassManager object.
2. There are currently no consumers of this information and storing this information with OpPassManager for a
   simple assert will be an overkill.

Reviewed By: aartbik

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

22 months ago[libc++][NFC] Remove tab in filebuf/traits_mismatch.fail.cpp
Nikolas Klauser [Thu, 25 Aug 2022 20:45:47 +0000 (22:45 +0200)]
[libc++][NFC] Remove tab in filebuf/traits_mismatch.fail.cpp

22 months ago[LAA] Cache PSE.getSE() in variable (NFC).
Florian Hahn [Thu, 25 Aug 2022 20:40:21 +0000 (21:40 +0100)]
[LAA] Cache PSE.getSE() in variable (NFC).

Preparation for follow-up patches will introduce additional uses
of SE.

22 months ago[compiler-rt][builtins] Revert all the recent changes I made for adding
Akira Hatanaka [Thu, 25 Aug 2022 20:27:29 +0000 (13:27 -0700)]
[compiler-rt][builtins] Revert all the recent changes I made for adding
security-related compiler flags

The changes broke Fuchsia builders.

22 months ago[libc++][NFC] Remove mentions of warn_unused_result
Nikolas Klauser [Thu, 25 Aug 2022 20:24:21 +0000 (22:24 +0200)]
[libc++][NFC] Remove mentions of warn_unused_result

We don't use `clang::warn_unused_result` anymore, so let's remove the mentions of it from the tests

Reviewed By: Mordante, #libc

Spies: libcxx-commits

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

22 months ago[libc++] Consolidate the different [[nodiscard]] configuration options into a single one
Nikolas Klauser [Fri, 19 Aug 2022 13:41:56 +0000 (15:41 +0200)]
[libc++] Consolidate the different [[nodiscard]] configuration options into a single one

Reviewed By: ldionne, #libc

Spies: libcxx-commits

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

22 months ago[LV] Add additional test coverage for SCEVexp and LCSSA interaction.
Florian Hahn [Thu, 25 Aug 2022 19:57:45 +0000 (20:57 +0100)]
[LV] Add additional test coverage for SCEVexp and LCSSA interaction.

Also converts the test to use opaque pointers while I am here.

22 months ago[compiler-rt][builtins] Check whether the flags are usable before adding
Akira Hatanaka [Thu, 25 Aug 2022 19:51:09 +0000 (12:51 -0700)]
[compiler-rt][builtins] Check whether the flags are usable before adding
them to the compiler command line

This is another attempt to fix the broken window bot.

22 months ago[RISCV][M68k] Replace fixed size BitVector with std::bitset.
Craig Topper [Thu, 25 Aug 2022 19:38:42 +0000 (12:38 -0700)]
[RISCV][M68k] Replace fixed size BitVector with std::bitset.

Saves a heap allocation and avoids an explicit call to the BitVector constructor.

Reviewed By: reames, myhsu

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

22 months ago[InstCombine] add test for fcmp+select miscompile; NFC
Sanjay Patel [Thu, 25 Aug 2022 19:38:19 +0000 (15:38 -0400)]
[InstCombine] add test for fcmp+select miscompile; NFC

issue #57357

22 months ago[flang] Introduce `AbstractResultOnGlobalOpt` pass
Daniil Dudkin [Thu, 25 Aug 2022 18:57:45 +0000 (21:57 +0300)]
[flang] Introduce `AbstractResultOnGlobalOpt` pass

This pass allows to convert operations
which use functions with abstract results to ones that do not.

Depends on D130087

Reviewed By: jeanPerier

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

22 months ago[libc++][NFC] Enable modernize-use-override
Nikolas Klauser [Wed, 24 Aug 2022 00:14:29 +0000 (02:14 +0200)]
[libc++][NFC] Enable modernize-use-override

Reviewed By: Mordante, #libc

Spies: aheejin, libcxx-commits, smeenai

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

22 months ago[libc] Implement linux link, linkat, symlink, symlinkat, readlink, readlinkat.
Siva Chandra Reddy [Wed, 24 Aug 2022 06:53:34 +0000 (06:53 +0000)]
[libc] Implement linux link, linkat, symlink, symlinkat, readlink, readlinkat.

Reviewed By: michaelrj

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

22 months ago[compiler-rt][builtins] Check whether -Wformat-security is usable before
Akira Hatanaka [Thu, 25 Aug 2022 18:42:22 +0000 (11:42 -0700)]
[compiler-rt][builtins] Check whether -Wformat-security is usable before
adding it to the compiler command line

This is an attempt to fix the window bot broken by
e1dcd4ba444b0aaac05c399670d870925cef4459

22 months ago[mlir][Linalg] Fix out of bounds access while handling multiple results.
Mahesh Ravishankar [Thu, 25 Aug 2022 18:01:58 +0000 (18:01 +0000)]
[mlir][Linalg] Fix out of bounds access while handling multiple results.

Previous change (a7bfdc23ab3ade54da99f0f59dababe4d71ae75b) added
support for fusion of `linalg.generic` op with `tensor.expand_shape`
op when the former had multiple results. Fix a bug related to this
that resulted in a segfault.

Reviewed By: hanchung

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

22 months ago[RISCV] Teach combineDeMorganOfBoolean to handle (and (xor X, 1), (not Y)).
Craig Topper [Thu, 25 Aug 2022 17:24:50 +0000 (10:24 -0700)]
[RISCV] Teach combineDeMorganOfBoolean to handle (and (xor X, 1), (not Y)).

SimplifyDemandedBits tries to agressively turn xor immediates into -1
to match a 'not' instruction. In this case, because X is a boolean, the
upper bits of (xor X, 1) are known to be 0. Because this is an AND
instruction, that means those bits aren't demanded from the other
operand, and thus SimplifyDemandedBits can turn (xor Y, 1) to (not Y).

We need to detect that this has happened to enable the DeMorgan
optimization. To do this we allow one of the xors to use -1 when
the outer operation is And.

Reviewed By: reames

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

22 months ago[mlir][NFC] Fix compilation error downstream when `NDEBUG` is defined
Markus Böck [Thu, 25 Aug 2022 17:54:55 +0000 (19:54 +0200)]
[mlir][NFC] Fix compilation error downstream when `NDEBUG` is defined

If the LLVM build used was compiled with `LLVM_ENABLE_ABI_BREAKING_CHECKS` but the header was included with `NDEBUG` defined, a compilation error would occur as there is a pack expansion operator (`...`), but no variadic arguments existed. This was due to the assert being preprocessed to an empty expression.

This commit moves the pack expansion within the `assert` to also be removed with the `assert`.

22 months agoRevert "ManagedStatic: remove from DebugCounter"
Nicolai Hähnle [Thu, 25 Aug 2022 17:44:06 +0000 (19:44 +0200)]
Revert "ManagedStatic: remove from DebugCounter"

This reverts commit 51d82502d98d3c5d60606e63b6c23bb5759fdb91.

There is a regression in the flang-aarch64-dylib buildbot which is most
likely caused by this change. Reverting until I can investigate.

22 months agoRevert "[PowerPC] Remove extra swap for extract+vperm on LE"
Maryam Moghadas [Thu, 25 Aug 2022 16:41:17 +0000 (11:41 -0500)]
Revert "[PowerPC] Remove extra swap for extract+vperm on LE"

This reverts commit f7294ac8093a2fbd8c00254580eaac6c4e1f7b24.

22 months ago[Timer][Statistics] Make global constructor ordering more robust
Nicolai Hähnle [Wed, 3 Aug 2022 08:56:10 +0000 (10:56 +0200)]
[Timer][Statistics] Make global constructor ordering more robust

It was observed in D129117 that the subtle dependency between statistic
and timer code is not entirely robust: the global destructor
~StatisticInfo indirectly calls CreateInfoOutputFile, which requires
the LibSupportInfoOutputFilename to not have been destructed.

By constructing LibSupportInfoOutputFilename before the StatisticInfo
object, the order of destruction is guaranteed.

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

22 months agoManagedStatic: remove from DebugCounter
Nicolai Hähnle [Mon, 4 Jul 2022 10:52:08 +0000 (12:52 +0200)]
ManagedStatic: remove from DebugCounter

Follow the pattern used in MLIR for the cl::opt instances.

v2:
- make DebugCounter::isCountingEnabled public so that the
  DebugCounterOwner doesn't have to be a nested class. This simplifies
  later changes

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

22 months ago[mlir][ODS] Automatically create `result_segment_sizes` in builder
Markus Böck [Thu, 25 Aug 2022 17:09:10 +0000 (19:09 +0200)]
[mlir][ODS] Automatically create `result_segment_sizes` in builder

When using multiple variadic results of differing sizes, using `AttrSizedResultSegments` is currently a requirement. Unlike `AttrSizedOperandSegments` however, it is not created within the default builders created by tablegen. Instead, one has to explicitly add `DenseI32ArrayAttr:$result_segments_sizes` as argument and then also explicitly specify all the sizes when using the builder from C++.

This patch fixes that redundancy, by making the builder generate the attribute in similar fashion as it already does for `AttrSizedOperandSegments`. The sizes required are simply gathered from the result type arguments of the builder.

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

22 months ago[MC] Omit fill value if it's zero when emitting code alignment
Stephen Long [Thu, 25 Aug 2022 17:04:11 +0000 (10:04 -0700)]
[MC] Omit fill value if it's zero when emitting code alignment

Previously, we were generating zeroes when generating code alignments for AArch64, but now we should omit the value and let the assembler choose to generate nops or zeroes.

Reviewed By: efriedma, MaskRay

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

22 months ago[mlir][sparse] Folding operations that try to insert zero into an all-zero sparse...
Peiming Liu [Tue, 23 Aug 2022 21:15:10 +0000 (21:15 +0000)]
[mlir][sparse] Folding operations that try to insert zero into an all-zero sparse tensor

The operations to fill zero into newly allocated sparse tensor are redundant, plus it failed
to lowering the test cases provided in the patch as well.

Reviewed By: aartbik

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

22 months ago[RISCV] Add empirical costs for integer min/max and saturing add/sub
Philip Reames [Thu, 25 Aug 2022 16:25:26 +0000 (09:25 -0700)]
[RISCV] Add empirical costs for integer min/max and saturing add/sub

All of these are lowered to a single instruction for all legal vector types.

22 months ago[HLSL] Initial codegen for SV_GroupIndex
Chris Bieneman [Wed, 24 Aug 2022 19:46:04 +0000 (14:46 -0500)]
[HLSL] Initial codegen for SV_GroupIndex

Semantic parameters aren't passed as actual parameters, instead they are
populated from intrinsics which are generally lowered to reads from
dedicated hardware registers.

This change modifies clang CodeGen to emit the intrinsic calls and
populate the parameter's LValue with the result of the intrinsic call
for SV_GroupIndex.

The result of this is to make the actual passed argument ignored, which
will make it easy to clean up later in an IR pass.

Reviewed By: aaron.ballman

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

22 months ago[flang] Fixed a number of typos
Gabriel Ravier [Thu, 25 Aug 2022 16:10:02 +0000 (18:10 +0200)]
[flang] Fixed a number of typos

I went over the output of the following mess of a command:

`(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)`

and proceeded to spend a few days looking at it to find probable typos
and fixed a few hundred of them in all of the llvm project (note, the
ones I found are not anywhere near all of them, but it seems like a
good start).

Reviewed By: awarzynski, clementval

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

22 months ago[RISCV][CostModel] Correct typo in saturating intrinsic names
Philip Reames [Thu, 25 Aug 2022 16:10:22 +0000 (09:10 -0700)]
[RISCV][CostModel] Correct typo in saturating intrinsic names

The fact that we silently accept unrecognized intrinsic names is sometimes a bit annoying.

22 months ago[RISCV][CostModel] Add test coverage for all the vectorizable binary intrinsics
Philip Reames [Thu, 25 Aug 2022 15:42:32 +0000 (08:42 -0700)]
[RISCV][CostModel] Add test coverage for all the vectorizable binary intrinsics

22 months ago[RISCV] Apply DeMorgan's law to (and/or (xor X, 1), (xor Y, 1)) if X and Y are 0/1.
Craig Topper [Wed, 24 Aug 2022 22:37:48 +0000 (15:37 -0700)]
[RISCV] Apply DeMorgan's law to (and/or (xor X, 1), (xor Y, 1)) if X and Y are 0/1.

This optimizes xors that appear due to legalizing setge/setle which
require an xor with 1. This reduces the number of xors and may
allow the xor to fold with a beqz or bnez.

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

22 months ago[CostModel][X86] Support cost kind specific look up tables (REAPPLIED)
Simon Pilgrim [Thu, 25 Aug 2022 15:49:06 +0000 (16:49 +0100)]
[CostModel][X86] Support cost kind specific look up tables (REAPPLIED)

Most of our cost model tables have been created assuming cost kind == recip-throughput. But we're starting to see passes wanting to get accurate costs for the other kinds as well. Some of these can be determined procedurally (e.g. codesize by default could just be the split count after type legalization), but others are going to need to be handled in cost tables - this is especially true for x86 which has so many ISA combinations.

I've created a 'CostKindCosts' struct which can hold cost values for the 4 cost kinds, defaulting to -1U for unknown cost, this can be used with the existing CostTblEntryT/CostTableLookup template code. I've also added a [TargetCostKind] accessor to make it much easier to look up individual <Optional> costs.

This just changes the ISD::SELECT costs to check the effect (and also to check that the ISD::SETCC are correctly handled for default/None cost kinds) - the plan would be to slowly extend this and move the CostKindTblEntry type somewhere generic to allow other targets to use it once its matured.

I'm also going to resurrect D103695 so that it can help with latency/codesize/sizelatency coverage testing.

For sizelatency - IIRC the definition was vague to let it be target specific - I've tried to use typical uop counts so they're comparable to MicroOpBufferSize etc.

REAPPLIED: Added early out to prevent getCmpSelInstrCost being used for anything but generic integer/float scalar/vector types - getTypeLegalizationCost can't handle the "exotic" TypeID enums that some passes attempt to get a costs for (aggregates etc.).

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

22 months ago[debuginfo-tests] Un-XFAIL no passing unused-merged-value.c test
Michael Buch [Thu, 25 Aug 2022 15:00:50 +0000 (16:00 +0100)]
[debuginfo-tests] Un-XFAIL no passing unused-merged-value.c test

This test would previously expect one of the parameters to have
an incorrect DW_AT_location. Stepping through `fun` with a debugger
would then no reflect updates to one of the parameters.

With a recent change to Clang's DeadArgumentEliminationPass
(see `879f5118fc74657e4a5c4eff6810098e1eed75ac`) the generated
DWARF does not contain a location for `parama`, and stepping through
the function with `lldb` works as expected.

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

22 months ago[lld-macho] Move adding bindings for stub targets out of Writer (NFC)
Daniel Bertalan [Sun, 14 Aug 2022 13:42:21 +0000 (15:42 +0200)]
[lld-macho] Move adding bindings for stub targets out of Writer (NFC)

We now re-use the existing needsBinding() helper to determine if a
branch has to go through a stub. The logic for determining which type of
binding is needed is moved inside StubsSection::addEntry().

This is an NFC refactor that simplifies my diff that adds support for
chained fixups.

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

22 months ago[InstCombine] restore test for mul+add transform with constant expression; NFC
Sanjay Patel [Thu, 25 Aug 2022 15:26:21 +0000 (11:26 -0400)]
[InstCombine] restore test for mul+add transform with constant expression; NFC

This test was added with 6cf6c05322629a17a82aa53e3931086b0,
but then made useless with D4238 / d1bea693e20b470f0.

We still need a test to make sure transforms are not
conflicting when matching a constant expression.

22 months ago[openmp][amdgpu] Implement target_alloc_host as fine grain HSA memory
Jon Chesterfield [Thu, 25 Aug 2022 15:27:51 +0000 (16:27 +0100)]
[openmp][amdgpu] Implement target_alloc_host as fine grain HSA memory

The cuda plugin maps TARGET_ALLOC_HOST onto cuMemAllocHost
which is page locked host memory. Fine grain HSA memory is not
necessarily page locked but has the same read/write from host or
device semantics.

The cuda plugin does this per-gpu and this patch makes it accessible
from any gpu, but it can be locked down to match the cuda behaviour
if preferred.

Enabling tests requires an equivalent to
// RUN: %libomptarget-compile-run-and-check-nvptx64-nvidia-cuda
for amdgpu which doesn't seem to be in use yet.

Reviewed By: jhuber6

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

22 months agoRevert "[CMake] Avoid `LLVM_BINARY_DIR` when other more specific variable are better...
John Ericson [Thu, 25 Aug 2022 15:13:46 +0000 (11:13 -0400)]
Revert "[CMake] Avoid `LLVM_BINARY_DIR` when other more specific variable are better-suited"

This reverts commit ad8c34bc3089d847a09bb740f7a58c96073e0959.

22 months ago[mlir] Add arith.addui_carry conversion to LLVM
Jakub Kuderski [Thu, 25 Aug 2022 15:06:44 +0000 (11:06 -0400)]
[mlir] Add arith.addui_carry conversion to LLVM

This covers the scalar and 1-D vector case.

I haven't implemented conversion for the multidimensional vector case yet because
the current LLVM conversion infrastructure (`handleMultidimensionalVectors`) does
not seem to support ops with multiple results.

Reviewed By: Mogball

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

22 months agoManagedStatic: remove from DynamicLibrary
Nicolai Hähnle [Wed, 29 Jun 2022 14:47:51 +0000 (16:47 +0200)]
ManagedStatic: remove from DynamicLibrary

v2:
- fix Windows build issues

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

22 months ago[mlir] Clean up ArithToLLVM. NFC.
Jakub Kuderski [Thu, 25 Aug 2022 14:48:38 +0000 (10:48 -0400)]
[mlir] Clean up ArithToLLVM. NFC.

Based on @Mogball's feedback in https://reviews.llvm.org/D132613.

Reviewed By: dcaballe

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

22 months ago[clang-cl] /kernel should toggle bit 30 in @feat.00
David Majnemer [Wed, 24 Aug 2022 19:56:31 +0000 (19:56 +0000)]
[clang-cl] /kernel should toggle bit 30 in @feat.00

The linker is supposed to detect when an object with /kernel is linked
with another object which is not compiled with /kernel. The linker
detects this by checking bit 30 in @feat.00.

22 months ago[clang][deps] Minor ModuleDepCollector refactorings NFC
Ben Langmuir [Wed, 24 Aug 2022 22:31:55 +0000 (15:31 -0700)]
[clang][deps] Minor ModuleDepCollector refactorings NFC

* Factor module map and module file path functions out
* Use a secondary mapping to lookup module deps by ID instead of the
  preprocessor module map.
* Sink DirectPrebuiltModularDeps into MDC.

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

22 months agoRevert "[CostModel][X86] Support cost kind specific look up tables"
Benjamin Kramer [Thu, 25 Aug 2022 13:42:44 +0000 (15:42 +0200)]
Revert "[CostModel][X86] Support cost kind specific look up tables"

This reverts commit 45846854a2c1414c27bc819033f6de588dea56fe.

This triggers an assertion failure during Clang selfhost

Unknown type!
UNREACHABLE executed at llvm/lib/CodeGen/ValueTypes.cpp:548!
*** SIGABRT received by PID 6107 (TID 6107) on cpu 218 from PID 6107; stack trace: ***
    @     0x556c8827c2d1         64  llvm::llvm_unreachable_internal()
    @     0x556c82a5542a         32  llvm::MVT::getVT()
    @     0x556c82a54a28         80  llvm::EVT::getEVT()
    @     0x556c7dda1526         80  llvm::TargetLoweringBase::getValueType()
    @     0x556c8174dd38        112  llvm::BasicTTIImplBase<>::getTypeLegalizationCost()
    @     0x556c81755e72        144  llvm::X86TTIImpl::getCmpSelInstrCost()
    @     0x556c8174cadf        512  llvm::TargetTransformInfoImplCRTPBase<>::getInstructionCost()
    @     0x556c84ab4dd2         32  llvm::TargetTransformInfo::getInstructionCost()
    @     0x556c82ead283       1968  llvm::sinkRegion()

22 months ago[FLANG]Remove experimental flag from SUM simplification
Mats Petersson [Wed, 24 Aug 2022 14:43:00 +0000 (15:43 +0100)]
[FLANG]Remove experimental flag from SUM simplification

The SUM function does appear to be safe to use, so remove the
experimental flag for the SUM operation.

Reviewed By: vzakhari, awarzynski

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

22 months ago[CostModel][X86] Add CodeSize handling for fdiv ops
Simon Pilgrim [Thu, 25 Aug 2022 12:43:28 +0000 (13:43 +0100)]
[CostModel][X86] Add CodeSize handling for fdiv ops

Eventually this will be part of the cost table lookup

22 months ago[AArch64][SVE] Extend LD1RQ ISel patterns to cover missing addressing modes
Matt Devereau [Fri, 29 Jul 2022 14:07:31 +0000 (14:07 +0000)]
[AArch64][SVE] Extend LD1RQ ISel patterns to cover missing addressing modes

Add some missing patterns for ld1rq's scalar + scalar addressing mode.
Also, adds the scalar + imm and scalar + scalar addressing modes for
the patterns added in https://reviews.llvm.org/D130010

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

22 months ago[libc++] Fix .compile.fail.cpp tests that should have been marked as UNSUPPORTED...
Louis Dionne [Wed, 24 Aug 2022 19:39:07 +0000 (15:39 -0400)]
[libc++] Fix .compile.fail.cpp tests that should have been marked as UNSUPPORTED in C++03/11

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

22 months agoAdd a missing override keyword. NFC.
Benjamin Kramer [Thu, 25 Aug 2022 12:50:28 +0000 (14:50 +0200)]
Add a missing override keyword. NFC.

clang/lib/Basic/Targets/X86.h:293:8: warning: 'shouldEmitFloat16WithExcessPrecision' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
  bool shouldEmitFloat16WithExcessPrecision() const {
       ^
clang/include/clang/Basic/TargetInfo.h:915:16: note: overridden virtual function is here
  virtual bool shouldEmitFloat16WithExcessPrecision() const { return false; }
               ^

22 months ago[NFC][libc] Move Uint implementation to parent directory
Guillaume Chatelet [Thu, 25 Aug 2022 09:09:10 +0000 (09:09 +0000)]
[NFC][libc] Move Uint implementation to parent directory

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

22 months agoSupport of expression granularity for _Float16.
Zahira Ammarguellat [Mon, 30 May 2022 11:52:56 +0000 (07:52 -0400)]
Support of expression granularity for _Float16.

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

22 months ago[clang][Interp] Implement pointer (de)ref operators
Timm Bäder [Thu, 18 Aug 2022 08:15:20 +0000 (10:15 +0200)]
[clang][Interp] Implement pointer (de)ref operators

Implement pointer references, dereferences and assignments.

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

22 months ago[mlir] Add math.roundeven and llvm.intr.roundeven
Tres Popp [Mon, 22 Aug 2022 13:47:44 +0000 (15:47 +0200)]
[mlir] Add math.roundeven and llvm.intr.roundeven

This is similar to math.round, but rounds to even instead of rounding away from
zero in the case of halfway values. This CL also adds lowerings to libm and
to the LLVM intrinsic.

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

22 months ago[NVPTX] Lower llvm.roundeven to cvt.rni
Benjamin Kramer [Thu, 25 Aug 2022 11:30:29 +0000 (13:30 +0200)]
[NVPTX] Lower llvm.roundeven to cvt.rni

22 months ago[NVPTX] Factor rounding patterns into a multiclass. NFCI.
Benjamin Kramer [Thu, 25 Aug 2022 11:21:40 +0000 (13:21 +0200)]
[NVPTX] Factor rounding patterns into a multiclass. NFCI.

22 months ago[CostModel][X86] Support cost kind specific look up tables
Simon Pilgrim [Thu, 25 Aug 2022 11:23:26 +0000 (12:23 +0100)]
[CostModel][X86] Support cost kind specific look up tables

Most of our cost model tables have been created assuming cost kind == recip-throughput. But we're starting to see passes wanting to get accurate costs for the other kinds as well. Some of these can be determined procedurally (e.g. codesize by default could just be the split count after type legalization), but others are going to need to be handled in cost tables - this is especially true for x86 which has so many ISA combinations.

I've created a 'CostKindCosts' struct which can hold cost values for the 4 cost kinds, defaulting to -1U for unknown cost, this can be used with the existing CostTblEntryT/CostTableLookup template code. I've also added a [TargetCostKind] accessor to make it much easier to look up individual <Optional> costs.

This just changes the ISD::SELECT costs to check the effect (and also to check that the ISD::SETCC are correctly handled for default/None cost kinds) - the plan would be to slowly extend this and move the CostKindTblEntry type somewhere generic to allow other targets to use it once its matured.

I'm also going to resurrect D103695 so that it can help with latency/codesize/sizelatency coverage testing.

For sizelatency - IIRC the definition was vague to let it be target specific - I've tried to use typical uop counts so they're comparable to MicroOpBufferSize etc.

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

22 months ago[AArch64] Fix sched model for tsv110
zhongyunde [Thu, 25 Aug 2022 11:14:58 +0000 (19:14 +0800)]
[AArch64] Fix sched model for tsv110

Update three changes:
1.Split the Load/Store resources into two, Ld0St and Ld1,
  since only one of them is capable of stores.
2.Integer ADD and SUB instructions have different latencies
  and processor resource usage (pipeline) when they have a shift of
  zero vs. non-zero, refer to D8043
3.The throughout of scalar DIV instruction.

Reviewed By: dmgreen, bryanpkc

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

22 months ago[IRCE] Drop SCEV of a Phi after adding a new input. PR57335
Max Kazantsev [Thu, 25 Aug 2022 10:48:50 +0000 (17:48 +0700)]
[IRCE] Drop SCEV of a Phi after adding a new input. PR57335

Since SCEV learned to look through single value phis with
20d798bd47ec5191de1b2a8a031da06a04e612e1, whenever we add
a new input to a Phi, we should make sure that the old cached
value is dropped. Otherwise, it may lead to various miscompiles,
such as breach of dominance as shown in the bug
https://github.com/llvm/llvm-project/issues/57335

22 months agoRevert "[gn build] port bc39d7bdd497 (libclang.map -> libclang.exports)"
Nico Weber [Thu, 25 Aug 2022 11:08:44 +0000 (07:08 -0400)]
Revert "[gn build] port bc39d7bdd497 (libclang.map -> libclang.exports)"

This reverts commit 94c00c10e837aded6a6b15fe84c12f1ced4d856d.
bc39d7bdd497 was reverted in 0f28d4856630.

22 months ago[clang-tidy] Ignore other members in a union if any member of it is initialized in...
Sockke [Thu, 25 Aug 2022 10:23:57 +0000 (18:23 +0800)]
[clang-tidy] Ignore other members in a union if any member of it is initialized in cppcoreguidelines-pro-type-member-init

If a union member is initialized, the other members of the union are still suggested to be initialized in this check.  This patch fixes this behavior.
Reference issue: https://github.com/llvm/llvm-project/issues/54748

Reviewed By: njames93

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