- Feb 05, 2021
-
-
Akira Hatanaka authored
This reverts commit 3fe3946d. The commit violates layering by including a header from Analysis in lib/IR/AutoUpgrade.cpp.
-
Akira Hatanaka authored
emitting retainRV or claimRV calls in the IR Background: This patch makes changes to the front-end and middle-end that are needed to fix a longstanding problem where llvm breaks ARC's autorelease optimization (see the link below) by separating calls from the marker instructions or retainRV/claimRV calls. The backend changes are in https://reviews.llvm.org/D92569. https://clang.llvm.org/docs/AutomaticReferenceCounting.html#arc-runtime-objc-autoreleasereturnvalue What this patch does to fix the problem: - The front-end adds operand bundle "clang.arc.rv" to calls, which indicates the call is implicitly followed by a marker instruction and an implicit retainRV/claimRV call that consumes the call result. In addition, it emits a call to @llvm.objc.clang.arc.noop.use, which consumes the call result, to prevent the middle-end passes from changing the return type of the called function. This is currently done only when the target is arm64 and the optimization level is higher than -O0. - ARC optimizer temporarily emits retainRV/claimRV calls after the calls with the operand bundle in the IR and removes the inserted calls after processing the function. - ARC contract pass emits retainRV/claimRV calls after the call with the operand bundle. It doesn't remove the operand bundle on the call since the backend needs it to emit the marker instruction. The retainRV and claimRV calls are emitted late in the pipeline to prevent optimization passes from transforming the IR in a way that makes it harder for the ARC middle-end passes to figure out the def-use relationship between the call and the retainRV/claimRV calls (which is the cause of PR31925). - The function inliner removes an autoreleaseRV call in the callee if nothing in the callee prevents it from being paired up with the retainRV/claimRV call in the caller. It then inserts a release call if the call is annotated with claimRV since autoreleaseRV+claimRV is equivalent to a release. If it cannot find an autoreleaseRV call, it tries to transfer the operand bundle to a function call in the callee. This is important since ARC optimizer can remove the autoreleaseRV returning the callee result, which makes it impossible to pair it up with the retainRV/claimRV call in the caller. If that fails, it simply emits a retain call in the IR if the implicit call is a call to retainRV and does nothing if it's a call to claimRV. Future work: - Use the operand bundle on x86-64. - Fix the auto upgrader to convert call+retainRV/claimRV pairs into calls annotated with the operand bundles. rdar://71443534 Differential Revision: https://reviews.llvm.org/D92808
-
Nicolas Vasilache authored
-
Alex Zinenko authored
Historically, Linalg To LLVM conversion subsumed numerous other conversions, including (affine) loop lowerings to CFG and conversions from the Standard and Vector dialects to the LLVM dialect. This was due to the insufficient support for partial conversions in the infrastructure that essentially required conversions that involve type change (in this case, !linalg.range to !llvm.struct) to be performed in a single conversion sweep. This is no longer the case so remove the subsumed conversions and run them as separate passes when necessary. Depends On D95317 Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D96008
-
Kadir Cetinkaya authored
Differential Revision: https://reviews.llvm.org/D95942
-
Qiu Chaofan authored
Commit 6bf29dbb enables float128 feature by default for Power9 targets. But float128 may cause build failure in libcxx testing. Revert this commit first to unblock LLVM 12 release.
-
Simon Pilgrim authored
Fix codegen after rG7fe41ac3
-
Vladislav Vinogradov authored
The `AffineMap` class follows the same semantic as Type and Attribute. It is immutable object, so it make sence to mark its methods as const. Also part of its API is already marked as const, this change just make the API consistent. Reviewed By: ftynse, bondhugula Differential Revision: https://reviews.llvm.org/D96026
-
Aaron Ballman authored
The attribute definition claimed the attribute was inheritable (which only applies to declaration attributes) and not a statement attribute. Further, it treats subject appertainment errors as being parse errors rather than semantic errors, which leads to us accepting invalid code. For instance, we currently fail to reject: void foo() { int i = 1000; __attribute__((nomerge, opencl_unroll_hint(8))) if (i) { foo(); } } This addresses the issues by clarifying that opencl_unroll_hint is a statement attribute and handles its appertainment checks in the semantic layer instead of the parsing layer. This changes the output of the diagnostic text to be more consistent with other appertainment errors. -
Nicolas Vasilache authored
-
Nicolas Vasilache authored
Differential Revision: https://reviews.llvm.org/D96116
-
Adrian Kuegel authored
Revert "[LV] Unconditionally branch from middle to scalar preheader if the scalar loop must execute" This reverts commit 3e5ce49e. Tests started failing on PPC, for example: http://lab.llvm.org:8011/#/builders/105/builds/5569
-
Max Kazantsev authored
The test shows how "usub with overflow" opt gets or does not get applied to increment of IV depending on its code placement, while two cases are semantically equivalent.
-
Nicolas Vasilache authored
-
Simon Pilgrim authored
Remove duplicate param
-
Simon Pilgrim authored
-
Simon Pilgrim authored
Remove duplicate param
-
Simon Pilgrim authored
-
Simon Pilgrim authored
void functions shouldn't have a \returns
-
Simon Pilgrim authored
-
Simon Pilgrim authored
-
Joe Ellis authored
It is possible to eliminate redundant calls to the SVE ptrue intrinsic. For example: suppose that we have two SVE ptrue intrinsic calls P1 and P2. If P1 is at least as wide as P2, then P2 can be written as a reinterpret P1 using the SVE reinterpret intrinsics. Coalescing ptrue intrinsics can result in fewer ptrue instructions in the codegen, and is conducive to better analysis further down the line. This commit extends the aarch64-sve-intrinsic-opts pass to support coalescing ptrue intrisic calls. Reviewed By: david-arm Differential Revision: https://reviews.llvm.org/D94230
-
Aleksandr Platonov authored
Current indexes merge logic skip data from the static index if the file is in the dynamic index, but sometimes the dynamic index does not contain references (e.g. preamble (dynamic) index vs background (static) index). This problem is masked with the fact, that the preamble index file list consists of file URI's and other indexes file lists consist of file paths. This patch introduces the index contents (symbols, references, etc.), which makes indexes merge more flexible and makes it able to use URI's for the index file list. Reviewed By: sammccall Differential Revision: https://reviews.llvm.org/D94952
-
Guillaume Chatelet authored
-
Guillaume Chatelet authored
-
Fraser Cormack authored
This patch adds support for the integer reduction intrinsics supported by RVV. This excludes "mul" which has no corresponding instruction. The reduction instructions in RVV have slightly complicated type constraints given they always produce a single "M1" vector register. They are lowered to custom nodes including the second "scalar" reduction operand to simplify the patterns and in the hope that they can be useful for future DAG combines. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D95620
-
Fraser Cormack authored
This patch custom-legalizes all integer EXTRACT_VECTOR_ELT nodes where SEW < XLEN to VMV_S_X nodes to help the compiler infer sign bits from the result. This allows us to eliminate redundant sign extensions. For parity, all integer EXTRACT_VECTOR_ELT nodes are legalized this way so that we don't need TableGen patterns for some and not others. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D95741
-
Fraser Cormack authored
This patch adds support for lowering the sqrt intrinsic to the RVV vfsqrt instruction. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D96012
-
David Green authored
getIntrinsicInstrCost takes a IntrinsicCostAttributes holding various parameters of the intrinsic being costed. It can either be called with a scalar intrinsic (RetTy==Scalar, VF==1), with a vector instruction (RetTy==Vector, VF==1) or from the vectorizer with a scalar type and vector width (RetTy==Scalar, VF>1). A RetTy==Vector, VF>1 is considered an error. Both of the vector modes are expected to be treated the same, but because this is confusing many backends end up getting it wrong. Instead of trying work with those two values separately this removes the VF parameter, widening the RetTy/ArgTys by VF used called from the vectorizer. This keeps things simpler, but does require some other modifications to keep things consistent. Most backends look like this will be an improvement (or were not using getIntrinsicInstrCost). AMDGPU needed the most changes to keep the code from c230965c working. ARM removed the fix in dfac521d, webassembly happens to get a fixup for an SLP cost issue and both X86 and AArch64 seem to now be using better costs from the vectorizer. Differential Revision: https://reviews.llvm.org/D95291
-
Raphael Isemann authored
The element count getter can just be in the header. Also doxygenify some of the comments and document m_argv's terminating nullptr element that the other comments keep mentioning.
-
James Henderson authored
-
Nicolas Vasilache authored
Reviewed By: nicolasvasilache Differential Revision: https://reviews.llvm.org/D96094
-
Anton Zabaznov authored
OpenCL keywords 'pipe' and 'generic' are unconditionally supported for OpenCL C 2.0 or in OpenCL C++ mode. In OpenCL C 3.0 these keywords are available if corresponding optional core feature is supported. Reviewed By: Anastasia, svenvh Differential Revision: https://reviews.llvm.org/D95778
-
Pavel Labath authored
Use indirection to avoid duplicated long lists of variables. Depends on D95261. Differential Revision: https://reviews.llvm.org/D96034
-
Pavel Labath authored
Replace the dotest command line options and various cmake variables, which are used for passing the locations of llvm tools to the API tests with a single variable, which points to the directory these tools are placed in. Besides reducing repetition, this also makes things more similar to how "normal" llvm tests are configured. Differential Revision: https://reviews.llvm.org/D95261
-
Max Kazantsev authored
These tests demonstrate that LSR does not insert IV increment into the latch block (as it supposes to) when it can use an existing Phi as IV rather than creating a new LSR IV.
-
Sourabh Singh Tomar authored
Earlier scheme was using negative integers for communicating error status, switch to canonical MLIR style. f18 commit authored by @schweitz: https://github.com/flang-compiler/f18-llvm-project/commit/c1af08d6e70b66c08ee2fbf2e63c764ec2e006e5 Reviewed By: mehdi_amini, clementval, svedanayagam Differential Revision: https://reviews.llvm.org/D96068
-
Kazu Hirata authored
-
Kazu Hirata authored
-
Kazu Hirata authored
Identified with const-return-type.
-