- Mar 20, 2024
-
-
Nikita Popov authored
As part of the migration to ptradd (https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699), we need to change the representation of the `inrange` attribute, which is used for vtable splitting. Currently, inrange is specified as follows: ``` getelementptr inbounds ({ [4 x ptr], [4 x ptr] }, ptr @vt, i64 0, inrange i32 1, i64 2) ``` The `inrange` is placed on a GEP index, and all accesses must be "in range" of that index. The new representation is as follows: ``` getelementptr inbounds inrange(-16, 16) ({ [4 x ptr], [4 x ptr] }, ptr @vt, i64 0, i32 1, i64 2) ``` This specifies which offsets are "in range" of the GEP result. The new representation will continue working when canonicalizing to ptradd representation: ``` getelementptr inbounds inrange(-16, 16) (i8, ptr @vt, i64 48) ``` The inrange offsets are relative to the return value of the GEP. An alternative design could make them relative to the source pointer instead. The result-relative format was chosen on the off-chance that we want to extend support to non-constant GEPs in the future, in which case this variant is more expressive. This implementation "upgrades" the old inrange representation in bitcode by simply dropping it. This is a very niche feature, and I don't think trying to upgrade it is worthwhile. Let me know if you disagree.
-
Tom Eccles authored
OpenMP reduction declare operations can contain FIR code which needs to be lowered to LLVM. With array reductions, these regions can contain more complicated operations which need PreCGRewriting. A similar extra case was already needed for fir::GlobalOp. OpenMP array reductions 3/6 Previous PR: https://github.com/llvm/llvm-project/pull/84953 Next PR: https://github.com/llvm/llvm-project/pull/84955
-
Tom Eccles authored
Most FIR passes only look for FIR operations inside of functions (either because they run only on func.func or they run on the module but iterate over functions internally). But there can also be FIR operations inside of fir.global, some OpenMP and OpenACC container operations. This has worked so far for fir.global and OpenMP reductions because they only contained very simple FIR code which doesn't need most passes to be lowered into LLVM IR. I am not sure how OpenACC works. In the long run, I hope to see a more systematic approach to making sure that every pass runs on all of these container operations. I will write an RFC for this soon. In the meantime, this pass duplicates the CFG conversion pass to also run on omp reduction operations. This is similar to how the AbstractResult pass is already duplicated for fir.global operations. OpenMP array reductions 2/6 Previous PR: https://github.com/llvm/llvm-project/pull/84952 Next PR: https://github.com/llvm/llvm-project/pull/84954 --------- Co-authored-by:
Mats Petersson <mats.petersson@arm.com>
-
Qiu Chaofan authored
-
Thomas Preud'homme authored
This fixes the following failure when doing a clean build (in particular no .ninja* lying around) of lib/libMLIRLinalgToStandard.a only: ``` In file included from mlir/include/mlir/Dialect/Vector/Transforms/VectorTransforms.h:12, from mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h:21, from mlir/lib/Conversion/LinalgToStandard/LinalgToStandard.cpp:15: mlir/include/mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h:20:10: fatal error: mlir/Dialect/Vector/Transforms/VectorTransformsEnums.h.inc: No such file or directory ``` -
Alexandros Lamprineas authored
We would like the resolver to be generated eagerly, even if the versioned function is not called from the current translation unit. Fixes #81494. It further allows Multi Versioning to work even if the default target version attribute is omitted from function declarations.
-
Pravin Jagtap authored
Authored-by:Pravin Jagtap <Pravin.Jagtap@amd.com>
-
Xiaoyang Liu authored
## Abstract This pull request removes the `__workaround_52970` concept. This concept is a workaround for a bug described in #52970, which causes the compiler to trigger ADL on a pointer to an incomplete type in an SFINAE context. This bug is fixed in Clang 14. ## Reference - [[clang] Don't typo-fix an expression in a SFINAE context](https://reviews.llvm.org/D117603) - [[libc++] [ranges] ADL-proof the [range.access] CPOs.](https://reviews.llvm.org/D116239)
-
Xiaoyang Liu authored
## Abstract This pull request implements LWG3715: `view_interface::empty` is overconstrained. Here is an example similar to those described in the report, which compiles with `-stdlib=libstdc++` but failed to compile with `-stdlib=libc++`: ```cpp // https://godbolt.org/z/EWEoTzah3 std::istringstream input("1 2 3 4 5"); auto i = std::views::istream<int>(input); auto r = std::views::counted(i.begin(), 4) | std::views::take(2); assert(!r.empty()); ``` ## Reference - [Draft C++ Standard: [view.interface.general]](https://eel.is/c++draft/view.interface.general) - [LWG3715](https://wg21.link/LWG3715)
-
Martin Storsjö authored
In other contexts, install directories such as LIBCXX_INSTALL_LIBRARY_DIR and LIBCXX_INSTALL_MODULES_DIR can be specified either as a relative path, relative to CMAKE_INSTALL_PREFIX, or as an absolute path. When calculating the relative path between the two, account for the fact that LIBCXX_INSTALL_MODULES_DIR and LIBCXX_INSTALL_LIBRARY_DIR can be absolute paths too.
-
Mark de Wever authored
Before the __formattable concept depended on itself in a contrieved example. By using the underlying concept directly the cycle is broken. Fixes https://github.com/llvm/llvm-project/issues/81590
-
Christian Sigg authored
-
Nikita Popov authored
Use IRBuilder with TargetFolder in SLPVectorizer to avoid the custom constant folding code. This fixes the remaining part of https://github.com/llvm/llvm-project/issues/61240.
-
Yingwei Zheng authored
This patch handles `not` in `isImpliedCondition` to enable more fold in some multi-use cases.
-
kadir çetinkaya authored
-
Krishna Narayanan authored
-
Justin Holewinski authored
MSVC/Windows does not support `alloca()`; instead it defines `_alloca()` in `malloc.h`.
-
Nathan Ridge authored
The option --function-arg-placeholders=0 results in placeholders being omitted for class template argument lists. This patch extends the same treatment to variable template argument lists. Fixes https://github.com/clangd/clangd/issues/1976
-
Matteo Franciolini authored
The current implementation is not functional and does not compile. The patch allows to correctly mark a dialect as denied for the purpose of bufferization.
-
YunQiang Su authored
MIPSr6 ISA requires normal load/store instructions support misunaligned memory access, while it is not always do so by hardware. On some microarchitectures or some corner cases it may need support by OS. Don't confuse with pre-R6's lwl/lwr famlily: MIPSr6 doesn't support them, instead, r6 requires lw instruction support misunaligned memory access. So, if -mstrict-align is used for pre-R6, lwl/lwr won't be disabled. If -mstrict-align is used for r6 and the access is not well aligned, some lb/lh instructions will be used to replace lw. This is useful for OS kernels. To be back-compatible with GCC, -m(no-)unaligned-access are also added as Neg-Alias of -m(no-)strict-align.
-
Noah Goldstein authored
This reverts commit d80d5b92. It wasn't a particularly important transform to begin with and caused some codegen regressions on targets that prefer `sitofp` so dropping. Might re-visit along with adding `nneg` flag to `uitofp` so its easily reversable for the backend.
-
Billy Zhu authored
Fixes this bug for the previous recursive DI type PR: https://github.com/llvm/llvm-project/pull/80251#issuecomment-2007254788 . Drawing inspiration from how clang uses DIBuilder to build forward decls, this PR changes how placeholders are created & updated. Instead of requiring each recursive DIType to do in-place mutation, we simply ask for a temporary node as the placeholder, and run RAUW at the end when the concrete node is translated. This has the side effect of simplifying what's needed to add recursion support for a type. Now only one additional method needs to be created for exporting. Concretely, for this PR, `translateImpl` for DICompositeType is back to the state it was before the previous PR, and the only net addition for DICompositeType is `translateTemporaryImpl`. --------- Co-authored-by:
Tobias Gysi <tobias.gysi@nextsilicon.com>
-
Peter Rong authored
When i1 true is used as an index, SExt extends it to i32 -1. This would cause BitVector to overflow. The language manual have specified that the index shall be treated as an unsigned number, this patch fixes that. (https://llvm.org/docs/LangRef.html#insertelement-instruction ) This patch fixes #85717 --------- Signed-off-by:
Peter Rong <PeterRong96@gmail.com>
-
Yeoul Na authored
In `-fbounds-safety`, bounds annotations are considered type attributes rather than declaration attributes. Constructing them as type attributes allows us to extend the attribute to apply nested pointers, which is essential to annotate functions that involve out parameters: `void foo(int *__counted_by(*out_count) *out_buf, int *out_count)`. We introduce a new sugar type to support bounds annotated types, `CountAttributedType`. In order to maintain extra data (the bounds expression and the dependent declaration information) that is not trackable in `AttributedType` we create a new type dedicate to this functionality. This patch also extends the parsing logic to parse the `counted_by` argument as an expression, which will allow us to extend the model to support arguments beyond an identifier, e.g., `__counted_by(n + m)` in the future as specified by `-fbounds-safety`. This also adjusts `__bdos` and array-bounds sanitizer code that already uses `CountedByAttr` to check `CountAttributedType` instead to get the field referred to by the attribute.
-
Craig Topper authored
Specification is here https://github.com/riscv/riscv-isa-manual/blob/main/src/rnmi.adoc CSRs numbers defined here https://github.com/riscv/riscv-isa-manual/blob/main/src/priv-csrs.adoc
-
Craig Topper authored
-
Jonas Devlieghere authored
Outline and correct Doxygen comments in LineEntry.
-
Yaxun (Sam) Liu authored
since it will cause duplicate symbols when the partially linked object is linked again.
-
Jonas Devlieghere authored
This reverts commit 113214e1 as the corresponding change was reverted in a289f66e.
-
Jie Fu authored
llvm-project/lld/MachO/ObjC.cpp:617:12: error: implicit conversion turns string literal into bool: 'const char[55]' to 'bool' [-Werror,-Wstring-conversion] 617 | assert("Tried to read pointer list beyond protocol section end"); | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
Cyndy Ishida authored
* This completes support for verifying every declaration found in a header is discovered in the dylib. Diagnostics are reported for each class for differences that are representable in TBD files. * This patch also now captures unavailable attributes that depend on target triples. This is needed for proper tbd file generation.
-
Alex MacLean authored
This change removes an extra, unneeded debug directive emitted in the PTX at the beginning on non-empty functions: ```nvptx .visible .func (.param .b32 func_retval0) foo( .param .b32 foo_param_0, .param .b32 foo_param_1 ) { .reg .b32 %r<4>; .loc 1 26 0 <---- unneeded (removed by the PR) $L__func_begin0: .loc 1 26 0 ``` -
Fangrui Song authored
-
Fangrui Song authored
Ensure that every InputFile has a non-null file so that we enforce this in the future.
-
Jonas Devlieghere authored
Reverts llvm/llvm-project#85468 because @slackito reports this broke stepping in one of their tests [1] and this patch was meant to be NFC. [1] https://github.com/llvm/llvm-project/commit/d5a277d309e92b1d3e493da6036cffdf815105b1#commitcomment-139991120
-
Med Ismail Bennani authored
This patch exposes the missing `eBroadcastBitSymbolsChanged` event bit in `SBTarget`. Signed-off-by:Med Ismail Bennani <ismail@bennani.ma>
-
Qizhi Hu authored
Fix https://github.com/llvm/llvm-project/issues/85343 When build lambda expression in lambda instantiation, `ThisType` is required in `Sema::CheckCXXThisCapture` to build `this` capture. Set `this` type by import `Sema::CXXThisScopeRAII` and it will be used later in lambda expression transformation. Co-authored-by:
huqizhi <836744285@qq.com>
-
Thomas Preud'homme authored
This fixes the following failure when doing a clean build (in particular no .ninja* lying around) of lib/libMLIRMemRefToLLVM.a only: ``` In file included from mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp:18: mlir/include/mlir/Dialect/Func/IR/FuncOps.h:29:10: fatal error: mlir/Dialect/Func/IR/FuncOps.h.inc: No such file or directory ```
-