- Jul 26, 2022
-
-
Kito Cheng authored
Leverage the method OpenCL uses that adds C intrinsics when the lookup failed. There is no need to define C intrinsics in the header file any more. It could help to avoid the large header file to speed up the compilation of RVV source code. Besides that, only the C intrinsics used by the users will be added into the declaration table. This patch is based on https://reviews.llvm.org/D103228 and inspired by OpenCL implementation. ### Experimental Results #### TL;DR: - Binary size of clang increase ~200k, which is +0.07% for debug build and +0.13% for release build. - Single file compilation speed up ~33x for debug build and ~8.5x for release build - Regression time reduce ~10% (`ninja check-all`, enable all targets) #### Header size change ``` | size | LoC | ------------------------------ Before | 4,434,725 | 69,749 | After | 6,140 | 162 | ``` #### Single File Compilation Time Testcase: ``` #include <riscv_vector.h> vint32m1_t test_vadd_vv_vfloat32m1_t(vint32m1_t op1, vint32m1_t op2, size_t vl) { return vadd(op1, op2, vl); } ``` ##### Debug build: Before: ``` real 0m19.352s user 0m19.252s sys 0m0.092s ``` After: ``` real 0m0.576s user 0m0.552s sys 0m0.024s ``` ~33x speed up for debug build ##### Release build: Before: ``` real 0m0.773s user 0m0.741s sys 0m0.032s ``` After: ``` real 0m0.092s user 0m0.080s sys 0m0.012s ``` ~8.5x speed up for release build #### Regression time Note: the failed case is `tools/llvm-debuginfod-find/debuginfod.test` which is unrelated to this patch. ##### Debug build Before: ``` Testing Time: 1358.38s Skipped : 11 Unsupported : 446 Passed : 75767 Expectedly Failed: 190 Failed : 1 ``` After ``` Testing Time: 1220.29s Skipped : 11 Unsupported : 446 Passed : 75767 Expectedly Failed: 190 Failed : 1 ``` ##### Release build Before: ``` Testing Time: 381.98s Skipped : 12 Unsupported : 1407 Passed : 74765 Expectedly Failed: 176 Failed : 1 ``` After: ``` Testing Time: 346.25s Skipped : 12 Unsupported : 1407 Passed : 74765 Expectedly Failed: 176 Failed : 1 ``` #### Binary size of clang ##### Debug build Before ``` text data bss dec hex filename 335261851 12726004 552812 348540667 14c64efb bin/clang ``` After ``` text data bss dec hex filename 335442803 12798708 552940 348794451 14ca2e53 bin/clang ``` +253K, +0.07% code size ##### Release build Before ``` text data bss dec hex filename 144123975 8374648 483140 152981763 91e5103 bin/clang ``` After ``` text data bss dec hex filename 144255762 8447296 483268 153186326 9217016 bin/clang ``` +204K, +0.13% Authored-by:
Kito Cheng <kito.cheng@sifive.com> Co-Authored-by:
Hsiangkai Wang <kai.wang@sifive.com> Reviewed By: khchen, aaron.ballman Differential Revision: https://reviews.llvm.org/D111617
-
David Spickett authored
This teaches ProcessElfCore to recognise the MTE tag segments. https://www.kernel.org/doc/html/latest/arm64/memory-tagging-extension.html#core-dump-support These segments contain all the tags for a matching memory segment which will have the same size in virtual address terms. In real terms it's 2 tags per byte so the data in the segment is much smaller. Since MTE is the only tag type supported I have hardcoded some things to those values. We could and should support more formats as they appear but doing so now would leave code untested until that happens. A few things to note: * /proc/pid/smaps is not in the core file, only the details you have in "maps". Meaning we mark a region tagged only if it has a tag segment. * A core file supports memory tagging if it has at least 1 memory tag segment, there is no other flag we can check to tell if memory tagging was enabled. (unlike a live process that can support memory tagging even if there are currently no tagged memory regions) Tests have been added at the commands level for a core file with mte and without. There is a lot of overlap between the "memory tag read" tests here and the unit tests for MemoryTagManagerAArch64MTE::UnpackTagsFromCoreFileSegment, but I think it's worth keeping to check ProcessElfCore doesn't cause an assert. Depends on D129487 Reviewed By: omjavaid Differential Revision: https://reviews.llvm.org/D129489
-
Saiyedul Islam authored
This patch extends the is_valid_binary routine to also check if the binary's target ID matches the one parsed from the system's runtime environment. This should allow us to only use the binary whose compute capability matches, allowing us to support basic multi-architecture binaries for AMDGPU. It also handles compatibility testing of target IDs of the image and the enviornment. Depends on D127432 Reviewed By: JonChesterfield Differential Revision: https://reviews.llvm.org/D127769
-
isuckatcs authored
This patch introduces a new `ConstructionContext` for lambda capture. This `ConstructionContext` allows the analyzer to construct the captured object directly into it's final region, and makes it possible to capture non-POD arrays. Differential Revision: https://reviews.llvm.org/D129967
-
John Ericson authored
This was in CMake syntax generation, so we didn't catch it eval time. Follow up from D117973
-
Diana Picus authored
Use pertinent names instead of numbered values, to make it easier to update the test in future patches. Differential Revision: https://reviews.llvm.org/D130474
-
Victor Campos authored
The ARM attribute parser for Tag_CPU_arch is missing value descriptions for Armv8-A and Armv8-R. This patch adds these descriptions. Reviewed By: pratlucas Differential Revision: https://reviews.llvm.org/D129631
-
Slava Gurevich authored
Fix incorrect direction for bit-shifting. Coverity warning 1355603 (scan.coverity.com) Differential Revision: https://reviews.llvm.org/D130307
-
Amir Ayupov authored
`LastSymbol` handling in `discoverFileObjects` assumes a non-zero number of symbols in an object file. It's not the case for broken_dynsym.test added in D130073, and potentially other stripped binaries. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D130544
-
isuckatcs authored
This patch introduces the evaluation of ArrayInitLoopExpr in case of structured bindings and implicit copy/move constructor. The idea is to call the copy constructor for every element in the array. The parameter of the copy constructor is also manually selected, as it is not a part of the CFG. Differential Revision: https://reviews.llvm.org/D129496
-
Weining Lu authored
-
owenca authored
Fixes #56624. Differential Revision: https://reviews.llvm.org/D130411
-
Alex Brachet authored
Differential Revision: https://reviews.llvm.org/D130514
-
Kazu Hirata authored
This patch deprecates getValueOr in favor of value_or. Differential Revision: https://reviews.llvm.org/D130140
-
Kazu Hirata authored
This patch replaces x.getValue() with *x if the reference is obviously protected by a presence check. Otherwise, it replaces x.getValue() with x.value().
-
Kazu Hirata authored
Identified with tidy-modernize-use-override.
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Nico Weber authored
-
Nico Weber authored
After bc39d7bd (ported to GN in 94c00c10), libclang uses symbol_exports, and clang/test/LibClang/symbols.test wants the versioned name to be `LLVM_[0-9]$` instead of `FOO`.
-
Sinan Lin authored
It would be better for CodeMetrics to use hasOneLiveUse while analyzing static and called once callsites, since inline cost now uses hasOneLiveUse instead of hasOneUse to avoid overpessimization on dead constant cases (since this patch https://reviews.llvm.org/D109294). This change has no noticeable influence now, but it helps improve the accuracy of cost models of passes that use CodeMetrics. Reviewed By: fhahn, nikic Differential Revision: https://reviews.llvm.org/D130461
-
Nico Weber authored
-
zhongyunde authored
Fix https://github.com/llvm/llvm-project/issues/56681 Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D130418
-
Tom Stellard authored
This partially reverts c7b3a910. Having libclang.so with a different SONAME than the other LLVM libraries was causing a lot of confusion for users. Also, this change did not really acheive it's purpose of allowing apps to use newer versions of libclang.so without rebuilding, because a new version of libclang.so requires a new version of libLLVM.so, which does not have a stable ABI. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D129160
-
Amir Ayupov authored
The test exercises an implicit ptr-to-int conversion which is made an error in D129881. We acknowledge the error but still want to test this case. Add `-Wno-int-conversion` to silence the error. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D130546
-
Xiang Li authored
A new helper class DXILOpBuilder is added to create DXIL op function calls. TableGen backend for DXILOperation will create table for DXIL op function parameter types. When create DXIL op function, these parameter types will used to create the function type. Reviewed By: bogner Differential Revision: https://reviews.llvm.org/D130291
-
Jun Zhang authored
Also move MangleCtx when moving some lazy emission states in CodeGenModule. Without this patch clang-repl hits an invalid address access when passing `-Xcc -O2` flag. Signed-off-by:
Jun Zhang <jun@junz.org> Differential Revision: https://reviews.llvm.org/D130420
-
Sunho Kim authored
Adds keep-alive edges to pdata section to prevent dead strip of block when its parent function is alive. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D129945
-
Sunho Kim authored
Consider lib/dll files in llvm-jitlink. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D129944
-
Luo, Yuanke authored
Currently the X86 shuffle lowering would widen the element type for shuffle if the mask element value is adjacent. For below example %t2 = add nsw <16 x i32> %t0, %t1 %t3 = sub nsw <16 x i32> %t0, %t1 %t4 = shufflevector <16 x i32> %t2, <16 x i32> %t3, <16 x i32> <i32 16, i32 17, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15> ret <16 x i32> %t4 Compiler would transform the shuffle to %t4 = shufflevector <8 x i64> %t2, <8 x i64> %t3, <8 x i64> <i32 8, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7> This may lose the oppotunity to let ISel select mask instruction when avx512 is enabled. This patch is to prevent the tranform when avx512 feature is enabled. Thank Simon for the idea. Differential Revision: https://reviews.llvm.org/D129537 -
Slava Gurevich authored
Improve LLDB reliability by fixing the following "uninitialized variables" static code inspection warnings from scan.coverity.com: 1476275, 1274012, 1455035, 1364789, 1454282 1467483, 1406152, 1406255, 1454837, 1454416 1467446, 1462022, 1461909, 1420566, 1327228 1367767, 1431254, 1467299, 1312678, 1431780 1454731, 1490403 Differential Revision: https://reviews.llvm.org/D130528
-
Kazu Hirata authored
This fixes the warning: llvm-project/flang/lib/Lower/OpenMP.cpp:94:10: error: unused variable 'lastPrivBlock' [-Werror,-Wunused-variable]
-
Sunho Kim authored
Implement IMAGE_COMDAT_SELECT_LARGEST partially. It's going to fail if larger symbol appears but this hasn't happened at least in vcruntime library. We probably would not implement this properly as it requires complicated runtime patching which is not of nature of JIT. However, we'd like to validate if larger section appears and report to the user in the near future. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D129941
-
Sunho Kim authored
Implement IMAGE_WEAK_EXTERN_SEARCH_NOLIBRARY/LIBRARY characteristics flag. Since COFFObjectFile class will set undefined flag for symbols with no alias flag, ORC ObjectFileInterface will not pull in this symbol. So, we only need to make sure the scope is local. NOLIBRARY and LIBRARY are handled in the same way for now. (which is what lld does right now) Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D129939
-
Sunho Kim authored
Handles duplicate external symbols. This happens in few static libraries generaed from msvc toolchain. Reviewed By: lhames Differential Revision: https://reviews.llvm.org/D129937
-
Weverything authored
-
John Ericson authored
If `CMAKE_INSTALL_BINDIR` is a different absolute path per project, as it is with NixOS when we install every package to its own prefix, the old way fails when the absolute path gets prepended with `CMAKE_INSTALL_PREFIX`. The `extend_path` function does what we want, but it is currently internal-only. So easier to just inline the one small case of it we need. Also fix one stray `bin` -> `CMAKE_INSTALL_BINDIR` Reviewed By: sebastian-ne Differential Revision: https://reviews.llvm.org/D101070
-
jacquesguan authored
This patch supports the scalable splat part for scalarizeExtractedBinop. Differential Revision: https://reviews.llvm.org/D129725
-
Slava Gurevich authored
This reverts commit b9aedd94.
-
jacquesguan authored
This patch adds constant folder for Exp2Op which only supports single and double precision floating-point. Differential Revision: https://reviews.llvm.org/D130472
-