Commit Graph

419172 Commits

Author SHA1 Message Date
Fangrui Song dcad676958 [CGSCC] Use make_early_inc_range. NFC 2022-03-23 15:31:09 -07:00
Adrian Prantl 12606d16bc Revert "Expose GetAddressingBits() in the Process API."
This reverts commit 7504dd5e00.

In newer review feedback it was pointed out that there is a better API for this in Process::GetCodeAddressMask().
2022-03-23 15:28:34 -07:00
Joseph Huber 0d16c23af1 [OpenMP] Do not create offloading entries for internal or hidden symbols
Currently we create offloading entries to register device variables with
the host. When we register a variable we will look up the symbol in the
device image and map the device address to the host address. This is a
problem when the symbol is declared with hidden visibility or internal
linkage. This means the symbol is not accessible externally and we
cannot get its address. We should still allow static variables to be
declared on the device, but ew should not create an offloading entry for
them so they exist independently on the host and device.

Fixes #54309

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D122352
2022-03-23 18:27:16 -04:00
Keith Smiley 955cff803e reland: [AArch64] Add support for -march=native for Apple M1 CPU
This reverts commit fc3cdd0b29.

The issue was imports being scoped to specific architectures for Apple
platforms.
2022-03-23 15:19:17 -07:00
Chia-hung Duan 14ecafd0bd [mlir] Make OpBuilder::createOperation to accept raw inputs
This provides a way to create an operation without manipulating
OperationState directly. This is useful for creating unregistered ops.

Reviewed By: rriddle, mehdi_amini

Differential Revision: https://reviews.llvm.org/D120787
2022-03-23 22:13:48 +00:00
Valentin Clement 00cc73044d
[flang][NFC] Add lowering tests for interfaces
This patch adds lowering tests for Fortran
interfaces.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D122326

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-03-23 23:02:44 +01:00
Valentin Clement e847374e19
[flang][NFC] Add derived type lowering tests
Add more use cases of lowering of derived types.

This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D122329

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>
2022-03-23 23:00:02 +01:00
Wenlei He 0ca8ff4da1 [llvm-profdata] Unify default cutoffs for detailed summary printing
Use `ProfileSummaryBuilder::DefaultCutoffs` for llvm-profdata detailed summary printing for Instr profile.

Differential Revision: https://reviews.llvm.org/D122210
2022-03-23 14:38:53 -07:00
Jacques Pienaar 450692d5b4 [mlir] Add simple fuzzer for textual format
Only use this on generic parser for now by not registering any dialect. For flushing out some parser bugs. The textual format is not meant to be load bearing in production runs, but still useful to remove edge cases/failures.

Differential Revision: https://reviews.llvm.org/D122267
2022-03-23 14:33:50 -07:00
Fabian Wolff 528e6eba2f [clang] Improve diagnostic for reopened inline namespace
Reviewed By: cor3ntin, aaron.ballman

Differential Revision: https://reviews.llvm.org/D122278
2022-03-23 22:30:45 +01:00
Keith Smiley fc3cdd0b29 Revert "[AArch64] Add support for -march=native for Apple M1 CPU"
This reverts commit fcca10c69a.
2022-03-23 14:27:02 -07:00
Adrian Prantl 7504dd5e00 Expose GetAddressingBits() in the Process API.
This is needed by the Swift Plugin.

See also  https://github.com/apple/llvm-project/pull/4110.

Differential Revision: https://reviews.llvm.org/D122347
2022-03-23 14:22:26 -07:00
Hongtao Yu 3f97016857 [llvm-profgen] Decoding pseudo probe for profiled function only.
Complete pseudo probes decoding can result in large memory usage. In practice only a small porting of the decoded probes are used in profile generation. I'm changing the full decoding mode to be decoding for profiled functions only, though we still do a full scan of the .pseudoprobe section due to a missing table-of-content but we don't have to build the in-memory data structure for functions not sampled.

To build the in-memory data structure for profiled functions only, I'm rewriting the previous non-recursive probe decoding logic to be recursive. This is easy to read and maintain.

I also have to change the previous representation of unsymbolized context from probe-based stack to address-based stack since the profiled functions are unknown yet by the time of virtual unwinding. The address-based stack will be converted to probe-based stack after virtual unwinding and on-demand probe decoding.

I'm seeing 20GB memory is saved for one of our internal large service.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D121643
2022-03-23 14:15:11 -07:00
Dávid Bolvanský d90a3fcacd [Clang] Added testcases for -Wunused-but-set-parameter
Clang now emits warnings for them after D122271 (shared logic with -Wunused-but-set-variable)
2022-03-23 22:14:38 +01:00
Keith Smiley fcca10c69a [AArch64] Add support for -march=native for Apple M1 CPU
This improves the getHostCPUName check for Apple M1 CPUs, which
previously would always be considered cyclone instead. This also enables
`-march=native` support when building on M1 CPUs which would previously
fail. This isn't as sophisticated as the X86 CPU feature checking which
consults the CPU via getHostCPUFeatures, but this is still better than
before. This CPU selection could also be invalid if this was run on an
iOS device instead, ideally we can improve those cases as they come up.

Differential Revision: https://reviews.llvm.org/D119788
2022-03-23 14:06:59 -07:00
Dávid Bolvanský 460fc440ad [Clang] -Wunused-but-set-variable warning - handle also pre/post unary operators
Clang fails to diagnose:
```
void test() {
    int j = 0;
    for (int i = 0; i < 1000; i++)
            j++;
    return;
}
```

Reason: Missing support for UnaryOperator.

We should not warn with volatile variables... so add check for it.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D122271
2022-03-23 22:05:36 +01:00
Siva Chandra Reddy 7fdb50c813 [libc] Add a new rule add_integration_test.
All existing loader tests are switched to an integration test added with
the new rule. Also, the getenv test is now enabled as an integration test.

All loader tests have been moved to test/integration. Also, the simple
checker library for the previous loader tests has been moved to a
separate directory of its own.

A follow up change will perform more cleanup of the loader CMake rules
to eliminate now redundent options.

Reviewed By: lntue, michaelrj

Differential Revision: https://reviews.llvm.org/D122266
2022-03-23 20:57:29 +00:00
Austin Kerbow 1e15adba62 [AMDGPU] Add s_nop WaitStates between neighboring mfma
In some cases padding bubbles between sequential MFMA instructions may
lead to increased inter-wave performance. Add option to request to pad
some portion of these stall cycles with s_nops.

Fixes: SWDEV-326925

Reviewed By: rampitec

Differential Revision: https://reviews.llvm.org/D121437
2022-03-23 13:56:09 -07:00
Johannes Doerfert ee94a4a3d0 [Attributor][FIX] Avoid endless recursion, simple case
There is potential for endless recursion if we try to determine the
underlying objects of a load, just to end up with the load as underlying
object. A proper solution will require us to pass a visited set around.
This will happen as we cleanup genericValueTraversal soon.
2022-03-23 15:55:32 -05:00
Nico Weber 0ff3cc2087 [gn build] Change python run lines to python3
macOS 12.3 no longer ships non-3 python.

Almost all of these scripts were launched by ninja, and the GN files
already told it to run them under python3, so this is a fairly small
change.  The main effect is that if you run them manually, you now
get the same behavior.

(A small set of scripts, gn.py, gen.py, sync_source_lists_from_cmake.py,
are for manual running.  For these, it is an actual change.)

Differential Revision: https://reviews.llvm.org/D122345
2022-03-23 16:42:18 -04:00
Siva Chandra Reddy 3bfbb68e1e [libc] Rename libc-integration-test to libc-api-test.
Reviewed By: jeffbailey, michaelrj

Differential Revision: https://reviews.llvm.org/D122272
2022-03-23 20:25:34 +00:00
Mogball 7c72f55ea8 [mlir] Fix emitting an error at EOF
Emitting at error at EOF will emit the diagnostic past the end of the file. When emitting an error during parsing at EOF, emit it at the previous character.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D122295
2022-03-23 20:23:01 +00:00
Nico Weber 88da78ddd0 Install symlink "otool" if LLVM_INSTALL_CCTOOLS_SYMLINKS is set
Differential Revision: https://reviews.llvm.org/D122313
2022-03-23 16:22:24 -04:00
Florian Hahn 890fc21742
[LV] Extend checks in debugloc.ll. 2022-03-23 20:21:58 +00:00
Nico Weber 69cde915e9 [gn build] add llvm_install_cctools_symlinks arg
It behaves (mostly) like the LLVM_INSTALL_CCTOOLS_SYMLINKS option
in cmake.

The minor difference is that the llvm-objcopy symlinks bitcode_strip
and install_name_tool symlink to llvm-objcopy directly in the GN build,
while it's a bitcode_strip -> llvm-bitcode-strip -> objcopy chain
in the CMake build (and analogous for install_name_tool).

The implementation is very similar to the implementation of the
existing llvm_install_binutils_symlinks arg.

Differential Revision: https://reviews.llvm.org/D122312
2022-03-23 16:19:54 -04:00
Nico Weber f9889dd28a [gn build] (manually) port b0fd9497af 2022-03-23 16:16:53 -04:00
Erich Keane 3fb101a691 [NFC] Replace a not-null-check && isa with isa_and_nonnull 2022-03-23 13:09:28 -07:00
minglotus-6 e2074de6a8 [ProfSampleLoader] When disable-sample-loader-inlining is true, merge profiles of inlined instances to outlining versions.
When --disable-sample-loader-inlining is true, skip inline transformation, but merge profiles of inlined instances to outlining versions.

Differential Revision: https://reviews.llvm.org/D121862
2022-03-23 13:02:48 -07:00
Nathaniel McVicar 4907cfe2cb [mlir][MemRef] Fix warning on unsigned comparison
Fix warning in clang introduced in D121766.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D122333
2022-03-23 12:47:04 -07:00
Nico Weber e85aee06d8 [gn build] (manually) port b0fd9497af 2022-03-23 15:46:42 -04:00
Louis Dionne b0fd9497af [libc++] Add a lightweight overridable assertion handler
This patch adds a lightweight assertion handler mechanism that can be
overriden at link-time in a fashion similar to `operator new`.

This is a third take on https://llvm.org/D121123 (which allowed customizing
the assertion handler at compile-time), and https://llvm.org/D119969
(which allowed customizing the assertion handler at runtime only).

This approach is, I think, the best of all three explored approaches.
Indeed, replacing the assertion handler in user code is ergonomic,
yet we retain the ability to provide a custom assertion handler when
deploying to older platforms that don't have a default handler in
the dylib.

As-is, this patch provides a pretty good amount of backwards compatibility
with the previous debug mode:

- Code that used to set _LIBCPP_DEBUG=0 in order to get basic assertions
  in their code will still get basic assertions out of the box, but
  those assertions will be using the new assertion handler support.
- Code that was previously compiled with references to __libcpp_debug_function
  and friends will work out-of-the-box, no changes required. This is
  because we provide the same symbols in the dylib as we used to.
- Code that used to set a custom __libcpp_debug_function will stop
  compiling, because we don't provide that declaration anymore. Users
  will have to migrate to the new way of setting a custom assertion
  handler, which is extremely easy. I suspect that pool of users is
  very limited, so breaking them at compile-time is probably acceptable.

The main downside of this approach is that code being compiled with
assertions enabled but deploying to an older platform where the assertion
handler didn't exist yet will fail to compile. However users can easily
fix the problem by providing a custom assertion handler and defining
the _LIBCPP_AVAILABILITY_CUSTOM_ASSERTION_HANDLER_PROVIDED macro to
let the library know about the custom handler. In a way, this is
actually a feature because it avoids a load-time error that one would
otherwise get when trying to run the code on the older target.

Differential Revision: https://reviews.llvm.org/D121478
2022-03-23 15:35:46 -04:00
Sanjay Patel b6efd2510a [InstCombine] add tests for nsw propagation; NFC
These are based on tests that were included in the abandoned D122299.
Comments indicate what should or should not happen if we change
behavior in Negator.
2022-03-23 15:31:25 -04:00
Med Ismail Bennani 9216baf87d [lldb/test] Add events listener helper function to lldbtest
This patch introduces 2 new lldb utility functions:
- lldbutil.start_listening_from: This can be called in the test setup to
  create a listener and set it up for a specific event mask and add it
  to the user-provided broadcaster's list.
- lldbutil.fetch_next_event: This will use fetch a single event from the
  provided istener and return it if it matches the provided broadcaster.

The motivation behind this is to easily test new kinds of events
(i.e. Swift type-system progress events). However, this patch also
updates `TestProgressReporting.py` and `TestDiagnosticReporting.py`
to make use of these new helper functions.

Differential Revision: https://reviews.llvm.org/D122193

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2022-03-23 12:30:09 -07:00
chenglin.bi 52f323d0f1 [InstCombine] Fold abs of known negative operand when source is sub
When abs source comes from (x - y), check if a "x > y" dominating
condition exists.

Fixes #54132

Differential Revision: https://reviews.llvm.org/D122013
2022-03-23 15:21:33 -04:00
Craig Topper 6c90a654bb [RISCV] Simplify some code in lowering vector int<->fp conversions. NFC
Don't call EltVT.getSizeInBits() or SrcEltVT.getSizeInBits() a second
time. They are already in EltSize or SrcEltSize variables.

Refactor some comparisons to use multiply instead of division.
2022-03-23 12:09:05 -07:00
Simon Pilgrim b75399a5e2 [InstCombine] Add some initial SimplifyDemandedBits tests for removal of ashr with sufficient signbits
We have this in SelectionDAG but it's missing in InstCombine

Based off PR21929 test case
2022-03-23 19:07:10 +00:00
Daniel Grumberg f833aab0d0 [clang][extract-api] Enable processing of multiple headers
Before actually executing the ExtractAPIAction, clear the
CompilationInstance's input list and replace it with a single
synthesized file that just includes (or imports in ObjC) all the inputs.

Depends on D122141

Differential Revision: https://reviews.llvm.org/D122175
2022-03-23 19:05:19 +00:00
wren romano ebc8466481 [mlir][sparse] Adding {pointer,index}OverheadTypeEncoding
Work towards: https://github.com/llvm/llvm-project/issues/51652

The new functions fill the gap between `overheadTypeEncoding` and `get{Pointer,Index}OverheadType`.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D122056
2022-03-23 12:04:47 -07:00
Arthur Eubanks d051c566cd [test] Remove the last couple uses of -analyze in llvm/test 2022-03-23 11:31:12 -07:00
Arthur Eubanks df1a216a62 [test] Set -verify-cfg-preserved=0 in new-pm-defaults.ll
Matches other similar tests.
2022-03-23 11:09:41 -07:00
Arthur Eubanks 9bd66b312c [PassManager][Coroutine] Run passes under -O0 conditionally and run GlobalDCE
CoroSplit lowers various coroutine intrinsics. It's a CGSCC pass and
CGSCC passes don't run on unreachable functions. Normally GlobalDCE will
come along and delete unreachable functions, but we don't run GlobalDCE
under -O0, so an unreachable function with coroutine intrinsics may
never have CoroSplit run on it.

This patch adds GlobalDCE when coroutines intrinsics are present. It
also now runs all coroutine passes conditional when coroutine intrinsics
are present. This should also solve the -O0 regression reported in
D105877 due to LazyCallGraph construction.

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

Reviewed By: ChuanqiXu

Differential Revision: https://reviews.llvm.org/D122275
2022-03-23 11:03:26 -07:00
Arthur Eubanks e6ead19b77 Revert "Recommit "[SLP] Fix lookahead operand reordering for splat loads." attempt 2, fixed assertion crash."
This reverts commit 27bd8f9492.

Causes crashes, see comments in D121973
2022-03-23 10:57:45 -07:00
Roger Kim f858fba631 [lld][Macho][NFC] Encapsulate priorities map in a priority class
`config->priorities` has been used to hold the intermediate state during the construction of the order in which sections should be laid out. This is not a good place to hold this state since the intermediate state is not a "configuration" for LLD. It should be encapsulated in a class for building a mapping from section to priority (which I created in this diff as the `PriorityBuilder` class).

The same thing is being done for `config->callGraphProfile`.

Reviewed By: #lld-macho, int3

Differential Revision: https://reviews.llvm.org/D122156
2022-03-23 13:57:26 -04:00
Sam McCall 31dc248ffc [clangd] Fix IncludeFixer test on windows
Actual functionality doesn't seem to work with (default)
-fms-compatibility. Not sure why yet...
2022-03-23 18:57:08 +01:00
Louis Dionne cb1598cf6e [libc++] Correct outdated documentation about __config_site
The way we handle __config_site changed 1-2 years ago, and the
documentation was never updated -- this commit does that.
2022-03-23 13:42:04 -04:00
Roger Ferrer Ibanez d2663fcc39 [flang][Evaluate] Fold DBLE
We can reuse the folding of REAL.

Differential Revision: https://reviews.llvm.org/D122214
2022-03-23 17:27:05 +00:00
Aaron Ballman e4a42c5b64 Change __auto_type behavior with qualifiers to match GCC behavior
Currently, Clang handles some qualifiers correctly for __auto_type, but
it does not handle the restrict or _Atomic qualifiers in the same way
that GCC does. This patch handles those qualifiers so that they attach
to the deduced type the same as const and volatile already do.

This fixes https://github.com/llvm/llvm-project/issues/53652
2022-03-23 13:25:31 -04:00
Louis Dionne 215f5fd135 [libc++][NFC] Change availability macro from macosx to macos
The Clang documentation mentions that macosx is supported for backwards
compatibility, but it's deprecated.
2022-03-23 13:14:19 -04:00
Louis Dionne cc82a1b02a [libc++][NFC] Fix include guards and add a missing license header 2022-03-23 13:14:19 -04:00
Jonas Devlieghere 9a88c2b639
[lldb] Fixup tagged pointers ISAs
This patch upstreams support for tagger pointer ISAs.
2022-03-23 09:59:34 -07:00