Commit Graph

409378 Commits

Author SHA1 Message Date
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
Arthur O'Dwyer 6ce732cbad [libc++] [ranges] Add namespace __cpo to ranges::{advance,next,prev}.
The reason for those nested namespaces is explained in D115315:

> AIUI, this keeps the CPO's own type from ADL'ing into the `std::ranges`
> namespace; e.g. `foobar(std::ranges::uninitialized_default_construct)`
> should not consider `std::ranges::foobar` a candidate, even if
> `std::ranges::foobar` is not a CPO itself. Also, of course, consistency
> (Chesterton's Fence, the economist's hundred-dollar bill): if it were
> safe to omit the namespace, we'd certainly want to do it everywhere,
> not just here.

This makes these three niebloids more consistent with the other Ranges
niebloids we've already implemented, such as the `ranges::begin` group
and the `ranges::uninitialized_default_construct` group.

FWIW, we still have three different indentation-and-comment styles
among these three groups.

Differential Revision: https://reviews.llvm.org/D116569
2022-01-08 12:47:54 -05:00
Dave Lee 930f3c625e Revert "[lldb] Set result error state in 'frame variable'"
This reverts commit 2c7d10c412.
2022-01-08 09:35:13 -08:00
Dave Lee 2c7d10c412 [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
2022-01-08 08:50:17 -08:00
Simon Pilgrim 6ee589e2f5 [CGObjCMac] Use castAs<> instead of getAs<> to avoid dereference of nullptr inside BuildRCBlockVarRecordLayout
This will assert the cast is correct instead of returning nullptr (UnionType is a subtype of RecordType so this should be clean).
2022-01-08 16:18:55 +00:00
Florian Hahn 7e679f88ac
[LSR] Auto-generate check lines for test.
Checking the full output provides more context and makes it easier to
review changes to the test in a follow-up patch.
2022-01-08 15:44:54 +00:00
Florian Hahn 9153c27385
[LoopUnroll] Make test more robust by removing undef.
Replace a uses of undef in the tests. The undef causes runtime checks
to be trivially fold/removeable, which does defeat the purpose of the test.
2022-01-08 15:44:23 +00:00
Florian Hahn daa5e26312
[LV] Make tests more robust by removing undef.
Replace some uses of undef in the tests. The undef causes runtime checks
to be trivially fold/removeable, which does defeat the purpose of the tests.
2022-01-08 15:21:57 +00:00
Simon Pilgrim 75d8507e45 [X86] LowerRotate - enable ROTL vXi16 rotate-by-splat-amount on pre-AVX targets
To enable this on all targets there's still a number of regressions due to getSplatValue/getTargetVShiftNode but these don't really affect pre-AVX targets.
2022-01-08 14:57:00 +00:00
Simon Pilgrim be7dbd674c [DivergenceAnalysis] Simplify inRegion test based on whether the RegionLoop pointer is null or not
More closely matches the documentation

Requested by @nikic
2022-01-08 14:30:10 +00:00
Simon Pilgrim 06e9733fec [CGExpr] Use castAs<> instead of getAs<> to avoid dereference of nullptr
This will assert the cast is correct instead of returning nullptr
2022-01-08 14:26:09 +00:00
Simon Pilgrim b3f193a980 [DivergenceAnalysis] Fix static analyzer warning about dereference of nullptr
We're testing that the RegionLoop pointer is null in the first part of the check, so we need to check that its non-null before dereferencing it in a later part of the check.
2022-01-08 13:57:33 +00:00
Simon Pilgrim 274359cf09 [OpenMPOpt] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr. NFC 2022-01-08 13:47:35 +00:00
Simon Pilgrim b5d2e232b8 [X86][SSE] Add initial FSHL/FSHR vXi8 lowering support
This is very similar to the existing ROTL/ROTR support for scalar shifts in LowerRotate, I think as time goes on we should be able to share much of this code in helpers between Funnel Shift + Rotation lowering.
2022-01-08 12:19:25 +00:00
Uday Bondhugula 9cf9ed94ed Multiple fixes to affine loop tiling return status and checks
Fix crash in the presence of yield values. Multiple fixes to affine loop
tiling pre-condition checks and return status. Do not signal pass
failure on a failure to tile since the IR is still valid. Detect index
set computation failure in checkIfHyperrectangular and return failure.
Replace assertions with proper status return. Move checks to an
appropriate place earlier in the utility before mutation happens.

Differential Revision: https://reviews.llvm.org/D116738
2022-01-08 16:50:44 +05:30
Florian Hahn 9345ab3a45
[SCEVExpander] Skip creating <u 0 check, which is always false.
Unsigned compares of the form <u 0 are always false. Do not create such
a redundant check in generateOverflowCheck.

The patch introduces a new lambda to create the check, so we can
exit early conveniently and skip creating some instructions feeding the
check.

I am planning to sink a few additional instructions as follow-ups, but I
would prefer to do this separately, to keep the changes and diff
smaller.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D116811
2022-01-08 10:31:04 +00:00
Groverkss 0e19186c82 [MLIR][NFC] Move PresburgerSet to Presburger/ directory
This patch moves PresburgerSet to Presburger/ directory. This patch is purely
mechincal, it only moves and renames functionality and tests.

This patch is part of a series of patches to move presburger functionality to
Presburger/ directory.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D116836
2022-01-08 15:39:40 +05:30
Jay Foad 50fb44eebb [GlobalISel] Use getPreferredShiftAmountTy in one more G_UBFX combine
Change CombinerHelper::matchBitfieldExtractFromShrAnd to use
getPreferredShiftAmountTy for the shift-amount-like operands of G_UBFX
just like all the other G_[SU]BFX combines do. This better matches the
AMDGPU legality rules for these instructions.

Differential Revision: https://reviews.llvm.org/D116803
2022-01-08 09:20:44 +00:00
Jay Foad ff971873b3 [GlobalISel] Fix legality checks for G_UBFX combines
1. Fix CombinerHelper::matchBitfieldExtractFromAnd to check legality
   with the correct types for the G_UBFX that it builds.
2. Fix AMDGPUTargetLowering::isConstantUnsignedBitfieldExtractLegal to
   match the legality rules: result and first operand can be s32 or s64
   but the "shift amount" operands are always s32.
3. Add AMDGPU tests where the post-legalizer combiner would create
   illegal MIR without the above fixes.

Differential Revision: https://reviews.llvm.org/D116802
2022-01-08 09:20:44 +00:00