platform/upstream/llvm.git
20 months ago[test][OpenMP] Expect more tsan reports
Vitaly Buka [Fri, 18 Nov 2022 07:16:31 +0000 (23:16 -0800)]
[test][OpenMP] Expect more tsan reports

20 months ago[NFC][OpenMP] Remove extra ";"
Vitaly Buka [Fri, 18 Nov 2022 07:05:17 +0000 (23:05 -0800)]
[NFC][OpenMP] Remove extra ";"

20 months ago[NFC][OpenMP] Fix warning about non-virtual dtor
Vitaly Buka [Fri, 18 Nov 2022 07:03:01 +0000 (23:03 -0800)]
[NFC][OpenMP] Fix warning about non-virtual dtor

20 months ago[NFC][asan] Rename variables in test
Vitaly Buka [Fri, 18 Nov 2022 06:34:30 +0000 (22:34 -0800)]
[NFC][asan] Rename variables in test

20 months ago[RegisterScavenger][RISCV] Don't search for FrameSetup instrs if we were searching...
luxufan [Fri, 18 Nov 2022 06:56:36 +0000 (14:56 +0800)]
[RegisterScavenger][RISCV] Don't search for FrameSetup instrs if we were searching from Non-FrameSetup instrs

Otherwise, the spill position may point to position where before
FrameSetup instructions. In which case, the spill instruction may store
to caller's frame since the stack pointer has not been adjustted.

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

Reviewed By: craig.topper

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

20 months ago[PowerPC] mark dead def for ctr be clobber.
Chen Zheng [Thu, 17 Nov 2022 05:18:04 +0000 (05:18 +0000)]
[PowerPC] mark dead def for ctr be clobber.

TLS pseudo ADDIStlsgdHA will have such def. This dead def should
also prevent PPC from generating CTR loops.

20 months ago[openmp] [test] Fix warnings about printf format mismatches on Windows
Martin Storsjö [Tue, 8 Nov 2022 09:45:41 +0000 (11:45 +0200)]
[openmp] [test] Fix warnings about printf format mismatches on Windows

This fixes warnings like this:

```
openmp/runtime/test/omp_testsuite.h:107:60: warning: format specifies type 'unsigned int' but the argument has type 'DWORD' (aka 'unsigned long') [-Wformat]
    fprintf(stderr, "CreateThread() failed: Error #%u.\n", GetLastError());
                                                   ~~      ^~~~~~~~~~~~~~
                                                   %lu
```

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

20 months ago[openmp] Only try to add the -mrtm flag on i386/x86_64
Martin Storsjö [Tue, 8 Nov 2022 13:31:40 +0000 (15:31 +0200)]
[openmp] Only try to add the -mrtm flag on i386/x86_64

Clang does accept the flag for any architecture, but prints a
warning:

    clang-16: warning: argument unused during compilation: '-mrtm' [-Wunused-command-line-argument]

This flag is documented as an x86 specific flag, so don't try to
add it for other architectures, to silence this warning.

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

20 months ago[RISCV] Make lowerVECTOR_SHUFFLEAsVSlidedown follow source until not EXTRACT_SUBVECTOR.
Han-Kuan Chen [Tue, 15 Nov 2022 11:34:44 +0000 (03:34 -0800)]
[RISCV] Make lowerVECTOR_SHUFFLEAsVSlidedown follow source until not EXTRACT_SUBVECTOR.

Current lowerVECTOR_SHUFFLEAsVSlidedown only seeks whether input are
EXTRACT_SUBVECTOR and their source are same. The commit will make the
function seek input and their source until they are not
EXTRACT_SUBVECTOR.

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

20 months ago[RISCV] Pre-commit test.
Han-Kuan Chen [Tue, 15 Nov 2022 12:02:41 +0000 (04:02 -0800)]
[RISCV] Pre-commit test.

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

20 months ago[asan] Simplify the test
Vitaly Buka [Fri, 18 Nov 2022 06:29:19 +0000 (22:29 -0800)]
[asan] Simplify the test

20 months agoApply clang-tidy fixes for llvm-else-after-return in SparseTensorCodegen.cpp (NFC)
Mehdi Amini [Thu, 17 Nov 2022 09:09:30 +0000 (09:09 +0000)]
Apply clang-tidy fixes for llvm-else-after-return in SparseTensorCodegen.cpp (NFC)

20 months agoApply clang-tidy fixes for bugprone-argument-comment in LinalgTransformOps.cpp (NFC)
Mehdi Amini [Thu, 17 Nov 2022 08:06:15 +0000 (08:06 +0000)]
Apply clang-tidy fixes for bugprone-argument-comment in LinalgTransformOps.cpp (NFC)

20 months agoMLIR: Add --fix-error to clang-tidy script
Mehdi Amini [Wed, 16 Nov 2022 21:29:28 +0000 (21:29 +0000)]
MLIR: Add --fix-error to clang-tidy script

20 months ago[opt][clang] Enable using -module-summary/-flto=thin with -S/-emit-llvm
Alexander Shaposhnikov [Fri, 18 Nov 2022 04:26:08 +0000 (04:26 +0000)]
[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

20 months ago[OpenMP] Initial parsing/sema for 'strict' modifier with 'grainsize' clause
Fazlay Rabbi [Fri, 18 Nov 2022 00:20:14 +0000 (16:20 -0800)]
[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

20 months ago[mlir][spirv] Support attribute in MapMemRefStorageClassPass
Lei Zhang [Fri, 18 Nov 2022 04:46:18 +0000 (23:46 -0500)]
[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

20 months agoAMDGPU/GlobalISel: Make strict fadd, fmul and fma legal
Matt Arsenault [Sun, 31 May 2020 17:23:20 +0000 (13:23 -0400)]
AMDGPU/GlobalISel: Make strict fadd, fmul and fma legal

20 months ago[clang][Parse][NFC] Remove unused CommaLocs parameters
Timm Bäder [Thu, 17 Nov 2022 14:49:30 +0000 (15:49 +0100)]
[clang][Parse][NFC] Remove unused CommaLocs parameters

20 months ago[clang][Parser][NFC] Simplify ParseParenExprOrCondition
Timm Bäder [Thu, 17 Nov 2022 11:12:11 +0000 (12:12 +0100)]
[clang][Parser][NFC] Simplify ParseParenExprOrCondition

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

20 months ago[NFC] Remove unused codes after 4a7be42d922af
Chuanqi Xu [Fri, 18 Nov 2022 03:49:33 +0000 (11:49 +0800)]
[NFC] Remove unused codes after 4a7be42d922af

There are still some unused codes remained after 4a7be42d922af. And this
patch tries to remove them.

20 months ago[C++20] [Modules] Don't emit macro definitions with named module
Chuanqi Xu [Fri, 18 Nov 2022 02:45:08 +0000 (10:45 +0800)]
[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.

20 months agoAMDGPU/GlobalISel: Fix not selecting modifiers for f16 fma on gfx9
Matt Arsenault [Fri, 18 Nov 2022 02:05:30 +0000 (18:05 -0800)]
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.

20 months ago[VP] Add support for vp.inttoptr & vp.ptrtoint
YingChi Long [Tue, 1 Nov 2022 16:08:40 +0000 (00:08 +0800)]
[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

20 months ago[C++20] [Modules] Remove unmaintained Header Module
Chuanqi Xu [Fri, 18 Nov 2022 02:13:40 +0000 (10:13 +0800)]
[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

20 months ago[Clang] Fix behavior of -ffp-model option when overriden
Qiu Chaofan [Fri, 18 Nov 2022 02:28:24 +0000 (10:28 +0800)]
[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

20 months ago[ODRHash] Detect duplicate `ObjCProtocolDecl` ODR mismatches during parsing.
Volodymyr Sapsai [Fri, 8 Jul 2022 20:10:31 +0000 (13:10 -0700)]
[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

20 months ago[IR] Split out IR printing passes into IRPrinter
Alexander Shaposhnikov [Fri, 18 Nov 2022 01:47:56 +0000 (01:47 +0000)]
[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

20 months ago[SLP]Fix PR59053: trying to erase instruction with users.
Alexey Bataev [Fri, 18 Nov 2022 00:46:51 +0000 (16:46 -0800)]
[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.

20 months ago[Sink] Process basic blocks with a single successor
Fangrui Song [Fri, 18 Nov 2022 01:23:12 +0000 (01:23 +0000)]
[Sink] Process basic blocks with a single successor

This condition seems unnecessary.

Reviewed By: arsenm

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

20 months ago[ODRHash] Hash `ObjCPropertyDecl` and diagnose discovered mismatches.
Volodymyr Sapsai [Wed, 6 Jul 2022 21:58:26 +0000 (14:58 -0700)]
[ODRHash] Hash `ObjCPropertyDecl` and diagnose discovered mismatches.

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

20 months agoRevert "[mlir][Vector] Re-define masking semantics in vector.transfer ops"
Diego Caballero [Fri, 18 Nov 2022 01:18:11 +0000 (01:18 +0000)]
Revert "[mlir][Vector] Re-define masking semantics in vector.transfer ops"

This reverts commit 6c59c5cd08c879c9d1cfa653711613244a7c39bf.

20 months ago[libc++][NFC] Add a missing include in pre-C++14 language modes.
Konstantin Varlamov [Fri, 18 Nov 2022 01:13:53 +0000 (17:13 -0800)]
[libc++][NFC] Add a missing include in pre-C++14 language modes.

20 months ago[mlir][Vector] Re-define masking semantics in vector.transfer ops
Diego Caballero [Wed, 16 Nov 2022 00:43:50 +0000 (00:43 +0000)]
[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

20 months ago[CMake] Remove a duplicate clangLex entry
Fangrui Song [Fri, 18 Nov 2022 00:58:04 +0000 (00:58 +0000)]
[CMake] Remove a duplicate clangLex entry

20 months ago[include-cleaner] Fix -DBUILD_SHARED_LIBS=on build
Fangrui Song [Fri, 18 Nov 2022 00:56:04 +0000 (00:56 +0000)]
[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.

20 months ago[include-cleaner] Fix the build of include-cleaner with LLVM_BUILD_LLVM_DYLIB=ON
Alexander Shaposhnikov [Fri, 18 Nov 2022 00:53:56 +0000 (00:53 +0000)]
[include-cleaner] Fix the build of include-cleaner with LLVM_BUILD_LLVM_DYLIB=ON

20 months ago[libc++] Fix a missing include in pre-C++17 language modes.
Konstantin Varlamov [Fri, 18 Nov 2022 00:51:53 +0000 (16:51 -0800)]
[libc++] Fix a missing include in pre-C++17 language modes.

20 months ago[Linux] Revert 1e56821bac02a5d3c6249bbf3ef43b8b569d2551
Brad Smith [Fri, 18 Nov 2022 00:46:23 +0000 (19:46 -0500)]
[Linux] Revert 1e56821bac02a5d3c6249bbf3ef43b8b569d2551

The glibc issue mentioned in #47994 has been fixed upstream.

20 months agoUpdate lambda mangling test to C++17
David Blaikie [Fri, 18 Nov 2022 00:12:42 +0000 (00:12 +0000)]
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.

20 months ago[OPENMP5.1] Initial support for severity clause
Jennifer Yu [Wed, 16 Nov 2022 21:29:14 +0000 (13:29 -0800)]
[OPENMP5.1] Initial support for severity clause

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

20 months ago[OpenMP] kmp_affinity.h: add RISCV64 support
Yabin Cui [Fri, 18 Nov 2022 00:03:46 +0000 (00:03 +0000)]
[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

20 months ago[Hexagon] Add instruction definitions for Hexagon v71, v71t, and v73
Krzysztof Parzyszek [Wed, 16 Nov 2022 16:57:01 +0000 (08:57 -0800)]
[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.

20 months ago[libc] add scanf entrypoints
Michael Jones [Wed, 19 Oct 2022 20:36:59 +0000 (13:36 -0700)]
[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

20 months agoFix declare target implementation to support enter.
Doru Bercea [Wed, 16 Nov 2022 23:23:48 +0000 (17:23 -0600)]
Fix declare target implementation to support enter.

20 months ago[Affine] Replace a magic -1 with ShapedType::kDynamicSize
Benjamin Kramer [Thu, 17 Nov 2022 23:26:08 +0000 (00:26 +0100)]
[Affine] Replace a magic -1 with ShapedType::kDynamicSize

20 months agoComment function
Adrian Prantl [Thu, 17 Nov 2022 23:24:35 +0000 (15:24 -0800)]
Comment function

20 months agoAMDGPU: Convert a test to opaque pointers
Matt Arsenault [Thu, 17 Nov 2022 23:07:23 +0000 (15:07 -0800)]
AMDGPU: Convert a test to opaque pointers

20 months agoRevert "[Hexagon] Add instruction definitions for Hexagon v71, v71t, and v73"
Fangrui Song [Thu, 17 Nov 2022 23:14:32 +0000 (23:14 +0000)]
Revert "[Hexagon] Add instruction definitions for Hexagon v71, v71t, and v73"

This reverts commit 766536989baf9431ff535670d01c4c19d7351fad.

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`.

20 months ago[clang-tidy] Fix misc-unused-using-decls for user-defined literals
v1nh1shungry [Thu, 17 Nov 2022 21:30:35 +0000 (21:30 +0000)]
[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

20 months agoRevert D135411 "Add generic KCFI operand bundle lowering"
Fangrui Song [Thu, 17 Nov 2022 22:45:29 +0000 (22:45 +0000)]
Revert D135411 "Add generic KCFI operand bundle lowering"

This reverts commit eb2a57ebc7aaad551af30462097a9e06c96db925.

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.

20 months ago[X86] Use correctly sized floating point literals in *zero_ps/pd.
Craig Topper [Thu, 17 Nov 2022 22:03:05 +0000 (14:03 -0800)]
[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.

20 months agoSimplifying the SplitReduction logic that uses the control to get the
Murali Vijayaraghavan [Sat, 5 Nov 2022 03:50:40 +0000 (03:50 +0000)]
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

20 months ago[Hexagon] Add instruction definitions for Hexagon v71, v71t, and v73
Krzysztof Parzyszek [Wed, 16 Nov 2022 16:57:01 +0000 (08:57 -0800)]
[Hexagon] Add instruction definitions for Hexagon v71, v71t, and v73

This includes instruction formats, definitions, encodings, scheduling
classes, and builtins/intrinsics.

20 months ago[Hexagon] Add ELF flags for Hexagon v71, v71t, and v73
Krzysztof Parzyszek [Thu, 17 Nov 2022 21:56:50 +0000 (13:56 -0800)]
[Hexagon] Add ELF flags for Hexagon v71, v71t, and v73

20 months agoAdd generic KCFI operand bundle lowering
Sami Tolvanen [Thu, 18 Aug 2022 23:53:09 +0000 (23:53 +0000)]
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

20 months ago[clang] Use InMemoryModuleCache for readASTFileControlBlock NFC
Ben Langmuir [Thu, 17 Nov 2022 00:07:34 +0000 (16:07 -0800)]
[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

20 months ago[UBSan] Implementation NonUniqueARMRTTIBit __type_name has higher bits set on arm64
usama hameed [Mon, 7 Nov 2022 01:36:57 +0000 (17:36 -0800)]
[UBSan] Implementation NonUniqueARMRTTIBit __type_name has higher bits set on arm64

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

20 months ago[NFC][SROA] Add more tests with non-speculatable `load`s of `select`s
Roman Lebedev [Thu, 17 Nov 2022 21:40:50 +0000 (00:40 +0300)]
[NFC][SROA] Add more tests with non-speculatable `load`s of `select`s

20 months ago[mlir][sparse] Make three integration tests run with the codegen path.
bixia1 [Thu, 17 Nov 2022 20:25:41 +0000 (12:25 -0800)]
[mlir][sparse] Make three integration tests run with the codegen path.

Reviewed By: aartbik

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

20 months ago[mlir][sparse] Fix a problem in the new operator rewriter.
bixia1 [Thu, 17 Nov 2022 18:19:57 +0000 (10:19 -0800)]
[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

20 months ago[Hexagon] Improve inserting/extracting to/from scalar predicates
Krzysztof Parzyszek [Wed, 16 Nov 2022 23:30:12 +0000 (15:30 -0800)]
[Hexagon] Improve inserting/extracting to/from scalar predicates

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

20 months agoLangRef: Fix repeated word
Matt Arsenault [Fri, 11 Nov 2022 20:29:48 +0000 (12:29 -0800)]
LangRef: Fix repeated word

20 months ago[Hexagon] Fix lowering loads/stores of scalar vNi1
Krzysztof Parzyszek [Thu, 17 Nov 2022 19:54:51 +0000 (11:54 -0800)]
[Hexagon] Fix lowering loads/stores of scalar vNi1

Don't treat them as i1, all predicate bits need to be loaded or stored.

20 months ago[Hexagon] Use BUILD_PAIR instead of HexagonISD::COMBINE in lowering
Krzysztof Parzyszek [Thu, 17 Nov 2022 18:55:00 +0000 (10:55 -0800)]
[Hexagon] Use BUILD_PAIR instead of HexagonISD::COMBINE in lowering

20 months ago[openmp] [test] Unbreak tests that rely on hidden_helper_task on Windows
Martin Storsjö [Tue, 8 Nov 2022 09:37:15 +0000 (11:37 +0200)]
[openmp] [test] Unbreak tests that rely on hidden_helper_task on Windows

The hidden helper task is only enabled on Linux (kmp_runtime.cpp
initializes __kmp_enable_hidden_helper to TRUE for linux but to
FALSE for any other OS), and the __kmp_stg_parse_use_hidden_helper
function always makes it disabled on non-Linux OSes too.

Add a lit test feature for hidden helper tasks (only made available
on Linux) and mark two tests as requiring this feature.

Disable hidden helper tasks in the test that doesn't really involve
them, for consistent behaviour across platforms.

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

20 months agoRevert D119547 "[libc][bazel] Add tests to the bazel build"
Guillaume Chatelet [Thu, 17 Nov 2022 20:20:57 +0000 (20:20 +0000)]
Revert D119547 "[libc][bazel] Add tests to the bazel build"

The introducion of `constraint_setting` generated issues with downstream
integration.

This reverts commit 3c13d83ad59b5932328c0a99b0a0008e1da8b1d8.

20 months agoRefactor StaticAnalyzer to use `clang::SarifDocumentWriter`
Vaibhav Yenamandra [Thu, 17 Nov 2022 19:47:02 +0000 (14:47 -0500)]
Refactor StaticAnalyzer to use `clang::SarifDocumentWriter`

Refactor StaticAnalyzer to use clang::SarifDocumentWriter for
serializing sarif diagnostics.

Uses clang::SarifDocumentWriter to generate SARIF output in the
StaticAnalyzer.

Various bugfixes are also made to clang::SarifDocumentWriter.

Summary of changes:

clang/lib/Basic/Sarif.cpp:
  * Fix bug in adjustColumnPos introduced from prev move, it now uses
    FullSourceLoc::getDecomposedExpansionLoc which provides the correct
    location (in the presence of macros) instead of
    FullSourceLoc::getDecomposedLoc.
  * Fix createTextRegion so that it handles caret ranges correctly,
    this should bring it to parity with the previous implementation.

clang/test/Analysis/diagnostics/Inputs/expected-sarif:
  * Update the schema URL to the offical website
  * Add the emitted defaultConfiguration sections to all rules
  * Annotate results with the "level" property

clang/lib/StaticAnalyzer/Core/SarifDiagnostics.cpp:
  * Update SarifDiagnostics class to hold a clang::SarifDocumentWriter
    that it uses to convert diagnostics to SARIF.

20 months ago[CUDA] make use of deprecated texture API conditional on CUDA version.
Artem Belevich [Thu, 17 Nov 2022 19:35:34 +0000 (11:35 -0800)]
[CUDA] make use of deprecated texture API conditional on CUDA version.

20 months ago[mlir][sparse] fix crash on sparse_tensor.foreach operation on tensors with complex...
Peiming Liu [Thu, 17 Nov 2022 17:49:23 +0000 (17:49 +0000)]
[mlir][sparse] fix crash on sparse_tensor.foreach operation on tensors with complex<T> elements.

Reviewed By: aartbik, bixia

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

20 months ago[scudo] Extend basic test to cover zero size allocs.
Evgenii Stepanov [Thu, 3 Nov 2022 19:42:12 +0000 (12:42 -0700)]
[scudo] Extend basic test to cover zero size allocs.

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

20 months ago[bazel][mlir] Add missing dependency for D138178
Jakub Kuderski [Thu, 17 Nov 2022 19:10:16 +0000 (14:10 -0500)]
[bazel][mlir] Add missing dependency for D138178

20 months ago[mlir][arith] Add `index_cast` and `index_castui` support to WIE
Jakub Kuderski [Thu, 17 Nov 2022 19:01:50 +0000 (14:01 -0500)]
[mlir][arith] Add `index_cast` and `index_castui` support to WIE

Reviewed By: Mogball

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

20 months ago[X86][KCFI] Add support for memory operand unfolding
Sami Tolvanen [Wed, 16 Nov 2022 23:08:00 +0000 (23:08 +0000)]
[X86][KCFI] Add support for memory operand unfolding

When the Linux kernel is compiled without -mretpoline, KCFI fails
ungracefully because it doesn't handle indirect calls with a memory
target operand. Since the KCFI check will need to load the target
address into a register for validating the type hash anyway, simply
unfold memory operands in indirect calls that need a KCFI check.

Fixes #59017

20 months ago[Passes] reduce duplicated CHECK lines in tests; NFC
Sanjay Patel [Thu, 17 Nov 2022 18:35:23 +0000 (13:35 -0500)]
[Passes] reduce duplicated CHECK lines in tests; NFC

I missed this file when updating similarly with f44e8464027c.

20 months agoAttempt ro fix Windows build errors.
Adrian Prantl [Thu, 17 Nov 2022 18:49:44 +0000 (10:49 -0800)]
Attempt ro fix Windows build errors.

20 months ago[mlir][sparse] Extend the operator new rewriter to handle isSymmetric flag.
bixia1 [Thu, 17 Nov 2022 16:16:19 +0000 (08:16 -0800)]
[mlir][sparse] Extend the operator new rewriter to handle isSymmetric flag.

Reviewed By: aartbik

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

20 months ago[mlir][spirv][math] Fix crash on unsupported types in math-to-spirv
Jakub Kuderski [Thu, 17 Nov 2022 18:45:01 +0000 (13:45 -0500)]
[mlir][spirv][math] Fix crash on unsupported types in math-to-spirv

Fail to match conversion patterns when source op has unsupported types.

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

Reviewed By: antiagainst

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

20 months ago[ARM][AArch64] Use StringRef in TargetParser structs
Tomas Matheson [Mon, 24 Oct 2022 13:25:37 +0000 (14:25 +0100)]
[ARM][AArch64] Use StringRef in TargetParser structs

The invalid case is now represented by an empty StringRef rather than
a nullptr.

Previously ARCH_FEATURE was build from SUB_ARCH by prepending "+".
This is now reverse, so that the "+arch-feature" is now visible in
the .def, which is a bit clearer. This meant converting one StringSwitch
into a loop.

Removed getters which are now mostly unnecessary.

Removed some old FIXMEs.

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

20 months ago[LoopInterchange] Refactor and rewrite validDepInterchange()
Mengxuan Cai [Thu, 17 Nov 2022 18:33:37 +0000 (13:33 -0500)]
[LoopInterchange] Refactor and rewrite validDepInterchange()

The current code of validDepInterchange() enumerates cases that are
legal for interchange. This could be simplified by checking
lexicographically order of the swapped direction matrix.

Reviewed By: congzhe, Meinersbur, bmahjour

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

20 months ago[mlir][arith] Add Max*I and Min*I support to WIE
Jakub Kuderski [Thu, 17 Nov 2022 18:36:02 +0000 (13:36 -0500)]
[mlir][arith] Add Max*I and Min*I support to WIE

This includes LIT IR tests and runtime tests.

Reviewed By: Mogball

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

20 months ago[Pipelines] Introduce SROA after (final, run-time) loop unrolling
Roman Lebedev [Thu, 17 Nov 2022 18:17:56 +0000 (21:17 +0300)]
[Pipelines] Introduce SROA after (final, run-time) loop unrolling

Now that we are done with loop unrolling, be it either by LoopVectorizer,
or LoopUnroll passes, some variable-offset GEP's into alloca's could have
become constant-offset, thus enabling SROA and alloca promotion,
yet we don't capitalize on that, which is surprizing.

While it would be good to not introduce one more SROA invocation,
but instead move the one from `PassBuilder::buildFunctionSimplificationPipeline()`,
the existing test coverage says that is a bad idea,
though it would be fine compile-time wise: https://llvm-compile-time-tracker.com/compare.php?from=b150d34c47efbd8fa09604bce805c0920360f8d7&to=5a9a5c855158b482552be8c7af3e73d67fa44805&stat=instructions

So instead, i add yet another SROA run.
I have checked, and it needs to be at least after said final loop unrolling.
This is still fine compile-time wise: https://llvm-compile-time-tracker.com/compare.php?from=70324cd88328c0924e605fa81b696572560aa5c9&to=fb489bbef687ad821c3173a931709f9cad9aee8a&stat=instructions

I've encountered this in a real code, `SROA-after-final-loop-unrolling.ll` has been reduced from https://godbolt.org/z/fsdMhETh3

Reviewed By: spatel

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

20 months ago[flang] Propagate fastmath flags during intrinsics simplification.
Slava Zakharin [Tue, 15 Nov 2022 19:09:59 +0000 (11:09 -0800)]
[flang] Propagate fastmath flags during intrinsics simplification.

In general, the meaning of fastmath flags on a call during inlining
is that the call's operation flags must be ignored. For user functions
that means that the fastmath flags used for the function definition
override any call site's fastmath flags. For intrinsic functions
we can use the call site's fastmath flags, but we have to make sure
that the call sites with different flags produce/use different
simplified versions of the same intrinsic function.

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

20 months ago[Passes] reduce duplicated CHECK lines in tests; NFC
Sanjay Patel [Thu, 17 Nov 2022 17:54:58 +0000 (12:54 -0500)]
[Passes] reduce duplicated CHECK lines in tests; NFC

20 months ago[mlir][sparse] Run an integration test with codegen.
bixia1 [Thu, 17 Nov 2022 15:32:58 +0000 (07:32 -0800)]
[mlir][sparse] Run an integration test with codegen.

Reviewed By: Peiming

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

20 months ago[Analysis] `isSafeToLoadUnconditionally()`: `lifetime` intrinsics can be ignored
Roman Lebedev [Thu, 17 Nov 2022 17:23:51 +0000 (20:23 +0300)]
[Analysis] `isSafeToLoadUnconditionally()`: `lifetime` intrinsics can be ignored

In practice this means that we can speculate more loads in SROA.
This e.g. comes up in https://godbolt.org/z/G8716s6sj,
although we are missing second half of the puzzle to optimize that.

20 months ago[NFC][SROA] Add test for select speculation failures
Roman Lebedev [Thu, 17 Nov 2022 17:02:12 +0000 (20:02 +0300)]
[NFC][SROA] Add test for select speculation failures

20 months ago[AMDGPU] Allow finer grain control of an unaligned access speed
Stanislav Mekhanoshin [Thu, 21 Apr 2022 23:23:11 +0000 (16:23 -0700)]
[AMDGPU] Allow finer grain control of an unaligned access speed

A target can return if a misaligned access is 'fast' as defined
by the target or not. In reality there can be different levels
of 'fast' and 'slow'. This patch changes the boolean 'Fast'
argument of the allowsMisalignedMemoryAccesses family of functions
to an unsigned representing its speed.

A target can still define it as it wants and the direct translation
of the current code uses 0 and 1 for current false and true. This
makes the change an NFC.

Subsequent patch will start using an actual value of speed in
the load/store vectorizer to compare if a vectorized access going
to be not just fast, but not slower than before.

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

20 months agoFix MSVC "not all control paths return a value" warning. NFC.
Simon Pilgrim [Thu, 17 Nov 2022 17:19:41 +0000 (17:19 +0000)]
Fix MSVC "not all control paths return a value" warning. NFC.

20 months agoValueTracking: Look through copysign in isKnownNeverInfinity
Matt Arsenault [Thu, 17 Nov 2022 07:08:23 +0000 (23:08 -0800)]
ValueTracking: Look through copysign in isKnownNeverInfinity

20 months ago[AMDGPU] Remove isLiteralConstant and isLiteralConstantLike
Jay Foad [Tue, 8 Mar 2022 13:16:18 +0000 (13:16 +0000)]
[AMDGPU] Remove isLiteralConstant and isLiteralConstantLike

isLiteralConstant and isLiteralConstantLike were similar to
!isInlineConstant with slight differences like handling isReg operands.

To avoid a profusion of similar functions with undocumented differences,
this patch removes all the isLiteralConstant* variants. Callers are responsible
for handling the isReg case.

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

20 months agoValueTracking: Look through fneg in isKnownNeverNaN
Matt Arsenault [Thu, 17 Nov 2022 06:38:08 +0000 (22:38 -0800)]
ValueTracking: Look through fneg in isKnownNeverNaN

20 months ago[Clang, SystemZ] Add support for option -mno-pic-data-is-text-relative.
Jonas Paulsson [Sun, 6 Nov 2022 18:13:50 +0000 (19:13 +0100)]
[Clang, SystemZ] Add support for option -mno-pic-data-is-text-relative.

Add support for this GCC option which has the purpose of disallowing text
relative accesses of module local symbols with PIC. In effect, this changes
the code model to "medium".

Reviewed By: uweigand, efriedma, MaskRay

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

20 months ago[include-cleaner] add macro symbols and implicit refs to HTML report
Sam McCall [Wed, 9 Nov 2022 00:07:55 +0000 (01:07 +0100)]
[include-cleaner] add macro symbols and implicit refs to HTML report

Demo: http://htmlpreview.github.io/?https://gist.githubusercontent.com/sam-mccall/fec9b77c726cfb3cc7c424b197e3f68c/raw/8c5c5ad927b0485db76c34c25250b0ae8f7637f8/ASTTests.html

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

20 months ago[SDAG] Assert we don't see scalable VECTOR_SHUFFLES
Philip Reames [Thu, 17 Nov 2022 16:17:58 +0000 (08:17 -0800)]
[SDAG] Assert we don't see scalable VECTOR_SHUFFLES

It was pointed out in review of D137140 that this case should be impossible.  This patch converts an existing bailout into an assert instead.

20 months ago[test] Allow skipTestIfFn to apply to entire classes for skipIfNoSBHeaders
Jordan Rupprecht [Thu, 17 Nov 2022 16:17:10 +0000 (08:17 -0800)]
[test] Allow skipTestIfFn to apply to entire classes for skipIfNoSBHeaders

Some test cases are already marked @skipIfNoSBHeaders, but they make use of SBAPI headers in test setup. The setup will fail if the headers are missing, so it is too late to wait until the test case to apply the skip annotation.

In addition to allowing this to apply to entire classes, I also changed all the existing annotations from test cases to test classes where necessary/appropriate.

Reviewed By: DavidSpickett

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

20 months ago[ARM][AArch64] De-template TargetParser types
Tomas Matheson [Mon, 24 Oct 2022 13:18:01 +0000 (14:18 +0100)]
[ARM][AArch64] De-template TargetParser types

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

20 months agoFix debug-info test
Alex Brachet [Thu, 17 Nov 2022 16:02:54 +0000 (16:02 +0000)]
Fix debug-info test

20 months ago[flang] Set default to -ffpcontract=fast
Tom Eccles [Fri, 11 Nov 2022 20:00:18 +0000 (20:00 +0000)]
[flang] Set default to -ffpcontract=fast

Following RFC at
https://discourse.llvm.org/t/rfc-ffp-contract-default-value/66301

This adds the `fastmath<contract>` attribute to `fir.call` and some
floating point arithmetic operations (hence the many test changes).
Instead of testing for this specific attribute, I am using a regular
expression to match any attributes.

20 months ago[libc++][NFC] Add missing include <cstring> in char_traits.h
Louis Dionne [Thu, 17 Nov 2022 15:46:38 +0000 (10:46 -0500)]
[libc++][NFC] Add missing include <cstring> in char_traits.h