- Mar 24, 2020
-
-
Justin Hibbits authored
The e500 core has a silicon bug that triggers an illegal instruction program trap on any sync other than msync. Other cores will typically ignore illegal sync types, and the documentation even implies that the 'illegal' bits are ignored. Address this hardware deficiency by only using msync, like the PPC440. Differential Revision: https://reviews.llvm.org/D76614
-
Richard Smith authored
-
Ladd Van Tol authored
Summary: When building a large Xcode project with multiple module dependencies, and mixed Objective-C & Swift, I observed a large number of clang processes stalling at zero CPU for 30+ seconds throughout the build. This was especially prevalent on my 18-core iMac Pro. After some sampling, the major cause appears to be the lock file implementation for precompiled modules in the module cache. When the lock is heavily contended by multiple clang processes, the exponential backoff runs in lockstep, with some of the processes sleeping for 30+ seconds in order to acquire the file lock. In the attached patch, I implemented a more aggressive polling mechanism that limits the sleep interval to a max of 500ms, and randomizes the wait time. I preserved a limited form of exponential backoff. I also updated the code to use cross-platform timing, thread sleep, and random number capabilities available in C++11. On iMac Pro (2.3 GHz Intel Xeon W, 18 core): Xcode 11.1 bundled clang: 502.2 seconds (average of 5 runs) Custom clang build with LockFileManager patch applied: 276.6 seconds (average of 5 runs) This is a 1.82x speedup for this use case. On MacBook Pro (4 core 3.1GHz Intel i7): Xcode 11.1 bundled clang: 539.4 seconds (average of 2 runs) Custom clang build with LockFileManager patch applied: 509.5 seconds (average of 2 runs) As expected, machines with fewer cores benefit less from this change. ``` Call graph: 2992 Thread_393602 DispatchQueue_1: com.apple.main-thread (serial) 2992 start (in libdyld.dylib) + 1 [0x7fff6a1683d5] 2992 main (in clang) + 297 [0x1097a1059] 2992 driver_main(int, char const**) (in clang) + 2803 [0x1097a5513] 2992 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (in clang) + 1608 [0x1097a7cc8] 2992 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (in clang) + 3299 [0x1097dace3] 2992 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (in clang) + 509 [0x1097dcc1d] 2992 clang::FrontendAction::Execute() (in clang) + 42 [0x109818b3a] 2992 clang::ParseAST(clang::Sema&, bool, bool) (in clang) + 185 [0x10981b369] 2992 clang::Parser::ParseFirstTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (in clang) + 37 [0x10983e9b5] 2992 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&) (in clang) + 141 [0x10983ecfd] 2992 clang::Parser::ParseExternalDeclaration(clang::Parser::ParsedAttributesWithRange&, clang::ParsingDeclSpec*) (in clang) + 695 [0x10983f3b7] 2992 clang::Parser::ParseObjCAtDirectives(clang::Parser::ParsedAttributesWithRange&) (in clang) + 637 [0x10a9be9bd] 2992 clang::Parser::ParseModuleImport(clang::SourceLocation) (in clang) + 170 [0x10c4841ba] 2992 clang::Parser::ParseModuleName(clang::SourceLocation, llvm::SmallVectorImpl<std::__1::pair<clang::IdentifierInfo*, clang::SourceLocation> >&, bool) (in clang) + 503 [0x10c485267] 2992 clang::Preprocessor::Lex(clang::Token&) (in clang) + 316 [0x1098285cc] 2992 clang::Preprocessor::LexAfterModuleImport(clang::Token&) (in clang) + 690 [0x10cc7af62] 2992 clang::CompilerInstance::loadModule(clang::SourceLocation, llvm::ArrayRef<std::__1::pair<clang::IdentifierInfo*, clang::SourceLocation> >, clang::Module::NameVisibilityKind, bool) (in clang) + 7989 [0x10bba6535] 2992 compileAndLoadModule(clang::CompilerInstance&, clang::SourceLocation, clang::SourceLocation, clang::Module*, llvm::StringRef) (in clang) + 296 [0x10bba8318] 2992 llvm::LockFileManager::waitForUnlock() (in clang) + 91 [0x10b6953ab] 2992 nanosleep (in libsystem_c.dylib) + 199 [0x7fff6a22c914] 2992 __semwait_signal (in libsystem_kernel.dylib) + 10 [0x7fff6a2a0f32] ``` Differential Revision: https://reviews.llvm.org/D69575 -
Fred Riss authored
Summary: The default behavior of Platform::PutFile is to open the file and truncate it if it already exists. This works fine and is a sensible default, but it interacts badly with code-signing on iOS, as doing so invalidates the signature of the file (even if the new content has a valid code signature). We have a couple tests which on purpose reload a different binary with the same name. Those tests are currently broken because of the above interaction. This patch simply makes the Darwin platform unconditionally delete the destination file before sending the new one to work around this issue. Reviewers: jasonmolenda Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D76450
-
Eli Friedman authored
Add the relevant magic bits to allow "-mllvm=-load=plugin.so" etc. This is now using export_executable_symbols_for_plugins, so symbols are only exported if plugins are enabled. Differential Revision: https://reviews.llvm.org/D75879
-
LLVM GN Syncbot authored
-
Simon Pilgrim authored
This was noticed on D71817, which removed another use of __OPTIMIZE__ Differential Revision: https://reviews.llvm.org/D76622
-
Matt Arsenault authored
There seems to be a small benefit to the legalized sequence for v2f16 round with packed instructions, so allow vectorizing it by reducing the cost. An unintended side effect is vectorization of f32 round also happens. The current FMA logic seems off to me, and isn't checking for packed instructions.
-
Alexandre Ganea authored
On Windows, when the LLVM toolchain is in the current path (%PATH%), fusing the linker yields c:\{path}\lld.exe whereas the hip tests did not expect the .exe part. This only happens if LLD is not present in the build folder, which consequently makes the code in Driver::GetProgramPath() to fall back to %PATH% and platform-specific search, which includes the .exe part (see https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/Driver.cpp#L4733). Differential Revision: https://reviews.llvm.org/D76631 -
Matt Arsenault authored
These are equivalent. The generic rotate builtins do not directly map to the fshr intrinsic.
-
Matt Arsenault authored
-
Kirstóf Umann authored
[analyzer][NFC] Move the text output type to its own file, move code to PathDiagnosticConsumer creator functions TableGen and .def files (which are meant to be used with the preprocessor) come with obvious downsides. One of those issues is that generated switch-case branches have to be identical. This pushes corner cases either to an outer code block, or into the generated code. Inspect the removed code in AnalysisConsumer::DigestAnalyzerOptions. You can see how corner cases like a not existing output file, the analysis output type being set to PD_NONE, or whether to complement the output with additional diagnostics on stderr lay around the preprocessor generated code. This is a bit problematic, as to how to deal with such errors is not in the hands of the users of this interface (those implementing output types, like PlistDiagnostics etc). This patch changes this by moving these corner cases into the generated code, more specifically, into the called functions. In addition, I introduced a new output type for convenience purposes, PD_TEXT_MINIMAL, which always existed conceptually, but never in the actual Analyses.def file. This refactoring allowed me to move TextDiagnostics (renamed from ClangDiagPathDiagConsumer) to its own file, which it really deserved. Also, those that had the misfortune to gaze upon Analyses.def will probably enjoy the sight that a clang-format did on it. Differential Revision: https://reviews.llvm.org/D76509
-
Fangrui Song authored
Debian and some other distributions install llvm-strip as llvm-strip-$major (e.g. `/usr/bin/llvm-strip-9`) D54193 made it work with llvm-strip-$major but did not add a test. The behavior was regressed by D69146. Fixes https://github.com/ClangBuiltLinux/linux/issues/940 Reviewed By: alexshap Differential Revision: https://reviews.llvm.org/D76562
-
Stefanos Baziotis authored
Reviewed By: sstefan1, uenoku Differential Revision: https://reviews.llvm.org/D76175
-
Jim Ingham authored
There an option: EvaluateExpressionOptions::SetResultIsInternal to indicate whether the result number should be returned to the pool or not. It got broken when the PersistentExpressionState was refactored. This fixes the issue and provides a test of the behavior. Differential Revision: https://reviews.llvm.org/D76532
-
Ilya Leoshkevich authored
Summary: Move interceptor from msan to sanitizer_common_interceptors.inc, so that other sanitizers could benefit. Adjust FixedCVE_2016_2143() to deal with the intercepted uname(). Patch by Ilya Leoshkevich. Reviewers: eugenis, vitalybuka, uweigand, jonpa Reviewed By: eugenis, vitalybuka Subscribers: dberris, krytarowski, #sanitizers, stefansf, Andreas-Krebbel Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D76578
-
Vitaly Buka authored
-
Matt Arsenault authored
Since intrinsics can now specify when an argument is required to be constant, it is now OK to replace arguments with variables if they aren't. This means intrinsics must now be accurately marked with immarg.
-
Johannes Doerfert authored
See rational here: https://reviews.llvm.org/D71830#1922656 Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D76173
-
Johannes Doerfert authored
See rational here: https://reviews.llvm.org/D71847#1922648 Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D76170
-
Eli Friedman authored
The only reason we export symbols from these tools is to support plugins; if we don't have plugins, exporting symbols just bloats the executable and makes LTO less effective. See review of D75879 for the discussion that led to this patch. Differential Revision: https://reviews.llvm.org/D76527
-
LLVM GN Syncbot authored
-
Jonas Devlieghere authored
Revert "[analyzer][NFC] Tie CheckerRegistry to CheckerManager, allow CheckerManager to be constructed for non-analysis purposes" Temporarily reverting this patch because it breaks the modules build.
-
Matt Arsenault authored
-
Matt Arsenault authored
Currently all GlobalISel unittests use a hardcoded AArch64 target machine. Factor this so I can write some for AMDGPU specific known bits unittests.
-
Matt Arsenault authored
I think we can save the MRI argument from these since it's in GISelKnownBits already, but currently not accessible. Implementation deferred to avoid dependency on other patches.
-
Andrew Ng authored
Differential Revision: https://reviews.llvm.org/D76544
-
MaheshRavishankar authored
When trying to fold an operation during operation creation check that the operation folding succeeds before inserting the op. Differential Revision: https://reviews.llvm.org/D76415
-
shafik authored
This adds a formatter for libc++ std::unique_ptr. I also refactored GetValueOfCompressedPair(...) out of LibCxxList.cpp since I need the same functionality and it made sense to share it. Differential Revision: https://reviews.llvm.org/D76476
-
Fangrui Song authored
[CMake] Fix AMDGPUTests -DBUILD_SHARED_LIBS=on builds and trim dependencies of AMDGPUTests and AMDDwarfTests after D76357/G24698e52 FAILED: unittests/Target/AMDGPU/AMDGPUTests ... ld.lld: error: undefined symbol: llvm::MCRegisterInfo::getLLVMRegNum(unsigned int, bool) const >>> referenced by DwarfRegMappings.cpp:60 (/usr/local/google/home/maskray/llvm/llvm/unittests/Target/AMDGPU/DwarfRegMappings.cpp:60) >>> unittests/Target/AMDGPU/CMakeFiles/AMDGPUTests.dir/DwarfRegMappings.cpp.o:(AMDGPUDwarfRegMappingTests_TestWave64DwarfRegMapping_Test::TestBody()) >>> referenced by DwarfRegMappings.cpp:82 (/usr/local/google/home/maskray/llvm/llvm/unittests/Target/AMDGPU/DwarfRegMappings.cpp:82) >>> unittests/Target/AMDGPU/CMakeFiles/AMDGPUTests.dir/DwarfRegMappings.cpp.o:(AMDGPUDwarfRegMappingTests_TestWave32DwarfRegMapping_Test::TestBody()) A -DBUILD_SHARED_LIBS=off build is good because AMDGPUCodeGen pulls in MC. A -DBUILD_SHARED_LIBS=on build requires all direct dependencies (MC) to be listed becuase llvm/cmake/modules/HandleLLVMOptions.cmake uses -Wl,-z,defs
-
Chris Lattner authored
Summary: Also eliminate the redunant anon namespace around the already static function. Reviewers: herhut Subscribers: hiraditya, steven_wu, dexonsmith, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D76627
-
Sanjay Patel authored
Two one-use checks were added with rGfdcb2710, but only the first one is necessary to limit an increase in instruction count. The second transform only creates one instruction, so it is always a reasonable canonicalization/optimization.
-
Fangrui Song authored
This behavior matches GNU ld and seems reasonable. ``` // If a SECTIONS command is not specified .text.* -> .text .rodata.* -> .rodata .init_array.* -> .init_array ``` A proposed Linux feature CONFIG_FG_KASLR may depend on the GNU ld behavior. Reword a comment about -z keep-text-section-prefix and a comment about CommonSection (deleted by rL286234). Reviewed By: grimar Differential Revision: https://reviews.llvm.org/D75225
-
LLVM GN Syncbot authored
-
Fangrui Song authored
-
Jonathan Coe authored
Reviewers: krasimir Reviewed By: krasimir Subscribers: cfe-commits, MyDeveloperDay Tags: #clang-format, #clang Differential Revision: https://reviews.llvm.org/D76621
-
Alexey Bataev authored
Added basic support (parsing/sema/serialization) for exclusive clause in scan directives.
-
AndreyChurbanov authored
Added missed initialization of td_last_tied field for taskloop tasks. Differential Revision: https://reviews.llvm.org/D75673
-
Fangrui Song authored
-
Jonas Devlieghere authored
Reproducers are unsupported on Windows. Rather than having a UNSUPPORTED line in every test, just skip the whole subdirectory.
-