- Sep 18, 2023
-
-
Chuanqi Xu authored
This reverts commit 6998ecd3.
-
Kohei Asano authored
(cherry picked from commit fef82492)
-
Martin Storsjö authored
The trick we use (since cbc2a062) for exporting the __chkstk function (with various per-arch names) that is defined in a different object file, relies on the function already being linked in (by some function referencing it). This function does end up referenced if there's a function that allocates more than 4 KB on the stack. In most cases, it's referenced somewhere, but in the case of builds with LLVM_LINK_LLVM_DYLIB enabled (so most of the code resides in a separate libLLVM-<ver>.dll) the only code in lli.exe is the lli tool specific code and the mingw-w64 crt startup code. In the case of GCC based MinGW i386 builds with LLVM_LINK_LLVM_DYLIB, nothing else references it though. Manually add a reference to the function to make sure it is linked in (from libgcc or compiler-rt builtins) so that it can be exported. This fixes one build issue encountered in https://github.com/msys2/MINGW-packages/pull/18002. Differential Revision: https://reviews.llvm.org/D159085 (cherry picked from commit 4bba12f7)
-
David Green authored
This removes the backend requirement for crc instructions on HasV8, relying on just HasCRC instead. This should allow them to be selected with ArmV7 + crc, making them more usable whilst hopefully not making them incorrectly generated (they only come from intrinsics, and HasCRC usually requires HasV8). This is how most other instructions are specified. (cherry picked from commit a82c106e)
-
- Sep 14, 2023
-
-
Peter Klausler authored
This patch enables the Fortran runtime support library to be built without native 128-bit integer support in the C++ compiler. Experimental: do not merge yet. Differential Revision: https://reviews.llvm.org/D154660 (cherry picked from commit 1c35c1a7)
-
- Sep 11, 2023
-
-
Sam James authored
As reported by mgorny at https://reviews.llvm.org/D159115#4638037, the unsigned long long cast fails on 32-bit systems at least with GCC. It looks like a pointer provenance/aliasing issue rather than a bug in GCC. Acked by Vassil Vassilev on the original revision. (cherry picked from commit 3403686b)
-
Jessica Clarke authored
Whilst Clang does not use these, recent GCC does, and so on systems such as FreeBSD that wish to use compiler-rt as the system runtime library but also wish to support building programs with GCC these interfaces are needed. This is a light adaptation of the code committed to GCC by Sebastian Pop <spop@amazon.com>, relicensed with permission for use in compiler-rt. Fixes https://github.com/llvm/llvm-project/issues/63483 Reviewed By: sebpop, MaskRay Differential Revision: https://reviews.llvm.org/D158536 (cherry picked from commit 4bb2416d)
-
Wael Yehia authored
-
Tejas Joshi authored
The following commit enabled the analysis of ranges for heap allocations: 22ca38da The range turns out to be empty in cases such as the one in test (which is [1,1)), leading to an assertion failure. This patch fixes for the same case. Fixes https://github.com/llvm/llvm-project/issues/63856 Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D159160 (cherry picked from commit 0609b65a)
-
Igor Kirillov authored
When replacing ComplexDeinterleavingPass::ReductionOperation, we can do it either from the Real or Imaginary part. The correct way is to take whichever is later in the BasicBlock, but before the patch, we just always took the Real part. Fixes https://github.com/llvm/llvm-project/issues/65044 Differential Revision: https://reviews.llvm.org/D159209 (cherry picked from commit e2cb07c3)
-
Danila Malyutin authored
(cherry picked from commit 2fce8f74)
-
Konstantin Varlamov authored
This patch effectively maintains the status quo, making sure that the safe mode keeps working the same way as before. Hardening will target the next major release, allowing it to go through RFC and for the implementation to stabilize and mature. Differential Revision: https://reviews.llvm.org/D159171
-
Igor Kirillov authored
When a loop has multiple reductions, each with an intermediate invariant store, the order in which those reductions are processed is not considered. This can result in the invariant stores outside the loop not preserving the original order. This patch sorts VPReductionPHIRecipes by the order in which they have stores in the original loop before running `InnerLoopVectorizer::fixReduction` function, and it helps to maintain the correct order of stores. Fixes https://github.com/llvm/llvm-project/issues/64047 Differential Revision: https://reviews.llvm.org/D157631 (cherry picked from commit ac65fb86)
-
Igor Kirillov authored
Differential Revision: https://reviews.llvm.org/D157630 (cherry picked from commit 2df9ed11)
-
- Sep 07, 2023
-
-
Arthur Eubanks authored
-
- Sep 05, 2023
-
-
Christian Sigg authored
This is probably a bad idea, but it's only become a problem with properties and is easy to fix. Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D159185
-
Takuya Shimizu authored
The associated commit was reverted and backported in a93ca35a, so this release note line should also be removed. This reverts commit 061e8557.
-
Younan Zhang authored
`clang::runWithSufficientStackSpace` requires the address of the initial stack bottom to prevent potential stack overflows. In addition, add a fallback to ASTFrontendAction in case any client forgets to call it when not through CompilerInstance::ExecuteAction, which is rare. Fixes https://github.com/clangd/clangd/issues/1745. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D158967 (cherry picked from commit e257c0a9)
-
Younan Zhang authored
We're expecting a SubstitutionDiagnostic in diagnoseUnsatisfiedRequirement if the status of ExprRequirement is SubstFailure. Previously, the Requirement was created with Expr on SubstFailure by mistake, which could lead to the assertion failure in the subsequent diagnosis. Fixes https://github.com/clangd/clangd/issues/1726 Fixes https://github.com/llvm/llvm-project/issues/64723 Fixes https://github.com/llvm/llvm-project/issues/64172 In addition, this patch also fixes an invalid test from D129499. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D158061
-
Elizabeth Andrews authored
Differential Revision: https://reviews.llvm.org/D157554
-
Fangrui Song authored
When the optional assignment-allocation character 'm' (Extension to the ISO C standard) is present, we currently use internal_strlen(buf)+1 for all of cCsS[ (D85350). Fix cCS to use the correct size. Fix https://github.com/llvm/llvm-project/issues/61768 Reviewed By: #sanitizers, vitalybuka Differential Revision: https://reviews.llvm.org/D158485 (cherry picked from commit beeb37a8)
-
- Sep 04, 2023
-
-
Vassil Vassilev authored
This patch fixes valgrind reports from downstream consumers about conditional jump over uninitialised memory. The original report: ```[ RUN ] ScopeReflectionTest.IsComplete ==987150== Conditional jump or move depends on uninitialised value(s) ==987150== at 0x1E1128F: clang::CodeGen::CodeGenModule::SetLLVMFunctionAttributesForDefinition(clang::Decl const*, llvm::Function*) (CodeGenModule.cpp:2391) ==987150== by 0x1E4F181: clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(clang::GlobalDecl, llvm::GlobalValue*) (CodeGenModule.cpp:5669) ==987150== by 0x1E4A194: clang::CodeGen::CodeGenModule::EmitGlobalDefinition(clang::GlobalDecl, llvm::GlobalValue*) (CodeGenModule.cpp:3909) ==987150== by 0x1E4A752: clang::CodeGen::CodeGenModule::EmitGlobal(clang::GlobalDecl) (CodeGenModule.cpp:3649) ==987150== by 0x1E532F5: clang::CodeGen::CodeGenModule::EmitTopLevelDecl(clang::Decl*) [clone .part.0] (CodeGenModule.cpp:6563) ==987150== by 0x1B0BEDD: (anonymous namespace)::CodeGeneratorImpl::HandleTopLevelDecl(clang::DeclGroupRef) (ModuleBuilder.cpp:190) ==987150== by 0x1AEA47B: clang::BackendConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (CodeGenAction.cpp:235) ==987150== by 0x101B02F: clang::IncrementalASTConsumer::HandleTopLevelDecl(clang::DeclGroupRef) (IncrementalParser.cpp:52) ==987150== by 0x101ED93: clang::IncrementalParser::ParseOrWrapTopLevelDecl() (IncrementalParser.cpp:276) ==987150== by 0x101FBBC: clang::IncrementalParser::Parse(llvm::StringRef) (IncrementalParser.cpp:342) ==987150== by 0x100E104: clang::Interpreter::Parse(llvm::StringRef) (Interpreter.cpp:360) ==987150== by 0xE734C0: Cpp::Interpreter::Parse(llvm::StringRef) (CppInterOpInterpreter.h:172) ==987150== Uninitialised value was created by a heap allocation ==987150== at 0x844BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) ==987150== by 0x1B0C882: StartModule (ModuleBuilder.cpp:139) ==987150== by 0x1B0C882: clang::CodeGenerator::StartModule(llvm::StringRef, llvm::LLVMContext&) (ModuleBuilder.cpp:360) ==987150== by 0x101C4AF: clang::IncrementalParser::GenModule() (IncrementalParser.cpp:372) ==987150== by 0x101FC0E: clang::IncrementalParser::Parse(llvm::StringRef) (IncrementalParser.cpp:362) ==987150== by 0x100E104: clang::Interpreter::Parse(llvm::StringRef) (Interpreter.cpp:360) ==987150== by 0x100E243: clang::Interpreter::create(std::unique_ptr<clang::CompilerInstance, std::default_delete<clang::CompilerInstance> >) (Interpreter.cpp:279) ==987150== by 0xF2131A: compat::createClangInterpreter(std::vector<char const*, std::allocator<char const*> >&) (Compatibility.h:123) ==987150== by 0xF22AB9: Cpp::Interpreter::Interpreter(int, char const* const*, char const*, std::vector<std::shared_ptr<clang::ModuleFileExtension>, std::allocator<std::shared_ptr<clang::ModuleFileExtension> > > const&, void*, bool) (CppInterOpInterpreter.h:146) ==987150== by 0xF1827A: CreateInterpreter (CppInterOp.cpp:2494) ==987150== by 0xECFA0E: TestUtils::GetAllTopLevelDecls(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<clang::Decl*, std::allocator<clang::Decl*> >&, bool) (Utils.cpp:23) ==987150== by 0xE9CB85: ScopeReflectionTest_IsComplete_Test::TestBody() (ScopeReflectionTest.cpp:71) ==987150== by 0xF0ED0C: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) (in /home/vvassilev/workspace/builds/scratch/cppyy/InterOp/build-with-clang-repl-release/unittests/CppInterOp/CppInterOpTests) ==987150== ``` Differential revision: https://reviews.llvm.org/D159339 (cherry picked from commit 92246a9b)
-
Fangrui Song authored
This patch amends D151590 to not error for unlaimed TargetSpecific options for `-x assembler` input files. This input type causes Driver to construct tools::ClangAs (-fintegrated-as) or other assemblers (e.g. tools::gnutools::Assembler) Their ConstructJobs methods, unlike Clang::ConstructJobs, claim very few options. If an option is unclaimed, it either leads to a -Wunused-command-line-argument warning or an error (if `TargetSpecific` is set): ``` % clang '-###' --target=aarch64 -mbranch-protection=bti -c a.s clang: error: unsupported option '-mbranch-protection=' for target 'aarch64' ``` It seems that downgrading the diagnostic to warning is most useful as many users use CFLAGS even for `.s` files: ``` clang --target=aarch64 -mbranch-protection=bti -S a.c clang --target=aarch64 -mbranch-protection=bti -c a.s ``` I decide not to suppress the warning so that -Wunused-command-line-argument lovers still get a warning, and help projects use proper ASFLAGS/CFLAGS/etc. Note: `-mbranch-protection=bti a.S` currently has no warning as `-x assembler-with-cpp` instructs clangDriver to select tools::Clang and claim most options. Revert D159010 to demonstrate that we emit a warning for -mfpmath= for `-x assembler` input. Modify my AIX cleanup cd18efb6 to add an err_drv_unsupported_opt_for_target. Reviewed By: thesamesam Differential Revision: https://reviews.llvm.org/D159173 (cherry picked from commit e9d454d1)
-
hstk30 authored
StN lane memory size set too big lead to alias analysis goes wrong. Fixes https://github.com/llvm/llvm-project/issues/64696 Differential Revision: https://reviews.llvm.org/D158611 (cherry picked from commit db8f6c00)
-
Martin Storsjö authored
Whether a temp file or a pipe is used for preprocessing is an internal detail, this flag has a notable effect on the preprocessing in GNU windres. Without this flag, GNU windres passes command arguments as-is to popen(), which means they get evaluated by a shell without being re-escaped for this case. To mimic this, llvm-windres has manually tried to unescape arguments. When GNU windres is given the --use-temp-file flag, it uses a different API for invoking the preprocessor, and this API takes care of preserving special characters in the command line arguments. For users of GNU windres, this means that by using --use-temp-file, they don't need to do the (quite terrible) double escaping of quotes/spaces etc. The xz project uses the --use-temp-file flag when invoking GNU windres, see https://github.com/tukaani-project/xz/commit/6b117d3b1fe91eb26d533ab16a2e552f84148d47. However as llvm-windres didn't implement this flag and just assumed the GNU windres popen() behaviour, they had to use a different codepath for llvm-windres. That separate codepath for llvm-windres broke later when llvm-windres got slightly more accurate unescaping of lone quotes in 0f4c6b12 / https://reviews.llvm.org/D146848 (fixing a discrepancy to GNU windres as found in https://github.com/llvm/llvm-project/issues/57334), and this was reported in https://github.com/mstorsjo/llvm-mingw/issues/363. Not touching the implementation of the --preprocessor option with respect to the --use-temp-file flag; that option is doubly tricky as GNU windres changed its behaviour in a backwards incompatible way recently (and llvm-windres currently matches the old behaviour). (See https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=21c33bcbe36377abf01614fb1b9be439a3b6de20, https://sourceware.org/bugzilla/show_bug.cgi?id=27594 and https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=5edb8e3f5ad8d74a83fc0df7f6e4514eed0aa77f;hp=3abbafc2aacc6706fea3e3e326e2f08d107c3672 for the behaviour change.) Differential Revision: https://reviews.llvm.org/D159223 (cherry picked from commit 2bcc0fdc)
-
Haojian Wu authored
Fixes https://github.com/llvm/llvm-project/issues/64191 Differential Revision: https://reviews.llvm.org/D156648 (cherry picked from commit 171868dc)
-
- Sep 01, 2023
-
-
Fangrui Song authored
Adjust tests from dd230efe to use -std=c2x instead, as Clang in release/17.x doesn't support -std=c23.
-
Fangrui Song authored
clangDriver depends on clangBasic, so clangBasic should not depend on clangDriver, even just its header. Also remove clangBasic's dependency on LLVMOption. The issue can be seen through the bazel commit d26dd681 which is reverted now. Add hasFlagNoClaim and use it as we don't want to suppress -Wunused-command-line-argument for -mexecute-only just because -fsanitize= is specified.
-
Ying Yi authored
An execute-only target disallows data access to code sections. -fsanitize=function and -fsanitize=kcfi instrument indirect function calls to load a type hash before the function label. This results in a non-execute access to the code section and a runtime error. To solve the issue, -fsanitize=function should not be included in any check group (e.g. undefined) on an execute-only target. If a user passes -fsanitize=undefined, there is no error and no warning. However, if the user explicitly passes -fsanitize=function or -fsanitize=kcfi on an execute-only target, an error will be emitted. Fixes: https://github.com/llvm/llvm-project/issues/64931. Reviewed By: MaskRay, probinson, simon_tatham Differential Revision: https://reviews.llvm.org/D158614
-
Phoebe Wang authored
Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D158952 (cherry picked from commit b667e9c2)
-
Phoebe Wang authored
Split from D158952. (cherry picked from commit 30ec9473)
-
Haojian Wu authored
see the issue https://github.com/llvm/llvm-project/issues/64191 Differential Revision: https://reviews.llvm.org/D156650 (cherry picked from commit dcb28244)
-
Craig Topper authored
This disables the transform if the branch does not have the kill flag set for the AND we want to delete. Ideally we'd be able to share the AND with the AND we create in the expansion, but that's a more complex transform. So this starts with the simple approach to fix miscompile. This should be backported to LLVM 17. Fixes PR65025.ll Reviewed By: asb Differential Revision: https://reviews.llvm.org/D158962 (cherry picked from commit ff6d3338)
-
Amy Kwan authored
[PowerPC][lld] Account for additional X-Forms -> D-Form/DS-Forms load/stores when relaxing initial-exec to local-exec D153645 added additional X-Form load/stores that can be generated for TLS accesses. However, these added instructions have not been accounted for in lld. As a result, lld does not know how to handle them and cannot relax initial-exec to local-exec when the initial-exec sequence contains these additional load/stores. This patch aims to resolve https://github.com/llvm/llvm-project/issues/64424. Differential Revision: https://reviews.llvm.org/D158197 (cherry picked from commit 698b45aa)
-
- Aug 31, 2023
-
-
Simon Tatham authored
The `STGloop` family of pseudo-instructions all expand to a loop which iterates over a region of memory setting all its MTE tags to a given value. The loop writes to the flags in order to check termination. But the unexpanded pseudo-instructions were not marked as modifying the flags. Therefore it was possible for one to end up in a location where the flags were live, and then the loop would corrupt them. We spotted the effect of this in a libc++ test involving a lot of complicated inlining, and haven't been able to construct a smaller test case that demonstrates actual incorrect output code. So my test here is just checking that `implicit-def $nzcv` shows up on the pseudo-instructions as they're output from isel. Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D158262 (cherry picked from commit b09c5759)
-
Mark de Wever authored
Fixes https://llvm.org/PR65011 Reviewed By: #libc, ldionne Differential Revision: https://reviews.llvm.org/D158940 (cherry picked from commit 8930d04d)
-
Yuxuan Shui authored
When sending file from a Linux host to a Windows remote, Linux host will try to copy the source file's permission bits, which will contain `_S_I?GRP` and `_S_I?OTH` bits. Those bits are rejected by `_wsopen_s`, causing it to return EINVAL. This patch masks out the rejected bits. GitHub issue: #64313 Reviewed By: jasonmolenda, DavidSpickett Differential Revision: https://reviews.llvm.org/D156817 (cherry picked from commit 9a4b3fdb)
-
Garvit Gupta authored
Before accessing "getOpcode" thorugh machine instruction, check if the iterator has reached the end of Machine basic block otherwise we will crash at the assertion `!NodePtr->isKnownSentinel()`. The above assertion is hit in "Prologue/Epilogue Insertion & Frame Finalization pass". Reviewed By: craig.topper, wangpc Differential Revision: https://reviews.llvm.org/D158256 (cherry picked from commit fdef7952)
-