- Jan 01, 2021
-
-
Andrew Litteken authored
We outline what the IRSimilarityIdentifier deems GEP Instructions to be similar. In this case, the types must be the same, and the operand values after the first indexing operand must be the exact same. Tests: Removing test/Transforms/IROutliner/illegal-gep.ll Adding test/Transforms/IROutliner/outlining-gep.ll Reviewers: jroelofs, paquette Differential Revision: https://reviews.llvm.org/D87317
-
Jacques Pienaar authored
Enable querying shape function library ops from the module. Currently supports singular or array of them (as long as array has all unique ops in mappings). The preferred canonical form would have one library, but given the invariant on the mapping, this can easily be achieved by a simple merging pass. Preferred the attribute approach vs naming convention as these could be added in multiple different ways.
-
Sanjay Patel authored
This might also make it easier to adapt if we want to match min/max intrinsics rather than cmp+sel idioms. The 'const' part is to potentially avoid confusion in calling code. There's some surprising and possibly wrong behavior related to matching min/max reductions differently than other reductions.
-
Fangrui Song authored
Refactor how -fno-semantic-interposition sets dso_local on default visibility external linkage definitions The idea is that the CC1 default for ELF should set dso_local on default visibility external linkage definitions in the default -mrelocation-model pic mode (-fpic/-fPIC) to match COFF/Mach-O and make output IR similar. The refactoring is made available by 2820a2ca. Currently only x86 supports local aliases. We move the decision to the driver. There are three CC1 states: * -fsemantic-interposition: make some linkages interposable and make default visibility external linkage definitions dso_preemptable. * (default): selected if the target supports .Lfoo$local: make default visibility external linkage definitions dso_local * -fhalf-no-semantic-interposition: if neither option is set or the target does not support .Lfoo$local: like -fno-semantic-interposition but local aliases are not used. So references can be interposed if not optimized out. Add -fhalf-no-semantic-interposition to a few tests using the half-based semantic interposition behavior.
-
Fangrui Song authored
ELF -cc1 -mrelocation-model pic will default to no semantic interposition plus setting dso_local on default visibility external linkage definitions, so that COFF, Mach-O and ELF output will be similar. This patch makes tests immune to the differences.
-
Andrew Litteken authored
Causing multiple different buildbots to fail with similar errors to: http://lab.llvm.org:8011/#/builders/84/builds/3719/ http://lab.llvm.org:8011/#/builders/21/builds/5863/ This reverts commit a2513cb8.
-
Juneyoung Lee authored
-
Andrew Litteken authored
GetElementPtr instructions require the extra check that all operands after the first must only be constants and be exactly the same to be considered similar. Tests are found in unittests/Analysis/IRSimilarityIdentifierTest.cpp.
-
Nuno Lopes authored
-
Juneyoung Lee authored
Recently a few patches are made to move towards using select i1 instead of and/or i1 to represent "a && b"/"a || b" in C/C++. "a && b" in C/C++ does not evaluate b if a is false whereas 'and a, b' in IR evaluates b and uses its result regardless of the result of a. This is problematic because it can cause miscompilation if b was an erroneous operation (https://llvm.org/pr48353). In C/C++, the result is simply false because b is not evaluated, but in IR the result is poison. The discussion at D93065 has more context about this. This patch makes two branch-splitting optimizations (one in SelectionDAGBuilder, one in CodeGenPrepare) recognize select form of and/or as well using m_LogicalAnd/Or. Since it is CodeGen, I think this is semantically ok (at least as safe as what codegen already did). Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D93853
-
Juneyoung Lee authored
This patch makes SCEV recognize 'select A, B, false' and 'select A, true, B'. This is a performance improvement that will be helpful after unsound select -> and/or transformation is removed, as discussed in D93065. SCEV's answers for the select form should be a bit more conservative than the equivalent `and A, B` / `or A, B`. Take this example: https://alive2.llvm.org/ce/z/NsP9ue . To check whether it is valid for SCEV's computeExitLimit to return min(n, m) as ExactNotTaken value, I put llvm.assume at tgt. It fails because the exit limit becomes poison if n is zero and m is poison. This is problematic if e.g. the exit value of i is replaced with min(n, m). If either n or m is constant, we can revive the analysis again. I added relevant tests and put alive2 links there. If and is used instead, this is okay: https://alive2.llvm.org/ce/z/K9rbJk . Hence the existing analysis is sound. Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D93882
-
Atmn authored
This test has %clang in the run line when it should have %clang_cc1. This should prevent future release test failures. Differential Revision: https://reviews.llvm.org/D93952
-
Andrew Litteken authored
When combining extracted functions, they may have different function attributes. We want to make sure that we do not make any assumptions, or lose any information. This attempts to make sure that we consolidate function attributes to their most general case. Tests: llvm/test/Transforms/IROutliner/outlining-compatible-and-attribute-transfer.ll llvm/test/Transforms/IROutliner/outlining-compatible-or-attribute-transfer.ll Reviewers: jdoefert, paquette Differential Revision: https://reviews.llvm.org/D87301
-
Fangrui Song authored
The default value is dependent on `-DLLVM_ENABLE_ASSERTIONS={off,on}` (D22167), which is error-prone. The few tests checking `!thinlto_src_module` can specify -enable-import-metadata explicitly. Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D93959 -
Kazu Hirata authored
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Fangrui Song authored
[ThinLTO][test] Specify -enable-import-metadata to make !thinlto_src_module available in -DLLVM_ENABLE_ASSERTIONS=off mode
-
Fangrui Song authored
Reviewed By: tejohnson Differential Revision: https://reviews.llvm.org/D92899
-
- Dec 31, 2020
-
-
Dávid Bolvanský authored
define i32 @src(i32 %x, i32 %y) { %0: %a = add i32 %x, %y %o = and i32 %x, %y %r = sub i32 %a, %o ret i32 %r } => define i32 @tgt(i32 %x, i32 %y) { %0: %b = or i32 %x, %y ret i32 %b } Transformation seems to be correct! https://alive2.llvm.org/ce/z/2fhW6r -
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
-