- May 14, 2024
-
-
Vyacheslav Levytskyy authored
This PR is to introduce support for 'spirv.Decorations' metadata node in SPIR-V Backend. See also https://github.com/KhronosGroup/SPIRV-LLVM-Translator/blob/main/docs/SPIRVRepresentationInLLVM.rst that describes `spirv.Decorations` as an important part of SPIRV-friendly LLVM IR.
-
Dmitry Vasilyev authored
Windows path is case insensitive. Tests `test_QMemTags_packets` and `test_qMemTags_packets` will use the same build dir and conflict. Added a suffix to resolve conflicts.
-
chuongg3 authored
-
Hari Limaye authored
This patch extends support for lowering the experimental.cttz.elts intrinsic to BRKB + CNTP instruction sequences, using this lowering for all legal predicate types. An unused parameter is also removed from some of the related regression tests.
-
Florian Hahn authored
Add a new opcode to mode non-poison propagating logical AND operations used when generating edge masks. This follows the similar decision to model Not as dedicated opcode as well, to improve clarity. This also helps to simplify the matchers for https://github.com/llvm/llvm-project/pull/89386. PR: https://github.com/llvm/llvm-project/pull/91897
-
Dmitry Vasilyev authored
It is necessary to transfer the test file to/from the really remote target (for example Windows host and Linux target). Also ignore chmod check in case of the Windows host.
-
Christian Ulmann authored
This commit extends the SROA interfaces to ensure the interface instantiations can communicate newly created allocators to the algorithm. This ensures that the SROA implementation does no longer require re-walking the IR to find new allocators.
-
aabhinavg authored
This commit addresses issue #87244, where a redundant condition was found in the Target.cpp file. Static analyzer cppcheck flagged the issue in the Target.cpp file fix #87244
-
Sameer Sahasrabuddhe authored
-
Kazu Hirata authored
This patch fixes: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:19848:11: error: enumeration value 'SW_GUARDED_BRIND' not handled in switch [-Werror,-Wswitch]
-
martinboehme authored
# Observed erroneous behavior Prior to this change, a `MemberExpr` that accesses an anonymous class might have a prvalue as its base (even though C++ mandates that the base of a `MemberExpr` must be a glvalue), if the code containing the `MemberExpr` was in a template. Here's an example on [godbolt](https://godbolt.org/z/Gz1Mer9oz) (that is essentially identical to the new test this patch adds). This example sets up a struct containing an anonymous struct: ```cxx struct S { struct { int i; }; }; ``` It then accesses the member `i` using the expression `S().i`. When we do this in a non-template function, we get the following AST: ``` `-ExprWithCleanups <col:10, col:14> 'int' `-ImplicitCastExpr <col:10, col:14> 'int' <LValueToRValue> `-MemberExpr <col:10, col:14> 'int' xvalue .i 0xbdcb3c0 `-MemberExpr <col:10, col:14> 'S::(anonymous struct at line:2:3)' xvalue .S::(anonymous struct at line:2:3) 0xbdcb488 `-MaterializeTemporaryExpr <col:10, col:12> 'S' xvalue `-CXXTemporaryObjectExpr <col:10, col:12> 'S' 'void () noexcept' zeroing ``` As expected, the AST contains a `MaterializeTemporarExpr` to materialize the prvalue `S()` before accessing its members. When we perform this access in a function template (that doesn't actually even use its template parameter), the AST for the template itself looks the same as above. However, the AST for an instantiation of the template looks different: ``` `-ExprWithCleanups <col:10, col:14> 'int' `-ImplicitCastExpr <col:10, col:14> 'int' <LValueToRValue> `-MemberExpr <col:10, col:14> 'int' xvalue .i 0xbdcb3c0 `-MaterializeTemporaryExpr <col:10, col:14> 'S::(anonymous struct at line:2:3)' xvalue `-MemberExpr <col:10, col:14> 'S::(anonymous struct at line:2:3)' .S::(anonymous struct at line:2:3) 0xbdcb488 `-CXXTemporaryObjectExpr <col:10, col:12> 'S' 'void () noexcept' zeroing ``` Note how the inner `MemberExpr` (the one accessing the anonymous struct) acts on a prvalue. Interestingly, this does not appear to cause any problems for CodeGen, probably because CodeGen is set up to deal with `MemberExpr`s on rvalues in C. However, it does cause issues in the dataflow framework, which only supports C++ today and expects the base of a `MemberExpr` to be a glvalue. Beyond the issues with the dataflow framework, I think this issue should be fixed because it goes contrary to what the C++ standard mandates, and the AST produced for the non-template case indicates that we want to follow the C++ rules here. # Reasons for erroneous behavior Here's why we're getting this malformed AST. First of all, `TreeTransform` [strips any `MaterializeTemporaryExpr`s](https://github.com/llvm/llvm-project/blob/cd132dcbeb0fc79fd657bd5e0a8e9244c3fb5da6/clang/lib/Sema/TreeTransform.h#L14853) from the AST. It is therefore up to [`TreeTransform::RebuildMemberExpr()`](https://github.com/llvm/llvm-project/blob/cd132dcbeb0fc79fd657bd5e0a8e9244c3fb5da6/clang/lib/Sema/TreeTransform.h#L2853) to recreate a `MaterializeTemporaryExpr` if needed. In the [general case](https://github.com/llvm/llvm-project/blob/cd132dcbeb0fc79fd657bd5e0a8e9244c3fb5da6/clang/lib/Sema/TreeTransform.h#L2915), it does this: It calls `Sema::BuildMemberReferenceExpr()`, which ensures that the base is a glvalue by [materializing a temporary](https://github.com/llvm/llvm-project/blob/cd132dcbeb0fc79fd657bd5e0a8e9244c3fb5da6/clang/lib/Sema/SemaExprMember.cpp#L1016) if needed. However, when `TreeTransform::RebuildMemberExpr()` encounters an anonymous class, it [calls `Sema::BuildFieldReferenceExpr()`](https://github.com/llvm/llvm-project/blob/cd132dcbeb0fc79fd657bd5e0a8e9244c3fb5da6/clang/lib/Sema/TreeTransform.h#L2880), which, unlike `Sema::BuildMemberReferenceExpr()`, does not make sure that the base is a glvalue. # Proposed fix I considered several possible ways to fix this issue: - Add logic to `Sema::BuildFieldReferenceExpr()` that materializes a temporary if needed. This appears to work, but it feels like the fix is in the wrong place: - AFAIU, other callers of `Sema::BuildFieldReferenceExpr()` don't need this logic. - The issue is caused by `TreeTransform` removing the `MaterializeTemporaryExpr`, so it seems the fix should also be in `TreeTransform` - Materialize the temporary directly in `TreeTransform::RebuildMemberExpr()` if needed (within the case that deals with anonymous classes). This would work, too, but it would duplicate logic that already exists in `Sema::BuildMemberReferenceExpr()` (which we leverage for the general case). - Use `Sema::BuildMemberReferenceExpr()` instead of `Sema::BuildFieldReferenceExpr()` for the anonymous class case, so that it also uses the existing logic for materializing the temporary. This is the option I've decided to go with here. There's a slight wrinkle in that we create a `LookupResult` that claims we looked up the unnamed field for the anonymous class -- even though we would obviously never be able to look up an unnamed field. I think this is defensible and still better than the other alternatives, but I would welcome feedback on this from others who know the code better.
-
Martin Storsjö authored
This reverts commit d03a1a6e. This change caused failed assertions, see https://github.com/llvm/llvm-project/pull/86409#issuecomment-2109469845 for details.
-
Dmitry Vasilyev authored
Install `a.out` to the remote target (after handshake) if necessary and use the remote path to call `vRun`.
-
Vyacheslav Levytskyy authored
This PR is to support saturation arithmetic intrinsics in SPIR-V Backend.
-
Vyacheslav Levytskyy authored
[SPIR-V] Set non-kernel function linkage type via OpDecorate for all linkage types except for static functions (#91598) This PR fixes the issue https://github.com/llvm/llvm-project/issues/91595 by setting non-kernel function linkage type via OpDecorate for all linkage types except for static functions. A new test case is added.
-
Michael Klemm authored
[Flang][Driver] Add -print-resource-dir command line flag to emit Flang's resource directory (#90886) This should be a NFC change for all drivers, but Flang.
-
Dmitry Vasilyev authored
It can be used in tests #91918, #91931 and such.
-
Jacob Lambert authored
-
Yeting Kuo authored
When Zicfilp enabled, indirect jump table branch should be a software guarded branch.
-
Alex Bradbury authored
This matches what we do for extensions, and saves us having to do it in RISCVISAInfo. This is a minor tweak to what I added in #91993.
-
Matthias Gehre authored
Allow to skip running the TOSA validation pass when spec conformance is not required.
-
Matthias Gehre authored
After #86509 allowed all integer types in TOSA ops, this PR allows TOSA ops on all floating point types. This helps to experiment with `f64` and 8-bit float types when spec conformance is not required.
-
Pierre van Houtryve authored
I was benchmarking the MatchTable when I found that `getConstantVRegValWithLookThrough` took a non-negligible amount of time, about 7.5% of all of `AArch64PreLegalizerCombinerImpl::tryCombineAll`. I decided to take a closer look to see if I could squeeze some performance out of it, and I landed on a few changes that: - Avoid copying APint unnecessarily, especially returning std::optional<APInt> can be expensive when a out parameter also works. - Avoid indirect call by using templated function pointers instead of function_ref/std::function Both of those changes seem to speedup this function by about 50%, but my benchmarking (`perf record`) seems inconsistent (so take measurements with a grain of salt), I saw as high as 4.5% and as low as 2% for this function on the exact same input after the changes, but it never got close again to 7% in a few runs so this looks like a stable improvement.
-
Tomas Matheson authored
-
appujee authored
Recurring meeting at 3rd Thursday of every month.
-
Robin Caloudis authored
Since https://github.com/llvm/llvm-project/pull/91150, a proxy header for the errno macros is available and gets included in `libc_errno.h` since then. As `libc_errno.cpp` includes `libc_errno.h`, which already includes the proxy header `hdr/errno_macros.h`, there's no need to include it in `libc_errno.cpp` if we are in overlay mode, because the proxy header takes care to either include our header from libc/include/ (fullbuild) or the corresponding underlying system header (overlay).
-
Owen Pan authored
Remove FormatToken::isSimpleTypeSpecifier() and call Token::isSimpleTypeSpecifier(LangOpts) instead.
-
Schrodinger ZHU Yifan authored
-
Craig Topper authored
The same registers are listed in the same order in FixedCSRFIMap.
-
Alex Bradbury authored
This is just the TableGen-side changes, split out as the minimal testable unit. It doesn't yet transition RVA23 and friends to be experimental (and add the necessary other changes for this to work). Although choosing not to emit the SupportedExperimentalProfiles array if no experimental profiles are present isn't consistent with what we do for experimental extensions, we need to do this in order to avoid adding a warning for the empty array when building LLVM for as long as we don't have any experimental profiles defined.
-
cor3ntin authored
wg21.link/P2552 suggest that __has_cpp_attribute should return a non-zero value for all attributes that the implementation does something interesting with. Clang does something meaninful with all attributes except for: - no_unique_address which we do not support for msvc target - carries_dependency which arguably does nothing interesting. P2552 shies away from specifying a behavior for that attribute (despite being the only one for which a recommandation would have been interesting, arguably) As such, we have nothing to change for this paper. This paper is a DR and clang always behaved reasonably.
-
Ryosuke Niwa authored
[alpha.webkit.UncountedCallArgsChecker] Allow explicit instantiation of Ref/RefPtr on call arguments. (#91875) Co-authored-by:Ryosuke Niwa <rniwa@apple.com>
-
Fangrui Song authored
-
Craig Topper authored
Remove the switch statement and instead do range checks to know which pieces we need to print.
-
Nikita Popov authored
-
Nikita Popov authored
-
Nikita Popov authored
-
Owen Pan authored
-
Owen Pan authored
Move static member functions LeftRightQualifierAlignmentFixer::is...() out of the class so that #91712 can reland.
-
Phoebe Wang authored
As discussed in https://github.com/llvm/llvm-project/commit/3cf8535dbf0bf5fafa99ea1f300e2384a7254fba We are not allowed to combine explicit fptrunc/fpext from user.
-