- Apr 05, 2021
-
-
Alexey Bataev authored
During vectorization better to postpone the vectorization of the CmpInst instructions till the end of the basic block. Otherwise we may vectorize it too early and may miss some vectorization patterns, like reductions. Reworked part of D57059 Differential Revision: https://reviews.llvm.org/D99796
-
Paul C. Anagnostopoulos authored
Differential Revision: https://reviews.llvm.org/D99800
-
Alex Orlov authored
This patch introduces a DIPrinter interface to implement by different output style printer implementations. DIPrinterGNU and DIPrinterLLVM implement the GNU and LLVM output style printing respectively. No functional changes. This refactoring clarifies and simplifies the code, and makes a new output style addition easier. Reviewed By: jhenderson, dblaikie Differential Revision: https://reviews.llvm.org/D98994
-
Fraser Cormack authored
This patch adds a test which shows how the compiler incorrectly sets the size and alignment of a stack object used to indirectly pass vector types to functions. In the particular example, the test passes a <4 x i8> vector type to a function and creates a stack object of size and alignment equal to 4 bytes. However, the code generated to set up that parameter has been scalarized and stores each element as individual XLEN-sized values. Thus on RV32 this stores 16 bytes and on RV64 32 bytes, both of which clobber the stack. Similarly, the alignment is set up as the alignment of the vector type, which is not necessarily the natural alignment of XLEN. Reviewed By: luismarques Differential Revision: https://reviews.llvm.org/D95025
-
Simon Pilgrim authored
Fixes PR47603 (second case) by extending rG89afec34
-
Simon Pilgrim authored
We had coverage for the xor(trunc(xor(x,31)),31) case but not xor(zext(xor(x,31)),31)
-
Thomas Preud'homme authored
Clang test CodeGen/debug-info-extern-call.c tries to check for the absence of a sequence of instructions with several CHECK-NOT with one of those directives using a variable defined in another. However CHECK-NOT are checked independently so that is using a variable defined in a pattern that should not occur in the input. This commit removes the CHECK-NOT for the retained line attribute definition since the CHECK-NOT on the compile unit will already check that there is no retained lines. Reviewed By: djtodoro Differential Revision: https://reviews.llvm.org/D99830
-
Josh Berdine authored
The removal of CAMLprim left the code in need of an application of clang-format. There are various other changes made by clang-format which it seems ought to be rolled together into this diff. Differential Revision: https://reviews.llvm.org/D99477
-
Josh Berdine authored
The CAMLprim macro has not been needed since OCaml 3.11, and is defined to the empty string. This diff removes all instances of it. Differential Revision: https://reviews.llvm.org/D99476
-
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
-