Commit Graph

386238 Commits

Author SHA1 Message Date
Olle Fredriksson f5446b769a [MemCpyOpt] Allow variable lengths in memcpy optimizer
This makes the memcpy-memcpy and memcpy-memset optimizations work for
variable sizes as long as they are equal, relaxing the old restriction
that they are constant integers. If they're not equal, the old
requirement that they are constant integers with certain size
restrictions is used.

The implementation works by pushing the length tests further down in the
code, which reveals some places where it's enough that the lengths are
equal (but not necessarily constant).

Differential Revision: https://reviews.llvm.org/D100870
2021-04-21 23:23:38 +02:00
Jonas Devlieghere 6331680ad2 Re-land "[Driver] Support default libc++ library location on Darwin"
This reverts commit 05eeed9691 and after
fixing the impacted lldb tests in 5d1c43f333.

  [Driver] Support default libc++ library location on Darwin

  Darwin driver currently uses libc++ headers that are part of Clang
  toolchain when available (by default ../include/c++/v1 relative to
  executable), but it completely ignores the libc++ library itself
  because it doesn't pass the location of libc++ library that's part
  of Clang (by default ../lib relative to the exceutable) to the linker
  always using the system copy of libc++.

  This may lead to subtle issues when the compilation fails because the
  headers that are part of Clang toolchain are incompatible with the
  system library. Either the driver should ignore both headers as well as
  the library, or it should always try to use both when available.

  This patch changes the driver behavior to do the latter which seems more
  reasonable, it makes it easy to test and use custom libc++ build on
  Darwin while still allowing the use of system version. This also matches
  the Clang driver behavior on other systems.

  Differential Revision: https://reviews.llvm.org/D45639
2021-04-21 14:22:13 -07:00
Yaxun (Sam) Liu 5a2d78b163 [HIP] Add option -fgpu-inline-threshold
Add option -fgpu-inline-threshold for inline threshold for device compilation only.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D99233
2021-04-21 17:18:18 -04:00
Louis Dionne ac8b71227c [libc++] Move macOS testing out of the 2nd CI stage
It's too slow, which delays the posting of CI results to Phabricator
when another step in the same stage fails.
2021-04-21 17:12:43 -04:00
Peter Collingbourne 3d47e003e9 scudo: Make prepareTaggedChunk() and resizeTaggedChunk() generic.
Now that we have a more efficient implementation of storeTags(),
we should start using it from resizeTaggedChunk(). With that, plus
a new storeTag() function, resizeTaggedChunk() can be made generic,
and so can prepareTaggedChunk(). Make it so.

Now that the functions are generic, move them to combined.h so that
memtag.h no longer needs to know about chunks.

Differential Revision: https://reviews.llvm.org/D100911
2021-04-21 13:53:39 -07:00
Peter Collingbourne 46c59d91dc scudo: Use DC GZVA instruction in storeTags().
DC GZVA can operate on multiple granules at a time (corresponding to
the CPU's cache line size) so we can generally expect it to be faster
than STZG in a loop.

Differential Revision: https://reviews.llvm.org/D100910
2021-04-21 13:53:26 -07:00
Walter Erquinigo 79fbbeb412 [lldb-vscode] Add postRunCommands
This diff ass postRunCommands, which are the counterpart of the preRunCommands. TThey will be executed right after the target is launched or attached correctly, which means that the targets can assume that the target is running.

Differential Revision: https://reviews.llvm.org/D100340
2021-04-21 13:51:30 -07:00
Arthur Eubanks b606e2df4d [Evaluator] Bitcast result of pointer stripping
Trying to evaluate a GEP would assert with
  "Ty == cast<PointerType>(C->getType()->getScalarType())->getElementType()"
because the type of the pointer we would evaluate the GEP argument to
would be a different type than the GEP was expecting. We should treat
pointer stripping as a bitcast.

The test adds a redundant GEP that would crash due to type mismatch.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D100970
2021-04-21 13:32:29 -07:00
Jonas Devlieghere 5d1c43f333 [lldb] Use the compiler from the SDK in simulator tests
Use the clang compiler from the SDK to build the simulator test programs
to ensure we pick up the correct libc++.
2021-04-21 13:22:58 -07:00
Mehdi Chinoune 0a7d2b5f50 [flang][msvc] Fix compilation of external-hello-world test with MSVC.
MSVC doesn't accept division by zero.

Reviewed By: Meinersbur

Differential Revision: https://reviews.llvm.org/D96069
2021-04-21 15:18:24 -05:00
Alexey Bataev 07c236f3c3 [SLP]Add a test with broadcast shuffle kind in SLP, NFC. 2021-04-21 13:16:31 -07:00
Arthur Eubanks 24e12e0726 [LLParser] Print mismatched types in error message
Helps with debugging invalid handcrafted IR.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D100990
2021-04-21 13:10:37 -07:00
Dávid Bolvanský 0804f0262f [LoopIdiom] Added testcase from PR44378; NFC 2021-04-21 22:00:32 +02:00
Jez Ng ed4a4e3312 [lld-macho][nfc] Add accessors for commonly-used PlatformInfo fields
As discussed here: https://reviews.llvm.org/D100523#inline-951543

Reviewed By: #lld-macho, thakis, alexshap

Differential Revision: https://reviews.llvm.org/D100978
2021-04-21 15:43:56 -04:00
Nikita Popov 24e9fbc1a3 Revert "[InstCombine] Fold multiuse shr eq zero"
This reverts commit 9423f78240.

A performance regression with this patch has been reported at
https://reviews.llvm.org/rG9423f78240a2#990953. Reverting for now.
2021-04-21 21:40:52 +02:00
Roland McGrath d9b2641aa5 [scudo] Avoid empty statement warnings
An empty macro that expands to just `... else ;` can get
warnings from some compilers (e.g. GCC's -Wempty-body).

Reviewed By: cryptoad, vitalybuka

Differential Revision: https://reviews.llvm.org/D100693
2021-04-21 12:39:09 -07:00
Jordan Rupprecht eb5e11f460 [lldb] Fix RichManglingContext::FromCxxMethodName() leak
`RichManglingContext::FromCxxMethodName` allocates a m_cxx_method_parser, but never deletes it.

This fixes a `-DLLVM_USE_SANITIZER=Leaks` failure.

Reviewed By: teemperor

Differential Revision: https://reviews.llvm.org/D100795
2021-04-21 12:32:08 -07:00
sstefan1 62cdcd6c5a [FuncAttrs] Don't infer willreturn for nonexact definitions
Discovered during attributor testing comparing stats with
and without the attributor. Willreturn should not be inferred
for nonexact definitions.

Differential Revision: https://reviews.llvm.org/D100988
2021-04-21 21:26:09 +02:00
Emily Shi 6ae7fc0a29 [compiler-rt] check max address from kernel is <= mmap range size
If these sizes do not match, asan will not work as expected. Previously, we added compile-time checks for non-iOS platforms. We check at run time for iOS because we get the max VM size from the kernel at run time.

rdar://76477969

Reviewed By: delcypher

Differential Revision: https://reviews.llvm.org/D100784
2021-04-21 12:02:48 -07:00
sstefan1 656ebd519e [SimplifyLibCalls] Don't change alignment when creating memset
Fix for PR49984
This was discovered during Attributor testing.
Memset was always created with alignment of 1
and in case when strncpy alignment was changed
it triggered an assertion in the AttrBuilder.
Memset will now be created with appropriate alignment.

Differential Revision: https://reviews.llvm.org/D100875
2021-04-21 20:34:13 +02:00
Ahmed Taei 10d7924581 Fix FoldReshapeOpWithUnitExtent generating illegal reshape
This will prevent fusion that spains all dims and generates
(d0, d1, ...) -> () reshape that isn't legal

Differential Revision: https://reviews.llvm.org/D100805
2021-04-21 11:30:45 -07:00
Sanjay Patel 5e6dc5e404 [InstSimplify] generalize ctlz-of-shifted-constant
https://alive2.llvm.org/ce/z/zWL_VQ
2021-04-21 14:23:55 -04:00
Sanjay Patel 859e1f420d [InstSimplify] add tests for ctlz-of-shift-constant; NFC 2021-04-21 14:23:55 -04:00
Nico Weber b309f17abf [lld/mac] add aarch64 to requirements of encryption-info.s test 2021-04-21 14:21:42 -04:00
Mark de Wever f2ff3b91ec [libc++][doc] Improve Phabricator links.
Removes the "reviews." part of the links as suggested by @ldionne in
D100707.
2021-04-21 20:12:03 +02:00
Krzysztof Parzyszek a7f33d720b [Polly] Explicitly include all std headers
There were some recent header changes, and now some std classes
are no longer available in ScopDetection.cpp with the pre-existing
includes.
2021-04-21 12:52:11 -05:00
Simon Pilgrim a511b55cfd [X86][SSE] getFauxShuffleMask - don't decode OR(SHUFFLE,SHUFFLE) containing UNDEFs. (PR50049)
PR50049 demonstrated an infinite loop between OR(SHUFFLE,SHUFFLE) <-> BLEND(SHUFFLE,SHUFFLE) patterns.

The UNDEF elements were allowing a combined shuffle mask to be widened which lost the undef element, resulting us needing to use the BLEND pattern (as the undef element would need to be zero for the OR pattern). But then bitcast folds would re-expose the undef element allowing us to use OR again.....
2021-04-21 18:47:00 +01:00
Michał Górny e414ede2cd [lldb] [test/Register] Initial tests for regsets in core dumps
Add initial tests for reading register sets from core dumps.  This
includes a C++ program to write registers and dump core, resulting core
dumps for Linux, FreeBSD and NetBSD, and the tests to verify them.

The tests are split into generic part, verifying user-specified register
values, and coredump-specific tests that verify memory addresses that
differ for every dump.

At this moment, all platforms support GPRs and FPRs up to XMM for amd64
target.  The i386 target does not work on NetBSD at all, and is missing
FPRs entirely on FreeBSD.

Differential Revision: https://reviews.llvm.org/D91963
2021-04-21 19:41:09 +02:00
Jez Ng ab9c21bbab [lld-macho] Support LC_ENCRYPTION_INFO
This load command records a range spanning from the end of the load
commands to the end of the `__TEXT` segment. Presumably the kernel will encrypt
all this data.

Reviewed By: #lld-macho, thakis

Differential Revision: https://reviews.llvm.org/D100973
2021-04-21 13:39:56 -04:00
Alexey Bataev 079884225a [OPENMP]Fix PR49698: OpenMP declare mapper causes segmentation fault.
The implicitly generated mappings for allocation/deallocation in mappers
runtime should be mapped as implicit, also no need to clear member_of
flag to avoid ref counter increment. Also, the ref counter should not be
incremented for the very first element that comes from the mapper
function.

Differential Revision: https://reviews.llvm.org/D100673
2021-04-21 10:38:31 -07:00
Fangrui Song 4cbe488188 [lsan][docs] Clarify supported platforms
Differential Revision: https://reviews.llvm.org/D100907
2021-04-21 10:27:55 -07:00
Christopher Di Bella 04733181b5 [libcxx][iterator] adds `std::indirectly_readable` and `std::indirectly_writable`
Implements parts of:
    * P0896R4 The One Ranges Proposal`

Depends on D99873.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D100073
2021-04-21 17:14:28 +00:00
Michael Kruse 89b59345ee [PollyACC] Fix declaration/stub definition mismatch. NFC.
external.c defines stub functions that are never used because of how
Polly uses PPCG. Unfortunately, they are declared as functions without
return values or parameters which does not match their declarations.
Since they are never called, this was usually not a problem, but an LTO
build gets confused with differently declared functions, or in case of
pet_options_args, a global variable declaration that is defined as a
function

Resolve by including the declaring headers in external.c which forces
the declaration and definition to match at compile-time.

This fixes llvm.org/50021
2021-04-21 11:52:43 -05:00
Arthur O'Dwyer 5c40c994c3 [libc++] s/_LIBCPP_NO_HAS_CHAR8_T/_LIBCPP_HAS_NO_CHAR8_T/g
This was raised in D94511.

Differential Revision: https://reviews.llvm.org/D100736
2021-04-21 12:49:07 -04:00
Arthur O'Dwyer e9d876159e [libc++] [test] Remove epicyclic workarounds for vector/span; use T[] or std::array.
Simplify the test code, and drive-by also test that these algorithms
return the right iterator as their return value.

Differential Revision: https://reviews.llvm.org/D100876
2021-04-21 12:41:45 -04:00
Hongtao Yu b6db6f5530 [CSSPGO] Exclude pseudo probe from slotindex verification. 2021-04-21 09:17:12 -07:00
Nico Weber e6eaacbf0b [gn build] add llvm-profgen to gn build
Didn't notice it missing due to https://reviews.llvm.org/D89707#2705110
2021-04-21 11:50:41 -04:00
LLVM GN Syncbot 35c564dc96 [gn build] Port 97e383aa06 2021-04-21 15:39:33 +00:00
Alexander Shaposhnikov b5720354ef [lld][MachO] Refactor findCommand
Refactor findCommand to allow passing multiple types. NFC.

Test plan: make check-lld-macho

Differential revision: https://reviews.llvm.org/D100954
2021-04-21 08:38:17 -07:00
Pavel Labath 55ee541653 [lldb/test] Clean up TestThreadSpecificBpPlusCondition inferior
The test had a race that could cause two threads to end up with the same
"thread local" value. I believe this would not cause the test to fail,
but it could cause it to succeed even when the functionality is broken.

The new implementation removes this uncertainty, and removes a lot of
cruft left over from the time this test was written using pthreads.
2021-04-21 17:37:30 +02:00
Stanislav Mekhanoshin f9d0d0d7e0 [AMDGPU] Lower regbanks reassign threshold to 15000
Let it work on a very small kernels only. Measurements showed
the performance benefit is not worth the compile time.

Differential Revision: https://reviews.llvm.org/D100904
2021-04-21 08:34:11 -07:00
Louis Dionne 97e383aa06 [libc++] Add std::ranges::iter_move and std::iter_rvalue_reference_t
Original patch by @cjdb, modified by @ldionne.

Differential Revision: https://reviews.llvm.org/D99873
2021-04-21 11:32:00 -04:00
Nico Weber 861eff24df [flang] iwyu fixes after ba7a92c01e 2021-04-21 11:10:45 -04:00
Nico Weber 297a5b7cbc [mlir] hopefully final round of iwyu fixes after ba7a92c01e 2021-04-21 11:03:06 -04:00
Pavel Labath 953f580b90 [lldb/test] Modernize lldb-server test inferior
Avoid c string manipulation by introducing a StringRef-like
consume_front operation.
2021-04-21 17:02:41 +02:00
Nico Weber 56f987fafe [mlir] yet more iwyu fixes after ba7a92c01e 2021-04-21 10:54:44 -04:00
Nico Weber 41711c0c14 [mlir] more iwyu fixes after ba7a92c01e 2021-04-21 10:50:59 -04:00
Nico Weber fce0ef277d [mlir] some iwyu fixes after ba7a92c01e 2021-04-21 10:48:54 -04:00
Martin Probst 70ae843d99 clang-format: [JS] do not wrap after `asserts`
`asserts` is a pseudo keyword in TypeScript used in return types.
Wrapping after it triggers automatic semicolon insertion, which
breaks the code semantics/syntax.

`asserts` is different from other pseudo keywords in that it is
specific to TS and only carries meaning in a very specific location.
Thus introducing a token type is probably overkill.

Differential Revision: https://reviews.llvm.org/D100953
2021-04-21 16:33:55 +02:00
dfukalov a8b35e0f52 [TTI] NFC: Change getVectorSplitCost to return InstructionCost
This patch migrates the TTI cost interfaces to return an InstructionCost.

See this patch for the introduction of the type: https://reviews.llvm.org/D91174
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2020-November/146408.html

Reviewed By: sdesmalen

Differential Revision: https://reviews.llvm.org/D100952
2021-04-21 17:32:02 +03:00