- Apr 27, 2021
-
-
Aart Bik authored
The new "encoding" field in tensor types so far had no meaning. This revision introduces: 1. an encoding attribute interface in IR: for verification between tensors and encodings in general 2. an attribute in Tensor dialect; #tensor.sparse<dict> + concrete sparse tensors API Active discussion: https://llvm.discourse.group/t/rfc-introduce-a-sparse-tensor-type-to-core-mlir/2944/ Reviewed By: silvas, penpornk, bixia Differential Revision: https://reviews.llvm.org/D101008
-
Yonghong Song authored
For an example like below, extern int do_work(int); long bpf_helper(void *callback_fn); long prog() { return bpf_helper(&do_work); } The final generated codes look like: r1 = do_work ll call bpf_helper exit where we have debuginfo for do_work() extern function: !17 = !DISubprogram(name: "do_work", ...) This patch implemented to add additional checking in processing LD_imm64 operands for possible function pointers so BTF for bpf function do_work() can be properly generated. The original llvm function name processReloc() is renamed to processGlobalValue() to better reflect what the function is doing. Differential Revision: https://reviews.llvm.org/D100568 -
Arthur Eubanks authored
The ModulePassManager should already have taken care of all analysis invalidation. Without this change, upcoming changes will cause more invalidation than necessary. Reviewed By: mtrofin Differential Revision: https://reviews.llvm.org/D101320
-
LLVM GN Syncbot authored
-
William S. Moses authored
Add two canoncalizations for scf.if. 1) A canonicalization that allows users of a condition within an if to assume the condition is true if in the true region, etc. 2) A canonicalization that removes yielded statements that are equivalent to the condition or its negation Differential Revision: https://reviews.llvm.org/D101012 -
William S. Moses authored
LLVM does not have valid assembly backends for atomicrmw on local memory. However, as this memory is thread local, we should be able to lower this to the relevant load/store. Differential Revision: https://reviews.llvm.org/D98650
-
Alex Lorenz authored
The VFS is null when it's invalid so return early in collectVFSFromYAML.
-
Yonghong Song authored
Commit e3d8ee35 ("reland "[DebugInfo] Support to emit debugInfo for extern variables"") added support to emit debugInfo for extern variables if requested by the target. Currently, only BPF target enables this feature by default. As BPF ecosystem grows, callback function started to get support, e.g., recently bpf_for_each_map_elem() is introduced (https://lwn.net/Articles/846504/) with a callback function as an argument. In the future we may have something like below as a demonstration of use case : extern int do_work(int); long bpf_helper(void *callback_fn, void *callback_ctx, ...); long prog_main() { struct { ... } ctx = { ... }; return bpf_helper(&do_work, &ctx, ...); } Basically bpf helper may have a callback function and the callback function is defined in another file or in the kernel. In this case, we would like to know the debuginfo types for do_work(), so the verifier can proper verify the safety of bpf_helper() call. For the following example, extern int do_work(int); long bpf_helper(void *callback_fn); long prog() { return bpf_helper(&do_work); } Currently, there is no debuginfo generated for extern function do_work(). In the IR, we have, ... define dso_local i64 @prog() local_unnamed_addr #0 !dbg !7 { entry: %call = tail call i64 @bpf_helper(i8* bitcast (i32 (i32)* @do_work to i8*)) #2, !dbg !11 ret i64 %call, !dbg !12 } ... declare dso_local i32 @do_work(i32) #1 ... This patch added support for the above callback function use case, and the generated IR looks like below: ... declare !dbg !17 dso_local i32 @do_work(i32) #1 ... !17 = !DISubprogram(name: "do_work", scope: !1, file: !1, line: 1, type: !18, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2) !18 = !DISubroutineType(types: !19) !19 = !{!20, !20} !20 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) The TargetInfo.allowDebugInfoForExternalVar is renamed to TargetInfo.allowDebugInfoForExternalRef as now it guards both extern variable and extern function debuginfo generation. Differential Revision: https://reviews.llvm.org/D100567
-
Hongtao Yu authored
As a follow-up to D95982, this patch continues unblocking optimizations that are blocked by pseudu probe instrumention. The optimizations unblocked are: - In-block load propagation. - In-block dead store elimination - Memory copy optimization that turns stores to consecutive memories into a memset. These optimizations are local to a block, so they shouldn't affect the profile quality. Reviewed By: wmi Differential Revision: https://reviews.llvm.org/D100075
-
Fangrui Song authored
In LLVM_ENABLE_STATS=0 builds, `llvm::Statistic` maps to `llvm::NoopStatistic` but has 3 mostly unused pointers. GlobalOpt considers that the pointers can potentially retain allocated objects, so GlobalOpt cannot optimize out the `NoopStatistic` variables (see D69428 for more context), wasting 23KiB for stage 2 clang. This patch makes `NoopStatistic` empty and thus reclaims the wasted space. The clang size is even smaller than applying D69428 (slightly smaller in both .bss and .text). ``` # This means the D69428 optimization on clang is mostly nullified by this patch. HEAD+D69428: size(.bss) = 0x0725a8 HEAD+D101211: size(.bss) = 0x072238 # bloaty - HEAD+D69428 vs HEAD+D101211 # With D101211, we also save a lot of string table space (.rodata). FILE SIZE VM SIZE -------------- -------------- -0.0% -32 -0.0% -24 .eh_frame -0.0% -336 [ = ] 0 .symtab -0.0% -360 [ = ] 0 .strtab [ = ] 0 -0... -
William S. Moses authored
This reverts commit fede99d3.
-
William S. Moses authored
LLVM does not have valid assembly backends for atomicrmw on local memory. However, as this memory is thread local, we should be able to lower this to the relevant load/store. Differential Revision: https://reviews.llvm.org/D98650
-
Fangrui Song authored
The order regressed after D94202: after `a b`, when adding `a c`, we may reorder `a` to the right of `b`, causing the final order to be `b a c`.
-
Craig Topper authored
Reduces the amount of vector ALU operations and reduces vector register pressure.
-
Lei Zhang authored
This reverts commit b5403117 because it breaks MLIR build: https://buildkite.com/mlir/mlir-core/builds/13299#ad0f8901-dfa4-43cf-81b8-7940e2c6c15b
-
Hubert Tong authored
The value observed for the `mtim.tv_nsec` member is erroneous in some AIX environments. Avoid using this member by forcing `HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC` to `0`. This resolves "mtime changed" errors such as the one http://lab.llvm.org:8014/#/builders/126/builds/330/steps/5/logs/FAIL__Clang__test_c has. Reviewed By: daltenty, jsji Differential Revision: https://reviews.llvm.org/D101323
-
Michael Kruse authored
When replacing a conditional branch by an unconditional one because the targets are identical, transfer the metadata to the new branch instruction. Reviewed By: lebedev.ri Differential Revision: https://reviews.llvm.org/D101226
-
Fangrui Song authored
This reverts commit 0ce723cb. D76519 was not quite NFC. If we see a CFISection::Debug function before a CFISection::EH one (-fexceptions -fno-asynchronous-unwind-tables), we may incorrectly pick CFISection::Debug and emit a `.cfi_sections .debug_frame`. We should use .eh_frame instead. This scenario is untested.
-
LLVM GN Syncbot authored
-
Lang Hames authored
This reverts commit 87403600. This commit caused failures on some builders (see e.g. https://lab.llvm.org/buildbot/#/builders/5/builds/7071). Reverting while I investigate.
-
Michael Benfield authored
These are intended to mimic warnings available in gcc. -Wunused-but-set-variable is triggered in the case of a variable which appears on the LHS of an assignment but not otherwise used. For instance: void f() { int x; x = 0; } -Wunused-but-set-parameter works similarly, but for function parameters instead of variables. In C++, they are triggered only for scalar types; otherwise, they are triggered for all types. This is gcc's behavior. -Wunused-but-set-parameter is controlled by -Wextra, while -Wunused-but-set-variable is controlled by -Wunused. This is slightly different from gcc's behavior, but seems most consistent with clang's behavior for -Wunused-parameter and -Wunused-variable. Reviewed By: aeubanks Differential Revision: https://reviews.llvm.org/D100581 -
zoecarver authored
Based on D100160. Reviewed By: cjdb, ldionne, Quuxplusone, #libc, miscco Differential Revision: https://reviews.llvm.org/D100587
-
Alex Lorenz authored
This reverts commit 6cc62043. This caused a test failure on a M1 mac CI job (https://reviews.llvm.org/D100807#2718006), I will recommit this with a fix.
-
LLVM GN Syncbot authored
-
Baptiste Saleil authored
the compilation time and there is no case for which we see any improvement in performance. This patch removes this pass and its associated test cases from the tree. Differential Revision: https://reviews.llvm.org/D101313 Change-Id: I0599169a7609c19a887f8d847a71e664030cc141
-
Vineet Kumar authored
This patch adds the missing implementation for TargetTransformInfo::hasActiveVectorLength() without which using hasActiveVectorLength() causes linker error. Patch by Vineet Kumar! Differential Revision: https://reviews.llvm.org/D100941
-
Sterling Augustine authored
Support leak sanitizer in libcxx. Simple addition for leak checking when running the libcxx testsuite. Differential Revision: https://reviews.llvm.org/D100775
-
Sterling Augustine authored
Don't fail the shared_ptr test if libc++ has insufficient debug info. This addresses https://bugs.llvm.org/show_bug.cgi?id=48937 Differential Revision: https://reviews.llvm.org/D100610
-
LLVM GN Syncbot authored
-
Lang Hames authored
Patch by Mats Larsen. Thanks Mats! Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D100506
-
Lang Hames authored
Adds support for creating custom MaterializationUnits in the C API with the new LLVMOrcCreateCustomMaterializationUnit function. Modifies ownership rules for LLVMOrcAbsoluteSymbols to make it consistent with LLVMOrcCreateCustomMaterializationUnit. This is an ABI breaking change for any clients of the LLVMOrcAbsoluteSymbols API. Adds LLVMOrcLLJITGetObjLinkingLayer and LLVMOrcObjectLayerEmit functions to allow clients to get a reference to an LLJIT instance's linking layer, then emit an object file using it. This can be used to support construction of custom materialization units in the common case where those units will generate an object file that needs to be emitted to complete the materialization.
-
Lang Hames authored
Rename JITTargetSymbolFlags to JITSymbolTargetFlags. This matches the convention used for JITSymbolGenericFlags.
-
Fangrui Song authored
In LLVM_ENABLE_STATS=0 builds, `llvm::Statistic` maps to `llvm::NoopStatistic` but has 3 unused pointers. GlobalOpt considers that the pointers can potentially retain allocated objects, so GlobalOpt cannot optimize out the `NoopStatistic` variables (see D69428 for more context), wasting 23KiB for stage 2 clang. This patch makes `NoopStatistic` empty and thus reclaims the wasted space. The clang size is even smaller than applying D69428 (slightly smaller in both .bss and .text). ``` # This means the D69428 optimization on clang is mostly nullified by this patch. HEAD+D69428: size(.bss) = 0x0725a8 HEAD+D101211: size(.bss) = 0x072238 # bloaty - HEAD+D69428 vs HEAD+D101211 # With D101211, we also save a lot of string table space (.rodata). FILE SIZE VM SIZE -------------- -------------- -0.0% -32 -0.0% -24 .eh_frame -0.0% -336 [ = ] 0 .symtab -0.0% -360 [ = ] 0 .strtab [ = ] 0 -0.2% -880 .bss -0.0% -2.11Ki -0.0% -2.11Ki .rodata -0.0% -2.89Ki -0.0% -2.89Ki .text -0.0% -5.71Ki -0.0% -5.88Ki TOTAL ``` Note: LoopFuse is a disabled pass. This patch adds `#if LLVM_ENABLE_STATS` so `OptimizationRemarkMissed` is skipped in LLVM_ENABLE_STATS==0 builds. If these `OptimizationRemarkMissed` are useful and not noisy, we can replace `llvm::Statistic` with `llvm::TrackingStatistic` in the future. Reviewed By: lattner Differential Revision: https://reviews.llvm.org/D101211 -
Craig Topper authored
This modifies my previous patch to push the strided load formation to isel. This gives us opportunity to fold the splat into a .vx operation first. Using a scalar register and a .vx operation reduces vector register pressure which can be important for larger LMULs. If we can't fold the splat into a .vx operation, then it can make sense to use a strided load to free up the vector arithmetic ALU to do actual arithmetic rather than tying it up with vmv.v.x. Reviewed By: khchen Differential Revision: https://reviews.llvm.org/D101138
-
Fangrui Song authored
Add LLVM_ATTRIBUTE_USED to fix problems which could be exposed by aggressive global pointer variable removal Note to BuryPointer.cpp:GraveYard. 'unused' cannot prevent (1) dead store elimination and (2) removal of the global pointer variable (D69428) but 'used' can. Discovered when comparing link maps between HEAD+D69428 and HEAD. Reviewed By: lattner Differential Revision: https://reviews.llvm.org/D101217
-
Fangrui Song authored
[gcov] Set nounwind and respect module flags metadata "frame-pointer" & "uwtable" for synthesized functions This applies the D100251 mechanism to the gcov instrumentation pass. With this patch, `-fno-omit-frame-pointer` in `clang -fprofile-arcs -O1 -fno-omit-frame-pointer` will be respected for synthesized `__llvm_gcov_writeout,__llvm_gcov_reset,__llvm_gcov_init` functions: the frame pointer will be kept (note: on many targets -O1 eliminates the frame pointer by default). `clang -fno-exceptions -fno-asynchronous-unwind-tables -g -fprofile-arcs` will produce .debug_frame instead of .eh_frame. Fix: https://github.com/ClangBuiltLinux/linux/issues/955 Reviewed By: nickdesaulniers Differential Revision: https://reviews.llvm.org/D101129
-
Leonard Chan authored
This is undefined if SANITIZER_SYMBOLIZER_MARKUP is 1, which is the case for Fuchsia, and will result in a undefined symbol error. This function is needed by hwasan for online symbolization, but is not needed for us since we do offline symbolization. Differential Revision: https://reviews.llvm.org/D99386
-
Arthur O'Dwyer authored
params.py:106: SyntaxWarning: "is" with a literal. Did you mean "=="?
-
Arthur O'Dwyer authored
When checking the strong exception guarantee, also check that iterators haven't been invalidated. Reviewed as part of https://reviews.llvm.org/D98573
-
Arthur O'Dwyer authored
This reverts a large chunk of http://reviews.llvm.org/D15862 , and also fixes bugs in `insert`, `append`, and `assign`, which are now regression-tested. (Thanks to Tim Song for pointing out the bug in `append`!) Before this patch, we did a special dance in `append`, `assign`, and `insert` (but not `replace`). All of these require the strong exception guarantee, even when the user-provided InputIterator might have throwing operations. The naive way to accomplish this is to construct a temporary string and then append/assign/insert from the temporary; i.e., finish all the potentially throwing and self-inspecting InputIterator operations *before* starting to modify self. But this is slow, so we'd like to skip it when possible. The old code (D15682) attempted to check that specific iterator operations were nothrow: it assumed that if the iterator operations didn't throw, then it was safe to iterate the input range multiple times and therefore it was safe to use the fast-path non-naive version. This was wrong for two reasons: (1) the old code checked the wrong operations (e.g. checked noexceptness of `==`, but the code that ran used `!=`), and (2) the conversion of value_type to char could still throw, or inspect the contents of self. The new code is much simpler, although still much more complicated than it really could be. We'll likely revisit this codepath at some point, but for now this patch suffices to get it passing all the new regression tests. The added tests all fail before this patch, and succeed afterward. See https://quuxplusone.github.io/blog/2021/04/17/pathological-string-appends/ Differential Revision: https://reviews.llvm.org/D98573
-