- Sep 29, 2020
-
-
Max Kazantsev authored
Currently, we have `isLoopEntryGuardedByCond` method in SCEV, which checks that some fact is true if we enter the loop. In fact, this is just a particular case of more general concept `isBasicBlockEntryGuardedByCond` applied to given loop's header. In fact, the logic if this code is largely independent on the given loop and only cares code above it. This patch makes this generalization. Now we can query it for any block, and `isBasicBlockEntryGuardedByCond` is just a particular case. Differential Revision: https://reviews.llvm.org/D87828 Reviewed By: fhahn
-
Tres Popp authored
This reverts commit 55c4ff91. Issues were introduced as discussed in https://reviews.llvm.org/D88241 where this change made previous bugs in the linker and BitCodeWriter visible.
-
Serguei Katkov authored
Handle the case when all inputs of phi are proven to be non zero. Constants are checked in beginning of this method before check for depth of recursion, so it is a partial case of non-constant phi. Recursion depth is already handled by the function. Reviewers: aqjune, nikic, efriedma Reviewed By: nikic Subscribers: dantrushin, hiraditya, jdoerfert, llvm-commits Differential Revision: https://reviews.llvm.org/D88276
-
Florian Hahn authored
Looks like there is still another remaining issue: http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-msan/builds/22273/steps/build%20libcxx%2Fmsan/logs/stdio This reverts commit 86a20d9e.
-
Florian Hahn authored
This version includes an small fix allowing function pointers to be unconditionally replaced for now. This reverts commit 4c5e4aa8.
-
Sam Parker authored
Add some comments in LowOverheadLoops and make some lambda variables explicit arguments instead of capturing.
-
Ellis Hoag authored
for generating the mangled name of an Objective-C method. This has no intended functionality change. https://reviews.llvm.org/D88329
-
Dmitry Antipov authored
Differential Revision: https://reviews.llvm.org/D87901
-
Craig Topper authored
The number of zeros in the mask provides a lower bound on the number of leading zeros in the result.
-
Craig Topper authored
-
Johannes Doerfert authored
This reverts commit c9420957. One of the tests broke, revert to investigate.
-
Arthur Eubanks authored
Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D88342
-
Max Kazantsev authored
From preconditions it is known that either A dominates B or B dominates A. If A does not dominate B, we do not really need to check it. Assert should be enough. Should save some compile time.
-
Max Kazantsev authored
When removing exiting loop conditions, we only consider checks for which we know the exact exit count. We could also eliminate checks for which the condition is always true/false. Differential Revision: https://reviews.llvm.org/D87344 Reviewed By: lebedev.ri, reames
-
Johannes Doerfert authored
Especially for templates we need to check at some point if the base function matches the specialization we might call instead. Before this lead to the replacement of `std::sqrt(int(2))` calls with one that converts the argument to a `std::complex<int>`, clearly not the desired behavior. Reported as PR47655 Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D88384
-
Kiran Kumar T P authored
Summary: ======== Bugzilla Ticket No: Bug 46884 [https://bugs.llvm.org/show_bug.cgi?id=46884] Flush op assembly syntax was ambiguous: Consider the below test case: flush operation is not having any arguments. But the next statement token i.e "%2" is read as the argument for flush operation and then translator issues an error. *************************************************************** $ cat -n flush.mlir 1 llvm.func @_QQmain(%arg0: !llvm.i32) { 2 %0 = llvm.mlir.constant(1 : i64) : !llvm.i64 3 %1 = llvm.alloca %0 x !llvm.i32 {in_type = i32, name = "a"} : (!llvm.i64) -> !llvm.ptr<i32> 4 omp.flush 5 %2 = llvm.load %1 : !llvm.ptr<i32> 6 llvm.return 7 } $ mlir-translate -mlir-to-llvmir flush.mlir flush.mlir:5:6: error: expected ':' %2 = llvm.load %1 : !llvm.ptr<i32> ^ *************************************************************** Solution: ========= Introduced begin ( `(` ) and end token ( `)` ) to determince the begin and end of variadic arguments. The patch includes code changes and testcase modifications. Reviewed By: Valentin Clement, Mehdi AMINI Differential Revision: https://reviews.llvm.org/D88376
-
Yonghong Song authored
Commit 54d9f743 ("BPF: move AbstractMemberAccess and PreserveDIType passes to EP_EarlyAsPossible") changed most of CORE tests with opt run followed by llc and opt requires the target triple specified in the IR. There are few tests where little endian and big endian will report different result and for little endian versions of tests, "target triple = "bpf"" will produce wrong results if the test executed in a big endian machine, e.g. PowerPC big endian machine, since target "bpf" represents host endian and will resolve to "bpfeb". The builtbot reported such failures when build-and-run on a PowerPC big endian machine. To fix the issue, using "target triple = "bpfel"" instead.
-
Yaxun (Sam) Liu authored
This is part of https://reviews.llvm.org/D60620
-
Yaxun (Sam) Liu authored
Recommit 04abbb3a
-
Amara Emerson authored
Differential Revision: https://reviews.llvm.org/D88437
-
Yaxun (Sam) Liu authored
AMDGPU toolchain does not support -fPIE, therefore skip it if specified by driver. Differential Revision: https://reviews.llvm.org/D88425
-
Valentin Clement authored
Add a basic verifier for the data operation following the restriction from the standard. Reviewed By: kiranchandramohan Differential Revision: https://reviews.llvm.org/D88334
-
Nathan Ridge authored
Fixes https://github.com/clangd/clangd/issues/515 Differential Revision: https://reviews.llvm.org/D87225
-
Mehdi Amini authored
The OmpDialect is in practice optional during translation to LLVM IR: the code is tolerant to have a "nullptr" when not present / needed. The dependency still exists on the export to LLVMIR. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D88351
-
LLVM GN Syncbot authored
-
Richard Smith authored
it has a member whose name is the same as a builtin. Fixes a regression from the introduction of BuiltinAttr.
-
Jan Korous authored
Follow-up to 1e86d637: [clang] Selectively ena/disa-ble format-insufficient-args warning
-
Ruiling Song authored
When extending the subranges, the reaching-def may be an undefs. When extending such kind of subrange, it will try to search for the reaching def first. If the reaching def is an undef and we did not provide 'Undefs', The findReachingDefs() will fail with message: "Use of $noreg does not have a corresponding definition on every path: LLVM ERROR: Use not jointly dominated by defs." So we computeSubRangeUndefs() and pass the result to extendToIndices(). Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D87744
-
Zahira Ammarguellat authored
Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D88150
-
Yonghong Song authored
Move abstractMemberAccess and PreserveDIType passes as early as possible, right after clang code generation. Currently, compiler may transform the above code p1 = llvm.bpf.builtin.preserve.struct.access(base, 0, 0); p2 = llvm.bpf.builtin.preserve.struct.access(p1, 1, 2); a = llvm.bpf.builtin.preserve_field_info(p2, EXIST); if (a) { p1 = llvm.bpf.builtin.preserve.struct.access(base, 0, 0); p2 = llvm.bpf.builtin.preserve.struct.access(p1, 1, 2); bpf_probe_read(buf, buf_size, p2); } to p1 = llvm.bpf.builtin.preserve.struct.access(base, 0, 0); p2 = llvm.bpf.builtin.preserve.struct.access(p1, 1, 2); a = llvm.bpf.builtin.preserve_field_info(p2, EXIST); if (a) { bpf_probe_read(buf, buf_size, p2); } and eventually assembly code looks like reloc_exist = 1; reloc_member_offset = 10; //calculate member offset from base p2 = base + reloc_member_offset; if (reloc_exist) { bpf_probe_read(bpf, buf_size, p2); } if during libbpf relocation resolution, reloc_exist is actually resolved to 0 (not exist), reloc_member_offset relocation cannot be resolved and will be patched with illegal instruction. This will cause verifier failure. This patch attempts to address this issue by do chaining analysis and replace chains with special globals right after clang code gen. This will remove the cse possibility described in the above. The IR typically looks like %6 = load @llvm.sk_buff:0:50$0:0:0:2:0 %7 = bitcast %struct.sk_buff* %2 to i8* %8 = getelementptr i8, i8* %7, %6 for a particular address computation relocation. But this transformation has another consequence, code sinking may happen like below: PHI = <possibly different @preserve_*_access_globals> %7 = bitcast %struct.sk_buff* %2 to i8* %8 = getelementptr i8, i8* %7, %6 For such cases, we will not able to generate relocations since multiple relocations are merged into one. This patch introduced a passthrough builtin to prevent such optimization. Looks like inline assembly has more impact for optimizaiton, e.g., inlining. Using passthrough has less impact on optimizations. A new IR pass is introduced at the beginning of target-dependent IR optimization, which does: - report fatal error if any reloc global in PHI nodes - remove all bpf passthrough builtin functions Changes for existing CORE tests: - for clang tests, add "-Xclang -disable-llvm-passes" flags to avoid builtin->reloc_global transformation so the test is still able to check correctness for clang generated IR. - for llvm CodeGen/BPF tests, add "opt -O2 <ir_file> | llvm-dis" command before "llc" command since "opt" is needed to call newly-placed builtin->reloc_global transformation. Add target triple in the IR file since "opt" requires it. - Since target triple is added in IR file, if a test may produce different results for different endianness, two tests will be created, one for bpfeb and another for bpfel, e.g., some tests for relocation of lshift/rshift of bitfields. - field-reloc-bitfield-1.ll has different relocations compared to old codes. This is because for the structure in the test, new code returns struct layout alignment 4 while old code is 8. Align 8 is more precise and permits double load. With align 4, the new mechanism uses 4-byte load, so generating different relocations. - test intrinsic-transforms.ll is removed. This is used to test cse on intrinsics so we do not lose metadata. Now metadata is attached to global and not instruction, it won't get lost with cse. Differential Revision: https://reviews.llvm.org/D87153 -
David Tenty authored
Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D88182
-
ogiroux authored
-
Diego Caballero authored
Adding missing code that should have been part of "D85869: Utility to vectorize loop nest using strategy." Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D88346
-
Kostya Kortchinsky authored
`atomic_compare_exchange_weak` is unused in Scudo, and its associated test is actually wrong since the weak variant is allowed to fail spuriously (thanks Roland). This lead to flakes such as: ``` [ RUN ] ScudoAtomicTest.AtomicCompareExchangeTest ../../zircon/third_party/scudo/src/tests/atomic_test.cpp:98: Failure: Expected atomic_compare_exchange_weak(reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) is true. Expected: true Which is: 01 Actual : atomic_compare_exchange_weak(reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) Which is: 00 ../../zircon/third_party/scudo/src/tests/atomic_test.cpp:100: Failure: Expected atomic_compare_exchange_weak( reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) is false. Expected: false Which is: 00 Actual : atomic_compare_exchange_weak( reinterpret_cast<T *>(&V), &OldVal, NewVal, memory_order_relaxed) Which is: 01 ../../zircon/third_party/scudo/src/tests/atomic_test.cpp:101: Failure: Expected OldVal == NewVal. Expected: NewVal Which is: 24 Actual : OldVal Which is: 42 [ FAILED ] ScudoAtomicTest.AtomicCompareExchangeTest (0 ms) [----------] 2 tests from ScudoAtomicTest (1 ms total) ``` So I am removing this, if someone ever needs the weak variant, feel free to add it back with a test that is not as terrible. This test was initially ported from sanitizer_common, but their weak version calls the strong version, so it works for them. Differential Revision: https://reviews.llvm.org/D88443 -
Jan Korous authored
Differential Revision: https://reviews.llvm.org/D87176
-
Mehdi Amini authored
Guard `find_library(tensorflow_c_api ...)` by checking for TENSORFLOW_C_LIB_PATH to be set by the user Also have CMake fails if the user provides a TENSORFLOW_C_LIB_PATH but we can't find TensorFlow at this path. At the moment the CMake script tries to figure if TensorFlow is available on the system and enables support for it. This is in general not desirable to customize build features this way and instead it is preferable to let the user opt-in explicitly into the features they want to enable. This is in line with other optional external dependencies like Z3. There are a few reasons to this but amongst others: - reproducibility: making features "magically" enabled based on whether we find a package on the system or not makes it harder to handle bug reports from users. - user control: they can't have TensorFlow on the system and build LLVM without TensorFlow right now. They also would suddenly distribute LLVM with a different set of features unknowingly just because their build machine environment would change subtly. Right now this is motivated by a user reporting build failures on their system: .../mesa-git/llvm-git/src/llvm-project/llvm/lib/Analysis/TFUtils.cpp:23:10: fatal error: tensorflow/c/c_api.h: No such file or directory 23 | #include "tensorflow/c/c_api.h" | ^~~~~~ It looks like we detected TensorFlow at configure time but couldn't set all the paths correctly. Differential Revision: https://reviews.llvm.org/D88371 -
Philip Reames authored
For a call site which had both constant deopt operands and nonnull arguments, we were missing the opportunity to recognize the later by bailing early. This is somewhat of a speculative fix. Months ago, I'd had a private report of performance and compile time regressions from the deopt operand folding. I never received a test case. However, the only possibility I see was that after that change CVP missed the nonnull fold, and we end up with a pass ordering/missed simplification issue. So, since it's a real issue, fix it and hope.
-
Fangrui Song authored
(Note that EMStreamer.cpp is largely under tested. The only test checking the prefix sharing is CodeGen/WebAssembly/eh-lsda.ll)
-
Sean Silva authored
- use select-ops to make the lowering simpler - change style of FileCheck variables names to be consistent - change some variable names in the code to be more explicit Differential Revision: https://reviews.llvm.org/D88258
-
Petr Hosek authored
This flag is the default in libtool on Darwin, and it's not supported by llvm-libtool-darwin causing a build failure. Differential Revision: https://reviews.llvm.org/D88449
-