Commit Graph

414075 Commits

Author SHA1 Message Date
wangpc c53d99c37d [RISCV] Split f64 undef into two i32 undefs
So that no store instruction will be generated.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D118222
2022-02-08 13:42:15 +08:00
Lang Hames adbc7a2665 [llvm-jitlink] Don't add process symbols to every JITDylib.
The addProcessSymbols function added a generator for process symbols to every
JITDylib in the session, but this is unhelpful default behavior (e.g. it will
cause the ORC runtime's definition of __cxa_atexit to be shadowed by the
process's definition for all JITDylibs except main).

Since the loadProcessSymbols function already added a generator to main we only
need to drop this function. Other JITDylibs wishing to resolve process symbols
can link against the main JITDylib by passing `-lmain`.
2022-02-08 16:18:43 +11:00
Lang Hames ea0ce326fd [ORC-RT] Make ExecutorAddr hashable.
This will be used in an upcoming macho_platform patch.
2022-02-08 16:11:07 +11:00
Amir Ayupov c840047c38 [BOLT][CMAKE][NFC] Update runtime/CMakeLists.txt
Summary:
- Specify compiler flags for runtime libraries as BOLT_RT_FLAGS,
- Remove redundant CMake definitions.

Reviewers: maksfb

FBD34048561
2022-02-07 21:04:41 -08:00
Amir Ayupov 03f014c9ae [BOLT] Add ld.lld substitution
Register ld.lld substition (tests were failing)

Reviewed By: yota9

Differential Revision: https://reviews.llvm.org/D118738
2022-02-07 20:59:18 -08:00
wangpc cb0fff4397 [RISCV] Pre-commit test for D118222
Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D119212
2022-02-08 12:52:13 +08:00
Lang Hames 6646832f18 [ORC-RT] Add more string_view operations and tests.
Adds construction from std::string, an ostream &operator<< and std::hash
specialization. Also adds unit tests for each of these operations, as well as
tests for copy construction and assignment.

These new operations will be used in upcoming macho_platform patches.
2022-02-08 15:29:31 +11:00
Lang Hames f8006a0a40 [ORC-RT] Fix typos in testcase.
Replace references to 'span' in string_view tests that were originally copied
from span tests.
2022-02-08 15:14:47 +11:00
Keith Smiley 4669cc9394 [test][llvm-objcopy/mac] Fix invalid strip tests
I discovered some of these tests had `cmp` statements that weren't
actually being run. I had also recently copied this broken setup for a
new test around chained fixups. Fixing this revealed that the binaries
did differ because of their code signature so I regenerated the fixture
here with this source:

```c
int main() {
   return 0;
}
```

Passing `-Wl,-no_adhoc_codesign` on my M1 machine to make sure it didn't
get any signature.

Differential Revision: https://reviews.llvm.org/D119203
2022-02-07 20:01:48 -08:00
Keith Smiley c4ac46b95d [test][llvm-objcopy/mac] Move test to new file
Follow up from https://reviews.llvm.org/D118526

Differential Revision: https://reviews.llvm.org/D119149
2022-02-07 19:59:04 -08:00
Chuanqi Xu 3504937dfb [C++20] [Modules] Don't create multiple global module fragment
Since the serialization code would recognize modules by names and the
name of all global module fragment is <global>, so that the
serialization code would complain for the same module.

This patch fixes this by using a unique global module fragment in Sema.
Before this patch, the compiler would fail on an assertion complaining
the duplicated modules.

Reviewed By: urnathan, rsmith

Differential Revision: https://reviews.llvm.org/D115610
2022-02-08 11:52:09 +08:00
Chuanqi Xu e39ba04617 [C++20] [Coroutines] Warning for always_inline coroutine
See the discussion in https://reviews.llvm.org/D100282. The coroutine
marked always inline might not be inlined properly in current compiler
support. Since the coroutine would be splitted into pieces. And the call
to resume() and destroy() functions might be indirect call. Also the
ramp function wouldn't get inlined under O0 due to pipeline ordering
problems. It might be different to what users expects to. Emit a warning
to tell it.

This is what GCC does too: https://godbolt.org/z/7eajb1Gf8

Reviewed By: Quuxplusone

Differential Revision: https://reviews.llvm.org/D115867
2022-02-08 11:43:42 +08:00
River Riddle 7889ff7f00 [mlir] Finish removing FunctionPass
FunctionPass has been deprecated in favor of OperationPass<FuncOp>
for a few weeks, and this commit finished the deprecation with deletion.
The only difference between the two is that FunctionPass filters out function
declarations. When updating references to FunctionPass, ensure that
the pass either can handle declarations or explicitly add in filtering.

See https://llvm.discourse.group/t/functionpass-deprecated-in-favor-of-operationpass-funcop

Differential Revision: https://reviews.llvm.org/D118735
2022-02-07 19:04:52 -08:00
River Riddle 2418cd92c0 [mlir] Update uses of `parser`/`printer` ODS op field to `hasCustomAssemblyFormat`
The parser/printer fields are deprecated and in the process of being removed.
2022-02-07 19:03:58 -08:00
River Riddle 12bfd159b7 [mlir] Update Toy operations to use the `hasCustomAssemblyFormat` field
The parser/printer fields are deprecated and in the process of being removed.
2022-02-07 19:03:58 -08:00
River Riddle 60cac0c081 [mlir][NFC] Remove deprecated/old build/fold/parser utilities from OpDefinition
These have generally been replaced by better ODS functionality, and do not
need to be explicitly provided anymore.

Differential Revision: https://reviews.llvm.org/D119065
2022-02-07 19:03:58 -08:00
River Riddle 3c69bc4d6e [mlir][NFC] Remove a few op builders that simply swap parameter order
Differential Revision: https://reviews.llvm.org/D119093
2022-02-07 19:03:57 -08:00
River Riddle d7f0083dca [mlir:ODS] Deprecate Op parser/printer fields in favor of a new hasCustomAssemblyFormat field
Currently if an operation wants a C++ implemented parser/printer, it specifies inline
code blocks. This is quite problematic for various reasons, e.g. it requires defining
C++ inside of Tablegen which is discouraged when possible, but mainly because
nearly all usages simply forward to static functions (e.g. `static void parseSomeOp(...)`)
with users devising their own standards for how these are defined.

This commit adds support for a `hasCustomAssemblyFormat` bit field that specifies if
a C++ parser/printer is needed, and when set to 1 declares the parse/print methods for
operations to override. For migration purposes, the existing behavior is untouched. Upstream
usages will be replaced in a followup to keep this patch focused on the new implementation.

Differential Revision: https://reviews.llvm.org/D119054
2022-02-07 19:03:57 -08:00
Arthur Eubanks 45084eab5e [clang] Fix some clang->llvm type cache invalidation issues
Take the following as an example

  struct z {
    z (*p)();
  };

  z f();

When we attempt to get the LLVM type of f, we recurse into z. z itself
has a function pointer with the same type as f. Given the recursion,
Clang simply treats z::p as a pointer to an empty struct `{}*`. The
LLVM type of f is as expected. So we have two different potential
LLVM types for a given Clang type. If we store one of those into the
cache, when we access the cache with a different context (e.g. we
are/aren't recursing on z) we may get an incorrect result. There is some
attempt to clear the cache in these cases, but it doesn't seem to handle
all cases.

This change makes it so we only use the cache when we are not in any
sort of function context, i.e. `noRecordsBeingLaidOut() &&
FunctionsBeingProcessed.empty()`, which are the cases where we may
decide to choose a different LLVM type for a given Clang type. LLVM
types for builtin types are never recursive so they're always ok.

This allows us to clear the type cache less often (as seen with the
removal of one of the calls to `TypeCache.clear()`). We
still need to clear it when we use a placeholder type then replace it
later with the final type and other dependent types need to be
recalculated.

I've added a check that the cached type matches what we compute. It
triggered in this test case without the fix. It's currently not
check-clang clean so it's not on by default for something like expensive
checks builds.

This change uncovered another issue where the LLVM types for an argument
and its local temporary don't match. For example in type-cache-3, when
expanding z::dc's argument into a temporary alloca, we ConvertType() the
type of z::p which is `void ({}*)*`, which doesn't match the alloca GEP
type of `{}*`.

No noticeable compile time changes:
https://llvm-compile-time-tracker.com/compare.php?from=3918dd6b8acf8c5886b9921138312d1c638b2937&to=50bdec9836ed40e38ece0657f3058e730adffc4c&stat=instructions

Fixes #53465.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D118744
2022-02-07 18:59:09 -08:00
Sameer Sahasrabuddhe 02a2e46ff0 [AMDGPU] [NFC] refactor the AMDGPU attributor
Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D119087
2022-02-07 21:45:32 -05:00
Carl Ritson a1fb307b4b [AMDGPU] Allow hoisting of some VALU compare instructions
Conversatively allow hoisting/sinking of VALU comparisons.
If the result of a comparison is masked with exec, narrowing the
set of active lanes, then it is safe to hoist it as the masking
instruction will never by hoisted.

Heuristically this is also true for sinking, as we do not expect
the result of a sunk comparison that is masked with exec to be
used outside of the loop.

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D118975
2022-02-08 11:27:23 +09:00
Johannes Doerfert dd101c808b [Attributor][FIX] Do not use assumed information for UB detection
The helper `Attributor::checkForAllReturnedValuesAndReturnInsts`
simplifies the returned value optimistically. In `AAUndefinedBehavior`
we cannot use such optimistic values when deducing UB. As a result, we
assumed UB for the return value of a function because we initially
(=optimistically) thought the function return is `undef`. While we later
adjusted this properly, the `AAUndefinedBehavior` was under the
impression the return value is "known" (=fix) and could never change.

To correct this we use `Attributor::checkForAllInstructions` and then
manually to perform simplification of the return value, only allowing
known values to be used. This actually matches the other UB deductions.

Fixes #53647
2022-02-07 20:19:19 -06:00
Johannes Doerfert 29c8ebad10 [MemoryBuiltins][FIX] Adjust index type size properly wrt. AS casts
Use existing functionality to strip constant offsets that works well
with AS casts and avoids the code duplication.

Since we strip AS casts during the computation of the offset we also
need to adjust the APInt properly to avoid mismatches in the bit width.
This code ensures the caller of `compute` sees APInts that match the
index type size of the value passed to `compute`, not the value result
of the strip pointer cast.

Fixes #53559.

Differential Revision: https://reviews.llvm.org/D118727
2022-02-07 20:19:19 -06:00
Sheng 5aa3af3fcb [M68k][GlobalISel] Implement lowerCall based on M68k calling convention
This patch implements CallLowering::lowerCall based on M68k calling
convention and adds M68kOutgoingValueHandler and CallReturnHandler to
handle argument passing and returned value.
2022-02-07 21:18:54 -05:00
Tue Ly e5e93f60ee [libc] Return a float NaN for log1pf instead of double NaN. 2022-02-07 21:07:09 -05:00
Jez Ng 06f863ac5e [lld-macho] Include address offsets in error messages
This makes it easier to pinpoint the source of the problem.

TODO: Have more relocation error messages make use of this
functionality.

Reviewed By: #lld-macho, oontvoo

Differential Revision: https://reviews.llvm.org/D118798
2022-02-07 21:06:18 -05:00
Craig Topper bbc748996f [SystemZ] Remove a superfluous semicolon to fix a gcc warning. NFC 2022-02-07 17:52:08 -08:00
Lancelot Six 046017291f [AMDGPU][NFC] AMDGPUUsage.rst: fix wording. 2022-02-07 20:06:17 -05:00
Sheng 146c7820d9 [GlobalISel][Legalizer] Support reducing load/store width in big endian order 2022-02-07 20:06:17 -05:00
Sheng 0fe419faa3 M68K: Pre-commit test of D116931 2022-02-07 20:06:17 -05:00
Alex Lorenz b58bf76f97 [clang][driver] update the darwin driver to point to correct macho_embedded path
Compiler-rt started emitting the macho_embedded libraries in
`<resource_dir>/lib/darwin/macho_embedded` after
https://reviews.llvm.org/D105765 / 1e03c37b97,
so update the clang's driver to reflect that.

Differential Revision: https://reviews.llvm.org/D115403
2022-02-07 16:50:58 -08:00
Vladislav Khmelevsky 823ebcc7a8 [BOLT] Fix runtime osx cross-compile build
Place include elf.h under !apple condition

Differential Revision: https://reviews.llvm.org/D119038
2022-02-08 03:42:47 +03:00
Nikolas Klauser 126663211a [libc++][CI] Put runs into groups
Many CI runs are very similar in nature. Let's put them into groups for a better overview

Reviewed By: ldionne, #libc

Spies: libcxx-commits, arichardson, mstorsjo

Differential Revision: https://reviews.llvm.org/D119059
2022-02-08 01:19:10 +01:00
Vladislav Khmelevsky 19fb5a210d [BOLT] Add aarch64 support for peephole passes
Enable peephole optimizations for aarch64.
Also small code refactoring - add PeepholeOpts under Peepholes class.

Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei

Differential Revision: https://reviews.llvm.org/D118732
2022-02-08 03:04:40 +03:00
Craig Topper 2c26cfdef7 [RISCV] Use splat_vector instead of SplatPat in widening FP instruction patterns. NFCI
We use splat_vector for FP nodes without VL, not SplatPat which handles
splat_vector and integer VMV_V_X_VL.

Reduces isel table size by a few hundred bytes.
2022-02-07 15:53:27 -08:00
Craig Topper cef177d186 [VP] llvm.vp.fma intrinsic and LangRef
Differential Revision: https://reviews.llvm.org/D119185
2022-02-07 15:53:27 -08:00
Nico Weber 74e90900e3 [gn build] (manually) port 157bbe6aea 2022-02-07 18:45:04 -05:00
Joe Loser 66dea85b36
[libc++] Mark some members private in experimental/functional
Some members are public but should be private. Nothing requires they are public
right now, so make them private.

Differential Revision: https://reviews.llvm.org/D119097
2022-02-07 18:06:56 -05:00
Mahesh Ravishankar 7568f7101f Revert "[mlir][Linalg] NFC: Combine elementwise fusion test passes."
This reverts commit d730336411.
2022-02-07 22:51:29 +00:00
Louis Dionne 157bbe6aea [libc++] Remove the ability to use the std::nullptr_t emulation in C++03 mode
Back in https://reviews.llvm.org/D109459, we stopped using the C++03
emulation for std::nullptr_t by default, which was an ABI break. We
still left a knob for users to turn it back on if they were broken by
the change, with a note that we would remove that knob after one release.

The time has now come to remove the knob and clean up the std::nullptr_t
emulation.

Differential Revision: https://reviews.llvm.org/D114786
2022-02-07 17:51:05 -05:00
Mahesh Ravishankar d730336411 [mlir][Linalg] NFC: Combine elementwise fusion test passes.
There are a few different test passes that check elementwise fusion in
Linalg. Consolidate them to a single pass controlled by different pass
options (in keeping with how `TestLinalgTransforms` exists).
2022-02-07 22:46:57 +00:00
Dave Lee bf02586c57 [lldb] Call __lldb_init_module from __init__
Update `__init__.py` generation to implement `__lldb_init_module`, which calls
`__lldb_init_module` on submodules that define it.

This allows the use case where a user runs `command script import lldb.macosx`.
With this change, the `__lldb_init_module` function in `crashlog.py` and
`heap.py` will be run, which is where command registration is occurring.

Differential Revision: https://reviews.llvm.org/D119179
2022-02-07 14:43:44 -08:00
Keith Smiley 4c12a75e69 [llvm-libtool-darwin] Add -warnings_as_errors
libtool can currently produce 2 warnings:

1. No symbols were in the object file
2. An object file with the same basename was specified multiple times

The first warning here is often harmless and may just mean you have some
translation units with no symbols for the target you're building for.
The second warning can lead to real issues like those mentioned in
https://reviews.llvm.org/D113130 where ODR violations can slip in.

This introduces a new -warnings_as_errors flag that can be used by build
systems that want to verify they never hit these warnings. For example
with bazel the libtool caller first uniques names to make sure the
duplicate base name case is not possible, but if that doesn't work as
expected, having it fail would be preferred.

It's also worth noting that llvm-libtool-darwin works around an issue
that cctools libtool experiences related to debug info and duplicate
basenames, the workaround is described here:
30baa5d2a4/llvm/lib/Object/ArchiveWriter.cpp (L424-L465)
And it avoids this bug:
f0cbbb1c37/DuplicateBasenameIssue

Differential Revision: https://reviews.llvm.org/D118931
2022-02-07 14:39:21 -08:00
Sanjay Patel d1ecfaa097 [SDAG] try to fold one-demanded-bit-of-multiply
This is a translation of the transform added to InstCombine with:
D118539
2022-02-07 17:24:35 -05:00
Ruslan Arutyunyan 6a929492a6 [libcxx][test][NFC] Add tests for backward iteration over associative
containers

Add test cases for iteration over the ordered associative container from
end to begin using operator--

Reviewed By: Quuxplusone, rarutyun

Differential Revision: https://reviews.llvm.org/D118114
2022-02-08 01:21:42 +03:00
Joseph Huber d28051c4ab [Libomptarget] Replace Value RAII with default value
This patch replaces the ValueRAII pointer with a default 'nullptr'
value. Previously this was initialized as a reference to an existing
variable. The use of this variable caused overhead as the compiler could
not look through the uses and determine that it was unused if 'Active'
was not set. Because of this accesses to the variable would be left in
the runtime once compiled.

Fixes #53641

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D119187
2022-02-07 17:12:00 -05:00
Paul Robinson 260fbffe62 Fix my email address in CODE_OWNERS.TXT 2022-02-07 14:03:50 -08:00
Sanjay Patel be059a1263 [x86] avoid compile-time warning for parens; NFC 2022-02-07 16:59:50 -05:00
Sergei Grechanik bb39ad43ce [mlir][spirv] Fix verification of nested array constants
Fix the verification function of spirv::ConstantOp to allow nesting
array attributes.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D118939
2022-02-07 13:48:53 -08:00
Andrew Browne 77f5a3fbba [Bitstream] Temporarily disable UBSan for invalid bitcode tests. This fixes failing sanitizer buildbots.
Tests added by
  3c86642edd
  f4fca0fbb0
cause existing code to exhibit UB:
  b4c6d1bb37/llvm/include/llvm/Bitstream/BitstreamReader.h (L244)

llvm/include/llvm/Bitstream/BitstreamReader.h:244:51:
runtime error: shift exponent 35 is too large for 32-bit type 'unsigned int'

Hitting the UBSan error before the expected error causes the test to fail under UBSan:

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D119182
2022-02-07 13:55:15 -08:00