Allocatable intent(out) are deallocated at the beginning of a function/subroutine.
For polyrmophic entities, the dynamic type need to be reseted to the declared
type. This patch makes sure this is done when the dummy argument is optional and
present.
Depends on D145674
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D145679
Restore the behavior changed in D145384 and add proper
unit tests.
Unallocated unlimited poymorphic allocatable and disassociated
unlimited polymorphic pointer should return false.
Reviewed By: PeteSteinfeld
Differential Revision: https://reviews.llvm.org/D145674
Ignoring freeze(undef) if it has multiple uses in LowerAVXCONCAT_VECTORS
causes the custom INSERT_SUBVECTOR for vector widening to be ignored.
Differential Revision: https://reviews.llvm.org/D144903
This silences a GCC conversion diagnostic about assigning `1` to a
1-bit signed bit-field changing the value from `1` to `-1`.
Co-authored-by: Igor Kushnir <igorkuo@gmail.com>
The function makes liveness tests for the entire live register set for every instruction it passes by.
This becomes very slow on high RP regions such as ASAN enabled code.
Instead only uses of last tracked instruction should be tested and this greatly improves compilation time.
This patch revealed few bugs in SIFormMemoryClauses and PreRARematStage::sinkTriviallyRematInsts which should
be fixed first.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D136267
The outer context private check for reduction variables was firing
for all constructs. This check is not applicable to non-worksharing
constructs.
OpenMP 5.2: Section 5.5.8
A list item that appears in a reduction clause on a worksharing construct
must be shared in the parallel region to which a correspodning worksharing
region binds.
Reviewed By: peixin
Differential Revision: https://reviews.llvm.org/D144824
We were failing tests where an ALLOCATE statement that allocated an
array had a non-character scalar MOLD argument.
I fixed this by merging the code for ALLOCATE statements with MOLD and
SOURCE arguments.
Differential Revision: https://reviews.llvm.org/D145418
The patch adds the lowering from Flang parse-tree to FIR+OpenMP. The
conversion code is also added in MLIR.
Reviewed By: kiranchandramohan
Differential Revision: https://reviews.llvm.org/D133442
Co-authored-by: Kiran Chandramohan <kiran.chandramohan@arm.com>
After commit 0a4aa8a122 we see failures
like:
optional:722:7: error: missing '#include <__type_traits/conjunction.h>';
'_And' must be declared before it is used
and:
optional:683:46: error: missing '#include
<__type_traits/disjunction.h>'; '_Or' must be declared before it is used
using __check_constructible_from_opt = _Or<
Adding these here fixes that.
I'm not familiar with the libcxx codebase, will ask the author to take a
look too.
This function mimics the std::atomic_thread_fence function from
<atomic>. This has no uses in source currently, but this will be used by
the proposed RPC client for the GPU mode support. There is varying
support for direct memory ordering for the GPU atomics on shared memory
resources. So the implementation will use relaxed atomics and explicit
memory fences.
Some additional work may need to be done to map this to `NVPTX` system
level fences.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D145608
This revision adds:
- New test allocator, which cleans memory during allocation and deallocation,
- tests using that allocator to vector.
This patch is part of our efforts to add support for ASan annotations with every
allocator.
This commit adds a new allocator for testing purposes only. The safe allocator
ensures that memory is cleand (zeroed) during allocation and deallocation, and
is intendted to test ASan annotations for every allocator in std::vector.
Check: D136765
Those tests should work correctly, even if support for every allocator in std::vector
is not yet available.
Support in ASan API was added here: rGdd1b7b797a116eed588fd752fbe61d34deeb24e4
Reviewed By: philnik, #libc
Spies: libcxx-commits
Differential Revision: https://reviews.llvm.org/D145597
fir.if currently isn't treated as a 'proper' conditional, so passes are unable to determine which regions are executed at times.
This patch gives fir.if this interface, which shouldn't do too much on its own but should allow future changes to take advantage
for various purposes
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D145165
This reverts commit d14e7ee3d1.
Makes clang_format_diff.py always fail with:
Traceback (most recent call last):
File "/home/npopov/repos/llvm-project/clang/tools/clang-format/clang-format-diff.py", line 177, in <module>
main()
File "/home/npopov/repos/llvm-project/clang/tools/clang-format/clang-format-diff.py", line 174, in main
process_subprocess_result(proc, args)
File "/home/npopov/repos/llvm-project/clang/tools/clang-format/clang-format-diff.py", line 42, in process_subprocess_result
with open(filename) as f:
^^^^^^^^
NameError: name 'filename' is not defined
When linking a shared library with Flang on MinGW, the functions from the
Flang runtime are exported from the shared library. When trying to link an
executable to that library using Flang, the linker errors out because the
functions from the runtime conflict with the functions exported from the
shared library.
Add the Flang runtime libraries to the list of libraries for which no
symbols are exported.
Reapplying the patch with the git author name corrected.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D145389
This reverts commit 04fc67bf08.
The patch was applied with the wrong git author name (forgot to
amend in the right user name after applying the patch); I'll
reapply it with the right author name.
When linking a shared library with Flang on MinGW, the functions from the
Flang runtime are exported from the shared library. When trying to link an
executable to that library using Flang, the linker errors out because the
functions from the runtime conflict with the functions exported from the
shared library.
Add the Flang runtime libraries to the list of libraries for which no
symbols are exported.
Reviewed By: mstorsjo
Differential Revision: https://reviews.llvm.org/D145389
Ignoring freeze(undef) if it has multiple uses in LowerAVXCONCAT_VECTORS
causes the custom INSERT_SUBVECTOR for vector widening to be ignored.
Differential Revision: https://reviews.llvm.org/D144903
The code was difficult to maintain (big internal class definitions
with long inline functions, other functions of the same class at
different location far away, irregular ordering of classes and
function definitions). It is now improved to some extent.
New functions are added to RangeConstraint to remove code repetition,
these are useful for planned new features too.
Comments are improved.
Reviewed By: Szelethus
Differential Revision: https://reviews.llvm.org/D143751
Add an emitter to produce something similar to opencl-c.h from the
OpenCL builtin descriptions in OpenCLBuiltins.td
This only adds the emitter, without any direct use of it. This allows
opencl-c.h additions to be generated from the builtin descriptions by
manually invoking `clang-tblgen -gen-clang-opencl-builtin-header`.
Differential Revision: https://reviews.llvm.org/D104040
Values in SGPR and VGPR register are treated as unsigned by hardware.
When value in 32-bit SGPR or VGPR base can be negative calculate offset
using 32-bit add instructions, otherwise use
sgpr(unsigned) + vgpr(unsigned) + offset.
LoopStrengthReduce.cpp changes offsets to negative and in some
iterations value in SGPR or VGPR register could be negative.
Differential Revision: https://reviews.llvm.org/D144957
Values in VGPR register are treated as unsigned by hardware.
When value in 32-bit VGPR base can be negative calculate offset using
32-bit add instruction, otherwise use vgpr base(unsigned) + offset.
Does not affect case where whole offset comes from VGPR register
(immediate offset is 0).
LoopStrengthReduce.cpp changes offsets to negative and in some
iterations value in VGPR register could be negative.
Differential Revision: https://reviews.llvm.org/D144956
Values in SGPR register are treated as unsigned by hardware.
When value in 32-bit SGPR base can be negative calculate offset using
32-bit add instruction, otherwise use sgpr base(unsigned) + offset.
Does not affect case where whole offset comes from SGPR register
(immediate offset is 0).
LoopStrengthReduce.cpp changes offsets to negative and in some
iterations value in SGPR register could be negative.
Differential Revision: https://reviews.llvm.org/D144955
The patch mainly does two things. The first is allowing scalable vector
ISD::STRICT_FP_EXTEND. The second is making RISC-V customized lower
strict_fpextend to riscv_strict_fpextend_vl, the strict version of
riscv_fpextend_vl.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D145548
Close https://github.com/llvm/llvm-project/issues/61065.
We will avoid writing the names from external AST naturally. But
currently its check is often false positive since we may have already
marked the declarations as external but
DeclContext::hasNeedToReconcileExternalVisibleStorage would be false
after reconciling.
Tested with libcxx's modular build.
This patch can improve 8% compilation time in an internal workloads.
Since https://reviews.llvm.org/D141386 !range violations return
poison instead of causing immediate undefined behavior. As such,
it is fine for IPSCCP to infer !range even if the value might be
poison. (The value cannot be undef as this would promote undef to
poison, but this is already checked separately.)
This basically undoes the late change done to D83952, restoring
it to its original version (which is now valid).
Differential Revision: https://reviews.llvm.org/D144467
Use the memory() spelling in a few places that were using the
old syntax.
The documented attributes for llvm.type.checked.load don't match
the actual attributes, I've raised this here:
https://reviews.llvm.org/D21121#inline-1406792
SanitizerBinaryMetadata should only apply to to host code, and not GPU
code. Recently AMD GPU target code has experimental sanitizer support.
If we're compiling a mixed host/device source file, only add sanitizer
metadata to host code.
Differential Revision: https://reviews.llvm.org/D145519
The legacy PM is only supported for codegen, and PassManagerBuilder
is exclusively about the middle-end optimization pipeline. Drop it.
Differential Revision: https://reviews.llvm.org/D145387
These libraries are only ever used in clang-tidy itself, so there is no
need to unconditionally keep all symbols.
Reviewed By: GMNGeoffrey, #bazel_build
Differential Revision: https://reviews.llvm.org/D145258
When compiling compiler-rt with -fsanitize=undefined and running testcases you
end up with the following warning:
UBSan: int_mulo_impl.inc:21:36: left shift of 1 by 63 places cannot be represented in type 'di_int' (aka 'long long')
This can be avoided by simply doing the shift in a matching unsigned variant of
the type.
The same kind of pattern seems to exist in int_mulv_impl.inc
This was found in an out of tree target.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D145556