- Oct 07, 2021
-
-
peter klausler authored
These functions were missing from the standard intrinsic module IEEE_ARITHMETIC. IEEE_SCALB is an alias for the standard intrinsic function SCALE(), and the others are defined as new builtin intrinsic functions. Differential Revision: https://reviews.llvm.org/D111253
-
Dan Liew authored
Although THREADLOCAL variables are supported on Darwin they cannot be used very early on during process init (before dyld has set it up). Unfortunately the checked lock is used before dyld has setup TLS leading to an abort call (`_tlv_boostrap()` is never supposed to be called at runtime). To avoid this problem `SANITIZER_CHECK_DEADLOCKS` is now disabled on Darwin platforms. This fixes running TSan tests (an possibly other Sanitizers) when `COMPILER_RT_DEBUG=ON`. For reference the crashing backtrace looks like this: ``` * thread #1, stop reason = signal SIGABRT * frame #0: 0x00000002044da0ae dyld`__abort_with_payload + 10 frame #1: 0x00000002044f01af dyld`abort_with_payload_wrapper_internal + 80 frame #2: 0x00000002044f01e1 dyld`abort_with_payload + 9 frame #3: 0x000000010c989060 dyld_sim`abort_with_payload + 26 frame #4: 0x000000010c94908b dyld_sim`dyld4::halt(char const*) + 375 frame #5: 0x000000010c988f5c dyld_sim`abort + 16 frame #6: 0x000000010c96104f dyld_sim`dyld4::APIs::_tlv_bootstrap() + 9 frame #7: 0x000000010cd8d6d2 libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::CheckedMutex::LockImpl(this=<unavailable>, pc=<unavailable>) at sanitizer_mutex.cpp:218:58 [opt] frame #8: 0x000000010cd8a0f7 libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::Mutex::Lock() [inlined] __sanitizer::CheckedMutex::Lock(this=0x000000010d733c90) at sanitizer_mutex.h:124:5 [opt] frame #9: 0x000000010cd8a0ee libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::Mutex::Lock(this=0x000000010d733c90) at sanitizer_mutex.h:162:19 [opt] frame #10: 0x000000010cd8a0bf libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock(this=0x000000030c7479a8, mu=<unavailable>) at sanitizer_mutex.h:364:10 [opt] frame #11: 0x000000010cd89819 libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::GenericScopedLock<__sanitizer::Mutex>::GenericScopedLock(this=0x000000030c7479a8, mu=<unavailable>) at sanitizer_mutex.h:363:67 [opt] frame #12: 0x000000010cd8985b libclang_rt.tsan_iossim_dynamic.dylib`__sanitizer::LibIgnore::OnLibraryLoaded(this=0x000000010d72f480, name=0x0000000000000000) at sanitizer_libignore.cpp:39:8 [opt] frame #13: 0x000000010cda7aaa libclang_rt.tsan_iossim_dynamic.dylib`__tsan::InitializeLibIgnore() at tsan_interceptors_posix.cpp:219:16 [opt] frame #14: 0x000000010cdce0bb libclang_rt.tsan_iossim_dynamic.dylib`__tsan::Initialize(thr=0x0000000110141400) at tsan_rtl.cpp:403:3 [opt] frame #15: 0x000000010cda7b8e libclang_rt.tsan_iossim_dynamic.dylib`__tsan::ScopedInterceptor::ScopedInterceptor(__tsan::ThreadState*, char const*, unsigned long) [inlined] __tsan::LazyInitialize(thr=0x0000000110141400) at tsan_rtl.h:665:5 [opt] frame #16: 0x000000010cda7b86 libclang_rt.tsan_iossim_dynamic.dylib`__tsan::ScopedInterceptor::ScopedInterceptor(this=0x000000030c747af8, thr=0x0000000110141400, fname=<unavailable>, pc=4568918787) at tsan_interceptors_posix.cpp:247:3 [opt] frame #17: 0x000000010cda7bb9 libclang_rt.tsan_iossim_dynamic.dylib`__tsan::ScopedInterceptor::ScopedInterceptor(this=0x000000030c747af8, thr=<unavailable>, fname=<unavailable>, pc=<unavailable>) at tsan_interceptors_posix.cpp:246:59 [opt] frame #18: 0x000000010cdb72b7 libclang_rt.tsan_iossim_dynamic.dylib`::wrap_strlcpy(dst="\xd2", src="0xd1d398d1bb0a007b", size=20) at sanitizer_common_interceptors.inc:7386:3 [opt] frame #19: 0x0000000110542b03 libsystem_c.dylib`__guard_setup + 140 frame #20: 0x00000001104f8ab4 libsystem_c.dylib`_libc_initializer + 65 ... ``` rdar://83723445 Differential Revision: https://reviews.llvm.org/D111243 -
Philip Reames authored
This does for readability of returns within said function as what we do for the caller side when reasoning about what might be poison. Differential Revision: https://reviews.llvm.org/D111180
-
Wolfgang Pieb authored
Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D111172
-
rdzhabarov authored
clang-tidy, fix redundant return statement at the end of the void method. Reviewed By: jpienaar Differential Revision: https://reviews.llvm.org/D111251
-
wlei authored
Differential Revision: https://reviews.llvm.org/D110859
-
Arthur Eubanks authored
This reverts commit 8d64314f.
-
Arthur Eubanks authored
To fix mismatched size_t vs uint64_t on some platforms.
-
Stefan Pintilie authored
Lowering of byval parameters with sizes that are not represented by a single store require multiple stores to properly address the correct size of the parameter. Sizes that cannot be done with a single store are 3 bytes, 5 bytes, 6 bytes, 7 bytes. It is not correct to simply perform an 8 byte store and for these elements because then the store would be larger than the element and alias analysis would assume that this is undefined behaivour and return NoAlias for them. This patch adds the correct stores so that the size of the store is not larger than the size of the element. Reviewed By: nemanjai, #powerpc Differential Revision: https://reviews.llvm.org/D108795
-
Joe Loser authored
Implement P1391 (https://wg21.link/p1391) which allows `std::string_view` to be constructible from any contiguous range of characters. Note that a different paper (http://wg21.link/P1989) handles the generic range constructor for `std::string_view`. Reviewed By: ldionne, Quuxplusone, Mordante, #libc Differential Revision: https://reviews.llvm.org/D110718
-
Philip Reames authored
This patch removes a compile time restriction from isSCEVExprNeverPoison. We've strengthened our ability to reason about flags on scopes other than addrecs, and this bailout prevents us from using it. The comment is also suspect as well in that we're in the middle of constructing a SCEV for I. As such, we're going to visit all operands *anyways*. Differential Revision: https://reviews.llvm.org/D111186
-
Simon Pilgrim authored
Match the predicate used in TargetLowering::expandMULO to detect overflow
-
Simon Pilgrim authored
Fix copy+pasta that was checking for smul_fix instead of smul_with_overflow to detected signed values. The LShr is performed on the extended type as we use it to truncate+extract the upper/hi bits of the extended multiply. More closely matches the default expansion from TargetLowering::expandMULO
-
Simon Pilgrim authored
Match the predicates used in TargetLowering::expandUADDSUBO
-
Leonard Chan authored
When using a static libunwind, the check_memcpy.c can fail because it checks that tsan intercepted all memcpy/memmoves in the final binary. Though if the static libunwind is not instrumented, then this will fail because it may contain regular memcpy/memmoves. This adds a new REQUIRES check for ensuring that this test won't run unless a dynamic libunwind.so is provided. Differential Revision: https://reviews.llvm.org/D111194
-
Arthur Eubanks authored
Currently the max alignment representable is 1GB, see D108661. Setting the align of an object to 4GB is desirable in some cases to make sure the lower 32 bits are clear which can be used for some optimizations, e.g. https://crbug.com/1016945. This uses an extra bit in instructions that carry an alignment. We can store 15 bits of "free" information, and with this change some instructions (e.g. AtomicCmpXchgInst) use 14 bits. We can increase the max alignment representable above 4GB (up to 2^62) since we're only using 33 of the 64 values, but I've just limited it to 4GB for now. The one place we have to update the bitcode format is for the alloca instruction. It stores its alignment into 5 bits of a 32 bit bitfield. I've added another field which is 8 bits and should be future proof for a while. For backward compatibility, we check if the old field has a value and use that, otherwise use the new field. Updating clang's max allowed alignment will come in a future patch. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D110451
-
Craig Topper authored
-
LLVM GN Syncbot authored
-
Stella Stamenova authored
This change broke the windows lldb bot. This reverts commit a30a36f6.
-
Kevin P. Neal authored
Currently the fadd optimizations in InstSimplify don't know how to do this "X + -0.0 ==> X" fold when using the constrained intrinsics. This adds the support. This commit is derived from D106362 with some improvements from D107285. Differential Revision: https://reviews.llvm.org/D111085
-
Fangrui Song authored
[Driver][test] Add Debian multiarch lib/clang/14.0.0/x86_64-linux-gnu and include/x86_64-linux-gnu/c++/v1 tests
-
Vitaly Buka authored
Now we can avoid scanning the stack on fast path. The price is the false stack trace with probability of the hash collision. This increase performance of lsan by 6% and pre-requirement for stack compression. Depends on D111182. Reviewed By: morehouse, dvyukov Differential Revision: https://reviews.llvm.org/D111183
-
natashaknk authored
Transpose, Matmul and Fully-connected dynamic shape support Reviewed By: rsuderman Differential Revision: https://reviews.llvm.org/D111167
-
Craig Topper authored
-
Mogball authored
Add missing documentation. Reviewed By: Chia-hungDuan, jpienaar Differential Revision: https://reviews.llvm.org/D110964
-
Arthur Eubanks authored
This reverts commit df84c1fe. Breaks some bots
-
Michael Kruse authored
Clang would reject #pragma omp for #pragma omp tile sizes(P) for (int i = 0; i < 128; ++i) {} where P is a template parameter, but the loop itself is not template-dependent. Because P context-dependent, the TransformedStmt cannot be generated and therefore is nullptr (until the template is instantiated by TreeTransform). The OMPForDirective would still expect the a loop is the dependent context and trigger an error. Fix by introducing a NumGeneratedLoops field to OMPLoopTransformation. This is used to distinguish the case where no TransformedStmt will be generated at all (e.g. #pragma omp unroll full) and template instantiation is needed. In the latter case, delay resolving the iteration space like when the for-loop itself is template-dependent until the template instatiation. A more radical solution would always delay the iteration space analysis until template instantiation, but would also break many test cases. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D111124 -
H.J. Lu authored
1. Include <cet.h> in sanitizer_common/sanitizer_asm.h to mark Intel CET support when Intel CET is enabled. 2. Add _CET_ENDBR to function entries in assembly codes so that ENDBR instruction will be generated when Intel CET is enabled. Reviewed By: dvyukov Differential Revision: https://reviews.llvm.org/D111185
-
Frederic Cambus authored
Reviewed By: xgupta Differential Revision: https://reviews.llvm.org/D110836
-
Shivam Gupta authored
-
Pengxuan Zheng authored
D100244 missed a check on the ResNo of the extract's operand 0 when finding a pair of extracts to combine into a VMOVRRD (extract(x, n); extract(x, n+1) -> VMOVRRD(extract x, n/2)). As a result, it can incorrectly pair an extract(x, n) with another extract(x:3, n+1) for example. This patch fixes the bug by adding the proper check on ResNo. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D111188
-
Arthur Eubanks authored
Currently the max alignment representable is 1GB, see D108661. Setting the align of an object to 4GB is desirable in some cases to make sure the lower 32 bits are clear which can be used for some optimizations, e.g. https://crbug.com/1016945. This uses an extra bit in instructions that carry an alignment. We can store 15 bits of "free" information, and with this change some instructions (e.g. AtomicCmpXchgInst) use 14 bits. We can increase the max alignment representable above 4GB (up to 2^62) since we're only using 33 of the 64 values, but I've just limited it to 4GB for now. The one place we have to update the bitcode format is for the alloca instruction. It stores its alignment into 5 bits of a 32 bit bitfield. I've added another field which is 8 bits and should be future proof for a while. For backward compatibility, we check if the old field has a value and use that, otherwise use the new field. Updating clang's max allowed alignment will come in a future patch. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D110451
-
Arthur Eubanks authored
Currently we're limited to 32 bit ints in diagnostics. With support for 4GB alignments coming soon, we need to report 4GB as the max alignment allowed. I've tested that this does indeed properly print 2^32. Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D111184
-
Max Kazantsev authored
Patch by Dmitry Makogon!
-
Gabor Marton authored
This tiny change improves the debugging experience of the solver a lot! Differential Revision: https://reviews.llvm.org/D110911
-
Geoffrey Martin-Noble authored
It's nice for users to have more information when debugging failures and these are only triggered in a failure path. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D107676
-
Alexandre Rames authored
For the type lattice, we (now) use the "less specialized or equal" partial order, leading to the bottom representing the empty set, and the top representing any type. This naming is more in line with the generally used conventions, where the top of the lattice is the full set, and the bottom of the lattice is the empty set. A typical example is the powerset of a finite set: generally, meet would be the intersection, and join would be the union. ``` top: {a,b,c} / | \ {a,b} {a,c} {b,c} | X X | {a} { b } {c} \ | / bottom: { } ``` This is in line with the examined lattice representations in LLVM: * lattice for `BitTracker::BitValue` in `Hexagon/BitTracker.h` * lattice for constant propagation in `HexagonConstPropagation.cpp` * lattice in `VarLocBasedImpl.cpp` * lattice for address space inference code in `InferAddressSpaces.cpp` Reviewed By: silvas, jpienaar Differential Revision: https://reviews.llvm.org/D110766 -
Nikita Popov authored
BasicAA GEP decomposition currently performs all calculation on the maximum pointer size, but at least 64-bit, with an option to double the size. The code comment claims that this improves analysis power when working with uint64_t indices on 32-bit systems. However, I don't see how this can be, at least while maintaining correctness: When working on canonical code, the GEP indices will have GEP index size. If the original code worked on uint64_t with a 32-bit size_t, then there will be truncs inserted before use as a GEP index. Linear expression decomposition does not look through truncs, so this will be an opaque value as far as GEP decomposition is concerned. Working on a wider pointer size does not help here (or have any effect at all). When working on non-canonical code (before first InstCombine), the GEP indices are implicitly truncated to GEP index size. The BasicAA code currently just ignores this fact completely, and pretends that this truncation doesn't happen. This is incorrect and will be addressed by D110977. I believe that for correctness reasons, it is important to work on the actual GEP index size to properly model potential overflow. BasicAA tries to patch over the fact that it uses the wrong size (see adjustToPointerSize), but it only does that in limited cases (only for constant values, and not all of them either). I'd like to move this code towards always working on the correct size, and dropping these artificial pointer size adjustments is the first step towards that. Differential Revision: https://reviews.llvm.org/D110657
-
Sanjay Patel authored
https://alive2.llvm.org/ce/z/QagQMn This fold is handled by instcombine via SimplifyUsingDistributiveLaws(), but we are missing the sibliing fold for 'logical and' (implemented with 'select'). Retrofitting the code in instcombine looks much harder than just adding a small adjustment here, and this is potentially more efficient and beneficial to other passes.
-
Sanjay Patel authored
-