David Green [Sun, 28 May 2023 18:12:45 +0000 (19:12 +0100)]
[ARM] Allow D-reg copies to use VMOVD with fpregs64
This instruction should be available with MVE, where we have D regs, not
requiring the full FP64 target feature.
Krzysztof Parzyszek [Fri, 26 May 2023 20:29:13 +0000 (13:29 -0700)]
[Hexagon] Explicitly make vector subregs have unknown size and offset
Vector length depends on the HVX mode, so make the size and offset unknown
instead using values for some specific mode.
Justin Lebar [Sun, 28 May 2023 14:53:04 +0000 (07:53 -0700)]
[LSV] Fix the ContextInst for computeKnownBits.
Previously we used the later of GEPA or GEPB. This is hacky because
really we should be using the later of the two load/store instructions
being considered. But also it's flat-out incorrect, because GEPA and
GEPB might be in different BBs, in which case we cannot ask which one
comes last (assertion failure,
https://reviews.llvm.org/D149893#4378332).
Fixed, now we use the correct context instruction.
Differential Revision: https://reviews.llvm.org/D151630
Vlad Serebrennikov [Sun, 28 May 2023 12:58:14 +0000 (15:58 +0300)]
[clang][NFC] Update latest released Clang versions in make_cxx_dr_status
This changes a handful of recently implemented DRs from "unreleased" to "full" styling in cxx_dr_status.html
Ivan Murashko [Sun, 28 May 2023 10:47:29 +0000 (11:47 +0100)]
[clang][HeaderSearch] Fix implicit module when using header maps
Previously, if a header was found via in a header map, and not just remapped.
we wouldn't also find the module it maps to when using implicit modules (for
module maps that were explicitly loaded).
This diff just updates these code paths to also locate the owning module via
`findUsableModuleForHeader`.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D103930
Martin Storsjö [Wed, 24 May 2023 07:45:51 +0000 (07:45 +0000)]
[libcxx] [test] Fix the new alloc tests for Windows
Use ASSERT_WITH_OPERATOR_NEW_FALLBACKS where relevant to waive
the known cases where operator new isn't overridden as expected,
in MinGW DLL configurations.
Clarify the reason for why the fallback in
new.delete.array/new.size_align_nothrow.replace.indirect doesn't
work as expected, which can be considered a vcruntime bug.
Differential Revision: https://reviews.llvm.org/D151304
Martin Storsjö [Fri, 26 May 2023 22:09:39 +0000 (22:09 +0000)]
[clang-repl] Fix REPL_EXTERNAL_VISIBILITY and building libclang-cpp.dll for MinGW configurations
This fixes two issues that are observed after
5111286f06e1e10f24745007a45a830760f1790c:
For builds with GCC with LLVM_LINK_LLVM_DYLIB=ON, we previously got
build errors, as libclang-cpp.dll suddenly only contained the
functions that were marked dllexport via REPL_EXTERNAL_VISIBILITY,
instead of all symbols as expected.
For MinGW builds with Clang, building previously succeeded (as it
used either the __attribute__((visibility("default"))) annotation or
nothing at all), and the functions were exported from libclang-cpp.dll
if that was built, but the unit test failed (as neither of those cases
made the functions exported from an EXE).
Don't use the visibility attributes on MinGW targets for these purposes;
setting default visibility only makes a difference if building with
e.g. -fvisibility=hidden, but it doesn't make the symbols exported
from an EXE.
Differential Revision: https://reviews.llvm.org/D151620
eopXD [Sun, 28 May 2023 08:29:36 +0000 (01:29 -0700)]
[Clang][RISCV] Reduce boilerplate under RVVEmitter::createHeader. NFC
Signed-off by: eop Chen <eop.chen@sifive.com>
Kazu Hirata [Sun, 28 May 2023 05:26:37 +0000 (22:26 -0700)]
[ModuleInliner] Remove an inapplicable comment
The module inliner has its own logic in deciding the order in which
call sites are inlined, so the comment is inapplicable.
Kazu Hirata [Sat, 27 May 2023 21:53:54 +0000 (14:53 -0700)]
[StaticAnalyzer] Remove unused declaration handleLVectorSplat
The corresponding function definition was removed by:
commit
55662b24a4755680e4fd34dc22a3dd555fdb1291
Author: Balazs Benics <balazs.benics@sigmatechnology.se>
Date: Thu Jul 1 10:54:28 2021 +0200
Kazu Hirata [Sat, 27 May 2023 21:53:53 +0000 (14:53 -0700)]
[StaticAnalyzer] Remove unused declaration findDirectConstructorForCurrentCFGElement
The corresponding definition was removed by:
commit
a84374dc0e4e756a92191dd55efca43165e3977d
Author: Artem Dergachev <artem.dergachev@gmail.com>
Date: Thu Jun 14 01:40:49 2018 +0000
Kazu Hirata [Sat, 27 May 2023 21:53:51 +0000 (14:53 -0700)]
[StaticAnalyzer] Remove unused declaration evalLoadCommon
The corresponding function definition was removed by:
commit
e0fb481cc57f5a9fb4908ab0a871c49d7ee61382
Author: Artem Dergachev <artem.dergachev@gmail.com>
Date: Fri May 4 23:01:10 2018 +0000
Aart Bik [Sat, 27 May 2023 20:38:36 +0000 (13:38 -0700)]
[mlir][sparse][gpu] fix merge conflict
Reviewed By: K-Wu
Differential Revision: https://reviews.llvm.org/D151619
Eugene Burmako [Sat, 27 May 2023 20:25:36 +0000 (13:25 -0700)]
[mlir][bazel] Port for 660f714, third attempt
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D151618
Kun Wu [Wed, 24 May 2023 02:21:55 +0000 (02:21 +0000)]
[mlir][gpu][sparse] adding cusparse sddmm support
Differential Revision: https://reviews.llvm.org/D151279
Eugene Burmako [Fri, 26 May 2023 21:16:47 +0000 (14:16 -0700)]
[MLIR] Reformat the Bazel build
This patch normalizes formatting of the the root BUILD.bazel file by: 1) adjusting indentation a little bit, 2) alphabetically ordering dependencies. These small deviations were introduced by some yesterday's patches:
* https://reviews.llvm.org/D151104
* https://reviews.llvm.org/D151346
* https://reviews.llvm.org/rG16fe2b37365c00b0c6d0ed22c2e6521f2d5de01a
* https://reviews.llvm.org/rG4d1cd1d8caab13d6b76ce6fc4ff76a01a7931c34
Reviewed By: aartbik
Differential Revision: https://reviews.llvm.org/D151499
Florian Hahn [Sat, 27 May 2023 19:47:57 +0000 (20:47 +0100)]
[ConstraintElimination] Add tests with incrementing pointer IV.
Add initial set of tests for improved loop phi handling.
LLVM GN Syncbot [Sat, 27 May 2023 19:23:49 +0000 (19:23 +0000)]
[gn build] Port
ddeab07ca632
Nico Weber [Sat, 27 May 2023 19:23:26 +0000 (15:23 -0400)]
Kazu Hirata [Sat, 27 May 2023 17:45:18 +0000 (10:45 -0700)]
[Analysis] Remove unused declaration getCurrentLVarDefinition
The declaration was added without a corresponding function definition
by:
commit
ae497deddfd9c631380bc622fa3e184531c2600a
Author: DeLesley Hutchins <delesley@google.com>
Date: Sat Apr 19 00:35:54 2014 +0000
Kazu Hirata [Sat, 27 May 2023 17:45:16 +0000 (10:45 -0700)]
[Serialization] Remove unused declaration SLocCursorForID
The corresponding function body was removed by:
commit
925296b4c2cbb358c34323dfcffbea6d59eb9c1e
Author: Douglas Gregor <dgregor@apple.com>
Date: Tue Jul 19 16:10:42 2011 +0000
Kazu Hirata [Sat, 27 May 2023 17:29:23 +0000 (10:29 -0700)]
[AST] Remove unused function removeLocalCVRQualifiers
The last use was removed by:
commit
0eb06cb3aa2700508c20da28f22ff91e7b82a436
Author: Roy Jacobson <roi.jacobson1@gmail.com>
Date: Tue Mar 14 21:25:54 2023 +0200
Differential Revision: https://reviews.llvm.org/D151607
Kazu Hirata [Sat, 27 May 2023 17:29:21 +0000 (10:29 -0700)]
[Bitcode] Modernize PerBlockIDStats (NFC)
Kazu Hirata [Sat, 27 May 2023 17:29:20 +0000 (10:29 -0700)]
[polly] Fix typos in documentation
Krzysztof Parzyszek [Fri, 26 May 2023 16:20:12 +0000 (09:20 -0700)]
[Hexagon] Use scalar evolution to calculate pointer difference in HVC
Bing1 Yu [Fri, 26 May 2023 08:48:39 +0000 (16:48 +0800)]
[CGP] Disable default copy ctor and copy assignment operator for InstructionRemover
class InstructionRemover manages resources such as dynamically allocated memory, it's generally a good practice to either implement a custom copy constructor or disable the default one.
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D151543
Manna, Soumi [Sat, 27 May 2023 14:15:24 +0000 (07:15 -0700)]
[NFC][CLANG] Fix nullptr dereference issue in CodeGenModule::GetConstantArrayFromStringLiteral()
This patch adds an assert.
Reviewed By: erichkeane
Differential Revision: https://reviews.llvm.org/D151480
Simon Pilgrim [Wed, 24 May 2023 18:51:21 +0000 (19:51 +0100)]
[X86] lowerBuildVectorAsBroadcast - broadcast Constant of original (BuildVector) element size
Noticed in D150143/D150526 - we currently create scalar Constant values using the broadcast instruction width, which might be wider than the original build vector width, making it tricky to recognise the original constant bits data.
If we have widened the broadcast value, its much more useful for asm comments if we create a ConstantVector with the original element data, add that to the constant-pool and load that with the same (wider) broadcast instruction.
Markus Mützel [Sat, 27 May 2023 12:54:18 +0000 (14:54 +0200)]
[flang][runtime] Support all non-ASCII characters in temporary path on Windows
If the path to the TEMP folder contains (non-ASCII) characters that cannot be
encoded in the current 8-bit locale of the user, openfile_mkstemp might fail
on Windows.
That is an unlikely scenario. But given that the path to the default TEMP
folder on Windows contains the Windows user name, it is still possible.
Use the wide character Windows API to avoid that (unlikely) issue.
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D151571
Mark de Wever [Sat, 27 May 2023 11:57:26 +0000 (13:57 +0200)]
[libc++][format][test] Adds Windows support.
These tests pass on Windows without additional changes. This has been
tested in D150593.
Mark de Wever [Wed, 24 May 2023 16:12:32 +0000 (18:12 +0200)]
Reland "[CMake] Bumps minimum version to 3.20.0.
This reverts commit
d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6.
Adds the patch by @hans from
https://github.com/llvm/llvm-project/issues/62719
This patch fixes the Windows build.
d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6 reverted the reviews
D144509 [CMake] Bumps minimum version to 3.20.0.
This partly undoes D137724.
This change has been discussed on discourse
https://discourse.llvm.org/t/rfc-upgrading-llvms-minimum-required-cmake-version/66193
Note this does not remove work-arounds for older CMake versions, that
will be done in followup patches.
D150532 [OpenMP] Compile assembly files as ASM, not C
Since CMake 3.20, CMake explicitly passes "-x c" (or equivalent)
when compiling a file which has been set as having the language
C. This behaviour change only takes place if "cmake_minimum_required"
is set to 3.20 or newer, or if the policy CMP0119 is set to new.
Attempting to compile assembly files with "-x c" fails, however
this is workarounded in many cases, as OpenMP overrides this with
"-x assembler-with-cpp", however this is only added for non-Windows
targets.
Thus, after increasing cmake_minimum_required to 3.20, this breaks
compiling the GNU assembly for Windows targets; the GNU assembly is
used for ARM and AArch64 Windows targets when building with Clang.
This patch unbreaks that.
D150688 [cmake] Set CMP0091 to fix Windows builds after the cmake_minimum_required bump
The build uses other mechanism to select the runtime.
Fixes #62719
Reviewed By: #libc, Mordante
Differential Revision: https://reviews.llvm.org/D151344
Benjamin Kramer [Sat, 27 May 2023 10:04:36 +0000 (12:04 +0200)]
M. Zeeshan Siddiqui [Sat, 27 May 2023 08:43:35 +0000 (16:43 +0800)]
[Docs] Fix Sphinx documentation formatting issues in LanguageExtensions.rst
Fix indentation and spacing.
Reviewed By: pengfei
Differential Revision: https://reviews.llvm.org/D151610
Anubhab Ghosh [Mon, 6 Mar 2023 11:20:02 +0000 (16:50 +0530)]
[clang-repl][CUDA] Re-land: Initial interactive CUDA support for clang-repl
CUDA support can be enabled in clang-repl with --cuda flag.
Device code linking is not yet supported. inline must be used with all
__device__ functions.
Differential Revision: https://reviews.llvm.org/D146389
Haojian Wu [Sat, 27 May 2023 06:37:45 +0000 (08:37 +0200)]
[mlir][bazel] Port for
660f714e26999d266232a1fbb02712bb879bd34e, second
attempt.
Haojian Wu [Sat, 27 May 2023 06:03:02 +0000 (08:03 +0200)]
M. Zeeshan Siddiqui [Sat, 27 May 2023 03:45:12 +0000 (11:45 +0800)]
[Clang][BFloat16] Upgrade __bf16 to arithmetic type, change mangling, and extend excess precision support
Pursuant to discussions at
https://discourse.llvm.org/t/rfc-c-23-p1467r9-extended-floating-point-types-and-standard-names/70033/22,
this commit enhances the handling of the __bf16 type in Clang.
- Firstly, it upgrades __bf16 from a storage-only type to an arithmetic
type.
- Secondly, it changes the mangling of __bf16 to DF16b on all
architectures except ARM. This change has been made in
accordance with the finalization of the mangling for the
std::bfloat16_t type, as discussed at
https://github.com/itanium-cxx-abi/cxx-abi/pull/147.
- Finally, this commit extends the existing excess precision support to
the __bf16 type. This applies to hardware architectures that do not
natively support bfloat16 arithmetic.
Appropriate tests have been added to verify the effects of these
changes and ensure no regressions in other areas of the compiler.
Reviewed By: rjmccall, pengfei, zahiraam
Differential Revision: https://reviews.llvm.org/D150913
Sergei Barannikov [Sat, 27 May 2023 04:34:48 +0000 (07:34 +0300)]
[CodeGen] Remove unused MachineMemOperand::Profile (NFC)
The last use was removed by
commit
48b185d6f718f0408a54bc7be8387beb3237cff3
Author: Dan Gohman <gohman@apple.com>
Date: Fri Sep 25 20:36:54 2009 +0000
Kazu Hirata [Sat, 27 May 2023 03:19:23 +0000 (20:19 -0700)]
[Sema] Remove unused declaration startLambdaDefinition
The corresponding function definition was removed by:
commit
93d7002dc4644b0a6f15a998dff0d55c72012e87
Author: Corentin Jabot <corentinjabot@gmail.com>
Date: Sun Feb 6 22:58:43 2022 +0100
Kazu Hirata [Sat, 27 May 2023 03:19:22 +0000 (20:19 -0700)]
[clangd] Remove unused declaration onCallHierarchyOutgoingCalls
The corresponding function definition was removed by:
commit
1a929525e86a20d0b3455a400d0dbed40b325a13
Author: Kadir Cetinkaya <kadircet@google.com>
Date: Tue Dec 21 17:06:40 2021 +0100
Kazu Hirata [Sat, 27 May 2023 03:07:52 +0000 (20:07 -0700)]
[CodeGen] Remove unused declarations emitNonSPMDParallelCall and emitSPMDParallelCall
The corresponding function definitions were removed by:
commit
a2dbfb6b72db19ed851464160ef7539b50d43894
Author: Giorgis Georgakoudis <georgakoudis1@llnl.gov>
Date: Wed Apr 21 11:41:31 2021 -0700
Kazu Hirata [Sat, 27 May 2023 03:07:51 +0000 (20:07 -0700)]
[AST] Remove unused declaration enumerateVFPtrs
The corresponding function definition was removed by:
commit
9c6e9e313d61284f3d7fa46c86b6f999c8a1adea
Author: Reid Kleckner <reid@kleckner.net>
Date: Thu Feb 27 19:40:09 2014 +0000
Kazu Hirata [Sat, 27 May 2023 03:07:49 +0000 (20:07 -0700)]
[Sema] Remove unused declaration ConvertIntegerToTypeWarnOnOverflow
The corresponding function definition was removed by:
commit
077d083b4dd12538fc824d5784d455da0d86a1ea
Author: Richard Smith <richard-llvm@metafoo.co.uk>
Date: Mon Aug 4 00:40:48 2014 +0000
Fangrui Song [Sat, 27 May 2023 02:39:19 +0000 (19:39 -0700)]
[Driver] Remove redundant -z special case. NFC
Enna1 [Sat, 27 May 2023 02:35:18 +0000 (10:35 +0800)]
[hwasan] support hwasan-match-all-tag flag for hwasan meminstrinsic calls
This patch implements `__hwasan_memset_match_all`, `__hwasan_memcpy_match_all` and `__hwasan_memmove_match_all`, making hwasan-match-all-tag flag working for hwasan versions of memset, memcpy and memmove.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D149943
Enna1 [Sat, 27 May 2023 02:27:28 +0000 (10:27 +0800)]
[hwasan] support hwasan-match-all-tag flag for callback memory access instrumentation
Currently, hwasan-match-all-tag flag is supported in inline memory access instrumentation and outline memory access instrumentation, but not supported in callback memory access instrumentation.
- For inline memory access instrumentation: a hwasan-match-all-tag check is added following the tag-mismtach check, if tag from pointer is mismatched with tag from shadow memory and tag from pointer is not equal with hwasan-match-all-tag, then a tag-mismatch will be report.
- For outline memory acess instrumentation: MatchAllTag is encoded in AccessInfo, when emit HWASAN memaccess symbols, asm-printer emits assembly instructions to check if tag from pointer is equal with hwasan-match-all-tag.
- For callback memory access instrumentation: hwasan-match-all-tag check is not implemented in `__hwasan_load`/`__hwasan_store`.
This patch implements a set of callback functions: `__hwasan_[load|store][1|2|4|8|16|n]_match_all` and `__hwasan_load[load|store][1|2|4|8|16|n]_match_all_noabort`, making hwasan-match-all-tag flag working for callback memory access instrumentation.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D149580
Fangrui Song [Sat, 27 May 2023 02:01:39 +0000 (19:01 -0700)]
[Driver][test] Replace legacy -target with --target=
Jie Fu [Sat, 27 May 2023 01:53:10 +0000 (09:53 +0800)]
[mlir] Fix non-const lvalue reference to type 'uint64_t' cannot bind to type 'size_t' error (NFC)
/Users/jiefu/llvm-project/mlir/lib/Bytecode/Reader/BytecodeReader.cpp:1007:39: error: non-const lvalue reference to type 'uint64_t' (aka 'unsigned long long') cannot bind to a value of unrelated type 'size_t' (aka 'unsigned long')
if (failed(propReader.parseVarInt(count)))
^~~~~
/Users/jiefu/llvm-project/mlir/lib/Bytecode/Reader/BytecodeReader.cpp:191:39: note: passing argument to parameter 'result' here
LogicalResult parseVarInt(uint64_t &result) {
^
/Users/jiefu/llvm-project/mlir/lib/Bytecode/Reader/BytecodeReader.cpp:1020:44: error: non-const lvalue reference to type 'uint64_t' (aka 'unsigned long long') cannot bind to a value of unrelated type 'size_t' (aka 'unsigned long')
if (failed(offsetsReader.parseVarInt(dataSize)) ||
^~~~~~~~
/Users/jiefu/llvm-project/mlir/lib/Bytecode/Reader/BytecodeReader.cpp:191:39: note: passing argument to parameter 'result' here
LogicalResult parseVarInt(uint64_t &result) {
^
2 errors generated.
Shengchen Kan [Fri, 26 May 2023 06:26:06 +0000 (14:26 +0800)]
[CodeGen][NFC] Declare copy constructor & copy assignment as deleted for ScheduleDAG
ScheduleDAG has derived classes ScheduleDAGVLIW and ScheduleDAGRRList,
which own resources that are freed in their destructors. Static analyzer
warns b/c they do not have user-written copy constructors.
According to the design of ScheduleDAG, it seems that it should always
be passed by reference. So I declare them as deleted in this patch.
Reviewed By: RKSimon
Differential Revision: https://reviews.llvm.org/D151538
Mehdi Amini [Fri, 26 May 2023 04:04:35 +0000 (21:04 -0700)]
[MLIR] Add native Bytecode support for properties
This is adding a new interface (`BytecodeOpInterface`) to allow operations to
opt-in skipping conversion to attribute and serializing properties to native
bytecode.
The scheme relies on a new section where properties are stored in sequence
{ size, serialize_properties }, ...
The operations are storing the index of a properties, a table of offset is
built when loading the properties section the first time.
This is a re-commit of
837d1ce0dc which conflicted with another patch upgrading
the bytecode and the collision wasn't properly resolved before.
Differential Revision: https://reviews.llvm.org/D151065
Teresa Johnson [Fri, 26 May 2023 22:07:24 +0000 (15:07 -0700)]
[MemProf] Clean up MemProf instrumentation pass invocation
First, removes the invocation of the memprof instrumentation passes from
the end of the module simplification pass builder, where it doesn't
really belong. However, it turns out that this was never being invoked,
as it is guarded by an internal option not used anywhere (even tests).
These passes are actually added via clang under the -fmemory-profile
option. Changed this to add via the EP callback interface, similar to
the sanitizer passes. They are added to the EP for the end of the
optimization pipeline, which is roughly where they were being added
already (end of the pre-LTO link pipelines and non-LTO optimization
pipeline).
Ideally we should plumb the output file through to LLVM and set it up
there, so I have added a TODO.
Differential Revision: https://reviews.llvm.org/D151593
Kazu Hirata [Sat, 27 May 2023 00:27:25 +0000 (17:27 -0700)]
[Vectorize] Fix warnings
This patch fixes:
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:140:20: error:
unused function 'operator<<' [-Werror,-Wunused-function]
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:176:6: error:
unused function 'dumpChain' [-Werror,-Wunused-function]
Kazu Hirata [Sat, 27 May 2023 00:02:34 +0000 (17:02 -0700)]
[Vectorize] Fix a warning
This patch fixes:
llvm/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp:1429:23:
error: comparison of integers of different signs: 'int' and 'const
size_t' (aka 'const unsigned long') [-Werror,-Wsign-compare]
Jakub Kuderski [Fri, 26 May 2023 23:54:44 +0000 (19:54 -0400)]
[mlir][spirv][NFC] Clean up SPIR-V canonicalization
Follow best practices. Use llvm helper functions for readability.
Reviewed By: antiagainst
Differential Revision: https://reviews.llvm.org/D151600
Craig Topper [Fri, 26 May 2023 23:44:20 +0000 (16:44 -0700)]
[RISCV] Add isel patterns to form tail undisturbed vfwadd.wv from fpextend_vl+vfwadd_vl+vp_merge.
We use a special TIED instructions for vfwadd.wv to avoid an
earlyclobber constraint preventing the first source and the destination
from being the same register.
This prevents our normal post process for forming TU instructions.
Add manual isel pattern instead. This matches what we do for FMA
for example.
Jennifer Yu [Fri, 26 May 2023 23:14:03 +0000 (16:14 -0700)]
skip test run on amdgcn-amd-amdhsa
Nishant Patel [Fri, 26 May 2023 23:20:53 +0000 (19:20 -0400)]
[mlir][spirv] Enhance folding capability of spirv::CompositeExtractOp::fold
This PR improves the `spirv::CompositeExtractOp::fold` function by adding a backtracking mechanism.
The updated function can now traverse a chain of `CompositeInsertOp`s to find a match.
Patch By: nbpatel
Reviewed By: kuhar
Differential Revision: https://reviews.llvm.org/D151536
Justin Lebar [Fri, 26 May 2023 23:22:16 +0000 (16:22 -0700)]
Fix -Wsign-compare from D149893.
Jennifer Yu [Fri, 26 May 2023 17:48:51 +0000 (10:48 -0700)]
Fix runtime crash inside __kmpc_init_allocator
It seems load of traits.addr should be passed in runtime call. Currently
the load of load traits.addr gets passed cause runtime to fail.
To fix this, skip the call to EmitLoadOfScalar for extra load.
Differential Revision: https://reviews.llvm.org/D151576
Jonas Devlieghere [Fri, 26 May 2023 22:42:42 +0000 (15:42 -0700)]
[Dexter] XFAIL Dexter tests for Apple Silicon (arm64)
Jason Molenda [Fri, 26 May 2023 22:31:41 +0000 (15:31 -0700)]
Revert "[lldb] Disable variable watchpoints when going out of scope"
Reverting https://reviews.llvm.org/D151366 until Ismail has a chance
to look at the ubuntu CI test failures and can reland.
This reverts commit
7c847ac4bd1bd8a89c7fbb4581328fa8cb0498f1.
Justin Lebar [Fri, 26 May 2023 22:30:10 +0000 (15:30 -0700)]
Fix test failure after
2be0abb7fe7 (caused by bad merge, sorry).
Jan Svoboda [Fri, 26 May 2023 20:14:16 +0000 (13:14 -0700)]
[clang][modules] NFCI: Use `DirectoryEntryRef` for umbrella directory
This removes some deprecated uses of `DirectoryEntry::getName()`.
Depends on D151581.
Differential Revision: https://reviews.llvm.org/D151584
Fangrui Song [Fri, 26 May 2023 22:30:23 +0000 (15:30 -0700)]
[Driver] Reject AIX-specific link options on non-AIX targets
Follow-up to D106688 and D146431.
-b leads to a -Wunused-command-line-argument warning instead of an error
without linking phase.
-mxcoff-build-id= leads to a -Wunused-command-line-argument warning instead of
an error.
Justin Lebar [Thu, 4 May 2023 19:34:43 +0000 (12:34 -0700)]
Rewrite load-store-vectorizer.
The motivation for this change is a workload generated by the XLA compiler
targeting nvidia GPUs.
This kernel has a few hundred i8 loads and stores. Merging is critical for
performance.
The current LSV doesn't merge these well because it only considers instructions
within a block of 64 loads+stores. This limit is necessary to contain the
O(n^2) behavior of the pass. I'm hesitant to increase the limit, because this
pass is already one of the slowest parts of compiling an XLA program.
So we rewrite basically the whole thing to use a new algorithm. Before, we
compared every load/store to every other to see if they're consecutive. The
insight (from tra@) is that this is redundant. If we know the offset from PtrA
to PtrB, then we don't need to compare PtrC to both of them in order to tell
whether C may be adjacent to A or B.
So that's what we do. When scanning a basic block, we maintain a list of
chains, where we know the offset from every element in the chain to the first
element in the chain. Each instruction gets compared only to the leaders of
all the chains.
In the worst case, this is still O(n^2), because all chains might be of length
1. To prevent compile time blowup, we only consider the 64 most recently used
chains. Thus we do no more comparisons than before, but we have the potential
to make much longer chains.
This rewrite affects many tests. The changes to tests fall into two
categories.
1. The old code had what appears to be a bug when deciding whether a misaligned
vectorized load is fast. Suppose TTI reports that load <i32 x 4> align 4
has relative speed 1, and suppose that load i32 align 4 has relative speed
32.
The intent of the code seems to be that we prefer the scalar load, because
it's faster. But the old code would choose the vectorized load.
accessIsMisaligned would set RelativeSpeed to 0 for the scalar load (and not
even call into TTI to get the relative speed), because the scalar load is
aligned.
After this patch, we will prefer the scalar load if it's faster.
2. This patch changes the logic for how we vectorize. Usually this results in
vectorizing more.
Explanation of changes to tests:
- AMDGPU/adjust-alloca-alignment.ll: #1
- AMDGPU/flat_atomic.ll: #2, we vectorize more.
- AMDGPU/int_sideeffect.ll: #2, there are two possible locations for the call to @foo, and the pass is brittle to this. Before, we'd vectorize in case 1 and not case 2. Now we vectorize in case 2 and not case 1. So we just move the call.
- AMDGPU/adjust-alloca-alignment.ll: #2, we vectorize more
- AMDGPU/insertion-point.ll: #2 we vectorize more
- AMDGPU/merge-stores-private.ll: #1 (undoes changes from git rev
86f9117d476, which appear to have hit the bug from #1)
- AMDGPU/multiple_tails.ll: #1
- AMDGPU/vect-ptr-ptr-size-mismatch.ll: Fix alignment (I think related to #1 above).
- AMDGPU CodeGen: I have difficulty commenting on these changes, but many of them look like #2, we vectorize more.
- NVPTX/4x2xhalf.ll: Fix alignment (I think related to #1 above).
- NVPTX/vectorize_i8.ll: We don't generate <3 x i8> vectors on NVPTX because they're not legal (and eventually get split)
- X86/correct-order.ll: #2, we vectorize more, probably because of changes to the chain-splitting logic.
- X86/subchain-interleaved.ll: #2, we vectorize more
- X86/vector-scalar.ll: #2, we can now vectorize scalar float + <1 x float>
- X86/vectorize-i8-nested-add-inseltpoison.ll: Deleted the nuw test because it was nonsensical. It was doing `add nuw %v0, -1`, but this is equivalent to `add nuw %v0, 0xffff'ffff`, which is equivalent to asserting that %v0 == 0.
- X86/vectorize-i8-nested-add.ll: Same as nested-add-inseltpoison.ll
Differential Revision: https://reviews.llvm.org/D149893
Jan Svoboda [Fri, 26 May 2023 19:24:06 +0000 (12:24 -0700)]
[clang][modules] NFCI: Distinguish as-written and effective umbrella directories
For modules with umbrellas, we track how they were written in the module map. Unfortunately, the getter for the umbrella directory conflates the "as written" directory and the "effective" directory (either the written one or the parent of the written umbrella header).
This patch makes the distinction between "as written" and "effective" umbrella directories clearer. No functional change intended.
Reviewed By: benlangmuir
Differential Revision: https://reviews.llvm.org/D151581
Jonas Devlieghere [Fri, 26 May 2023 22:06:11 +0000 (15:06 -0700)]
[Dexter] Don't hardcode x86_64 as the default architecture
Use platform.machine() as the default architecture instead of hardcoding
it to x86_64.
Andrés Villegas [Fri, 26 May 2023 21:32:28 +0000 (14:32 -0700)]
[llvm-debuginfod][NFC] Switch to OptTable
Reviewed By: mysterymath
Differential Revision: https://reviews.llvm.org/D151273
Florian Mayer [Wed, 24 May 2023 23:30:31 +0000 (16:30 -0700)]
[HWASan] use hwasan linker for Android 14+
This will allow to compile binaries that use hwasan to run on a
non-HWASan system image.
Reviewed By: pcc
Differential Revision: https://reviews.llvm.org/D151388
NagaChaitanya Vellanki [Fri, 26 May 2023 20:57:17 +0000 (13:57 -0700)]
[clang-tidy] Check for specific return types on all functions
Extend the check to all functions with return types like
std::error_code, std::expected, boost::system::error_code, abseil::Status...
Resolves issue https://github.com/llvm/llvm-project/issues/62884
Reviewed By: PiotrZSL
Differential Revision: https://reviews.llvm.org/D151383
Kazu Hirata [Fri, 26 May 2023 20:58:20 +0000 (13:58 -0700)]
[mlir] Use std::optional instead of llvm::Optional (NFC)
This is part of an effort to migrate from llvm::Optional to std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
Adrian Prantl [Fri, 26 May 2023 20:51:30 +0000 (13:51 -0700)]
Revert "Factor out xcrun into a function (NFC)"
This reverts commit
97ca34996dbe5a61e79d7c559af7b15dc39c08a5.
Adrian Prantl [Fri, 26 May 2023 20:51:25 +0000 (13:51 -0700)]
Revert "Make function static (NFC)"
This reverts commit
cefd2802aa49274942da87edf5019b5a23315f01.
Jonas Devlieghere [Fri, 26 May 2023 20:10:51 +0000 (13:10 -0700)]
[lldb] Skip instead of XFAIL TestInteractiveScriptedProcess
The test is failing on x86_64 but passing on arm64. Skip until Ismail
can investigate this further.
Adrian Prantl [Fri, 26 May 2023 20:12:12 +0000 (13:12 -0700)]
Make function static (NFC)
Adrian Prantl [Fri, 26 May 2023 20:01:34 +0000 (13:01 -0700)]
Factor out xcrun into a function (NFC)
Hongtao Yu [Fri, 26 May 2023 05:41:58 +0000 (22:41 -0700)]
[PseudoProbe] Do not force the calliste debug loc to inlined probes from __nodebug__ functions.
For pseudo probes we would like to keep their original dwarf discriminator (either a zero or null) until the first FS-discriminator pass. The inliner is a violation of that, given that it assigns inlinee instructions with no debug info with the that of the callsite. This is being disabled in this patch.
Reviewed By: wenlei
Differential Revision: https://reviews.llvm.org/D151568
Florian Hahn [Fri, 26 May 2023 19:58:05 +0000 (20:58 +0100)]
[PhaseOrdering] Add test for loop over span with hardened libc++.
Add a slightly reduced test case for a loop iterating over a std::span
with libc++ hardening.
See https://godbolt.org/z/cKerYq9fY.
max [Fri, 26 May 2023 19:39:03 +0000 (14:39 -0500)]
[MLIR][python bindings] Fix inferReturnTypes + AttrSizedOperandSegments for optional operands
Right now `inferTypeOpInterface.inferReturnTypes` fails because there's a cast in there to `py::sequence` which throws a `TypeError` when it tries to cast the `None`s. Note `None`s are inserted into `operands` for omitted operands passed to the generated builder:
```
operands.append(_get_op_result_or_value(start) if start is not None else None)
operands.append(_get_op_result_or_value(stop) if stop is not None else None)
operands.append(_get_op_result_or_value(step) if step is not None else None)
```
Note also that skipping appending to the list operands doesn't work either because [[ https://github.com/llvm/llvm-project/blob/
27c37327da67020f938aabf0f6405f57d688441e/mlir/lib/Bindings/Python/IRCore.cpp#L1585 | build generic ]] checks against the number of operand segments expected.
Currently the only way around is to handroll through `ir.Operation.create`.
Reviewed By: rkayaith
Differential Revision: https://reviews.llvm.org/D151409
Louis Dionne [Thu, 25 May 2023 16:46:21 +0000 (09:46 -0700)]
[libc++][NFC] Add additional test case for modules issue in Objective-C++
Differential Revision: https://reviews.llvm.org/D151467
Alexey Bataev [Fri, 26 May 2023 17:35:25 +0000 (10:35 -0700)]
[SLP]Fix getSpillCost functions.
There are several issues in the current implementation. The instructions
are not properly ordered, if they are placed in different basic blocks,
need to reverse the order of blocks. Also, need to exclude
non-vectorizable nodes and check for CallBase, not CallInst, otherwise
invoke calls are not handled correctly.
Craig Topper [Fri, 26 May 2023 19:16:19 +0000 (12:16 -0700)]
[RISCV] Simplify code in LowerIS_FPCLASS. NFC
Craig Topper [Fri, 26 May 2023 19:01:14 +0000 (12:01 -0700)]
[RISCV] Remove extra MVT::Other result from creation of RISCVISD::FCLASS_VL.
electriclilies [Fri, 26 May 2023 18:53:17 +0000 (11:53 -0700)]
Add fastmath attributes to llvm.call_intrinsic
Reviewed By: Mogball
Differential Revision: https://reviews.llvm.org/D151492
Craig Topper [Fri, 26 May 2023 18:49:55 +0000 (11:49 -0700)]
[RISCV] Tighten type constraint for RISCVISD::FCLASS_VL.
Daniel Thornburgh [Tue, 23 May 2023 18:48:28 +0000 (11:48 -0700)]
[lldb] Pass CMAKE_SYSROOT through to LLDB shell tests
This allows the LLDB Shell tests to succeed in (e.g. CI) environments where
system libraries are provided hermetically as a sysroot.
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D151269
Alexey Bataev [Fri, 26 May 2023 17:59:40 +0000 (10:59 -0700)]
[SLP][NFC]Add a test for spill cost, NFC.
Aart Bik [Fri, 26 May 2023 17:50:55 +0000 (10:50 -0700)]
[mlir][sparse][gpu] fix merge conflict
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D151574
Alex Langford [Wed, 24 May 2023 22:01:22 +0000 (15:01 -0700)]
[lldb][NFCI] Include <cstdio> in SBDefines for FILE * definition
There are a few API headers that use FILE * but do not include the
correct header for their definition. Instead of including <cstdio> in each
of the headers manually, it seems easiest to include it in SBDefines to
get them all at once.
rdar://
109579348
Differential Revision: https://reviews.llvm.org/D151381
Nikolas Klauser [Fri, 26 May 2023 14:45:08 +0000 (07:45 -0700)]
[libc++][PSTL] Add a test to make sure that customization points work properly
Reviewed By: #libc, ldionne
Spies: ldionne, libcxx-commits
Differential Revision: https://reviews.llvm.org/D151257
Craig Topper [Fri, 26 May 2023 17:48:49 +0000 (10:48 -0700)]
SelectionDAG: Teach ComputeKnownBits about VSCALE
This reverts commit
9b92f70d4758f75903ce93feaba5098130820d40. The issue
with the re-applied change was an implicit truncation due to the
multiplication. Although the operations were converted to `APInt`, the
values were implicitly converted to `long` due to the typing rules.
Fixes: #59594
Differential Revision: https://reviews.llvm.org/D140347
Piotr Zegar [Fri, 26 May 2023 16:03:39 +0000 (16:03 +0000)]
[clang-tidy] Optimize misc-confusable-identifiers
Main performance issue in this check were caused by many
calls to getPrimaryContext and constant walk up to declaration
contexts using getParent. Also there were issue with forallBases
that is slow.
Profiled with perf and tested on open-source project Cataclysm-DDA.
Before changes check took 27320 seconds, after changes 3682 seconds.
That's 86.5% reduction. More optimizations are still possible in this
check.
Reviewed By: serge-sans-paille
Differential Revision: https://reviews.llvm.org/D151051
Louis Dionne [Thu, 18 May 2023 21:11:01 +0000 (14:11 -0700)]
[libc++][ci] Install ccache in the Docker image
This will allow using ccache in the jobs that build Clang, which
should speed up those jobs.
Differential Revision: https://reviews.llvm.org/D150907
Jennifer Yu [Thu, 25 May 2023 16:29:59 +0000 (09:29 -0700)]
Fix wrong error message when compiling C souce code:
Currently emit error for uses_allocators(alloc(traits)):
called object type 'omp_allocator_handle_t' (aka
'enum omp_allocator_handle_t') is not a function or function pointer
To fix this, since "alloc" is Id expresison(spce 5.2), during the parser
(in ParseOpenMP.cpp), using tryParseCXXIdExpression instead of
ParseExpression for C.
Differential Revision: https://reviews.llvm.org/D151517
Kun Wu [Fri, 26 May 2023 02:29:49 +0000 (02:29 +0000)]
[mlir] [sparse] [gpu] adding transpose support to spmm spmv
Reviewed By: aartbik, wrengr
Differential Revision: https://reviews.llvm.org/D151259
Fangrui Song [Fri, 26 May 2023 16:52:57 +0000 (09:52 -0700)]
[Driver][X86] Reject unsupported value for -mabi=
-mabi= was incorrectly claimed before D134671. -mabi=sysv appears to be
somewhat common in open-source packages, even if it was not intended to
be supported by Clang.
(For common options supported by multiple architectures, it's easy to
forget to report an error on unsupported targets. Unfortunately
the driver infrastructure doesn't make this less error-prone.)
On x86, support -mabi=sysv for non-Windows targets and -mabi=ms for Windows,
and remove the spurious -Wunused-command-line-argument warning.
With this change, all popular architectures claim -mabi=, so we don't
have to worry much about -Wunused-command-line-argument for other
architectures.
Differential Revision: https://reviews.llvm.org/D151509
Thurston Dang [Thu, 25 May 2023 20:37:11 +0000 (20:37 +0000)]
hwasan: enable mmap interception (no tagging used)
This enables HWASan interception for mmap, to prevent users from allocating in the shadow memory regions. For compatibility, it does not use pointer tagging, nor does it allow MAP_FIXED with a tagged address.
This patch initializes the common interceptors, but that should be a no-op (except for the mmap interceptor), due to the disable-by-default nature of hwasan_platform_interceptors.h (from D150708). As the first patch to utilize this common interceptor machinery for HWASan, it also defines some macros (e.g., COMMON_INTERCEPT_FUNCTION) that will be useful as future interceptors are enabled.
TestCases/Posix/mmap_write_exec.cpp now passes for HWASan.
Reviewed By: kstoimenov, vitalybuka
Differential Revision: D151262
Jonas Devlieghere [Fri, 26 May 2023 16:26:29 +0000 (09:26 -0700)]
[lldb] Remove reproducer test suite (NFC)
The reproducer feature as well as the ability to capture or replay tests
with reproducers was removed. This removes the corresponding CMake
target.
V Donaldson [Thu, 25 May 2023 17:05:26 +0000 (10:05 -0700)]
[flang] Retain the sign of the argument for the result of fraction(0)
The f18 clause 16.9.80 description of the FRACTION(X) intrinsic states:
Result Value. The result has the value ....
If X has the value zero, the result is zero.
If X is an IEEE NaN, the result is that NaN.
If X is an IEEE infinity, the result is an IEEE NaN.
This clause does not specify whether fraction(-0.0) should be -0.0 or +0.0.
However, a folded result and a runtime result should be consistent, and
returning -0.0 is more in line with the result for fraction(NaN).
For this test:
print '(2f6.1)', 0.0, fraction(0.0)
call f(0.0)
print '(2f6.1)', -0.0, fraction(-0.0)
call f(-0.0)
end
subroutine f(x)
print '(2f6.1)', x, fraction(x)
end
Current output is:
0.0 0.0
0.0 0.0
-0.0 -0.0
-0.0 0.0
Change that to:
0.0 0.0
0.0 0.0
-0.0 -0.0
-0.0 -0.0
Craig Topper [Fri, 26 May 2023 16:01:28 +0000 (09:01 -0700)]
[VP][SelectionDAG][RISCV] Add get_vector_length intrinsics and generic SelectionDAG support.
The generic implementation is umin(TC, VF * vscale).
Lowering to vsetvli for RISC-V will come in a future patch.
This patch is a pre-requisite to be able to CodeGen vectorized code from
D99750.
Reviewed By: reames, frasercrmck
Differential Revision: https://reviews.llvm.org/D149916