Kazu Hirata [Thu, 29 Sep 2022 16:00:38 +0000 (09:00 -0700)]
[ModuleInliner] Add a cost-benefit-based priority
This patch teaches the module inliner a traversal order designed for
the instrumentation FDO (+ThinLTO) scenario.
The new traversal order prioritizes call sites in the following order:
1. Those call sites that are expected to reduce the caller size
2. Those call sites that have gone through the cost-benefit analaysis
3. The remaining call sites
With this fairly simple traversal order, a large internel benchmark
yields performance comparable to the bottom-up inliner -- both in
terms of the execution performance and .text* sizes.
Big thanks goes to Liqiang Tao for the module inliner infrastructure.
I still have hacks outside this patch to prevent excessively long
compilation or .text* size explosion. I'm trying to come up with
acceptable solutions in near future.
Differential Revision: https://reviews.llvm.org/D134376
Arthur Eubanks [Wed, 28 Sep 2022 22:57:19 +0000 (15:57 -0700)]
[lld][COFF][LTO] Don't disable verifier in assert builds
We should catch more issues this way.
This previously the behavior and was dropped in
cde5e5b600b06.
Reviewed By: hans
Differential Revision: https://reviews.llvm.org/D134839
Jakub Kuderski [Thu, 29 Sep 2022 15:55:17 +0000 (11:55 -0400)]
[flang][mlir][arith] Fix flang build after dialect renaming
Tested with `ninja check-flang`
Mark de Wever [Wed, 28 Sep 2022 17:58:05 +0000 (19:58 +0200)]
[NFC][libc++][test] Enables variant test.
Noticed this while working on D133326. Let's see whehter all compilers
now support this feature.
Reviewed By: #libc, philnik, ldionne
Differential Revision: https://reviews.llvm.org/D134818
Jakub Kuderski [Thu, 29 Sep 2022 15:14:47 +0000 (11:14 -0400)]
[mlir][arith] Change dialect name from Arithmetic to Arith
Suggested by @lattner in https://discourse.llvm.org/t/rfc-define-precise-arith-semantics/65507/22.
Tested with:
`ninja check-mlir check-mlir-integration check-mlir-mlir-spirv-cpu-runner check-mlir-mlir-vulkan-runner check-mlir-examples`
and `bazel build --config=generic_clang @llvm-project//mlir:all`.
Reviewed By: lattner, Mogball, rriddle, jpienaar, mehdi_amini
Differential Revision: https://reviews.llvm.org/D134762
luxufan [Sun, 25 Sep 2022 14:56:19 +0000 (14:56 +0000)]
[DSE][NFC] Update noop-stores.ll using update_test_checks.py
Differential Revision: https://reviews.llvm.org/D134630
Nikita Popov [Thu, 29 Sep 2022 13:51:05 +0000 (15:51 +0200)]
[ValueTracking] Fix CannotBeOrderedLessThanZero() for fdiv (PR58046)
When checking the RHS of fdiv, we should set the SignBitOnly flag,
because a negative zero can become -Inf, which is ordered less
than zero.
Fixes https://github.com/llvm/llvm-project/issues/58046.
Differential Revision: https://reviews.llvm.org/D134876
Nikola Tesic [Wed, 28 Sep 2022 10:34:32 +0000 (12:34 +0200)]
[Debugify][OriginalDIMode] Update script to handle large JSON reports
This patch updates llvm/utils/llvm-original-di-preservation.py to create more
compact HTML verify-debuginfo-preserve reports by:
- removing duplicated debug info bugs,
- introducing -compress option to create highly compressed report.
Additionally, this patch makes script able to process very large JSON inputs.
That is done by reading & analyzing JSON report in chunks.
Differential Revision: https://reviews.llvm.org/D115617
Nikola Tesic [Wed, 28 Sep 2022 10:32:46 +0000 (12:32 +0200)]
[Debugify][OriginalDIMode] Make HTML reporting infrastructure more resilient
Debugify in OriginalDebugInfo mode (verify-each-debuginfo-preserve), when used
in parallel builds of large projects, can produce incorrect report. More
precisely, simultaneous writes to JSON report file, could form incorrect JSON
objects, which describe found Debug Info bugs.
This patch uses the lock/unlock mechanism to protect JSON report file and also
makes script llvm/utils/llvm-original-di-preservation.py resilient to corrupted
lines in the report file. So, it ensures the creation of HTML report.
Differential Revision: https://reviews.llvm.org/D115616
Philip Reames [Thu, 29 Sep 2022 14:31:03 +0000 (07:31 -0700)]
[RISCV] Adjust vector immediate store materialization cost
This change updates the costs to make constant pool loads match their actual cost, and adds the broadcast special case to avoid too many regressions. We really need more information about the constants being rematerialized, but this is an incremental improvement.
Differential Revision: https://reviews.llvm.org/D134746
Louis Dionne [Thu, 29 Sep 2022 14:34:52 +0000 (10:34 -0400)]
[libc++] Add missing return 0;'s to main() functions in tests
Adrian Kuegel [Wed, 28 Sep 2022 11:49:13 +0000 (13:49 +0200)]
[mlir][Linalg] Add ReduceOp to Linalg structured ops.
This will allow to model (variadic) reductions with this special op instead of
using GenericOp.
RFC: https://discourse.llvm.org/t/rfc-primitive-ops-add-mapop-reductionop-transposeop-broadcastop-to-linalg/64184
Alex Zinenko [Thu, 29 Sep 2022 14:09:40 +0000 (14:09 +0000)]
[mlir] fix formatting in markdown
Guillaume Chatelet [Thu, 29 Sep 2022 13:51:20 +0000 (13:51 +0000)]
[libc][NFC] Move alignment utils to utils.h
eopXD [Thu, 29 Sep 2022 13:30:32 +0000 (06:30 -0700)]
[LSR][NFC] Add missing constness
Nikita Popov [Thu, 29 Sep 2022 13:21:57 +0000 (15:21 +0200)]
[InstSimplify] Add test for PR58046 (NFC)
eopXD [Wed, 28 Sep 2022 03:14:04 +0000 (20:14 -0700)]
[RISCV] Add lowering for llvm.roundeven
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D134785
Tim Northover [Mon, 26 Sep 2022 12:26:36 +0000 (13:26 +0100)]
Unwind-tables: move back to original logic outline for kind.
There are lots of options interacting in complex ways here, and when moving to
`getDefaultUnwindTableLevel` I had refactored this and changed behaviour in
some cases. So this reverts the basic structure of the logic back to the
original, while leaving the hook in the new style.
Alex Zinenko [Thu, 29 Sep 2022 09:50:24 +0000 (09:50 +0000)]
[mlir][GPU] treat the absence of workgroup attributes correctly
The helper function in GPUFuncOp incorrectly assumed the workgroup
attribution attribute is always present. Instead, treat its absence as
if its value was zero, i.e., no workgroup attributions are specified.
Closes #58045.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D134865
Serge Pavlov [Sun, 21 Aug 2022 17:30:28 +0000 (00:30 +0700)]
[Support] Class for response file expansion (NFC)
Functions that implement expansion of response and config files depend
on many options, which are passes as arguments. Extending the expansion
requires new options, it in turn causes changing calls in various places
making them even more bulky.
This change introduces a class ExpansionContext, which represents set of
options that control the expansion. Its methods implements expansion of
responce files including config files. It makes extending the expansion
easier.
No functional changes.
Differential Revision: https://reviews.llvm.org/D132379
Guillaume Chatelet [Thu, 29 Sep 2022 12:13:26 +0000 (12:13 +0000)]
[libc][test] Better reporting for MemoryMatcher
Nikita Popov [Fri, 23 Sep 2022 11:03:59 +0000 (13:03 +0200)]
Reapply [FunctionAttrs] Infer precise FMRB
The previous version of the patch would incorrect convert an
existing argmemonly attribute into an inaccessiblemem_or_argmemonly
attribute.
-----
This updates checkFunctionMemoryAccess() to infer a precise
FunctionModRefBehavior, rather than an approximation split into
read/write and argmemonly.
Afterwards, we still map this back to imprecise function attributes.
This still allows us to infer some cases that we previously did not
handle, namely inaccessiblememonly and inaccessiblemem_or_argmemonly.
In practice, this means we get better memory attributes in the
presence of intrinsics like @llvm.assume.
Differential Revision: https://reviews.llvm.org/D134527
Nikita Popov [Thu, 29 Sep 2022 11:55:36 +0000 (13:55 +0200)]
[FunctionAttrs] Add test for argmemonly function that already has attr (NFC)
Test for the issue reported in https://reviews.llvm.org/D134527#3821010.
Timm Bäder [Thu, 29 Sep 2022 11:40:57 +0000 (13:40 +0200)]
Revert "[clang][Interp] Handle enums"
This reverts commit
c090295916a921e809184f589c6830475e293b8b.
One of the test cases fails. Revert this until I know a way to make it
work reliably.
Muhammad Omair Javaid [Thu, 29 Sep 2022 11:32:49 +0000 (16:32 +0500)]
[LLVM][DebugInfo] Disable split-complex.ll for aarch64-pc-windows-msvc
This patch disables split-complex.ll for aarch64-pc-windows-msvc.
split-complex.ll fails with a crash when run on AArch64/Windows.
I have reported following issue: llvm-project/issues/58053
David Green [Thu, 29 Sep 2022 11:16:13 +0000 (12:16 +0100)]
[Clang][Arm] Fix fp16 return error tests under AArch64/Arm. NFC
The -fallow-half-arguments-and-returns option was removed in
59528e4bdb27ed4ab3, replaced with an always-on target option under
AArch64/Arm. There are two tests - fp16-sema.c and renderscripts.rs that
test that an error is produced for __fp16 function args/returns, which
are now expected to pass for Arm/AArch64. i.e they no longer give the
same error as before on native Arm/AArch64 machines. Alter the targets
of those tests to compensate.
Denys Shabalin [Thu, 29 Sep 2022 09:41:42 +0000 (09:41 +0000)]
[mlir] Add Python bindings for StridedLayoutAttr
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D134869
Adrian Kuegel [Thu, 29 Sep 2022 10:28:45 +0000 (12:28 +0200)]
[mlir][Linalg] Slightly adjust DestinationStyleOpInterface.
Rename some interface methods to be consistent with the new accessor names.
This is a preparation for adding a ReduceOp, which then will implement
getIteratorTypes() and getOutputs() instead of iterator_types() and outputs().
Differential Revision: https://reviews.llvm.org/D134868
Timm Bäder [Wed, 28 Sep 2022 11:20:37 +0000 (13:20 +0200)]
[clang][Interp][NFC] Remove unused prototypes
Timm Bäder [Wed, 28 Sep 2022 10:37:52 +0000 (12:37 +0200)]
[clang][Interp][NFC] Make EvalEmitter::isActive() const
Timm Bäder [Fri, 23 Sep 2022 10:40:44 +0000 (12:40 +0200)]
[clang][Interp][NFC] Unifty ReadArg() impl in Disasm.cpp
We can use another if constexpr here to make this shorter and easier to
understand.
Timm Bäder [Fri, 23 Sep 2022 09:48:58 +0000 (11:48 +0200)]
[clang][Interp] Print Function address in dump()
It's used in the bytecode dump of the function itself, so useful to
identify which function is being called.
Timm Bäder [Sat, 17 Sep 2022 14:03:39 +0000 (16:03 +0200)]
[clang][Interp][NFC] Remove unused opcode argument types
Timm Bäder [Sat, 17 Sep 2022 14:14:37 +0000 (16:14 +0200)]
[clang][Interp][NFC] Unify the two ReadArg() implementations
Just use a constexpr if here instead of two different implementations.
[#
Timm Bäder [Mon, 19 Sep 2022 07:09:16 +0000 (09:09 +0200)]
[clang][Interp][NFC] Remove unused function
Timm Bäder [Sat, 17 Sep 2022 06:11:36 +0000 (08:11 +0200)]
[clang][Interp] Specify Boolean conversion operartors as (u)int32
Follow up to https://reviews.llvm.org/D133934
Timm Bäder [Fri, 16 Sep 2022 16:59:00 +0000 (18:59 +0200)]
[clang][Interp] Properly destruct allocated Records
We are otherwise leaking some memory the records might allocate
themselves.
Differential Revision: https://reviews.llvm.org/D134054
Timm Bäder [Sat, 17 Sep 2022 13:14:32 +0000 (15:14 +0200)]
[clang][Interp][NFC] Make classes final that can be final
Timm Bäder [Fri, 16 Sep 2022 16:26:24 +0000 (18:26 +0200)]
[clang][Interp][NFC] Make some Record methods const
Timm Bäder [Fri, 16 Sep 2022 16:21:16 +0000 (18:21 +0200)]
[clang][Interp][NFC] Limit includes to neccessary ones
Timm Bäder [Fri, 16 Sep 2022 16:15:57 +0000 (18:15 +0200)]
[clang][Interp] Rename a local variable to be more specific
It's called BaseSize in the Record class as well, so call it BaseSize
when creating the Record.
Timm Bäder [Fri, 16 Sep 2022 07:17:52 +0000 (09:17 +0200)]
[clang][Interp] Handle enums
Handle DeclRefExprs of enum types. They are otherwise handled like
integers.
Differential Revision: https://reviews.llvm.org/D134020
Timm Bäder [Thu, 15 Sep 2022 14:08:28 +0000 (16:08 +0200)]
[clang][Interp] Record item types in InterpStack
The type information is lost when pushing things on the stack. When
later pop()ing items of the wrong type, we can instead simply get
garbage values and those problems are hard to find. Add another stack to
record the type of item we pushed and use that for debugging.
Differential Revision: https://reviews.llvm.org/D133941
Timm Bäder [Thu, 15 Sep 2022 13:36:51 +0000 (15:36 +0200)]
[clang][Interp][NFC] Make a few InterpStack functions const
Timm Bäder [Wed, 14 Sep 2022 14:53:55 +0000 (16:53 +0200)]
[clang][Interp] Handle sizeof()
Implement visiting UnaryExprOrTypeTraitExprs to handle sizeof()
expressions.
Differential Revision: https://reviews.llvm.org/D133934
Timm Bäder [Tue, 27 Sep 2022 05:29:09 +0000 (07:29 +0200)]
[clang][Interp][NFC] Unify emit() implementations
Instead of two overloads, use a if constexpr to differentiate between
pointer and non-pointer parameters
Timm Bäder [Wed, 14 Sep 2022 13:13:58 +0000 (15:13 +0200)]
[clang][Interp][NFC] Forward-declare Pointer in InterpFrame.h
We don't need the full include here.
Timm Bäder [Wed, 14 Sep 2022 13:12:42 +0000 (15:12 +0200)]
[clang][Interp][NFC] Remove an unnecessary <vector> include.
Timm Bäder [Wed, 14 Sep 2022 13:03:04 +0000 (15:03 +0200)]
[clang][Interp] Pass initializer when creating globals
This is dead code right now but will be used for implementing array
fillers, where we need some information from the initializer when
allocaing the Descriptors.
Differential Revision: https://reviews.llvm.org/D133856
Amir Ayupov [Wed, 28 Sep 2022 18:18:51 +0000 (20:18 +0200)]
[BOLT] Report BB reordering %-age vs profiled and total number of functions
Reviewed By: spupyrev
Differential Revision: https://reviews.llvm.org/D134819
Thomas Symalla [Thu, 29 Sep 2022 07:29:39 +0000 (09:29 +0200)]
[AMDGPU] Add use check in v_fma combine.
In D132837, an existing v_fma combine was extended to regard nested
fma instructions. Originally, the inner FMA was checked for being used
only once. In its current state, this check is missing, which causes
some regressions.
In this patch, this check was added.
Reviewed By: foad
Differential Revision: https://reviews.llvm.org/D134856
Florian Hahn [Thu, 29 Sep 2022 10:12:28 +0000 (11:12 +0100)]
[LV] Create createInductionResumeValue helper (NFC).
Factor out the logic to create induction resume values for a specific
induction. This will be used in D92132 to support widened IVs during
epilogue vectorization.
Reviewed By: Ayal
Differential Revision: https://reviews.llvm.org/D134211
David Green [Thu, 29 Sep 2022 10:00:32 +0000 (11:00 +0100)]
[Clang][Arm] Convert -fallow-half-arguments-and-returns to a target option. NFC
This cc1 option -fallow-half-arguments-and-returns allows __fp16 to be
passed by argument and returned, without giving an error. It is
currently always enabled for Arm and AArch64, by forcing the option in
the driver. This means any cc1 tests (especially those needing
arm_neon.h) need to specify the option too, to prevent the error from
being emitted.
This changes it to a target option instead, set to true for Arm and
AArch64. This allows the option to be removed. Previously it was implied
by -fnative_half_arguments_and_returns, which is set for certain
languages like open_cl, renderscript and hlsl, so that option now too
controls the errors. There were are few other non-arm uses of
-fallow-half-arguments-and-returns but I believe they were unnecessary.
The strictfp_builtins.c tests were converted from __fp16 to _Float16 to
avoid the issues.
Differential Revision: https://reviews.llvm.org/D133885
Denys Shabalin [Wed, 28 Sep 2022 13:40:31 +0000 (13:40 +0000)]
[mlir] Add C bindings for StridedArrayAttr
Reviewed By: ftynse
Differential Revision: https://reviews.llvm.org/D134808
Muhammad Omair Javaid [Thu, 29 Sep 2022 08:19:37 +0000 (13:19 +0500)]
[LLVM][MC] Disable cfi-version test for aarch64-pc-windows*
This patch disables MC/ELF/cfi-version.ll test as windows does not emit
.debug_frame needed by the test. This was previously disabled for arm64
but windows on arm uses aarch64-pc-windows* triple. Replacing arm64 with
aarch64 to accomodate windows aarch64 triple(s).
Reviewed By: DavidSpickett
Differential Revision: https://reviews.llvm.org/D134863
Nicolas Vasilache [Thu, 29 Sep 2022 09:29:31 +0000 (02:29 -0700)]
[mlir][memref]Add conversion support for memref.extract_aligned_pointer_as_index to LLVM
Reviewed By: pifon2a
Differential Revision: https://reviews.llvm.org/D134834
Stefan Gränitz [Thu, 29 Sep 2022 09:01:59 +0000 (11:01 +0200)]
[WinEH] Prepare test win64-funclet-preisel-intrinsics.ll for extension to nested try-catch case (NFC)
Nicolas Vasilache [Wed, 28 Sep 2022 22:29:55 +0000 (15:29 -0700)]
[mlir][memref]Add pattern to forward memref.extract_aligned_pointer_as_index(view_like_op) to its source
Differential Revision: https://reviews.llvm.org/D134835
Juan Manuel MARTINEZ CAAMAÑO [Mon, 26 Sep 2022 13:49:32 +0000 (13:49 +0000)]
[DebugInfo][InferAddressSpaces] Propagate DebugLoc when cloning an instruction in InferAddressSpaces
Differential Revision: https://reviews.llvm.org/D134428
Juan Manuel MARTINEZ CAAMAÑO [Tue, 27 Sep 2022 13:48:10 +0000 (13:48 +0000)]
[StructurizeCFG] Remove imposible case and replace by assert
In addition, replace outdated XFAIL test by a new one.
Differential Revision: https://reviews.llvm.org/D134439
Florian Hahn [Thu, 29 Sep 2022 08:24:38 +0000 (09:24 +0100)]
[SCEVExpander] Use CreateBitOrPointerCast instead of builder (NFC).
Simplify the code by using CastInst::CreateBitOrPointerCast directly. By
not going through the builder, the temporary instruction also won't get
registered in InsertedValues & co, which means less work overall and
simplifies the clean-up.
Michael Platings [Wed, 28 Sep 2022 19:30:29 +0000 (20:30 +0100)]
Fix frint ACLE intrinsic names
Although the instruction names begin "frint", the ACLE spec states that
the intrinsic names begin "__rint", without the "f".
Differential Revision: https://reviews.llvm.org/D134824
Nikita Popov [Thu, 29 Sep 2022 07:56:51 +0000 (09:56 +0200)]
Revert "[cmake] Export GetHostTriple.cmake"
This turned out to be insufficient by itself, because we would
also need to export config.guess.
This reverts commit
4ac4d6bc9f312e18416739d70c9beb727acd33fb.
Fangrui Song [Thu, 29 Sep 2022 07:54:55 +0000 (00:54 -0700)]
Revert D134638 "[Clang][LoongArch] Add inline asm support for constraints k/m/ZB/ZC"
This reverts commit
b7baddc7557e5c35a0f6a604a134d849265a99d4.
Broke CodeGen/X86/callbr-asm-kill.mir
We shall pay attention when adding new constraints.
Thomas Symalla [Thu, 29 Sep 2022 07:53:23 +0000 (09:53 +0200)]
[NFC][AMDGPU] Pre-commit FMA test.
Fangrui Song [Thu, 29 Sep 2022 07:50:19 +0000 (00:50 -0700)]
[ELF] Make symAux[0] a sentinel
And default auxIdx to 0.
Fangrui Song [Thu, 29 Sep 2022 07:38:12 +0000 (00:38 -0700)]
[Driver] Add --config= as canonical spelling of --config
Driver options usually use `Joined` instead of `Separate`. It is also weird that
`--config-system-dir=`/etc exist while `--config=` did not exist.
Reviewed By: mgorny
Differential Revision: https://reviews.llvm.org/D134790
Sam McCall [Thu, 29 Sep 2022 07:28:06 +0000 (09:28 +0200)]
[clangd] Avoid using constructor/destructor of vector<incomplete type>
This is formally invalid, and causes build errors when building with
clang in -std=c++20.
http://eel.is/c%2B%2Bdraft/vector.overview#4
Pierre van Houtryve [Wed, 28 Sep 2022 06:50:17 +0000 (06:50 +0000)]
[AMDGPU] Update `mad-mix*` CodeGen tests
- Use `fneg %a` instead of `fsub -0.0, %a`
- This is for D134354 as we don't currently support folding `fsub -0.0, %a` into `fneg` on GISel.
Also, `fneg` is the canonical way to do the negation.
- Switch to `update_llc_test_checks`-generated tests.
- Better test coverage
- Easier to update
- Easier to see changes in future diffs
- Remove unnecessary CL arguments in RUN lines
Motive for the patch: Preparation for D134354 - we would like to
put GISel tests in this file as well. Fixing the lack of `fneg` and
switching to generated testing makes it much easier.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D134793
Weining Lu [Thu, 29 Sep 2022 06:47:24 +0000 (14:47 +0800)]
[Clang][LoongArch] Add inline asm support for constraints k/m/ZB/ZC
k: A memory operand whose address is formed by a base register and
(optionally scaled) index register.
m: A memory operand whose address is formed by a base register and
offset that is suitable for use in instructions with the same
addressing mode as st.w and ld.w.
ZB: An address that is held in a general-purpose register. The offset
is zero.
ZC: A memory operand whose address is formed by a base register and
offset that is suitable for use in instructions with the same
addressing mode as ll.w and sc.w.
Differential Revision: https://reviews.llvm.org/D134638
Vitaly Buka [Thu, 29 Sep 2022 06:53:01 +0000 (23:53 -0700)]
Revert "[sanitizer] Use LLVM_ENABLE_LIBCXX to build symbolizer"
Trigger some "libatomic" error.
This reverts commit
ccbb40147286e2e1996b2b7f089fc44f049c9d28.
Petr Hosek [Thu, 29 Sep 2022 06:51:43 +0000 (06:51 +0000)]
[NFC][CMake] Inline the append_libcxx_libs macro
This is only invoked from a single site and doesn't add any value.
Bjorn Pettersson [Wed, 28 Sep 2022 10:59:33 +0000 (12:59 +0200)]
[llvm-stress] Remove dependency to legacy pass manager
This patch removes the dependency to the legacy pass manager when
building llvm-stress.
Instead of setting up a pass manager at all we just run verifyModule()
to check that the generated IR satisfies the verifier, and then
we use Module::print() to output the IR. No need to setup passes and
populating a pass manager since we aren't doing anything more fancy
than that.
Reviewed By: aeubanks
Differential Revision: https://reviews.llvm.org/D134802
Arthur Eubanks [Wed, 28 Sep 2022 19:56:44 +0000 (12:56 -0700)]
[clang] Add debug info in MicrosoftCXXABI::EmitVirtualMemPtrThunk()
(Probably) fixes https://crbug.com/1355639
Reviewed By: dblaikie
Differential Revision: https://reviews.llvm.org/D134825
Abinav Puthan Purayil [Thu, 15 Sep 2022 13:10:36 +0000 (18:40 +0530)]
[AMDGPU] Report minimum scratch size in code object v5 and later by default
This change sets
-amdgpu-assume-{external-call-stack-size | dynamic-stack-object-size}
options to zero by default for code object v5 and later. The runtime is
expected to adjust the scratch size if the amdhsa_uses_dynamic_stack bit
in the kernel descriptor is set.
Differential Revision: https://reviews.llvm.org/D128346
Carlos Alberto Enciso [Thu, 29 Sep 2022 04:17:36 +0000 (05:17 +0100)]
[ADT] IntervalTree - Fix random unittests failures in a debug builds.
On a debug build with _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY
enabled from 100 executions around 80 are failing.
More details in https://reviews.llvm.org/D125776#3820399
The issue is related to the use of std::sort.
Reviewed By: antondaubert, jryans, probinson
Differential Revision: https://reviews.llvm.org/D134805
River Riddle [Thu, 29 Sep 2022 01:39:26 +0000 (18:39 -0700)]
[mlir] Making verification after parsing optional
This is very useful when you want to parse IR even if
its invalid (e.g. bytecode). It's also useful if you don't
want to pay the cost of verification in certain situations.
Differential Revision: https://reviews.llvm.org/D134847
Ashay Rane [Wed, 28 Sep 2022 14:53:36 +0000 (14:53 +0000)]
[mlir][python] stop initialization on ImportError
An `_mlirRegisterEverything.*.so` file from an old build that referenced
`MLIRPythonExtension.RegisterEverything`, but which no longer references
that extension in a new build, causes runtime errors in the new build
like:
ImportError: _mlirRegisterEverything.cpython-38-x86_64-linux-gnu.so: undefined symbol: mlirRegisterAllPasses
The error occurs because the MLIR Python binding tries to dynamically
import the `_mlirRegisterEverything` module but the dynamic importer
fails since the new build no longer references
`MLIRPythonExtension.RegisterEverything`.
One possible solution is for the user to manually remove the
`_mlirRegisterEverything.*.so` file. This patch instead resolves the
problem in code by printing a waning if the module cannot be
imported.
Reviewed By: stellaraccident
Differential Revision: https://reviews.llvm.org/D133450
Fangrui Song [Thu, 29 Sep 2022 03:01:41 +0000 (20:01 -0700)]
[ELF] Remove resolve => resolve{Defined,Common,Shared,Lazy,Undefined} indirection. NFC
Jessica Paquette [Thu, 29 Sep 2022 00:25:11 +0000 (17:25 -0700)]
[GlobalISel][CallLowering] Use hasRetAttr for return flags on CallBases
Given something like this:
```
declare signext i16 @signext_callee()
define i32 @caller() {
%res = call i16 @signext_callee()
...
}
```
CallLowering would miss that signext_callee's return value is sign extended,
because it isn't on the call.
Use hasRetAttr on the CallBase to allow us to catch this.
(This now inserts G_ASSERT_SEXT/G_ASSERT_ZEXT like in the original review.)
Differential Revision: https://reviews.llvm.org/D86228
Vitaly Buka [Thu, 29 Sep 2022 02:26:21 +0000 (19:26 -0700)]
[sanitizer] Use LLVM_ENABLE_LIBCXX to build symbolizer
gonglingqin [Thu, 29 Sep 2022 02:05:58 +0000 (10:05 +0800)]
[LoongArch] Add fp_to_sint support for soft floating point
Differential Revision: https://reviews.llvm.org/D134692
owenca [Tue, 27 Sep 2022 05:34:53 +0000 (22:34 -0700)]
[clang-format] Fix a bug with C++ `export import <Foo/Bar>`
Fixes #57798.
Differential Revision: https://reviews.llvm.org/D134700
Vitaly Buka [Thu, 29 Sep 2022 01:42:57 +0000 (18:42 -0700)]
[test][openmp] Tsan may report more warnings here
Vitaly Buka [Thu, 29 Sep 2022 01:39:52 +0000 (18:39 -0700)]
[test][msan] -fno-sanitize-memory-param-retval in unittests
Murali Vijayaraghavan [Thu, 29 Sep 2022 01:07:52 +0000 (01:07 +0000)]
[mlir] Add support for parallel dim *after* reduction dim in split reduction
Previously, splitReduction transformation added the split parallel dimension
*before* the reduction dimension, leading to tiling for reduction. This
commit creates an option to create the parallel dimension *after* the
reduction dimension, allowing us to transform the op into vertical reduction
with SIMD parallelism.
Reviewed By: ThomasRaoux, dcaballe
Differential Revision: https://reviews.llvm.org/D134764
Gulfem Savrun Yeniceri [Wed, 28 Sep 2022 01:52:04 +0000 (01:52 +0000)]
[InstrProfiling] Fix emitting runtime hook once
https://reviews.llvm.org/D134254 introduced an issue on Fuchsia
target, which does not unconditionally emit runtime hook.
It used containsProfilingIntrinsics(M) after intrinsics are lowered.
So, this patch fixes the issue by capturing the result of that
function invocation before intrinsics are lowered.
Differential Revision: https://reviews.llvm.org/D134841
WANG Xuerui [Thu, 29 Sep 2022 01:06:01 +0000 (09:06 +0800)]
[LoongArch] Expand llvm.stacksave and llvm.stackrestore
As in commit
bfb00d4c1c98 ("[RISCV] Allow lowering of dynamic_stackalloc, stacksave, stackrestore").
Differential Revision: https://reviews.llvm.org/D134435
chenglin.bi [Thu, 29 Sep 2022 01:04:13 +0000 (09:04 +0800)]
[ARM64EC] Add arm64ec for getArchName
Followup D125412, return the correct arch name for Arm64EC
Reviewed By: efriedma, mstorsjo
Differential Revision: https://reviews.llvm.org/D134787
wanglei [Thu, 29 Sep 2022 00:48:54 +0000 (08:48 +0800)]
[LoongArch] Produce a R_LARCH_32_PCREL relocation
LoongArchELFObjectWriter::getRelocType check IsPCRel for FK_Data_4
(which we produce a R_LARCH_32_PCREL relocation for if IsPCRel).
R_LARCH_32_PCREL is required for FDE relocation.
Differential Revision: https://reviews.llvm.org/D134715
Fangrui Song [Thu, 29 Sep 2022 00:56:16 +0000 (17:56 -0700)]
[ELF] Avoid redundant assignment to Symbol fields. NFC
Florian Mayer [Thu, 29 Sep 2022 00:40:50 +0000 (17:40 -0700)]
[NFC] [HWASan] remove unnecessary cast
wanglei [Wed, 28 Sep 2022 09:56:31 +0000 (17:56 +0800)]
[LoongArch] Override TargetSubtargetInfo::getSelectionDAGInfo
The target selection DAG lowering information is needed for
SelectionDAGBuilder to lower a call like memcmp into an optimized
form.
Differential Revision: https://reviews.llvm.org/D134712
Jason Molenda [Thu, 29 Sep 2022 00:35:35 +0000 (17:35 -0700)]
Include <cmath> before using std::pow()
Not sure why this is failing for me to build tonight, but either
something in a header somewhere changed or my tools changed, and
it is failing to compile.
Nico Weber [Thu, 29 Sep 2022 00:11:58 +0000 (20:11 -0400)]
[lldb] Fix deprecation warnings for hasValue and getValue in mac-only code paths
No behavior change.
Nico Weber [Thu, 29 Sep 2022 00:07:14 +0000 (20:07 -0400)]
Revert "When there are variable errors, display an error in VS Code's local variables view."
This reverts commit
15f83ab77502cb2bd405a091cf419536e1d41381.
Doesn't build, see https://reviews.llvm.org/D134333#3822313
Aart Bik [Wed, 28 Sep 2022 22:04:17 +0000 (15:04 -0700)]
[mlir][sparse] provide convenience methods for toOrig/toStoredDim
Reviewed By: Peiming
Differential Revision: https://reviews.llvm.org/D134833
Vitaly Buka [Wed, 28 Sep 2022 06:41:32 +0000 (23:41 -0700)]
[StackLifetime] More efficient loop for LivenessType::Must
CFG with cycles may requires additional passes of "while (Changed)"
iteration if to propagate data back from latter blocks to earlier blocks,
ordered according to depth_fist.
OR logic, used for ::May, converge to stable state faster then AND logic
use for ::Must.
Though the better solution is to switch to some some form of queue, but
having that this one is good enough, I will consider to do that later.
We can switch ::Must to OR logic if we calculate "may be dead" instead
of direct "must be alive" and then convert values to match existing
interface.
Additionally it fixes correctness in "@cycle" test.
Reviewed By: kstoimenov, fmayer
Differential Revision: https://reviews.llvm.org/D134796
Jessica Paquette [Wed, 28 Sep 2022 23:20:24 +0000 (16:20 -0700)]
[AArch64][GlobalISel] Make G_PTRTOINT only legal for s64 + p0
A few issues:
1. There was no legalizer test for G_PTRTOINT
2. Same clamping issue as in many other opcodes
3. AArch64 pointers can only be 64b, so in reality we always have to trunc or
extend with any size other than p0 anyway.
This seems to actually produce more correct selection for narrow types as well.
Differential Revision: https://reviews.llvm.org/D107588
Philip Reames [Wed, 28 Sep 2022 22:47:25 +0000 (15:47 -0700)]
[RISCV] Add test coverage for upcoming select lowering optimization
Test copied from X86 backend since I'm going to be taking the code from there too.