- May 21, 2024
-
-
Noah Goldstein authored
-
Matt Arsenault authored
We need to insert a constrained canonicalize. Depends #92594
-
Jeremy Kun authored
Similar to https://github.com/llvm/llvm-project/pull/92613 , but for types. Co-authored-by:
Jeremy Kun <j2kun@users.noreply.github.com>
-
Eli Friedman authored
The current definition is a bit fuzzy... replace it with something that's somewhat rigorous. For functions, the definition is pretty narrow; as a consequence of language-level non-determinism, it's impossible to tell whether two functions are equivalent, so just embrace the non-determinism. For constants, we're pretty strict; otherwise you end up concluding constants can actually change value, which is bad for alias analysis. I think C++ standard don't allow any non-deterministic operations in constants, so we should be okay there? Poison is per-byte to allow some ambiguity in the way padding is defined.
-
Hugo Trachino authored
* Implements `TransferWritePermutationLowering`, `TransferReadPermutationLowering` and `TransferWriteNonPermutationLowering` as a MaskableOpRewritePattern. Allowing to exit gracefully when such use of a xferOp is inside a `vector::MaskOp` * Updates MaskableOpRewritePattern to handle MemRefs and buffer semantics providing empty `Value()` as a return value for `matchAndRewriteMaskableOp` now represents successful rewriting without value to replace the original op. Split of https://github.com/llvm/llvm-project/pull/90835
-
Leon Clark authored
Fixes error in GlobalISel CTLZ lowering caused by [#88512](https://github.com/llvm/llvm-project/pull/88512 ). --------- Co-authored-by:
Leon Clark <leoclark@amd.com>
-
Matt Arsenault authored
It's really great that we have the same information duplicated in TargetLibraryInfo and RuntimeLibcalls which both assume everything by default. Should fix issue reported after #92287
-
Chris B authored
Doh! CMake cache scripts don't have generator variables set yet, so the script can't depend on the generator variables. Instead I've added a variable that a user can specify to enable the distribution settings.
-
Krystian Stasiowski authored
[Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (#92449) Clang incorrectly accepts the following when using C++14 or later: ``` struct A { template<typename T> void f() const; template<> constexpr void f<int>(); }; ``` Non-static member functions declared `constexpr` are only implicitly `const` in C++11. This patch makes clang reject the explicit specialization of `f` in language modes after C++11. -
Kiran Chandramohan authored
Removes two XFAILed tests, the other tests are marked UNSUPPORTED only on windows.
-
Krystian Stasiowski authored
Consider the following: ``` template<typename T> struct A { struct B : A { }; }; ``` According to [class.derived.general] p2: > [...] A _class-or-decltype_ shall denote a (possibly cv-qualified) class type that is not an incompletely defined class; any cv-qualifiers are ignored. [...] Although GCC and EDG rejects this, Clang accepts it. This is incorrect, as `A` is incomplete within its own definition (outside of a complete-class context). This patch correctly diagnoses instances where the current instantiation is used as a base class before it is complete. Conversely, Clang erroneously rejects the following: ``` template<typename T> struct A { struct B; struct C : B { }; struct B : C { }; // error: circular inheritance between 'C' and 'A::B' }; ``` Though it may seem like no valid specialization of this template can be instantiated, an explicit specialization of either member classes for an implicit instantiated specialization of `A` would permit the definition of the other member class to be instantiated, e.g.: ``` template<> struct A<int>::B { }; A<int>::C c; // ok ``` So this patch also does away with this error. This means that circular inheritance is diagnosed during instantiation of the definition as a consequence of requiring the base class type to be complete (matching the behavior of GCC and EDG). -
Florian Hahn authored
This allows use at other places, in particular an updated version of https://github.com/llvm/llvm-project/pull/92307.
-
Fangrui Song authored
Related to the poor performance of MCAssembler based constant folding (see `bool MCExpr::evaluateAsAbsolute(int64_t &Res, const MCAssembler *Asm) const` and `AttemptToFoldSymbolOffsetDifference`), commit 9500a5d0 (#91082) caused -O0 -g compile time regression. 9500a5d0 special cased .eh_frame FDE emitting. This patch adds a special case to .debug_* emitting as well to mitigate the rest regression. The MCAssembler based constant folding strategy should be improved to remove the two special cases.
-
Aaron Ballman authored
This amends 702a2b62 to hopefully get the test passing for Windows again.
-
Jay Foad authored
I still don't see why we need to select to different Real instructions on different targets, but at least this is less verbose.
-
Yingchi Long authored
Previously `report_fatal_error` is used for reporting something goes wrong in the backend, but this is confusing because `report_fatal_error` basically means there are something unexpected & crashed in the backend. So, turn this "crash" into an elegant error reporting. After this patch, clang can diagnose it: bpf-crash.c:4:30: error: Invalid usage of the XADD return value 4 | u32 next_event_id() { return __sync_fetch_and_add(&GLOBAL_EVENT_ID, 1); } | ^ 1 error generated. -
Krystian Stasiowski authored
[Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (#92318) According to [expr.prim.id.general] p2: > If an _id-expression_ `E` denotes a non-static non-type member of some class `C` at a point where the current class is `X` and > - `E` is potentially evaluated or `C` is `X` or a base class of `X`, and > - `E` is not the _id-expression_ of a class member access expression, and > - if `E` is a _qualified-id_, `E` is not the un-parenthesized operand of the unary `&` operator, > > the _id-expression_ is transformed into a class member access expression using `(*this)` as the object expression. Consider the following: ``` struct A { void f0(); template<typename T> void f1(); }; template<typename T> struct B : T { auto g0() -> decltype(T::f0()); // ok auto g1() -> decltype(T::template f1<int>()); // error: call to non-static member function without an object argument }; template struct B<A>; ``` Clang incorrectly rejects the call to `f1` in the _trailing-return-type_ of `g1`. Furthermore, the following snippet results in a crash during codegen: ``` struct A { void f(); }; template<typename T> struct B : T { template<typename U> static void g(); template<> void g<int>() { return T::f(); // crash here } }; template struct B<A>; ``` This happens because we unconditionally build a `CXXDependentScopeMemberExpr` (with an implicit object expression) for `T::f` when parsing the template definition, even though we don't know whether `g` is an implicit object member function yet. This patch fixes these issues by instead building `DependentScopeDeclRefExpr`s for such expressions, and only transforming them into implicit class member access expressions during instantiation. Since we implemented the MS "unqualified lookup into dependent bases" extension by building an implicit class member access (and relying on the first component name of the _nested-name-specifier_ to be looked up in the context of the object expression during instantiation), we instead pre-append a fake _nested-name-specifier_ that refers to the injected-class-name of the enclosing class. This patch also refactors `Sema::BuildQualifiedDeclarationNameExpr` and `Sema::BuildQualifiedTemplateIdExpr`, streamlining their implementation and removing any redundant checks. -
LLVM GN Syncbot authored
-
Mehdi Amini authored
-
David Green authored
-
Ahmed Bougacha authored
This is in effect a revert of f139ae3d, as we have since gained a more sophisticated way of doing extra IRGen with the addition of RawAddress in #86923.
-
Jeremy Kun authored
Co-authored-by:Jeremy Kun <j2kun@users.noreply.github.com>
-
Vyacheslav Levytskyy authored
[SPIR-V] Ensure that internal intrinsic functions "ptrcast" for PHI's operand are inserted at the correct positions (#92536) The goal of the PR is to ensure that newly inserted `ptrcast` internal intrinsic functions are inserted at the correct positions, and don't break rules of instruction domination and PHI nodes grouping at top of basic block.
-
Vyacheslav Levytskyy authored
[SPIR-V] reqd_work_group_size and work_group_size_hint metadata are correctly converted to the LocalSize and LocalSizeHint execution mode (#92552) The goal of this PR is to ensure that reqd_work_group_size and work_group_size_hint metadata are correctly converted to the LocalSize and LocalSizeHint execution mode. reqd_work_group_size and work_group_size_hint require 3 operands (see https://registry.khronos.org/SPIR-V/specs/unified1/SPIRV.html#Execution_Mode), if metadata contains less operands, just add a default value (1).
-
Vlad Serebrennikov authored
-
Vlad Serebrennikov authored
In preparation for #92682.
-
Pradeep Kumar authored
This commit fixes the missing semicolon in the PTX codegen path where barrier id is provided for the NVVM BarrierArriveOp. Also, updated nvvm-to-llvm.mlir lit test to reflect the same Co-authored-by:pradeepku <pradeepku@nvidia.com>
-
Craig Topper authored
I may eventually add getVPZeroExtendInReg to SelectionDAG if there are other cases, but for now just hardcode it.
-
Jacob Lambert authored
-
Matt Arsenault authored
We could try harder for nonsplat vectors but probably not worth the effort.
-
inglorion authored
LLVM is now using GitHub. This change makes revert_checker.py -u generate commit links that go to GitHub, instead of the old Phabricator URIs.
-
David Truby authored
flang/lib/Optimizer/Dialect/CUF/Attributes/CUFAttr.cpp includes CUFDialect.h.inc, but the target generating that isn't currently depended on in CUF/Attributes. This patch adds that missing dependency. Fixes #92635
-
Krystian Stasiowski authored
Clang crashes when diagnosing the following invalid redeclaration in C++11: ``` struct A { void f(); }; constexpr void A::f() { } // crash here ``` This happens because `DiagnoseInvalidRedeclaration` tries to create a fix-it to remove `const` from the out-of-line declaration of `f`, but there is no `SourceLocation` for the `const` qualifier (it's implicitly `const` due to `constexpr`) and an assert in `FunctionTypeInfo::getConstQualifierLoc` fails. This patch changes `DiagnoseInvalidRedeclaration` to only suggest the removal of the `const` qualifier when it was explicitly specified in the _cv-qualifier-seq_ of the declaration.
-
- May 20, 2024
-
-
Mingming Liu authored
Reland "[ThinLTO] Populate declaration import status except for distributed ThinLTO under a default-off new option" (#92718) The original PR is reviewed in https://github.com/llvm/llvm-project/pull/88024, and this PR adds one line (https://github.com/llvm/llvm-project/pull/92718/commits/b9f04d199dec4f3c221d981dcb91e55298d0693f) to fix test Limit to one thread for in-process ThinLTO to test `LLVM_DEBUG` log. - This should fix build bot failure like https://lab.llvm.org/buildbot/#/builders/259/builds/4727 and https://lab.llvm.org/buildbot/#/builders/9/builds/43876 - I could repro the failure and see interleaved log messages by using `-thinlto-threads=all` **Original Commit Message:** The goal is to populate `declaration` import status if a new flag `-import-declaration` is on. * For in-process ThinLTO, the `declaration` status is visible to backend `function-import` pass, so `FunctionImporter::importFunctions` should read the import status and be no-op for declaration summaries. Basically, the postlink pipeline is updated to keep its current behavior (import definitions), but not updated to handle `declaration` summaries. Two use cases ([better call-graph sort](https://discourse.llvm.org/t/rfc-for-better-call-graph-sort-build-a-more-complete-call-graph-by-adding-more-indirect-call-edges/74029#support-cross-module-function-declaration-import-5) or [cross-module auto-init](https://github.com/llvm/llvm-project/pull/87597#discussion_r1556067195)) would use this bit differently. * For distributed ThinLTO, the `declaration` status is not serialized to bitcode. As discussed, https://github.com/llvm/llvm-project/pull/87600 will do this.
-
Krzysztof Drewniak authored
Per comments in DivRemPairs, the rewrite from ```llvm %div = div %X, %Y %rem = rem %X, %Y ``` to ```llvm %div = div %X, %Y %.mul = mul %div, %Y %rem = sub %X, %mul ``` is unsound when %X or %Y are undef. However, it is known to be sound if %X or %Y are poison but can't be undef, since both the pre- and post-rewrite %rem are `poison`. Additionally, proofs: https://alive2.llvm.org/ce/z/xtNQ8j A comment in the pass listed a TODO for changing a usage of isGuaranteedNotToBeUndefOrPoison() in the pass to something that only detects undef. Such a function has been implemented since the time that TODO was written, but has not been used. Therefore, this commit updates DivRemPairs to use isGuaranteedNotToBeUndef() instead. -
Krzysztof Drewniak authored
The tests are added to a new AMDGPU/ subdirectory since I found the missed optimization while hacking on AMDGPU code. Also, this ensures that AMDGPU, which uses DivRemPass, is being checked for existing expected behavior.
-
Joseph Huber authored
Summary: The plugins are no longer linked to a share library, making this unused and useless.
-
Hubert Tong authored
Fix linkage of `build_name`; it is not supposed to have external linkage.
-
Kazu Hirata authored
-
Shan Huang authored
Fixes #92537
-