- Dec 05, 2023
-
-
Simon Pilgrim authored
We use X32 for gnux32 triples - X86 should be used for 32-bit triples
-
Valery Pykhtin authored
Upcoming patch #74422.
-
Jeremy Morse authored
The order of dbg.value intrinsics appearing in the output can affect the order of tables in DWARF sections. This means that DPValues, our dbg.value replacement, needs to obey the same ordering rules. For dbg.values returned by findDbgUsers it's reverse order of creation (due to how they're put on use-lists). Produce that order from findDbgUsers for DPValues. I've got a few IR files where the order of dbg.values flips, but it's a fragile test -- ultimately it needs the number of times a DPValue is handled by findDbgValues to be odd.
-
Andrzej Warzynski authored
-
Florian Hahn authored
StoreSwiftAsyncContext clobbers X16 & X17. Make sure they are available in canUseAsPrologue, to avoid shrink wrapping moving the pseudo to a place where X16 or X17 are live.
-
Rik Huijzer authored
Continuation of https://github.com/llvm/llvm-project/pull/74247 to fix https://github.com/llvm/llvm-project/issues/56962. Fixes verifier for (Integer Attr): ```mlir llvm.mlir.constant(1 : index) : f32 ``` and (Dense Attr): ```mlir llvm.mlir.constant(dense<100.0> : vector<1xf64>) : f32 ``` ## Integer Attr The addition that this PR makes to `LLVM::ConstantOp::verify` is meant to be exactly verifying the code in `mlir::LLVM::detail::getLLVMConstant`: https://github.com/llvm/llvm-project/blob/9f78edbd20ed922cced9482f7791deb9899a6d82/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp#L350-L353 One failure mode is when the `type` (`llvm.mlir.constant(<value>) : <type>`) is not an `Integer`, because then the `cast` in `getIntegerBitWidth` will crash: https://github.com/llvm/llvm-project/blob/dca432cb7b1c282f5dc861095813c4f40f109619/llvm/include/llvm/IR/DerivedTypes.h#L97-L99 So that's now caught in the verifier. Apart from that, I don't see anything we could check for. `sextOrTrunc` means "Sign extend or truncate to width" and that one is quite permissive. For example, the following doesn't have to be caught in the verifier as it doesn't crash during `mlir-translate -mlir-to-llvmir`: ```mlir llvm.func @main() -> f32 { %cst = llvm.mlir.constant(100 : i64) : f32 llvm.return %cst : f32 } ``` ## Dense Attr Crash if not either a MLIR Vector type or one of these: https://github.com/llvm/llvm-project/blob/9f78edbd20ed922cced9482f7791deb9899a6d82/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp#L375-L391
-
Benjamin Maxwell authored
This patch adds a target_features (TargetFeaturesAttr) to the LLVM dialect to allow setting and querying the features in use on a function. The motivation for this comes from the Arm SME dialect where we would like a convenient way to check what variants of an operation are available based on the CPU features. Intended usage: The target_features attribute is populated manually or by a pass: ```mlir func.func @example() attributes { target_features = #llvm.target_features<["+sme", "+sve", "+sme-f64f64"]> } { // ... } ``` Then within a later rewrite the attribute can be checked, and used to make lowering decisions. ```c++ // Finds the "target_features" attribute on the parent // FunctionOpInterface. auto targetFeatures = LLVM::TargetFeaturesAttr::featuresAt(op); // Check a feature. // Returns false if targetFeatures is null or the feature is not in // the list. if (!targetFeatures.contains("+sme-f64f64")) return failure(); ``` For now, this is rather simple just checks if the exact feature is in the list, though it could be possible to extend with implied features using information from LLVM. -
David Spickett authored
This includes some commonly needed information like how to add reviewers. This is implemented as a job before the labeler, so that on a new PR the comment is added before there are any subscribers and only the author gets a nofitication. The labeler job depends on the greeter having run or having been skipped. So if the PR wasn't just opened, or it's from a regular contributor, the labeling still happens. But we can be sure that when a greeting comment is left, it's the very first thing we do.
-
Jeremy Morse authored
Avoid editing a range of DPValues and then remapping them. This occurs when we try to de-duplicate dbg.values, but then re-use the same iterator range. We can instead remap them, and then erase any duplicates. At the same time refactor the computation of seen-intrinsic hashes, and account for a peculiarity of loop-rotates existing behaviour: it will only deduplicate dbg.values that are immediately before the preheaders branch instruction, not just any dbg.value in the preheader.
-
Samira Bazuzi authored
…ng member pointers. This initially landed with a broken test due to a mid-air collision with a new requirement for Environment initialization before field modeling. Have added that initialization in the test. From first landing: getMethodDecl does not handle pointers to members and returns nullptr for them. getMethodDecl contains a decade-plus-old FIXME to handle pointers to members, but two approaches I looked at for fixing it are more invasive or complex than simply swapping to getCalleeDecl. The first, have getMethodDecl call getCalleeDecl, creates a large tree of const-ness mismatches due to getMethodDecl returning a non-const value while being a const member function and getCalleeDecl only being a const member function when it returns a const value. The second, implementing an AST walk to match how CXXMemberCallExpr::getImplicitObjectArgument grabs the LHS of the binary operator, is basically reimplementing Expr::getReferencedDeclOfCallee, which is used by Expr::getCalleeDecl. We don't need another copy of that code.
-
Jacek Caban authored
ARM64EC needs to handle both ARM and x86_64 exception tables. This is achieved by separating their chunks and sorting them separately. EXCEPTION_TABLE directory references x86_64 variant, while ARM variant is exposed using CHPE metadata, which references __arm64x_extra_rfe_table and __arm64x_extra_rfe_table_size symbols.
-
Matthew Devereau authored
-
Radu Salavat authored
Add support for frame pointers in MLIR. --------- Co-authored-by:
Markus Böck <markus.boeck02@gmail.com> Co-authored-by:
Christian Ulmann <christianulmann@gmail.com>
-
Owen Pan authored
This is a minor improvement to #73491.
-
Guillaume Chatelet authored
Same as #73939 but also fix `libc/src/string/memory_utils/op_aarch64.h` that was still using `deferred_static_assert`.
-
Guillaume Chatelet authored
Reverts llvm/llvm-project#73939 This broke libc-aarch64-ubuntu build bot https://lab.llvm.org/buildbot/#/builders/138/builds/56186
-
Guillaume Chatelet authored
-
Mikhail Goncharov authored
This reverts commit d55692d6. See discussion in #66505: assertion fires in OSS build of TensorFlow.
-
Jay Foad authored
-
Billy Zhu authored
Translate debug emission kind into LLVM (the importer already supports this).
-
Tom Eccles authored
Now that tbaa tags pass is enabled by default, I would like to remove these flags. `-fno-alias-analysis` was originally intended to be useful for debugging, but as it also disables tbaa tag generation in codegen, it turned out to be too noisy. @banach-space expressed that these flags felt too non-standard. The tbaa tags pass can be toggled using `-mllvm -disable-fir-alias-tags=0`
-
eleviant authored
AsmParser creates dummy values when value identifiers are not going in ascending order and tries to use those dummy values when/if they are being referenced. We need to postpone this until all required data is read.
-
Nikita Popov authored
Because AA does not support vectors of pointers, we have to treat pointers that are inserted into a vector as captures. We mostly already do so, but missed the case where getelementptr is used to produce a vector.
-
Nikita Popov authored
Reported at: https://github.com/llvm/llvm-project/pull/69931#issuecomment-1839475854
-
Hideto Ueno authored
This commit refactors `verifyDominanceOfContainedRegions` to iterative algorithms similar to https://reviews.llvm.org/D154925 to fix stack overflow for deeply nested regions (e.g. https://github.com/llvm/circt/issues/5316). There should be no functional change except that this could result in slightly different order of verification.
-
ZengZhijin authored
Count how often the value is with signext/zeroext calls when determining the preferred extension type.
-
Mikhail Goncharov authored
-
Andrzej Warzyński authored
Updates patterns for flattening `vector.transfer_read` by relaxing the requirement that the "collapsed" indices are all zero. This enables collapsing cases like this one: ```mlir %2 = vector.transfer_read %arg4[%c0, %arg0, %arg1, %c0] ... : memref<1x43x4x6xi32>, vector<1x2x6xi32> ``` Previously only the following case would be consider for collapsing (all indices are 0): ```mlir %2 = vector.transfer_read %arg4[%c0, %c0, %c0, %c0] ... : memref<1x43x4x6xi32>, vector<1x2x6xi32> ``` Also adds some new comments and renames the `firstContiguousInnerDim` parameter as `firstDimToCollapse` (the latter better matches the actual meaning). Similar updates for `vector.transfer_write` will be implemented in a follow-up patch. -
Ramkumar Ramachandra authored
Follow up on a post-commit review of 9468de48 (TargetInstrInfo: make getOperandLatency return optional (NFC)) by Bjorn Pettersson to fix a couple of things that are not NFC: - std::optional<T>::operator<= returns true if the first operand is a std::nullopt and second operand is T. Fix a couple of places where we assumed it would return false. - In TargetSchedule, computeInstrCost could take another codepath, returning InstrLatency instead of DefaultDefLatency. Fix one instance not accounting for this behavior.
-
Phoebe Wang authored
-
Brad Smith authored
Also eliminate an unused variable while here.
-
Yonggang Luo authored
[clang] Fixes compile error that double colon operator cannot resolve macro with parentheses. (#68618) Error message: ``` In file included from ../src/amd/addrlib/src/core/addrobject.h:21: ../src/amd/addrlib/src/core/addrcommon.h:343:13: error: expected unqualified-id out = ::_tzcnt_u32(mask); ^ /usr/lib/llvm-15/lib/clang/15.0.6/include/bmiintrin.h:74:27: note: expanded from macro '_tzcnt_u32' #define _tzcnt_u32(a) (__tzcnt_u32((a))) ``` This is because both GCC/Clang doesn't support compiling the following code: ``` #ifdef _MSC_VER #include <intrin.h> #else #include <x86intrin.h> #endif int f(int a) { return ::(_tzcnt_u32)(a); } ``` This is because the return statement expects an expression or braced init list: http://eel.is/c++draft/stmt.jump#general-1 but we really only need to care about the expression form (there's no braces in sight). Grammatically, the leading :: will parse as a qualified-id because it matches the production for nested-name-specifier: http://eel.is/c++draft/expr.prim.id.qual#nt:qualified-id That needs to be followed by an unqualified-id (http://eel.is/c++draft/expr.prim.id.unqual#nt:unqualified-id), but the open paren does not match any of the grammar productions, so this is a syntax error. Closes: https://github.com/llvm/llvm-project/issues/64467 Signed-off-by:Yonggang Luo <luoyonggang@gmail.com>
-
Amy Wang authored
This PR creates the wrapper class AffineForOp and adds a testcase for it. A testcase for the AffineLoadOp is also added.
-
Craig Topper authored
The explicit 'align 4' caused the pointers to be underaligned on RV64.
-
Danila Malyutin authored
Specify their restrictions w.r.t. `align` attribute.
-
Vlad Serebrennikov authored
This patch continues the work started with ea5b1ef0. See that commit and its corresponding PR for details.
-
Brad Smith authored
-
Joshua Cao authored
There is support for intrinsics in Instruction::isCommunative, but there is no equivalent implementation for isAssociative. This patch builds support for associative intrinsics with TRE as an application. TRE can now have associative intrinsics as an accumulator. For example: ``` struct Node { Node *next; unsigned val; } unsigned maxval(struct Node *n) { if (!n) return 0; return std::max(n->val, maxval(n->next)); } ``` Can be transformed into: ``` unsigned maxval(struct Node *n) { struct Node *head = n; unsigned max = 0; // Identity of unsigned std::max while (true) { if (!head) return max; max = std::max(max, head->val); head = head->next; } return max; } ``` This example results in about 5x speedup in local runs. We conservatively only consider min/max and as associative for this patch to limit testing scope. There are probably other intrinsics that could be considered associative. There are a few consumers of isAssociative() that could be impacted. Testing has only required to Reassociate pass be updated. -
Joshua Cao authored
-
Brad Smith authored
This reverts commit 3223936d. Commited by accident while mixed in with another commit.
-