- Dec 12, 2023
-
-
Orlando Cazalet-Hyams authored
This patch doesn't change any call sites. Depends on #73498.
-
Nikita Popov authored
We're only working on integers here, so we don't need DataLayout to determine the width.
-
James Y Knight authored
This will result in larger atomic operations getting expanded to `__atomic_*` libcalls via AtomicExpandPass, which matches what Clang already does in the frontend.
-
Kerry McLaughlin authored
Adds the following SME2 builtins: - svunpk (x2 & x4) See https://github.com/ARM-software/acle/pull/217/files Patch by David Sherwood <david.sherwood@arm.com>
-
Guillaume Chatelet authored
Also start to expose some of the internals to avoid duplication.
-
Pete Lawrence authored
This commits fixes a few subtle bugs where the method: 1. Declares a local `Status error` which eclipses the method's parameter `Status &error`. - The method then sets the error state to the local `error` and returns without ever touching the parameter `&error`. - This effectively traps the error state and its message from ever reaching the caller. - I also threw in a null pointer check in case the callee doesn't set its `Status` parameter but returns `0`/`nullptr`. 2. Declares a local `Status deref_error` (good), passes it to the `Dereference` method (also good), but then checks the status of the method's `Status &error` parameter (not good). - The fix checks `deref_error` instead and also checks for a `nullptr` return value. - There's a good opportunity here for a future PR that changes the `Dereference` method to fold an error state into the `ValueObject` return value's `m_error` instead of using a parameter. 3. Declares another local `Status error`, which it doesn't pass to a method (because there isn't a parameter for it), and then checks for an error condition that never happens. - The fix just checks the callee's return value, because that's all it has to go on. - This likely comes from a copy/paste from issue 1 above. rdar://119155810
-
Wang Pengcheng authored
We know the type is scalar type.
-
David Green authored
The adds a hlfir minloc intrinsic, similar to the minval intrinsic already added, to help in the lowering of minloc. The idea is to later add maxloc too, and from there add a simplification for producing minloc with inlined elemental and hopefully less temporaries.
-
Guillaume Chatelet authored
-
jeanPerier authored
VALUE derived type are passed by reference outside of BIND(C) interface. The ABI is much simpler and it is possible for these arguments to have the OPTIONAL attribute. In the BIND(C) context, these arguments must follow the C ABI for struct, which may lead the data to be passed in register. OPTIONAL is also forbidden for those arguments, so it is safe to directly use the fir.type<T> type for the func.func argument. Codegen is in charge of later applying the C passing ABI according to the target (https://github.com/llvm/llvm-project/pull/74829).
-
Nikita Popov authored
The code only works on integer casts, and the only bitcasts involving integers are trivial. The code as previously written would try to handle things like float to integer bitcasts by fetching a ConstantRange of a float value, which is an ill-defined operation.
-
lorenzo chelini authored
Adjust the silenceable failure message as we lower `tensor.unpack` as a combination of `linalg.transpose` + `tensor.collapse_shape` and `tensor.extract_slice`.
-
Guillaume Chatelet authored
This patch sinks `EXPLICIT_BIT_MASK` into `get_explicit_mantissa` - the only function using it. Then it sinks the content of `FPCommonProperties` directly into `FPProperties`.
-
Guillaume Chatelet authored
`EXPONENT_BIAS` is almost always used with signed arithmetic. Making it an `int32_t` from the start reduces the chances to run into implementation defined behavior (cast from unsigned to signed is implementation-defined until C++20). https://en.cppreference.com/w/cpp/language/implicit_conversion#:~:text=If%20the%20destination%20type%20is%20signed,arithmetic%20overflow%2C%20which%20is%20undefined).
-
Nikita Popov authored
For the remaining uses set it to true, matching the current behavior.
-
Orlando Cazalet-Hyams authored
This is a boring mechanical update to support DPValues that look like dbg.declares in SelectionDAG. The tests will become "live" once #74090 lands (see for more info).
-
Nikolas Klauser authored
This is back-ported to C++03 now, since clang accepts C++11 attributes in C++03. https://godbolt.org/z/f7xG18bdE
-
Wang Pengcheng authored
We can reduce some code.
-
Nabeel Omer authored
> We are re-using tryToMergePartialOverlappingStores, which requires DeadSI to dominate DeadSI. Should be "DeadSI to dominate KillingSI" because that's what the check is for.
-
Nikita Popov authored
Using it for RHS is fine, as undef is UB in that case.
-
Nikita Popov authored
-
Simon Pilgrim authored
Rename to canonicalizeShuffleWithOp and begin adding SHUFFLE(UNARYOP(X),UNARYOP(Y)) -> UNARYOP(SHUFFLE(X,Y)) fold support. This is only kicking in after legalization, so targets that expand bit counts are still duplicating but it helps with a few initial cases. I'm investigating adding support for extensions/conversions as well, but this is a first step.
-
Guillaume Chatelet authored
-
Nikita Popov authored
-
Nikita Popov authored
-
jeanPerier authored
In the context of C/Fortran interoperability (BIND(C)), it is possible to give the VALUE attribute to a BIND(C) derived type dummy, which according to Fortran 2018 18.3.6 - 2. (4) implies that it must be passed like the equivalent C structure value. The way C structure value are passed is ABI dependent. LLVM does not implement the C struct ABI passing for LLVM aggregate type arguments. It is up to the front-end, like clang is doing, to split the struct into registers or pass the struct on the stack (llvm "byval") as required by the target ABI. So the logic for C struct passing sits in clang. Using it from flang requires setting up a lot of clang context and to bridge FIR/MLIR representation to clang AST representation for function signatures (in both directions). It is a non trivial task. See https://stackoverflow.com/questions/39438033/passing-structs-by-value-in-llvm-ir/75002581#75002581. Since BIND(C) struct are rather limited as opposed to generic C struct (e.g. no bit fields). It is easier to provide a limited implementation of it for the case that matter to Fortran. This patch: - Updates the generic target rewrite pass to keep track of both the new argument type and attributes. The motivation for this is to be able to tell if a previously marshalled argument is passed in memory (it is a C pointer), or if it is being passed on the stack (has the byval llvm attributes). - Adds an entry point in the target specific codegen to marshal struct arguments, and use it in the generic target rewrite pass. - Implements limited support for the X86-64 case. So far, the support allows telling if a struct must be passed in register or on the stack, and to deal with the stack case. The register case is left TODO in this patch. The X86-64 ABI implemented is the System V ABI for AMD64 version 1.0
-
Guillaume Chatelet authored
-
Nikita Popov authored
For the two remaining uses that did not explicitly specify it, set UndefAllowed=false. In both cases, I believe that treating undef as a full range is the correct behavior.
-
Mariusz Sikora authored
Co-authored-by:Mirko Brkusanin <Mirko.Brkusanin@amd.com>
-
Simon Pilgrim authored
[X86] X86FixupVectorConstants - create f32/f64 broadcast constants if the source constant data was f32/f64 This partially reverts 33819f3b - the asm comments become a lot messier in #73509 - we're better off ensuring the constant data is the correct type in DAG
-
Nikita Popov authored
-
Nikita Popov authored
-
Nikita Popov authored
-
wangpc authored
-
wangpc authored
To reduce the diff in #73310
-
Timm Baeder authored
Static lambdas cannot have captures. They may still end up in the constant evaluator though. They've been diagnosted appropriately before, so just reject them here. This is similar to #74661, but for the new constant expression interpreter.
-
Timm Baeder authored
This way we have a pointer to the first element on the stack.
-
Nikita Popov authored
The current implementation using a worklist and visited map adds a significant amount of additional complexity and compile-time overhead. All we really care about here is that we don't overflow the stack or cause exponential complexity in degenerate cases. We can achieve this with a simple depth limit.
-
David Spickett authored
For reasons unknown, the FIRST_TIMER and FIRST_TIME_CONTRIBUTOR states don't come through on new user PRs, I have opened https://github.com/orgs/community/discussions/78038 to see if that's my mistake or GitHub's. In the meantime, a possible workaround is to check that we have none of the other states. If there's some bug that means the first time associations aren't available in workflows, maybe the association will be "NONE". Also added a debug step to print that association so I can add it to the linked report. I will remove this as soon as I have 1 example PR.
-
Wang Pengcheng authored
There are a lot of operations to move current node to parent and then move to another child. So `OPC_MoveSibling` and its space-optimized forms are added to do this "move to sibling" operations. These new operations will be generated when optimizing matcher in `ContractNodes`. Currently `MoveParent+MoveChild` will be optimized to `MoveSibling` and sequences `MoveParent+RecordChild+MoveChild` will be transformed into `MoveSibling+RecordNode`. Overall this reduces the llc binary size with all in-tree targets by about 30K.
-