Craig Topper [Mon, 1 Feb 2021 03:41:31 +0000 (19:41 -0800)]
[PowerPC] Remove vnot_ppc and replace with the standard vnot.
immAllOnesV has special support for looking through bitcasts
automatically so isel patterns don't need to explicitly look
for the bitconvert.
Craig Topper [Mon, 1 Feb 2021 02:46:55 +0000 (18:46 -0800)]
[X86] Cleanup isel patterns to use 'vnot' instead of (xor X, immAllOnesV) to improve readability. NFC
Lang Hames [Mon, 1 Feb 2021 02:32:11 +0000 (13:32 +1100)]
Revert "[JITLink] Add missing symbols for ELF ehframe testcase, re-enable ...."
This reverts commit
6e58539659aea0ee621c7e267d825aa82d4e7e96.
This failed in http://lab.llvm.org:8011/#/builders/123/builds/2676. I guess
were're still missing some symbols, but unfortunately the specific error is
masked by a bug in python/lit that hides stderr. This test will have to remain
disabled on Windows until I can get help to debug it further.
Craig Topper [Mon, 1 Feb 2021 01:37:44 +0000 (17:37 -0800)]
[RISCV] Custom lower fshl/fshr with Zbt extension.
We need to add a mask to the shift amount for these operations
to use the FSR/FSL instructions. We were previously doing this
in isel patterns, but custom lowering will make the mask
visible to optimizations earlier.
Lang Hames [Mon, 1 Feb 2021 01:21:18 +0000 (12:21 +1100)]
[JITLink] Add missing symbols for ELF ehframe testcase, re-enable on Windows.
This testcase was failing on windows due to missing definitions. This commit
adds definitions of the missing symbols (as absolute symbols) to eliminate the
errors.
Mike Rice [Mon, 1 Feb 2021 01:14:16 +0000 (17:14 -0800)]
[OpenMP] Fix comment and assertion strings (NFC).
James Y Knight [Mon, 1 Feb 2021 00:47:37 +0000 (19:47 -0500)]
Fix test in "CFG: Create scope for non-compound range-for body."
The constant 4 is sometimes printed as "4L", or "4LL", in CFG dump
output, depending on platform; accept all variants.
Ammends commit
8f670d5b6d8f39bf9bf1d142dacef3afaed6d70b.
Jun Ma [Tue, 26 Jan 2021 06:57:46 +0000 (14:57 +0800)]
[CodeGenPrepare] Also skip lifetime.end intrinsic when check return block in dupRetToEnableTailCallOpts.
Differential Revision: https://reviews.llvm.org/D95424
Luís Marques [Sun, 31 Jan 2021 23:56:01 +0000 (23:56 +0000)]
[Sanitizer][RISCV] Fix FastUnwindTest
Fixes the `FastUnwindTest` unit test for RISC-V.
These changes reflect the different stack organization commonly used for
that architecture.
Differential Revision: https://reviews.llvm.org/D90574
Luís Marques [Sun, 31 Jan 2021 23:51:38 +0000 (23:51 +0000)]
[CMake][compiler-rt][RISCV] Support RISC-V cross-compilation
This seems to be a safe way to ensure that the Compiler-RT test compiler
flags are properly set in all cross-compilation scenarios. Without this
when `BUILTINS_TEST_TARGET_CFLAGS` is set in
`compiler-rt/test/builtins/CMakeLists.txt` the other flags are cleared.
Differential Revision: https://reviews.llvm.org/D92124
James Y Knight [Sun, 31 Jan 2021 23:42:39 +0000 (18:42 -0500)]
CFG: Create scope for non-compound range-for body.
Previously, it was omitting the destructor call from the CFG, which
could result in incorrect diagnostics.
Craig Topper [Sun, 31 Jan 2021 06:38:06 +0000 (22:38 -0800)]
[RISCV][LegalizeTypes] Try to expand BSWAP before promoting if the promoted BSWAP would expand anyway.
If we're going to end up expanding anyway, we should do it early
so we don't create extra operations to handle the bytes added by
promotion.
This is helfpul on RISCV where we might have to promote i16 all
the way to i64.
Differential Revision: https://reviews.llvm.org/D95756
Jacques Pienaar [Sun, 31 Jan 2021 22:06:58 +0000 (14:06 -0800)]
Fix omitted kw in type alias printer
* Fixing missing `type` keyword in alias print
* Add test for large tuple type alias & rerun output to verify printed
form can be parsed (which caught the above).
Luís Marques [Sun, 31 Jan 2021 21:52:32 +0000 (21:52 +0000)]
[LSan][RISCV] Enable LSan for RISCV64
Fixes the broken RISCV64 implementation of `internal_clone` and
adds RISCV64 support for LSan.
Differential Revision: https://reviews.llvm.org/D92403
Florian Hahn [Sun, 31 Jan 2021 19:08:07 +0000 (19:08 +0000)]
[LTOCodeGenerator] Use lto::Config for options (NFC).
This patch removes some options that have been duplicated in
LTOCodeGenerator and instead use lto::Config directly to manage the
options.
This is a cleanup after
6a59f0560648.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D95738
Florian Hahn [Thu, 28 Jan 2021 10:35:30 +0000 (10:35 +0000)]
[ConstraintElimination] Add tests for ICMP_EQ predicates.
Pre-commit test coverage for conditions with EQ predicates.
Michał Górny [Wed, 27 Jan 2021 14:34:15 +0000 (15:34 +0100)]
[lldb] [Process/FreeBSDRemote] Introduce arm (32-bit) support
Introduce a NativeRegisterContextFreeBSD for 32-bit ARM platform.
This includes support for GPR + VFP registers as exposed by FreeBSD's
ptrace(2) API. Hardware breakpoints or watchpoints are not supported
due to missing kernel support. The code is roughly based on the arm64
context.
It also includes an override for GetSoftwareBreakpointTrapOpcode() based
on the matching code in the PlatformFreeBSD plugin.
Differential Revision: https://reviews.llvm.org/D95696
Michał Górny [Thu, 21 Jan 2021 18:30:56 +0000 (19:30 +0100)]
[lldb] [Process/FreeBSDRemote] Introduce arm64 support
Introduce arm64 support in the FreeBSDRemote plugin. The code
is roughly based on Linux and reuses the same POSIX RegisterInfos
(but the buffers need to be a few bytes larger due to stricter struct
member alignment in FreeBSD structures -- luckily, they do not affect
the actual member offsets). It supports reading and writing
general-purpose and FPU registers. SVE and hardware watchpoint support
is missing due to the limitations of FreeBSD ptrace(2) API.
Differential Revision: https://reviews.llvm.org/D95297
Kazu Hirata [Sun, 31 Jan 2021 18:23:43 +0000 (10:23 -0800)]
[llvm] Drop unnecessary const from return types (NFC)
Identified with const-return-type.
Kazu Hirata [Sun, 31 Jan 2021 18:23:41 +0000 (10:23 -0800)]
[TableGen] Use ListSeparator (NFC)
Kazu Hirata [Sun, 31 Jan 2021 18:23:39 +0000 (10:23 -0800)]
[VE] Fix compiler warnings (NFC)
Matt Arsenault [Mon, 18 Jan 2021 14:53:55 +0000 (09:53 -0500)]
RegAlloc: Fix assert if all registers in class reserved
With a context instruction, this would produce a context
error. However, it would continue on and do an out of bounds access of
the empty allocation order array.
Matt Arsenault [Thu, 28 Jan 2021 20:40:38 +0000 (15:40 -0500)]
AMDGPU: Add missing consts
Sam McCall [Sun, 31 Jan 2021 15:37:42 +0000 (16:37 +0100)]
Reland [clangd] Quote/escape argv included in log messages.
... but don't apply it where we're using hasSubstr
This reverts commit
7a8008d0e8885d22ff9a1fa7f9965c7b2ad2569a.
Sam McCall [Sun, 31 Jan 2021 15:21:44 +0000 (16:21 +0100)]
Revert "[clangd] Quote/escape argv included in log messages."
This reverts commit
0962f1d72b1606f3224a14434c7b4500a23f8728.
http://45.33.8.238/win/32346/step_9.txt
Alexey Lapshin [Tue, 1 Dec 2020 20:15:34 +0000 (23:15 +0300)]
[dsymutil][DWARFLinker][NFC] make AddressManager not depending on the order of checks for relocations.
Current dsymutil implementation of hasLiveMemoryLocation()/hasLiveAddressRange()
and applyValidRelocs() assume that calls should be done in certain order
(from first Dies to last). Multi-thread implementation might call these methods
in other order(it might process compilation units in order other than they are physically
located), so we remove restriction that searching for relocations should be done
in ascending order. This change does not introduce noticable performance degradation.
The testing results for clang binary:
golden-dsymutil/dsymutil
23787992
clang MD5:
5efa8fd9355ebf81b65f24db5375caa2
elapsed time=91sec
build-Release/bin/dsymutil
23855616
clang MD5:
5efa8fd9355ebf81b65f24db5375caa2
elapsed time=91sec
Differential Revision: https://reviews.llvm.org/D93106
Mark de Wever [Sun, 31 Jan 2021 13:25:01 +0000 (14:25 +0100)]
[libc++] Allow building with C++17.
After committing D92214 it was noticed libc++ no longer builds with
C++17. For now reenable building with C++17. This is intended to be a
temporary measure in the future a C++20 capable compiler will be
required.
Sam McCall [Sun, 31 Jan 2021 11:13:20 +0000 (12:13 +0100)]
[clangd] Remove references to old future-based API. NFC
Sam McCall [Sun, 31 Jan 2021 11:00:08 +0000 (12:00 +0100)]
[clangd] Quote/escape argv included in log messages.
https://github.com/clangd/clangd/issues/637
Sam McCall [Sun, 31 Jan 2021 10:16:52 +0000 (11:16 +0100)]
[docs] Clarify compile_flags.txt subtleties
See confusion e.g. in https://github.com/clangd/clangd/issues/637
Craig Topper [Sun, 31 Jan 2021 05:30:14 +0000 (21:30 -0800)]
[RISCV] Add rv64 command line to bswap-ctlz-cttz-ctpop.ll.
Matthias Springer [Sun, 31 Jan 2021 02:57:50 +0000 (11:57 +0900)]
[mlir][AVX512] Fix result type of vp2intersect
The result values of vp2intersect are vectors of bits, i.e.,
vector<8xi1> or vector<16xi8> (instead of i8 or i16).
Differential Revision: https://reviews.llvm.org/D95678
peter klausler [Sat, 30 Jan 2021 18:14:07 +0000 (10:14 -0800)]
[flang] Improve shape & length characterization
Analyze the shape of the result of TRANSFER(ptr,array) correctly
when "ptr" is an array of deferred shape. Fixing this bug led to
some refactoring and concentration of common code in TypeAndShape
member functions with code in general shape and character length
analysis, and this led to some regression test failures that have
all been cleaned up.
Differential Revision: https://reviews.llvm.org/D95744
Craig Topper [Sat, 30 Jan 2021 23:57:12 +0000 (15:57 -0800)]
[RISCV] Use MVT instead of EVT in RISCVISelDAGToDAG.cpp
All this code runs post type legalization so we should have
exclusively legal types. The methods on MVT should be more
efficient than EVT.
Craig Topper [Sat, 30 Jan 2021 21:14:46 +0000 (13:14 -0800)]
[TableGen] Use emplace_back to add to PatternsToMatch in GenerateVariants. Use std::move when adding to PatternsToMatch in AddPatternToMatch.
We already used emplace_back in at least one other place so be
consistent.
AddPatternToMatch already took PTM as an rvalue reference, but
we need to use std::move again to move it into the PatternToMatch
vector.
Craig Topper [Sat, 30 Jan 2021 20:19:14 +0000 (12:19 -0800)]
[TableGen] Avoid a couple vector copies in ExpandHwModeBasedTypes.
Use vector::swap instead of copying to a local vector and clearing
the original. We can just swap into the just created local vector
instead which will move the pointers and not the data.
Use std::move in another place to avoid a copy.
Shilei Tian [Sat, 30 Jan 2021 20:14:41 +0000 (15:14 -0500)]
[OpenMP][NVPTX] Refined CMake logic to choose compute capabilites
This patch refines the logic to choose compute capabilites via the
environment variable `LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES`. It supports the
following values (all case insensitive):
- "all": Build `deviceRTLs` for all supported compute capabilites;
- "auto": Only build for the compute capability auto detected. Note that this
requires CUDA. If CUDA is not found, a CMake fatal error will be raised.
- "xx,yy" or "xx;yy": Build for compute capabilities `xx` and `yy`.
If `LIBOMPTARGET_NVPTX_COMPUTE_CAPABILITIES` is not set, it is equivalent to set
it to `all`.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D95687
Florian Hahn [Sat, 30 Jan 2021 17:56:51 +0000 (17:56 +0000)]
[ConstraintElimination] Verify CS and DFSInStack are in sync.(NFC)
After the main loop is done, we should have one constraint per item in
DFSInStack. Otherwise we added a constraint without a proper DFSInStack
item.
Kazu Hirata [Sat, 30 Jan 2021 17:53:42 +0000 (09:53 -0800)]
[llvm] Add missing header guards (NFC)
Identified with llvm-header-guard.
Kazu Hirata [Sat, 30 Jan 2021 17:53:40 +0000 (09:53 -0800)]
[AMDGPU] Forward-declare AMDGPUTargetMachine (NFC)
AMDGPUTargetTransformInfo.h needs AMDGPUTargetMachine but relies on a
forward declaration of AMDGPUTargetMachine in AMDGPU.h. This patch
adds a forward declaration right in AMDGPUTargetTransformInfo.h.
While we are at it, this patch removes the one in
AMDGPU.h, where it is unnecessary.
Kazu Hirata [Sat, 30 Jan 2021 17:53:38 +0000 (09:53 -0800)]
[TableGen] Use ListSeparator (NFC)
Stephen Kelly [Sat, 30 Jan 2021 15:46:08 +0000 (15:46 +0000)]
[ASTMatchers] Fix definition of decompositionDecl
Fraser Cormack [Sat, 30 Jan 2021 15:47:16 +0000 (15:47 +0000)]
[RISCV] Update extractelt tests to sign-extend results (NFC)
This demonstrates a missed optimization: the `vmv.x.s` instruction is
used to extract the element from the vector, and this instruction
already sign-extends the value to XLEN.
Georgii Rymar [Thu, 28 Jan 2021 13:35:18 +0000 (16:35 +0300)]
[llvm-symbolizer] - Fix the crash in GNU output style with --no-inlines and missing input file.
Fixes https://bugs.llvm.org/show_bug.cgi?id=48882.
If the input file does not exist (or has a reading error), the
following code will crash if there are two or more input addresses.
```
auto ResOrErr = Symbolizer.symbolizeInlinedCode(
ModuleName, {Offset, object::SectionedAddress::UndefSection});
Printer << (error(ResOrErr) ? DILineInfo() : ResOrErr.get().getFrame(0));
```
For the first address, `symbolizeInlinedCode` returns an error.
For the second address, `symbolizeInlinedCode` returns an empty result
(not an error) and `.getFrame(0)` will crash.
Differential revision: https://reviews.llvm.org/D95609
Stephen Kelly [Thu, 28 Jan 2021 13:12:43 +0000 (13:12 +0000)]
Fix traversal with hasDescendant into lambdas
Differential Revision: https://reviews.llvm.org/D95607
Florian Hahn [Sat, 30 Jan 2021 13:30:48 +0000 (13:30 +0000)]
[LoopUnswitch] Properly update MSSA if header has non-clobbering stores.
This patch fixes updating MemorySSA if the header contains memory
defs that do not clobber a duplicated instruction. We need to find the
first defining access outside the loop body and use that as defining
access of the duplicated instruction.
This fixes a crash caused by
bee486851c1a.
Stephen Kelly [Wed, 27 Jan 2021 22:03:23 +0000 (22:03 +0000)]
[ASTMatchers] Fix traversal below range-for elements
Differential Revision: https://reviews.llvm.org/D95562
Harald van Dijk [Sat, 30 Jan 2021 13:06:08 +0000 (13:06 +0000)]
[compiler-rt][tests] Define TARGET_FLAGS
D36116 refactored the logic of tests and removed the definition of TARGET_FLAGS, but left one use of it. Restore its definition for that one use, so that an x86_64 test is compiled with -m64.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D93634
Florian Hahn [Sat, 30 Jan 2021 11:50:37 +0000 (11:50 +0000)]
[LTO] Add option enable NewPM with LTOCodeGenerator.
This patch adds an option to enable the new pass manager in
LTOCodeGenerator. It also updates a few tests with legacy PM specific
tests, which started failing after
6a59f0560648 when
LLVM_ENABLE_NEW_PASS_MANAGER=true.
Florian Hahn [Sat, 30 Jan 2021 10:09:55 +0000 (10:09 +0000)]
[LTO] Use lto::backend for code generation.
This patch updates LTOCodeGenerator to use the utilities provided by
LTOBackend to run middle-end optimizations and backend code generation.
This is a first step towards unifying the code used by libLTO's C API
and the newer, C++ interface (see PR41541).
The immediate motivation is to allow using the new pass manager when
doing LTO using libLTO's C API, which is used on Darwin, among others.
With the changes, there are no codegen/stats differences when building
MultiSource/SPEC2000/SPEC2006 on Darwin X86 with LTO, compared
to without the patch.
Reviewed By: steven_wu
Differential Revision: https://reviews.llvm.org/D94487
Fangrui Song [Sat, 30 Jan 2021 08:51:36 +0000 (00:51 -0800)]
[ELF][test] Add --emit-relocs --gc-sections test for relocation section for a non-SHF_ALLOC section
This has been fixed by D89841.
Kazu Hirata [Sat, 30 Jan 2021 07:23:37 +0000 (23:23 -0800)]
[llvm] Use isa instead of dyn_cast (NFC)
Kazu Hirata [Sat, 30 Jan 2021 07:23:35 +0000 (23:23 -0800)]
[llvm] Use llvm::lower_bound and llvm::upper_bound (NFC)
Kazu Hirata [Sat, 30 Jan 2021 07:23:34 +0000 (23:23 -0800)]
[llvm] Use append_range (NFC)
Yang Fan [Sat, 30 Jan 2021 06:52:43 +0000 (14:52 +0800)]
[NFC][VFS] Fix a build warning due to an extra semicolon
Greg McGary [Fri, 11 Dec 2020 05:36:42 +0000 (21:36 -0800)]
[lld-macho][NFC] Add new option group for versions
Coalesce all version control options into a group
Differential Revision: https://reviews.llvm.org/D94938
Greg McGary [Fri, 11 Dec 2020 04:54:45 +0000 (20:54 -0800)]
[llvm-objdump-macho] print per-second-level-page encodings for option --unwind-info
Compact unwind entries have 8 bits for the encoding-table offset:
* offsets 0..126 reference the global commmon-encodings table, while
* offsets 127..255 reference a per-second-level-page table.
This diff teaches `llvm-objdump` to print this per-page encodings table.
Differential Revision: https://reviews.llvm.org/D93265
Wang, Pengfei [Sat, 30 Jan 2021 04:00:55 +0000 (12:00 +0800)]
[X86] Fix tile config register spill issue.
This is an optimized approach for D94155.
Previous code build the model that tile config register is the user of
each AMX instruction. There is a problem for the tile config register
spill. When across function, the ldtilecfg instruction may be inserted
on each AMX instruction which use tile config register. This cause all
tile data register clobber.
To fix this issue, we remove the model of tile config register. Instead,
we analyze the AMX instructions between one call to another. We will
insert ldtilecfg after the first call if we find any AMX instructions.
Reviewed By: LuoYuanke
Differential Revision: https://reviews.llvm.org/D95136
Sriraman Tallam [Sat, 30 Jan 2021 02:47:26 +0000 (18:47 -0800)]
Detect Source Drift with Propeller.
Source Drift happens when the sources are updated after profiling the binary
but before building the final optimized binary. If the source has changed since
the profiles were obtained, optimizing basic blocks might be sub-optimal. This
only applies to BasicBlockSection::List as it creates clusters of basic blocks
using basic block ids. Source drift can invalidate these groupings leading to
sub-optimal code generation with regards to performance.
PGO source drift for a particular function can be detected using function
metadata added in D95495.
When source drift is deected, disable basic block clusters by default
which can be re-enabled with -mllvm option
bbsections-detect-source-drift=false.
Differential Revision: https://reviews.llvm.org/D95593
Jacques Pienaar [Sat, 30 Jan 2021 01:42:23 +0000 (17:42 -0800)]
Use type alias for large tuples
Tuples can occupy quite a lot of space, instead of printing out tuple type
everywhere, just use the type alias if larger (arbitrarily chose a bound for
now).
Differential Revision: https://reviews.llvm.org/D95707
Craig Topper [Sat, 30 Jan 2021 01:32:01 +0000 (17:32 -0800)]
[RISCV] Merge rv32 and rv64 vector fadd/fsub/fmul/fdiv sdnode tests into single tests files with 2 run lines.
The IR and CHECK lines are identical so just keep one copy.
Nathan Hawes [Sat, 16 Jan 2021 01:44:14 +0000 (11:44 +1000)]
[VFS] Combine VFSFromYamlDirIterImpl and OverlayFSDirIterImpl into a single implementation (NFC)
As a fixme notes, both of these directory iterator implementations are
conceptually similar and duplicate the functionality of returning and uniquing
entries across two or more directories. This patch combines them into a single
class 'CombiningDirIterImpl'.
This also drops the 'Redirecting' prefix from RedirectingDirEntry and
RedirectingFileEntry to save horizontal space. There's no loss of clarity as
they already have to be prefixed with 'RedirectingFileSystem::' whenever
they're referenced anyway.
rdar://problem/
72485443
Differential Revision: https://reviews.llvm.org/D94857
karimnosseir [Sat, 30 Jan 2021 00:55:12 +0000 (16:55 -0800)]
Update ElementsAttr::isValidIndex to handle ElementsAttr with a scalar. Scalar will have rank 0.
Update ElementsAttr::isValidIndex to handle ElementsAttr with a scalar. Scalar will have rank 0.
Reviewed By: rriddle
Differential Revision: https://reviews.llvm.org/D95663
Hsiangkai Wang [Fri, 29 Jan 2021 23:54:41 +0000 (07:54 +0800)]
[RISCV] Update the version number to v0.10 for vector.
peter klausler [Fri, 29 Jan 2021 21:34:22 +0000 (13:34 -0800)]
[flang] Support disabled alternative PARAMETER statement
Legacy Fortran implementations support an alternative form of the
PARAMETER statement; it differs syntactically from the standard's
PARAMETER statement by lacking parentheses, and semantically by
using the type and shape of the initialization expression to define
the attributes of the named constant. (GNU Fortran gets that part
wrong; Intel Fortran and nvfortran have full support.)
This patch disables the old style PARAMETER statement by default, as
it is syntactically ambiguous with conforming assignment statements;
adds a new "-falternative-parameter-statement" option to enable it;
and implements it correctly when enabled.
Fixes https://bugs.llvm.org/show_bug.cgi?id=48774, in which a user
tripped over the syntactic ambiguity.
Differential Revision: https://reviews.llvm.org/D95697
Hsiangkai Wang [Fri, 29 Jan 2021 13:59:49 +0000 (21:59 +0800)]
[RISCV] Update the version number to v0.10 for vector.
v0.10 is tagged in V specification. Update the version to v0.10.
Differential Revision: https://reviews.llvm.org/D95680
Hsiangkai Wang [Fri, 29 Jan 2021 06:35:58 +0000 (14:35 +0800)]
[NFC][RISCV] Remove redundant pseudo instructions for vector load/store.
Not all combinations of SEW and LMUL we need to support. For example, we
only need to support [M1, M2, M4, M8] for SEW = 64. There is no need to
define pseudos for PseudoVLSE64MF8, PseudoVLSE64MF4, and PseudoVLSE64MF2.
Differential Revision: https://reviews.llvm.org/D95667
Stanislav Mekhanoshin [Fri, 29 Jan 2021 22:38:29 +0000 (14:38 -0800)]
[AMDGPU] Be more specific in needsFrameBaseReg
A condition "mayLoadOrStore" is too broad for that function.
Differential Revision: https://reviews.llvm.org/D95700
Roman Lebedev [Fri, 29 Jan 2021 19:46:34 +0000 (22:46 +0300)]
[ExpandMemCmpPass] Preserve Dominator Tree, if available
This finishes getting rid of all the avoidable Dominator Tree recalculations
in X86 optimized codegen pipeline.
Roman Lebedev [Fri, 29 Jan 2021 18:14:34 +0000 (21:14 +0300)]
[ShadowStackGCLowering] Preserve Dominator Tree, if avaliable
This doesn't help avoid any Dominator Tree recalculations just yet,
there's one more pass to go..
Roman Lebedev [Fri, 29 Jan 2021 18:33:49 +0000 (21:33 +0300)]
[LowerConstantIntrinsics] Preserve Dominator Tree, if avaliable
Christopher Tetreault [Fri, 29 Jan 2021 20:52:39 +0000 (12:52 -0800)]
[SVE] delete VectorType::getNumElements()
The previously agreed-upon deprecation period for
VectorType::getNumElements() has passed. This patch removes this method
and completes the refactor proposed in the RFC:
https://lists.llvm.org/pipermail/llvm-dev/2020-March/139811.html
Reviewed By: david-arm, rjmccall
Differential Revision: https://reviews.llvm.org/D95570
Sriraman Tallam [Fri, 29 Jan 2021 20:52:59 +0000 (12:52 -0800)]
Emit metadata when instr. profiles hash mismatch occurs.
This patch emits "instr_prof_hash_mismatch" function annotation metadata if
there is a hash mismatch while applying instrumented profiles.
During the PGO optimized build using instrumented profiles, if the CFG of
the function has changed since generating the profile, a hash mismatch is
encountered. This patch emits this information as annotation metadata. We
plan to use this with Propeller which is done at the machine IR level.
Propeller is usually applied on top of PGO and a hash mismatch during
PGO could be used to detect source drift.
Differential Revision: https://reviews.llvm.org/D95495
Michał Górny [Fri, 29 Jan 2021 01:14:47 +0000 (02:14 +0100)]
[clang-tidy] Fix linking tests to LLVMTestingSupport
LLVMTestingSupport is not part of libLLVM, and therefore can not
be linked to via LLVM_LINK_COMPONENTS. Instead, it needs to be
specified explicitly to ensure that it is linked explicitly
even if LLVM_LINK_LLVM_DYLIB is used. This is consistent with handling
in clangd.
Fixes PR#48931
Differential Revision: https://reviews.llvm.org/D95653
Alexander Belyaev [Fri, 29 Jan 2021 20:26:57 +0000 (21:26 +0100)]
[mlir] Preserve lexicographic order after loop collapsing.
Currently, for a scf.parallel (i,j,k) after the loop collapsing to 1D is done, the
IVs would be traversed as for an scf.parallel(k,j,i).
Differential Revision: https://reviews.llvm.org/D95693
Christopher Tetreault [Fri, 29 Jan 2021 20:03:32 +0000 (12:03 -0800)]
Revert "[CMake] Actually require python 3.6 or greater"
There are builders that do not have python 3.6. Revert until this situation can be rectified
This reverts commit
0703b0753c40dad30f1683403f6600bd2cb42055.
Christopher Tetreault [Fri, 29 Jan 2021 17:11:38 +0000 (09:11 -0800)]
[CMake] Actually require python 3.6 or greater
Previously, CMake would find any version of Python3. However, the project
claims to require 3.6 or greater, and 3.6 features are being used.
Reviewed By: yln
Differential Revision: https://reviews.llvm.org/D95635
Jessica Paquette [Thu, 28 Jan 2021 20:27:30 +0000 (12:27 -0800)]
[GlobalISel] Remove hint instructions in generic InstructionSelect code.
I think every target will want to remove these in the same way. Rather than
making them all implement the same code, let's just put this in
InstructionSelect.
Differential Revision: https://reviews.llvm.org/D95652
Fangrui Song [Fri, 29 Jan 2021 19:18:30 +0000 (11:18 -0800)]
[VE] Add include for formatted_raw_ostream after
046cfb856517c6140d5e1c0989232e26d00b05b2
Zarko Todorovski [Fri, 29 Jan 2021 19:05:17 +0000 (14:05 -0500)]
[AIX] Actually push back "-mabi=vec-extabi" when option is on.
Accidentaly ommitted the portion of pushing back the option in
https://reviews.llvm.org/D94986
Casey Carter [Fri, 29 Jan 2021 19:05:52 +0000 (11:05 -0800)]
[libcxx][test] Silence MSVC narrowing warning
Jonathan Peyton [Fri, 22 Jan 2021 20:45:45 +0000 (14:45 -0600)]
[OpenMP] Add environment variable to force monotonic dynamic scheduling
This patch introduces a new environment variable to force monotonic
behavior for users that absolutely need it. This is in anticipation
of 5.0 change that uses non-monotonic behavior for dynamic scheduling
by default. Fixes for that and the actual switch are coming soon.
Differential Revision: https://reviews.llvm.org/D95263
Shilei Tian [Fri, 29 Jan 2021 18:12:47 +0000 (13:12 -0500)]
[OpenMP][NFC] Added release note for new `deviceRTLs` and hidden helper task
Added release note for new `deviceRTLs` and hidden helper task for LLVM
12.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D95584
Casey Carter [Fri, 29 Jan 2021 18:05:14 +0000 (10:05 -0800)]
[libcxx][test] Silence false positive MSVC /analyze warning
Casey Carter [Fri, 29 Jan 2021 18:01:37 +0000 (10:01 -0800)]
[libcxx][test] explicitly discard bitset::test's return
... just in case some implementation annotates it `[[nodiscard]]`.
Petr Hosek [Fri, 29 Jan 2021 03:01:41 +0000 (19:01 -0800)]
Make the profile-filter.c test compatible with 32-bit systems
This addresses PR48930.
Differential Revision: https://reviews.llvm.org/D95658
Pavel Iliin [Thu, 17 Dec 2020 20:07:35 +0000 (20:07 +0000)]
[AArch64][Clang][Linux] Enable out-of-line atomics by default.
Generate outline atomics if compiling for armv8-a non-LSE AArch64 Linux
(including Android) targets to use LSE instructions, if they are available,
at runtime. Library support is checked by clang driver which doesn't enable
outline atomics if no proper libraries (libgcc >= 9.3.1 or compiler-rt) found.
Differential Revision: https://reviews.llvm.org/D93585
Jordan Rupprecht [Fri, 29 Jan 2021 17:16:35 +0000 (09:16 -0800)]
[mlir][docs] Fix typo: even -> event
Andrzej Warzynski [Fri, 29 Jan 2021 16:56:53 +0000 (16:56 +0000)]
[flang][docs] Add New Flang Driver Biweekly call
Jay Foad [Fri, 29 Jan 2021 14:41:58 +0000 (14:41 +0000)]
[GlobalISel] Fix modifying a G_OR without notifying the observer
Remove the call to setFlags in favour of creating the instruction with
the correct flags in the first place, so we don't have to explicitly
notify the observer.
Differential Revision: https://reviews.llvm.org/D95681
Nico Weber [Fri, 29 Jan 2021 16:20:04 +0000 (11:20 -0500)]
Revert "Disable rosegment for old Android versions."
This reverts commit
fae16fc0eed7cf60207901818cfe040116f2ef00.
Breaks building compiler-rt android runtimes with trunk clang
but older NDK, see discussion on https://reviews.llvm.org/D95166
Jay Foad [Thu, 28 Jan 2021 14:19:31 +0000 (14:19 +0000)]
[AMDGPU] Test all register names known to AMDGPUPALMetadata
Differential Revision: https://reviews.llvm.org/D95684
Peter Steinfeld [Tue, 26 Jan 2021 16:20:57 +0000 (08:20 -0800)]
[flang] Fix problems with constant arrays with lower bounds that are not 1
There were two problems with constant arrays whose lower bound is not 1.
First, when folding the arrays, we were creating the folded array to have lower
bounds of 1 but, we were not re-adjusting their lower bounds to the
declared values. Second, we were not calculating the extents correctly.
Both of these problems led to bogus error messages.
I fixed the first problem by adjusting the lower bounds in
NonPointerInitializationExpr() in Evaluate/check-expression.cpp. I wrote the
class ArrayConstantBoundChanger, which is similar to the existing class
ScalarConstantExpander. In the process of implementing and testing it, I found
a bug that I fixed in ScalarConstantExpander which caused it to infinitely
recurse on parenthesized expressions. I also removed the unrelated class
ScalarExpansionVisitor, which was not used.
I fixed the second problem by changing the formula that calculates upper bounds
in in the function ComputeUpperBound() in Evaluate/shape.cpp.
I added tests that trigger the bogus error messages mentioned above along with
a constant folding tests that uses array operands with shapes that conform but
have different bounds.
In the process of adding tests, I discovered that tests in
Evaluate/folding09.f90 and folding16.f90 were written incorrectly, and I
fixed them. This also revealed a bug in contant folding of the
intrinsic "lbounds" which I plan to fix in a later change.
Differential Revision: https://reviews.llvm.org/D95449
J-Y You [Fri, 29 Jan 2021 15:24:30 +0000 (10:24 -0500)]
[TableGen] Fix instantiating multiclass in foreach
If multiclass argument comes from loop varaible and argument is record type,
it will not recognize the type. This patch ensures that loop variables are
resolved correctly.
Differential Revision: https://reviews.llvm.org/D95308
Nico Weber [Wed, 27 Jan 2021 23:59:39 +0000 (18:59 -0500)]
clang-cl: Accept /std:c11, /std:c17 flags
clang-cl already defaults to C17 for .c files, but no harm
in accepting these flags. Fixes PR48185.
Differential Revision: https://reviews.llvm.org/D95575
Nico Weber [Wed, 27 Jan 2021 16:01:59 +0000 (11:01 -0500)]
clang-cl: Invent a /winsysroot concept
On non-Windows platforms, --sysroot can be used to make the compiler use
a single, hermetic directory for all header and library files.
This is useful, but difficult to do on Windows. After D95472 it's
possible to achieve this with two flags:
out/gn/bin/clang-cl win.c -fuse-ld=lld \
/vctoolsdir path/to/VC/Tools/MSVC/14.26.28801 \
/winsdkdir path/to/win_sdk
But that's still cumbersome: It requires two flags instead of one, and
it requires writing down the (changing) VC/Tools/MSVC version.
This adds a new `/winsysroot <dir>` flag that's effectively an alias to
these two flags. With this, building against a hermetic Windows
toolchain only needs:
out/gn/bin/clang-cl win.c -fuse-ld=lld /winsysroot path
`/winsysroot <dir>` is the same as adding
/vctoolsdir <dir>/VC/Tools/MSVC/<vctoolsver>
/winsdkdir <dir>/Windows Kits/<winsdkmajorversion>
`<vctoolsver>` is taken from `/vctoolsversion` if passed, or else it's
the name of the directory in `<dir>/VC/Tools/MSVC` that's the highest
numeric tuple.
`<winsdkmajorversion>` is the major version in /winsdkversion if passed,
else it's the name of the directory in `<dir>/Windows Kits` that's the
highest number.
So `/winsysroot <path>` requires this subfolder structure:
path/
VC/
Tools/
MSVC/
14.26.28801 (or another number)
include/
...
Windows Kits/
10/
Include/
10.0.19041.0/ (or another number)
um/
...
Lib/
10.0.19041.0/ (or another number)
um/
x64/
...
...
Differential Revision: https://reviews.llvm.org/D95534
Simon Pilgrim [Fri, 29 Jan 2021 14:21:55 +0000 (14:21 +0000)]
[X86][SSE] combineExtractWithShuffle - support zero-extending to allow extracting from narrow shuffle masks
If the shuffle mask can't be widened to match the original extracted element width, see if the upper bits are zeroable - which allows us to extract+zero-extend the smaller extraction.
Christian Sigg [Thu, 28 Jan 2021 14:03:25 +0000 (15:03 +0100)]
[mlir] Remove mlir_c_runner_utils_static.
The library is not actually static when BUILD_SHARED_LIBS is on, and tests need to explicitly load it already. Also, the shared objects it was linked to did not use any symbols from it and it was therefore never linked to it.
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D95612
Sam McCall [Fri, 29 Jan 2021 13:59:16 +0000 (14:59 +0100)]
Revert "[clangd] Extract symbol-scope logic out of Quality, add tests. NFC"
On second thought, this can't properly be reused for highlighting.
Consider this example, which Quality wants to consider function-scope,
but highlighting must consider class-scope:
void foo() {
class X {
int ^y;
};
}
Sam McCall [Fri, 29 Jan 2021 13:38:43 +0000 (14:38 +0100)]
[clangd] Extract symbol-scope logic out of Quality, add tests. NFC
This prepares for reuse from the semantic highlighting code.
There's a bit of yak-shaving here:
- when the enum is moved into the clangd namespace, promote it to a
scoped enum. This means teaching the decision forest infrastructure
to deal with scoped enums.
- AccessibleScope isn't quite the right name: e.g. public class members
are treated as accessible, but still have class scope. So rename to
SymbolScope.
- Rename some QualitySignals members to avoid name conflicts.
(the string) SymbolScope -> Scope
(the enum) Scope -> ScopeKind