Kees Cook [Fri, 1 Apr 2022 06:27:10 +0000 (23:27 -0700)]
[CSKY] AsmBackend: Wrap Inst.dump() in LLVM_DEBUG
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=CSKY -DLLVM_ENABLE_ASSERTIONS=OFF
builds will fail to link due to undefined `llvm::MCInst::dump() const`
```
ld.lld: error: undefined symbol: llvm::MCInst::dump() const
>>> referenced by CSKYAsmBackend.cpp
>>> /home/kees/src/built-compilers/llvm/stage2-prof-gen/lto.cache/llvmcache-
0656FC38C728A7FE0F767D10CD84C7F820114C46:(llvm::CSKYAsmBackend::relaxInstruction(llvm::MCInst&, llvm::MCSubtargetInfo const&) const)
```
Wrap it in LLVM_DEBUG().
Fixes https://github.com/llvm/llvm-project/issues/54684
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D122854
Mehdi Amini [Fri, 1 Apr 2022 05:52:25 +0000 (05:52 +0000)]
Add a test case for `applyPatternsAndFoldGreedily` to support the revert of
59bbc7a08
This shows that pushing constant to the right in a commutative op leads
to `applyPatternsAndFoldGreedily` to converge without applying all the
patterns.
Differential Revision: https://reviews.llvm.org/D122870
Mehdi Amini [Fri, 1 Apr 2022 06:16:00 +0000 (06:16 +0000)]
Revert "[GreedPatternRewriter] Preprocess constants while building worklist when not processing top down"
This reverts commit
59bbc7a0851b6e0054bb3ed47df0958822f08880.
This exposes an issue breaking the contract of
`applyPatternsAndFoldGreedily` where we "converge" without applying
remaining patterns.
Fangrui Song [Fri, 1 Apr 2022 06:04:50 +0000 (23:04 -0700)]
[X86] Set frame-setup/frame-destroy on prologue/epilogue CFI instructions
This approach is used by AArch64/RISCV to make frame-setup/frame-destroy
instructions contiguous instead of being interleaved by CFI instructions. Code
checking `MBBI->getFlag(MachineInstr::FrameSetup) || MBBI->isCFIInstruction()`
can be simplified to just check FrameSetup.
This helps locate all CFI instructions in the prologue, which can be handy to use
.cfi_remember_state/.cfi_restore_state to decrease unwind table size (D114545).
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D122541
Kai Luo [Fri, 1 Apr 2022 05:16:11 +0000 (13:16 +0800)]
[PowerPC] Add cmpxchg test for pwr7 in atomic expand pass. NFC.
Vitaly Buka [Fri, 1 Apr 2022 03:39:03 +0000 (20:39 -0700)]
Destroy ValueNames after all unique_ptr<Value>
This UB detected by -fsanitize-memory-use-after-dtor in tensorflow/MLIR.
Tan Jinhua [Thu, 31 Mar 2022 06:43:47 +0000 (14:43 +0800)]
[llvm-cov] Add test cases for coverage_watermark
Add test cases for coverage_watermark in llvm-cov, also refer to
https://reviews.llvm.org/D116876
Differential Revision: https://reviews.llvm.org/D122785
Jake Vossen [Fri, 1 Apr 2022 03:38:14 +0000 (03:38 +0000)]
Fix Typo in SmallVector doc
Replace forward slash with backward slash.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D120930
Lian Wang [Thu, 31 Mar 2022 01:51:06 +0000 (01:51 +0000)]
[RISCV] Supplement SDNode patterns for vfwmul/vfwadd/vfwsub
Reviewed By: jacquesguan
Differential Revision: https://reviews.llvm.org/D122720
Richard Smith [Fri, 1 Apr 2022 01:40:40 +0000 (18:40 -0700)]
An expression should only contain an unexpanded parameter pack if it
lexically contains a mention of the pack.
Systematically distinguish between syntactic and semantic references to
packs, especially when propagating dependence from a type into an
expression. We should consult the type-as-written when computing
syntactic dependence and should consult the semantic type when computing
semantic dependence.
Fixes #54402.
yanming [Wed, 23 Mar 2022 06:11:55 +0000 (14:11 +0800)]
[VP] Add more cast VPintrinsic and docs.
Add vp.fptoui, vp.uitofp, vp.fptrunc, vp.fpext, vp.trunc, vp.zext, vp.sext, vp.ptrtoint, vp.inttoptr intrinsic and docs.
Reviewed By: frasercrmck, craig.topper
Differential Revision: https://reviews.llvm.org/D122291
Hongtao Yu [Thu, 31 Mar 2022 19:35:40 +0000 (12:35 -0700)]
[llvm-profgen] Fixing a context attribure update issue due to a non-derministic processing order on different platforms.
A context can be created by invoking the `getFunctionProfileForContext` function in two ways:
- by using a probe and its calling context.
- by removing the leaf frame from an existing contexts. The first way is used when generating a function profile for a given LBR range, and the input `WasLeafInlined` is computed depending on the actually probe in the LBR range. The second way is used when using the entry count of an inlinee function profile to update its inliner callsite count, so `WasLeafInlined` is unknown for the inliner frame.
The two invocations can happen in different order on different platforms, since the lbr ranges are stored in an unordered_map, and we are making sure `ContextWasInlined` is always set correctly.
This should fix the random test failure introduced by D121655
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D122844
Artur Pilipenko [Thu, 31 Mar 2022 23:30:14 +0000 (16:30 -0700)]
Fix MemorySSAUpdater::insertDef for dead code
Fix for https://github.com/llvm/llvm-project/issues/51257.
Differential Revision: https://reviews.llvm.org/D122601
Zequan Wu [Thu, 31 Mar 2022 23:07:49 +0000 (16:07 -0700)]
Revert "[LLDB][NativePDB] Minor fix on inline line table."
This reverts commit
4b2af365b6fadde9e578ca08e6de332388b2f9c2.
Leonard Grey [Thu, 31 Mar 2022 18:49:12 +0000 (14:49 -0400)]
Add output filename to UUID hash
Differential Revision: https://reviews.llvm.org/D122843
Matt Arsenault [Thu, 31 Mar 2022 21:57:39 +0000 (17:57 -0400)]
Target: Use getPointerSizeInBits instead of 8 * getPointerSize
Matt Arsenault [Thu, 31 Mar 2022 21:42:02 +0000 (17:42 -0400)]
X86/GlobalISel: Use LLT form of getMachineMemOperand
Matt Arsenault [Thu, 31 Mar 2022 21:43:32 +0000 (17:43 -0400)]
X86/GlobalISel: Regenerate test checks
Matt Arsenault [Thu, 31 Mar 2022 21:25:11 +0000 (17:25 -0400)]
SelectionDAG: Avoid some uses of getPointerTy
Avoids use of the default address space parameter, and avoids some
assumptions about the incoming address space.
Matt Arsenault [Thu, 31 Mar 2022 21:10:35 +0000 (17:10 -0400)]
MSP430: Avoid using getPointerSize/getPointerTy
Use the contextually appropriate value instead of relying on the
default address space default parameters. Usually you should be
reusing a pre-existing type.
LLVM GN Syncbot [Thu, 31 Mar 2022 22:04:13 +0000 (22:04 +0000)]
[gn build] Port
fc7573f29c79
Zequan Wu [Thu, 31 Mar 2022 21:56:47 +0000 (14:56 -0700)]
[LLDB][NativePDB] Minor fix on inline line table.
Jorge Gorbe Moya [Thu, 31 Mar 2022 21:54:41 +0000 (14:54 -0700)]
Revert "[misexpect] Re-implement MisExpect Diagnostics"
This reverts commit
46774df307159444d65083c2fd82f8574f0ab1d9.
Luboš Luňák [Thu, 31 Mar 2022 20:22:21 +0000 (22:22 +0200)]
include stddef.h for size_t
Needed at least for -DLLVM_ENABLE_MODULES=On.
Shivam [Thu, 31 Mar 2022 21:45:17 +0000 (03:15 +0530)]
resolve typo in the manual.
Julian Lettner [Wed, 30 Mar 2022 17:24:11 +0000 (10:24 -0700)]
[Darwin] Limit parallelism for sanitizer tests that use shadow memory on AS
On Darwin, we want to limit the parallelism during test execution for
sanitizer tests that use shadow memory. The reason is explained by this
existing comment:
> Only run up to 3 processes that require shadow memory simultaneously
> on 64-bit Darwin. Using more scales badly and hogs the system due to
> inefficient handling of large mmap'd regions (terabytes) by the
> kernel.
Previously we detected 3 cases:
* on-device: limit to 1 process
* 64-bit: macOS & simulators, limit to 3 processes
* others (32-bit): no limitation
We checked for the 64-bit case like this: `if arch in ['x86_64',
'x86_64h']` which misses macOS running on AS. Additionally, we don't
care about 32-bit anymore, so I've simplified this to 2 cases: on-device
and everything else.
Differential Revision: https://reviews.llvm.org/D122751
Jim Ingham [Thu, 31 Mar 2022 21:11:39 +0000 (14:11 -0700)]
Add a setting to not require --overwrite to overwrite commands.
Protecting against accidental overwriting of commands is good, but
having to pass a flag to overwrite the command when developing your
commands is pretty annoying. This adds a setting to defeat the protection
so you can do this once at the start of your session and not have to
worry about it again.
Differential Revision: https://reviews.llvm.org/D122680
Artem Belevich [Thu, 31 Mar 2022 18:58:44 +0000 (11:58 -0700)]
[CUDA] Don't call inferCUDATargetForImplicitSpecialMember too early.
Otherwise we may crash because the special member has not been sufficiently set
up yet. Fixes https://github.com/llvm/llvm-project/issues/54537
Differential Revision: https://reviews.llvm.org/D122846
Matt Arsenault [Wed, 30 Mar 2022 21:30:28 +0000 (17:30 -0400)]
ARM/GlobalISel: Get pointer type from value instead of getPointerSize
Avoid using getPointerSize and pass through the original value type.
Matt Arsenault [Mon, 28 Mar 2022 15:29:08 +0000 (11:29 -0400)]
AMDGPU: Update test checks to include -NEXT
Matt Arsenault [Mon, 28 Feb 2022 23:26:41 +0000 (18:26 -0500)]
RegAllocGreedy: Fix typo
Matt Arsenault [Mon, 28 Mar 2022 18:18:48 +0000 (14:18 -0400)]
X86: Use -NEXT checks in a test
Simon Pilgrim [Thu, 31 Mar 2022 20:29:07 +0000 (21:29 +0100)]
[X86] setcc.ll - add PR39174 test case and i686 coverage
Shafik Yaghmour [Thu, 31 Mar 2022 20:20:46 +0000 (13:20 -0700)]
[LLDB] Applying clang-tidy modernize-use-equals-default over LLDB
Applied modernize-use-equals-default clang-tidy check over LLDB.
This check is already present in the lldb/.clang-tidy config.
Differential Revision: https://reviews.llvm.org/D121844
Stefan Pintilie [Thu, 31 Mar 2022 19:12:19 +0000 (14:12 -0500)]
[PowerPC] Fix lowering of byval parameters for sizes greater than 8 bytes.
To store a byval parameter the existing code would store as many 8 byte elements
as was required to store the full size of the byval parameter.
For example, a paramter of size 16 would store two element of 8 bytes.
A paramter of size 12 would also store two elements of 8 bytes.
This would sometimes store too many bytes as the size of the paramter is not
always a factor of 8.
This patch fixes that issue and now byval paramters are stored with the correct
number of bytes.
Reviewed By: nemanjai, #powerpc, quinnp, amyk
Differential Revision: https://reviews.llvm.org/D121430
Vy Nguyen [Thu, 31 Mar 2022 19:39:17 +0000 (15:39 -0400)]
[llvm-readobj] Support non 64bit platforms too
(Orignal phab: https://reviews.llvm.org/D116787)
Valentin Clement [Thu, 31 Mar 2022 19:34:55 +0000 (21:34 +0200)]
[flang] Keep fully qualified !fir.heap type for fir.freemem op
Re-introduce a fully qualified type on teh fir.freemem operation.
Since this is the only operation where the prefix gets elided in fir, this
patch make it fully qualified so the dialect syntax feels more consistent.
Reviewed By: vdonaldson
Differential Revision: https://reviews.llvm.org/D122839
Vladislav Khmelevsky [Sun, 20 Mar 2022 13:10:27 +0000 (16:10 +0300)]
[BOLT] LongJmp: Check for shouldEmit
Check that the function will be emitted in the final binary. Preserving
old function address is needed in case it is PLT trampiline, that is
currently not moved by the BOLT.
Differential Revision: https://reviews.llvm.org/D122098
Vladislav Khmelevsky [Sun, 20 Mar 2022 12:31:16 +0000 (15:31 +0300)]
[BOLT] AArch64: Emit text objects
BOLT treats aarch64 objects located in text as empty functions with
contant islands. Emit them with at least 8-byte alignment to the new
text section.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D122097
Nico Weber [Thu, 31 Mar 2022 19:25:43 +0000 (15:25 -0400)]
better syntax
Vy Nguyen [Thu, 31 Mar 2022 19:21:23 +0000 (15:21 -0400)]
[llvm-readobj] Fix forward build breakages caused by https://reviews.llvm.org/rG33b3c86afab06ad61d46456c85c0b565cfff8287
Change: use std::function instead of function_ref because it's not safe to store a function_ref
(original phab: https://reviews.llvm.org/D116787)
River Riddle [Tue, 29 Mar 2022 23:28:38 +0000 (16:28 -0700)]
[GreedPatternRewriter] Preprocess constants while building worklist when not processing top down
This avoids accidentally reversing the order of constants during successive
application, e.g. when running the canonicalizer. This helps reduce the number
of iterations, and also avoids unnecessary changes to input IR.
Fixes #51892
Differential Revision: https://reviews.llvm.org/D122692
Stefan Pintilie [Thu, 31 Mar 2022 17:46:51 +0000 (12:46 -0500)]
[PowerPC] Set the special DSCR with a compiler option.
Add a compiler option and the instructions required to set the
special Data Stream Control Register (DSCR). The special register will
not be set by default.
Original patch by: Muhammad Usman
Reviewed By: nemanjai, #powerpc
Differential Revision: https://reviews.llvm.org/D117013
Mark de Wever [Thu, 31 Mar 2022 16:55:18 +0000 (18:55 +0200)]
[libc++] Fixes calendar function visibility.
Note of the functions was marked as _LIBCPP_HIDE_FROM_ABI.
Did some minor formatting fixes to keep consistency. To keep it easy to
review not all odd formatting has been fixed.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D122834
Jonathan Peyton [Thu, 31 Mar 2022 18:37:50 +0000 (13:37 -0500)]
[OpenMP][libomp] NFC: Move omp_* functions out of kmp_* section
Vy Nguyen [Thu, 31 Mar 2022 13:36:10 +0000 (09:36 -0400)]
Reland "[llvm-readobj][MachO] Add option to sort the symbol table before dumping (MachO only, for now)."
https://reviews.llvm.org/D116787
This reverts commit
33b3c86afab06ad61d46456c85c0b565cfff8287.
New change: fixed build failures:
- in stabs-sorted:restore the the ERR-KEY statements, which were accidentally deleted during refactoring
- in ObjDumper.h/MachODumper.cpp: refactor so that current dumpers which didn't provide an impl that accept a SymCom still works
Alex Zinenko [Thu, 31 Mar 2022 18:01:12 +0000 (20:01 +0200)]
Revert "Added an empty __init__.py file to the MLIR Python bindings"
This reverts commit
b50893db528cce45e5eb8d0ce367bc5b686b5558.
Post-commit review pointed out that adding this file will require the
entire Python tree (including out-of-tree projects) to come from the
same directory, which might be problematic in non-default installations.
Reverting pending further discussion.
Florian Hahn [Thu, 31 Mar 2022 18:00:48 +0000 (19:00 +0100)]
Revert "Recommit "[LV] Remove unneeded createHeaderBranch.(NFCI)""
This reverts commit
8378a71b6cce611e01f42690713fd7b561ff3f30.
It looks like this patch uncovered another issue, e.g. see
https://lab.llvm.org/buildbot/#/builders/168/builds/5518
LLVM GN Syncbot [Thu, 31 Mar 2022 17:50:34 +0000 (17:50 +0000)]
[gn build] Port
46774df30715
Roger Kim [Thu, 31 Mar 2022 17:29:03 +0000 (13:29 -0400)]
[lld-macho][NFC] Encapsulate symbol priority implementation.
Just some code clean up.
Reviewed By: #lld-macho, int3
Differential Revision: https://reviews.llvm.org/D122752
Aaron Ballman [Thu, 31 Mar 2022 17:43:53 +0000 (13:43 -0400)]
Use functions with prototypes when appropriate; NFC
A significant number of our tests in C accidentally use functions
without prototypes. This patch converts the function signatures to have
a prototype for the situations where the test is not specific to K&R C
declarations. e.g.,
void func();
becomes
void func(void);
Paul Kirth [Tue, 29 Mar 2022 17:20:12 +0000 (17:20 +0000)]
[misexpect] Re-implement MisExpect Diagnostics
Reimplements MisExpect diagnostics from D66324 to reconstruct its
original checking methodology only using MD_prof branch_weights
metadata.
New checks rely on 2 invariants:
1) For frontend instrumentation, MD_prof branch_weights will always be
populated before llvm.expect intrinsics are lowered.
2) for IR and sample profiling, llvm.expect intrinsics will always be
lowered before branch_weights are populated from the IR profiles.
These invariants allow the checking to assume how the existing branch
weights are populated depending on the profiling method used, and emit
the correct diagnostics. If these invariants are ever invalidated, the
MisExpect related checks would need to be updated, potentially by
re-introducing MD_misexpect metadata, and ensuring it always will be
transformed the same way as branch_weights in other optimization passes.
Frontend based profiling is now enabled without using LLVM Args, by
introducing a new CodeGen option, and checking if the -Wmisexpect flag
has been passed on the command line.
Reviewed By: tejohnson
Differential Revision: https://reviews.llvm.org/D115907
Joachim Protze [Thu, 31 Mar 2022 17:31:18 +0000 (12:31 -0500)]
[OpenMP][Tools] Fix handling of initial-task-end
Latest OpenMP spec says parallel_data is NULL for initial/implicit-task-end.
We nevertheless need to cleanup the ParallelData here, as there is no other
callback for the end of the implicit parallel region. We can use the reference
stored in the TaskData.
Reviewed By: dreachem
Differential Revision: https://reviews.llvm.org/D114005
Thomas Symalla [Thu, 31 Mar 2022 10:23:38 +0000 (12:23 +0200)]
[AMDGPU] Add missing use check in SIOptimizeExecMasking pass.
Whenever a v_cmp, s_and_saveexec instruction sequence shall be
transformed to an equivalent s_mov, v_cmpx sequence, it needs
to be detected if the v_cmp target register is used between
the two instructions as the v_cmp result gets omitted by
using the v_cmpx instruction, resulting in invalid code.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D122797
Simon Pilgrim [Thu, 31 Mar 2022 17:05:19 +0000 (18:05 +0100)]
[X86] Remove redundant FIXME
lowerV64I8Shuffle has been extended a lot since this was added.
Simon Pilgrim [Thu, 31 Mar 2022 17:04:09 +0000 (18:04 +0100)]
[X86] lowerV64I8Shuffle - don't use lowerShuffleWithPERMV until we've tried simpler options
Shuffle combining will still lower to this with better fast cross lane checks.
Noticed while triaging Issue #54658
Okwan Kwon [Fri, 18 Mar 2022 16:48:34 +0000 (16:48 +0000)]
[mlir] Bubble up tensor.extract_slice above linalg operation
Bubble up extract_slice above Linalg operation.
A sequence of operations
%0 = linalg.<op> ... arg0, arg1, ...
%1 = tensor.extract_slice %0 ...
can be replaced with
%0 = tensor.extract_slice %arg0
%1 = tensor.extract_slice %arg1
%2 = linalg.<op> ... %0, %1, ...
This results in the reduce computation of the linalg operation.
The implementation uses the tiling utility functions. One difference
from the tiling process is that we don't need to insert the checking
code for the out-of-bound accesses. The use of the slice itself
represents that the code writer is sure about the boundary condition.
To avoid adding the boundary condtion check code, `omitPartialTileCheck`
is introduced for the tiling utility functions.
Differential Revision: https://reviews.llvm.org/D122437
Chris Bieneman [Thu, 31 Mar 2022 14:38:47 +0000 (09:38 -0500)]
[HLSL] Further improve to numthreads diagnostics
This adds diagnostics for conflicting attributes on the same
declarataion, conflicting attributes on a forward and final
declaration, and defines a more narrowly scoped HLSLEntry attribute
target.
Big shout out to @aaron.ballman for the great feedback and review on
this!
Abinav Puthan Purayil [Thu, 31 Mar 2022 11:03:28 +0000 (16:33 +0530)]
[AMDGPU][GlobalISel] Scalarize add/sub with overflow ops in the legalizer
Differential Revision: https://reviews.llvm.org/D122803
Abinav Puthan Purayil [Thu, 31 Mar 2022 14:05:11 +0000 (19:35 +0530)]
[AMDGPU][GlobalISel] Add end to end IR tests for add/sub with overflow
Differential Revision: https://reviews.llvm.org/D122818
Aaron Ballman [Thu, 31 Mar 2022 16:02:54 +0000 (12:02 -0400)]
Fix the build after
cd26190a10fceb6e1472fabcd9e1736f62f078c4
These variables were being used uninitialized and it caused a
significant number of test failures on Windows.
Kirill Bobyrev [Thu, 31 Mar 2022 15:58:49 +0000 (17:58 +0200)]
Revert "[clangd] IncludeCleaner: Add support for IWYU pragma private"
This reverts commit
4cb38bfe76b7ef157485338623c931d04d17b958.
Awkwardly enough, this builds Windows buildbots:
http://45.33.8.238/win/55402/step_9.txt
It is yet unclear why this is happening but I will need more time to
diagnose the issue.
Michał Górny [Thu, 31 Mar 2022 07:55:25 +0000 (09:55 +0200)]
[compiler-rt] [scudo] Use -mcrc32 on x86 when available
Update the hardware CRC32 logic in scudo to support using `-mcrc32`
instead of `-msse4.2`. The CRC32 intrinsics use the former flag
in the newer compiler versions, e.g. in clang since
12fa608af44a.
With these compilers, passing `-msse4.2` is insufficient to enable
the instructions and causes build failures when `-march` does not enable
CRC32:
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-14.0.0/work/compiler-rt/lib/scudo/scudo_crc32.cpp:20:10: error: always_inline function '_mm_crc32_u32' requires target feature 'crc32', but would be inlined into function 'computeHardwareCRC32' that is compiled without support for 'crc32'
return CRC32_INTRINSIC(Crc, Data);
^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-14.0.0/work/compiler-rt/lib/scudo/scudo_crc32.h:27:27: note: expanded from macro 'CRC32_INTRINSIC'
# define CRC32_INTRINSIC FIRST_32_SECOND_64(_mm_crc32_u32, _mm_crc32_u64)
^
/var/tmp/portage/sys-libs/compiler-rt-sanitizers-14.0.0/work/compiler-rt/lib/scudo/../sanitizer_common/sanitizer_platform.h:132:36: note: expanded from macro 'FIRST_32_SECOND_64'
# define FIRST_32_SECOND_64(a, b) (a)
^
1 error generated.
For backwards compatibility, use `-mcrc32` when available and fall back
to `-msse4.2`. The `<smmintrin.h>` header remains in use as it still
works and is compatible with GCC, while clang's `<crc32intrin.h>`
is not.
Originally reported in https://bugs.gentoo.org/835870.
Differential Revision: https://reviews.llvm.org/D122789
Siva Chandra [Thu, 31 Mar 2022 06:44:57 +0000 (23:44 -0700)]
[libc] Enable threads.h functions on aarch64.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D122788
Sven van Haastregt [Thu, 31 Mar 2022 15:41:40 +0000 (16:41 +0100)]
[OpenCL] Set MinVersion for sub_group_barrier with memory_scope
The memory_scope enum is not available before OpenCL 2.0, so ensure
the sub_group_barrier overload with a memory_scope argument is
restricted to OpenCL 2.0 and above. This is already the case in
opencl-c.h.
Fixes the issue revealed by https://reviews.llvm.org/D120254
Reported-by: Harald van Dijk (hvdijk)
Mark de Wever [Wed, 30 Mar 2022 15:30:39 +0000 (17:30 +0200)]
[libc++][ci] Installs Japanese locale in Docker.
The alternative outputs of std::put_time and std::strftime are the
easiest to test with the Japanese locale. This is a preparation for the
tests of the chrono formatters.
Note since it takes a while before the Docker file changes propagate to
the build nodes the verification of the locale is done in a separate
patch.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D122736
Mark de Wever [Sun, 27 Mar 2022 16:39:24 +0000 (18:39 +0200)]
[libc++][doc] Update formatting status.
Reduced the details of the non-chrono formatting information. This has
been shipped and these details part of P0645 which is still documented.
Removing this information keeps the information up-to-date.
Adds the formatters required for the types chrono namespace.
Reviewed By: ldionne, #libc
Differential Revision: https://reviews.llvm.org/D122735
Vince Bridgers [Mon, 24 Jan 2022 16:54:24 +0000 (10:54 -0600)]
[analyzer] Avoid checking addrspace pointers in cstring checker
This change fixes an assert that occurs in the SMT layer when refuting a
finding that uses pointers of two different sizes. This was found in a
downstream build that supports two different pointer sizes, The CString
Checker was attempting to compute an overlap for the 'to' and 'from'
pointers, where the pointers were of different sizes.
In the downstream case where this was found, a specialized memcpy
routine patterned after memcpy_special is used. The analyzer core hits
on this builtin because it matches the 'memcpy' portion of that builtin.
This cannot be duplicated in the upstream test since there are no
specialized builtins that match that pattern, but the case does
reproduce in the accompanying LIT test case. The amdgcn target was used
for this reproducer. See the documentation for AMDGPU address spaces here
https://llvm.org/docs/AMDGPUUsage.html#address-spaces.
The assert seen is:
`*Solver->getSort(LHS) == *Solver->getSort(RHS) && "AST's must have the same sort!"'
Ack to steakhal for reviewing the fix, and creating the test case.
Reviewed By: steakhal
Differential Revision: https://reviews.llvm.org/D118050
Peter Waller [Wed, 30 Mar 2022 15:04:59 +0000 (15:04 +0000)]
[AArch64][SVE] Mark {CNT*,RDVL,INDEX} as materializable
Differential Revision: https://reviews.llvm.org/D122731
Fraser Cormack [Thu, 31 Mar 2022 15:15:16 +0000 (16:15 +0100)]
[RISCV][NFC] Minor formatting fix
Jay Foad [Thu, 31 Mar 2022 15:23:21 +0000 (16:23 +0100)]
[AMDGPU] Fix typo in RUN line
Wenju He [Thu, 31 Mar 2022 15:12:29 +0000 (08:12 -0700)]
[NewPM] Add OptimizerEarly module extension point
VectorizerStart extension is module callback in old PM, but is function
callback in new PM. We lack a module extension point between end of
buildModuleSimplificationPipeline and the function optimization
(including vectorizer) pipeline. So this patch adds a new module
extension point before the function optimization pipeline.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D122296
Groverkss [Thu, 31 Mar 2022 15:09:39 +0000 (20:39 +0530)]
[MLIR][Presburger] Carry IdKind information in LinearTransform::applyTo
This patch fixes a bug in LinearTransform::applyTo where it did not carry the
IdKind information, and instead treated every id as IdKind::Domain.
Reviewed By: arjunp
Differential Revision: https://reviews.llvm.org/D122823
Nico Weber [Thu, 31 Mar 2022 15:10:18 +0000 (11:10 -0400)]
[gn build] (manually) port
19246b0779a2
David Goldman [Mon, 21 Mar 2022 17:45:21 +0000 (13:45 -0400)]
Serialize PragmaAssumeNonNullLoc to support preambles
Previously, if a `#pragma clang assume_nonnull begin` was at the
end of a premable with a `#pragma clang assume_nonnull end` at the
end of the main file, clang would diagnose an unterminated begin in
the preamble and an unbalanced end in the main file.
With this change, those errors no longer occur and the case above is
now properly handled. I've added a corresponding test to clangd,
which makes use of preambles, in order to verify this works as
expected.
Differential Revision: https://reviews.llvm.org/D122179
Changpeng Fang [Thu, 31 Mar 2022 15:06:31 +0000 (08:06 -0700)]
AMDGPU: Use isLiteralConstantLike to check whether the operand could ever be literal
Summary:
To compute the size of a VALU/SALU instruction, we need to check whether an operand
could ever be literal. Previously isLiteralConstant was used, which missed cases
like global variables or external symbols. These misses lead to under-estimation of
the instruction size and branch offset, and thus incorrectly skip the necessary branch
relaxation when the branch offset is actually greater than what the branch bits can hold.
In this work, we use isLiteralConstantLike to check the operands. It maybe conservative,
but it is safe.
Reviewers: arsenm
Differential Revision: https://reviews.llvm.org/D122778
Louis Dionne [Thu, 31 Mar 2022 14:52:52 +0000 (10:52 -0400)]
[libc++] Install psutil on the macOS nodes
Nikita Popov [Thu, 31 Mar 2022 14:44:45 +0000 (16:44 +0200)]
[X86] Add test for PR54369 (NFC)
Carlo Marcelo Arenas Belón [Thu, 31 Mar 2022 13:46:45 +0000 (13:46 +0000)]
[compiler-rt] Implement __clear_cache on FreeBSD/powerpc
dd9173420f06 (Add clear_cache implementation for ppc64. Fix buffer to
meet ppc64 alignment., 2017-07-28), adds an implementation for
__builtin___clear_cache on powerpc64, which was promptly ammended to
also be used with big endian mode in
f67036b62c0c (This ppc64 implementation
of clear_cache works for both big and little endian., 2017-08-02)
clang will use this implementation for it's builtin on FreeBSD and result
in an abort() in the cases where 32-bit generation was requested (ex in
macppc or when the big endian powerpc64 build was done with "-m32") and as
reported[1] recently with pcre2, but there is no reason why the same code
couldn't be used in those cases, so use instead the more generic identifier
for the PowerPC architecture.
While at it, update the comment to reflect that POWER8/9 have a 128 byte
wide cache line and so the code could instead use 64 byte windows instead
but that possible optimization has been punted for now.
[1] https://github.com/PhilipHazel/pcre2/issues/92
Reviewed By: jhibbits, #powerpc, MaskRay
Differential Revision: https://reviews.llvm.org/D122640
Arjun P [Thu, 31 Mar 2022 13:43:44 +0000 (14:43 +0100)]
[MLIR][Presburger] IntegerRelation::truncate: fix bug when truncating equalities
This was truncating inequalities instead of equalities.
Reviewed By: Groverkss
Differential Revision: https://reviews.llvm.org/D122811
Nikita Popov [Thu, 31 Mar 2022 14:09:34 +0000 (16:09 +0200)]
[Float2Int] Avoid unnecessary lamdbas (NFC)
Instead of first creating a lambda for calculating the range,
then collecting the ranges for the operands, and then calling the
lambda on those ranges, we can first calculate the operand ranges
and then calculate the result directly in the switch.
Nikita Popov [Thu, 31 Mar 2022 14:06:46 +0000 (16:06 +0200)]
[Float2Int] Extract calcRange() method (NFC)
This avoids the awkward "Abort" flag, because we can simply
early-return instead.
Arjun P [Thu, 31 Mar 2022 11:34:33 +0000 (12:34 +0100)]
[MLIR][Presburger] MultiAffineFunction:eliminateRedundantLocalId: fix bug where local offset was not considered
Previously, when updating the outputs matrix, the local offset was not being considered.
Reviewed By: Groverkss
Differential Revision: https://reviews.llvm.org/D122812
Florian Hahn [Thu, 31 Mar 2022 12:31:34 +0000 (13:31 +0100)]
Recommit "[LV] Remove unneeded createHeaderBranch.(NFCI)"
This reverts the revert commit
2760cdc9c6.
This version pulls in the code to create the vector loop object in VPlan
from D121624.
This is needed because otherwise existing LoopInfo verification will
fail, as a loop block doesn't have in-loop successors now that we
do not replace the branch.
Now that we do not add new loops during skeleton construction, there's
also no need to verify LI there.
Louis Dionne [Wed, 23 Mar 2022 17:17:06 +0000 (13:17 -0400)]
[libc++] Remove the __libcpp_version file
It seems to have been added back in
761e42fa3dd72 for Clang to use it,
however it seems to have never been used for that purpose, so it is
probably fine to remove it.
Differential Revision: https://reviews.llvm.org/D122330
Vy Nguyen [Thu, 31 Mar 2022 13:33:04 +0000 (09:33 -0400)]
Revert "[llvm-readobj][MachO] Add option to sort the symbol table before dumping (MachO only, for now)."
This reverts commit
ea9cf2dc96c765773ee574a9189d529175a57751.
Broke LLDB - reverting to investigage
Louis Dionne [Wed, 2 Mar 2022 22:49:13 +0000 (17:49 -0500)]
[libc++] Add a CI job running MSAN
For some reason, we've been going without a MSAN CI job, even though
even run-buildbot defined a generic-msan job. This must have been an
oversight that went unnoticed. Thanks to @EricWF for the catch.
Differential Revision: https://reviews.llvm.org/D120851
Yitzhak Mandelbaum [Mon, 21 Mar 2022 20:37:04 +0000 (20:37 +0000)]
[clang][dataflow] Add support for `value_or` in a comparison.
This patch adds limited modeling of the `value_or` method. Specifically, when
used in a particular idiom in a comparison to implicitly check whether the
optional holds a value.
Differential Revision: https://reviews.llvm.org/D122231
Sanjay Patel [Thu, 31 Mar 2022 12:21:28 +0000 (08:21 -0400)]
[x86] try to replace 0.0 in fcmp with negated operand
This inverts a fold recently added to IR with:
3491f2f4b033
We can put -bidirectional on the Alive2 examples to show that
the reverse transforms work:
https://alive2.llvm.org/ce/z/8iVQwB
The motivation for the IR change was to improve matching to
'fabs' in IR (see https://github.com/llvm/llvm-project/issues/38828 ),
but it regressed x86 codegen for 'not-quite-fabs' patterns like
(X > -X) ? X : -X.
Ie, when there is no fast-math (nsz), the cmp+select is not a proper
fabs operation, but it does map nicely to the unusual NAN semantics
of MINSS/MAXSS.
I drafted this as a target-independent fold, but it doesn't appear to
help any other targets and seems to cause regressions for SystemZ at
least.
Differential Revision: https://reviews.llvm.org/D122726
Vy Nguyen [Tue, 22 Mar 2022 22:55:15 +0000 (18:55 -0400)]
[llvm-readobj][MachO] Add option to sort the symbol table before dumping (MachO only, for now).
This would help making tests less brittle as the order will be fixed.
(see also PR/53026)
Differential Revision: https://reviews.llvm.org/D116787
Jay Foad [Tue, 29 Mar 2022 16:06:50 +0000 (17:06 +0100)]
[AMDGPU] Fix last remaining checks in perfhint.ll
Unfortunately this just shows that the test case for D47740 never
really tested what it was supposed to test.
Differential Revision: https://reviews.llvm.org/D122664
Fraser Cormack [Thu, 31 Mar 2022 12:17:11 +0000 (13:17 +0100)]
[RISCV][NFC] Fix formatting on one line
Sergei Lebedev [Thu, 31 Mar 2022 12:27:49 +0000 (14:27 +0200)]
Fixed the type of context in type stubs for MLIR Python bindings
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D122795
Abinav Puthan Purayil [Thu, 31 Mar 2022 10:18:50 +0000 (15:48 +0530)]
[AMDGPU] Regenerate checks in some mir tests
Serge Pavlov [Fri, 1 Nov 2019 13:49:35 +0000 (20:49 +0700)]
Implement inlining of strictfp functions
According to the current design, if a floating point operation is
represented by a constrained intrinsic somewhere in a function, all
floating point operations in the function must be represented by
constrained intrinsics. It imposes additional requirements to inlining
mechanism. If non-strictfp function is inlined into strictfp function,
all ordinary FP operations must be replaced with their constrained
counterparts.
Inlining strictfp function into non-strictfp is not implemented as it
would require replacement of all FP operations in the host function,
which now is undesirable due to expected performance loss.
Differential Revision: https://reviews.llvm.org/D69798
Alexandros Lamprineas [Thu, 31 Mar 2022 11:00:00 +0000 (12:00 +0100)]
[FuncSpec] Constant propagate multiple arguments for recursive functions.
This fixes a TODO in constantArgPropagation() to make it feature complete.
However, I do find myself in agreement with the review comments in
https://reviews.llvm.org/D106426. I don't think we should pursue
specializing such recursive functions as the code size increase becomes
linear to 'max-iters'. Compiling the modified test just with -O3 (no
function specialization) generates the same code.
Differential Revision: https://reviews.llvm.org/D122755
Priyansh Singh [Thu, 31 Mar 2022 11:35:40 +0000 (07:35 -0400)]
Fixed minor documentation issues
Fixed whitespace and punctuation issues, added a name to a link, and
fixed a typo.
Florian Hahn [Thu, 31 Mar 2022 11:32:50 +0000 (12:32 +0100)]
Revert "[LV] Remove unneeded createHeaderBranch.(NFCI)"
This reverts commit
32bc83d11e19b8a8c15df81b32fde1f9f8c6156b.
This is causing bots with expensive-checks to fail. Revert while I
investigate.
Abinav Puthan Purayil [Thu, 31 Mar 2022 11:14:54 +0000 (16:44 +0530)]
[AMDGPU][GlobalISel] Remove unused variable. NFC.
Luo, Yuanke [Wed, 30 Mar 2022 08:45:15 +0000 (16:45 +0800)]
[X86][AMX] Materialize undef or zero value to tilezero
The AMX combiner would store undef or zero to stack and invoke tileload
to load the data to tile register. To avoid the store/load, we can
materialzie undef or zero value to tilezero.
Differential Revision: https://reviews.llvm.org/D122714