Commit Graph

425678 Commits

Author SHA1 Message Date
Martin Storsjö d8e67c1ccc [ARM] Add SEH opcodes in frame lowering
Skip inserting regular CFI instructions if using WinCFI.

This is based a fair amount on the corresponding ARM64 implementation,
but instead of trying to insert the SEH opcodes one by one where
we generate other prolog/epilog instructions, we try to walk over the
whole prolog/epilog range and insert them. This is done because in
many cases, the exact number of instructions inserted is abstracted
away deeper.

For some cases, we manually insert specific SEH opcodes directly where
instructions are generated, where the automatic mapping of instructions
to SEH opcodes doesn't hold up (e.g. for __chkstk stack probes).

Skip Thumb2SizeReduction for SEH prologs/epilogs, and force
tail calls to wide instructions (just like on MachO), to make sure
that the unwind info actually matches the width of the final
instructions, without heuristics about what later passes will do.

Mark SEH instructions as scheduling boundaries, to make sure that they
aren't reordered away from the instruction they describe by
PostRAScheduler.

Mark the SEH instructions with the NoMerge flag, to avoid doing
tail merging of functions that have multiple epilogs that all end
with the same sequence of "b <other>; .seh_nop_w, .seh_endepilogue".

Differential Revision: https://reviews.llvm.org/D125648
2022-06-02 12:28:46 +03:00
jacquesguan 5482ae6328 [LegalizeTypes][VP] Add widen and split support for VP FP integer casting op.
This patch adds widen and split support for VP_FPTOSI, VP_FPTOUI, VP_SITOFP and VP_UITOFP.

Differential Revision: https://reviews.llvm.org/D126847
2022-06-02 09:05:27 +00:00
lewuathe 9f0869a61d [mlir][complex] Lower complex.sin/cos to libm
Lower sin/cos operation in complex dialect to libm as a baseline. This follows up to https://reviews.llvm.org/D125550.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D126755
2022-06-02 10:39:00 +02:00
Nikita Popov 3ed6fc9a69 [llvm-ocaml] Add LLVMBuildCall2 binding
Add binding for the opaque pointer compatible LLVMBuildCall2
API and use it in tests.
2022-06-02 10:36:00 +02:00
lewuathe 4b13b061ae [mlir][complex] Sanity check for tan operation in complex dialect
Add a sanity check for newly added tan operation in complex dialect. It follows-up to https://reviews.llvm.org/D126685.

Differential Revision: https://reviews.llvm.org/D126858
2022-06-02 10:33:40 +02:00
owenca db15e31212 [clang-format] Handle do-while loops for RemoveBracesLLVM
Also updates the unit tests to match the updated LLVM Coding
Standards.

Differential Revision: https://reviews.llvm.org/D126758
2022-06-02 01:08:40 -07:00
Stanislav Gatev 0e286b77cf [clang][dataflow] Add transfer functions for structured bindings
This is part of the implementation of the dataflow analysis framework.
See "[RFC] A dataflow analysis framework for Clang AST" on cfe-dev.

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

Reviewed-by: ymandel, xazax.hun
2022-06-02 08:02:26 +00:00
Benjamin Kramer 5b2a7348b7 [IRTests] With opaque ptrs we can test that there is no bitcast inserted 2022-06-02 09:56:11 +02:00
Nikita Popov 41d5033eb1 [IR] Enable opaque pointers by default
This enabled opaque pointers by default in LLVM. The effect of this
is twofold:

* If IR that contains *neither* explicit ptr nor %T* types is passed
  to tools, we will now use opaque pointer mode, unless
  -opaque-pointers=0 has been explicitly passed.
* Users of LLVM as a library will now default to opaque pointers.
  It is possible to opt-out by calling setOpaquePointers(false) on
  LLVMContext.

A cmake option to toggle this default will not be provided. Frontends
or other tools that want to (temporarily) keep using typed pointers
should disable opaque pointers via LLVMContext.

Differential Revision: https://reviews.llvm.org/D126689
2022-06-02 09:40:56 +02:00
Amir Ayupov 6333e5dde9 [BOLT][NFC] Use colors in CFG dumps
Use color coding to distinguish nodes:
- Entry nodes have bold border
- Scalar (non-loopy) code is milk white
- Outer loops are light yellow
- Innermost loops are light blue

`-print-loops` needs to be enabled to provide BinaryLoopInfo.
Examples:
{F23170673}
{F23170680}

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D126248
2022-06-02 00:27:12 -07:00
Venkata Ramanaiah Nalamothu c6ad690173 [lldb, test] Fix typos in the lldb tests
Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D126596
2022-06-02 12:45:57 +05:30
Weining Lu cfeacec833 [LoongArch] Add the missing ld.d instruction definition 2022-06-02 14:57:23 +08:00
Amir Ayupov cc23c64ff1 [BOLT][NFC] Print block instructions in dumpGraph as part of node label
Reuse the option `-dot-tooltip-code` to put block instructions into the label.
This way, the instructions are displayed by default when used with dot viewer.

When the .dot file is used with dot2html, instructions are hidden by default,
and are shown by clicking on a node.

{F23169510}

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D126237
2022-06-01 23:41:41 -07:00
Amir Ayupov 51c20e5804 [BOLT][UTILS] Add dot2html helper tool to embed dot into html
To be rendered in browser using d3-graphviz.
Example: {F23169510}

Reviewed By: rafauler

Differential Revision: https://reviews.llvm.org/D126218
2022-06-01 23:37:43 -07:00
jacquesguan 19e285477e [mlir][Arithmetic] Add constant folder for RemF.
This patch adds the constant folder for RemF.

Differential Revision: https://reviews.llvm.org/D126045
2022-06-02 06:24:37 +00:00
Weining Lu 8a1250f958 [LoongArch] Fix register type in FCMP_*_D instructions definition
The correct type is FPR64 but not FPR32.
2022-06-02 14:21:58 +08:00
Tobias Hieta fde9ef5214 [NFC][workflow] Fix issue where the workflow would say all PR's already exists 2022-06-02 08:20:21 +02:00
LLVM GN Syncbot 11d8bc98d1 [gn build] Port a15ae4139c 2022-06-02 06:04:25 +00:00
Mark de Wever b3d1142d09 [libc++][doc] Fixes unwanted list nesting. 2022-06-02 08:02:19 +02:00
Mark de Wever a15ae4139c [libc++] Make to_chars base 10 header only.
The functions to_chars and from_chars should offer 128-bit support. This
is the first step to implement 128-bit version of to_chars. Before
implementing 128-bit support the current code will be polished.

This moves the code from the dylib to the header in prepartion of

P2291 "Add Constexpr Modifiers to Functions to_chars and from_chars for
Integral Types in <charconv> Header"

Note some more cleanups will be done in follow-up commits
- Remove the _LIBCPP_AVAILABILITY_TO_CHARS from to_chars. With all code
  in the header the availablilty macro is no longer needed. This
  requires enabling the unit tests for additional platforms.
- The code in the dylib can switch to using the header implementation.
  This allows removing the code duplicated in the header and the dylib.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D125704
2022-06-02 08:00:31 +02:00
Richard b418ef5cb9 [clang-tidy] Reject invalid enum initializers in C files
C requires that enum values fit into an int.  Scan the macro tokens
present in an initializing expression and reject macros that contain
tokens that have suffixes making them larger than int.

C forbids the comma operator in enum initializing expressions, so
optionally reject comma operator.

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

Fixes #55467
2022-06-01 22:25:39 -06:00
eopXD 6eab5cade7 [LSR] Early exit for RateFormula when it is already losing. NFC
This patch does not effect any behavior of the current code.

The codebase implicitly implies that `Cost::RateFormula` is only called
when the `Cost` is not in losing status, or else there may be possible
to trigger the assertion of `Cost::isValid`.

The intention here is to prevent mis-use where future development
allow `Cost` that is already loser to call `Cost::RateFormula` - Early
exit when `Cost` is already losing.

Reviewed By: Meinersbur, #loopoptwg

Differential Revision: https://reviews.llvm.org/D125670
2022-06-01 21:02:40 -07:00
jacquesguan ce820375ef [mlir] Support convert token type from LLVM IR.
This patch supports the token type for converting from LLVM IR.

Differential Revision: https://reviews.llvm.org/D126756
2022-06-02 03:32:51 +00:00
Fangrui Song 146f7fec95 [test] Fix LLVMgold.so tests after D125847 2022-06-01 20:05:01 -07:00
Florian Mayer 13b8bfc514 [libunwind] Add more information to eh_frame_hdr version error
This makes it easier to find the offending ELF file.

Reviewed By: #libunwind, MaskRay

Differential Revision: https://reviews.llvm.org/D126841
2022-06-01 19:48:19 -07:00
Nico Weber 4463bd0f89 unbreak Modules/cxx20-export-import.cpp with LLVM_APPEND_VC_REV after 8c8a2679a2
See revision b8b7a9dcdc for prior art.
2022-06-01 22:33:36 -04:00
Snehasish Kumar 8a87f42fc6 [memprof] Print out the segment information in YAML format.
This change prints out the segment information in the raw profile in
YAML format for testing. Since we don't capture build ids yet, we print
out <None> for now.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D126840
2022-06-02 02:26:39 +00:00
jacquesguan 058791d8f2 [LegalizeTypes][VP] Add widen and split support for VP_SIGN_EXTEND and VP_ZERO_EXTEND.
Differential Revision: https://reviews.llvm.org/D126442
2022-06-02 02:21:22 +00:00
Snehasish Kumar 962db7de84 [memprof] Update summary output.
Update the YAML format print out of the profile to include a summary
instead of displaying the headers in the raw file buffer. This allows us
to release the raw buffer early saving memory.

Reviewed By: tejohnson

Differential Revision: https://reviews.llvm.org/D126834
2022-06-02 02:15:42 +00:00
Matthias Braun fe0f2c1e99 Fix compilation in gold-plugin triggered by D125847 2022-06-01 18:51:35 -07:00
Siva Chandra Reddy 70c8d12b79 [libc] Add pthread_create and pthread_join functions.
They do not yet support all the feature/attributes in pthread_attr_t.
Future changes will add such support.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D126718
2022-06-02 01:47:24 +00:00
Joe Loser 93a375a15c
[libc++][test] Enable constexpr string comparison tests
Some tests in `string.view.comparison` are not enabled due to previous lack of
support for `constexpr std::string`. Now that it is implemented, we can enable
these tests.

Differential Revision: https://reviews.llvm.org/D126737
2022-06-01 19:26:20 -06:00
Chris Bieneman 6784adc63d Fix DXContainer test on ppcbe
Silly mistake, the code here was byteswapping in-place which corrupts
the data structure that is used later to write the correct file.
2022-06-01 20:19:59 -05:00
Alexander Yermolovich ab9a175990 [BOLT][DWARF] Fix TU Index handling for DWARF4/5
When we generate split dwarf with -fdebug-types-section we will have
.debug_types.dwo sections. These go into TU Index when we run llvm-dwp. BOLT was
not handling DWP input correctly with this section.

Added support for handling DWP with TU Index as an input and output for DWARF4.
Added support for handling DWP with TU Index as an input for DWARF5

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D126087
2022-06-01 18:16:12 -07:00
Matt Arsenault 4cb722acbc BranchFolder: Require NoPHIs
The pass doesn't handle SSA and breaks any phis.
2022-06-01 21:14:49 -04:00
Matt Arsenault 09a539e926 AMDGPU: Add release notes about atomic load and store 2022-06-01 21:14:48 -04:00
Matt Arsenault 89b1808a2f AMDGPU: Fix missing c++ mode comment 2022-06-01 21:14:48 -04:00
Matthias Braun 850d53a197 LTO: Decide upfront whether to use opaque/non-opaque pointer types
LTO code may end up mixing bitcode files from various sources varying in
their use of opaque pointer types. The current strategy to decide
between opaque / typed pointers upon the first bitcode file loaded does
not work here, since we could be loading a non-opaque bitcode file first
and would then be unable to load any files with opaque pointer types
later.

So for LTO this:
- Adds an `lto::Config::OpaquePointer` option and enforces an upfront
  decision between the two modes.
- Adds `-opaque-pointers`/`-no-opaque-pointers` options to the gold
  plugin; disabled by default.
- `--opaque-pointers`/`--no-opaque-pointers` options with
  `-plugin-opt=-opaque-pointers`/`-plugin-opt=-no-opaque-pointers`
  aliases to lld; disabled by default.
- Adds an `-lto-opaque-pointers` option to the `llvm-lto2` tool.
- Changes the clang driver to pass `-plugin-opt=-opaque-pointers` to
  the linker in LTO modes when clang was configured with opaque
  pointers enabled by default.

This fixes https://github.com/llvm/llvm-project/issues/55377

Differential Revision: https://reviews.llvm.org/D125847
2022-06-01 18:05:53 -07:00
Hendrik Greving a92ed167f2 [ValueTypes] Define MVTs for v128i2/v64i4 as well as i2 and i4.
Adds MVT::v128i2, MVT::v64i4, and implied MVT::i2, MVT::i4.

Keeps MVT::i2, MVT::i4 lowering actions as expand, which should be
removed once targets set this explicitly.

Adjusts 11 lit tests to reflect slightly different behavior during
DAG combine.

Differential Revision: https://reviews.llvm.org/D125247
2022-06-02 00:49:11 +00:00
Fangrui Song 8d3dda7624 [Polly] Fix -Wreorder-ctor. NFC 2022-06-01 17:33:14 -07:00
Quentin Colombet 1a155ee7de [RegisterClassInfo] Invalidate cached information if ignoreCSRForAllocationOrder changes
Even if CSR list is same between functions, we could have had a different
allocation order if ignoreCSRForAllocationOrder is evaluated differently.
Hence invalidate cached register class information if
ignoreCSRForAllocationOrder changes.

Patch by Srividya Karumuri <srividya_karumuri@apple.com>

Differential Revision: https://reviews.llvm.org/D126565
2022-06-01 17:15:51 -07:00
Fangrui Song 2108f7a243 [Object] Fix namespace style issues in D122069
https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions
2022-06-01 17:04:58 -07:00
Shilei Tian eb673be5ac [OMPIRBuilder] Add the support for compare capture
This patch adds the support for `compare capture` in `OMPIRBuilder`.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D120007
2022-06-01 19:53:43 -04:00
Philip Reames f15add7d93 [RISCV] Split fixed-vector-strided-load-store.ll so it can be autogened
I've gotten tired of updating register allocation changes by hand, let's just autogen this even if we have to duplicate it.
2022-06-01 16:12:35 -07:00
Alexey Bataev 73020b4540 Revert "[SLP]Improve shuffles cost estimation where possible."
This reverts commit fd5a6ce9dc to fix
a crash detected by a buildbot
https://lab.llvm.org/buildbot/#/builders/179/builds/3805/steps/11/logs/stdio.
2022-06-01 15:44:51 -07:00
Joseph Huber afd2f7e991 [Binary] Promote OffloadBinary to inherit from Binary
We use the `OffloadBinary` to create binary images of offloading files
and their corresonding metadata. This patch changes this to inherit from
the base `Binary` class. This allows us to create and insepect these
more generically. This patch includes all the necessary glue to
implement this as a new binary format, along with added the magic bytes
we use to distinguish the offloading binary to the `file_magic`
implementation.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D126812
2022-06-01 18:40:57 -04:00
Craig Topper 909a78b3a4 [RISCV] Use MachineRegisterInfo::use_instr_begin instead of use_begin+getParent. NFCI 2022-06-01 15:37:48 -07:00
David Tenty 8c8a2679a2 [clang][AIX] add option mdefault-visibility-export-mapping
The option mdefault-visibility-export-mapping is created to allow
mapping default visibility to an explicit shared library export
(e.g. dllexport). Exactly how and if this is manifested is target
dependent (since it depends on how they map dllexport in the IR).

Three values are provided for the option:

* none: the default and behavior without the option, no additional export linkage information is created.
* explicit: add the export for entities with explict default visibility from the source, including RTTI
* all: add the export for all entities with default visibility

This option is useful for targets which do not export symbols as part of
their usual default linkage behaviour (e.g. AIX), such targets
traditionally specified such information in external files (e.g. export
lists), but this mapping allows them to use the visibility information
typically used for this purpose on other (e.g. ELF) platforms.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D126340
2022-06-01 18:07:17 -04:00
Matthias Springer 6232a8f3d6 [mlir][sparse][NFC] Switch InitOp to bufferization::AllocTensorOp
Now that we have an AllocTensorOp (previously InitTensorOp) in the bufferization dialect, the InitOp in the sparse dialect is no longer needed.

Differential Revision: https://reviews.llvm.org/D126180
2022-06-02 00:03:52 +02:00
Chris Bieneman 902360d21d Temporarily disabling this test on arm
This is failing on an arm32 builder, and it is going to take me a while
to debug. To not block further progress I'm disabling this test on
arm32 configuraitons.
2022-06-01 16:46:04 -05:00