Commit Graph

409446 Commits

Author SHA1 Message Date
Jim Lin 9b70ddaff6 [Builtins] Add missing the macro 'y' description in comments
New type str 'y' added from D76077. But missed its description in
comments.

Reviewed By: stuij

Differential Revision: https://reviews.llvm.org/D116509
2022-01-10 10:43:13 +08:00
Craig Topper 2dd52f840b [RISCV] Fold (srl (and X, 0xffff), C)->(srli (slli X, (XLen-16), (XLen-16) + C) even with Zbb/Zbp.
We can use zext.h with Zbb, but srli/slli may offer more opportunities
for compression.
2022-01-09 18:42:03 -08:00
Esme-Yi 817936408b [yaml2obj][XCOFF] parsing auxiliary symbols.
Summary: The patch adds support for yaml2obj parsing auxiliary
symbols for XCOFF. Since the test cases of this patch are
interdependent with D113825 ([llvm-readobj][XCOFF] dump
auxiliary symbols), test cases of this patch will be committed
after D113825 is committed.

Reviewed By: jhenderson, DiggerLin

Differential Revision: https://reviews.llvm.org/D113552
2022-01-10 02:38:49 +00:00
Chen Zheng 2c46ca96e2 [PowerPC] fast isel can lower intrinsics call on AIX.
Reviewed By: qiucf

Differential Revision: https://reviews.llvm.org/D114778
2022-01-10 02:30:05 +00:00
Craig Topper a500f7f48f [SelectionDAG] Add FP_TO_UINT_SAT/FP_TO_SINT_SAT to computeKnownBits/computeNumSignBits.
These nodes should saturate to their saturating VT. We can use this
information to know the bits past the VT are all zeros or all sign bits.

I think we might only have test coverage for the unsigned case. I'll
verify and add tests.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D116870
2022-01-09 17:48:05 -08:00
Alexander Shaposhnikov 22430ede7e [CodeGen] Rename emitCalleeSavedFrameMoves
This diff renames emitCalleeSavedFrameMoves to avoid conflicts with
non-virtual methods of derived classes having the same name but different semantics.
E.g. the class AArch64FrameLowering used to have (non-virtual) "emitCalleeSavedFrameMoves"
but it started to override TargetFrameLowering::emitCalleeSavedFrameMoves after
https://github.com/llvm/llvm-project/commit/c3e6555616 though its usage and semantics didn't change.
P.S. for x86 there was no conflict because the signature of
non-virtual X86FrameLowering::emitCalleeSavedFrameMoves is different

Test plan: make check-all

Differential revision: https://reviews.llvm.org/D114140
2022-01-10 01:33:04 +00:00
Mehdi Amini 60d13b85ca Apply clang-tidy fixes for performance-move-const-arg in ReductionNode.cpp (NFC) 2022-01-10 01:05:14 +00:00
Mehdi Amini ba19fa5779 Apply clang-tidy fixes for performance-for-range-copy in ElementwiseOpFusion.cpp (NFC) 2022-01-10 01:05:14 +00:00
Mehdi Amini 0c9d59e56a Apply clang-tidy fixes for performance-for-range-copy in ModuleBufferization.cpp (NFC) 2022-01-10 01:05:14 +00:00
Mehdi Amini 6a38cbfb53 Apply clang-tidy fixes for modernize-use-equals-default in IRCore.cpp (NFC) 2022-01-10 01:05:13 +00:00
Dave Lee 08f70adedb Revert "[lldb] Set result error state in 'frame variable'"
This reverts commit 2bcff220bf.
2022-01-09 14:12:47 -08:00
Fangrui Song 5d3bd7f360 [ELF] Move gotIndex/pltIndex/globalDynIndex to SymbolAux
to decrease sizeof(SymbolUnion) by 8 on ELF64 platforms.

Symbols needing such information are typically 1% or fewer (5134 out of 560520
when linking clang, 19898 out of 5550705 when linking chrome). Storing them
elsewhere can decrease memory usage and symbol initialization time.
There is a ~0.8% saving on max RSS when linking a large program.

Future direction:

* Move some of dynsymIndex/verdefIndex/versionId to SymbolAux
* Support mixed TLSDESC and TLS GD without increasing sizeof(SymbolUnion)

Reviewed By: peter.smith

Differential Revision: https://reviews.llvm.org/D116281
2022-01-09 13:43:27 -08:00
Dave Lee 2bcff220bf [lldb] Set result error state in 'frame variable'
Ensure that errors in `frame variable` are reflected in result object.

The statistics for `frame variable` show invocations as being successful, even
when executing one of the error paths.

This change replaces `result.GetErrorStream()` with `result.AppendError()`,
which also sets the status to `eReturnStatusFailed`.

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

(cherry picked from commit 2c7d10c412)
2022-01-09 13:26:30 -08:00
Dave Lee a6f1d04665 [lldb][docs] Update references to SVN 2022-01-09 13:21:40 -08:00
Kazu Hirata 8afcfbfb8f Use true/false instead of 1/0 (NFC)
Identified by modernize-use-bool-literals.
2022-01-09 12:21:06 -08:00
Kazu Hirata 47b9aadb32 [lldb] Remove redundant member initialization (NFC) 2022-01-09 12:21:04 -08:00
Kazu Hirata b12fd13812 Fix bugprone argument comments.
Identified by bugprone-argument-comment.
2022-01-09 12:21:02 -08:00
Kazu Hirata ac2090d507 [clang] Remove unused forward declarations (NFC) 2022-01-09 12:21:00 -08:00
Dave Lee 39ea676d9d [lldb] Compute fully qualified command names in FindCommandsForApropos
Fixes incomplete command names in `apropos` results.

The full command names given by `apropos` have come from command name string
literals given to `CommandObject` constructors. For most commands, this has
been accurate, but some commands have incorrect strings. This results in
`apropos` output that doesn't tell the user the full command name they might
want learn more about. These strings can be fixed.

There's a seperate issue that can't be fixed as easily: plugin commands. With
the way they're implemented, plugin commands have to exclude the root command
from their command name string. To illustrate, the `language objc` subcommand
has to set its command name string to "objc", which results in apropos printing
results as `objc ...` instead of `language objc ...`.

To fix both of these issues, this commit changes `FindCommandsForApropos` to
derive the fully qualified command name using the keys of subcommand maps.

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

(cherry picked from commit b3bfd595a5)
2022-01-09 12:11:32 -08:00
Dave Lee 9d9f3e0ec7 [lldb] Remove ProcessStructReader from NSStringSummaryProvider (NFC)
Simplify getting the length of `NSPathStore2` strings.

`NSStringSummaryProvider` uses a single field from `NSPathStore2` instances,
its first ivar: `_lengthAndRefCount`. This change uses
`GetSyntheticChildAtOffset` to replace the use of `ProcessStructReader`, and
removes the hard coded `CompilerType` definition of `NSPathStore2`.

Differential Revision: https://reviews.llvm.org/D116461
2022-01-09 12:09:02 -08:00
Nicolas Vasilache 8871d8236a [mlir][MemRef] NFC - Improve assertion error message 2022-01-09 14:17:37 -05:00
Johannes Doerfert 4e8a02e7f4 [Attributor][FIX] Remove assumption that doesn't have to hold
There is no guarantee we strip all GEPOperators and the conservative
handling doesn't even require us to.
2022-01-09 13:15:53 -06:00
Nicolas Vasilache 9ba25ec92d [mlir][Bufferize] NFC - Introduce areCastCompatible assertions to catch misformed CastOp early
Differential Revision: https://reviews.llvm.org/D116893
2022-01-09 14:13:08 -05:00
Florian Hahn 1ce01b7dfe
[SCEVExpander] Simplify cleanup, skip sorting by dominance.
There is no need to sort inserted instructions by dominance, as the
deletion loop still requires RAUW with undef before deleting. Removing
instructions in reverse insertion order should still insure that the
number of uselist updates is kept to a minimum.
2022-01-09 18:38:41 +00:00
Jake Egan fbf52caf58 [AIX] Disable tests that fail because of no 64-bit XCOFF object file support
The modified tests fail because 64-bit XCOFF object files are not currently supported on AIX. This patch disables these tests on 64-bit AIX for now.

This patch is similar to D111887 except the failures on this patch are on a 64-bit build.

Reviewed By: shchenz, #powerpc

Differential Revision: https://reviews.llvm.org/D113049
2022-01-09 12:25:24 -05:00
Sanjay Patel e745507eda [x86] exclude "X==0 ? Y :-1" from math/logic transform
This is the last step in a series to improve lowering
via "SBB" asm:
68defc0134
aab1f55e33
...and fixes #53006
2022-01-09 09:03:39 -05:00
Florian Hahn 7f1bf68d7d
[SCEVExpander] Only check overflow if it is needed.
9345ab3a45 updated generateOverflowCheck to skip creating checks that
always evaluate to false. This in turn means that we only need to check
for overflows if the result of the multiplication is actually used.

Sink the Or for the overflow check into ComputeEndCheck, so it is only
created when there's an actual check.
2022-01-09 12:55:41 +00:00
Sanjay Patel 1d21667ce2 [InstCombine] (~A | B) & (A ^ B) -> ~A & B
This is part of a set of 2-variable logic optimizations
suggested here:
https://lists.llvm.org/pipermail/llvm-dev/2021-December/154470.html

The 'not' op must not propagate undef elements of a vector,
so this patch creates a new 'full' not, but I am not counting
that as an extra-use restriction because it should get folded
with the existing value by CSE.

https://alive2.llvm.org/ce/z/7v65im
2022-01-09 06:23:51 -05:00
Sanjay Patel 0b13789d58 [InstCombine] add tests for and(orn, xor); NFC 2022-01-09 06:23:50 -05:00
Sanjay Patel aab1f55e33 [x86] use SETCC_CARRY instead of SBB node for select lowering
This is a suggested follow-up to D116765.
This removes a clear of the register operand, so it is better
for code size, but it does potentially create a false register
dependency on surrounding code. If that is a problem, it should
be solvable using dependency-breaking code that is used for
other instructions.

Differential Revision: https://reviews.llvm.org/D116804
2022-01-09 06:23:50 -05:00
Kazu Hirata 80e2c58749 [clang] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
2022-01-09 00:19:51 -08:00
Kazu Hirata 17d4bd3d78 [clang] Fix bugprone argument comments (NFC)
Identified with bugprone-argument-comment.
2022-01-09 00:19:49 -08:00
Kazu Hirata 40446663c7 [clang] Use true/false instead of 1/0 (NFC)
Identified with modernize-use-bool-literals.
2022-01-09 00:19:47 -08:00
Casey Carter 4cd768ed5e [libcxx][test] `_VSTD` doesn't belong in test code 2022-01-08 21:33:52 -08:00
Johannes Doerfert 37639b72a1 [OpenMP][FIX] Emit debug declares only if debug info is available
The `EmitDeclareOfAutoVariable` introduced in D114504 and D115510 has a
precondition that cannot be violated. It is unclear if we should call it
directly given the sparse usage in clang but for now we should at least
not crash if the debug info kind is too low.

Fixes #52938.

Differential Revision: https://reviews.llvm.org/D116865
2022-01-08 17:01:19 -06:00
Johannes Doerfert 6c745e04fa [Attributor][FIX] Ensure order for multiple references into map
If we have multiple references into a map we need to ensure the ones
created late do not invalidate the ones created early. To do that we
need to make sure all but the first are not modifying the map, hence
for them the keys have to be present already.

Fixes #52875.
2022-01-08 16:59:21 -06:00
Craig Topper 6a10bc7056 [RISCV] Add i8/i16 fptosi/fptoui and fptosi_sat/fptoui_sat tests. NFC
Use signext/zeroext return attributes to show unnecessary ands or
shifts in the saturating tests.
2022-01-08 14:01:31 -08:00
Eric Schweitz 7ecce1f695 [fir] Correct and reenable test that was removed by MLIR.
See https://github.com/llvm/llvm-project/issues/53064

The original test required a cast to be correct.
Correct the CHECK lines. Prune unused ones.

Differential Revision: https://reviews.llvm.org/D116842
2022-01-08 13:58:35 -08:00
Arthur O'Dwyer 8a21e0c10c [libc++] [test] Remove `UNSUPPORTED: stdlib=msvc` from lock.pass.cpp.
Casey Carter says, "We run std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
on every CI and it works fine with MSVC STL. I'm guessing this annotation predates
Billy's rewrite of std::lock in 2017-ish."

Differential Revision: https://reviews.llvm.org/D116712
2022-01-08 16:03:30 -05:00
Craig Topper fe230bfc00 [RISCV] Add nounwind to remove some cfi directives from test CHECKs. NFC 2022-01-08 12:48:24 -08:00
Florian Hahn 3b7b1a75b0
[LV] Improve check lines in existing tests.
Update the check lines in 2 existing tests to use patterns + variables
to match some IR to make them independent of value naming.
2022-01-08 20:46:31 +00:00
Craig Topper 0f9f17869f [RISCV] Add nounwind to remove some cfi directives from test CHECKs. NFC 2022-01-08 12:27:46 -08:00
Craig Topper db4cb4668b [docs] Fix documentation of -fno-strict-float-cast-overflow after D115804.
Previously this was documented as having the behavior of the
"target's native float-to-int conversion". After D115804, clang
uses saturating FP cast intrinsics which have the same behavior
on all targets.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D116856
2022-01-08 12:12:44 -08:00
Mehdi Amini 18eb681821 Fix clang-tidy readability-redundant-smartptr-get in MLIR ModuleTranslation.cpp (NFC) 2022-01-08 20:07:11 +00:00
Mehdi Amini 651c73b8d1 Enable readability-redundant-smartptr-get in MLIR local clang-tidy config 2022-01-08 20:07:11 +00:00
Kazu Hirata f44473ec4e [llvm] Remove redundant member initialization (NFC)
Identified with readability-redundant-member-init.
2022-01-08 11:56:44 -08:00
Kazu Hirata 51fd157635 Remove duplicate forward declarations (NFC) 2022-01-08 11:56:42 -08:00
Kazu Hirata d1b127b5b7 [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
Kazu Hirata 435a5a3652 [llvm] Fix bugprone argument comments (NFC)
Identified with bugprone-argument-comment.
2022-01-08 11:56:38 -08:00
Philip Reames 2cafbcb560 [instcombine] Key deref vs deref_or_null annotation of allocation sites off nonnull attribute
Goal is to remove use of isOpNewLike.  I looked at a couple approaches to this, and this turned out to be the cheapest one.  Just letting deref_or_null be generated causes a bunch of test diffs, and I couldn't convince myself there wasn't a real regression somewhere.  A generic instcombine to convert deref_or_null + nonnull to deref is annoying complicated since you have to mix facts from callsite and declaration while manipulating only existing call site attributes.  It just wasn't worth the code complexity.

Note that the change in new-delete-itanium.ll is a real regression.  If you have a callsite which overrides the builtin status of a nobuiltin declaration, *and* you don't put the apppriate attributes on that callsite, you may lose the deref fact.  I decided this didn't matter; if anyone disagrees, you can add this case to the generic non-null inference.
2022-01-08 10:33:54 -08:00