- Dec 31, 2020
-
-
Dávid Bolvanský authored
-
Dávid Bolvanský authored
define i32 @src(i32 %x, i32 %y) { %0: %a = add i32 %x, %y %o = or i32 %x, %y %r = sub i32 %a, %o ret i32 %r } => define i32 @tgt(i32 %x, i32 %y) { %0: %b = and i32 %x, %y ret i32 %b } Transformation seems to be correct! https://alive2.llvm.org/ce/z/aQRh2j -
Dávid Bolvanský authored
-
Bogdan Graur authored
Test clang/test/Misc/loop-opt-setup.c fails when executed in Release. This reverts commit 6f1503d5. Reviewed By: SureYeaah Differential Revision: https://reviews.llvm.org/D93956
-
Bogdan Graur authored
Both newly added tests fail in Release. This reverts commit 52aa4e21. Reviewed By: SureYeaah Differential Revision: https://reviews.llvm.org/D93957
-
Nuno Lopes authored
-
Fangrui Song authored
-
Fangrui Song authored
Several `#if SANITIZER_LINUX && !SANITIZER_ANDROID` guards are replaced with the more appropriate `#if SANITIZER_GLIBC` (the headers are glibc extensions, not specific to Linux (i.e. if we ever support GNU/kFreeBSD or Hurd, the guards may automatically work)). Several `#if SANITIZER_LINUX && !SANITIZER_ANDROID` guards are refined with `#if SANITIZER_GLIBC` (the definitions are available on Linux glibc, but may not be available on other libc (e.g. musl) implementations). This patch makes `ninja asan cfi msan stats tsan ubsan xray` build on a musl based Linux distribution (apk install musl-libintl) Notes about disabled interceptors for musl: * `SANITIZER_INTERCEPT_GLOB`: musl does not implement `GLOB_ALTDIRFUNC` (GNU extension) * Some ioctl structs and functions operating on them. * `SANITIZER_INTERCEPT___PRINTF_CHK`: `_FORTIFY_SOURCE` functions are GNU extension * `SANITIZER_INTERCEPT___STRNDUP`: `dlsym(RTLD_NEXT, "__strndup")` errors so a diagnostic is formed. The diagnostic uses `write` which hasn't been intercepted => SIGSEGV * `SANITIZER_INTERCEPT_*64`: the `_LARGEFILE64_SOURCE` functions are glibc specific. musl does something like `#define pread64 pread` * Disabled `msg_iovlen msg_controllen cmsg_len` checks: musl is conforming while many implementations (Linux/FreeBSD/NetBSD/Solaris) are non-conforming. Since we pick the glibc definition, exclude the checks for musl (incompatible sizes but compatible offsets) Pass through LIBCXX_HAS_MUSL_LIBC to make check-msan/check-tsan able to build libc++ (https://bugs.llvm.org/show_bug.cgi?id=48618). Many sanitizer features are available now. ``` % ninja check-asan (known issues: * ASAN_OPTIONS=fast_unwind_on_malloc=0 odr-violations hangs ) ... Testing Time: 53.69s Unsupported : 185 Passed : 512 Expectedly Failed: 1 Failed : 12 % ninja check-ubsan check-ubsan-minimal check-memprof # all passed % ninja check-cfi ( all cross-dso/) ... Testing Time: 8.68s Unsupported : 264 Passed : 80 Expectedly Failed: 8 Failed : 32 % ninja check-msan (Many are due to functions not marked unsupported.) Testing Time: 23.09s Unsupported : 6 Passed : 764 Expectedly Failed: 2 Failed : 58 % ninja check-tsan Testing Time: 23.21s Unsupported : 86 Passed : 295 Expectedly Failed: 1 Failed : 25 ``` Used `ASAN_OPTIONS=verbosity=2` to verify no unneeded interceptors. Partly based on Jari Ronkainen's https://reviews.llvm.org/D63785#1921014 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D93848
-
Fangrui Song authored
For a default visibility external linkage definition, dso_local is set for ELF -fno-pic/-fpie and COFF and Mach-O. Since default clang -cc1 for ELF is similar to -fpic ("PIC Level" is not set), this nuance causes unneeded binary format differences. To make emitted IR similar, ELF -cc1 -fpic will default to -fno-semantic-interposition, which sets dso_local for default visibility external linkage definitions. To make this flip smooth and enable future (dso_local as definition default), this patch replaces (function) `define ` with `define{{.*}} `, (variable/constant/alias) `= ` with `={{.*}} `, or inserts appropriate `{{.*}} `. -
Fangrui Song authored
-
Juneyoung Lee authored
File listed by: grep -R -E "^[^;]*shufflevector <.*> .*, <.*> undef" . | grep inseltpoison Updated with: sed -i -E 's/shufflevector <(.*)> (.*), <(.*)> undef/shufflevector <\1> \2, <\3> poison/g' $1
-
Stella Laurenzo authored
-
Stella Laurenzo authored
* Works in tandem with prototype packaging scripts here: https://github.com/stellaraccident/mlir-py-release * The `mlir` top-level now differentiates between in-tree builds where all packages are co-located and distribution mode where all native components are under a top-level `_mlir_libs` package. * Also fixes the generated dialect python installation again. Hopefully the last tweak. * With this, I am able to install and generate archives with the above setup script on Linux. Archive size=31M with just host codegen and headers/shared-libraries. Will need more linker tweaks when wiring up the next dependent project. Differential Revision: https://reviews.llvm.org/D93936
-
Thorsten Schütt authored
-
Luo, Yuanke authored
Differential Revision: https://reviews.llvm.org/D92837
-
Fangrui Song authored
* static relocation model: always * other relocation models: if isStrongDefinitionForLinker This will make LLVM IR emitted for COFF/Mach-O and executable ELF similar.
-
Fangrui Song authored
For a definition (of most linkage types), dso_local is set for ELF -fno-pic/-fpie and COFF, but not for Mach-O. This nuance causes unneeded binary format differences. This patch replaces (function) `define ` with `define{{.*}} `, (variable/constant/alias) `= ` with `={{.*}} `, or inserts appropriate `{{.*}} ` if there is an explicit linkage. * Clang will set dso_local for Mach-O, which is currently implied by TargetMachine.cpp. This will make COFF/Mach-O and executable ELF similar. * Eventually I hope we can make dso_local the textual LLVM IR default (write explicit "dso_preemptable" when applicable) and -fpic ELF will be similar to everything else. This patch helps move toward that goal. -
Monk Chiang authored
Define intrinsics: 1. vfcvt.xu.f.v/vfcvt.x.f.v 2. vfcvt.rtz.xu.f.v/vfcvt.rtz.x.f.v 3. vfcvt.f.xu.v/vfcvt.f.x.v We work with @rogfer01 from BSC to come out this patch. Authored-by:
Roger Ferrer Ibanez <rofirrim@gmail.com> Co-Authored-by:
Monk Chiang <monk.chiang@sifive.com> Differential Revision: https://reviews.llvm.org/D93933
-
Monk Chiang authored
Define intrinsics: 1. vfncvt.xu.f.w/vfncvt.x.f.w 2. vfncvt.rtz.xu.f.w/vfncvt.rtz.x.f.w 3. vfncvt.f.xu.w/vfncvt.f.x.w 4. vfncvt.f.f.w/vfncvt.rod.f.f.w We work with @rogfer01 from BSC to come out this patch. Authored-by:
Roger Ferrer Ibanez <rofirrim@gmail.com> Co-Authored-by:
Monk Chiang <monk.chiang@sifive.com> Differential Revision: https://reviews.llvm.org/D93932
-
Monk Chiang authored
Define intrinsics: 1. vfwcvt.xu.f.v/vfwcvt.x.f.v 2. vfwcvt.rtz.xu.f.v/vfwcvt.rtz.x.f.v 3. vfwcvt.f.xu.v/vfwcvt.f.x.v 4. vfwcvt.f.f.v We work with @rogfer01 from BSC to come out this patch. Authored-by:
Roger Ferrer Ibanez <rofirrim@gmail.com> Co-Authored-by:
Monk Chiang <monk.chiang@sifive.com> Differential Revision: https://reviews.llvm.org/D93855
-
Monk Chiang authored
Add vfredosum/vfredsum/vwredsum/vwredsumu testcase. Differential Revision: https://reviews.llvm.org/D93887
-
Vitaly Buka authored
This makes suppression list to work similar to __lsan_ignore_object. Existing behavior was inconsistent and very inconvenient for complex data structures. Example: struct B; struct A { B* ptr; }; A* t = makeA(); t->ptr = makeB(); Before the patch: if makeA suppressed by suppression file, lsan will still report the makeB() leak, so we need two suppressions. After the patch: a single makeA suppression is enough (the same as a single __lsan_ignore_object(t)). Differential Revision: https://reviews.llvm.org/D93884 -
Fangrui Song authored
When building abseil-cpp `bin/absl_hash_test` with Clang in -fno-pic mode, an instruction like `movl $foo-2147483648, $eax` may be produced (subtracting a number from the address of a static variable). If foo's address is smaller than 2147483648, GNU ld/gold/LLD will error because R_X86_64_32 cannot represent a negative value. ``` using absl::Hash; struct NoOp { template < typename HashCode > friend HashCode AbslHashValue(HashCode , NoOp ); }; template <typename> class HashIntTest : public testing::Test {}; TYPED_TEST_SUITE_P(HashIntTest); TYPED_TEST_P(HashIntTest, BasicUsage) { if (std::numeric_limits< TypeParam >::min ) EXPECT_NE(Hash< NoOp >()({}), Hash< TypeParam >()(std::numeric_limits< TypeParam >::min())); } REGISTER_TYPED_TEST_CASE_P(HashIntTest, BasicUsage); using IntTypes = testing::Types< int32_t>; INSTANTIATE_TYPED_TEST_CASE_P(My, HashIntTest, IntTypes); ld: error: hash_test.cc:(function (anonymous namespace)::gtest_suite_HashIntTest_::BasicUsage<int>::TestBody(): .text+0x4E472): relocation R_X86_64_32 out of range: 18446744071564237392 is not in [0, 4294967295]; references absl::hash_internal::HashState::kSeed ``` Actually any negative offset is not allowed because the symbol address can be zero (e.g. set by `-Wl,--defsym=foo=0`). So disallow such folding. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D93931 -
Atmn Patel authored
From C11 and C++11 onwards, a forward-progress requirement has been introduced for both languages. In the case of C, loops with non-constant conditionals that do not have any observable side-effects (as defined by 6.8.5p6) can be assumed by the implementation to terminate, and in the case of C++, this assumption extends to all functions. The clang frontend will emit the `mustprogress` function attribute for C++ functions (D86233, D85393, D86841) and emit the loop metadata `llvm.loop.mustprogress` for every loop in C11 or later that has a non-constant conditional. This patch modifies LoopDeletion so that only loops with the `llvm.loop.mustprogress` metadata or loops contained in functions that are required to make progress (`mustprogress` or `willreturn`) are checked for observable side-effects. If these loops do not have an observable side-effect, then we delete them. Loops without observable side-effects that do not satisfy the above conditions will not be deleted. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D86844
-
Nico Weber authored
These are new in Xcode 12's ld64. lld never codesigns at the moment, so -no_adhoc_codesign doesn't even have to warn that it's not implemented.
-
Kazu Hirata authored
The last use of the function, located in RemovePredecessorAndSimplify, was removed on Dec 25, 2020 in commit 46bea9b2. The last use of RemovePredecessorAndSimplify was removed on Sep 29, 2010 in commit 99c985c3.
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Fangrui Song authored
Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D92899
-
Fangrui Song authored
TargetMachine::shouldAssumeDSOLocal currently implies dso_local for such definitions. Since clang -fno-pic add the dso_local specifier, we don't need to special case.
-
Fangrui Song authored
-
Fangrui Song authored
This effect is not testable until we drop the implied dso_local for ELF static/PIE defined symbols from TargetMachine::shouldAssumeDSOLocal.
-
Fangrui Song authored
-
Lang Hames authored
-
Fangrui Song authored
-
Fangrui Song authored
-
Fangrui Song authored
TargetMachine::shouldAssumeDSOLocal currently implies dso_local for such definitions. Adding explicit dso_local makes these tests align with the clang -fno-pic behavior and allow the removal of the TargetMachine::shouldAssumeDSOLocal special case.
-
Fangrui Song authored
TargetMachine::shouldAssumeDSOLocal currently implies dso_local for such definitions. Adding explicit dso_local makes these tests align with the clang -fno-pic behavior and allow the removal of the TargetMachine::shouldAssumeDSOLocal special case. Split tiny_model.ll to tiny-model-{static,pic}.ll -
Fangrui Song authored
-
Fangrui Song authored
TargetMachine::shouldAssumeDSOLocal currently implies dso_local for such definitions. Adding explicit dso_local makes these tests align with the clang -fno-pic behavior and allow the removal of the TargetMachine::shouldAssumeDSOLocal special case.
-