- Feb 15, 2024
-
-
Cullen Rhodes authored
Currently marked as XFAIL due to bug in QEMU. See test for details.
-
Vyacheslav Levytskyy authored
This PR adds support for the SPV_KHR_linkonce_odr extension and modifies existing negative test with a positive check for the extension and proper linkage type in case when the extension is enabled. SPV_KHR_linkonce_odr adds a "LinkOnceODR" linkage type, allowing proper translation of, for example, C++ templates classes merging during linking from different modules and supporting any other cases when a global variable/function must be merged with equivalent global variable(s)/function(s) from other modules during the linking process.
-
Vyacheslav Levytskyy authored
By SPIR-V specification: "If an instruction, enumerant, or other feature specifies multiple enabling capabilities, only one such capability needs to be declared to use the feature." However, one capability may be preferred over another. One important case is Shader capability that may not be supported by a backend, but always is inserted if "OpDecorate SpecId" is found, because Enabling Capabilities for the latter is the list of Shader and Kernel, where Shader is coming first and thus always selected as the first available option. In this PR we address the problem by keeping current behaviour of selecting the first option among enabling capabilities as is, but giving a user a way to filter capabilities during the selection process via a newly introduced "--avoid-spirv-capabilities" command line option. This option is to avoid selection of certain capabilities if there are other available enabling capabilities. This PR is changing also existing pruneCapabilities() function. It doesn't remove capability from module requirement anymore, but only adds implicitly required capabilities recursively, so its name is changed accordingly. This change fixes the present bug in collecting required by a module capabilities. Before the change, introduced by this PR, pruneCapabilities() function has been removing, for example, Kernel capability from required by a module, because Kernel is initially required and the second time it was needed pruneCapabilities() removed it by mistake.
-
David Spickett authored
Currently https://flang.llvm.org/docs/FlangCommandLineReference.html refers to "Clang" in several of the group descriptions for example: ``` Compilation options Flags controlling the behavior of Clang during compilation... ``` This is pretty confusing. I'm fixing this by making use of `Program` from the existing GlobalDocumentation object to substitute in the program name to these descriptions. This `Program` has been changed to a proper noun given that it's easier to lower case a string than capitalise one character (syntax wise). The tablegen backend has been changed to lower it so that links in the RST/HTML remain the same as they were before. To make sure the file is valid when not generating docs, I'm checking a #define and providing a default GlobalDocumentation if it's not defined. (I looked for a way to check if a def exists, but tablegen doesn't seem to have one) This means that if the DocBrief are used outside of documentation, they'll say "Clang", which is the same as it always was. This change does not aim fix option descriptions that refer to clang. Though we can use parts of this for that, there is only one driver library so it needs a different approach. This change also fixes the warning: ``` /home/buildbot/as-worker-4/publish-sphinx-docs/build/tools/flang/docs/Source/FlangCommandLineReference.rst:194: WARNING: unknown document: 'DiagnosticsReference' ``` Which is due to flang docs trying to link to clang docs. Now it will just tell the reader to go to Clang's page, which is not ideal but it is easy to find with Google at least.
-
chuongg3 authored
The combine now works using tablegen and checks if new instruction is legal before creating it.
-
Stanislav Mekhanoshin authored
I need these operands for a future patch. Also simplify conditions there. If nothing using !cond instead of nesting !if's does not need to realign code every time a new type is added.
-
Paul Semel authored
-
Mikael Holmen authored
Without the fix gcc warns like ../../clang/lib/Sema/SemaDecl.cpp:2963:24: warning: unused variable 'SupA' [-Wunused-variable] 2963 | else if (const auto *SupA = dyn_cast<SuppressAttr>(Attr)) | ^~~~ and ../../clang/lib/Driver/Driver.cpp:4192:17: warning: unused variable 'IAA' [-Wunused-variable] 4192 | if (auto *IAA = dyn_cast<InstallAPIJobAction>(Current)) { | ^~~ Remove the unused variables and change the "dyn_cast"s into "isa"s. -
jeanPerier authored
When doing a pointer assignment with an RHS that is an array section, the code fell in the legacy lowering code even with HLFIR enabled. Escape this old code when HLFIR is on. Should fix #80884.
-
jeanPerier authored
Spread, reshape, pack, and other transformational intrinsic runtimes are using `CopyElement` utility to copy elements. This utility was dealing with deep copies, but only when the allocatable components where "immediate" components of the type being copied. If the allocatable components were nested inside a nonpointer/nonallocatable component, they were not deep copied, leading to bugs later when manipulating the value (or double free when applying #81117). Visit data components with allocatable components (using the noDestructionNeeded flag to avoid expensive and useless type visit when there are no such components).
-
jeanPerier authored
The runtime was currently only deallocating the direct allocatable components, which caused leaks when there are allocatable components nested in the direct components. Update Destroy to recursively destroy components. Also call Destroy from Assign to deallocate nested allocatable components before doing the assignment as required by F2018 9.7.3.2 point 7. This lack of deallocation was visible if the nested components had user defined assignment "observing" the allocation state.
-
Christian Sigg authored
-
NAKAMURA Takumi authored
Also, Let `NumConditions` `uint16_t`. It is smarter to handle the ID as signed. Narrowing to `int16_t` will reduce costs of handling byvalue. (See also #81221 and #81227) External behavior doesn't change. They below handle values as internal values plus 1. * `-dump-coverage-mapping` * `CoverageMappingReader.cpp` * `CoverageMappingWriter.cpp`
-
Rohit Aggarwal authored
Hi, AMD has it's own implementation of vector calls. This patch include the changes to enable the use of AMD's math library using -fveclib=AMDLIBM. Please refer https://github.com/amd/aocl-libm-ose --------- Co-authored-by:
Rohit Aggarwal <Rohit.Aggarwal@amd.com>
-
Timm Bäder authored
-
Timm Bäder authored
Checking for isConstexpr() is wrong; we need to (try to) call the function and let later code diagnose the failure accordingly.
-
riChar authored
VERR/VERW instructions will define ZF flag.
-
Owen Pan authored
-
Abhinav271828 authored
[MLIR][Presburger] Implement vertex enumeration and chamber decomposition for polytope generating function computation. (#78987) We implement a function to compute the generating function corresponding to a full-dimensional parametric polytope whose tangent cones are all unimodular. We fix a bug in unimodGenFunc to check the absolute value of the index. We also implement Matrix<T>::negateMatrix() and Matrix<T>::scaleRow for convenience.
-
Timm Bäder authored
For variadic member functions, the way we calculated the instance pointer and RVO pointer offsts on the stack was incorrect, due to Func->getArgSize() not returning the full size of all the passed arguments. When calling variadic functions, we need to pass the size of the passed (variadic) arguments to the Call* ops, so they can use that information to properly check the instance pointer, etc. This patch adds a bit of code duplication in Interp.h, which I will get rid of in later cleanup NFC patches.
-
Qfrost authored
[@xia0ji233](https://github.com/xia0ji233) and I found that X86::LAR and X86::lSR implicit use eflags register. However, it was not been defined in LLVM, which means we will get wrong alive-result if we use these two instructions. 
-
Joseph Huber authored
-
Luke Lau authored
For llvm.vector.extract, this tests combinations of inserting at a zero and non-zero index, and extracting from a fixed or scalable vector. For llvm.vector.insert, this tests the same combinations as extracts but with an additional configuration for an undef vector. This is because we can use a subregister insert if the index is 0 and the vector is undef, which should be free.
-
Joseph Huber authored
Summary: This is necessary because CMake build tools might need to generate several files but are unable to put them in separate images. This patch sipmly moves the file handling out into a separate split iterator.
-
rmarker authored
Complete the switch from "AlwaysBreakAfterReturnType" to "BreakAfterReturnType".
-
Jessica Clarke authored
The current implementation considers both iPTR+iN and everything else all in one go, which leads to more special casing when iPTR is present in only one set than is described in the comment block. Moreover this makes it very difficult to add any new iPTR-like wildcards due to the exponential combinatorial explosion that occurs. Logically, iPTR+iN handling is entirely independent from everything else, so rewrite the code to do them separately. This removes special cases, making the core of the implementation more succinct, whilst more clearly implementing exactly what is described in the comment block, and allows for any number of (non-overlapping) wildcards to be added to the list, as needed by CHERI LLVM downstream (due to having a new capability type which, much like a normal integer pointer in LLVM, varies in size between targets and modes). In testing, this change results in identical TableGen output for all in-tree backends (including those in LLVM_ALL_EXPERIMENTAL_TARGETS), and it is intended that this implementation is entirely equivalent to the old one.
-
Brianna Fan authored
That's a new GUI bell-and-whistle in the index.html page.
-
jkorous-apple authored
Introducing CArrayToPtrAssignment gadget and implementing fixits for some cases of array being assigned to pointer. Key observations: - const size array can be assigned to std::span and bounds are propagated - const size array can't be on LHS of assignment This means array to pointer assignment has no strategy implications. Fixits are implemented for cases where one of the variables in the assignment is safe. For assignment of a safe array to unsafe pointer we know that the RHS will never be transformed since it's safe and can immediately emit the optimal fixit. Similarly for assignment of unsafe array to safe pointer. (Obviously this is not and can't be future-proof in regards to what variables we consider unsafe and that is fine.) Fixits for assignment from unsafe array to unsafe pointer (from Array to Span strategy) are not implemented in this patch as that needs to be properly designed first - we might possibly implement optimal fixits for partially transformed cases, put both variables in a single fixit group or do something else.
-
Ryosuke Niwa authored
This PR introduces the concept of a "trivial function" which applies to a function that only calls other trivial functions and contain literals and expressions that don't result in heap mutations (specifically it does not call deref). This is implemented using ConstStmtVisitor and checking each statement and expression's trivialness. This PR also introduces the concept of a "ingleton function", which is a static member function or a free standing function which ends with the suffix "singleton". Such a function's return value is understood to be safe to call any function with.
-
lntue authored
[libc][math] Add C23 ldexpf128 math function and fix DyadicFloat conversions for subnormal ranges and 80-bit floating points. (#81780)
-
Jie Fu authored
llvm-project/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:921:45: error: missing field 'Annotations' initializer [-Werror,-Wmissing-field-initializers] TextEdit{Main.range("virtual1"), ""}}}; ^ llvm-project/clang-tools-extra/clangd/unittests/DiagnosticsTests.cpp:926:45: error: missing field 'Annotations' initializer [-Werror,-Wmissing-field-initializers] TextEdit{Main.range("virtual2"), ""}}}; ^ 2 errors generated. -
jkorous-apple authored
[-Wunsafe-buffer-usage] Ignore safe array subscripts Don't emit warnings for array subscripts on constant size arrays where the index is constant and within bounds. Example: int arr[10]; arr[5] = 0; //safe, no warning This patch recognizes only array indices that are integer literals - it doesn't understand more complex expressions (arithmetic on constants, etc.). -Warray-bounds implemented in Sema::CheckArrayAccess() already solves a similar (opposite) problem, handles complex expressions and is battle-tested. Adding -Wunsafe-buffer-usage diagnostics to Sema is a non-starter as we need to emit both the warnings and fixits and the performance impact of the fixit machine is unacceptable for Sema. CheckArrayAccess() as is doesn't distinguish between "safe" and "unknown" array accesses. It also mixes the analysis that decides if an index is out of bounds with crafting the diagnostics. A refactor of CheckArrayAccess() might serve both the original purpose and help us avoid false-positive with -Wunsafe-buffer-usage on constant size arrrays.
-
jkorous-apple authored
Currently we ignore calls on function pointers (unlike direct calls of functions and class methods). This patch adds support for function pointers as well. The change is to simply replace use of forEachArgumentWithParam matcher in UPC gadget with forEachArgumentWithParamType. from the documentation of forEachArgumentWithParamType: /// Matches all arguments and their respective types for a \c CallExpr or /// \c CXXConstructExpr. It is very similar to \c forEachArgumentWithParam but /// it works on calls through function pointers as well. Currently the matcher also uses hasPointerType() which checks that the canonical type of an argument is pointer and won't match on arrays decayed to pointer. Replacing hasPointerType() with isAnyPointerType() which allows implicit casts allows for the arrays to be matched as well and this way we get fixits for array arguments to function pointer calls too.
-
Philipp Tomsich authored
One of the whitespace fixes didn't get added to the commit introducing the Ampere1B model. Clean it up.
-
Tom Stellard authored
-
Fangrui Song authored
i386 has a `__tls_get_addr` link error. For internal_symbolizer, the x86_64 test would fail as well.
-
Daniel Rodríguez Troitiño authored
compiler-rt was creating the test-depends targets and trying to fill its dependencies with a variable, but the variable was empty because it was supposed to take its value from a property. The changes in this commit grab the value of the property and add them as dependencies. The changes in llvm are to remove the usage of `DEPENDS` arguments from `add_custom_target`, which according to the documentation is reserved for files/outputs created by `add_custom_command`. Use `add_dependencies` instead. This is similar to the changes introduced in 4eb84582 for runtimes.
-
Alexander Yermolovich authored
Added a test that relies on -fbasic-block-sections=all and --gc-sections that exercises a code path that previously printed a warning.
-