- Jun 27, 2023
-
-
Fangrui Song authored
to help debug and report better diagnostics for functions like relaxDwarfCallFrameFragment (D153167). In MCStreamer, some emitCFI* functions already take a SMLoc argument. Add a SMLoc argument to the remaining functions that generate a MCCFIInstruction.
-
Jason Molenda authored
EnumerateDirectory gets the vfs::Status of each directory entry to decide how to process it. If it is unable to get the Status for a directory entry, it will currently halt the directory iteration entirely. It should only skip this entry. Differential Revision: https://reviews.llvm.org/D153822 rdar://110861210
-
Hongtao Yu authored
The compiler has more insight and knowledge about functions based on their IR and attribures and should make a better inline decision than the offline preinliner does which is purely based on callsites hotness and code size. Therefore I'm making changes to favor previous compiler inline decision by bumping up the callsite allowance. This should improve the performance by more than 1% according to testing on Meta services. Reviewed By: wenlei Differential Revision: https://reviews.llvm.org/D153797
-
LLVM GN Syncbot authored
-
William Huang authored
[llvm-profdata] Refactoring Sample Profile Reader to increase FDO build speed using MD5 as key to Sample Profile map This is phase 1 of multiple planned improvements on the sample profile loader. The major change is to use MD5 hash code ((instead of the function itself) as the key to look up the function offset table and the profiles, which significantly reduce the time it takes to construct the map. The optimization is based on the fact that many practical sample profiles are using MD5 values for function names to reduce profile size, so we shouldn't need to convert the MD5 to a string and then to a SampleContext and use it as the map's key, because it's extremely slow. Several changes to note: (1) For non-CS SampleContext, if it is already MD5 string, the hash value will be its integral value, instead of hashing the MD5 again. In phase 2 this is going to be optimized further using a union to represent MD5 function (without converting it to string) and regular function names. (2) The SampleProfileMap is a wrapper to *map<uint64_t, FunctionSamples>, while providing interface allowing using SampleContext as key, so that existing code still work. It will check for MD5 collision (unlikely but not too unlikely, since we only takes the lower 64 bits) and handle it to at least guarantee compilation correctness (conflicting old profile is dropped, instead of returning an old profile with inconsistent context). Other code should not try to use MD5 as key to access the map directly, because it will not be able to handle MD5 collision at all. (see exception at (5) ) (3) Any SampleProfileMap::emplace() followed by SampleContext assignment if newly inserted, should be replaced with SampleProfileMap::Create(), which does the same thing. (4) Previously we ensure an invariant that in SampleProfileMap, the key is equal to the Context of the value, for profile map that is eventually being used for output (as in llvm-profdata/llvm-profgen). Since the key became MD5 hash, only the value keeps the context now, in several places where an intermediate SampleProfileMap is created, each new FunctionSample's context is set immediately after insertion, which is necessary to "remember" the context otherwise irretrievable. (5) When reading a profile, we cache the MD5 values of all functions, because they are used at least twice (one to index into FuncOffsetTable, the other into SampleProfileMap, more if there are additional sections), in this case the SampleProfileMap is directly accessed with MD5 value so that we don't recalculate it each time (expensive) Performance impact: When reading a ~1GB extbinary profile (fixed length MD5, not compressed) with 10 million function names and 2.5 million top level functions (non CS functions, each function has varying nesting level from 0 to 20), this patch improves the function offset table loading time by 20%, and improves full profile read by 5%. Reviewed By: davidxl, snehasish Differential Revision: https://reviews.llvm.org/D147740
-
River Riddle authored
The bytecode reader currently assumes all regions can be lazy loaded, which breaks reading any non-isolated region. This patch fixes that by properly handling nested non-lazy regions, and only considers isolated regions as lazy. Differential Revision: https://reviews.llvm.org/D153795
-
Benjamin Kramer authored
-
Petr Hosek authored
This allows building static libraries with Clang driver. Differential Revision: https://reviews.llvm.org/D148869
-
Alex MacLean authored
In NVPTX `ReplaceVectorLoad()`, i1 and i8 types are promoted to i16, followed by a truncate operation. Thus, v2i8 (or v2i1) and v2i16 will have the same VTList, which causes a collision in CSEMap. To differentiate the original VTList, let's add the size in generating an ID. Otherwise the compiler crashes in refineAlignment: `MMO->getSize() == getSize() && "Size mismatch!"` Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D153712
-
Jerry Wu authored
Handle the trivial case of size-1 vector.shape_cast. Differential Revision: https://reviews.llvm.org/D153719
-
Jim Ingham authored
as we don't in general know where the extra data should come from. Differential Revision: https://reviews.llvm.org/D153657
-
fernandosalas authored
Dumped some basic info about what is being cached and about the cache itself. Output of test below: ... Stats: MapAllocatorCache: EntriesCount: 33, MaxEntriesCount: 64, MaxEntrySize: 1048576 StartBlockAddress: 0x6d342c1000, EndBlockAddress: 0x6d342d2000, BlockSize: 69632 StartBlockAddress: 0x6fc45ff000, EndBlockAddress: 0x6fc462f000, BlockSize: 196608 ... Reviewed By: Chia-hungDuan Differential Revision: https://reviews.llvm.org/D153483
-
Riley authored
In SmallAlign implemented deallocation for the pointers Reviewed By: cferris, Chia-hungDuan Differential Revision: https://reviews.llvm.org/D153480
-
Chia-hung Duan authored
`populateFreeListAndPopBatch` may return batch with single block. Merge it with the reported free blocks and enqueue them together. Reviewed By: cferris, fabio-d Differential Revision: https://reviews.llvm.org/D153787
-
Eduard Zingerman authored
`NoMerge` attribute on machine instructions prevents certain transformations from merging these instructions. One of such transformations is 'llvm/lib/CodeGen/BranchFolding.cpp'. This attribute should be copied from IR `call` instructions to machine level instructions. See `X86TargetLowering::LowerCall` as another example. Differential Revision: https://reviews.llvm.org/D152987
-
Eduard Zingerman authored
Allow specifying 'nomerge' attribute for function pointers, e.g. like in the following C code: extern void (*foo)(void) __attribute__((nomerge)); void bar(long i) { if (i) foo(); else foo(); } With the goal to attach 'nomerge' to both calls done through 'foo': @foo = external local_unnamed_addr global ptr, align 8 define dso_local void @bar(i64 noundef %i) local_unnamed_addr #0 { ; ... %0 = load ptr, ptr @foo, align 8, !tbaa !5 ; ... if.then: tail call void %0() #1 br label %if.end if.else: tail call void %0() #1 br label %if.end if.end: ret void } ; ... attributes #1 = { nomerge ... } Report a warning in case if 'nomerge' is specified for a variable that is not a function pointer, e.g.: t.c:2:22: warning: 'nomerge' attribute is ignored because 'j' is not a function pointer [-Wignored-attributes] 2 | int j __attribute__((nomerge)); | ^ The intended use-case is for BPF backend. BPF provides a sort of "standard library" functions that are called helpers. BPF also verifies usage of these helpers before program execution. Because of limitations of verification / runtime model it is important to keep calls to some of such helpers from merging. An example could be found by the link [1], there input C code: if (data_end - data > 1024) { bpf_for_each_map_elem(&map1, cb, &cb_data, 0); } else { bpf_for_each_map_elem(&map2, cb, &cb_data, 0); } Is converted to bytecode equivalent to: if (data_end - data > 1024) tmp = &map1; else tmp = &map2; bpf_for_each_map_elem(tmp, cb, &cb_data, 0); However, BPF verification/runtime requires to use the same map address for each particular `bpf_for_each_map_elem()` call. The 'nomerge' attribute is a perfect match for this situation, but unfortunately BPF helpers are declared as pointers to functions: static long (*bpf_for_each_map_elem)(void *map, ...) = (void *) 164; Hence, this commit, allowing to use 'nomerge' for function pointers. [1] https://lore.kernel.org/bpf/03bdf90f-f374-1e67-69d6-76dd9c8318a4@meta.com/ Differential Revision: https://reviews.llvm.org/D152986 -
Kelvin Li authored
Insert a return statement
-
Alex Langford authored
The shared cache has grown past the previously hardcoded limit. As a temporary measure, I am increasing the hardcoded number of classes we can expect to read from the shared cache. This is not a good long-term solution. Differential Revision: https://reviews.llvm.org/D153817
-
David Green authored
If we don't find a node with either operand through isEssentiallyExtractHighSubvector, there is little point recreating the node with the same operands. Returning SDValue better communicates that no changes were made. This fixes #63491 by not recreating uabd nodes with swapped operands. As noted in the ticket there are other fixes that might be useful to make too, but this should prevent the infinite combine.
-
Andres Villegas authored
Switch the parse of command line options fromllvm::cl to OptTable. The motivation for this change is to continue adding llvm based tools to the llvm driver multicall. Differential Revision: https://reviews.llvm.org/D153665
-
Douglas Yung authored
-
Fangrui Song authored
Due to Mach-O's .subsections_via_symbols mechanism, non-private labels cannot appear between .cfi_startproc/.cfi_endproc. Compilers do not produce such labels, but hand-written assembly may. Give an error. Unfortunately, emitDwarfAdvanceFrameAddr generated MCExpr doesn't have location informatin. Note: evaluateKnownAbsolute is to force folding A-B to a constant even if A and B are separate by a non-private label. The function is a workaround for some Mach-O assembler issues and should generally be avoided. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D153167
-
yzhang93 authored
This patch adds support for narrow bitwidth storage emulation. The goal is to support sub-byte type codegen for LLVM CPU. Specifically, a type converter is added to convert memref of narrow bitwidth (e.g., i4) into supported wider bitwidth (e.g., i8). Another focus of this patch is to populate the pattern for int4 memref.load. memref.store pattern should be added in a seperate patch. Reviewed By: hanchung, mravishankar Differential Revision: https://reviews.llvm.org/D151519
-
cabreraam authored
This patch implements the lowering for the `hlfir.char_extremum` operation. Discussion for this patch can be found in the draft patch [here](https://reviews.llvm.org/D143326). The reason for not promoting this draft to a true patch for review was because I needed to separate the op definition/codegen and lowering into two separate patches, as preferred by @jeanPerier. Depends on D152474 Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D152475
-
Fangrui Song authored
-
Aiden Grossman authored
llvm-exegesis currently isn't compiling on 32-bit ARM due to SYS_mmap not being defined as 32-bit ARM instead uses SYS_mmap2. This patch defines SYS_mmap to be SYS_mmap2 in the relevant places to allow for compilation to succeed.
-
Matthias Braun authored
No longer conservatively assume a load/store accesses the stack when we can prove that we did not compute any stack-relative address up to this point in the program. We do this in a cheap not-quite-a-dataflow-analysis: Assume `NoStackAddressUsed` when all predecessors of a block already guarantee it. Process blocks in reverse post order to guarantee that except for loop headers we have processed all predecessors of a block before processing the block itself. For loops we accept the conservative answer as they are unlikely to be shrink-wrappable anyway. Differential Revision: https://reviews.llvm.org/D152213
-
Matthias Braun authored
Switch and update some tests to use `update_llc_test_checks` to reduce clutter in upcoming change. Differential Revision: https://reviews.llvm.org/D152215
-
Aiden Grossman authored
Some builders are currently failing as they don't have MAP_FIXED_NOREPLACE available. This patch checks if MAP_FIXED_NOREPLACE is available and if it isn't, it is simply defined as MAP_FIXED.
-
Shubham Sandeep Rastogi authored
When emitting a debug_frame section, it contains a named symbol. > echo "void foo(void) {}" | clang -arch arm64 -ffreestanding -g -c -o \ /tmp/test.o -x c - > nm /tmp/test.o -s __DWARF __debug_frame 0000000000000200 s ltmp1 There are no such symbols emitted in any of the other DWARF sections, this is because when the __debug_frame section is created, it doesn't get a `BeginSymName` and so it creates a named symbol, such as `ltmp1` and emits it when we switch to the section in MCDwarf.cpp. This patch fixes the above issue. Differential Revision: https://reviews.llvm.org/D153484 -
Aiden Grossman authored
On some platforms such as PPC shm_open is in librt and it isn't automatically linked against. This patch explicitly links against librt in the unittests which should hopefully fix the symbol resolution errors.
-
Diego Caballero authored
This patch fixes a bug in the way we compute the vector type for vector transfer writes when the value to store needs to be transposed. Reviewed By: nicolasvasilache, mravishankar Differential Revision: https://reviews.llvm.org/D153687
-
Nicolas Vasilache authored
matmul with transposed LHS operand allows better memory access patterns on several architectures including common GPUs. Having a named op for it allows to handle this kind of matmul in a more explicit way.
-
LLVM GN Syncbot authored
-
LLVM GN Syncbot authored
-
Nico Weber authored
-
Aart Bik authored
Submitting for Wren Reviewed By: K-Wu Differential Revision: https://reviews.llvm.org/D153804
-
Fangrui Song authored
-
Nicolas Vasilache authored
D141430 added the generated yaml file for (batch_)?matmul_transpose_b ops, but the source of truth core_named_ops.py was not updated. This change fixes .py file to generate the same result as the yaml file. Differential revision: https://reviews.llvm.org/D150059 Authored-by:
kon72 <kinsei0916@gmail.com>
-
Philip Reames authored
-