- Aug 06, 2021
-
-
Jonas Devlieghere authored
This patch refactors IRExecutionUnit::FindInSymbols. It eliminates a few potential pitfalls and tries to be more explicit about the state carried between symbol resolution attempts. Differential revision: https://reviews.llvm.org/D107206
-
Jonas Devlieghere authored
Rather than passing two booleans around, which is especially error prone with them being next to each other, use a struct with named fields instead. Differential revision: https://reviews.llvm.org/D107295
-
Dan Liew authored
02243993 added code that is only enabled when COMPILER_RT_DEBUG is enabled. This code doesn't build on targets that don't support thread local storage because the code added uses the THREADLOCAL macro. Consequently the COMPILER_RT_DEBUG build broke for some Apple targets (e.g. 32-bit iOS simulators). ``` /Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_mutex.cpp:216:8: error: thread-local storage is not supported for the current target static THREADLOCAL InternalDeadlockDetector deadlock_detector; ^ /Volumes/user_data/dev/llvm/llvm.org/main/src/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h:227:24: note: expanded from macro 'THREADLOCAL' # define THREADLOCAL __thread ^ 1 error generated. ``` To fix this, this patch introduces a `SANITIZER_SUPPORTS_THREADLOCAL` macro that is `1` iff thread local storage is supported by the current target. That condition is then added to `SANITIZER_CHECK_DEADLOCKS` to ensure the code is only enabled when thread local storage is available. The implementation of `SANITIZER_SUPPORTS_THREADLOCAL` currently assumes Clang. See `llvm-project/clang/include/clang/Basic/Features.def` for the definition of the `tls` feature. rdar://81543007 Differential Revision: https://reviews.llvm.org/D107524
-
Ramesh Peri authored
WHen thin archives are created which have symbol table of type SYM64 then all the tools will not work since they cannot read the files properly. One can reproduce the problem as follows: 1. Take a hello world program and create an archive out of it. The SYM64_THRESHOLD=0 will force the generation of SYM64 symbol table. clang -c hello.cpp SYM64_THRESHOLD=0 llvm-ar crsT mylib.a hello.o 2. Now try to use any of the tools on this mylib.a and it will fail. llvm-nm -M mylib.a THis fix will eliminate these failures. A regression test is created in llvm/test/Object/archive-symtab.test Reviewed By: MaskRay, Ramesh Differential Revision: https://reviews.llvm.org/D107322 -
Jon Roelofs authored
-
Benjamin Kramer authored
This reverts commits f819e4c7 and 35c0848b. It triggers an infinite loop during compilation. $ cat t.ll target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" define void @MaxPoolGradGrad_1.65() local_unnamed_addr #0 { entry: %wide.vec78 = load <64 x i32>, <64 x i32>* null, align 16 %strided.vec83 = shufflevector <64 x i32> %wide.vec78, <64 x i32> poison, <8 x i32> <i32 4, i32 12, i32 20, i32 28, i32 36, i32 44, i32 52, i32 60> %0 = lshr <8 x i32> %strided.vec83, <i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16, i32 16> %1 = add <8 x i32> zeroinitializer, %0 %2 = shufflevector <8 x i32> %1, <8 x i32> undef, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> %3 = shufflevector <16 x i32> %2, <16 x i32> undef, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31> %interleaved.vec = shufflevector <32 x i32> undef, <32 x i32> %3, <64 x i32> <i32 0, i32 8, i32 16, i32 24, i32 32, i32 40, i32 48, i32 56, i32 1, i32 9, i32 17, i32 25, i32 33, i32 41, i32 49, i32 57, i32 2, i32 10, i32 18, i32 26, i32 34, i32 42, i32 50, i32 58, i32 3, i32 11, i32 19, i32 27, i32 35, i32 43, i32 51, i32 59, i32 4, i32 12, i32 20, i32 28, i32 36, i32 44, i32 52, i32 60, i32 5, i32 13, i32 21, i32 29, i32 37, i32 45, i32 53, i32 61, i32 6, i32 14, i32 22, i32 30, i32 38, i32 46, i32 54, i32 62, i32 7, i32 15, i32 23, i32 31, i32 39, i32 47, i32 55, i32 63> store <64 x i32> %interleaved.vec, <64 x i32>* undef, align 16 unreachable } $ llc < t.ll -mcpu=skylake <hang>
-
Jessica Paquette authored
G_CONCAT_VECTORS shows up from time to time when legalizing other instructions. We actually import patterns for the v16s8 <- v8s8, v8s8 case so marking it as legal gives us selection for free. Differential Revision: https://reviews.llvm.org/D107512
-
Daniele Vettorel authored
The `llvm-stress` binary is currently missing from the Bazel `BUILD` file for llvm. This patch adds it. Reviewed By: GMNGeoffrey Differential Revision: https://reviews.llvm.org/D107571
-
Florian Hahn authored
-
- Aug 05, 2021
-
-
Jennifer Yu authored
The root problem is a null pointer is accessed during the call to checkOpenMPLoop, because loop up bound expr is an error expression due to error diagnostic was emit early. To fix this, in setLCDeclAndLB, setUB and setStep instead return false, return true when LB, UB or Step contains Error, so that the checking is stopped in checkOpenMPLoop. Differential Revision: https://reviews.llvm.org/D107385
-
Kazu Hirata authored
Identified with readability-const-return-type.
-
Alexey Bataev authored
If the vectorized insertelements instructions form indentity subvector (the subvector at the beginning of the long vector), it is just enough to extend the vector itself, no need to generate inserting subvector shuffle. Differential Revision: https://reviews.llvm.org/D107494
-
Craig Topper authored
[DAGCombiner][RISCV][AMDGPU] Call SimplifyDemandedBits at the end of visitMULHU to enable known bits contant folding. We don't have real demanded bits support for MULHU, but we can still use the known bits based constant folding support at the end of SimplifyDemandedBits to simplify a MULHU. This helps with cases where we know the LHS and RHS have enough leading zeros so that the high multiply result is always 0. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D106471
-
David Sherwood authored
-
Sander de Smalen authored
Since all operands to ExtractValue must be loop-invariant when we deem the loop vectorizable, we can consider ExtractValue to be uniform. Reviewed By: david-arm Differential Revision: https://reviews.llvm.org/D107286
-
Sean Fertile authored
On AIX an aligned attribute cannot decrease the alignment of a variable when placed on a variable declaration of vector type. Differential Revision: https://reviews.llvm.org/D107522
-
eopXD authored
Rename variable for better code readability. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D107570
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D107566
-
Jay Foad authored
Differential Revision: https://reviews.llvm.org/D107546
-
Dmitry Vyukov authored
Pass thr/pc args to MemoryResetRange as we do everywhere. Currently they are unused by MemoryResetRange, but there is no reason to be inconsistent. Depends on D107562. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D107563
-
Dmitry Vyukov authored
clang-tidy warning requires qualifying auto pointers: clang-tidy: warning: 'auto ctx' can be declared as 'auto *ctx' [llvm-qualified-auto] Fix remaing cases we have in tsan. Depends on D107561. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D107562
-
Dmitry Vyukov authored
None of the interceptors machinery is used/enabled for Go, so don't include the header, it's not needed (must not be). The problem is that we have fields in ThreadState that are not present in the Go build, so changes in thread_interceptors.h can cause Go build breakages due to missing fields. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D107561
-
Momchil Velikov authored
In SimplifyCFG we may simplify the CFG by speculatively executing certain stores, when they are preceded by a store to the same location. This patch allows such speculation also when the stores are similarly preceded by a load. In order for this transformation to be correct we need to ensure that the memory location is writable and the store in the new location does not introduce a data race. Local objects (created by an `alloca` instruction) are always writable, so once we are past a read from a location it is valid to also write to that same location. Seeing just a load does not guarantee absence of a data race (unlike if we see a store) - the load may still be part of a race, just not causing undefined behaviour (cf. https://llvm.org/docs/Atomics.html#optimization-outside-atomic). In the original program, a data race might have been prevented by the condition, but once we move the store outside the condition, we must be sure a data race wasn't possible anyway, no matter what the condition evaluates to. One way to be sure that a local object is never concurrently read/written is check that its address never escapes the function. Hence this transformation is restricted to local, non-escaping objects. Reviewed By: nikic, lebedev.ri Differential Revision: https://reviews.llvm.org/D107281
-
Dmitry Vyukov authored
For symbolizer we only process SIGSEGV signals synchronously (which means bug in symbolizer or in tsan). But we still want to reset in_symbolizer to fail gracefully. Symbolizer and user code use different memory allocators, so if we don't reset in_symbolizer we can get memory allocated with one being feed with another, which can cause more crashes. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D107564
-
Dmitry Vyukov authored
Use C++ casts and auto. Rename to CollectThreadLeaks b/c it's only collecting, not reporting. Reviewed By: melver Differential Revision: https://reviews.llvm.org/D107568
-
Michał Górny authored
LLVMLineEditor library is part of the LLVM dylib. Move it into LLVM_LINK_COMPONENTS to avoid duplicate linking when dylib is being used. This fixes building standalone clang against installed LLVM without static libraries. Differential Revision: https://reviews.llvm.org/D107558
-
Simon Pilgrim authored
IR typically creates INSERT_SUBVECTOR patterns as a widening of the subvector with undefs to pad to the destination size, followed by a shuffle for the actual insertion - SelectionDAGBuilder has to do something similar for shuffles when source/destination vectors are different sizes. This combine attempts to recognize these patterns by looking for a shuffle of a subvector (from a CONCAT_VECTORS) that starts at a modulo of its size into an otherwise identity shuffle of the base vector. This uncovered a couple of target-specific issues as we haven't often created INSERT_SUBVECTOR nodes in generic code - aarch64 could only handle insertions into the bottom of undefs (i.e. a vector widening), and x86-avx512 vXi1 insertion wasn't keeping track of undef elements in the base vector. Fixes PR50053 Differential Revision: https://reviews.llvm.org/D107068
-
Florian Hahn authored
We can only trust the range of the index if it is guaranteed non-poison. Fixes PR50949. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D107364
-
Dawid Jurczak authored
Additionally with this patch aligned DSE which is the only user of emitCalloc. Differential Revision: https://reviews.llvm.org/D103523
-
David Sherwood authored
This patch adds more instructions to the Uniforms list, for example certain intrinsics that are uniform by definition or whose operands are loop invariant. This list includes: 1. The intrinsics 'experimental.noalias.scope.decl' and 'sideeffect', which are always uniform by definition. 2. If intrinsics 'lifetime.start', 'lifetime.end' and 'assume' have loop invariant input operands then these are also uniform too. Also, in VPRecipeBuilder::handleReplication we check if an instruction is uniform based purely on whether or not the instruction lives in the Uniforms list. However, there are certain cases where calls to some intrinsics can be effectively treated as uniform too. Therefore, we now also treat the following cases as uniform for scalable vectors: 1. If the 'assume' intrinsic's operand is not loop invariant, then we are free to treat this as uniform anyway since it's only a performance hint. We will get the benefit for the first lane. 2. When the input pointers for 'lifetime.start' and 'lifetime.end' are loop variant then for scalable vectors we assume these still ultimately come from the broadcast of an alloca. We do not support scalable vectorisation of loops containing alloca instructions, hence the alloca itself would be invariant. If the pointer does not come from an alloca then the intrinsic itself has no effect. I have updated the assume test for fixed width, since we now treat it as uniform: Transforms/LoopVectorize/assume.ll I've also added new scalable vectorisation tests for other intriniscs: Transforms/LoopVectorize/scalable-assume.ll Transforms/LoopVectorize/scalable-lifetime.ll Transforms/LoopVectorize/scalable-noalias-scope-decl.ll Differential Revision: https://reviews.llvm.org/D107284
-
Fanbo Meng authored
This reverts commit d91234b2. Reviewed By: abhina.sreeskantharajan Differential Revision: https://reviews.llvm.org/D107565
-
Dawid Jurczak authored
[SimplifyLibCalls][NFC] Clean up LibCallSimplifier from 'memset + malloc into calloc' transformation FoldMallocMemset can be safely removed because since https://reviews.llvm.org/D103009 such transformation is already performed in DSE. Differential Revision: https://reviews.llvm.org/D103451
-
Krzysztof Parzyszek authored
When LLVM is used in other projects, it may happen that global cons- tructors will execute before the call to ParseCommandLineOptions. Since OptBisect is initialized via a constructor, and has no ability to be updated at a later time, passing "-opt-bisect-limit" to the parse function may have no effect. To avoid this problem use a cl::cb (callback) to set the bisection limit when the option is actually processed. Differential Revision: https://reviews.llvm.org/D104551
-
David Sherwood authored
The tests previously had lots of unnecessary CHECK lines, where all we really need to check is the presence (or absence) of the assume intrinsic and the correct input operands. Differential Revision: https://reviews.llvm.org/D107157
-
Sean Fertile authored
Limit the maximum alignment for attribute aligned to 4096 to match the limit of the .align pseudo op in the system assembler. Differential Revision: https://reviews.llvm.org/D107497
-
Bardia Mahjour authored
Function exploreDirections() in DependenceAnalysis implements a recursive algorithm for refining direction vectors. This algorithm has worst-case complexity of O(3^(n+1)) where n is the number of common loop levels. In this patch I'm adding a threshold to control the amount of time we spend in doing MIV tests (which most of the time end up resulting in over pessimistic direction vectors anyway). Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D107159
-
Sander de Smalen authored
This change wasn't strictly necessary for D106164 and could be removed. This patch addresses the post-commit comments from @fhahn on D106164, and also changes sve-widen-gep.ll to use the same IR test as shown in pointer-induction.ll. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D106878
-
David Sherwood authored
The two tests (@testloopvariant and @testbitcast) are actually identical as in both loops the bitcast gets widened, forcing the lifetime marker to be replicated using each lane of the input vector. Differential Revision: https://reviews.llvm.org/D107150
-
Paul Robinson authored
It's entirely possible (because it actually happened) for a bool variable to end up with a 256-bit DW_AT_const_value. This came about when a local bool variable was initialized from a bitfield in a 32-byte struct of bitfields, and after inlining and constant propagation, the variable did have a constant value. The sequence of optimizations had it carrying "i256" values around, but once the constant made it into the llvm.dbg.value, no further IR changes could affect it. Technically the llvm.dbg.value did have a DIExpression to reduce it back down to 8 bits, but the compiler is in no way ready to emit an oversized constant *and* a DWARF expression to manipulate it. Depending on the circumstances, we had either just the very fat bool value, or an expression with no starting value. The sequence of optimizations that led to this state did seem pretty reasonable, so the solution I came up with was to invent a DWARF constant expression folder. Currently it only does convert ops, but there's no reason it couldn't do other ops if that became useful. This broke three tests that depended on having convert ops survive into the DWARF, so I added an operator that would abort the folder to each of those tests. Differential Revision: https://reviews.llvm.org/D106915
-
Florian Hahn authored
Suggested in D107364.
-