Commit graph

426690 commits

Author SHA1 Message Date
Eric Schweitz f5b970c9ef
[flang] Fix type mismatch in verification error
FIR models Fortran intrinsic types with deliberate KIND values. Like
Fortran, COMPLEX and REAL have related KINDs in FIR. Lowering now
converts REAL types to floating point (MLIR) up front. This patch moves
the code to convert from FIR RealType to MLIR FloatType out of codegen
and into the builder, allowing FIR ComplexTypes to have their element
type returned as an MLIR FloatType.

We should consider whether to replace fir::ComplexType with
mlir::ComplexType at some point. I believe these types are presently
used to convey distinctins in the target ABIs in the Tilikum bridge
however.

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

Reviewed By: PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-13 21:37:39 +02:00
Nikolas Klauser 3abaefe64c [libc++] Granularize some more of <type_traits>
Reviewed By: ldionne, #libc

Spies: libcxx-commits, mgorny

Differential Revision: https://reviews.llvm.org/D127631
2022-06-13 21:37:26 +02:00
Eric Schweitz 0c1cf585c0
[flang][NFC] Add source location information to report unsupported complex types
This patch is part of the upstreaming effort from fir-dev branch.

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
2022-06-13 21:31:17 +02:00
Mitch Phillips 77475ffd22 Reland "Add sanitizer metadata attributes to clang IR gen."
RE-LAND (reverts a revert):
This reverts commit 8e1f47b596.

This patch adds generation of sanitizer metadata attributes (which were
added in D126100) to the clang frontend.

We still currently generate the llvm.asan.globals that's consumed by
the IR pass, but the plan is to eventually migrate off of that onto
purely debuginfo and these IR attributes.

Reviewed By: vitalybuka, kstoimenov

Differential Revision: https://reviews.llvm.org/D126929
2022-06-13 12:23:27 -07:00
Balazs Benics 0539b456b7 [analyzer][NFC] Remove unused Analyses enum
Reviewed By: martong

Differential Revision: https://reviews.llvm.org/D127485
2022-06-13 21:19:55 +02:00
Mitch Phillips 8e1f47b596 Revert "Add sanitizer metadata attributes to clang IR gen."
This reverts commit e7766972a6.

Broke the Windows buildbots.
2022-06-13 12:11:13 -07:00
owenca 7cb0bc8abf [clang-format] Handle more cases for RemoveBracesLLVM
Call mightFitOneOneline() on the line before the closing brace only
if it is at the level of the block.

Differential Revision: https://reviews.llvm.org/D127614
2022-06-13 12:10:35 -07:00
Zequan Wu 98c2a853eb Minor fix to ae60869908 2022-06-13 12:08:26 -07:00
Zequan Wu ae60869908 Minor fix to 3222f95ea8 2022-06-13 12:06:07 -07:00
Zequan Wu 3222f95ea8 [LLDB][NativePDB] Convert backslash to slash when creating CU and filter out CU with no function in ResolveSymbolContext.
On Windows, when compile with -fdebug-compilation-dir which contains slash, the source file path in PDB will look like "../tmp\file.cc" because the path separator used is determined by target machine. Converting backslash to slash helps lldb to find the CU in ResolveSymbolContext.

We want to filter out CU with no function in ResolveSymbolContext as a cpp file will have two debug info modules in PDB if built with thinlto and one of them is a skeleton with no function debug info.
2022-06-13 12:04:25 -07:00
Stephen Long d4245ed67c [clang-cl] Accept /FA[c][s][u], but ignore the arguments
Previously, /FAsc would emit a warning. Now, it will just do what /FA does.

https://docs.microsoft.com/en-us/cpp/build/reference/fa-fa-listing-file?view=msvc-170

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D127519
2022-06-13 12:01:54 -07:00
Peter Klausler 89e4b75648 [flang] Document extension: Ew.0 output editing
The restrictions on the relationship between a "kP" scale factor
and a Ew.d/Dw.d/Gw.d significant digit count are not enforced for
output editing when there is no nonzero scale factor in effect.
(An error message about a bad scale factor is confusing if no kP
control edit descriptor has been used.)  Document this usage in
Extensions.md.

Differential Revision: https://reviews.llvm.org/D127435
2022-06-13 11:50:11 -07:00
Philip Reames 6bab045d08 [RISCV] Add basic fshr/fshl cost and codegen coverage 2022-06-13 11:49:53 -07:00
Benjamin Kramer de0aa687a2 [mlir][linalg] Add conv_2d_nhwc_fhwc to core_named_ops.py
So it doesn't disappear when running the generator.
2022-06-13 20:43:10 +02:00
Peter Klausler ee9c917048 [flang] Fix bogus branch target error on END SELECT
The scope model used for branch target checking treats a label
on an END SELECT statement as if it were in the previous CASE block.
This makes it illegal to GO TO that label from within any earlier
CASE block in that statement.  Fix by treating the CASE blocks as
nested scopes within the scope of the SELECT construct.

Also, add a "warning:" tag to related warning messages.

Differential Revision: https://reviews.llvm.org/D127425
2022-06-13 11:42:55 -07:00
Craig Topper bb1a52aa8b Recommit "[RISCV] Teach RISCVMergeBaseOffset about cases where we use SHXADD to add some immediates."
With fix for sanitizer build bot failure.
2022-06-13 11:35:44 -07:00
Peter Klausler bd577afe8f [flang][runtime] Fix runtime CSHIFT of rank>1 array case of negative shift count
The calculation of the source index was incorrect when a CSHIFT shift
count value is negative, for the implementation of CSHIFT for arrays
with rank >= 2.  (The vector CSHIFT is fine.)

Differential Revision: https://reviews.llvm.org/D127424
2022-06-13 11:34:25 -07:00
Stephen Tozer 6bc2ad235a [Dexter] Remove debugger-dependent test from windows
One of the tests added in the recent floating point patch involves
string comparison against the debugger output; as DbgEng and LLDB have
different output, the test cannot pass against both of them, so disable
it on windows.
2022-06-13 19:27:34 +01:00
Stephen Long ee6ad7af45 [clang-cl][MSVC] Map /external:Wn n=1-4 to -Wsystem-headers
https://docs.microsoft.com/en-us/cpp/build/reference/external-external-headers-diagnostics?view=msvc-170

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D127452
2022-06-13 11:26:07 -07:00
Peter Klausler 2a07db4cf6 [flang][runtime] Don't crash after reporting I/O statement errors
When an I/O statement is known to be in a recoverable error state,
it shouldn't cause a crash later in execution because it's not in
an expected non-erroneous processing state.  Add checking for the
ErroneousIoStatementState variant on paths that might otherwise
lead to runtime crashes.

Differential Revision: https://reviews.llvm.org/D127423
2022-06-13 11:24:59 -07:00
Mitch Phillips e7766972a6 Add sanitizer metadata attributes to clang IR gen.
This patch adds generation of sanitizer metadata attributes (which were
added in D126100) to the clang frontend.

We still currently generate the `llvm.asan.globals` that's consumed by
the IR pass, but the plan is to eventually migrate off of that onto
purely debuginfo and these IR attributes.

Reviewed By: vitalybuka, kstoimenov

Differential Revision: https://reviews.llvm.org/D126929
2022-06-13 11:19:15 -07:00
Stephen Tozer ec7c959671 [Dexter] Fix incorrect test expectations for floating point tests
A pair of tests had incorrect expectations set, one being an off-by-one
error and the other using decimal points in the expect that lldb omits.
2022-06-13 19:07:18 +01:00
Jez Ng 224094eb44 [lld-macho] Require aarch64 for eh-frame.s test
Should fix the test failure introduced by D124561.
2022-06-13 14:05:07 -04:00
Thomas Raoux 2d32dac8bb Revert "[mlir][vector] Add patterns to ppropagate vector distribution"
This reverts commit 1c84800c42.

This was causing asan crash.
2022-06-13 17:55:31 +00:00
Peter Klausler 1444bc8241 [flang][runtime] Fix list-directed/NAMELIST complex input with "r*" repetition count
The little state machine in GetNextDataEdit() wasn't transitioning
properly from reading the imaginary part of the number back to the
real part for the next iteration of a repeated value.

Differential Revision: https://reviews.llvm.org/D127422
2022-06-13 10:50:25 -07:00
Nico Weber 8c974bfe1c Reland: unbreak Modules/cxx20-export-import.cpp with LLVM_APPEND_VC_REV after 8c8a2679a2
See revision b8b7a9dcdc for prior art.

Reland of: 4463bd0f89 since the dependent
patch D126340 is also relanding.
2022-06-13 13:45:13 -04:00
David Tenty 6a8673038b Reland [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.

This relands commit: 8c8a2679a2

with fixes for the compile time and assert problems that were reported
by:

* making shouldMapVisibilityToDLLExport inline and provide an early return
in the case where no mapping is in effect (aka non-AIX platforms)
* don't try to export RTTI types which we will give internal linkage to

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D126340
2022-06-13 13:43:46 -04:00
Peter Klausler 166d6ed5c7 [flang][runtime] Better (but still synchronous) support for asynchronous I/O
Track pending "asynchronous" I/O operation IDs so that WAIT statements can
report errors about bad ID numbers.

Lowering will need to extended to call GetAsynchronousId() for a READ or
WRITE statement with ID=n.

Differential Revision: https://reviews.llvm.org/D127421
2022-06-13 10:43:14 -07:00
Luís Ferreira 6d5b86f851 [lldb] Add missing UTF-8 char basic type entries
D120690 introduced `eBasicTypeChar8` but missed proper documentation order. This also introduces the missing bindings data on Swig, which should correspond with the documented information.

Reviewed By: labath

Differential Revision: https://reviews.llvm.org/D116136
2022-06-13 17:33:46 +00:00
Peter Klausler 2496938522 [flang][runtime] Fix nonadvancing output edge case
When nonadvancing output uses T/TL control edit descriptors to reposition
the record, don't reset the position to the furthest point written at
the end of the write.

Differential Revision: https://reviews.llvm.org/D127420
2022-06-13 10:27:27 -07:00
Amir Ayupov a2c4d6d332 [BOLT][NFC] Forward declare ReorderBlocks for MSVC19
Fix bolt-x86_64-wine-msvc builder:
https://lab.llvm.org/buildbot/#/builders/222/builds/1154

Reviewed By: maksfb

Differential Revision: https://reviews.llvm.org/D127612
2022-06-13 10:26:58 -07:00
Mitch Phillips 9d99870590 Revert "[RISCV] Teach RISCVMergeBaseOffset about cases where we use SHXADD to add some immediates."
This reverts commit 8bbcb98848.

Broke the UBSan bot. More details in https://reviews.llvm.org/D127376.
2022-06-13 10:16:28 -07:00
Lei Zhang b5192cbe50 [mlir][spirv] Fix result type for arith.cmpi/cmpf conversion
We cannot directly use the original result type; instead we need
to deduce it from the converted operand type. This addresses
invalid ops generated from converting single element vectors.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D127574
2022-06-13 13:15:23 -04:00
Lei Zhang 91de20c36d [mlir][spirv] Use UnrealizedConversionCast in ArithmeticToSPIRV
This avoids pulling in function converion patterns, which is not
part of what we want to test in ArithmeticToSPIRV. It also allows
using ConvertArithmeticToSPIRVPass as a standalone step.

Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D127573
2022-06-13 13:13:57 -04:00
Mitch Phillips d3ddc251ac Revert "[CodeGen] Keep track info of lazy-emitted symbols in ModuleBuilder"
This reverts commit b8f9459715.

Broke the ASan buildbot. See https://reviews.llvm.org/D126781 for more
information.
2022-06-13 10:12:38 -07:00
Mitch Phillips d90eecff5c Revert "Also move WeakRefReferences in CodeGenModule::moveLazyEmssionStates"
This reverts commit 0ecbedc098.

Parent change broke the ASan buildbot. See
https://reviews.llvm.org/D126781 for more information.
2022-06-13 10:12:38 -07:00
Lei Zhang cc020a2236 [mlir][spirv] Convert math.ctlz to spv.GLSL.FindUMsb
Reviewed By: ThomasRaoux

Differential Revision: https://reviews.llvm.org/D127582
2022-06-13 13:02:37 -04:00
Valentin Clement f1c84d0ff0
[flang][NFC] Add TODOs for KIND = 2
Add TODO for KIND=2 so the user is notified correctly.

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

Reviewed By: jeanPerier, PeteSteinfeld

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

Co-authored-by: Peter Steinfeld <psteinfeld@nvidia.com>
2022-06-13 18:45:32 +02:00
Simon Pilgrim 64eea34420 [X86] combineEXTEND_VECTOR_INREG - don't attempt to shuffle combine ANY_EXTEND_VECTOR_INREG without SSE41
Without SSE41, ANY_EXTEND_VECTOR_INREG nodes are likely to be prematurely combined to a target shuffle preventing generic sign extension folds.

Fixes a number of sign-extend regressions in D127115.
2022-06-13 17:42:04 +01:00
Stanislav Mekhanoshin 0f81830632 [AMDGPU] Make temp vgpr selection stable in indirectCopyToAGPR
This uses rotating reminder of division by 3 to select another
temp vgpr each next time in a sequence of several agpr copies.
Therefore, temp vgpr selection depends on the generated agpr
number. This number could change with any unrelated change to
the register definitions.

Stabilize the selection by using a real agpr number.

Differential Revision: https://reviews.llvm.org/D127524
2022-06-13 09:39:46 -07:00
Thomas Raoux 1c84800c42 [mlir][vector] Add patterns to ppropagate vector distribution
Add patterns to propagate vector distribution and remove dead
arguments. This handles propagation for several vector operations.

Differential Revision: https://reviews.llvm.org/D127167
2022-06-13 16:38:50 +00:00
Kiran Chandramohan c030f46703 [Flang][OpenMP] Avoid double privatisation of loop variables
Loop variables of a worksharing loop and sequential loops in parallel
region are privatised by default. These variables are marked with
OmpPreDetermined. Skip explicit privatisation of these variables.

Note: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.

Reviewed By: Leporacanthicus

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

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Mats Petersson <mats.petersson@arm.com>
2022-06-13 16:27:34 +00:00
Mogball e16d13322b [mlir] (NFC) Clean up bazel and CMake target names
All dialect targets in bazel have been named *Dialect and all dialect
targets in CMake have been named MLIR*Dialect.
2022-06-13 16:24:15 +00:00
Lei Zhang a10c09d1e3 [mlir][spirv] Remove unused traits from SPV_Attr
This addresses the warning of unused template argument.
2022-06-13 12:20:57 -04:00
Lei Zhang a4360efb2c [mlir][spirv] Convert single element vector.splat/fma
Reviewed By: ThomasRaoux, hanchung

Differential Revision: https://reviews.llvm.org/D127572
2022-06-13 12:18:16 -04:00
Mark de Wever 23b10a4a66 [libc++][NFC] Use concepts in <bit>.
All supported compilers have concepts support so use that in the C++20
functions in <bit>.

s/_LIBCPP_INLINE_VISIBILITY/_LIBCPP_HIDE_FROM_ABI/ as drive-by fix.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D127594
2022-06-13 18:17:48 +02:00
Philip Reames aaeb958ced [RISCV] Mutate instruction after computing transfer rule in InsertVSETVLI [nfc]
If we defer the mutation of the instruction, we can add the assert discussed in D126921.  Once we do that, the API becomes subject to revision - but let's do that in a separate change.
2022-06-13 09:08:25 -07:00
Craig Topper cef03e3dcd [RISCV] Move creation of constant pools from isel to lowering.
This simplifies the isel code by removing the manual load creation.
It also improves our ability to use 0 strided loads for vector splats.

There is an assumption here that Mask and ShiftedMask constants are
cheap enough that they don't become constant pool loads so that our
isel optimizations involving And still work. I believe those constants
are 3 instructions in the worst case.

The rv64zbp-intrinsic.ll changes is a regression caused by intrinsics
being expanded to RISCVISD also occuring during lowering. So the optimizations
were only happening during the last DAGCombine, which can't see through the
load. I believe we can fix this test by implementing
TargetLowering::getTargetConstantFromLoad for RISC-V or by adding the intrinsic
to computeKnownBitsForTargetNode to enable earlier DAG combine. Since Zbp is not
a ratified extension, I don't view these as blocking this patch.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D127520
2022-06-13 09:07:57 -07:00
Mark de Wever c36870c8e7 [libc++] Removes unneeded includes.
This removes all "TODO: remove these headers" comments from our headers.

Note there seem to be more headers that can be removed, that will be
done in separate commits.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D127592
2022-06-13 17:56:50 +02:00
Mark de Wever 26465c8337 [libc++] Removes a GCC bug work-around.
Based on the comments in [1] this should be fixed in GCC-11.

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37804

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D127590
2022-06-13 17:55:43 +02:00