- May 04, 2021
-
-
Arthur Eubanks authored
Previously, any change in any function in an SCC would cause all analyses for all functions in the SCC to be invalidated. With this change, we now manually invalidate analyses for functions we modify, then let the pass manager know that all function analyses should be preserved. So far this only touches the inliner, argpromotion, funcattrs, and updateCGAndAnalysisManager(), since they are the most used. Slight compile time improvements: http://llvm-compile-time-tracker.com/compare.php?from=326da4adcb8def2abdd530299d87ce951c0edec9&to=8942c7669f330082ef159f3c6c57c3c28484f4be&stat=instructions Reviewed By: mtrofin Differential Revision: https://reviews.llvm.org/D100917
-
Sam Clegg authored
Two of these are trivial. The third (shared.s) did have some expectations changes but only due to two data symbols being re-ordered. Differential Revision: https://reviews.llvm.org/D101711
-
Raman Tenneti authored
[libc] Introduce asctime, asctime_r to LLVM libc asctime and asctime_r share the same common code. They call asctime_internal a static inline function. asctime uses snprintf to return the string representation in a buffer. It uses the following format (26 characters is the buffer size) as per 7.27.3.1 section in http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2478.pdf. The buf parameter for asctime_r shall point to a buffer of at least 26 bytes. snprintf(buf, 26, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",...) Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D99686
-
LLVM GN Syncbot authored
-
Tomasz Miąsko authored
Add a demangling support for a small subset of a new Rust mangling scheme, with complete support planned as a follow up work. Intergate Rust demangling into llvm-cxxfilt and use llvm-cxxfilt for end-to-end testing. The new Rust mangling scheme uses "_R" as a prefix, which makes it easy to disambiguate it from other mangling schemes. The public API is modeled after __cxa_demangle / llvm::itaniumDemangle, since potential candidates for further integration use those. Reviewed By: dblaikie Differential Revision: https://reviews.llvm.org/D101444
-
Sam Clegg authored
When running in relocatable mode any input data segments that are part of a comdat group should not be merged with other segments of the same name. This is because the final linker needs to keep the separate so they can be included/excluded individually. Often this is not a problem since normally only one section with a given name `foo` ends up in the output object file. However, the problem occurs when one input contains `foo` which part of a comdat and another object contains a local symbol `foo` we were attempting to merge them. This behaviour matches (I believe) that of the ELF linker. See `LinkerScript.cpp:addInputSec`. Fixes: https://github.com/emscripten-core/emscripten/issues/9726 Differential Revision: https://reviews.llvm.org/D101703
-
Philip Reames authored
This was reverted because of a reported problem. It turned out this patch didn't introduce said problem, it just exposed it more widely. 15a42339 fixes the root issue, so this simple a) rebases over that, and b) adds a much more extensive comment explaining why that weakened assert is correct. Original commit message follows: Follow up to D99912, specifically the revert, fix, and reapply thereof. This generalizes the invertible recurrence logic in two ways: * By allowing mismatching operand numbers of the phi, we can recurse through a pair of phi recurrences whose operand orders have not been canonicalized. * By allowing recurrences through operand 1, we can invert these odd (but legal) recurrence. Differential Revision: https://reviews.llvm.org/D100884
-
Arthur Eubanks authored
GlobalsAA is only created at the beginning of the inliner pipeline. If an AAManager is cached from previous passes, it won't get rebuilt to include the newly created GlobalsAA. Reviewed By: mtrofin Differential Revision: https://reviews.llvm.org/D101379
-
Joseph Huber authored
Summary: Add the AAExecutionDomainInfo attributor instance to OpenMPOpt. This will infer information relating to domain information that an instruction might be expecting in. Right now this only includes a very crude check for instructions that will be executed by the master thread by comparing a thread-id function with a constant zero. Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D101578
-
Philip Reames authored
-
Eugene Zhulenev authored
This fixes a performance regression in vec-mat vectorization Reviewed By: asaadaldien Differential Revision: https://reviews.llvm.org/D101795
-
Peyton, Jonathan L authored
This patch does the following: 1) Introduce kmp_topology_t as the runtime-friendly structure (the corresponding global variable is __kmp_topology) to determine the exact machine topology which can vary widely among current and future architectures. The current design is not easy to expand beyond the assumed three layer topology: sockets, cores, and threads so a rework capable of using the existing KMP_AFFINITY mechanisms is required. This new topology structure has: * The depth and types of the topology * Ratio count for each consecutive level (e.g., number of cores per socket, number of threads per core) * Absolute count for each level (e.g., 2 sockets, 16 cores, 32 threads) * Equivalent topology layer map (e.g., Numa domain is equivalent to socket, L1/L2 cache equivalent to core) * Whether it is uniform or not The hardware threads are represented with the kmp_hw_thread_t structure. This structure contains the ids (e.g., socket 0, core 1, thread 0) and other information grabbed from the previous Address structure. The kmp_topology_t structure contains an array of these. 2) Generalize the KMP_HW_SUBSET envirable for the new kmp_topology_t structure. The algorithm doesn't assume any order with tiles,numa domains,sockets,cores,threads. Instead it just parses the envirable, makes sure it is consistent with the detected topology (including taking into account equivalent layers) and then trims away the unneeded subset of hardware threads. To enable this, a new kmp_hw_subset_t structure is introduced which contains a vector of items (hardware type, number user wants, offset). Any keyword within __kmp_hw_get_keyword() can be used as a name and can be shortened as well. e.g., KMP_HW_SUBSET=1s,2numa,4tile,2c,3t can be used on the KNL SNC-4 machine. 3) Simplify topology detection functions so they only do the singular task of detecting the machine's topology. Printing, and all canonicalizing functionality is now done afterwards. So many lines of duplicated code are eliminated. 4) Add new ll_caches and numa_domains to OMP_PLACES, and consequently, KMP_AFFINITY's granularity setting. All the names within __kmp_hw_get_keyword() are available for use in OMP_PLACES or KMP_AFFINITY's granularity setting. 5) Simplify and future-proof code where explicit lists of allowed affinity settings keywords inside if() conditions. 6) Add x86 CPUID leaf 4 cache detection to existing x2apic id method so equivalent caches could be detected (in particular for the ll_caches place). Differential Revision: https://reviews.llvm.org/D100997
-
Philip Reames authored
-
Jez Ng authored
-
Jez Ng authored
@thakis pointed out that `mach_header` and `mach_header_64` actually have the same set of (used) fields, with the 64-bit version having extra padding. So we can access the fields we need using the single `mach_header` type instead of using templates to switch between the two. I also spotted a potential issue where hasObjCSection tries to parse a file w/o checking if it does indeed match the target arch... As such, I've added a quick magic number check to ensure we don't access invalid memory during `findCommand()`. Addresses PR50180. Reviewed By: #lld-macho, thakis Differential Revision: https://reviews.llvm.org/D101724
-
Dávid Bolvanský authored
-
Giorgis Georgakoudis authored
Reviewed By: jdoerfert Differential Revision: https://reviews.llvm.org/D101742
-
Emilio Cota authored
This approximation matches the one in Eigen. ``` name old cpu/op new cpu/op delta BM_mlir_Log1p_f32/10 83.2ns ± 7% 34.8ns ± 5% -58.19% (p=0.000 n=84+71) BM_mlir_Log1p_f32/100 664ns ± 4% 129ns ± 4% -80.57% (p=0.000 n=82+82) BM_mlir_Log1p_f32/1k 6.75µs ± 4% 0.81µs ± 3% -88.07% (p=0.000 n=88+79) BM_mlir_Log1p_f32/10k 76.5µs ± 3% 7.8µs ± 4% -89.84% (p=0.000 n=80+80) BM_eigen_s_Log1p_f32/10 70.1ns ±14% 72.6ns ±14% +3.49% (p=0.000 n=116+112) BM_eigen_s_Log1p_f32/100 706ns ± 9% 717ns ± 3% +1.60% (p=0.018 n=117+80) BM_eigen_s_Log1p_f32/1k 8.26µs ± 1% 8.26µs ± 1% ~ (p=0.567 n=84+86) BM_eigen_s_Log1p_f32/10k 92.1µs ± 5% 92.6µs ± 6% +0.60% (p=0.047 n=115+115) BM_eigen_v_Log1p_f32/10 31.8ns ±24% 34.9ns ±17% +9.72% (p=0.000 n=98+96) BM_eigen_v_Log1p_f32/100 169ns ±10% 177ns ± 5% +4.66% (p=0.000 n=119+81) BM_eigen_v_Log1p_f32/1k 1.42µs ± 4% 1.46µs ± 8% +2.70% (p=0.000 n=93+113) BM_eigen_v_Log1p_f32/10k 14.4µs ± 5% 14.9µs ± 8% +3.61% (p=0.000 n=115+110) ``` Reviewed By: ezhulenev, ftynse Differential Revision: https://reviews.llvm.org/D101765
-
Eli Friedman authored
In some cases, we can improve the generated code by using a load with the "wrong" element width: in particular, using ld1b/st1b when we see reg+reg without a shift. Differential Revision: https://reviews.llvm.org/D100527
-
Jonas Devlieghere authored
The lack of a dot before the suffix is intentional, as the suffix itself includes a dot or dash. Differential revision: https://reviews.llvm.org/D101655
-
Dávid Bolvanský authored
``` ---------------------------------------- define i32 @src(i16 %x, i1 %b) { %0: %z = sext i16 %x to i32 %p = cttz i32 %z, %b ret i32 %p } => define i32 @tgt(i16 %x, i1 %b) { %0: %z = zext i16 %x to i32 %p = cttz i32 %z, %b ret i32 %p } Transformation seems to be correct! ``` https://alive2.llvm.org/ce/z/evomeg Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D101764 -
Heejin Ahn authored
This was temporarily disabled while we were reimplementing the new spec. Reviewed By: tlively Differential Revision: https://reviews.llvm.org/D101735
-
MaheshRavishankar authored
Given the source and destination shapes, if they are static, or if the expanded/collapsed dimensions are unit-extent, it is possible to compute the reassociation maps that can be used to reshape one type into another. Add a utility method to return the reassociation maps when possible. This utility function can be used to fuse a sequence of reshape ops, given the type of the source of the producer and the final result type. This pattern supercedes a more constrained folding pattern added to DropUnitDims pass. Differential Revision: https://reviews.llvm.org/D101343
-
Christopher Di Bella authored
Implements parts of: * P0896R4 The One Ranges Proposal` Depends on D100275. Differential Revision: https://reviews.llvm.org/D100278 -
Aart Bik authored
Test passes either way, but this is full name of dialect Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D101774
-
Dimitry Andric authored
This reverts commit ab40c027. Some additional test cases are influenced by the workaround, and I need to do a complete test run to identify and check them all.
-
Dimitry Andric authored
This fixes PR49821, and avoids "ld.lld: error: test.o:(.rodata.str1.1): offset is outside the section" errors when linking MIPS objects with negative R_MIPS_LO16 implicit addends. ld.lld handles R_MIPS_HI16/R_MIPS_LO16 separately, not as a whole, so it doesn't know that an R_MIPS_HI16 with implicit addend 1 and an R_MIPS_LO16 with implicit addend -32768 represents 32768, which is in range of a MergeInputSection. We could introduce a new RelExpr member (like R_RISCV_PC_INDIRECT for R_RISCV_PCREL_HI20 / R_RISCV_PCREL_LO12) but the complexity is unnecessary given that GNU as keeps the original symbol for this case as well. Reviewed By: atanasyan, MaskRay Differential Revision: https://reviews.llvm.org/D101773
-
Fangrui Song authored
Code patterns like this are common, `#` at the line beginning (https://google.github.io/styleguide/cppguide.html#Preprocessor_Directives), one space indentation for if/elif/else directives. ``` #if SANITIZER_LINUX # if defined(__aarch64__) # endif #endif ``` However, currently clang-format wants to reformat the code to ``` #if SANITIZER_LINUX #if defined(__aarch64__) #endif #endif ``` This significantly harms readability in my review. Use `IndentPPDirectives: AfterHash` to defeat the diagnostic. clang-format will now suggest: ``` #if SANITIZER_LINUX # if defined(__aarch64__) # endif #endif ``` Unfortunately there is no clang-format option using indent with 1 for just preprocessor directives. However, this is still one step forward from the current behavior. Reviewed By: #sanitizers, vitalybuka Differential Revision: https://reviews.llvm.org/D100238
-
Tomas Matheson authored
This reverts commit 75318503.
-
Christopher Di Bella authored
Implements parts of: * P0896R4 The One Ranges Proposal` Depends on D100271. Differential Revision: https://reviews.llvm.org/D100275 -
Teresa Johnson authored
When passingValueIsAlwaysUndefined scans for an instruction between an inst with a null or undef argument and its first use, it was checking for instructions that may have side effects, which is a superset of the instructions it intended to find (as per the comments, control flow changing instructions that would prevent reaching the uses). Switch to using isGuaranteedToTransferExecutionToSuccessor() instead. Without this change, when enabling -fwhole-program-vtables, which causes assumes to be inserted by clang, we can get different simplification decisions. In particular, when building with instrumentation FDO it can affect the optimizations decisions before FDO matching, leading to some mismatches. I had to modify d83507-knowledge-retention-bug.ll since this fix enables more aggressive optimization of that code such that it no longer tested the original bug it was meant to test. I removed the undef which still provokes the original failure (confirmed by temporarily reverting the fix) and also changed it to just invoke the passes of interest to narrow the testing. Similarly I needed to adjust code for UnreachableEliminate.ll to avoid an undef which was causing the function body to get optimized away with this fix. Differential Revision: https://reviews.llvm.org/D101507
-
Paulo Matos authored
WebAssembly instruction arguments should have their arguments ordered from the deepest to the shallowest on the stack.
-
Sanjay Patel authored
There's a TODO comment in the code and discussion in D99912 about generalizing this, but I wasn't sure how to implement that, so just going with a potential minimal fix to avoid crashing. The test is a reduction beyond useful code (there's no user of %user...), but it is based on https://llvm.org/PR50191, so this is asserting on real code. Differential Revision: https://reviews.llvm.org/D101772
-
MaheshRavishankar authored
Convert subtensor and subtensor_insert operations to use their rank-reduced versions to drop unit dimensions. Differential Revision: https://reviews.llvm.org/D101495
-
Valentin Clement authored
Add function to create the offload_maptypes and the offload_mapnames globals. These two functions are used in clang. They will be used in the Flang/MLIR lowering as well. Reviewed By: Meinersbur Differential Revision: https://reviews.llvm.org/D101503
-
Tomas Matheson authored
atomicrmw instructions are expanded by AtomicExpandPass before register allocation into cmpxchg loops. Register allocation can insert spills between the exclusive loads and stores, which invalidates the exclusive monitor and can lead to infinite loops. To avoid this, reimplement atomicrmw operations as pseudo-instructions and expand them after register allocation. Floating point legalisation: f16 ATOMIC_LOAD_FADD(*f16, f16) is legalised to f32 ATOMIC_LOAD_FADD(*i16, f32) and then eventually f32 ATOMIC_LOAD_FADD_16(*i16, f32) Differential Revision: https://reviews.llvm.org/D101164 Originally submitted as 3338290c. Reverted in c7df6b12.
-
thomasraoux authored
The current implementation had a bug as it was relying on the target vector dimension sizes to calculate where to insert broadcast. If several dimensions have the same size we may insert the broadcast on the wrong dimension. The correct broadcast cannot be inferred from the type of the source and destination vector. Instead when we want to extend transfer ops we calculate an "inverse" map to the projected permutation and insert broadcast in place of the projected dimensions. Differential Revision: https://reviews.llvm.org/D101738
-
Frederik Gossen authored
Differential Revision: https://reviews.llvm.org/D101771
-
Frederik Gossen authored
Add dedicated pass `convert-linalg-tiled-loops-to-scf` to lower `linalg.tiled_loop`s. Differential Revision: https://reviews.llvm.org/D101768
-
Anirudh Prasad authored
[AsmParser][SystemZ][z/OS] Implement HLASM location counter syntax ("*") for Z PC-relative instructions. - This patch attempts to implement the location counter syntax (*) for the HLASM variant for PC-relative instructions. - In the HLASM variant, for purely constant relocatable values, we expect a * token preceding it, with special support for " *" which is parsed as "<pc-rel-insn 0>" - For combinations of absolute values and relocatable values, we don't expect the "*" preceding the token. When you have a " * " what’s accepted is: ``` *<space>.*{.*} -> <pc-rel-insn> 0 *[+|-][constant-value] -> <pc-rel-insn> [+|-]constant-value ``` When you don’t have a " * " what’s accepted is: ``` brasl 1,func is allowed (MCSymbolRef type) brasl 1,func+4 is allowed (MCBinary type) brasl 1,4+func is allowed (MCBinary type) brasl 1,-4+func is allowed (MCBinary type) brasl 1,func-4 is allowed (MCBinary type) brasl 1,*func is not allowed (* cannot be used for non-MCConstantExprs) brasl 1,*+func is not allowed (* cannot be used for non-MCConstantExprs) brasl 1,*+func+4 is not allowed (* cannot be used for non-MCConstantExprs) brasl 1,*+4+func is not allowed (* cannot be used for non-MCConstantExprs) brasl 1,*-4+8+func is not allowed (* cannot be used for non-MCConstantExprs) ``` Reviewed By: Kai Differential Revision: https://reviews.llvm.org/D100987
-