Commit Graph

416559 Commits

Author SHA1 Message Date
Jessica Clarke 6aa8521fdb [RISCV] Fix parseBareSymbol to not double-parse top-level operators
By failing to lex the token we end up both parsing it as a binary
operator ourselves and parsing it as a unary operator when calling
parseExpression on the RHS. For plus this is harmless but for minus this
parses "foo - 4" as "foo - -4", effectively treating a top-level minus
as a plus.

Fixes https://github.com/llvm/llvm-project/issues/54105

Reviewed By: asb, MaskRay

Differential Revision: https://reviews.llvm.org/D120635
2022-02-27 20:48:52 +00:00
Fangrui Song 87e6251d66 [ELF] Use --error-limit instead of -error-limit 2022-02-27 20:47:37 +00:00
Fangrui Song d14d8664e3 [ELF] Change global variable backwardReferences to a LinkerDriver member variable. NFC
Similar to whyExtract.
2022-02-27 20:33:28 +00:00
Fangrui Song 7fd3849b35 [ELF] Move --print-archive-stats= and --why-extract= beside --warn-backrefs report
So that early errors don't suppress their output.
2022-02-27 20:23:09 +00:00
Martin Storsjö acf20001a0 [libcxx] [test] Fix one failing part of dsl.sh.py on Windows.
Windows UCRT has got a bug in older versions (present in CI), where
it successfully does set a locale named
`for_sure_this_is_not_an_existing_locale`. By adjusting the tested
locale name to `forsurethisisnotanexistinglocale`, that test works
as expected, failing to set the locale.

The bug is reported upstream at
https://developercommunity.visualstudio.com/t/setlocale-succeeds-for-bogus-locale-names-in-older/1652241,
but as it already is working correctly in newer versions, no action
was prompted there.

We could of course add a bug detection in features.py like other
existing `broken-*` features, but that would seem kinda
pointless as it would be doing exactly what this test does.
Instead just adjust the tested dummy locale name.

This bit was approved to be committed on its own, in
https://reviews.llvm.org/D120546 (which is left open to follow up on
review of the rest of that patch).
2022-02-27 22:06:18 +02:00
Martin Storsjö f1d0d6f70c [libcxx] [test] Fix the monetary locale pos/neg_format test for Windows and macOS
The zh_CN.UTF-8 locale on Glibc has got `n_sign_posn == 4` (which means
having the negative sign just after the currency symbol), but has
`int_n_sign_posn == 1` (which means before the string).

On Windows, there's no separate `int_n_sign_posn` field, so the same
`n_sign_posn` (which is 4 there too) is used for international currency
formatting too. This makes the ordering for the international case on
Windows be the same as for the national one right above it.

On Apple platforms, the fr_FR.UTF-8 locale has got `n_sign_posn == 2`
but `p_sign_posn == 1`, giving a different order for the French locale
for the negative format.

On Apple platforms for the zh_CN.UTF-8 locale, both `n_sign_posn` and
`int_n_sign_posn` are 4, but `p_sign_posn` and `int_p_sign_posn` are 1.

Differential Revision: https://reviews.llvm.org/D120550
2022-02-27 21:49:14 +02:00
Xiaodong Liu f6cb59d35f [sancov] Add SPARC support for getPreviousInstructionPc
The SPARC and MIPS branching operations have a branch delay slot, 4 more bytes occupied.

Depends on D120381

Reviewed By: ro, MaskRay

Differential Revision: https://reviews.llvm.org/D120451
2022-02-27 19:10:51 +00:00
Philip Reames 319265328c [SLP] Remove field unused after 33ce97f to silence buildbots [NFC] 2022-02-27 10:18:10 -08:00
Florian Hahn ff93260bf6
Revert "[VPlan] Introduce recipe to build scalar steps."
This reverts commit 49b23f451c.

This appears to break some PPC build bots. Revert while I investigate.
2022-02-27 17:51:19 +00:00
Philip Reames 33ce97f413 [SLP] Use BatchAA to reduce capture analysis cost [NFC]
SLP makes very heavy use of aliasing queries to construct pointer dependencies for scheduling purposes.  AA internally usings pointerMayBeCaptured to prove some noalias results.  In a local profile, we were spending about 4% of total O2 time in capture tracking.  By using BatchAA interface - which caches capture results - this drops to 2%.

Note that there is no invalidation of BatchAA here.  This assumes that no transformation done by SLP invalidates alias or capture results.  This is the same assumption made by the existing AliasCache, so this is not a new assumption in the code.
2022-02-27 09:47:24 -08:00
Florian Hahn 49b23f451c
[VPlan] Introduce recipe to build scalar steps.
This patch adds a new VPScalarIVStepsRecipe to handle building scalar
steps.

In the first patch, it only handles the case where there is no vector
induction variable needed.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D115953
2022-02-27 17:32:41 +00:00
Arthur O'Dwyer b6d75682f9 [libc++] [test] Check the presence of "pragma include_instead" in newly added headers.
Unless/until we revert D106124, we should make sure that every newly added
detail header includes this line.
2022-02-27 12:27:56 -05:00
Groverkss b486a9de80 [MLIR][Presburger] Move IntegerPolyhedron::reset to FlatAffineConstraints::reset
This patch moves IntegerPolyhedron::reset to FlatAffineConstraints::reset. This
function is not required in IntegerPolyhedron and creates ambiguity while
shifting implementations to IntegerRelation.

This patch is part of a series of patches to introduce relations in Presburger
library.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D120628
2022-02-27 22:27:28 +05:30
Sanjay Patel 69684b84c6 [SDAG] fold (rotate X) eq/ne (0/-1)
This is the SDAG equivalent of an instcombine transform added with:
fd807601a7

This is another step towards solving #49541 and part of an alternative
set of more general transforms than what is proposed in D111530.

https://alive2.llvm.org/ce/z/ToxaE8
2022-02-27 11:31:19 -05:00
Sanjay Patel 35de5125cc [x86] add tests for setcc eq/ne 0/-1 of rotate; NFC
The tests are adapted from a similar file for instcombine:
fd807601a7
2022-02-27 11:29:26 -05:00
Simon Pilgrim 2b46417aa2 [X86][SSE] Attempt to lower vec_reduce_add patterns with PSADBW for zero-extended vXi8 sources
For i16/32/64 vectors, if the upper bits are known to be zero, then we can try to truncate to vXi8 (if its worth it) and perform this as a PSADBW to add+zext each v4i8 subvector to a i64 sum, which we can then reduce together.

This addresses some of the PR42674 test cases where the source data was vXi8 but had been extended to match a wider unsigned integer accumulator.

Differential Revision: https://reviews.llvm.org/D120193
2022-02-27 15:17:42 +00:00
Sanjay Patel acb96ffd14 [SDAG] fold bitwise logic with shifted operands
LOGIC (LOGIC (SH X0, Y), Z), (SH X1, Y) --> LOGIC (SH (LOGIC X0, X1), Y), Z

https://alive2.llvm.org/ce/z/QmR9rR

This is a reassociation + factoring fold. The common shift operation is moved
after a bitwise logic op on 2 input operands.
We get simpler cases of these patterns in IR, but I suspect we would miss all
of these exact tests in IR too. We also handle the simpler form of this plus
several other folds in DAGCombiner::hoistLogicOpWithSameOpcodeHands().

This is a partial implementation of a transform suggested in D111530
(only handles 'or' bitwise logic as a first step - need to stamp out more
tests for other opcodes).
Several of the same tests added for D111530 are altered here (but not
fully optimized). I'm not sure yet if this would help/hinder that patch,
but this should be an improvement for all tests added with ecf606cb43
since it removes a shift operation in those examples.

Differential Revision: https://reviews.llvm.org/D120516
2022-02-27 09:54:12 -05:00
Yevgeny Rouban beb92af01b Revert "[Support] Reset option to its default if its Default field is undefined"
This reverts commit 7fb39fb6d6 as clang buildbots failed.
2022-02-27 21:46:10 +07:00
Yevgeny Rouban 7fb39fb6d6 [Support] Reset option to its default if its Default field is undefined
opt::setDefaultImpl() is changed to set the option value to the option
type's default if the Default field is not set. This results in option
value reset by Option::reset() or ResetAllOptionOccurrences() even if
the cl::init() is not specified.

Example:
  StackOption<std::string> Str("str"); // No cl::init().
  Str = "some value";
  cl::ResetAllOptionOccurrences();
  EXPECT_EQ("", Str); // The Str is reset.

Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D115433
2022-02-27 20:57:28 +07:00
Florian Hahn 9bc866cc6f
[VPlan] Add recipe to handle SCEV expansion (NFC).
This can be used to explicitly model VPValues that depend on SCEV
expansion, like the step for inductions.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D116288
2022-02-27 12:47:02 +00:00
Simon Pilgrim 850bc76a35 [lldb] BreakpointOptions::CommandData::CreateFromStructuredData - remove dead code + variable. NFCI.
The found_something bool is only ever read after it has always been set to true.

Looks to be a leftover debugging variable.

Fixes static analyzer warning: https://llvm.org/reports/scan-build/report-BreakpointOptions.cpp-CreateFromStructuredData-8-4055b9.html#EndPath
2022-02-27 11:33:14 +00:00
Simon Pilgrim fadd20f80d [DAG] Ensure type is legal for bswap(shl(x,c)) -> zext(bswap(trunc(shl(x,c-bw/2)))) fold
As reported on D120192
2022-02-27 11:25:22 +00:00
Iain Sandoe 853ca54723 [C++20][Modules][6/8] Record direct module imports.
This is a small cache to avoid having to check both Exports and
Imports.

Differential Revision: https://reviews.llvm.org/D118589
2022-02-27 10:07:11 +00:00
Carl Ritson 2bbe6506d4 [AMDGPU] Remove redundant isVALU in SIPreEmitPeephole. NFC
Remove redundant isVALU call added in D120202.
2022-02-27 16:09:20 +09:00
Fangrui Song bd448f01a6 [ELF] BitcodeFile: resolve defined symbols before undefined symbols
This ports D95985 for ELF relocatable object files to BitcodeFile.
2022-02-27 05:37:08 +00:00
Serge Pavlov 6982c38cb1 [ConstantFolding] Fix folding of constrained compare intrinsics
The change fixes treatment of constrained compare intrinsics if
compared values are of vector type.

Differential revision: https://reviews.llvm.org/D110322
2022-02-27 10:19:19 +07:00
Benjamin Kramer 20517719a9 [bazel] Port g95b4e88b1db3 2022-02-27 00:11:42 +01:00
Simon Pilgrim cbe9911845 [clang] MarkVarDeclODRUsed - remove redundant nullptr check. NFCI.
The function has already been dereferenced the Var pointer
2022-02-26 21:24:26 +00:00
Sam McCall 42cb812da7 [clangd] Test fixes missing from 257559ed9 2022-02-26 21:38:25 +01:00
Sam McCall 257559ed9a [clangd] Function return type hints: support lambdas, don't duplicate "->"
While here, fix an ugliness:
  auto foo()->auto { return 42; }
This (silly) code gains a "-> int" hint. While correct and useful, it renders as
  auto foo()->int->auto { return 42; }
which is confusing enough to do more harm than good I think.

Differential Revision: https://reviews.llvm.org/D120416
2022-02-26 21:28:09 +01:00
Björn Schäpers a74ff3ac2e [clang-format][NFC] Rename test and remove comments
Why put "InMacros" in the name? We test other things to, and I will add
more, withut macros.

Also all our tests are regression tests.

Differential Revision: https://reviews.llvm.org/D120401
2022-02-26 21:22:37 +01:00
Björn Schäpers 1d03548f63 [clang-format][NFC] Remove redundant semi
All "calls" have a semi, as they should, remove the one from the macro.

Differential Revision: https://reviews.llvm.org/D120359
2022-02-26 21:22:36 +01:00
Benjamin Kramer 1de11fe360 Use RegisterInfo::regsOverlaps instead of checking aliases
This is both less code and faster since it doesn't have to expand all
the sub & superreg sets. NFCI.
2022-02-26 20:32:12 +01:00
River Riddle b474ca1d5a [PDLL] Properly error out on returning results from native constraints
PDL currently doesn't support result values from constraints, meaning we need
to error out until this is actually supported to avoid crashes.

Differential Revision: https://reviews.llvm.org/D119782
2022-02-26 11:08:51 -08:00
River Riddle 9ad64a5c78 [mlir:PDLL] Add support for C++ generation
This commits adds a C++ generator to PDLL that generates wrapper PDL patterns
directly usable in C++ code, and also generates the definitions of native constraints/rewrites
that have code bodies specified in PDLL. This generator is effectively the PDLL equivalent of
the current DRR generator, and will allow easy replacement of DRR patterns with PDLL patterns.
A followup will start to utilize this for end-to-end integration testing and show case how to
use this as a drop-in replacement for DRR tablegen usage.

Differential Revision: https://reviews.llvm.org/D119781
2022-02-26 11:08:51 -08:00
River Riddle a486cf5e98 [mlir:PDLL] Fix handling of unspecified operands/results on operation expressions
If the operand list or result list of an operation expression is not specified, we interpret
this as meaning that the operands/results are "unconstraint" (i.e. "could be anything").
We currently don't properly handle differentiating this case from the case of
"no operands/results". This commit adds the insertion of implicit value/type range
variables when these lists are unspecified. This allows for adding proper support
for when zero operands or results are expected.

Differential Revision: https://reviews.llvm.org/D119780
2022-02-26 11:08:51 -08:00
River Riddle 95b4e88b1d [mlir:PDLL] Add support for PDL MLIR code generation
This commits starts to plumb PDLL down into MLIR and adds an initial
PDL generator. After this commit, we will have conceptually support
end-to-end execution of PDLL. Followups will add CPP generation to
match the current DRR setup, and begin to add various end-to-end
tests to test PDLL execution.

Differential Revision: https://reviews.llvm.org/D119779
2022-02-26 11:08:51 -08:00
David Green 2e7c35ea12 [AArch64] Cleanup and extend cast costs. NFC 2022-02-26 17:59:02 +00:00
Arthur O'Dwyer 7f285f48e7 [libc++] [test] Re-remove C++ comments from generated files.
A merge conflict in D106124 accidentally reverted this part of
b82683b2e/D110794.

> Even if these comments have a benefit in .h files (for editors that
> care about language but can't be configured to treat .h as C++ code),
> they certainly have no benefit for files with the .cpp extension.
2022-02-26 12:44:26 -05:00
Martin Storsjö 1198c309db [libcxx] [test] Remove an incorrect XFAIL, fix CI on main
9f5f084 (D119770) made this test pass in the Windows configuration too,
but didn't update the XFAIL accordingly.

Differential Revision: https://reviews.llvm.org/D120611
2022-02-26 12:29:42 -05:00
Groverkss e897214e97 [MLIR][Presburger] Remove redundant check from hasConsistentState
This patch removes a redundant check in hasConsistentState which is always true
after introduction of PresburgerSpace.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D120615
2022-02-26 22:02:17 +05:30
Florian Hahn da740492b0
[VPlan] Remove dead header-phi recipes.
This patch adds a new transform to remove dead recipes. For now, it only
removes dead recipes in the header, to keep the number tests that require
updating manageable. Future patches will extend this to remove dead
recipes across the whole plan.

Reviewed By: Ayal

Differential Revision: https://reviews.llvm.org/D118051
2022-02-26 16:26:39 +00:00
Nico Weber a524a12231 [gn build] (manually) port 2e6ae1d3f2 more
b85f97bc00 missed one file.

With this, all files listed in libcxx/include/CMakeLists.txt are
listed in this BUILD.gn file again.
2022-02-26 10:46:35 -05:00
Nico Weber eab54b5a9d [gn build] (manually) port 01ace074fc more
410d4492e3 only hit half the added files.
2022-02-26 10:43:21 -05:00
Nico Weber 505e1cda57 [gn build] Define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER when building libcxx
Ports 87a82490fc in a way. Has the effect of enabling warnings
when building libcxx itself, but more importantly this is required
after 5aaefa510e to not get build errors when building libcxx itself.
2022-02-26 10:25:01 -05:00
Florian Hahn 462cd9270c
[LV] Add test with redundant cast in separate latch block.
Adds another interesting test for D118051.
2022-02-26 14:52:55 +00:00
Sam McCall 671eab254a [clangd] Support IncludeFixer or base specifiers 2022-02-26 15:45:59 +01:00
Nikita Popov 8dcb5e6bf5 Revert "[Driver] Default CLANG_DEFAULT_PIE_ON_LINUX to ON"
See post-commit discussion on https://reviews.llvm.org/D120305.
This change breaks the clang-ppc64le-rhel buildbot, though
there is suspicion that it's an issue with the bot. The change
also had a larger than expected impact on compile-time and
code-size.

This reverts commit 3c4ed02698
and some followup changes.
2022-02-26 15:32:49 +01:00
Groverkss 3001d4674d [MLIR][Presburger] Move IdKind specific insert/append
This patch moves identifier kind specific insert/append functions like
`insertDimId`, `appendSymbolId`, etc. from IntegerPolyhedron to
FlatAffineConstraints.

This change allows for a smoother transition to IntegerRelation.

This change is part of a series of patches to introduce Relations in Presburger
library.

Reviewed By: arjunp

Differential Revision: https://reviews.llvm.org/D120576
2022-02-26 18:54:30 +05:30
Sam McCall b09c12c4b9 [clangd] Fix wrong included header. NFC 2022-02-26 14:21:52 +01:00