- Apr 05, 2021
-
-
Josh Berdine authored
The current code does not follow the simple interface to the OCaml GC, where GC roots are registered conservatively, only initializing allocations are performed, etc. This is intentional, as stated in the opening file comments. On the other hand, the current code does register GC roots in many situations where it is not strictly necessary. This diff omits many of them. Differential Revision: https://reviews.llvm.org/D99475
-
Josh Berdine authored
Using the `cstr_to_string` function that allocates and initializes an OCaml `string` value enables simplifications in several cases. This change also has the effect of avoiding calling `memcpy` on NULL pointers even if only 0 bytes are to be copied. Differential Revision: https://reviews.llvm.org/D99474
-
Josh Berdine authored
Using the `caml_alloc_some` and `ptr_to_option` functions that allocate OCaml `option` values enables simplifications in many cases. These simplifications also result in avoiding unnecessary double initialization in many cases, so yield a minor optimization as well. Also, change to avoid using the old unprefixed functions such as `alloc_small` and instead use the current `caml_alloc_small`. A few of the changed functions were slightly rewritten in the early-return style. Differential Revision: https://reviews.llvm.org/D99473
-
Josh Berdine authored
In several functions an OCaml block is allocated and no further OCaml allocation functions (or other functions that might trigger allocation or collection) are performed before the block is fully initialized. In these cases, it is safe and slightly more efficient to allocate an uninitialized block. Also, the code does not become more complex after the non-initializing allocation, since in the case that a non-small allocation is made, the initial values stored are definitely not pointers to OCaml young blocks, and so initializing via direct assignment is still safe. That is, in general if `caml_alloc_small` is called, initializing it with direct assignments is safe, but if `caml_alloc_shr` is called (e.g. for a block larger than `Max_young_wosize`), then `caml_initialize` should be called to inform the GC of a potential major to minor pointer. But if the initial value is definitely not a young OCaml block, direct assignment is safe. Differential Revision: https://reviews.llvm.org/D99472
-
Josh Berdine authored
Using `Store_field` to initialize fields of blocks allocated with `caml_alloc_small` is unsafe. The fields of blocks allocated by `caml_alloc_small` are not initialized, and `Store_field` calls the OCaml GC write barrier. If the uninitialized value of a field happens to point into the OCaml heap, then it will e.g. be added to a conflict set or followed and have what the GC thinks are color bits changed. This leads to crashes or memory corruption. This diff fixes a few (I think all) instances of this problem. Some of these are creating option values. OCaml 4.12 has a dedicated `caml_alloc_some` function for this, so this diff adds a compatible function with a version check to avoid conflict. With that, macros for accessing option values are also added. Differential Revision: https://reviews.llvm.org/D99471
-
Sylvestre Ledru authored
as requested in https://bugs.llvm.org/show_bug.cgi?id=49553, submitting the proposed changes to just ignore the -flto= options which are recognized by GCC ("auto" and "jobserver"). GCC supports -flto=<auto|jobserver|<N> to select the parallelity for LTO builds. LLVM also has -flto-jobs=<N>, which only seems to have a meaning when used with -flto=thin? The attached patch just ignores the values "auto" and "jobserver". that doesn't change anything in functionality. Another option would be to map these values to either "thin" or "full", maybe in presence of the -ffat-lto-objects option? -flto=<n> could also be translated to -flto-jobs=<N>. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D99501
-
Max Kazantsev authored
-
Max Kazantsev authored
This is to avoid sophistication of checks as the old and new PM behave differently with fix patches.
-
Max Kazantsev authored
-
Yaxun (Sam) Liu authored
Rename it to -fgpu-flush-denormals-to-zero. Reviewed by: Artem Belevich Differential Revision: https://reviews.llvm.org/D99688
-
Dave Lee authored
When referencing `NSObject`, it's enough to import `objc/NSObject.h`. Importing `Foundation` is unnecessary in these cases. Differential Revision: https://reviews.llvm.org/D99867
-
Dave Lee authored
Use `@import ObjectiveC` instead of `@import Foundation`, as the former is all that's needed, and results in fewer clang modules being built. This results in the following clang modules *not* being built for this test. ApplicationServices CFNetwork ColorSync CoreFoundation CoreGraphics CoreServices CoreText DiskArbitration Dispatch Foundation IOKit ImageIO Security XPC _Builtin_intrinsics launch libkern os_object os_workgroup Differential Revision: https://reviews.llvm.org/D99859
-
Craig Topper authored
The W version of orc.b does not exist in Zbp so we need to use gorci encoding. If we have Zbp, we can use gorciw which can avoid a sext.w in some cases.
-
Fangrui Song authored
This was reverted by f176803e due to Ubuntu 16.04 x86-64 glibc 2.23 problems. This commit additionally calls `__tls_get_addr({modid,0})` to work around the dlpi_tls_data==NULL issues for glibc<2.25 (https://sourceware.org/bugzilla/show_bug.cgi?id=19826) GetTls is the range of * thread control block and optional TLS_PRE_TCB_SIZE * static TLS blocks plus static TLS surplus On glibc, lsan requires the range to include `pthread::{specific_1stblock,specific}` so that allocations only referenced by `pthread_setspecific` can be scanned. This patch uses `dl_iterate_phdr` to collect TLS blocks. Find the one with `dlpi_tls_modid==1` as one of the initially loaded module, then find consecutive ranges. The boundaries give us addr and size. This allows us to drop the glibc internal `_dl_get_tls_static_info` and `InitTlsSize` entirely. Use the simplified method with non-Android Linux for now, but in theory this can be used with *BSD and potentially other ELF OSes. This simplification enables D99566 for TLS Variant I architectures. See https://reviews.llvm.org/D93972#2480556 for analysis on GetTls usage across various sanitizers. Differential Revision: https://reviews.llvm.org/D98926
-
Arthur O'Dwyer authored
Since D99515, this header triggers -Wundef on Mac OSX older than 10.15. This is now fixed.
-
Arthur O'Dwyer authored
-
Roman Lebedev authored
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): check that adding shift amounts doesn't overflow (PR49778) This is identical to 781d077a, but for the other function. For certain shift amount bit widths, we must first ensure that adding shift amounts is safe, that the sum won't have an unsigned overflow. Fixes https://bugs.llvm.org/show_bug.cgi?id=49778
-
Roman Lebedev authored
-
Roman Lebedev authored
-
Craig Topper authored
This will allow us to share any future known bits, demaned bits, or sign bits improvements.
-
Thomas Preud'homme authored
Clang test CodeGenCUDA/kernel-stub-name.cu uses never defined DKERN variable in a CHECK-NOT directive. This commit replace the variable by a regex, thereby avoiding the issue. Reviewed By: yaxunl Differential Revision: https://reviews.llvm.org/D99832
-
Thomas Preud'homme authored
Commit 81295213 changed a line defining PREFIX in clang test CodeGenCUDA/device-stub.cu into a CHECK-NOT directive. All following lines using PREFIX are therefore using an undefined variable since the pattern defining PREFIX is not supposed to occur and CHECK-NOT are checked independently. This commit replaces all uses of PREFIX by the regex used to define it, thereby avoiding the problem. Reviewed By: yaxunl Differential Revision: https://reviews.llvm.org/D99831
-
Mark de Wever authored
This improves the naming of the fields `depends`/`internal_depends`. It also adds the documentation for this script. The changes are based on D99290 and its review comments. Differential Revision: https://reviews.llvm.org/D99615
-
Fangrui Song authored
Take gcc-8 on Debian i386 as an example. The target-specific libstdc++ search path (`GPLUSPLUS_TOOL_INCLUDE_DIR`) uses the multiarch name `i386-linux-gnu`, instead of the triple of the GCC installation `i686-linux-gnu` (the directory under `usr/lib/gcc/`): ``` /usr/include/c++/8 /usr/include/i386-linux-gnu/c++/8 /usr/include/c++/8/backward ``` Clang currently detects `/usr/lib/gcc/i686-linux-gnu/8/../../../include/i686-linux-gnu/c++/8`. This patch changes the second i686-linux-gnu to i386-linux-gnu so that `/usr/include/i386-linux-gnu/c++/8` can be found. Fix PR49827 - this was somehow regressed by my previous libstdc++ include path cleanups and fixes for gcc-cross, but it seems that the paths were never properly tested before. Differential Revision: https://reviews.llvm.org/D99852
-
Martin Storsjö authored
This matches what we link the library itself against (set in CMakeLists.txt). When testing a static library version of libc++, this is needed for essentially every test due to libc++ object files requiring it. Also with libc++ built as a DLL, some tests directly call functions that are provided by msvcprt (such as std::set_new_handler), thus this fixes a number of tests in that configuration too. Differential Revision: https://reviews.llvm.org/D99263
-
- Apr 04, 2021
-
-
Sanjay Patel authored
This is discussed in https://llvm.org/PR48999 , but it does not solve that request. The difference in the vector test shows that some other logic transform is limited to scalar types.
-
Sanjay Patel authored
PR48999
-
Nikita Popov authored
When converting a switch with two cases and a default into a select, also handle the denegerate case where two cases have the same value. Generate this case directly as %or = or i1 %cmp1, %cmp2 %res = select i1 %or, i32 %val, i32 %default rather than %sel1 = select i1 %cmp1, i32 %val, i32 %default %res = select i1 %cmp2, i32 %val, i32 %sel1 as InstCombine is going to canonicalize to the former anyway.
-
Nikita Popov authored
We handle the case where we have two cases and a default all having different values, but not the case where two cases happen to have the same one. The PhaseOrdering test is a particularly bad example where this showed up.
-
Nikita Popov authored
These are supposed to test creation of a switch, so make sure there is some actual code in the branches. Otherwise this could be turned into a select instead.
-
Aaron Ballman authored
This attempts to resolve an issue found by http://45.33.8.238/macm1/6821/step_6.txt
-
Roman Lebedev authored
This way, once there's an error in the snippet file (like in the test), llvm-exegesis won't crash with an assertion failure, but print a nice diagnostic about the problem.
-
Nikita Popov authored
Also check the case where one operand isn't constant, which isn't handled right now, because the SPF code requires both operands to be ranges. Move the tests to directly check ranges rather than go through an and, to make it more obvious that this has no relation to bitmasks.
-
Roman Lebedev authored
-
Dimitry Andric authored
As FreeBSD already used libc++ before it changed its ABI, we still use the non-trivially copyable version of std::pair, which used to be exposed via `_LIBCPP_TRIVIAL_PAIR_COPY_CTOR`, but more recently via `_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR`. Reviewed By: serge-sans-paille Differential Revision: https://reviews.llvm.org/D99834
-
Butygin authored
[mlir][NFC] Fully spell mlir types names in LoopLikeOpInterface, so it can be used in ops defined outside mlir namespace Differential Revision: https://reviews.llvm.org/D99844
-
Nikita Popov authored
Even if one of the operands is overdefined, we may still produce a non-overdefined result, e.g. due to a min/max operation. This matches our handling elsewhere, e.g. for binary operators. The slot poisoning comment refers to a much older LVI cache implementation.
-
Nikita Popov authored
The and currently doesn't get optimized away because %a is overdefined.
-
Jason Molenda authored
This reverts commit 4d9039c8. This is causing the greendragon bots to fail most of the time when running TestNSDictionarySynthetic.py. Reverting until Jim has a chance to look at this on Monday. Running the commands from that test from the command line, it fails 10-13% of the time on my desktop. This is a revert of Jim's changes in https://reviews.llvm.org/D99694
-
Vitaly Buka authored
The check was removed in D99786 as it seems that quarantine is irrelevant for the just created allocator. However there is internal issues with tagged memory access. We should be able to fix iterateOverChunks for taggin later.
-