Nikita Popov [Sat, 18 Dec 2021 19:40:42 +0000 (20:40 +0100)]
Revert "[ConstantFolding] Unify handling of load from uniform value"
This reverts commit
9fd4f80e33a4ae4567483819646650f5735286e2.
This breaks SingleSource/Regression/C/gcc-c-torture/execute/pr19687.c
in test-suite. Either the test is incorrect, or clang is generating
incorrect union initialization code. I've submitted
https://reviews.llvm.org/D115994 to fix the test, assuming my
interpretation is correct. Reverting this in the meantime as it
may take some time to resolve.
Martin Storsjö [Thu, 9 Dec 2021 21:40:25 +0000 (23:40 +0200)]
[lit] Flush stderr manually on Windows after printing messages
When run in a git bash terminal, sys.stderr isn't flushed implicitly
after printing each line. Manually flush it after each printout,
to avoid getting broken/misordered output.
A similar fix had been done in the old libcxx test config, committed
as part of
7e3ee09ad24cbca3ea7687c50b53be5269127fb1 / D28725; this
generalizes the fix, making it available in the new libcxx test
configs too, and for any other test that uses lit_config.note().
Differential Revision: https://reviews.llvm.org/D115761
Cyndy Ishida [Sat, 18 Dec 2021 17:42:40 +0000 (09:42 -0800)]
[llvm-tapi-diff] Replicate diff utility error handling
For scripting purposes, use different error code for cases that aren't a
result of different tbd files, e.g. bad input like a path to a broken
symlink. This behaves more similiarly to how the unix `diff` command behaves.
This also includes minor tweaks on error messages.
Reviewed By: ributzka, JDevlieghere
Differential Revision: https://reviews.llvm.org/D115905
Ricky Zhou [Sat, 18 Dec 2021 17:49:17 +0000 (18:49 +0100)]
[AA] Handle callbr instructions in alias analysis
Before this change, AAResults::getModRefInfo() was missing a case for
callbr instructions (asm goto), which may read/write memory. In PR52735,
this led to a miscompile where a load was incorrect eliminated.
Add this missing case, as well as an assert verifying that all
memory-accessing instructions are handled properly.
Fixes #52735.
Differential Revision: https://reviews.llvm.org/D115992
Nikita Popov [Sat, 18 Dec 2021 16:55:39 +0000 (17:55 +0100)]
[LLParser] Avoid unnecessary AttrBuilder<->AttributeSet roundtrip (NFC)
This was creating an AttributeSet from an AttrBuilder, and then
(implicitly) constructing an AttrBuilder from the AttributeSet,
and then the method would internally convert that back into an
AttributeSet. Instead, directly pass the AttrBuilder.
Matt Arsenault [Sat, 18 Dec 2021 16:36:43 +0000 (11:36 -0500)]
AMDGPU: Regenerate more mir test checks with -NEXT
Matt Arsenault [Sat, 18 Dec 2021 15:07:00 +0000 (10:07 -0500)]
AMDGPU: Regenerate some mir test checks with -NEXT
mydeveloperday [Sat, 18 Dec 2021 14:10:14 +0000 (14:10 +0000)]
[clang-format] extern with new line brace without indentation
https://github.com/llvm/llvm-project/issues/49804
Interaction between IndentExternBlock and AfterExternBlock means you cannot have AfterExternBlock = true and IndentExternBlock = NoIndent/Indent
This patch resolves that
```
BraceWrapping:
AfterExternBlock: true
IndentExternBlock: AfterExternBlock
```
Fixes: #49804
Reviewed By: HazardyKnusperkeks, curdeius, owenpan
Differential Revision: https://reviews.llvm.org/D115879
Konstantin Boyarinov [Sat, 18 Dec 2021 13:05:16 +0000 (16:05 +0300)]
[libcxx][test][NFC] noexcept tests for std::array
Minor change - add tests that std::array methods (data, (c/r)begin,
(c/r)end) are noexcept
Reviewed By: ldionne, rarutyun, #libc
Differential Revision: https://reviews.llvm.org/D115717
mydeveloperday [Fri, 17 Dec 2021 18:33:17 +0000 (18:33 +0000)]
[clang-format] Extra spaces surrounding arrow in templated member call in variable decl
https://github.com/llvm/llvm-project/issues/43196
Fixes #43196
-> is incorrectly interpreted as a TrailingReturnArrow if we've seen an auto
```
auto p = new A;
auto x = p -> foo<1>();
```
Reviewed By: curdeius
Differential Revision: https://reviews.llvm.org/D115903
Nikita Popov [Sat, 18 Dec 2021 08:11:33 +0000 (09:11 +0100)]
Revert "[DSE] Remove calls with known writes to dead memory"
This reverts commit
a8a51fe55649f5e07f9f2973507dc20bc4e40765.
This breaks the strncpy-overflow.cpp test case.
Fangrui Song [Sat, 18 Dec 2021 07:30:42 +0000 (23:30 -0800)]
[ELF] Parallelize MergeNoTailSection::writeTo
With this patch, writing .debug_str is significantly for a program with
1.5G .debug_str:
* .debug_info 1.22s
* .debug_str 2.57s decreases to 0.66
Kazu Hirata [Sat, 18 Dec 2021 04:55:10 +0000 (20:55 -0800)]
[clang] Strip redundant lambda (NFC)
Fangrui Song [Sat, 18 Dec 2021 03:22:15 +0000 (19:22 -0800)]
[ELF] Use SmallVector for many SyntheticSections. NFC
This decreases struct sizes and usually decreases the lld executable
size (39KiB for my x86-64 executable) (unless in some cases smaller
SmallVector leads to more inlining, e.g. StringTableBuilder).
For --gdb-index, there may be memory usage saving.
Joshua Huels [Sat, 18 Dec 2021 02:37:55 +0000 (18:37 -0800)]
[doc] Fix regex in ClangFormatStyleOptions for IncludeCategories
This fixes the regex in ClangFormatStyleOptions for IncludeCategories
to match anything starting with < or starting with | AND followed by
(gtest|gmock|isl|json) then /.
Differential Revision: https://reviews.llvm.org/D115910
Kazu Hirata [Sat, 18 Dec 2021 02:19:24 +0000 (18:19 -0800)]
Use DenseMap::lookup (NFC)
Jonas Devlieghere [Fri, 17 Dec 2021 22:45:24 +0000 (14:45 -0800)]
[lldb] Remove reproducer replay functionality
This is part of a bigger rework of the reproducer feature. See [1] for
more details.
[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
Kazu Hirata [Sat, 18 Dec 2021 00:51:42 +0000 (16:51 -0800)]
[clang] Use llvm::reverse (NFC)
Yuanfang Chen [Sat, 18 Dec 2021 00:26:08 +0000 (16:26 -0800)]
WinMsvc.cmake: try lower-case include/lib when searching for windows SDK
if the pascal case ones failed. Some tools, like msvc-wine/xwin, use the
lower case.
Julian Lettner [Thu, 16 Dec 2021 03:33:51 +0000 (19:33 -0800)]
[TSan][Darwin] Fix shadow mapping for iOS simulator on Apple Silicon
With the introduction of Apple Silicon `defined(__aarch64__)` is not a
reliable way to check for the platform anymore.
We want to use the "normal" `Mapping48AddressSpace` mapping everywhere
except devices, including the iOS simulators on AS.
Relevant revisions:
https://reviews.llvm.org/D35147
https://reviews.llvm.org/D86377
https://reviews.llvm.org/D107743
https://reviews.llvm.org/D107888
Differential Revision: https://reviews.llvm.org/D115843
Julian Lettner [Fri, 17 Dec 2021 03:33:12 +0000 (19:33 -0800)]
[TSan][Darwin] Make malloc_size interceptor more robust
Previously we would crash in the TSan runtime if the user program passes
a pointer to `malloc_size()` that doesn't point into app memory.
In these cases, `malloc_size()` should return 0.
For ASan, we fixed a similar issue here:
https://reviews.llvm.org/D15008
Radar-Id: rdar://problem/
86213149
Differential Revision: https://reviews.llvm.org/D115947
Vitaly Buka [Fri, 17 Dec 2021 23:03:57 +0000 (15:03 -0800)]
[runtimes] Remove LLVM_ENABLE_LLD
It was added D115852 and related patches and it brakes https://lab.llvm.org/buildbot/#/builders/fuchsia-x86_64-linux
Kazu Hirata [Fri, 17 Dec 2021 22:34:30 +0000 (14:34 -0800)]
[Hexagon] Use is_contained (NFC)
Jon Chesterfield [Fri, 17 Dec 2021 22:23:56 +0000 (22:23 +0000)]
[libomptarget][nfc] Refactor dlwrap.h for easier reuse in D115966 and upcoming patches
Ellis Hoag [Fri, 17 Dec 2021 21:44:16 +0000 (13:44 -0800)]
[InstrProf][NFC] Require zlib for debug info tests
There was a build failure on the `instrprof-debug-info-correlate.c` test
because zlib was missing so we need to require it to run the test.
Differential Revision: https://reviews.llvm.org/D115970
Marek Kurdej [Fri, 17 Dec 2021 22:02:16 +0000 (23:02 +0100)]
[clang-format] Refactor common handling of attributes. NFC.
Reviewed By: MyDeveloperDay
Differential Revision: https://reviews.llvm.org/D115968
Kazu Hirata [Fri, 17 Dec 2021 21:48:56 +0000 (13:48 -0800)]
[llvm] Use none_of instead of \!any_of (NFC)
Philip Reames [Fri, 17 Dec 2021 21:41:25 +0000 (13:41 -0800)]
[DSE] Remove calls with known writes to dead memory
The majority of this change is sinking logic from instcombine into MemoryLocation such that it can be generically reused. If we have a call with a single analyzable write to an argument, we can treat that as-if it were a store of unknown size.
Merging the code in this was unblocks DSE in the store to dead memory code paths. In theory, it should also enable classic DSE of such calls, but the code appears to not know how to use object sizes to refine unknown access bounds (yet).
In addition, this does make the isAllocRemovable path slightly stronger by reusing the libfunc and additional intrinsics bits which are already in getForDest.
Differential Revision: https://reviews.llvm.org/D115904
Vy Nguyen [Wed, 15 Dec 2021 02:07:06 +0000 (21:07 -0500)]
[lld-macho] Handle $ld$hide[$os] symbols.
PR/52708
Differential Revision: https://reviews.llvm.org/D115775
Vitaly Buka [Fri, 17 Dec 2021 21:36:25 +0000 (13:36 -0800)]
[runtimes] Fix type on flag name in D115852
Sanjay Patel [Fri, 17 Dec 2021 15:58:48 +0000 (10:58 -0500)]
[SDAG] remove FP-to-int cast attribute check in fold to FTRUNC
We were using a function attribute to indicate a non-standard FP mode,
but now we can use intrinsics for that job as shown in the new tests.
Presumably the x86 asm could be improved for that IR with intrinsics,
but I have not worked out exactly how to do that. Note that the
transform to FTRUNC still requires a hacky check for "nsz" (because
FMF are not applied to FP casts).
This is a cleanup based on the clang change in D115804 /
8c7f2a4f87192 .
This is effectively a revert of
5a90285bd98d2 + D46237 .
Differential Revision: https://reviews.llvm.org/D115885
Jacques Pienaar [Fri, 17 Dec 2021 20:55:44 +0000 (12:55 -0800)]
[mlir][vscode] Highlight inside c++ raw strings
Within C++ raw strings with mlir delimitter use MLIR syntax.
Reviewed By: mehdi_amini
Differential Revision: https://reviews.llvm.org/D115963
Alexey Bataev [Fri, 17 Dec 2021 20:41:47 +0000 (12:41 -0800)]
[SLP][NFC]Adjust type in debug output loop.
The ReuseShuffleIndices indeces are integer, not unsigned, need to fix
the type in the debug print loop.
Philip Reames [Fri, 17 Dec 2021 20:42:42 +0000 (12:42 -0800)]
[tests] Precommit tests from D115904
Nico Weber [Fri, 17 Dec 2021 17:35:52 +0000 (12:35 -0500)]
[lld/mac] Don't lose "weak ref" bit when doing LTO
Fixes #52778.
Probably fixes Chromium crashing on startup on macOS 10.15 (and older) systems
when building with LTO, but I haven't verified that yet.
Differential Revision: https://reviews.llvm.org/D115949
Jonas Devlieghere [Fri, 17 Dec 2021 20:18:22 +0000 (12:18 -0800)]
[lldb] Remove --reproducer-finalize and associated functionality
This is part of a bigger rework of the reproducer feature. See [1] for
more details.
[1] https://lists.llvm.org/pipermail/lldb-dev/2021-September/017045.html
Greg Clayton [Fri, 17 Dec 2021 20:14:44 +0000 (12:14 -0800)]
Fix macOS buildbots after https://reviews.llvm.org/D115324.
The test was attempting to make a universal x86_64/arm64 binary, but some older bots don't have a macOS SDK that can handle this. Switching over to using a yaml file instead should solve the problem.
Alexey Bataev [Fri, 17 Dec 2021 18:57:44 +0000 (10:57 -0800)]
[SLP][NFC]Use 'llvm::copy' instead of element-by-elemen copying.
Nikita Popov [Fri, 17 Dec 2021 19:44:15 +0000 (20:44 +0100)]
[DSE] Make isRemovable() for calls more robust (NFCI)
We can only drop calls if they have an analyzable write, the return
value is not used, they don't throw and they don't diverge. The last
two conditions were previously not checked, because all the libcalls
with analyzable writes already happened to satisfy those conditions
anyway. This may not be true for generalizations (with D115904 in mind).
No test changes because the necessary attributes are already inferred
for currently supported libcalls.
Differential Revision: https://reviews.llvm.org/D115962
Nikita Popov [Fri, 17 Dec 2021 19:25:32 +0000 (20:25 +0100)]
[Bitcode] Avoid setting invalid comdat pointer (NFC)
Instead track global objects with implicit comdat in a separate
set. The current approach of temporarily assigning an invalid
comdat pointer is incompatible with D115864.
LLVM GN Syncbot [Fri, 17 Dec 2021 18:52:31 +0000 (18:52 +0000)]
[gn build] Port
65d7fd0239bf
Kazu Hirata [Fri, 17 Dec 2021 18:51:39 +0000 (10:51 -0800)]
[llvm] Strip redundant lambda (NFC)
Jon Chesterfield [Fri, 17 Dec 2021 18:32:17 +0000 (18:32 +0000)]
[openmp][amdgpu][nfc] Mark all external functions extern C to get type checking
Ellis Hoag [Thu, 16 Dec 2021 22:45:54 +0000 (14:45 -0800)]
[Try2][InstrProf] Add Correlator class to read debug info
Extend `llvm-profdata` to read in a `.proflite` file and also a debug info file to generate a normal `.profdata` profile. This reduces the binary size by 8.4% when building an instrumented Clang binary without value profiling (164 MB vs 179 MB).
This work is part of the "lightweight instrumentation" RFC: https://groups.google.com/g/llvm-dev/c/r03Z6JoN7d4
This was first landed in https://reviews.llvm.org/D114566 but had to be reverted due to build errors.
Reviewed By: kyulee
Differential Revision: https://reviews.llvm.org/D115915
Peter Stys [Fri, 17 Dec 2021 18:26:29 +0000 (10:26 -0800)]
[clang-format] Fix formatting of the code that follows C# Lambda Expressions
The alignment fix introduced by https://reviews.llvm.org/D104388 caused a regression whereby formatting of code that follows the lambda block is incorrect i.e. separate expressions are put on the same line.
Differential Revision: https://reviews.llvm.org/D115738
LLVM GN Syncbot [Fri, 17 Dec 2021 18:41:48 +0000 (18:41 +0000)]
[gn build] Port
cc324af0d64c
Martin Storsjö [Fri, 17 Dec 2021 18:37:25 +0000 (20:37 +0200)]
Revert "Port __sanitizer::StopTheWorld to Windows"
This reverts commit
3f5f687e2e8bf8b68c8a6ae0e000a8a78bfa70e5.
That commit broke building for mingw, where the sanitizers are
built with -nostdinc++, while the added source file includes
the C++ standard library's <algorithm>.
Additionally, the new code fails to build for i386, as it
unconditionally uses the CONTEXT member Rsp.
Tue Ly [Fri, 17 Dec 2021 18:30:41 +0000 (13:30 -0500)]
[libc][Obvious] Change func_ to <func>_ in add_math_function.md.
mydeveloperday [Fri, 17 Dec 2021 18:26:55 +0000 (18:26 +0000)]
[clang-format] Formatter does not handle c++11 string literal prefix with stringize #
https://github.com/llvm/llvm-project/issues/27740
Ensure
```
```
behave the same as
```
```
when formatted, ensure clang-format follows the conventions for `L` `u` `U` `u8`
https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp?redirectedfrom=MSDN&view=msvc-170
Fixes #27740
Reviewed By: curdeius, owenpan
Differential Revision: https://reviews.llvm.org/D115938
Alexey Bataev [Thu, 16 Dec 2021 21:25:24 +0000 (13:25 -0800)]
[OPENMP]Look through member function call base during implicit DSA analysis.
Need to look through the base of the member function calls at the DSA
analysis stage to correctly capture implicit class instances.
Differential Revision: https://reviews.llvm.org/D115902
Kazu Hirata [Fri, 17 Dec 2021 18:11:08 +0000 (10:11 -0800)]
[Target] Use range-based for loops (NFC)
Philip Reames [Fri, 17 Dec 2021 17:52:05 +0000 (09:52 -0800)]
[funcattrs] Use early return to clarify code in determinePointerAccessAttrs [NFC]
Instead of having the speculative path be the untaken path in the branch, explicitly have it return. This does require tail duplicating one call, but the resulting code is shorter and easier to understand. Also rewrite the condition using appropriate accessors.
Deepak Eachempati [Fri, 17 Dec 2021 17:44:46 +0000 (11:44 -0600)]
[OpenMP][NFC] update status for 5.1 'fail' atomic extension
Update status for the atomic 'fail' clause to "worked on".
Reviewed By: cchen
Differential Revision: https://reviews.llvm.org/D115901
Kazu Hirata [Fri, 17 Dec 2021 17:43:42 +0000 (09:43 -0800)]
[CodeGen] Fix an unused variable warning
This patch fixes:
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22617:11: error:
unused variable 'Ops' [-Werror,-Wunused-variable]
Philip Reames [Fri, 17 Dec 2021 17:34:40 +0000 (09:34 -0800)]
[funcattrs] Use getDataOperandNo where appropriate [NFC]
We'd manually duplicated the same logic and assertions; we can use the utility instead.
Simon Pilgrim [Fri, 17 Dec 2021 17:31:39 +0000 (17:31 +0000)]
Fix MSVC shadow variable warning. NFC.
Simon Pilgrim [Fri, 17 Dec 2021 17:22:10 +0000 (17:22 +0000)]
[DAG] SimplifyVBinOp - remove FoldConstantArithmetic call.
Constant folding (scalar/vector) is now consistently handled before the SimplifyVBinOp calls.
Philip Reames [Fri, 17 Dec 2021 17:20:10 +0000 (09:20 -0800)]
[capturetracking] Explicitly check for callee operand [NFC]
Pull out an explicit check rather than relying on the fact that the callee operand is not a data operand. The only real value is it gives us a clear place to move the comment, and makes the code slightly more understandable.
Craig Topper [Fri, 17 Dec 2021 16:58:28 +0000 (08:58 -0800)]
[RISCV} Add FSGNJ_H to isAsCheapAsAMove and isCopyInstrImpl.
This matches FSGNJ_S and FSGNJ_D.
Simon Pilgrim [Fri, 17 Dec 2021 17:01:17 +0000 (17:01 +0000)]
[DAG] Constant fold + canonicalize fp binops before SimplifyVBinOp call
Replace custom constant scalar/splat folding with FoldConstantArithmetic call and canonicalize commutative constant ops to the RHS before the SimplifyVBinOp call
Louis Dionne [Thu, 16 Dec 2021 21:59:56 +0000 (16:59 -0500)]
[libc++] Add a bunch of missing inline and _LIBCPP_HIDE_FROM_ABI in __threading_support
The inline keyword is required on those functions because they are defined
in the headers, so we need them to be inline to avoid ODR violations.
While we're at it, slap _LIBCPP_HIDE_FROM_ABI on them because they are
implementation details and we don't want them to be part of our ABI under
any circumstances.
Differential Revision: https://reviews.llvm.org/D115906
Philip Reames [Fri, 17 Dec 2021 16:32:43 +0000 (08:32 -0800)]
[funcattrs] Consistently treat calling a function pointer as a non-capturing read
We were being wildly inconsistent about what memory access was implied by an indirect function call. Depending on the call site attributes, you could get anything from a read, to unknown, to none at all. (The last was a miscompile.)
We were also always traversing the uses of a readonly indirect call. This is entirely unneeded as the indirect call does not capture. The callee might capture itself internally, but that has no implications for this caller. (See the nice explanation in the CaptureTracking comments if that case is confusing.)
Note that elsewhere in the same file, we were correctly computing the nocapture attribute for indirect calls. The changed case only resulted in conservatism when computing memory attributes if say the return value was written to.
Differential Revision: https://reviews.llvm.org/D115916
David Truby [Fri, 17 Dec 2021 15:46:19 +0000 (15:46 +0000)]
[AArch64][SVE] Improve code generation for VLS i1 masks
This patch partially resolves an issue for VLS code generation
where a mask is generated from a smaller width integer comparison
than the instruction using the mask requires.
Instead of sign extending a p register by converting it to a z
register, extending that, and converting back, we instead just
do an unpack of the p register.
A separate issue causes the code generation to still be poor when
the mask generation would fit in a neon register, as we then use
a neon comparison operation and have to convert that to a p register.
This will be resolved in a separate patch.
Reviewed By: peterwaller-arm
Differential Revision: https://reviews.llvm.org/D111221
Simon Pilgrim [Fri, 17 Dec 2021 16:00:30 +0000 (16:00 +0000)]
[DAG] Move foldConstantFPMath() inside FoldConstantArithmetic
Further merging of integer and fp constant folding paths.
This allows us to handle undef vector arguments the same as scalar cases.
Simon Pilgrim [Fri, 17 Dec 2021 15:54:53 +0000 (15:54 +0000)]
[X86] Rename funnel-shift X32 check prefixes to X86
We try to use X32 for gnux32 triple checks only
Simon Pilgrim [Fri, 17 Dec 2021 15:53:26 +0000 (15:53 +0000)]
[X86] Rename lzcnt/tzcnt X32 check prefixes to X86
We try to use X32 for gnux32 triple checks only
Nikita Popov [Fri, 17 Dec 2021 09:31:50 +0000 (10:31 +0100)]
[ConstantFolding] Unify handling of load from uniform value
There are a number of places that specially handle loads from a
uniform value where all the bits are the same (zero, one, undef,
poison), because we a) don't care about the load offset in that
case and b) it bypasses casts that might not be legal generally
but do work with uniform values.
We had multiple implementations of this, with a different set of
supported values each time, as well as incomplete type checks in
some cases. In particular, this fixes the assertion reported in
https://reviews.llvm.org/D114889#3198921, as well as a similar
assertion that could be triggered via constant folding.
Differential Revision: https://reviews.llvm.org/D115924
Carlo Bertolli [Fri, 17 Dec 2021 15:56:57 +0000 (15:56 +0000)]
[OpenMP][libomptarget] Fix __tgt_rtl_run_target_team_region_async API with missing parameter
I missed the async info parameter in the first version of this API.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D115887
Sanjay Patel [Fri, 17 Dec 2021 15:38:43 +0000 (10:38 -0500)]
[x86] add RUN line to test file for 32-bit target; NFC
More coverage for D115885
Momchil Velikov [Fri, 17 Dec 2021 15:07:19 +0000 (15:07 +0000)]
[AA] Correctly maintain the sign of PartiaAlias offset
Preserve the invariant that offset reported in the case of a
`PartialAlias` between `Loc1` and `Loc2`, is such that
`Loc1 + Offset = Loc2`, where `Loc1` and `Loc2` are the first and
the second argument, respectively, in alias queries.
Differential Revision: https://reviews.llvm.org/D115927
Simon Pilgrim [Fri, 17 Dec 2021 15:19:13 +0000 (15:19 +0000)]
[DAG] foldConstantFPMath - fold vector splats as well as scalar constants
Simon Pilgrim [Fri, 17 Dec 2021 15:03:31 +0000 (15:03 +0000)]
Revert rG22dbc7a48bf7a3942a7e5ff57977ef828d240bd3 "[DAG] foldConstantFPMath - fold vector splats as well as scalar constants"
A followup patch uncovered an issue with allowing undef elements in the splat - I will reapply this with a fixed implementation.
Nikita Popov [Fri, 17 Dec 2021 15:12:07 +0000 (16:12 +0100)]
[CodeGen] Fix element type for sret argument
Fix a mistake in
9bf917394eba3ba4df77cc17690c6d04f4e9d57f: sret
arguments use ConvertType, not ConvertTypeForMem, see the handling
in CodeGenTypes::GetFunctionType().
This fixes fp-matrix-pragma.c on s390x.
Benjamin Kramer [Fri, 17 Dec 2021 15:05:40 +0000 (16:05 +0100)]
Silence unused variable warning in release builds
lldb/source/Core/DataFileCache.cpp:278:10: warning: unused variable 'pos' [-Wunused-variable]
auto pos = m_string_to_offset.find(s);
^
lldb/source/Core/DataFileCache.cpp:277:18: warning: unused variable 'stroff' [-Wunused-variable]
const size_t stroff = encoder.GetByteSize() - strtab_offset;
^
Matthew Devereau [Thu, 19 Aug 2021 10:42:20 +0000 (11:42 +0100)]
[AArch64][SVE] Teach cost model that masked loads/stores are cheap
Reduce the cost of VLS masked loads/stores to make the vectorizor emit them more frequently.
David Truby [Fri, 17 Dec 2021 14:46:49 +0000 (14:46 +0000)]
[DAG][sve] Lowering for VLS masked truncating stores
This extends the custom lowering for truncating stores on
fixed length vectors in SVE to support masked truncating stores.
It also adds a DAG combine for truncates followed by masked
stores.
Reviewed By: peterwaller-arm, paulwalker-arm
Differential Revision: https://reviews.llvm.org/D108115
Nico Weber [Fri, 17 Dec 2021 15:02:26 +0000 (10:02 -0500)]
[gn build] (manually) port
fb9a075c813c5
Nico Weber [Fri, 17 Dec 2021 14:50:59 +0000 (09:50 -0500)]
[lld/test] List one test dep per line
Matches llvm's and clang's /test/CMakeLists.txt, makes it easier to
see in diffs which deps get added, and makes it easier to see if
a given dependency is present or not.
No behavior change.
Nico Weber [Fri, 17 Dec 2021 14:36:16 +0000 (09:36 -0500)]
[asan/mac] Fix remaining -Wformat warnings
AARCH64_GET_REG() is used to initialize uptrs, and after D79132
the ptrauth branch of its implementation explicitly casts to uptr.
The non-ptrauth branch returns ucontext->uc_mcontext->__ss.__fp (etc),
which has either type void* or __uint64_t (ref usr/include/mach/arm/_structs.h)
where __uint64_t is a unsigned long long (ref usr/include/arm/_types.h).
uptr is an unsigned long (ref
compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h). So explicitly
cast to uptr in this branch as well, so that AARCH64_GET_REG() has a
well-defined type.
Then change DUMPREGA64() tu use %lx instead of %llx since that's the right type
for uptr. (Most other places in compiler-rt print uptrs as %p and cast the arg
to (void*), but there are explicit 0x%016 format strings in the surroundings,
so be locally consistent with that.)
No behavior change, in the end it's just 64-bit unsigneds by slightly different
names.
Simon Pilgrim [Fri, 17 Dec 2021 14:24:26 +0000 (14:24 +0000)]
[DAG] foldConstantFPMath - fold vector splats as well as scalar constants
Nico Weber [Fri, 17 Dec 2021 14:16:07 +0000 (09:16 -0500)]
[asan/mac] Fix a few -Wformat warnings
All other places cast uptrs to (void*) when printing it via
%p after D113099, so do that here too.
Nico Weber [Fri, 17 Dec 2021 14:15:06 +0000 (09:15 -0500)]
[asan/mac] Fix a -Wformat warning
internal_getpid() is manually cast to int in all other places that
pass its result to a printf string, so do that here too for now.
Erich Keane [Mon, 13 Dec 2021 16:40:03 +0000 (08:40 -0800)]
Implement some constexpr vector unary operators, fix boolean-ops
As requested in the review, this implements unary +,-,~, and ! for
vector types.
All of our boolean operations on vector types should be using something
like vcmpeqd, which results in a mask of '-1' for the 'truth' type. We are
currently instead using '1', which results in some incorrect
calculations when used later (note that it does NOT result in a boolean
vector, as that is not really a thing).
This patch corrects that 1 to be a -1, and updates the affected tests.
Differential Revision: https://reviews.llvm.org/D115670
Simon Pilgrim [Fri, 17 Dec 2021 13:59:19 +0000 (13:59 +0000)]
[AArch64] Regenerate concat_vector-truncate-combine.ll tests
Paul Walker [Thu, 9 Dec 2021 18:30:22 +0000 (18:30 +0000)]
[NFC][SVE] Add missing tests for i32 INC/DEC patterns.
D111441 included trunc isel patterns for sve_int_pred_pattern_a
but no accompanying tests. This patch adds the missing tests and
also simplifies the isel patterns that use sve_cnt_shl_imm.
Differential Revision: https://reviews.llvm.org/D115512
Jan Svoboda [Fri, 17 Dec 2021 12:00:52 +0000 (13:00 +0100)]
[clang][deps] NFC: Unify ErrorOr patterns
This patch canonicalized some code into repetitive ErrorOr pattern. This will make refactoring easier if we ever come up with a way to simplify this.
Jan Svoboda [Fri, 17 Dec 2021 12:02:34 +0000 (13:02 +0100)]
[clang][deps] NFC: Take and store entry as reference
Jan Svoboda [Fri, 17 Dec 2021 12:43:12 +0000 (13:43 +0100)]
[clang][deps] NFC: Remove explicit call to implicit constructor
Jan Svoboda [Fri, 17 Dec 2021 12:30:38 +0000 (13:30 +0100)]
[clang][deps] NFC: Rename member variable
Jan Svoboda [Fri, 17 Dec 2021 12:34:56 +0000 (13:34 +0100)]
[clang][deps] NFC: Fix whitespace formatting
Pavel Labath [Fri, 17 Dec 2021 12:51:58 +0000 (13:51 +0100)]
[lldb/qemu] Add emulator-env-vars setting
This setting is for variables we want to pass to the emulator only --
then will be automatically removed from the target environment by our
environment diffing code. This variable can be used to pass various
QEMU_*** variables (although most of these can be passed through
emulator-args as well), as well as any other variables that can affect
the operation of the emulator (e.g. LD_LIBRARY_PATH).
Simon Pilgrim [Fri, 17 Dec 2021 12:33:54 +0000 (12:33 +0000)]
[DAG] foldConstantFPMath - use APFloat& for read-only constant fold arg. NFC.
We just need to copy the 1st arg (which we use for the constant fold result) - use a cheaper const reference for the 2nd arg.
Nico Weber [Fri, 17 Dec 2021 12:26:34 +0000 (07:26 -0500)]
[gn build] (semiautomatically) port
3f5f687e2e8b
Sjoerd Meijer [Fri, 17 Dec 2021 12:02:44 +0000 (12:02 +0000)]
[FuncSpec] Create helper to update state. NFC.
This creates a helper function updateSpecializedFuncs and is a NFC just to make
the function that drives the transformation easier to read.
Simon Pilgrim [Fri, 17 Dec 2021 12:01:56 +0000 (12:01 +0000)]
[DAG] Constant fold + canonicalize integer binops before SimplifyVBinOp call
SimplifyVBinOp still has a FoldConstantArithmetic call, which now it isn't vector specific we should be able to remove (once fp binops are tidied up); but we can at least clean up the integer opcodes to perform the basic constant/undef handling in common code first.
OCHyams [Fri, 17 Dec 2021 11:39:35 +0000 (11:39 +0000)]
[NFC] Fix type-units-maybe-unused-types.ll from D115325 (
78d15a112cbd)
78d15a112cbd adds llvm/test/DebugInfo/Generic/type-units-maybe-unused-types.ll
Move the test into llvm/test/DebugInfo/X86 and add -mtriple=x86_64-linux-gnu
because not all platforms support type units.
Example of failing bot: type-units-maybe-unused-types.ll
Original review: https://reviews.llvm.org/D115325
Nikita Popov [Fri, 17 Dec 2021 10:00:25 +0000 (11:00 +0100)]
[CodeGen] Avoid more pointer element type accesses
Denys Petrov [Thu, 16 Dec 2021 16:48:30 +0000 (18:48 +0200)]
[analyzer][NFC] Change return value of StoreManager::attemptDownCast function from SVal to Optional<SVal>
Summary: Refactor return value of `StoreManager::attemptDownCast` function by removing the last parameter `bool &Failed` and replace the return value `SVal` with `Optional<SVal>`. Make the function consistent with the family of `evalDerivedToBase` by renaming it to `evalBaseToDerived`. Aligned the code on the call side with these changes.
Differential Revision: https://reviews.llvm.org/
rkorsa [Fri, 17 Dec 2021 07:26:38 +0000 (12:56 +0530)]
[AMDGPU] Fixes in ISelDAG path and GlobalISel path for 'bias' operand with A16 bit on
The LOD bias operand is of type 'half' when the A16-bit is ON' for MIMG instructions.
'bias' is only 16-bit but occupies 32-bits with upper 16-bits containing junk.
The patch fixes both the paths(ISelDAG and GlobalISel) for proper encoding of LOD bias operand.
Differential Revision: https://reviews.llvm.org/D111754
Andrzej Warzynski [Tue, 23 Nov 2021 18:13:51 +0000 (18:13 +0000)]
[flang][codegen] Add a conversion for `fir.coordinate_of` - part 2
This patch extends the `FIRToLLVMLowering` pass in Flang by extending
the hook to transform `fir.coordinate_of` into a sequence of LLVM MLIR
instructions (i.e. `CoordinateOpConversion::doRewrite`). The following
case is added:
3.1 the input object is inside `!fir.ref` (e.g. `!fir.ref<!fir.array>` or
`!fir.ref<!fir.type>`).
3.2 the input object is inside `!fir.ptr` (e.g. `!fir.ptr<!fir.array>` or
`!fir.ptr<!fir.type>`).
From the point of view of the conversion, 3.1 and 3.2 are currently identical.
This is part of the upstreaming effort from the `fir-dev` branch in [1].
[1] https://github.com/flang-compiler/f18-llvm-project
Originally written by:
Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
Depends on: D114159
Differential Revision: https://reviews.llvm.org/D115333