Commit Graph

480656 Commits

Author SHA1 Message Date
Peter Klausler
a5eb6bdd8e [flang] Relax overindexing error to warning for last dummy dimension (#71725)
Compilation-time subscript value range checking should emit a warning,
not an error, when the indexed array is a dummy argument; there's
old-school codes out there that should have used assumed-size dummy
arguments but didn't.
2023-11-13 15:59:34 -08:00
Lei Zhang
6d9eb31c31 [mlir][spirv] Fix spirv.Select min version requirement (#72173)
Per the spec, "Before version 1.4, results are only computed per
component." So using scalar condition to select composite needs SPIR-V
v1.4 at least.
2023-11-13 15:53:53 -08:00
Peter Klausler
8b5eacb4a6 [flang][NFC] Document an extension (#71609)
Fortran free form line continuation with '&' works with this compiler
even across the end of an included source file, as it does with most
other Fortran compilers. This extension should be documented.
2023-11-13 15:50:49 -08:00
Peter Klausler
f06ea103e7 [flang] Do definability checking in RANK() clauses (#71607)
I explicitly skipped definability checking for construct entities under
a RANK() clause. I don't know what I was thinking at the time; it's
obviously incorrect! Fix, and add tests.
2023-11-13 15:37:54 -08:00
lntue
6899f035ae [libc] Check if arm targets support FPSCR in FEnvImpl.h. (#72158)
https://github.com/llvm/llvm-project/issues/72157
2023-11-13 18:32:42 -05:00
Craig Topper
0a459dd4e9 [RISCV] Add tests for selecting G_BRCOND+G_ICMP. NFC
These should have been part of e0e0891d74
2023-11-13 15:29:34 -08:00
Craig Topper
04107797d9 [RISCV][GISel] Simplify some code. NFC
typeIs and LegalizeMutation::changeTo instead of implementing our own lambdas
that do the same thing.
2023-11-13 15:27:41 -08:00
Peter Klausler
f2bf44b6ec [flang][preprocessor] Finesse disabling of function-like macros (#71589)
During function-like macro expansion in a standard C/C++ preprocessor,
the macro being expanded is disabled from recursive macro expansion. The
implementation in this compiler's preprocessor, however, was too broad;
the macro expansion needs to be disabled for the "rescanning" phase
only, not for actual argument expansion.

(Also corrects an obsolete comment elsewhere that was noticed during
reduction of an original test case.)
2023-11-13 15:25:10 -08:00
Fangrui Song
9c1c56a803 -fcoverage-mapping: simplify. NFC 2023-11-13 15:16:58 -08:00
Peter Klausler
36ad3431bb [flang] Don't accept NULL() actual for assumed-rank dummy (#71574)
A NULL() pointer without MOLD= cannot be allowed to be associated with
an assumed-rank dummy argument, as its rank is not well-defined and
neither the RANK() intrinsic function or the SELECT RANK construct will
work in the callee.
2023-11-13 15:14:05 -08:00
Peter Klausler
13893a08d9 [flang] Compile-time checking of substring bounds (#71453)
When the bounds of a substring reference are known during compilation,
and are outside the valid range for the character base object, issue an
error message.
2023-11-13 15:03:17 -08:00
Peter Klausler
ec4ba0f5fe [flang][runtime] Correct automatic parenthesized format repetition case (#71436)
In Fortran, a format automatically repeats, with a line break, until all
the data items of a data transfer statement have been consumed. PRINT
"(3I4)", 1, 2, 3, 4, 5, 6 prints two lines, for example, three values
each.

When there are nested parentheses in a format, the rightmost set of
parentheses at the top level are used for automatic repetition. PRINT
"(I4,2(I4))" 1, 2, 3, 4, 5, 6, 7 print three lines, with three values on
the first and two each on the later ones.

Fix a bug in format interpretation that causes the detection of the
"rightmost" set of parentheses to take place on each pass, leading to
problems when parentheses are even further nested.
2023-11-13 14:52:51 -08:00
Peter Klausler
9652e9b741 [flang] Catch non-CONTIGUOUS assumed-rank with ASYNCHRONOUS/VOLATILE … (#71243)
…forwarded to CONTIGUOUS dummy

No object with the ASYNCHRONOUS or VOLATILE attribute can go through the
copy-in/copy-out protocol necessary for argument association with a
contiguous dummy array argument. The check for this constraint missed
the case of an assumed-rank array without an explicit CONTIGUOUS
attribute being forwarded on to a CONTIGUOUS dummy argument.
2023-11-13 14:41:50 -08:00
Amara Emerson
63d19cfd85 Revert "[Kaleidoscope] Switch to the new PassManager. (#69032)"
This reverts commit 7b94744e77.

This breaks the expensive checks bot: https://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/26026/

We didn't notice because it was broken for other reasons I think.
2023-11-13 14:38:14 -08:00
Maksim Panchenko
2db9b6a93f [BOLT] Make instruction size a first-class annotation (#72167)
When NOP instructions are used to reserve space in the code, e.g. for
patching, it becomes critical to preserve their original size while
emitting the code. On x86, we rely on "Size" annotation for NOP
instructions size, as the original instruction size is lost in the
disassembly/assembly process.

This change makes instruction size a first-class annotation and is
affectively NFCI. A follow-up diff will use the annotation for code
emission.
2023-11-13 14:33:39 -08:00
Peter Klausler
b288b412ed [flang] Enforce C839 (#71239)
An assumed-rank array may not be a coarray and may not have the VALUE
attribute.
2023-11-13 14:31:20 -08:00
Peter Klausler
3de9aa6b36 [flang] Catch READ(... SIZE=) with NML= or FMT=* (#71235)
The SIZE= specifier may not appear on a list-directed or namelist READ
statement.
2023-11-13 14:20:43 -08:00
Peter Klausler
67f15e76eb [flang] Fold IS_IOSTAT_END() & IS_IOSTAT_EOR() (#70971)
These intrinsic functions are not particularly valuable -- one can just
compare a value to IOSTAT_END or IOSTAT_EOR directly -- but they are in
the standard and are allowed to appear in constant expressions, so
here's code to fold them.
2023-11-13 14:07:38 -08:00
Eric
c66d5f57ce Attempt entire rewrite of buildkite pipeline using anchors. (#71624)
This uses YAML anchors to deduplicate a lot of the pipeline LOC.

This makes it a lot easier to navigate through the file and to make modifications.
2023-11-13 17:06:25 -05:00
Peter Klausler
e4589ea2a5 [flang] Correct dummy argument names for C_ASSOCIATED() for C_FUNPTR (#70961)
The dummy argument names used for the interface to C_ASSOCIATED() were
wrong.
2023-11-13 13:53:46 -08:00
Craig Topper
29d75cb9dc [RISCV][GISel] Update legalize-smin.mir and legalize-smax.mir to test G_SMIN/G_SMAX.
Looks like an incomplete fixup was done after copying the umin/umax tests.
2023-11-13 13:49:14 -08:00
Brad Smith
e87633a548 [Driver][OpenBSD] Enable kernel address sanitizer on amd64 2023-11-13 16:47:59 -05:00
Owen Pan
fff993b7cf [clang-format] Fix a bug in aligning comments in vector of structs (#72099)
Fixed #71825.
2023-11-13 13:41:01 -08:00
elizabethandrews
7fb606e9fe [Clang] Fix a crash when using ast-dump=json (#70224)
CXXDeductionGuideDecl inherits from FunctionDecl. For FunctionDecls,
the JSONVisitor includes a call to visit NamedDecl in order to provide
mangled names in the dump. This did not correctly exclude
CXXDeductionGuideDecl, which resulted in an assert being hit.
2023-11-13 16:39:40 -05:00
Peter Klausler
29fd3e2aa8 [flang] Allow polymorphic actual to implicit interface (#70873)
Semantics is emitting an error when an actual argument to a procedure
that has an implicit interface has a polymorphic type. This is too
general; while TYPE(*) and CLASS(*) unlimited polymorphic items require
the presence of an explicit procedure interface, CLASS(T) data can be
passed over an implicit interface to a procedure expecting a
corresponding dummy argument with TYPE(T), so long as T is not
parameterized.

(Only XLF handles this usage correctly among other Fortran compilers.)

(Making this work in the case of an actual CLASS(T) array may well
require additional changes in lowering to copy data to/from a temporary
buffer to ensure contiguity when the actual type of the array is an
extension of T.)
2023-11-13 13:31:58 -08:00
Shraiysh
c9626e6264 [OpenMP][mlir] Add enter capture attribute to declare target (#72062)
This patch adds support for enter attribute in declare target. As the
enter attribute is a replacement for `to` attribute, it has the same
tests.
2023-11-13 14:51:20 -06:00
androm3da
bd91cf8d83 Hexagon: add support for system instructions (#72063)
The semantics and encodings for these instructions are described by the
Hexagon V67 Programmer's Reference Manual:

https://developer.qualcomm.com/downloads/qualcomm-hexagon-v67-programmer-s-reference-manual
2023-11-13 14:48:55 -06:00
Youngsuk Kim
eed067e9fb [llvm] Remove no-op ptr-to-ptr bitcasts (NFC)
Opaque ptr cleanup effort (NFC).
2023-11-13 14:33:41 -06:00
PiJoules
2c65860667 [clang] Remove fixed point arithmetic error (#71884)
Prior to this, clang would always report

```
compile with '-ffixed-point' to enable fixed point types
```

whenever it sees `_Accum`, `_Fract`, or `_Sat` when fixed point
arithmetic is not enabled. This can break existing code that uses these
as variable names and doesn't use fixed point arithmetic like in some
microsoft headers

(https://github.com/llvm/llvm-project/pull/67750#issuecomment-1775264907).

Fixed point should not raise this error for these cases, so this removes
the error altogether and defaults to the usual error clang gives where
it can see these keywords as either unknown types or regular variables.
2023-11-13 12:31:49 -08:00
Craig Topper
915e092400 [RISCV] Select zext as sext when sign bit is 0 for -riscv-experimental-rv64-legal-i32
In our default SelectionDAG where i32 isn't legal, the zext will become
and i64 AND and often get optimized out on its own. With i32 legal, we
need to turn it in into sext.w and rely on RISCVOptWInstrs to remove it.
2023-11-13 12:21:36 -08:00
Craig Topper
05300222ba [RISCV][GISel] Add really basic support for FP regbank selection for G_LOAD/G_STORE. (#70896)
Coerce the register bank based on the users of the G_LOAD or the
defining instruction for the G_STORE.

s64 on rv32 is handled by forcing the FPRB register bank.
2023-11-13 12:12:16 -08:00
Peiming Liu
269685545e [mlir][sparse] remove filter-loop based algorithm support to handle a… (#71840)
…ffine subscript expressions.
2023-11-13 11:36:49 -08:00
Egor Zhdan
41021e8ef8 [APINotes] Upstream APINotes YAML compiler
This upstreams more of the Clang API Notes functionality that is
currently implemented in the Apple fork:
https://github.com/apple/llvm-project/tree/next/clang/lib/APINotes
2023-11-13 19:36:36 +00:00
Michael Buch
743c4fe43c [lldb][DWARFASTParserClang][NFC] Extract static data member decl creation into helper (#72109)
This patch extracts the logic to create a static variable member decl
into a helper. We will use this in an upcoming patch which will need to
call exactly the same logic from a separate part of the DWARF parser.
2023-11-13 19:30:28 +00:00
Craig Topper
70ce047f7e [RISCV] Legalize G_CTLZ/G_CTLZ_ZERO_UNDEF/G_CTTZ/G_CTTZ_ZERO_UNDEF. (#72014)
The base ISA does not support these operations. A future patch will
enable them for Zbb.
2023-11-13 11:22:48 -08:00
Florian Hahn
c491c93365 [LAA] Refine tests added in 9c535a3c2e.
Refine FIXMEs in added tests, the problematic case only materializes if
there's either both a read and write from an indirect address.
2023-11-13 19:19:57 +00:00
Alex Richardson
dc298fecb7 [builtins] Build with -Wbuiltin-declaration-mismatch if supported
GCC is able to check that the signatures of the builtins are as expected
and this shows some incorrect signatures on ld80 platforms (i.e. x86).
The *tf* functions should take 128-bit arguments but until the latest fixes
they used 80-bit long double.

Differential Revision: https://reviews.llvm.org/D153814
2023-11-13 11:06:22 -08:00
Tom Stellard
877226f01f [X86] Simplify regex in pr42616.ll test (#71980) 2023-11-13 11:05:42 -08:00
Tom Stellard
2750a22745 Passes: Consolidate EnableKnowledgeRetention declarations into a header file (#71695) 2023-11-13 11:03:49 -08:00
Felipe de Azevedo Piovezan
a195d1fc6c [DebugInfo] Implement TAG_label entries for debug_names (#71724)
The DWARF 5 specification says that:

> The name index must contain an entry for each debugging information
entry that
> defines a named [...] label [...].

The verifier currently verifies this, but the AsmPrinter does not add
entries for TAG_labels in debug_names. This patch addresses the issue by
ensuring we add labels in the accelerator tables once we have a fully
completed DIE for the TAG_label entry.

We also respect the spec as follows:
> DW_TAG_label debugging information entries without an address
attribute
> (DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, or DW_AT_entry_pc) are
excluded.

The effect of this on the size of accelerator tables is minimal, as
TAG_labels are usually created by C/C++ labels (see example in test),
which are typically paired with "goto" statements.
2023-11-13 11:02:58 -08:00
Matteo Franciolini
4488f4933e [mlir][bytecode] Add bytecode writer config API to skip serialization of resources (#71991)
When serializing to bytecode, users can select the option to elide
resources from the bytecode file. This will instruct the bytecode writer
to serialize only the key and resource kind, while skipping
serialization of the data buffer. At parsing, the IR is built in memory
with valid (but empty) resource handlers.
2023-11-13 12:59:30 -06:00
Felix Schneider
08e8dacb4a [mlir] NFC: Clarify documentation on Infer(Shaped)TypeOpInterface (#70350)
This patch clarifies the documentation of methods `inferReturnTypeComponents()`
and `inferReturnTypes()` regarding verified/valid arguments.
2023-11-13 19:54:01 +01:00
Craig Topper
d8576e4542 [RISCV][GISel] Update RV64 legalize-ctpop.mir to account for constant shift amounts being i64 now.
This changed while the ctpop patch was in review and I forgot to update it.
2023-11-13 10:38:36 -08:00
Craig Topper
90dd4c470f [RISCV][GISel] Legalize G_CTPOP. (#72005)
The base ISA does not have an instruction for this so we need to lower.
Zbb support will come in a future patch.
2023-11-13 10:26:32 -08:00
Jacques Pienaar
204acc5c10 [mlir][py] Overload print with state. (#72064)
Enables reusing the AsmState when printing from Python. Also moves the
fileObject and binary to the end (pybind11::object was resulting in the
overload not working unless `state=` was specified).

---------

Co-authored-by: Maksim Levental <maksim.levental@gmail.com>
2023-11-13 10:21:21 -08:00
Alex Langford
ad20a9e1a1 [lldb] Remove StructuredData::Array::GetItemAtIndexAsArray (#71994)
This method is completely unused.
2023-11-13 10:12:36 -08:00
Youngsuk Kim
876236023c [llvm] Remove no-op ptr-to-ptr bitcasts (NFC) (#72133)
Opaque ptr cleanup effort (NFC).
2023-11-13 13:05:27 -05:00
Aart Bik
af8428c0d9 [mlir][sparse] unify support of (dis)assemble between direct IR/lib path (#71880)
Note that the (dis)assemble operations still make some simplfying
assumptions (e.g. trailing 2-D COO in AoS format) but now at least both
the direct IR and support library path behave exactly the same.

Generalizing the ops is still TBD.
2023-11-13 10:05:00 -08:00
antoine moynault
5fdb70be7b [clang] fix test PR69717.cpp (#72134)
Test still fail on ARM machine (no float_control support)
2023-11-13 18:39:25 +01:00
Tony Tye
0e42df4031 [AMDGPU][NFC] DWARF vector composite location description operations (#71623)
Summary:
Add description to AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst
for "DWARF Operations to Create Vector Composite Location Descriptions"
proposal to explain the main motivation is to facilitate more compact
DWARF that is faster to evaluate.

Reviewers: kzhuravl, scott.linder, zoran.zaric

Subscribers:
2023-11-13 11:44:37 -05:00