- Oct 31, 2022
-
-
Michał Górny authored
This reverts commit 64959325. It broke the flang-aarch64-out-of-tree buildbot.
-
David Spickett authored
+all includes it since 5d67b051.
-
Brendon Cahoon authored
The existing way of creating the predicate in the guard blocks uses a boolean value per outgoing block. This increases the number of live booleans as the number of outgoing blocks increases. The new way added in this change is to store one integer to represent the outgoing block we want to branch to, then at each guard block, an integer equality check is performed to decide which a specific outgoing block is taken. Using an integer reduces the number of live values and decreases register pressure especially in cases where there are a large number of outgoing blocks. The integer based approach is used when the number of outgoing blocks crosses a threshold, which is currently set to 32. Patch by Ruiling Song. Differential review: https://reviews.llvm.org/D127831
-
Michał Górny authored
Exclude building googletest and LLVMTestingSupport libraries from the `all` target. If unittests are being built, these libraries will be built as a dependency anyway. If they are not being built, building them makes little sense as they are not installed or used otherwise. This will also make standalone builds of other projects easier, as it makes it possible to include these directories without having to cover them with additional conditions to prevent them from being built unconditionally. Differential Revision: https://reviews.llvm.org/D137035
-
Nikita Popov authored
-
Valentin Clement authored
The runtime function `AllocatableDeallocate/PointerDeallocate` is reponsible to deallocate and finalize it. This patch just adds tests to make sure the correct runtime function is called. Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D137068
-
Haojian Wu authored
Allowing us to test this feature (context: a recent crash in semantic highlighting.) Differential Revision: https://reviews.llvm.org/D137063
-
David Sherwood authored
This patch adds the assembly/disassembly for the following instructions: sqrshrn : Signed saturating rounding shift right narrow by immediate and interleave sqrshrun : Signed saturating rounding shift right unsigned narrow by immediate and interleave uqrshrn : Unsigned saturating rounding shift right narrow by immediate and interleave The reference can be found here: https://developer.arm.com/documentation/ddi0602/2022-09 Differential Revision: https://reviews.llvm.org/D136690
-
Brendon Cahoon authored
Differential review: https://reviews.llvm.org/D127830
-
Chuanqi Xu authored
Now isa supports the variant args, which could simplify the codes further. This patch simplify the uses in clang/Serialization
-
Sanjay Patel authored
This is a sibling to: 6064e92b ...but we canonicalize the shl+add to shl+xor, so the pattern is different than I expected: https://alive2.llvm.org/ce/z/8CX16e I have not found any patterns that are safe to propagate no-wrap, so that is not included here.
-
Sanjay Patel authored
-
David Green authored
The sme2 predicate was as AssemblerPredicate, not AssemblerPredicateWithAll like all the other features, meaning it wasn't included in +all. This fixes that inconsistency, allowing the instructions to be decoded by default. Differential Revision: https://reviews.llvm.org/D137016
-
Simon Pilgrim authored
[X86] combineConcatVectorOps - fold concat(GF2P8AFFINEQB(x,y,c),GF2P8AFFINEQB(z,w,c)) -> GF2P8AFFINEQB(concat(x,z),concat(y,w),c) Pulled out of D137026
-
Michael Buch authored
This patch implements the `GetFunctionDisplayName` API which gets used by the frame-formatting code to decide how to print a function name. Currently this API trivially returns `false`, so we try to parse the demangled function base-name by hand. We try find the closing parenthesis by doing a forward scan through the demangled name. However, for arguments that contain parenthesis (e.g., function pointers) this would leave garbage in the frame function name. By re-using the `CPlusPlusLanguage` parser for this we offload the need to parse function names to a component that knows how to do this already. We leave the existing parsing code in `FormatEntity` since it's used in cases where a language-plugin is not available (and is not necessarily C++ specific). **Example** For following function: ``` int foo(std::function<int(void)> const& func) { return 1; } ``` Before patch: ``` frame #0: 0x000000010000151c a.out`foo(func= Function = bar() )> const&) at sample.cpp:11:49 ``` After patch: ``` frame #0: 0x000000010000151c a.out`foo(func= Function = bar() ) at sample.cpp:11:49 ``` **Testing** * Added shell test -
Michael Buch authored
This patch adds a way to extract the return type out of the `CPlusPlusNameParser`. This will be useful for cases where we want a function's basename *and* the return type but not the function arguments; this is currently not possible (the parser either gives us the full name or just the basename). Since the parser knows how to handle return types already we should just expose this to users that need it. **Testing** * Added unit-tests Differential Revision: https://reviews.llvm.org/D136935
-
Michael Buch authored
Hopefully makes the code more readable and allows us to re-use argument pretty-printing code from the `CPlusPlusLanguage` plugin in a follow-up commit. Differential Revision: https://reviews.llvm.org/D136934
-
Simon Pilgrim authored
Add explicit cast to fix MSVC error: "'return': cannot convert from 'int (__cdecl *)(int)' to '`anonymous-namespace'::Plus1FunctionRef::FuncT'"
-
Tom Eccles authored
Only add the option processing and store the result. No attributes are added to FIR yet. Only the "off" and "fast" options are supported. "fast-honor-pragmas" is not applicable because we do not implement `#pragma clang fp contract()` in Fortran [1]. "on" is not supported because it is unclear how to fuse only within individual statements. gfortran also does not implement "on": treating it as an "off". Currently the default value is "off" to preserve existing behavior. gfortran uses "fast" by default and that may be the right thing for flang-new after further discussion in the future, but that can be changed separately. gfortran's documentation is available [[ https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html | here ]]. [1] https://clang.llvm.org/docs/LanguageExtensions.html#extensions-to-specify-floating-point-flags Reviewed By: vzakhari, awarzynski Differential Revision: https://reviews.llvm.org/D136080
-
Sander de Smalen authored
This aligns with what was done for SVE, which consistently uses 32bit immediates at the LLVM IR level. Additionally, this change forces the intrinsic operands to be immediates using ImmArg<>, which subsequently requires the codegenerator to match TargetConstants instead of Constants. Reviewed By: paulwalker-arm Differential Revision: https://reviews.llvm.org/D136933
-
Benjamin Kramer authored
Found by msan -fsanitize-memory-use-after-dtor. ==8259==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x55dbec54d2b8 in dtorRecord(clang::interp::Block*, char*, clang::interp::Descriptor*) clang/lib/AST/Interp/Descriptor.cpp:150:22 #1 0x55dbec54bfcf in dtorArrayDesc(clang::interp::Block*, char*, clang::interp::Descriptor*) clang/lib/AST/Interp/Descriptor.cpp:97:7 #2 0x55dbec508578 in invokeDtor clang/lib/AST/Interp/InterpBlock.h:79:7 #3 0x55dbec508578 in clang::interp::Program::~Program() clang/lib/AST/Interp/Program.h:55:19 #4 0x55dbec50657a in operator() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:55:5 #5 0x55dbec50657a in std::__msan::unique_ptr<clang::interp::Program, std::__msan::default_delete<clang::interp::Program>>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:261:7 #6 0x55dbec5035a1 in clang::interp::Context::~Context() clang/lib/AST/Interp/Context.cpp:27:22 #7 0x55dbebec1daa in operator() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:55:5 #8 0x55dbebec1daa in std::__msan::unique_ptr<clang::interp::Context, std::__msan::default_delete<clang::interp::Context>>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:261:7 #9 0x55dbebe285f9 in clang::ASTContext::~ASTContext() clang/lib/AST/ASTContext.cpp:1038:40 #10 0x55dbe941ff13 in llvm::RefCountedBase<clang::ASTContext>::Release() const llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:101:7 #11 0x55dbe94353ef in release llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:159:38 #12 0x55dbe94353ef in release llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:224:7 #13 0x55dbe94353ef in ~IntrusiveRefCntPtr llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:191:27 #14 0x55dbe94353ef in clang::CompilerInstance::setASTContext(clang::ASTContext*) clang/lib/Frontend/CompilerInstance.cpp:178:3 #15 0x55dbe95ad0ad in clang::FrontendAction::EndSourceFile() clang/lib/Frontend/FrontendAction.cpp:1100:8 #16 0x55dbe9445fcf in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) clang/lib/Frontend/CompilerInstance.cpp:1047:11 #17 0x55dbe6b3afef in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:266:25 #18 0x55dbe6b13288 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) clang/tools/driver/cc1_main.cpp:250:15 #19 0x55dbe6b0095f in ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) clang/tools/driver/driver.cpp:319:12 #20 0x55dbe6aff41c in clang_main(int, char**) clang/tools/driver/driver.cpp:395:12 #21 0x7f9be07fa632 in __libc_start_main #22 0x55dbe6a702e9 in _start Member fields were destroyed #0 0x55dbe6a7da5d in __sanitizer_dtor_callback_fields compiler-rt/lib/msan/msan_interceptors.cpp:949:5 #1 0x55dbec5094ac in ~SmallVectorImpl llvm/include/llvm/ADT/SmallVector.h:479:7 #2 0x55dbec5094ac in ~SmallVectorImpl llvm/include/llvm/ADT/SmallVector.h:612:3 #3 0x55dbec5094ac in llvm::SmallVector<clang::interp::Record::Base, 8u>::~SmallVector() llvm/include/llvm/ADT/SmallVector.h:1207:3 #4 0x55dbec508e79 in clang::interp::Record::~Record() clang/lib/AST/Interp/Record.h:24:7 #5 0x55dbec508612 in clang::interp::Program::~Program() clang/lib/AST/Interp/Program.h:49:26 #6 0x55dbec50657a in operator() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:55:5 #7 0x55dbec50657a in std::__msan::unique_ptr<clang::interp::Program, std::__msan::default_delete<clang::interp::Program>>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:261:7 #8 0x55dbec5035a1 in clang::interp::Context::~Context() clang/lib/AST/Interp/Context.cpp:27:22 #9 0x55dbebec1daa in operator() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:55:5 #10 0x55dbebec1daa in std::__msan::unique_ptr<clang::interp::Context, std::__msan::default_delete<clang::interp::Context>>::~unique_ptr() third_party/crosstool/v18/stable/toolchain/bin/../include/c++/v1/__memory/unique_ptr.h:261:7 #11 0x55dbebe285f9 in clang::ASTContext::~ASTContext() clang/lib/AST/ASTContext.cpp:1038:40 #12 0x55dbe941ff13 in llvm::RefCountedBase<clang::ASTContext>::Release() const llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:101:7 #13 0x55dbe94353ef in release llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:159:38 #14 0x55dbe94353ef in release llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:224:7 #15 0x55dbe94353ef in ~IntrusiveRefCntPtr llvm/include/llvm/ADT/IntrusiveRefCntPtr.h:191:27 #16 0x55dbe94353ef in clang::CompilerInstance::setASTContext(clang::ASTContext*) clang/lib/Frontend/CompilerInstance.cpp:178:3 #17 0x55dbe95ad0ad in clang::FrontendAction::EndSourceFile() clang/lib/Frontend/FrontendAction.cpp:1100:8 #18 0x55dbe9445fcf in clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) clang/lib/Frontend/CompilerInstance.cpp:1047:11 #19 0x55dbe6b3afef in clang::ExecuteCompilerInvocation(clang::CompilerInstance*) clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:266:25 #20 0x55dbe6b13288 in cc1_main(llvm::ArrayRef<char const*>, char const*, void*) clang/tools/driver/cc1_main.cpp:250:15 #21 0x55dbe6b0095f in ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) clang/tools/driver/driver.cpp:319:12 #22 0x55dbe6aff41c in clang_main(int, char**) clang/tools/driver/driver.cpp:395:12 #23 0x7f9be07fa632 in __libc_start_main #24 0x55dbe6a702e9 in _start -
Hassnaa Hamdi authored
When streaming mode is enabled, lower some operations and disable some code paths; to force generateing code compatible to streaming mode. Add streaming-mode flag for new sve-fixed-length testing files: build_vector.ll concat.ll extract-subvector.ll extract-vector-elt.ll int-shifts.ll loads.ll shuffle.ll stores.ll Differential Revision: https://reviews.llvm.org/D135564
-
chenglin.bi authored
((X >> C) - Y) + Z --> (Z - Y) + (X >> C) Fix AArch part: #55714 Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D136158
-
Kiran Chandramohan authored
The OpenMP standard specifies the region inside to be a structured block. This means that branches into or out of the region is not permitted but branches are permitted inside the OpenMP single region. This is currently modeled by having a region of kind `AnyRegion` for all the OpenMP ops. In future we can have a more strictly defined region. Fixes #58396. Reviewed By: peixin Differential Revision: https://reviews.llvm.org/D137023
-
Kadir Cetinkaya authored
Differential Revision: https://reviews.llvm.org/D136951
-
Haojian Wu authored
Differential Revision: https://reviews.llvm.org/D137064
-
Matthias Springer authored
Run mlir-opt with `-debug-only="one-shot-analysis"` for detailed debug output. Differential Revision: https://reviews.llvm.org/D135549
-
Valentin Clement authored
Fortran standard 7.3.2.3 point 7 mentions that a diassociated pointer dynamic type is its declared type. in 9.7.2 note 1, when a NULLIFY statement is applied to a polymorphic pointer, its dynamic type becomes the same as its declared type. This patch enforce these standard points by calling the runtime function `PointerNullifyDerived` with the declared type descriptor. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D136948
-
Nikita Popov authored
This adds the usual complement of APIs for creating and fetching a non-trivial attribute. Split out from D135780.
-
Matthias Springer authored
When running with `-debug`, print the IR after bufferizing each op. Differential Revision: https://reviews.llvm.org/D137065
-
Alan Hu authored
Follow-up to D135524, to replace two more deprecated C functions in the OCaml bindings. const_in_bounds_gep now accepts the source element type as argument, and const_element has been changed into aggregate_element, which works on a wider range of constants and returns an option. Differential Revision: https://reviews.llvm.org/D136914
-
Geza Lore authored
programUndefinedIfUndefOrPoison used to eagerly propagate the fact that a value is poison to the users of the value. The problem is that if the value has a lot of uses (orders of magnitude more than the scanning limit we use in this function), then we spend the bulk of our time in eagerly propagating the poison property, which we will mostly never use later anyway due to the scanning limit. I have a test case (of ~50k lines of machine generated C++), where this results in ~60% of 35s compilation time being spent doing just this eager propagation. This patch changes programUndefinedIfUndefOrPoison to only propagate to instructions actually visited, looking back to see if their operands are poison. This should be equivalent and no functional change is intended, but we regain virtually all of the 60% compilation time spent in this function in my test case (i.e.: a 2.5x total compilation speedup). Differential Revision: https://reviews.llvm.org/D137027
-
Nikita Popov authored
Rather than switching to a new AAQI instance with empty cache when MayBeCrossIteration is toggled, include the value in the cache key. The implementation redundantly include the information in both sides of the pair, but that seems simpler than trying to store it only on one side. Differential Revision: https://reviews.llvm.org/D136175
-
Valentin Clement authored
fir.dispatch codegen was done in D136189.
-
Nikita Popov authored
This adds the default attributes (nosync, nofree, nocallback, willreturn) to the coro.id and coro.subfn.addr intrinsics. This is needed to avoid optimization regressions in the future. It's probably possible to use default attributes for most other coro intrinsics as well, but I only hit these as problematic in practice. Differential Revision: https://reviews.llvm.org/D136932
-
Serge Pavlov authored
Previously an error raised during an expansion of response files (including configuration files) was ignored and only the fact of its presence was reported to the user with generic error messages. This made it difficult to analyze problems. For example, if a configuration file tried to read an inexistent file, the error message said that 'configuration file cannot be found', which is wrong and misleading. This change enhances handling errors in the expansion so that users could get more informative error messages. Differential Revision: https://reviews.llvm.org/D136090
-
Nikita Popov authored
Place various classes/structs into anonymous namespaces and mark variables as static. As far as I understand, these are all implementation details and not intended to be exported -- only a small number of tsan hooks are supposed to be. Differential Revision: https://reviews.llvm.org/D136845
-
Nikita Popov authored
This adds the default attributes (nocallback, nosync, nofree, willreturn) to some X86 intrinsics. This will be needed to avoid optimization regressions in the future (once we remove the readonly -> willreturn implication for intrinsics). Due to the number of intrinsics, this patch focuses just on the IntrNoMem intrinsics up to the AVX2 section. Differential Revision: https://reviews.llvm.org/D136939
-
Matthias Springer authored
This addresses post-commit comments and should have been part of D136685. Differential Revision: https://reviews.llvm.org/D136923
-
Chuanqi Xu authored
modules From the discussion in https://discourse.llvm.org/t/how-should-we-support-dependency-scanner-for-c-20-modules/66027, we get a consensus that we want to support clang modules and c++ modules at the same time. This patch documents this intention. Reviewed By: bruno Differential Revision: https://reviews.llvm.org/D136221
-