- Jan 24, 2021
-
-
Arthur Eubanks authored
The new PM inliner does not delete dead calls.
-
Jon Chesterfield authored
[libomptarget][cuda] Call v2 functions explicitly rtl.cpp calls functions like cuMemFree that are replaced by a macro in cuda.h with cuMemFree_v2. This patch changes the source to use the v2 names consistently. See also D95104, D95155 for the idea. Alternatives are to use a mixture, e.g. call the macro names and explictly dlopen the _v2 names, or to keep the current status where the symbols are replaced by macros in both files Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D95274
-
Nikita Popov authored
In both cases, optimization is prevented because "br X == C || X == C2" is converted into a switch. In one case loop rotation is blocked, in the other vectorization.
-
Nikita Popov authored
-
Shilei Tian authored
D94700 removed the static library so we no longer need to pass `-llibomptarget-nvptx` to `nvlink`. Since the bitcode library is the only device runtime for now, instead of emitting a warning when it is not found, an error should be raised. We also set a new option `libomptarget-nvptx-bc-path` to let user choose which bitcode library is being used. Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D95161
-
Kazu Hirata authored
This reverts commit cc7a2382. The X86WinEHState.cpp hunk seems to break certain builds.
-
Mark de Wever authored
During the review of D91986 it has been discovered the in C++11 deprecated `throw()` exception specification has been removed in C++20. Removed the part of the test code using this feature.
-
Florian Hahn authored
This patch adds a new InstModificationIRStrategy to mutate flags/options for instructions. For example, it may add or remove nuw/nsw flags from add, mul, sub, shl instructions or change the predicate for icmp instructions. Subtle changes such as those mentioned above should lead to a more interesting range of inputs. The presence or absence of overflow flags can expose subtle bugs, for example. Reviewed By: bogner Differential Revision: https://reviews.llvm.org/D94905
-
Michael Kruse authored
ZoneAlgorithms's computePHI relies on being provided with consistent a schedule to compute the statement prodecessors of a statement containing PHINodes. Otherwise unexpected results such as PHI nodes with multiple predecessors can occur which would result in problems in the algorithms expecting consistent data. In the added test case, statement instances are scrubbed from the SCoP their execution would result in undefined behavior (Due to a nsw overflow). As already being undefined behavior in LLVM-IR, neither AssumedContext nor InvalidContext are updated, giving computePHI no means to avoid these cases. Intoduce a new SCoP property, the DefinedBehaviorContext, that among the runtime-checked conditions, also tracks the assumptions not needing a runtime check, in particular those affecting the assumed control flow. This replaces the manual combination of the 3 other contexts that was already done in computePHI and setNewAccessRelation. Curr...
-
Michael Kruse authored
-
Michael Kruse authored
-
Michael Kruse authored
This simplifies the access relations.
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Kazu Hirata authored
LoopUtils.h needs ICFLoopSafetyInfo but relies on a forward declaration of ICFLoopSafetyInfo in IVDescriptors.h. This patch adds a forward declaration right in LoopUtils.h. While we are at it, this patch removes the one in IVDescriptors.h, where it is unnecessary.
-
Florian Hahn authored
Some utilities used by InstCombine, like SimplifyLibCalls, may add new instructions and replace the uses of a call, but return nullptr because the inserted call produces multiple results. Previously, the replaced library calls would get removed by InstCombine's deleter, but after 29207707 this may not happen, if the willreturn attribute is missing. As a work-around, update replaceInstUsesWith to set MadeIRChange, if it replaces any uses. This catches the cases where it is used as replacer by utilities used by InstCombine and seems useful in general; updating uses will modify the IR. This fixes an expensive-check failure when replacing @__sinpif/@__cospifi with @__sincospif_sret.
-
Mark de Wever authored
Implements parts of: - P0898R3 Standard Library Concepts - P1754 Rename concepts to standard_case for C++20, while we still can Reviewed By: ldionne, miscco, #libc Differential Revision: https://reviews.llvm.org/D91004
-
Dan Liew authored
In that change I forgot to update the call to `AsanThread::ThreadStart()` in `asan_win.cpp`.
-
Ben Shi authored
Reviewed By: dylanmckay Differential Revision: https://reviews.llvm.org/D93976
-
Sanjay Patel authored
As shown in the test diffs, we could miscompile by propagating flags that did not exist in the original code. The flags required for fmin/fmax reductions will be fixed in a follow-up patch.
-
Sanjay Patel authored
-
Florian Hahn authored
With the addition of the `willreturn` attribute, functions that may not return (e.g. due to an infinite loop) are well defined, if they are not marked as `willreturn`. This patch updates `wouldInstructionBeTriviallyDead` to not consider calls that may not return as dead. This patch still provides an escape hatch for intrinsics, which are still assumed as willreturn unconditionally. It will be removed once all intrinsics definitions have been reviewed and updated. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D94106
-
- Jan 23, 2021
-
-
Ben Shi authored
Reviewed By: dylanmckay Differential Revision: https://reviews.llvm.org/D89047
-
Pedro Tammela authored
NFC
-
Pedro Tammela authored
This patch adds the integer handling typemaps and the typemap for string returning functions. The integer handling typemaps overrides SWIG's own typemaps to distinct the handling of integers from floating point. The typemap for string returning functions is a port of Python's typemap. Differential Revision: https://reviews.llvm.org/D94937
-
LLVM GN Syncbot authored
-
Ayke van Laethem authored
This reverts commit 2325157c. Unfortunately this commit produces linker errors on some builds: http://lab.llvm.org:8011/#/builders/57/builds/3704 http://lab.llvm.org:8011/#/builders/112/builds/3216 http://lab.llvm.org:8011/#/builders/121/builds/3900
-
Roman Lebedev authored
[SimplifyCFG] Change 'LoopHeaders' to be ArrayRef<WeakVH>, not a naked set, thus avoiding dangling pointers If i change it to AssertingVH instead, a number of existing tests fail, which means we don't consistently remove from the set when deleting blocks, which means newly-created blocks may happen to appear in that set if they happen to occupy the same memory chunk as did some block that was in the set originally. There are many places where we delete blocks, and while we could probably consistently delete from LoopHeaders when deleting a block in transforms located in SimplifyCFG.cpp itself, transforms located elsewhere (Local.cpp/BasicBlockUtils.cpp) also may delete blocks, and it doesn't seem good to teach them to deal with it. Since we at most only ever delete from LoopHeaders, let's just delegate to WeakVH to do that automatically. But to be honest, personally, i'm not sure that the idea behind LoopHeaders is sound.
-
LLVM GN Syncbot authored
-
Ayke van Laethem authored
This change adds an AssemblerInvocation class, similar to the CompilerInvocation class. It can be used to invoke cc1as directly. The project I'm working on wants to compile Clang and use it as a static library. For that to work, there must be a way to invoke the assembler programmatically, using the same arguments as you would otherwise pass to cc1as. Differential Revision: https://reviews.llvm.org/D63852
-
Nikita Popov authored
LSR should be dropping nowrap flags when adding new postinc users.
-
Florian Hahn authored
The target features are obtained as a list of features/attributes. Instead of storing them in a single string, store the vector. This matches lto::Config's behavior and simplifies the transition to lto::backend(). Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D95224
-
Jeroen Dobbelaere authored
Insert a llvm.experimental.noalias.scope.decl intrinsic that identifies where a noalias argument was inlined. This patch includes some refactorings from D90104. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D93040
-
Simon Pilgrim authored
Avoid string copies and fix clang-tidy warning.
-
Roger Ferrer Ibanez authored
[RISCV][PrologEpilogInserter] "Float" emergency spill slots to avoid making them immediately unreachable from the stack pointer In RISC-V there is a single addressing mode of the form imm(reg) where imm is a signed integer of 12-bit with a range of [-2048..2047] bytes from reg. The test MultiSource/UnitTests/C++11/frame_layout of the LLVM test-suite exercises several scenarios with the stack, including function calls where the stack will need to be realigned to to a local variable having a large alignment of 4096 bytes. In situations of large stacks, the RISC-V backend (in RISCVFrameLowering) reserves an extra emergency spill slot which can be used (if no free register is found) by the register scavenger after the frame indexes have been eliminated. PrologEpilogInserter already takes care of keeping the emergency spill slots as close as possible to the stack pointer or frame pointer (depending on what the function will use). However there is a final alignment step to honour the maximum alignment of the stack that, when using the stack pointer to access the emergency spill slots, has the side effect of setting them farther from the stack pointer. In the case of the frame_layout testcase, the net result is that we do have an emergency spill slot but it is so far from the stack pointer (more than 2048 bytes due to the extra alignment of a variable to 4096 bytes) that it becomes unreachable via any immediate offset. During elimination of the frame index, many (regular) offsets of the stack may be immediately unreachable already. Their address needs to be computed using a register. A virtual register is created and later RegisterScavenger should be able to find an unused (physical) register. However if no register is available, RegisterScavenger will pick a physical register and spill it onto an emergency stack slot, while we compute the offset (restoring the chosen register after all this). This assumes that the emergency stack slot is easily reachable (this is, without requiring another register!). This is the assumption we seem to break when we perform the extra alignment in PrologEpilogInserter. We can "float" the emergency spill slots by increasing (in absolute value) their offsets from the incoming stack pointer. This way the emergency spill slots will remain close to the stack pointer (once the function has allocated storage for the stack, including the needed realignment). The new size computed in PrologEpilogInserter is padding so it should be OK to move the emergency spill slots there. Also because we're increasing the alignment, the new location should stay aligned for the purpose of the emergency spill slots. Note that this change also impacts other backends as shown by the tests. Changes are minor adjustments to the emergency stack slot offset. Differential Revision: https://reviews.llvm.org/D89239
-
Sergey Dmitriev authored
This patch fixes llvm-link assertion when linking external variable declaration with a definition with appending linkage. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D95126
-
Dan Liew authored
Previously in ASan's `pthread_create` interceptor we would block in the `pthread_create` interceptor waiting for the child thread to start. Unfortunately this has bad performance characteristics because the OS scheduler doesn't know the relationship between the parent and child thread (i.e. the parent thread cannot make progress until the child thread makes progress) and may make the wrong scheduling decision which stalls progress. It turns out that ASan didn't use to block in this interceptor but was changed to do so to try to address http://llvm.org/bugs/show_bug.cgi?id=21621/. In that bug the problem being addressed was a LeakSanitizer false positive. That bug concerns a heap object being passed as `arg` to `pthread_create`. If: * The calling thread loses a live reference to the object (e.g. `pthread_create` finishes and the thread no longer has a live reference to the object). * Leak checking is triggered. * The child thread has not yet started (once it starts it will have a live reference). then the heap object will incorrectly appear to be leaked. This bug is covered by the `lsan/TestCases/leak_check_before_thread_started.cpp` test case. In b029c510 ASan was changed to block in `pthread_create()` until the child thread starts so that `arg` is kept alive for the purposes of leaking check. While this change "works" its problematic due to the performance problems it causes. The change is also completely unnecessary if leak checking is disabled (via detect_leaks runtime option or CAN_SANITIZE_LEAKS compile time config). This patch does two things: 1. Takes a different approach to solving the leak false positive by making LSan's leak checking mechanism treat the `arg` pointer of created but not started threads as reachable. This is done by implementing the `ForEachRegisteredThreadContextCb` callback for ASan. 2. Removes the blocking behaviour in the ASan `pthread_create` interceptor. rdar://problem/63537240 Differential Revision: https://reviews.llvm.org/D95184
-
Kazu Hirata authored
Identified with misc-static-assert.
-
Kazu Hirata authored
-
Kazu Hirata authored
-