Commit Graph

442179 Commits

Author SHA1 Message Date
Mehdi Amini 377af86847 MLIR: Add --fix-error to clang-tidy script 2022-11-18 06:22:32 +00:00
Alexander Shaposhnikov 34ab474348 [opt][clang] Enable using -module-summary/-flto=thin with -S/-emit-llvm
Enable using -module-summary with -S
(similarly to what currently can be achieved with opt <input> -o - | llvm-dis).
This is a recommit of ef9e62469.

Test plan: ninja check-all

Differential revision: https://reviews.llvm.org/D137768
2022-11-18 05:04:07 +00:00
Fazlay Rabbi ab9eac762c [OpenMP] Initial parsing/sema for 'strict' modifier with 'grainsize' clause
This patch gives basic parsing and semantic analysis support for 'strict'
modifier with 'grainsize' clause of 'taskloop' construct introduced in
OpenMP 5.1 (section 2.12.2)

Differential Revision: https://reviews.llvm.org/D138217
2022-11-17 20:59:07 -08:00
Lei Zhang 47e953e913 [mlir][spirv] Support attribute in MapMemRefStorageClassPass
MemRef memory space actually can be an attribute. Update the
map function signature to accept an attribute. The default
mappings can still only covers numeric ones, but this allows
downstream callers to extend with custom memory spaces.

Reviewed By: kuhar

Differential Revision: https://reviews.llvm.org/D138257
2022-11-17 23:55:52 -05:00
Matt Arsenault fe5b9a6a11 AMDGPU/GlobalISel: Make strict fadd, fmul and fma legal 2022-11-17 20:50:04 -08:00
Timm Bäder e78a43daca [clang][Parse][NFC] Remove unused CommaLocs parameters 2022-11-18 04:54:00 +01:00
Timm Bäder 9f61479007 [clang][Parser][NFC] Simplify ParseParenExprOrCondition
Differential Revision: https://reviews.llvm.org/D138194
2022-11-18 04:53:59 +01:00
Chuanqi Xu 1614d63405 [NFC] Remove unused codes after 4a7be42d92
There are still some unused codes remained after 4a7be42d92. And this
patch tries to remove them.
2022-11-18 11:52:44 +08:00
Chuanqi Xu d584468581 [C++20] [Modules] Don't emit macro definitions with named module
It is meaningless to emit macro definitions for named modules. With some
small experiments, the size of the module for the named modules reduced
2%~4% after this patch.
2022-11-18 11:11:17 +08:00
Matt Arsenault ae43420f39 AMDGPU/GlobalISel: Fix not selecting modifiers for f16 fma on gfx9
VOP3OpSel wasn't trying to match any modifiers. Just try to match the
basic case, like the DAG does.
2022-11-17 18:51:45 -08:00
YingChi Long 7a715bf317
[VP] Add support for vp.inttoptr & vp.ptrtoint
Add vp.inttoptr & vp.ptrtoint support by lowering them into
vp.zext / vp.truncate with in SelectionDAGBuilder.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D137169
2022-11-18 10:42:24 +08:00
Chuanqi Xu 4a7be42d92 [C++20] [Modules] Remove unmaintained Header Module
Currently there is a -emit-header-module mode, which can combine several
headers together as a module interface. However, this breaks our
assumption (for standard c++ modules) about module interface. The module
interface should come from a module interface unit. And if it is a
header, it should be a header unit. And currently we have no ideas to
combine several headers together.

So I think this mode is an experimental one and it is not maintained and
it is not used. So it will be better to remove them.

Reviewed By: Bigcheese, dblaikie, bruno

Differential Revision: https://reviews.llvm.org/D137609
2022-11-18 10:39:33 +08:00
Qiu Chaofan cab9c02bd9 [Clang] Fix behavior of -ffp-model option when overriden
-ffp-model=strict -ffp-model=fast will still enable strict exception
handling behavior, therefore clang still emits constrained FP operations
in IR.

-ffp-model=fast -ffp-model=strict emits two warnings: one for strict
overriding fast, the other for strict overriding strict, which is
confusing.

Reviewed By: zahiraam

Differential Revision: https://reviews.llvm.org/D137618
2022-11-18 10:34:41 +08:00
Volodymyr Sapsai a65d5309d5 [ODRHash] Detect duplicate `ObjCProtocolDecl` ODR mismatches during parsing.
When during parsing we encountered a duplicate `ObjCProtocolDecl`, we
were always emitting an error. With this change we accept
* when a previous `ObjCProtocolDecl` is in a hidden [sub]module;
* parsed `ObjCProtocolDecl` is the same as the previous one.

And in case of mismatches we provide more detailed error messages.

rdar://93069080

Differential Revision: https://reviews.llvm.org/D130327
2022-11-17 18:31:32 -08:00
Alexander Shaposhnikov 7059a6c32c [IR] Split out IR printing passes into IRPrinter
This diff splits out (from LLVMCore) IR printing passes into IRPrinter.
This structure is similar to what we already have for IRReader and
enables us to avoid circular dependencies between LLVMCore and Analysis
(this is a preparation for https://reviews.llvm.org/D137768).
The legacy interface is left unchanged, once the legacy pass manager
is removed (in the future) we will be able to clean it up further.
The bazel build configuration has been updated as well.

Test plan:
1/ Tested the following cmake configurations: static/dynamic linking * lld/gold * clang/gcc
2/ bazel build --config=generic_clang @llvm-project//...

Differential revision: https://reviews.llvm.org/D138081
2022-11-18 01:47:56 +00:00
Alexey Bataev 07015e12f0 [SLP]Fix PR59053: trying to erase instruction with users.
Need to count the reduced values, vectorized in the tree but not in the top node. Such scalars still must be extracted out of the vector node instead of the original scalar.
2022-11-17 17:23:48 -08:00
Fangrui Song 6b852ffa99 [Sink] Process basic blocks with a single successor
This condition seems unnecessary.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D93511
2022-11-18 01:23:12 +00:00
Volodymyr Sapsai dcb71b5e1d [ODRHash] Hash `ObjCPropertyDecl` and diagnose discovered mismatches.
Differential Revision: https://reviews.llvm.org/D130326
2022-11-17 17:22:03 -08:00
Diego Caballero 847b5f82a4 Revert "[mlir][Vector] Re-define masking semantics in vector.transfer ops"
This reverts commit 6c59c5cd08.
2022-11-18 01:18:11 +00:00
Konstantin Varlamov f51c91532e [libc++][NFC] Add a missing include in pre-C++14 language modes. 2022-11-17 17:15:41 -08:00
Diego Caballero 6c59c5cd08 [mlir][Vector] Re-define masking semantics in vector.transfer ops
Masking hasn't been widely used in vector transfer ops and the semantics
of the mask operand were a bit loose. This patch states that the mask
operand in a vector transfer op is applied to the read/write part of the
operation and, therefore, its shape should match the shape of the
elements read/written from/into the memref/tensor regardless of any
permutation/broadcasting also applied by the transfer operation.

Reviewers: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D138079
2022-11-18 01:05:42 +00:00
Fangrui Song 46202543c9 [CMake] Remove a duplicate clangLex entry 2022-11-18 00:58:04 +00:00
Fangrui Song f962dafbbd [include-cleaner] Fix -DBUILD_SHARED_LIBS=on build
and apply an include-cleaner fix for the tool itself:)

addPPCallbacks requires the vtable of PPChainedCallbacks and needs a clangLex
dependency.
2022-11-18 00:56:04 +00:00
Alexander Shaposhnikov 2483a7fffb [include-cleaner] Fix the build of include-cleaner with LLVM_BUILD_LLVM_DYLIB=ON 2022-11-18 00:54:45 +00:00
Konstantin Varlamov 821513b1e6 [libc++] Fix a missing include in pre-C++17 language modes. 2022-11-17 16:53:05 -08:00
Brad Smith 6536a67338 [Linux] Revert 1e56821bac
The glibc issue mentioned in #47994 has been fixed upstream.
2022-11-17 19:48:01 -05:00
David Blaikie a72d8d7041 Update lambda mangling test to C++17
add some side effects so some (I guess guaranteed?) constant folding
doesn't happen, keeping the test testing the things it was testing..

The test passes with 14, 17, and 20 - so let's just leave the version
off so it might be able to be updated/used in C++20 when the default
changes to C++20 in the future.
2022-11-18 00:24:40 +00:00
Jennifer Yu 1e054e6b52 [OPENMP5.1] Initial support for severity clause
Differential Revision:https://reviews.llvm.org/D138227
2022-11-17 16:05:02 -08:00
Yabin Cui 622d329148 [OpenMP] kmp_affinity.h: add RISCV64 support
In D135552 the #else is added, which causes build error when
building openmp on RISCV64. This patch fixed the error:
   "Unknown or unsupported architecture"

Reviewed By: pirama

Differential Revision: https://reviews.llvm.org/D138241
2022-11-18 00:03:59 +00:00
Krzysztof Parzyszek a98fc08396 [Hexagon] Add instruction definitions for Hexagon v71, v71t, and v73
This includes instruction formats, definitions, encodings, scheduling
classes, and builtins/intrinsics.

New and improved version of 76536989ba, so much so that even clang
builds with it.
2022-11-17 15:51:38 -08:00
Michael Jones 36991d8342 [libc] add scanf entrypoints
This patch adds scanf, sscanf, and fscanf entrypoints. It also adds unit
tests for sscanf and a basic test to fscanf. The scanf function is
basically impossible to test in an automated fashion due to it recieving
user input.

Reviewed By: sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D138076
2022-11-17 15:37:52 -08:00
Doru Bercea 98bfd7f976 Fix declare target implementation to support enter. 2022-11-17 17:35:53 -06:00
Benjamin Kramer eaafee27a9 [Affine] Replace a magic -1 with ShapedType::kDynamicSize 2022-11-18 00:26:25 +01:00
Adrian Prantl d2b6b2147b Comment function 2022-11-17 15:24:48 -08:00
Matt Arsenault aecae68b07 AMDGPU: Convert a test to opaque pointers 2022-11-17 15:14:59 -08:00
Fangrui Song 99f730c645 Revert "[Hexagon] Add instruction definitions for Hexagon v71, v71t, and v73"
This reverts commit 766536989b.

The commit caused:

clang/include/clang/Basic/BuiltinsHexagonDep.def:1896:69: error: use of undeclared identifier 'HVXV73'
TARGET_BUILTIN(__builtin_HEXAGON_V6_vadd_sf_bf, "V32iV16iV16i", "", HVXV73)

when building `clang`.
2022-11-17 23:14:32 +00:00
v1nh1shungry 8003c1d61e [clang-tidy] Fix misc-unused-using-decls for user-defined literals
Current version complains unused using-declaration even if the target
user-defined literal is used.

Reviewed By: ymandel

Differential Revision: https://reviews.llvm.org/D138204
2022-11-17 22:47:15 +00:00
Fangrui Song fc91c70593 Revert D135411 "Add generic KCFI operand bundle lowering"
This reverts commit eb2a57ebc7.

llvm/include/llvm/Transforms/Instrumentation/KCFI.h including
llvm/CodeGen is a layering violation. We should use an approach where
Instrumementation/ doesn't need to include CodeGen/.
Sorry for not spotting this in the review.
2022-11-17 22:45:30 +00:00
Craig Topper c9320bc871 [X86] Use correctly sized floating point literals in *zero_ps/pd.
This avoids depending on int->float or double->float conversion.
Improving codegen with #pragma STDC FENV_ACCESS ON.

Really we should improve constant folding somewhere, but this was
a cheap and easy improvement.

Fixes PR59052.
2022-11-17 14:28:52 -08:00
Murali Vijayaraghavan dddf6ab272 Simplifying the SplitReduction logic that uses the control to get the
dimension where the extra parallel dimension is inserted

Currently, the innerParallel and non innerParallel strategies use two
different ways to fix for where the extra loop is inserted and where the
extra dimension for the intermediate result is inserted - innerParallel
adds the extra (parallel) loop right after the pre-existing reduction
loop, whereas non innerParallel adds the reduction loop in the successor
to the index supplied by control, and the parallel loop in the index
supplied by the control. The semantics of the index supplied by the
control is supposed to only control where the extra tensor dimension is
inserted in the intermediate tensor. Conflating this index with where
the reduction (and parallel) loops are inserted leads to more complex
(and confusing) logic overall. This differential removes conflating the
two uses of the index, and keeps the reduction and parallel loops in the
same vicinity and uses the supplied index to only determine the position
of the extra tensor dimension. It also simplifies the code by merging
the two strategies in a lot more places.

Differential Revision: https://reviews.llvm.org/D137478
2022-11-17 22:26:02 +00:00
Krzysztof Parzyszek 766536989b [Hexagon] Add instruction definitions for Hexagon v71, v71t, and v73
This includes instruction formats, definitions, encodings, scheduling
classes, and builtins/intrinsics.
2022-11-17 14:15:47 -08:00
Krzysztof Parzyszek 35cc9bc486 [Hexagon] Add ELF flags for Hexagon v71, v71t, and v73 2022-11-17 14:15:46 -08:00
Sami Tolvanen eb2a57ebc7 Add generic KCFI operand bundle lowering
The KCFI sanitizer emits "kcfi" operand bundles to indirect
call instructions, which the LLVM back-end lowers into an
architecture-specific type check with a known machine instruction
sequence. Currently, KCFI operand bundle lowering is supported only
on 64-bit X86 and AArch64 architectures.

As a lightweight forward-edge CFI implementation that doesn't
require LTO is also useful for non-Linux low-level targets on
other machine architectures, add a generic KCFI operand bundle
lowering pass that's only used when back-end lowering support is not
available and allows -fsanitize=kcfi to be enabled in Clang on all
architectures.

Reviewed By: nickdesaulniers, MaskRay

Differential Revision: https://reviews.llvm.org/D135411
2022-11-17 21:55:00 +00:00
Ben Langmuir c4436f675d [clang] Use InMemoryModuleCache for readASTFileControlBlock NFC
When a pcm has already been loaded from disk, reuse it from the
InMemoryModuleCache in readASTFileControlBlock. This avoids potentially
reading it again.

As noted in the FIXME, ideally we would also add the module to the cache
if it will be used again later, but that could modify its build state
and we do not have enough context currenlty to know if it's correct.

Differential Revision: https://reviews.llvm.org/D138160
2022-11-17 13:47:46 -08:00
usama hameed 7052164f98 [UBSan] Implementation NonUniqueARMRTTIBit __type_name has higher bits set on arm64
Differential Revision: https://reviews.llvm.org/D137518
2022-11-17 13:46:59 -08:00
Roman Lebedev 950f248630
[NFC][SROA] Add more tests with non-speculatable `load`s of `select`s 2022-11-18 00:41:30 +03:00
bixia1 ee74d371a3 [mlir][sparse] Make three integration tests run with the codegen path.
Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D138233
2022-11-17 13:22:04 -08:00
bixia1 96b3bf4292 [mlir][sparse] Fix a problem in the new operator rewriter.
The getSparseTensorReaderNextX functions should return void.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D138226
2022-11-17 13:21:10 -08:00
Krzysztof Parzyszek 534b26aa07 [Hexagon] Improve inserting/extracting to/from scalar predicates
Fixes https://github.com/llvm/llvm-project/issues/59042.
2022-11-17 13:03:45 -08:00
Matt Arsenault f34fe2a3d2 LangRef: Fix repeated word 2022-11-17 12:54:19 -08:00