Commit Graph

405768 Commits

Author SHA1 Message Date
Bjorn Pettersson 00cf717f51 [test] Use -passes syntax in Feature/OperandBundles lit tests
Simply use the new PM syntax instead of the deprecated legacy PM
syntax when specifying the opt pipeline in some regression tests.

Differential Revision: https://reviews.llvm.org/D114518
2021-11-27 09:52:55 +01:00
Bjorn Pettersson 407600604b [test] Use -passes in lit tests for the UpdateTestChecks tool
The UpdateTestChecks tool itself does not care about which pass
manager that is used in the opt invocation. So the lit tests that
are verifying the behavior of the UpdateTestChecks tool is updated
to use the new-PM syntax (-passes=) when specifying the pass pipeline
in the test cases that are used for verifying the UpdateTestChecks
tool.

Differential Revision: https://reviews.llvm.org/D114517
2021-11-27 09:52:55 +01:00
Bjorn Pettersson 8ebb3eac02 [test] Use -passes syntax when specifying pipeline in some more tests
The legacy PM is deprecated, so update a bunch of lit tests running
opt to use the new PM syntax when specifying the pipeline.
In this patch focus has been put on test cases for ConstantMerge,
ConstraintElimination, CorrelatedValuePropagation, GlobalDCE,
GlobalOpt, SCCP, TailCallElim and PredicateInfo.

Differential Revision: https://reviews.llvm.org/D114516
2021-11-27 09:52:55 +01:00
Hsiangkai Wang b0c7421524 [RISCV] Emit DWARF location expression for RVV stack objects.
VLENB is the length of a vector register in bytes. We use
<vscale x 64 bits> to represent one vector register. The dwarf offset is
VLENB * scalable_offset / 8.

For the mask vector, it occupies one vector register.

Differential Revision: https://reviews.llvm.org/D107432
2021-11-27 15:13:10 +08:00
Kazu Hirata 387927bbaf [Target] Use range-based for loops (NFC) 2021-11-26 21:21:17 -08:00
Stanislav Funiak a19e163526 Fixed broken build under GCC 5.4.
This diff fixes broken build caused by D108550. Under GCC 5, auto lambdas that capture this require `this->` for member calls.

Reviewed By: bondhugula

Differential Revision: https://reviews.llvm.org/D114659
2021-11-27 09:03:27 +05:30
Fangrui Song 6fa8f7beb1 [ELF][test] Test that .o definition does not inherit .so STV_PROTECTED
Test %t2.so %t.o beside %t.o %t2.so
2021-11-26 15:00:10 -08:00
Konstantin Boyarinov 56c8ad237a [libcxx][NFC] Add tests for associative containers key_comp and value_comp
Add missing tests to improve associative containers code coverage:
 - Tests for key_comp() and value_comp() observers
 - Tests for std::map and std::multimap value_compare member class

Reviewed by: ldionne, rarutyun, #libc

Differential Revision: https://reviews.llvm.org/D113998
2021-11-27 01:46:22 +03:00
Fangrui Song f1ba48d508 [ELF] Simplify Symbol::extract. NFC 2021-11-26 14:10:55 -08:00
Vitaly Buka 8ae815cb19 [sanitizer] Switch StackStore to 8 MiB blocks
Larger blocks are more convenient for compressions.
Blocks are allocated with MmapNoReserveOrDie to save some memory.

Also it's 15% faster on StackDepotBenchmarkSuite

Depends on D114464.

Reviewed By: morehouse

Differential Revision: https://reviews.llvm.org/D114488
2021-11-26 14:00:10 -08:00
Erik Desjardins 53b00b8215 [InstSimplify] Fold X {lshr,udiv} C <u X --> true for nonzero X, non-identity C
This eliminates the bounds check in Rust code like

pub fn mid(data: &[i32]) -> i32 {
  if data.is_empty() { return 0; }
  return data[data.len()/2];
}

(from https://blog.sigplan.org/2021/11/18/undefined-behavior-deserves-a-better-reputation/)

Alive proofs:
lshr https://alive2.llvm.org/ce/z/nyTu8D
udiv https://alive2.llvm.org/ce/z/CNUZH7

Differential Revision: https://reviews.llvm.org/D114279
2021-11-26 16:48:33 -05:00
Patrick Oppenlander 06f1d63cb1 [compiler-rt][CMake] Support powerpcspe build
Reviewed By: jhibbits, MaskRay

Differential Revision: https://reviews.llvm.org/D98836
2021-11-26 13:29:06 -08:00
Patrick Oppenlander 30029e7407 [compiler-rt][CMake] Support powerpc32 on Linux
Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D98831
2021-11-26 13:28:20 -08:00
Nikita Popov 719354a571 Revert "[SCEV] Fix and validate ValueExprMap/ExprValueMap consistency"
This reverts commit bee8dcda1f.

Some sanitizer buildbots fail with:
> Attempt to use a SCEVCouldNotCompute object!

For example:
https://lab.llvm.org/buildbot/#/builders/85/builds/7020/steps/9/logs/stdio
2021-11-26 22:18:23 +01:00
Erik Desjardins a68af62b42 [InstSimplify] baseline tests for icmp of lshr/udiv fold (NFC)
Precommits tests for https://reviews.llvm.org/D114279

Differential Revision: https://reviews.llvm.org/D114280
2021-11-26 15:57:04 -05:00
Peter Klausler 45a8caf1cd [flang] Fix reversed comparison in RESHAPE() runtime
RESHAPE() fails inappropriately at runtime if the source array
is larger than the result -- which is perfectly valid -- because
of an obviously reversed comparison of their numbers of elements
is activating the runtime asserts meant for the opposite case
(source smaller than result).

Differential Revision: https://reviews.llvm.org/D114474
2021-11-26 12:34:00 -08:00
Kazu Hirata 803cec0268 [mlir] Fix a warning
This patch fixes:

  mlir/lib/IR/MLIRContext.cpp:1020:3: error: use of the 'nodiscard'
  attribute is a C++17 extension [-Werror,-Wc++17-extensions]
2021-11-26 12:27:11 -08:00
Nikita Popov bfa91f38a9 [DAG] Restore dropped condition
This was dropped in fcee33bd5a,
presumably accidentally.
2021-11-26 21:18:54 +01:00
Nikita Popov bee8dcda1f [SCEV] Fix and validate ValueExprMap/ExprValueMap consistency
Relative to the previous landing attempt, this makes
insertValueToMap() resilient against the value already being
present in the map -- previously I only checked this for the
createSimpleAffineAddRec() case, but the same issue can also
occur for the general createNodeForPHI(). In both cases, the
addrec may be constructed and added to the map in a recursive
query trying to create said addrec. In this case, this happens
due to the invalidation when the BE count is computed, which
ends up clearing out the symbolic name as well.

-----

This adds validation for consistency of ValueExprMap and
ExprValueMap, and fixes identified issues:

* Addrec construction directly wrote to ValueExprMap in a few places,
  without updating ExprValueMap. Add a helper to ensures they stay
  consistent. The adjustment in forgetSymbolicName() explicitly
  drops the old value from the map, so that we don't rely on it
  being overwritten.
* forgetMemoizedResultsImpl() was dropping the SCEV from
  ExprValueMap, but not dropping the corresponding entries from
  ValueExprMap.

Differential Revision: https://reviews.llvm.org/D113349
2021-11-26 20:57:47 +01:00
Fangrui Song 3b4dd68de5 [ELF][PPC64] Make --power10-stubs/--no-power10-stubs proper aliases for --power10-stubs={auto,no}
This allows --power10-stubs= and --[no-]power10-stubs to override each other
(they are position dependent in GNU ld).

Also improve --help messages and the manpage.

Note: GNU ld's default "auto" mode uses heuristics to decide whether Power10
instructions are used. Arguably it is a design mistake of R_PPC64_REL24_NOTOC
(acked by the relevant folks on a libc-alpha discussion). We don't implement
"auto", so the default --power10-stubs is the same as "yes".
2021-11-26 11:51:45 -08:00
Arnab Dutta c2280b5517 [MLIR] Avoid creation of buggy affine maps when incorrect values of number of dimensions and number of symbols are provided.
We check whether the maximum index of dimensional identifier present
in the result expressions is less than dimCount (number of dimensional
identifiers) argument passed in the AffineMap::get() and the maximum index
of symbolic identifier present in the result expressions is less than
symbolCount (number of symbolic identifiers) argument passed in AffineMap::get().

Reviewed By: nicolasvasilache, bondhugula

Differential Revision: https://reviews.llvm.org/D114238
2021-11-27 00:37:08 +05:30
Arnab Dutta e4e4da86af [MLIR] Prevent creation of buggy affine map after linearizing collapsed dimensions of source map
Initially we were passing wrong numSymbols argument while calling
AffineMap::get() for creaating affine map with linearized result
expressions. The main problems was the number of symbols of the newly
to be created map may be different from that of the source map, as
new symbolic identifiers may be introduced while creating strided layout
linearized expressions.

Reviewed By: nicolasvasilache, bondhugula

Differential Revision: https://reviews.llvm.org/D114240
2021-11-27 00:32:58 +05:30
Fangrui Song 09401dfcf1 [ELF] Rename fetch to extract
The canonical term is "extract" (GNU ld documentation, Solaris's `-z *extract`
options). Avoid inventing a term and match --why-extract. (ld64 prefers "load"
but the word is overloaded too much)

Mostly MFC, except for --help messages and the header row in
--print-archive-stats output.
2021-11-26 10:58:50 -08:00
Simon Pilgrim fcee33bd5a [DAG] Pull out repeated isLittleEndian() calls. NFC. 2021-11-26 18:41:56 +00:00
Chris Jones 344eee6f38 [MLIR] Allow `Idempotent` trait to be applied to binary ops.
Add `Idempotent` trait to `arith.{andi,ori}`.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D114574
2021-11-26 18:22:49 +00:00
Louis Dionne 5c454033dd [libc++] Trigger rebuild of the Docker image so we get a new nightly Clang 2021-11-26 12:57:30 -05:00
Michal Terepeta 7e65fc9a60 [mlir][Vector] Support 0-D vectors in `BroadcastOp`
This changes the op to produce `AnyVectorOfAnyRank` following mostly the code for 1-D vectors.

Depends On D114598

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114550
2021-11-26 17:17:18 +00:00
Michal Terepeta d0f927121e [mlir][Standard] Support 0-D vectors in `SplatOp`
This changes the op to produce `AnyVectorOfAnyRank` and implements this by just
inserting the element (skipping the shuffle that we do for the 1-D case).

Depends On D114549

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D114598
2021-11-26 17:05:15 +00:00
Arjun P ad34ce94d5 [MLIR] Simplex: fix a bug when rolling back a Simplex with no solutions
Previously, when adding a constraint to a Simplex that is already marked
as having no solutions (marked empty), the Simplex would be marked empty again,
and a second UnmarkEmpty entry would be pushed to the undo log. When rolling
back, Simplex should be unmarked empty only after rolling back past the
creation of the first constraint that made it empty.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D114613
2021-11-26 22:33:48 +05:30
Zarko Todorovski 715d2dc126 [llvm-cov][NFC] Add missing character to fix docs buildbot break. 2021-11-26 11:57:10 -05:00
Siva Chandra Reddy 7b59fcb7de [libc] Make string entrypoints mutualy exclusive.
For example, strcpy does not pull memcpy now.

Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D114300
2021-11-26 16:29:22 +00:00
Kazu Hirata 562356d6e3 [Target] Use range-based for loops (NFC) 2021-11-26 08:23:01 -08:00
Arjun P f074bbb04a [MLIR] Simplex::pivot: also update the redundant rows when pivoting
Previously, the pivot function would only update the non-redundant rows when
pivoting. This is incorrect because in some cases, when rolling back past a
`detectRedundant` call, the basis being used could be different from that which
was used at the time of returning from the `detectRedundant` call. Therefore,
it is important to update the redundant rows as well during pivots. This could
also be triggered by pivots that occur when testing successive constraints for
being redundant in `detectRedundant` after some initial constraints are marked redundant.

Reviewed By: Groverkss

Differential Revision: https://reviews.llvm.org/D114614
2021-11-26 21:42:41 +05:30
Zarko Todorovski e714394ab8 [LLVM][llvm-cov] Inclusive language: rename option -name-whitelist to -name-allowlist
Renamed the option for llvm-cov and changed variable names to use more
inclusive terms. Also changed the binary for the test.

Reviewed By: alanphipps

Differential Revision: https://reviews.llvm.org/D112816
2021-11-26 11:08:01 -05:00
Louis Dionne f18f9ce366 [libc++] Properly handle errors happening during Lit configuration
Instead of silently swallowing errors that happen during Lit configuration
(for example trying to obtain compiler macros but compiling fails), raise
an exception with some amount of helpful information.

This should avoid the possibility of silently configuring Lit in a bogus
way, and also provides more helpful information when things fail.

Note that this requires a bit more finesse around how we handle some
failing configuration checks that we would previously return None for.

Differential Revision: https://reviews.llvm.org/D114010
2021-11-26 11:03:15 -05:00
Louis Dionne 7dc9a03cfd [libc++] Add missing __format__ attributes
-Wformat-nonliteral was turned on in https://reviews.llvm.org/D112927,
however we forgot to apply some __format__ attributes in Linux specific
code paths, which led to warnings when building on Linux. This patch
addresses that oversight.

Differential Revision: https://reviews.llvm.org/D113876
2021-11-26 11:03:14 -05:00
David Spickett 0df522969a Revert "Reland "[lldb] Remove non address bits when looking up memory regions""
This reverts commit fac3f20de5.

I found this has broken how we detect the last memory region in
GetMemoryRegions/"memory region" command.

When you're debugging an AArch64 system with pointer authentication,
the ABI plugin will remove the top bit from the end address of the last
user mapped area.

(lldb)
[0x0000fffffffdf000-0x0001000000000000) rw- [stack]

ABI plugin removes anything above the 48th bit (48 bit virtual addresses
by default on AArch64, leaving an address of 0.

(lldb)
[0x0000000000000000-0x0000000000400000) ---

You get back a mapping for 0 and get into an infinite loop.
2021-11-26 15:35:02 +00:00
Kirill Bobyrev 34cc210aa8
[clangd] IncludeCleaner: Attribute symbols from non self-contained headers to their parents
When a symbol comes from the non self-contained header, we recursively uplift
the file we consider used to the first includer that has a header guard. We
need to do this while we still have FileIDs because every time a non
self-contained header is included, it gets a new FileID but is later
deduplicated by HeaderID and it's not possible to understand where it was
included from.

Based on D114370.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D114623
2021-11-26 16:20:48 +01:00
Alexey Bataev fc0aacf324 [SLP]Improve analysis/emission of vector operands for alternate nodes.
Compiler has an analysis for perfect diamond matching but it does not
support nodes with main/alternate opcodes. The problem is that the
scalars themselves are different and might not match directly with other
nodes, but operands and main/alternate opcodes might match and compiler
might reuse some previously emitted vector instructions. Need to include
this analysis in the cost model and actual vector instructions emission
process.

Differential Revision: https://reviews.llvm.org/D114101
2021-11-26 06:38:02 -08:00
Ruslan Arutyunyan f824bb0e36 [pstl] Fix incorrect usage of std::invoke_result
std::invoke_result takes function object type and arguments separately
(unlike std::result_of) so, std::invoke_result_t<F()> usage is
incorrect.

On the other hand, we don't need std::invoke() semantics here at all. So
just simplifying the code without extra dependency and use trailing
return type as the fix.

Reviewed By: MikeDvorskiy

Differential Revision: https://reviews.llvm.org/D114624
2021-11-26 17:29:08 +03:00
Mats Petersson 30238c3676 [mlir][OpenMP] Add support for SIMD modifier
Add support for SIMD modifier in OpenMP worksharing loops.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111051
2021-11-26 14:04:46 +00:00
Alexey Bataev 6263982172 [SLP][NFC]Add a test for gathered instructions in loop, NFC. 2021-11-26 05:52:48 -08:00
Venkata Ramanaiah Nalamothu 7f05ff8be4 [Bug 49018][lldb] Fix incorrect help text for 'memory write' command
Certain commands like 'memory write', 'register read' etc all use
the OptionGroupFormat options but the help usage text for those
options is not customized to those commands.

One such example is:

  (lldb) help memory read
           -s <byte-size> ( --size <byte-size> )
               The size in bytes to use when displaying with the selected format.
  (lldb) help memory write
	   -s <byte-size> ( --size <byte-size> )
               The size in bytes to use when displaying with the selected format.

This patch allows such commands to overwrite the help text for the options
in the OptionGroupFormat group as needed and fixes help text of memory write.

llvm.org/pr49018.

Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D114448
2021-11-26 19:14:26 +05:30
Florian Hahn b927aa69bf
[SCEV] Turn check in createSimpleAffineAddRec to assertion. (NFC)
Accum is guaranteed to be defined outside L (via Loop::isLoopInvariant
checks above). I think that should guarantee that the more powerful
ScalarEvolution::isLoopInvariant also determines that the value is loop
invariant.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D114634
2021-11-26 13:23:48 +00:00
Matthias Springer b62b21b980 [mlir][linalg][bufferize][NFC] InsertSliceOp no-copy detection as PostAnalysis
There is special logic for InsertSliceOp to check if a memcpy is needed. This change extracts that piece of code and makes it a PostAnalysisStep.

The purpose of this change is to untangle `bufferize` from BufferizationAliasInfo. (Not fully there yet.)

Differential Revision: https://reviews.llvm.org/D114513
2021-11-26 22:19:29 +09:00
Kirill Bobyrev cd0ca5a0ea
[clangd] Record information about non self-contained headers in IncludeStructure
This will be useful for IncludeCleaner.

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D114370
2021-11-26 14:12:54 +01:00
Benjamin Kramer 8521850f20 Provide a definition for OperationPosition::kDown
This isn't necessary in C++17, but C++14 still requires it.
2021-11-26 14:11:59 +01:00
Benjamin Kramer 1b0312d280 [PDL] fix unused variable warning in Release builds 2021-11-26 14:11:58 +01:00
Benjamin Kramer 0e099a64be [tsan] Relax atexit5.cpp a bit more so it's not as dependent on the standard library implementation 2021-11-26 14:02:34 +01:00
Jan Svoboda 97e504cff9 [clang][deps] NFC: Extract function
This commits extracts a couple of nested conditions into a separate function with early returns, making the control flow easier to understand.
2021-11-26 14:01:24 +01:00