- Jul 18, 2020
-
-
Roman Lebedev authored
Yes, if operands are non-positive this comes at the extra cost of two extra negations. But a. division is already just ridiculously costly, two more subtractions can't hurt much :) and b. we have better/more analyzes/folds for an unsigned division, we could end up narrowing it's bitwidth, converting it to lshr, etc. This is essentially a take two on 0fdcca07, which didn't fix the potential regression i was seeing, because ValueTracking's computeKnownBits() doesn't make use of dominating conditions in it's analysis. While i could teach it that, this seems like the more general fix. This big hammer actually does catch said potential regression. Over vanilla test-suite + RawSpeed + darktable (10M IR instrs, 1M IR BB, 1M X86 ASM instrs), this fires/converts 5 more (+2%) SDiv's, the total instruction count at the end of middle-end pipeline is only +6, so out of +10 extra negations, ~half are folded away, and asm instr count is only +1, so practically speaking all extra negations are folded away and are therefore free. Sadly, all these new UDiv's remained, none folded away. But there are two less basic blocks. https://rise4fun.com/Alive/VS6 Name: v0 Pre: C0 >= 0 && C1 >= 0 %r = sdiv i8 C0, C1 => %r = udiv i8 C0, C1 Name: v1 Pre: C0 <= 0 && C1 >= 0 %r = sdiv i8 C0, C1 => %t0 = udiv i8 -C0, C1 %r = sub i8 0, %t0 Name: v2 Pre: C0 >= 0 && C1 <= 0 %r = sdiv i8 C0, C1 => %t0 = udiv i8 C0, -C1 %r = sub i8 0, %t0 Name: v3 Pre: C0 <= 0 && C1 <= 0 %r = sdiv i8 C0, C1 => %r = udiv i8 -C0, -C1
-
Roman Lebedev authored
-
Roman Lebedev authored
-
Roman Lebedev authored
Currently that fold requires both operands to be non-negative, but the only real requirement for the fold is that we must know the domains of the operands.
-
Matt Arsenault authored
-
Matt Arsenault authored
-
David Green authored
-
Evgeny Leviant authored
Patch adds tti pass directly enforcing its execution with correctly set TargetTransformInfo. Differential revision: https://reviews.llvm.org/D84047
-
Vitaly Buka authored
-
Yash Jain authored
Add lowering conversion from affine.parallel to scf.parallel. Differential Revision: https://reviews.llvm.org/D83239
-
Fangrui Song authored
Code from D83800 by Yichao Yu
-
Fangrui Song authored
This suppresses `failed to compute relocation: R_PPC_REL32, Invalid data was encountered while parsing the file` and its 64-bit variants when running llvm-dwarfdump on a PowerPC object file with .eh_frame Unfortunately it is difficult to test the computation: DWARFDataExtractor::getEncodedPointer does not use the relocated value and even if it does, we need to teach llvm-dwarfdump --eh-frame to do some linker job to report a reasonable address.
-
Gui Andrade authored
-
Gui Andrade authored
This was committed mistakenly. This reverts commit 1f29171a.
-
Gui Andrade authored
-
Gui Andrade authored
This allows treating these functions like libcalls. This patch is a prerequisite to instrumenting them in MSAN: https://reviews.llvm.org/D83337 Differential Revision: https://reviews.llvm.org/D83361
-
Gui Andrade authored
Also adds a sanitizers-wide test, and a msan test, for these functions.
-
Chen Zheng authored
-
Chen Zheng authored
Recommit after removing the unused cast instructions. Differential Revision: https://reviews.llvm.org/D80975
-
Joel E. Denny authored
For example, without this patch: ``` $ cat test.c int main() { int x[3]; #pragma omp target map(tofrom:x[0:3]) #ifdef USE x[0] = 1 #endif ; return 0; } $ clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -S -emit-llvm test.c $ grep '^@.offload_maptypes' test.ll $ echo $? 1 $ clang -fopenmp -fopenmp-targets=nvptx64-nvidia-cuda -S -emit-llvm test.c \ -DUSE $ grep '^@.offload_maptypes' test.ll @.offload_maptypes = private unnamed_addr constant [1 x i64] [i64 35] ``` With this patch, both greps produce the same result. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D83922 -
Vitaly Buka authored
The incorrect symbol will cause linking failures for 32-bit targets: clang_rt.fuzzer-i386.lib(FuzzerDriver.obj) : error LNK2001: unresolved external symbol __libfuzzer_is_present Verified no longer fails to link with this change for 32-bit and still succeeds for 64-bit MSVC. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D83594
-
Arthur Eubanks authored
Under NPM, the asan-globals-md analysis is required but cannot be run within the asan function pass due to module analyses not being able to run from a function pass. So this pins all tests using "-asan" to the legacy PM and adds a corresponding RUN line with -passes='require<asan-globals-md>,function(asan)'. Now all tests in Instrumentation/AddressSanitizer pass when -enable-new-pm is by default on. Tests were automatically converted using the following python script and failures were manually fixed up. import sys for i in sys.argv: with open(i, 'r') as f: s = f.read() with open(i, 'w') as f: for l in s.splitlines(): if "RUN:" in l and ' -asan -asan-module ' in l and '\\' not in l: f.write(l.replace(' -asan -asan-module ', ' -asan -asan-module -enable-new-pm=0 ')) f.write('\n') f.write(l.replace(' -asan -asan-module ', " -passes='require<asan-globals-md>,function(asan),module(asan-module)' ")) f.write('\n') elif "RUN:" in l and ' -asan ' in l and '\\' not in l: f.write(l.replace(' -asan ', ' -asan -enable-new-pm=0 ')) f.write('\n') f.write(l.replace(' -asan ', " -passes='require<asan-globals-md>,function(asan)' ")) f.write('\n') else: f.write(l) f.write('\n') See https://bugs.llvm.org/show_bug.cgi?id=46611. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D83921 -
Lang Hames authored
This enables regression testing of GOT and stub handling with llvm-jitlink.
-
Kuba Mracek authored
This is needed because macOS on Apple Silicon has some reserved pages inside the "regular" shadow memory location, and mapping over that location fails. Differential Revision: https://reviews.llvm.org/D82912
-
Logan Smith authored
-
Logan Smith authored
-
Logan Smith authored
-
Vitaly Buka authored
Now we are going to pick name and index based on output of getprotoent_r.
-
peter klausler authored
The runtime was requiring that STATUS='OLD' be explicitly specified on an OPEN statement for a connected unit. There error should issue only if a STATUS= other than 'OLD' is specified; an OPEN with no STATUS= specifier is okay. Reviewed By: sscalpone Differential Revision: https://reviews.llvm.org/D84079
-
peter klausler authored
Reviewed By: sscalpone Differential Revision: https://reviews.llvm.org/D84078
-
peter klausler authored
Accept name=value as part of a !DIR$ compiler directive. These are currently ignored in semantics, but we should recognize more directive forms to facilitate testing. In due course, these placeholding directive parsers will be replaced. Reviewed By: sscalpone Differential Revision: https://reviews.llvm.org/D84077
-
Arthur Eubanks authored
This reverts commit 30c382a7. See https://crbug.com/1106813.
-
Michele Scandale authored
The `intrinsics_gen` target exists in the CMake exports since r309389 (see LLVMConfig.cmake.in), hence projects can depend on `intrinsics_gen` even it they are built separately from LLVM. Reviewed By: MaskRay, JDevlieghere Differential Revision: https://reviews.llvm.org/D83454
-
Aditya Nandakumar authored
https://reviews.llvm.org/D84072 Add G_EXTRACT to CSEConfigFull and add unit test as well.
-
Leonard Chan authored
This reverts commit d76e62fd. Reverting since this can lead to linker errors: ``` ld.lld: error: undefined hidden symbol: __start_asan_globals ``` when using --gc-sections. The linker can discard __start_asan_globals once there are no more `asan_globals` sections left, which can lead to this error if we have external linkages to them.
-
peter klausler authored
Old-style C /*comments*/ are omitted from preprocessor directive token sequences by the prescanner, but line-ending C++ and Fortran free-form comments are not since their handling might depend on the directive. Add code to skip these line-ending comments as appropriate in place of existing code that just skipped blanks. Reviewed By: sscalpone Differential Revision: https://reviews.llvm.org/D84061
-
AndreyChurbanov authored
hwloc documentation guarantees the only object that is always present in the topology is PU. We can check the presence of other objects in the topology, just in case. Differential Revision: https://reviews.llvm.org/D84065
-
Michael Spencer authored
In clang <3.9 the `unique_ptr` constructor that is supposed to allow for Derived to Base conversion does not work. Remove this if we drop support for such configurations. This is the same fix as in fda901a9, and it updates the comments to better reflect the actual issue. The same thing reproduces with libc++ with older clangs.
-
Eric Christopher authored
as it's causing a few unused variable warnings via the macro instantiation: sources/llvm-project/llvm/include/llvm/Frontend/OpenMP/OMPKinds.def:649:17: error: unused variable 'InaccessibleOnlyAttrs' [-Werror,-Wunused-variable] __OMP_ATTRS_SET(InaccessibleOnlyAttrs, ^ This reverts commit 09fe0c5a. -
Eric Christopher authored
Temporarily Revert "[InlineAdvisor] New inliner advisor to replay inlining from optimization remarks" as it is failing the inline-replay.ll test as well as sanitizers/Werror from returning a stack local variable. This reverts commit 029946b1.
-