Commit Graph

436343 Commits

Author SHA1 Message Date
Roy Jacobson 368b6832de [Clang] Implement fix for DR2628
Implement suggested fix for [[ https://cplusplus.github.io/CWG/issues/2628.html | DR2628. ]] Couldn't update the DR docs because there hasn't been a DR index since it was filed, but the tests still run in CI.

Note: I only transfer the constructor constraints, not the struct constraints. I think that's OK because the struct constraints are the same
for all constructors so they don't affect the overload resolution, and if they deduce to something that doesn't pass the constraints
we catch it anyway. So (hopefully) that should be more efficient without sacrificing correctness.

Closes:
https://github.com/llvm/llvm-project/issues/57646
https://github.com/llvm/llvm-project/issues/43829

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D134145
2022-09-20 00:07:41 +03:00
Alexey Bataev ce39bdbd65 [SLP][NFC]Reorder gather nodes with reused scalars, NFC.
The compiler does not reorder the gather nodes with reused scalars, just
does it for opernads of the user nodes. This currently does not affect
the compiler but breaks internal logic of the SLP graph. In future, it
is supposed to actually use all nodes instead of just list of operands
and this will affect the vectorization result.
Also, did some early check to avoid complex logic in cost estimation
analysis, should improve compiler time a bit.
2022-09-19 14:00:17 -07:00
Philip Reames ef253d9b47 [RISCV] Adding missing test from a4a29438f
This change was originally reviewed as part of what became a4a29438f, but apparently forgot to git-add it when applying the patch.  Oops.
2022-09-19 13:45:56 -07:00
Jeffrey Tan dc9e6c52f3 Add auto deduce source map setting
This patch adds a new "target.auto-source-map-relative" setting.

    If enabled, this setting may auto deduce a source map entry based on requested
    breakpoint path and the original path stored in debug info for resolved
    breakpoint.

    As an example, if debug info contains "./a/b/c/main.cpp", user sets a source
    breakpoint at "/root/repo/x/y/z/a/b/c/main.cpp". The breakpoint will resolve
    correctly now with Greg's patch https://reviews.llvm.org/D130401. However, the
    resolved breakpoint will use "./a/b/c/main.cpp" to locate source file during
    stop event which would fail most of the time.

    With the new "target.auto-source-map-relative" setting enabled, a auto deduced
    source map entry "." => "/root/repo/x/y/z" will be added. This new mapping will
    help lldb to map resolved breakpoint path "./a/b/c/main.cpp" back to
    "/root/repo/x/y/z/a/b/c/main.cpp" and locate it on disk.

    If an existing source map entry is used the patch also concatenates the auto
    deduced entry with any stripped reverse mapping prefix (see example below).

    As a second example, debug info contains "./a/b/c/main.cpp" and user sets
    breakpoint at "/root/repo/x/y/z/a/b/c/main.cpp". Let's say there is an existing
    source map entry "." => "/root/repo"; this mapping would strip the prefix out of
    "/root/repo/x/y/z/a/b/c/main.cpp" and use "x/y/z/a/b/c/main.cpp" to resolve
    breakpoint. "target.auto-source-map-relative" setting would auto deduce a new
    potential mapping of "." => "x/y/z", then it detects that there is a stripped
    prefix from reverse mapping and concatenates it as the new mapping:
     "." => "/root/repo/x/y/z" which would correct map "./a/b/c/main.cpp" path to
    new path in disk.

    This patches depends on https://reviews.llvm.org/D130401 to use new added
    SBDebugger::GetSetting() API for testing.

Differential Revision: https://reviews.llvm.org/D133042
2022-09-19 13:40:22 -07:00
Amir Ayupov 39336fc09c [BOLT] Control aggregation mode output profile file format
In perf2bolt and `-aggregate-only` BOLT mode, the output profile file is written
in fdata format by default. Provide a knob `-profile-format=[fdata,yaml]` to
control the format.
Note that `-w` option still dumps in YAML format.

Reviewed By: #bolt, maksfb

Differential Revision: https://reviews.llvm.org/D133995
2022-09-19 13:37:10 -07:00
Vitaly Buka 6f3276d57e [msan] Check mask and pointers shadow
Msan has default handler for unknown instructions which
previously applied to these as well. However depending on
mask, not all pointers or passthru part will be used. This
allows other passes to insert undef into sum arguments.
As result,  default strict instruction handler can produce false reports.

Reviewed By: kda, kstoimenov

Differential Revision: https://reviews.llvm.org/D133678
2022-09-19 13:09:56 -07:00
David Majnemer 955d7c39ff [clang] Add support for #pragma strict_gs_check 2022-09-19 20:07:14 +00:00
Christopher Bate 4d27f06f94 [mlir][Tensor] Fix ExtractSliceFromReshape transform edge case
The transformation would fail if none of the sliced dimensions were
linearized by the producing `tensor.collapse_shape`. This is a trivial
edge case but it wasn't correctly tested. Fixes the issue and adds a test.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D134088
2022-09-19 14:02:45 -06:00
Fangrui Song e601e25244 [test] Update llvm-dwp/X86/nocompress.test 2022-09-19 12:58:50 -07:00
Simon Pilgrim 7e5db16850 [CostModel][X86] Add CostKinds test coverage for min/max intrinsics 2022-09-19 20:50:25 +01:00
Tobias Hieta b27f6de35d
[docs] Fix build-docs.sh
If libcxxabi is not included CMake will error out:

Cannot find target libcxxabi-SHARED

I ran into this doing the 15.0.0 release

Differential Revision: https://reviews.llvm.org/D133475
2022-09-19 21:45:12 +02:00
Joseph Huber b647f13226 [CUDA][HIP] Fix new driver crashing when using -save-temps in RDC-mode
Previously when using the `clang-offload-packager` we did not pass the
active offloading kinds. Then in Clang when we attempted to detect when
there was host-offloading action that needed to be embedded in the host
we did not find it. This patch adds the active offloading kinds so we
know when there is input to be embedded.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D134189
2022-09-19 14:38:44 -05:00
Louis Dionne ad0dfb4f5e [libc++] Document the format of _LIBCPP_VERSION
Differential Revision: https://reviews.llvm.org/D134187
2022-09-19 15:31:02 -04:00
Dmitri Gribenko 7b7559aa43 [bazel] Port ba8424a251 2022-09-19 21:21:08 +02:00
Slava Zakharin 8bd76ac151 [flang] Support multidimensional reductions in SimplifyIntrinsicsPass.
Create simplified functions for each rank with "x<rank>" suffix
that implement multidimensional reductions. To enable this I had to fix
an issue with taking incorrect box shape in cases of sliced embox/rebox.

Differential Revision: https://reviews.llvm.org/D133820
2022-09-19 12:16:23 -07:00
Slava Zakharin 2b138567e0 [flang] Support more data types for reduction in SimplifyIntrinsicsPass.
All floating point (not complex) and integer types should be supported now.

Differential Revision: https://reviews.llvm.org/D133818
2022-09-19 12:16:22 -07:00
Wei Yi Tee 88210b81ee [clang][dataflow] Refactor `clang/Analysis/FlowSensitive/MatchSwitchTest.cpp`.
- Remove use of `runDataflowAnalysis` to keep test isolated.
- Add test for `ASTMatchSwitch<CXXCtorInitializer, ...>`.

Reviewed By: gribozavr2, sgatev

Differential Revision: https://reviews.llvm.org/D133935
2022-09-19 19:10:41 +00:00
Mircea Trofin c625c17b88 [lld][thinlto] Include -mllvm options in the thinlto cache key
They may modify thinlto optimization.

This patch only extends support for `-mllvm`. There is another way to
pass llvm flags, `-plugin-opt`, but its processing is different and will
be provided in a subsequent patch.

Differential Revision: https://reviews.llvm.org/D134013
2022-09-19 12:04:17 -07:00
Haojian Wu eec19987c0 Fix one more unused warning in release build, NFC 2022-09-19 20:56:39 +02:00
Haojian Wu 20822e2d42 Fix an unused warning in release build, NFC 2022-09-19 20:45:51 +02:00
Fangrui Song 0b140d0910 [Object] Add zstd decompression support to Decompressor
llvm::object::Decompressor is used by many DWARF consumers like llvm-dwarfdump,
llvm-dwp, llvm-symbolizer. Add tests to them. The lldb test can be left to
D133530.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D134116
2022-09-19 11:41:16 -07:00
Wei Yi Tee 41d52c5a7f [clang][dataflow] Modify `transfer` in `DataflowModel` to take `CFGElement` as input instead of `Stmt`.
To keep API of transfer functions consistent.

The single use of this transfer function in `ChromiumCheckModel` is also updated.

Reviewed By: gribozavr2, sgatev

Differential Revision: https://reviews.llvm.org/D133933
2022-09-19 18:40:29 +00:00
jeff 1bb293f658 [AMDGPU] [DAGCombiner] Precommit test for D133584
Change-Id: I488ac9b23718f8d0b28db034c4cc455ae736e785
2022-09-19 11:37:35 -07:00
Nuno Lopes bc698c77af add test for -enable-global-analyses=0 [NFC] 2022-09-19 19:25:14 +01:00
Krzysztof Parzyszek 94a71361d6 [Hexagon] Implement [SU]INT_TO_FP and FP_TO_[SU]INT for HVX 2022-09-19 11:11:20 -07:00
Nirvedh Meshram 8a5c7e36c0 [mlir][spirv] fix ordering in Intel joint matrix ops
Reviwed By: antiagainst

Differential Revision: https://reviews.llvm.org/D134069
2022-09-19 11:09:01 -07:00
Wei Yi Tee cf94c52e35 [clang][dataflow] Replace `transfer(const Stmt *, ...)` with `transfer(const CFGElement *, ...)` in `clang/Analysis/FlowSensitive`.
Reviewed By: gribozavr2, sgatev

Differential Revision: https://reviews.llvm.org/D133931
2022-09-19 18:06:57 +00:00
Vitaly Buka bbef90ace4 [IRBuilder] Use PoisonValue in CreateMasked*
Followup to 72b776168c

Reviewed By: nlopes

Differential Revision: https://reviews.llvm.org/D133967
2022-09-19 11:01:41 -07:00
Kazu Hirata 981fa1c15c Fix unused variable warnings:
This patch fixes warnings during a release build:

  mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp:198:52: error:
  lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]

  bolt/lib/Rewrite/RewriteInstance.cpp:5318:18: error: unused variable
  'HasNoAddress' [-Werror,-Wunused-variable]
2022-09-19 10:42:50 -07:00
Stanley Winata 7d23d1e640 [mlir][spirv] Lower arith max/min ops to OpenCL ones
Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D132881
2022-09-19 13:34:09 -04:00
Wei Yi Tee 7538b36045 [clang][dataflow] Replace usage of deprecated functions with the optional check
- Update `transfer` and `diagnose` to take `const CFGElement *` as input in `Analysis/FlowSensitive/Models/UncheckedOptionalAccessModel`.
- Update `clang-tools-extra/clang-tidy/bugprone/UncheckedOptionalAccessCheck.cpp` accordingly.
- Rename `runDataflowAnalysisOnCFG` to `runDataflowAnalysis` and remove the deprecated `runDataflowAnalysis` (this was only used by the now updated optional check).

Reviewed By: gribozavr2, sgatev

Differential Revision: https://reviews.llvm.org/D133930
2022-09-19 17:33:25 +00:00
Stanley Winata 9c3a73a579 [mlir][spirv] Support OpenCL when lowering memref load/store
-Add awareness to Kernel vs Shader capability for memref to SPIR-V
 lowering.
-Add lowering using spv.PtrAccessChain for Kernel capability.
-Enable lowering from scalar pointee types for kernel capabilities.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D132714
2022-09-19 13:24:21 -04:00
Haojian Wu e782d9a4a4 [clang] Fix a nullptr-access crash in CheckTemplateArgument.
It is possible that we can pass a null ParamType to
CheckNonTypeTemplateParameter -- the ParamType var can be reset to a null
type on Line 6940, and the followed bailout if is not entered.

Differential Revision: https://reviews.llvm.org/D134180
2022-09-19 19:18:50 +02:00
Florian Hahn 582f8ef19f
[LV] Keep track of cost-based ScalarAfterVec in VPWidenPointerInd.
Epilogue vectorization uses isScalarAfterVectorization to check if
widened versions for inductions need to be generated and bails out in
those cases.

At the moment, there are scenarios where isScalarAfterVectorization
returns true but VPWidenPointerInduction::onlyScalarsGenerated would
return false, causing widening.

This can lead to widened phis with incorrect start values being created
in the epilogue vector body.

This patch addresses the issue by storing the cost-model decision in
VPWidenPointerInductionRecipe and restoring the behavior before 151c144.
This effectively reverts 151c144, but the long-term fix is to properly
support widened inductions during epilogue vectorization

Fixes #57712.
2022-09-19 18:14:35 +01:00
Craig Topper e6f8a6b56e [LangRef] Clarify that noimplicitfloat disables all implicit vectors not just floating point.
Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D134086
2022-09-19 10:13:51 -07:00
Simon Pilgrim 37dc4373aa [LoopIdiom] Add non-LZCNT target test coverage 2022-09-19 18:13:11 +01:00
Krzysztof Parzyszek ec51e38062 [Hexagon] Add HVX patterns for ISD::ABS 2022-09-19 10:12:15 -07:00
Vitaly Buka 8edce2ff04 [test][clangd] Join back -Xclang and -undef 2022-09-19 10:11:37 -07:00
Craig Topper 90a004b4a1 [LV] Remove FIXME about NoImplicitFloat. NFC
My understanding is that NoImplicitFloat, despite it's name, is
supposed to disable all vectors not just float vectors.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D134084
2022-09-19 10:01:02 -07:00
zhijian 449a7c2c47 Fixed llvm-nm.rst:145:Block quote ends without a blank line; unexpected unindent.
ninja: build stopped: subcommand failed.
2022-09-19 13:00:25 -04:00
Lei Zhang 9d59705169 [mlir][tensor] Fold round-tripping extract/insert slice ops
Reviewed By: ThomasRaoux, nicolasvasilache

Differential Revision: https://reviews.llvm.org/D133909
2022-09-19 12:58:52 -04:00
Mathieu Fehr ba8424a251 [mlir] Add Dynamic Dialects
Dynamic dialects are dialects that can be defined at runtime.
Dynamic dialects are extensible by new operations, types, and
attributes at runtime.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D125201
2022-09-19 09:58:18 -07:00
Michał Górny daebf2c13c [clang] Make config-related options CoreOptions
Make `--config`, `--no-default-config` and `--config-*-dir` CoreOptions
to enable their availability to all clang driver modes.  This improves
consistency given that the default set of configuration files is
processed independently of mode anyway.

Differential Revision: https://reviews.llvm.org/D134191
2022-09-19 18:58:09 +02:00
Sebastian Peryt 99c9b37d11 [NFC][1/n] Remove -enable-new-pm=0 flags from lit tests
This is the first patch in a series intended for removing flag
-enable-new-pm=0 from lit tests. This is part of a bigger
effort of completely removing legacy code related to legacy
pass manager in favor of currently default new pass manager.

In this patch flag has been removed only from tests where no significant
change has been required because checks has been duplicated for
both PMs.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D134150
2022-09-19 09:57:37 -07:00
Felipe de Azevedo Piovezan 9749587498 [lldb] Reset breakpoint hit count before new runs
A common debugging pattern is to set a breakpoint that only stops after
a number of hits is recorded. The current implementation never resets
the hit count of breakpoints; as such, if a user re-`run`s their
program, the debugger will never stop on such a breakpoint again.

This behavior is arguably undesirable, as it renders such breakpoints
ineffective on all but the first run. This commit changes the
implementation of the `Will{Launch, Attach}` methods so that they reset
the _target's_ breakpoint hitcounts.

Differential Revision: https://reviews.llvm.org/D133858
2022-09-19 12:56:12 -04:00
mydeveloperday 95b3947111 [clang-format] JSON formatting add new option for controlling newlines in json arrays
Working in a mixed environment of both vscode/vim with a team configured prettier configuration, this can leave clang-format and prettier fighting each other over the formatting of arrays, both simple arrays of elements.

This review aims to add some "control knobs" to the Json formatting in clang-format to help align the two tools so they can be used interchangeably.

This will allow simply arrays `[1, 2, 3]` to remain on a single line but will break those arrays based on context within that array.

Happy to change the name of the option (this is the third name I tried)

Reviewed By: HazardyKnusperkeks, owenpan

Differential Revision: https://reviews.llvm.org/D133589
2022-09-19 17:54:39 +01:00
Keith Smiley f331ccca26
[ORC] Fix macho section name typo
I don't think __obj_selrefs is a thing, but __objc_selrefs definitely
is.

Differential Revision: https://reviews.llvm.org/D130221
2022-09-19 09:49:46 -07:00
Rahul Joshi e4c395018e BEGIN_PUBLIC
Use isa<> instead of dyn_cast
END_PUBLIC

Differential Revision: https://reviews.llvm.org/D134092
2022-09-19 09:48:39 -07:00
Krzysztof Parzyszek 3eee45cdc8 [Hexagon] Rework SplitHvxPairOp to be a general vector splitting utiity
Enable creating an idiom: V -> opJoin(SplitVectorOp(V))
2022-09-19 09:42:13 -07:00
Simon Pilgrim 6b4d409f69 [CostModel][X86] Add CostKinds handling for CTLZ_ZERO_UNDEF/CTTZ_ZERO_UNDEF instructions
This was achieved with the 'cost-tables vs llvm-mca' script D103695
2022-09-19 17:37:58 +01:00