Matheus Izvekov [Mon, 19 Jul 2021 19:35:18 +0000 (21:35 +0200)]
[clang] fix oops: enable implicit moves in MSVC compatibility mode
When disabling simpler implicit moves in MSVC compatibility mode as
a workaround in D105518, we forgot to make the opposite change and
enable regular (P1825) implicit moves in the same mode.
As a result, we were not doing any implicit moves at all. OOPS!
This fixes it and adds test for this.
This is a fix to a temporary workaround, there is ongoing
work to replace this, applying the workaround only to
system headers and the ::stl namespace.
Signed-off-by: Matheus Izvekov <mizvekov@gmail.com>
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D106303
Alex Lorenz [Wed, 14 Jul 2021 04:49:56 +0000 (21:49 -0700)]
[clang][darwin] Add support for macOS -> Mac Catalyst
version remapping to the Darwin SDK Info
Differential Revision: https://reviews.llvm.org/D105958
Roman Lebedev [Tue, 20 Jul 2021 21:24:47 +0000 (00:24 +0300)]
[NFC][VectorCombine] Add tests for widening of partial vector load
Eli Friedman [Tue, 20 Jul 2021 20:49:10 +0000 (13:49 -0700)]
[AArch64] Add tests for 128-bit atomic loads with casp available.
We currently don't use casp; maybe we should?
Sami Tolvanen [Tue, 20 Jul 2021 20:56:35 +0000 (13:56 -0700)]
Revert "ThinLTO: Fix inline assembly references to static functions with CFI"
This reverts commit
700d07f8ce6f2879610fd6b6968b05c6f17bb915.
Reverting due to a ThinLTO+CFI breakage on -msvc targets.
Martin Storsjö [Tue, 20 Jul 2021 20:56:00 +0000 (23:56 +0300)]
[LLD] [COFF] Add a couple "MinGW only" comments re linking against DLLs. NFC.
This was requested in the post-commit review of D104530.
LLVM GN Syncbot [Tue, 20 Jul 2021 20:51:01 +0000 (20:51 +0000)]
[gn build] Port
05a6d74c4845
Albion Fung [Tue, 20 Jul 2021 20:20:03 +0000 (15:20 -0500)]
[PowerPC] Store, load, move from and to registers related builtins
This patch implements store, load, move from and to registers related
builtins, as well as the builtin for stfiw. The patch aims to provide
feature parady with xlC on AIX.
Differential revision: https://reviews.llvm.org/D105946
Vincent Lee [Tue, 20 Jul 2021 01:52:45 +0000 (18:52 -0700)]
Recommit "[lld-macho] Use DO_BIND_ADD_ADDR_IMM_SCALED for bind opcodes"
Implement pass 3 of bind opcodes from ld64 (which supports both 32-bit and 64-bit).
Pass 3 implementation condenses BIND_OPCODE_DO_BIND_ADD_ADDR_ULEB opcode
to BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED. This change is already behind an
O2 flag so it shouldn't impact current performance. I verified ld64's output with x86_64 LLD
and they were both emitting the same optimized bind opcodes (although in a slightly different
order). Tested with arm64_32 LLD and compared that with x86 LLD that the order of the bind
opcodes are the same (offset values are different which should be expected).
Reviewed By: int3, #lld-macho, MaskRay
Differential Revision: https://reviews.llvm.org/D106128
Melanie Blower [Tue, 20 Jul 2021 20:40:55 +0000 (16:40 -0400)]
Revert "[CLANG][PATCH][FPEnv] Add support for option -ffp-eval-method and extend #pragma float_control similarly"
This reverts commit
ce8024e8ff76e7be8b9ffa1a39d1dc9310bf74c7.
There are a couple buildbot problems
Sterling Augustine [Tue, 20 Jul 2021 17:29:22 +0000 (10:29 -0700)]
Consolidate string types into ptr and length representations.
After rGbbbc4f110e35ac709b943efaa1c4c99ec073da30, we can move
any string type that has convenient pointer and length fields
into the PtrAndLengthKind, reducing the amount of code.
Differential Revision: https://reviews.llvm.org/D106381
Jessica Paquette [Tue, 20 Jul 2021 01:30:07 +0000 (18:30 -0700)]
[AArch64][GlobalISel] Select llvm.aarch64.neon.st2 intrinsics
Add manual selection code similar to the code in AArch64ISelDAGToDAG, and add
`createTuple` helpers similar to the code there as well.
This accounted for around 111 fallbacks while building clang for AArch64 with
GlobalISel.
This also should make it easy to add selection code for other store
intrinsics.
As a minor cleanup, this uses `createQTuple` in the other place where we use
REG_SEQUENCE.
Differential Revision: https://reviews.llvm.org/D106332
Eli Friedman [Tue, 20 Jul 2021 20:20:02 +0000 (13:20 -0700)]
[AArch64] Use the CMP_SWAP_128 variants added in
843c6140.
Accidentally forgot to flip the opcode... and I didn't notice because it
was working fine for the GlobalISel.
Alex Lorenz [Wed, 30 Jun 2021 14:44:42 +0000 (07:44 -0700)]
[clang] NFC, move DarwinSDKInfo to lib/Basic
This is a preparation commit for https://reviews.llvm.org/D105958
Fangrui Song [Tue, 20 Jul 2021 20:22:00 +0000 (13:22 -0700)]
[LTO] Add SelectionKind to IRSymtab and use it in ld.lld/LLVMgold
In PGO, a C++ external linkage function `foo` has a private counter
`__profc_foo` and a private `__profd_foo` in a `comdat nodeduplicate`.
A `__attribute__((weak))` function `foo` has a weak hidden counter `__profc_foo`
and a private `__profd_foo` in a `comdat nodeduplicate`.
In `ld.lld a.o b.o`, say a.o defines an external linkage `foo` and b.o
defines a weak `foo`. Currently we treat `comdat nodeduplicate` as `comdat any`,
ld.lld will incorrectly consider `b.o:__profc_foo` non-prevailing. In the worst
case when `b.o:__profd_foo` is retained and `b.o:__profc_foo` isn't, there will
be dangling reference causing an `undefined hidden symbol` error.
Add SelectionKind to `Comdat` in IRSymtab and let linkers ignore nodeduplicate comdat.
Differential Revision: https://reviews.llvm.org/D106228
Melanie Blower [Tue, 20 Jul 2021 20:01:51 +0000 (16:01 -0400)]
[CLANG][PATCH][FPEnv] Add support for option -ffp-eval-method and extend #pragma float_control similarly
The Intel compiler ICC supports the option "-fp-model=(source|double|extended)"
which causes the compiler to use a wider type for intermediate floating point
calculations. Also supported is a way to embed this effect in the source
program with #pragma float_control(source|double|extended).
This patch extends pragma float_control syntax, and also adds support
for a new floating point option "-ffp-eval-method=(source|double|extended)".
source: intermediate results use source precision
double: intermediate results use double precision
extended: intermediate results use extended precision
Reviewed By: Aaron Ballman
Differential Revision: https://reviews.llvm.org/D93769
Rob Suderman [Mon, 28 Jun 2021 21:36:47 +0000 (14:36 -0700)]
[mlir][tosa] Add quantized lowering for matmul and fully_connected
Added the named op variants for quantized matmul and quantized batch matmul
with the necessary lowerings/tests from tosa's matmul/fully connected ops.
Current version does not use the contraction op interface as its verifiers
are not compatible with scalar operations.
Differential Revision: https://reviews.llvm.org/D105063
Alex Lorenz [Wed, 30 Jun 2021 14:34:26 +0000 (07:34 -0700)]
[clang][darwin] add support for Mac Catalyst availability
This commit adds support for Mac Catalyst availability attribute, as
supported by the Apple clang compiler. A follow-up commit will provide
additional support for inferring Mac Catalyst availability from macOS
availability using the mapping in the SDKSettings.json.
Differential Revision: https://reviews.llvm.org/D105052
Fangrui Song [Tue, 20 Jul 2021 19:51:44 +0000 (12:51 -0700)]
[AArch64] Delete unused Opcode after D106039
Fangrui Song [Tue, 20 Jul 2021 19:47:10 +0000 (12:47 -0700)]
[IR] Rename `comdat noduplicates` to `comdat nodeduplicate`
In the textual format, `noduplicates` means no COMDAT/section group
deduplication is performed. Therefore, if both sets of sections are retained, and
they happen to define strong external symbols with the same names,
there will be a duplicate definition linker error.
In PE/COFF, the selection kind lowers to `IMAGE_COMDAT_SELECT_NODUPLICATES`.
The name describes the corollary instead of the immediate semantics. The name
can cause confusion to other binary formats (ELF, wasm) which have implemented/
want to implement the "no deduplication" selection kind. Rename it to be clearer.
Reviewed By: rnk
Differential Revision: https://reviews.llvm.org/D106319
Shilei Tian [Tue, 20 Jul 2021 19:45:26 +0000 (15:45 -0400)]
[OpenMP][deviceRTLs] Update return type of function __kmpc_parallel_level
In `deviceRTLs`, the parallel level is stored in a shared variable of type `uint8_t`.
`__kmpc_parallel_level` currently returns a 16-bit interger. This patch first
changes the return type of the function to `uint8_t`, same as the shared variable,
and then corrects function type which was updated in D105955.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D106384
Shilei Tian [Tue, 20 Jul 2021 19:39:08 +0000 (15:39 -0400)]
[NFC][OpenMP] Fix an issue that no CHECK in test cases
This fixes the complaint from FileCheck.
Reviewed By: abhinavgaba, jdoerfert
Differential Revision: https://reviews.llvm.org/D106387
Eli Friedman [Tue, 20 Jul 2021 19:35:49 +0000 (12:35 -0700)]
[AArch64] Fix i128 cmpxchg using ldxp/stxp.
Basically two parts to this fix:
1. Stop using AtomicExpand to expand cmpxchg i128
2. Fix AArch64ExpandPseudoInsts to use a correct expansion.
From ARM architecture reference:
To atomically load two 64-bit quantities, perform a Load-Exclusive
pair/Store-Exclusive pair sequence of reading and writing the same value
for which the Store-Exclusive pair succeeds, and use the read values
from the Load-Exclusive pair.
Fixes https://bugs.llvm.org/show_bug.cgi?id=51102
Differential Revision: https://reviews.llvm.org/D106039
Sam Clegg [Tue, 20 Jul 2021 18:49:37 +0000 (11:49 -0700)]
[lld][WebAssembly] Error on import of TLS symbols in shared libraries
In https://reviews.llvm.org/D102044 we made exporting a TLS symbol
into an error, but we also want to error on import.
See https://github.com/emscripten-core/emscripten/issues/14461
Differential Revision: https://reviews.llvm.org/D106385
Nikita Popov [Tue, 20 Jul 2021 18:21:08 +0000 (20:21 +0200)]
[AttrBuilder] Assert correct attribute kind
Make sure that addAttribute() is only used with simple enum
attributes. Integer and type attributes need to provide an
additional value/type.
Albion Fung [Tue, 20 Jul 2021 18:35:24 +0000 (13:35 -0500)]
[PowerPC] Extra test case for LDARX
An extra test case added for the builtin __LDARX.
Differential revision: https://reviews.llvm.org/D105926
Sam Clegg [Thu, 15 Jul 2021 00:16:15 +0000 (17:16 -0700)]
Reland "[lld][WebAssembly] Cleanup duplicate fields in Symbols.h. NFC"
This avoids duplication and simplifies the code in several places
without increasing the size of the symbol union (at least not
above the assert'd limit of 120 bytes).
Originally commit:
9b965b37c75d626c01951184088314590e38d299
Reverted in:
16aac493e59519377071e900d119ba2e7e5b525d.
Differential Revision: https://reviews.llvm.org/D106026
Nikita Popov [Tue, 20 Jul 2021 19:05:07 +0000 (21:05 +0200)]
[BitcodeReader] Handle type attributes more explicitly (NFCI)
For attributes in legacy bitcode that are now typed, explicitly
create a type attribute with nullptr type, the same as we do
for the attribute group representation. This is so we can assert
use of the correct constructor in the future.
Nikita Popov [Tue, 20 Jul 2021 18:45:18 +0000 (20:45 +0200)]
[Orc] Fix sret/byval attributes in test (NFC)
This was placing sret/byval attributes without type argument on
non-pointer arguments. Make this valid IR by using pointer
arguments and passing the corresponding attribute type argument.
peter klausler [Tue, 20 Jul 2021 17:20:47 +0000 (10:20 -0700)]
[flang] Fix legitimate warning from latest GCC
A rank-0 static descriptor needs to be a vector; it's for
"v-list" values in defined derived type formatted I/O.
(Pushed without pre-review due to high confidence and an
unwell buildbot.)
Graham Yiu [Tue, 20 Jul 2021 16:14:21 +0000 (09:14 -0700)]
[NFC] Update code owners file
- Replace Pete with Mark as owner of ARC backend
- Re-order Philip to be sorted by first name
Nikita Popov [Tue, 20 Jul 2021 17:57:11 +0000 (19:57 +0200)]
[ThinTLOBitcodeWriter] Fix unused variable warning (NFC)
Nikita Popov [Mon, 12 Jul 2021 20:30:37 +0000 (22:30 +0200)]
[Verifier] Check byval/etc type when comparing ABI attributes
For musttail calls, ABI attributes between the function and the
musttail call must match. The current check discards the type of
type attributes like byval, which means that it will consider
byval(i32) and byval(i64) (or similar) as compatible.
I assume this is a leftover from before these attributes had a
type argument. Ran into this while trying to tighten an assertion
in AttrBuilder.
Differential Revision: https://reviews.llvm.org/D105841
Alex Lorenz [Thu, 15 Jul 2021 20:52:38 +0000 (13:52 -0700)]
[clang-scan-deps] ignore top-level module dependencies that aren't actually imported
Whenever -fmodule-name=top_level_module name is parsed, and clang actually tries to
import top_level_module, the headers are imported textually and the module isn't actually
built. However, the dependency scanner could still record it as a potential dependency
if the module was reimported and thus recorded by the preprocessor callbacks.
This change avoids collecting this kind of module as a dependency by verifying that we don't
collect top level modules without actual PCM files.
Differential Revision: https://reviews.llvm.org/D106100
Victor Huang [Tue, 20 Jul 2021 16:51:42 +0000 (11:51 -0500)]
[PowerPC] Add PowerPC cmpb builtin and emit target indepedent code for XL compatibility
This patch is in a series of patches to provide builtins for compatibility
with the XL compiler. This patch add the builtin and emit target independent
code for __cmpb.
Reviewed By: nemanjai, #powerpc
Differential revision: https://reviews.llvm.org/D105194
Jacob Hegna [Tue, 20 Jul 2021 02:55:10 +0000 (02:55 +0000)]
Fix Threshold overwrite bug in the Oz inlining model features.
Differential Revision: https://reviews.llvm.org/D106336
Zequan Wu [Mon, 19 Jul 2021 21:26:00 +0000 (14:26 -0700)]
[Utils] Add -compilation-dir flag to prepare-code-coverage-artifact.py
Differential Revision: https://reviews.llvm.org/D106314
Nikita Popov [Sun, 18 Jul 2021 16:33:32 +0000 (18:33 +0200)]
[Inline] Fix noalias addition on simplified instructions (PR50589)
When adding noalias/alias.scope metadata, we analyze the instructions
of the original callee, and then place metadata on the corresponding
inlined instructions in the caller as provided by VMap. However, this
assumes that this actually a clone of the instruction, rather than
the result of simplification. If simplification occurred, the
instruction that VMap points to may not have any relationship as far
as ModRef behavior is concerned.
Fix this by tracking simplified instructions during cloning and then
only processing instructions that have not been simplified. This is
done with an additional map form original to cloned instruction,
into which we only insert if no simplification is performed. The
mapping in VMap can then be compared to this map. If they're the
same, the instruction hasn't been simplified. (I originally wanted
to only track a set of simplified instructions, but that wouldn't
work if the instruction only gets simplified afterwards, e.g. based
on rewritten phis.)
Fixes https://bugs.llvm.org/show_bug.cgi?id=50589.
Differential Revision: https://reviews.llvm.org/D106242
Fangrui Song [Tue, 20 Jul 2021 17:50:11 +0000 (10:50 -0700)]
[PowerPC][test] Don't write to srcdir
Mark de Wever [Tue, 20 Jul 2021 17:48:16 +0000 (19:48 +0200)]
[libc++][doc] Fixes a broken link.
Jacques Pienaar [Tue, 20 Jul 2021 17:44:48 +0000 (10:44 -0700)]
[mlir][ods] Add nested OpTrait
Allows for grouping OpTraits with list of OpTrait to make it easier to group OpTraits together without needing to use list concats (e.g., enable using `[Traits, ..., UsefulGroupOfTraits, Others, ...]` instead of `[Traits, ...] # UsefulGroupOfTraits # [Others, ...]`). Flatten in construction of Operation. This recurses here as the expectation is that these aren't expected to be deeply nested (most likely only 1 level of nesting).
Differential Revision: https://reviews.llvm.org/D106223
Sami Tolvanen [Fri, 16 Jul 2021 22:53:52 +0000 (15:53 -0700)]
ThinLTO: Fix inline assembly references to static functions with CFI
Create an internal alias with the original name for static functions
that are renamed in promoteInternals to avoid breaking inline
assembly references to them. This version uses module inline assembly
to avoid issues with LowerTypeTestsModule.
Relands commmit
8e3b5cb39eef462943ed7556469604ce25c07a1d with arch
specific tests fixed.
Link: https://github.com/ClangBuiltLinux/linux/issues/1354
Reviewed By: nickdesaulniers, pcc
Differential Revision: https://reviews.llvm.org/D104058
Arthur Eubanks [Mon, 19 Jul 2021 17:32:12 +0000 (10:32 -0700)]
[NewPM] Print pre-transformation IR name in --print-after-all
Sometimes a transformation can change the name of some IR (e.g. an SCC
with functions added/removed). This can be confusing when debug logging
doesn't match the post-transformation name. The specific example I came
across was that --print-after-all said the inliner was working on an SCC
that only contained one function, but calls in multiple functions were
getting inlined. After all inlining, the current SCC only contained one
function.
Piggyback off of the existing logic to handle invalidated IR +
--print-module-scope. Simply always store the IR description and use
that.
Reviewed By: jamieschmeiser
Differential Revision: https://reviews.llvm.org/D106290
Nancy Wang [Tue, 20 Jul 2021 17:02:05 +0000 (13:02 -0400)]
[SystemZ][z/OS][libcxx]: fix libcxx test cases related to codecvt class UTF8
This PR to fix a few test cases related to class https://en.cppreference.com/w/cpp/locale/codecvt , as mentioned in document, class is converting UTF16 and UTF8 or UTF32 and UTF8, character type is deprecated in c++20 and it needs explicitly specify it is UTF8 string literal. Current test cases assume 1 byte character is ASCII or Unicode character which is not true on z/OS platform. UTF8/16/32 information can be found in https://naveenr.net/unicode-character-set-and-utf-8-utf-16-utf-32-encoding/ and EBCDIC and ASCII character value can be found in http://www.simotime.com/asc2ebc1.htm
Differential Revision: https://reviews.llvm.org/D106153
Nancy Wang [Tue, 20 Jul 2021 16:54:20 +0000 (12:54 -0400)]
[SystemZ][z/OS][libcxx]: fix libcxx test cases related to codecvt class UTF16/32
This PR is to fix a few UTF16 and UTF32 related test cases that are testing member functions for https://en.cppreference.com/w/cpp/locale/codecvt class , functions are converting from UTF16, UTF32 to UTF8 or vise visa. Test cases need to explicitly specify it is UNICODE character for UTF16/32 type in order to be valid tests to match type in documentation. it assumes it will be ASCII or UTF8 type for 1 byte character ( value range from 1 to 127 ), which is not true on z/OS in EBCDIC mode. For information related to UTF16/32 , please see https://naveenr.net/unicode-character-set-and-utf-8-utf-16-utf-32-encoding/ , and EBCDIC/ASCII character value can be found in http://www.simotime.com/asc2ebc1.htm
Differential Revision: https://reviews.llvm.org/D106151
Giorgis Georgakoudis [Tue, 20 Jul 2021 02:18:29 +0000 (19:18 -0700)]
[OpenMP] Set RequiresFullRuntime false in SPMDization
SPMDization in D102307 does not change the RequiresFullRuntime argument of kmpc_target_init/deinit calls. However, the constraints of SPMDization detection for converting a target region to SPMD mode should guarantee that the region does not require full runtime support. Hence, this patch sets RequiresFullRuntime to false for improved execution performance.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D105556
Joseph Huber [Tue, 20 Jul 2021 16:52:00 +0000 (12:52 -0400)]
[OpenMP] Change AMDGCN to AMDGPU in the Cmake Module
Summary:
Change the name for targeting AMD offloading.
Rahul Joshi [Tue, 20 Jul 2021 15:56:35 +0000 (08:56 -0700)]
[MLIR][NFC] Minor cleanup for BufferDeallocation pass.
- Change walkReturnOperations() to be a non-template and look at block terminator
for ReturnLike trait.
- Clarify description of validateSupportedControlFlow
- Eliminate unused argument in Backedges::recurse.
- Eliminate repeated calls to getFunction()
- Fix wording for non-SCF loop failure
Differential Revision: https://reviews.llvm.org/D106373
Joseph Huber [Tue, 20 Jul 2021 16:04:13 +0000 (12:04 -0400)]
[OpenMP][Documentation] Fix hyperlink location
Fixes the documentation hyperlinks not showing the header.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D106374
Fangrui Song [Tue, 20 Jul 2021 16:34:35 +0000 (09:34 -0700)]
[test] Avoid llvm-symbolizer/llvm-addr2line one-dash long options
Shimin Cui [Tue, 20 Jul 2021 16:27:26 +0000 (12:27 -0400)]
This patch extends the OptimizeGlobalAddressOfMalloc to handle the null check of global pointer variables. It is disabled with https://reviews.llvm.org/rGb7cd291c1542aee12c9e9fde6c411314a163a8ea. This PR is to reenable it while fixing the original problem reported. The fix is to set the store value correctly when creating store for the new created global init bool symbol.
Reviewed By: efriedma
Differential Revision: https://reviews.llvm.org/D102711
Craig Topper [Tue, 20 Jul 2021 16:10:45 +0000 (09:10 -0700)]
[RISCV] Teach RISCVMatInt about cases where it can use LUI+SLLI to replace LUI+ADDI+SLLI for large constants.
If we need to shift left anyway we might be able to take advantage
of LUI implicitly shifting its immediate left by 12 to cover part
of the shift. This allows us to use more bits of the LUI immediate
to avoid an ADDI.
isDesirableToCommuteWithShift now considers compressed instruction
opportunities when deciding if commuting should be allowed.
I believe this is the same or similar to one of the optimizations
from D79492.
Reviewed By: luismarques, arcbbb
Differential Revision: https://reviews.llvm.org/D105417
Craig Topper [Tue, 20 Jul 2021 16:09:46 +0000 (09:09 -0700)]
[RISCV] Add -mattr=+c command lines to add-before-shl.ll to prepare for D105417. NFC
Fangrui Song [Tue, 20 Jul 2021 16:18:24 +0000 (09:18 -0700)]
[Driver] Detect libstdc++ include paths for native gcc on 32-bit non-Debian Linux
Fixes https://bugs.llvm.org/show_bug.cgi?id=50303
Differential Revision: https://reviews.llvm.org/D106119
Quinn Pham [Tue, 20 Jul 2021 14:42:14 +0000 (09:42 -0500)]
[PowerPC] Semachecking for XL compat builtin icbt
This patch is in a series of patches to provide builtins for compatibility with the XL compiler.
This patch adds semachecking for an already implemented builtin, `__icbt`. `__icbt` is only
valid for Power8 and up.
Reviewed By: #powerpc, nemanjai
Differential Revision: https://reviews.llvm.org/D105834
Craig Topper [Tue, 20 Jul 2021 15:46:21 +0000 (08:46 -0700)]
[RISCV] Add custom isel to select (and (srl X, C1), C2) and (and (shl X, C1), C2)
Replace some existing isel patterns that are covered by the new
code. SLLIUWPat has been removed in favor of folding its root case
into the new code. The other uses in isel patterns for shXadd.uw
have been switched to using hardcoded AND masks.
This is based on the original version of D49585 from ARM. The final
version of that was made a DAG combine, but I've chosen to keep it
as custom isel. I'm not convinced DAG combine is as good with
shift pairs as it is with and+shift. I saw some issues optimizing
the shifts created by vscale lowering if an and isn't created for
from a shift pair.
Reviewed By: luismarques
Differential Revision: https://reviews.llvm.org/D106230
Stefan Pintilie [Mon, 12 Jul 2021 17:47:44 +0000 (12:47 -0500)]
[PowerPC] Inefficient register allocation of ACC registers results in many copies.
ACC registers are a combination of four consecutive vector registers.
If the vector registers are assigned first this often forces a number
of copies to appear just before the ACC register is created. If the ACC
register is assigned first then fewer copies are generated when the vector
registers are assigned.
This patch tries to force the register allocator to assign the ACC registers first
and then the UACC registers and then the vector pair registers. It does this
by changing the priority of the register classes.
This patch also adds hints to help the register allocator assign UACC registers from
known ACC registers and vector pair registers from known UACC registers.
Reviewed By: nemanjai
Differential Revision: https://reviews.llvm.org/D105854
Sterling Augustine [Fri, 16 Jul 2021 20:17:16 +0000 (13:17 -0700)]
Avoid keeping internal string_views in Twine.
This is a follow-up to https://reviews.llvm.org/D103935
A Twine's internal layout should not depend on which version of the
C++ standard is in use. Dynamically linking binaries compiled with two
different layouts (eg, --std=c++14 vs --std=c++17) ends up
problematic.
This change avoids that issue by immediately converting a
string_view to a pointer-and-length at the cost of an extra eight-bytes
in Twine.
Differential Revision: https://reviews.llvm.org/D106186
Craig Topper [Tue, 20 Jul 2021 15:32:15 +0000 (08:32 -0700)]
[RISCV] Use unordered indexed loads for MGATHER.
I don't think the semantics of the llvm masked gather intrinsic care
about the order the elements are loaded. For example, type legalization
by splitting will chain them in parallel. This is different than
scatter which we do chain in order.
Reviewed By: frasercrmck
Differential Revision: https://reviews.llvm.org/D106025
David Green [Tue, 20 Jul 2021 15:44:50 +0000 (16:44 +0100)]
[LV] Change interface of getReductionPatternCost to return Optional
Currently the Instruction cost of getReductionPatternCost returns an
Invalid cost to specify "did not find the pattern". This changes that to
return an Optional with None specifying not found, allowing Invalid to
mean an infinite cost as is used elsewhere.
Differential Revision: https://reviews.llvm.org/D106140
Geoffrey Martin-Noble [Tue, 20 Jul 2021 15:33:51 +0000 (08:33 -0700)]
[Bazel] Update for
bc1a2979fc
Update Bazel build configuration for
https://github.com/llvm/llvm-project/commit/
bc1a2979fc70
by adding missing dep to clang tooling unit tests.
Joel E. Denny [Tue, 20 Jul 2021 15:17:56 +0000 (11:17 -0400)]
[UpdateCCTestChecks] Implement --global-hex-value-regex
For example, in OpenMP offload codegen tests, global variables like
`.offload_maptypes*` are much easier to read in hex.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D104743
Joel E. Denny [Tue, 20 Jul 2021 15:17:50 +0000 (11:17 -0400)]
[UpdateCCTestChecks] Implement --global-value-regex
`--check-globals` activates checks for all global values, and
`--global-value-regex` filters them. For example, I'd like to use it
in OpenMP offload codegen tests to check only global variables like
`.offload_maptypes*`.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D104742
LLVM GN Syncbot [Tue, 20 Jul 2021 15:13:51 +0000 (15:13 +0000)]
[gn build] Port
1a29403d2f8a
zoecarver [Thu, 27 May 2021 16:23:19 +0000 (09:23 -0700)]
[libcxx][ranges] Add common_iterator.
Differential Revision: https://reviews.llvm.org/D103335
Kazu Hirata [Tue, 20 Jul 2021 15:07:04 +0000 (08:07 -0700)]
[SampleProfile] Remove ProfileIsValid (NFC)
The last use was removed on Jan 22, 2021 in commit
c9cd9a006632419ce7346e50564e6347a93181cc.
Rahul Joshi [Tue, 20 Jul 2021 00:19:29 +0000 (17:19 -0700)]
[NFC] Fix some comments and only look at terminators when looking for ReturnLike ops
Differential Revision: https://reviews.llvm.org/D106326
Melanie Blower [Tue, 20 Jul 2021 14:56:33 +0000 (10:56 -0400)]
[clang][patch][NFC] Refactor calculation of FunctionDecl to avoid duplicate code
Caroline Concatto [Wed, 5 May 2021 14:20:16 +0000 (15:20 +0100)]
[NFC][LoopVectorizer] Remove VF.isScalable() assertion from collectInstsToScalarize and getInstructionCost
This patch removes the assertion when VF is scalable and replaces
getKnownMinValue() by getFixedValue(), so it still guards the code against
scalable vector types.
The assertions were used to guarantee that getknownMinValue were not used for
scalable vectors.
Differential Revision: https://reviews.llvm.org/D106359
Anirudh Prasad [Tue, 20 Jul 2021 14:50:18 +0000 (10:50 -0400)]
[SystemZ][z/OS] Add GOFF support to file magic identification
- This patch adds in the GOFF format to the file magic identification logic in LLVM
- Currently, for the object file support, GOFF is marked as having as an error
- However, this is only temporary until https://reviews.llvm.org/D98437 is merged in
Reviewed By: abhina.sreeskantharajan
Differential Revision: https://reviews.llvm.org/D105993
Quinn Pham [Tue, 20 Jul 2021 13:57:18 +0000 (08:57 -0500)]
[PowerPC] Restore FastMathFlags of Builder for Vector FDiv Builtins
This patch fixes `__builtin_ppc_recipdivf`, `__builtin_ppc_recipdivd`,
`__builtin_ppc_rsqrtf`, and `__builtin_ppc_rsqrtd`. FastMathFlags are
set to fast immediately before emitting these builtins. Now the flags
are restored to their previous values after the builtins are emitted.
Reviewed By: nemanjai, #powerpc
Differential Revision: https://reviews.llvm.org/D105984
Simon Pilgrim [Tue, 20 Jul 2021 14:31:24 +0000 (15:31 +0100)]
[CostModel] Templatize EntryCost::Cost to allow custom cost metrics
We currently use an unsigned value for our CostTblEntry and TypeConversionCostTblEntry cost tables which is limiting depending on how the target wishes to handle various CostKinds etc.
For instance, targets might wish to store separate instruction count, latency or throughput values etc. On D46276 we have been investigating storing a code snippet to improve latency/throughput cost calculations.
There is a slight problem in that template argument deduction was struggling to match the now templatized Costs[] tables in a ArrayRef constructor - I've added helper wrappers for CostTableLookup/ConvertCostTableLookup which avoids us having to update all existing calls with a template hint.
Differential Revision: https://reviews.llvm.org/D106351
Johannes Doerfert [Tue, 20 Jul 2021 14:16:56 +0000 (09:16 -0500)]
[Attributor] Initialize effectively unused value to appease UBSAN
Bradley Smith [Tue, 13 Jul 2021 14:42:36 +0000 (14:42 +0000)]
[AArch64][SVE] Move instcombine like transforms out of SVEIntrinsicOpts
Instead move them to the instcombine that happens in AArch64TargetTransformInfo.
Differential Revision: https://reviews.llvm.org/D106144
Florian Hahn [Tue, 20 Jul 2021 14:15:59 +0000 (16:15 +0200)]
[VPlan] Fix formatting glitch from
d2a73fb44ea0b8.
Florian Hahn [Tue, 20 Jul 2021 10:06:31 +0000 (12:06 +0200)]
[VPlan] Add recipe for first-order rec phis, make splicing explicit.
This patch adds a VPFirstOrderRecurrencePHIRecipe, to further untangle
VPWidenPHIRecipe into distinct recipes for distinct use cases/lowering.
See D104989 for a new recipe for reduction phis.
This patch also introduces a new `FirstOrderRecurrenceSplice`
VPInstruction opcode, which is used to make the forming of the vector
recurrence value explicit in VPlan. This more accurately models def-uses
in VPlan and also simplifies code-generation. Now, the vector recurrence
values are created at the right place during VPlan-codegeneration,
rather than during post-VPlan fixups.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D105008
Nico Weber [Tue, 20 Jul 2021 14:13:39 +0000 (10:13 -0400)]
[gn build] remove stray character in a comment
Jamie Schmeiser [Tue, 20 Jul 2021 14:12:20 +0000 (10:12 -0400)]
Reland Produce warning for performing pointer arithmetic on a null pointer.
Summary:
Test and produce warning for subtracting a pointer from null or subtracting
null from a pointer.
This reland adds the functionality that the warning is no longer reusing an
existing warning, it has different wording for C vs C++ to refect the fact
that nullptr-nullptr has defined behaviour in C++, it is suppressed
when the warning is triggered by a system header and adds
-Wnull-pointer-subtraction to allow the warning to be controlled. -Wextra
implies -Wnull-pointer-subtraction.
Author: Jamie Schmeiser <schmeise@ca.ibm.com>
Reviewed By: efriedma (Eli Friedman), nickdesaulniers (Nick Desaulniers)
Differential Revision: https://reviews.llvm.org/D98798
Stefan Pintilie [Wed, 16 Jun 2021 13:36:25 +0000 (08:36 -0500)]
[PowerPC][Builtins] Added a number of builtins for compatibility with XL.
Added a number of different builtins that exist in the XL compiler. Most of
these builtins already exist in clang under a different name.
Reviewed By: nemanjai, #powerpc
Differential Revision: https://reviews.llvm.org/D104386
Stella Laurenzo [Tue, 20 Jul 2021 13:56:05 +0000 (06:56 -0700)]
Exclude pybind11 2.7.0 from MLIR python requirements.
Appears to have a broken CMake installation. Reported bug: https://github.com/pybind/pybind11/issues/3136
David Green [Tue, 20 Jul 2021 13:52:36 +0000 (14:52 +0100)]
[AArch64] Regenerate some tests checks. NFC
Louis Dionne [Tue, 20 Jul 2021 13:19:52 +0000 (09:19 -0400)]
[libc++][NFC] Add missing commits to the ABI changelog
Tobias Gysi [Tue, 20 Jul 2021 12:21:15 +0000 (12:21 +0000)]
[linalg] Add TensorDimOp to list of ops known by bufferization.
Bufferization handles all unknown ops conservative. The patch ensures accessing the dimension of an output tensor does not prevent in place bufferization.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D106356
Simon Pilgrim [Tue, 20 Jul 2021 12:37:24 +0000 (13:37 +0100)]
[X86] X86InstCombineIntrinsic.cpp - silence clang-tidy warnings about incorrect uses of auto. NFCI.
We were using auto instead of auto* in a number of places which failed the llvm-qualified-auto check.
Additionally we were using auto in some places where the type wasn't immediately obvious - the style guide rule of thumb is only to use auto from casts etc. where the type is already explicitly stated.
Simon Pilgrim [Tue, 20 Jul 2021 11:54:50 +0000 (12:54 +0100)]
[MIPS][MSA] Regenerate basic operations test checks
Cleanup the check prefixes to make refresh a lot easier
Sam McCall [Sat, 17 Jul 2021 00:23:51 +0000 (02:23 +0200)]
[Lex] Consider a PCH header-guarded even with #endif truncated
This seems to be a more useful behavior for tools that use preambles.
I believe it doesn't affect real compiles: the PCH is only included once
when used, and recursive inclusion of the main-file *within* the PCH
isn't supported in any case.
Differential Revision: https://reviews.llvm.org/D106204
Haojian Wu [Tue, 20 Jul 2021 08:31:11 +0000 (10:31 +0200)]
[clang-tidy] Don't suggest "inline" fix for main function in
definitions-in-headers check.
Sam McCall [Sat, 17 Jul 2021 00:17:44 +0000 (02:17 +0200)]
[clangd] Propagate header-guarded flag from preamble to main AST
Fixes https://github.com/clangd/clangd/issues/377
Differential Revision: https://reviews.llvm.org/D106203
Sam McCall [Sat, 17 Jul 2021 00:10:16 +0000 (02:10 +0200)]
[clangd] Add tests covering existing header-guard behavior. NFC
A few different mechanisms here that will need some work to untangle:
- self-include in a preamble being an error even if the file is ifdef-guarded
- the is-include-guarded flag not being propagated from preamble to main ast
- preambles containing the first half on an include guard discard that info
For now just record current behavior.
Relevant to:
- https://github.com/clangd/clangd/issues/811
- https://github.com/clangd/clangd/issues/377
- https://github.com/clangd/clangd/issues/262
Differential Revision: https://reviews.llvm.org/D106201
LLVM GN Syncbot [Tue, 20 Jul 2021 12:00:01 +0000 (12:00 +0000)]
[gn build] Port
2b08f6af62af
Sebastian Neubauer [Mon, 19 Jul 2021 13:55:39 +0000 (15:55 +0200)]
[AMDGPU] Improve register computation for indirect calls
First, collect the register usage in each function, then apply the
maximum register usage of all functions to functions with indirect
calls.
This is more accurate than guessing the maximum register usage without
looking at the actual usage.
As before, assume that indirect calls will hit a function in the
current module.
Differential Revision: https://reviews.llvm.org/D105839
Ulrich Weigand [Tue, 20 Jul 2021 11:36:33 +0000 (13:36 +0200)]
[SystemZ] Fix invalid assumption in getCPUNameFromS390Model
Code in getCPUNameFromS390Model currently assumes that the
numerical value of the model number always increases with
future hardware. While this has happened to be the case
with the last few machines, it is not guaranteed -- that
assumption was violated with (much) older machines, and
it can be violated again with future machines.
Fix by explicitly listing model numbers for all supported
machine models.
Timm Bäder [Mon, 19 Jul 2021 09:51:00 +0000 (11:51 +0200)]
[llvm][tools] Hide more unrelated tool options
Differential Revision: https://reviews.llvm.org/D106271
Jan Svoboda [Tue, 20 Jul 2021 11:17:45 +0000 (13:17 +0200)]
[clang][deps] Fix test by checking ignored files correctly
After a rebase,
bc1a2979fc70d954ae97122205c71c8404a1b17e accidentally changed `shouldIgnoreFile(Filename)` to incorrect `IgnoredFiles.count(Filename)`. This avoided using native filenames, which the patch intended to solve in the first place.
Failing Windows builds:
* https://lab.llvm.org/buildbot#builders/123/builds/5147
* https://lab.llvm.org/buildbot#builders/86/builds/17177
Jay Foad [Mon, 19 Jul 2021 15:20:44 +0000 (16:20 +0100)]
[AMDGPU] Pre-commit test case for D106284
This test case shows the scheduler wrongly reordering two buffer
accesses that might alias.
Jeremy Morse [Tue, 20 Jul 2021 09:43:21 +0000 (10:43 +0100)]
[DebugInfo][InstrRef] Fix a broken substitution method, add test coverage
This patch fixes a clearly-broken function that I absent-mindedly bodged
many months ago.
Over in D85749 I landed the substituteDebugValuesForInst, that creates
substitution records for all the def operands from one debug-labelled
instruction to the new one. Unfortunately it would crash if the two
instructions had different numbers of operands; I tried to fix this in
537f0fbe82 by adding a "max operand" parameter to the method, but then
didn't actually change the loop bound to take account of this. It passed
all the tests because.... well there wasn't any real test coverage of this
method.
This patch fixes up the loop to be bounded by the MaxOperand bound; and
adds test coverage for the x86-fixup-LEAs calls to this method, so that
it's actually tested.
Differential Revision: https://reviews.llvm.org/D105820
Nico Weber [Tue, 20 Jul 2021 10:43:30 +0000 (06:43 -0400)]
[gn build] (manually) port
bc1a2979fc70
Chen Zheng [Tue, 20 Jul 2021 10:27:47 +0000 (10:27 +0000)]
[PowerPC][NFC] add more cases for lfiwzx/lfiwax
Jan Svoboda [Tue, 20 Jul 2021 10:12:40 +0000 (12:12 +0200)]
[clang][deps] Avoid minimizing PCH input files
This patch avoid minimizing input files that contributed to a PCH or its modules. This prevents the implicit modular build to fail on unexpected file size. Depends on D106146.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D104536
Jan Svoboda [Tue, 20 Jul 2021 09:42:34 +0000 (11:42 +0200)]
[clang][deps] Separate filesystem caches for minimized and original files
This patch separates the local and global caches of `DependencyScanningFilesystem` into two buckets: minimized files and original files. This is necessary to deal with precompiled modules/headers.
Consider a single worker with its instance of filesystem:
1. Build system uses the worker to scan dependencies of module A => filesystem cache gets populated with minimized input files.
2. Build system uses the results to explicitly build module A => explicitly built module captures the state of the real filesystem (containing non-minimized input files).
3. Build system uses the prebuilt module A as an explicit precompiled dependency for another compile job B.
4. Build system uses the same worker to scan dependencies for job B => worker uses implicit modular build to discover dependencies, which validates the filesystem state embedded in the prebuilt module (non-minimized files) to the current view of the filesystem (minimized files), resulting in validation failures.
This problem can be avoided in step 4 by collecting input files from the precompiled module and marking them as "ignored" in the minimizing filesystem. This way, the validation should succeed, since we should be always dealing with the original (non-minized) input files. However, the filesystem already minimized the input files in step 1 and put it in the cache, which gets used in step 4 as well even though it's marked ignored (do not minimize). This patch essentially fixes this oversight by making the `"file is minimized"` part of the cache key (from high level).
Depends on D106064.
Reviewed By: dexonsmith
Differential Revision: https://reviews.llvm.org/D106146