- Oct 13, 2022
-
-
WANG Xuerui authored
The e_flags of existing object files are all 0x3 which happens to be compatible. From this commit on, all LoongArch objects produced with upstream LLVM will be of object file ABI v1, which is already supported by binutils' master branch (to be released as 2.40), and is allowed by the same binutils version to interlink with v0 objects so the existing distributions have time to migrate. Differential Revision: https://reviews.llvm.org/D134601
-
Sheng authored
To achieve this, we need this observation: `uzp1` is just a `xtn` that operates on two registers For example, given the following register with type v2i64: LSB_______MSB x0 x1 x2 x3 Applying xtn on it we get: x0 x2 This is equivalent to bitcast it to v4i32, and then applying uzp1 on it: x0 x1 x2 x3 | uzp1 v x0 x2 <value from other register> We can transform xtn to uzp1 by this observation, and vice versa. This observation only works on little endian target. Big endian target has a problem: the uzp1 cannot be replaced by xtn since there is a discrepancy in the behavior of uzp1 between the little endian and big endian. To illustrate, take the following for example: LSB____________________MSB x0 x1 x2 x3 On little endian, uzp1 grabs x0 and x2, which is right; on big endian, it grabs x3 and x1, which doesn't match what I saw on the document. But, since I'm new to AArch64, take my word with a pinch of salt. This bevavior is observed on gdb, maybe there's issue in the order of the value printed by it ? Whatever the reason is, the execution result given by qemu just doesn't match. So I disable this on big endian target temporarily until we find the crux. Fixes #57502 Reviewed By: dmgreen, mingmingl Co-authored-by:
Mingming Liu <mingmingl@google.com> Differential Revision: https://reviews.llvm.org/D133850
-
Sam McCall authored
Need to take a break from this, so write down where we got to. Differential Revision: https://reviews.llvm.org/D135696
-
Daniel Grumberg authored
ExtractAPI was emitting a separate symbol for anonymous record declaration that define the type of a member of another record declaration. Now ExtractAPI ignores these declarations and just records the existence of the actual member. Differential Revision: https://reviews.llvm.org/D135804
-
Simon Pilgrim authored
[X86][AVX2] Add shuffle test case where we fail to merge vpunpcklqdq(vextracti128(x,0),vextracti128(x,1)) -> vpermq These are likely to appear during truncation
-
Caroline Concatto authored
First patch in a series adding MC layer support for Scalable Matrix Extension 2 (SME2). This patch adds the following feature: sme2 The 2022 Architecture Extension release adds other feature flags(eg.:sme2.1), that will be in follow-up patches. The reference can be found here: https://developer.arm.com/documentation/ddi0602/2022-09 Differential Revision: https://reviews.llvm.org/D135448
-
Nikita Popov authored
This reverts commit b05f5b90. There are thread sanitizer buildbot failures in simple_stack.c. I think that's because this ended up affecting the handling of volatile accesses to allocas. Reverting for now.
-
Nikita Popov authored
This is in preparation for https://discourse.llvm.org/t/rfc-unify-memory-effect-attributes/65579. FunctionModRefBehavior will be used by attributes, and as such has to be available in IR, not just Analysis. Differential Revision: https://reviews.llvm.org/D135589
-
Sam McCall authored
This check performs an extremely large amount of work (for each variable, it runs very many full matcher-driven traversals of the whole scope the variable is defined in). When (inadvertently) enabled for Fuchsia, it regressed BuildAST times by >10x (400ms -> 7s on my machine). Differential Revision: https://reviews.llvm.org/D135829
-
Valentin Clement authored
In some cases, it is useful to be able to embox a polymorphic entity together with its dynamic type. This patch adds an optional tdesc operand to fir.embox so the dynamic type can be provided while emboxing the entity. This will be used in follow-up patch that lowers tbp calls for element of polymorphic entities array. Reviewed By: jeanPerier Differential Revision: https://reviews.llvm.org/D135809
-
Archibald Elliott authored
fp16 and bf16 values can be used in GCC's inline assembly using the "w" constraint, which means "VFP floating-point registers d0-d31" - fp16 and bf16 values are stored in S registers (which alias the D registers). This change ensures that LLVM is compatible with GCC for programs that use fp16 and the 'w' constraint. Differential Revision: https://reviews.llvm.org/D135662
-
Nikita Popov authored
Don't add argmem if the pointer is clearly not an argument (e.g. a global). I don't think this makes a difference right now, but gives more obvious results with D135780.
-
Nikita Popov authored
-
Florian Hahn authored
Limit pointer decomposition to pointers with index sizes of at most 64 bits. int64_t is used for coefficients, so as long as the index size <= 64 bits we should be able to represent all pointer offsets. Pointer decomposition is limited to inbounds GEPs, so if a index computation would overflow the result is poison, so it doesn't matter that the coefficient overflows. This allows replacing MulOverflow with regular multiplications.
-
Nikita Popov authored
We have to account for accesses to argument memory via captures. I don't think there's any way to make this produce incorrect results right now (because as soon as "other" is set, we lose the ability to infer argmemonly), but this avoids incorrect results once we have more precise representation.
-
Haojian Wu authored
Differential Revision: https://reviews.llvm.org/D135857
-
Bjorn Pettersson authored
-
Bjorn Pettersson authored
-
Bjorn Pettersson authored
-
Bjorn Pettersson authored
-
Simon Tatham authored
MachineInstr's copy constructor works by calling the addOperand method to add each operand of the old MachineInstr to the new one, one by one. But addOperand deliberately avoids trying to replicate ties between operands, on the grounds that the tie refers to operands by index, and the indices aren't necessarily finalized yet. This led to a code generation fault when the machine pipeliner cloned an Arm conditional instruction, and lost the tie between the output register and the input value to be used when the condition failed to execute. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D135434
-
Valentin Clement authored
non-polymorphic derived-type can call type-bound procedure with passed-object. In that case, the derived-type is emboxed in order to be passed to the call. Until now the emboxing was done to a fir.box followed by a fir.convert. This patch update the createBox function so that we can directly embox to a fir.class and avoid the extra fir.convert. Reviewed By: PeteSteinfeld Differential Revision: https://reviews.llvm.org/D135790
-
Nikita Popov authored
Conversion performed using the script at: https://gist.github.com/nikic/98357b71fd67756b0f064c9517b62a34
-
Nikita Popov authored
-
Nikita Popov authored
The code for inferring memory attributes on arguments claims that inalloca/preallocated arguments are always clobbered: https://github.com/llvm/llvm-project/blob/d71ad4108056d685f48407447095d8d92fd7685d/llvm/lib/Transforms/IPO/FunctionAttrs.cpp#L640-L642 However, we would still infer memory attributes for the whole function without taking this into account, so we could still end up inferring readnone for the function. This adds an argument clobber if there are any inalloca/preallocated arguments. Differential Revision: https://reviews.llvm.org/D135783
-
Andi Drebes authored
The MemRef to LLVM conversion pass emits `llvm.alloca` operations to promote MemRef descriptors to the stack when lowering `memref.copy` operations for operands which do not have a contiguous layout in memory. The original stack position is never restored after the allocations, which creates an issue when the copy operation is embedded into a loop with a high trip count, ultimately resulting in a segmentation fault due to the stack growing too large. Below is as a minimal example illustrating the issue: ``` module { func.func @main() { %arg0 = memref.alloc() : memref<32x64xi64> %arg1 = memref.alloc() : memref<16x32xi64> %lb = arith.constant 0 : index %ub = arith.constant 100000 : index %step = arith.constant 1 : index %slice = memref.subview %arg0[16,32][16,32][1,1] : memref<32x64xi64> to memref<16x32xi64, #map> scf.for %i = %lb to %ub step %step { memref.copy %slice, %arg1 : memref<16x32xi64, #map> to memref<16x32xi64> } return } } ``` When running the code above, e.g., with mlir-cpu-runner, the execution crashes with a segmentation fault: ``` $ mlir-opt \ --convert-scf-to-cf \ --convert-memref-to-llvm \ --convert-func-to-llvm --convert-cf-to-llvm \ --reconcile-unrealized-casts <file> | \ mlir-cpu-runner \ -e main -entry-point-result=void \ --shared-libs=$PWD/build/lib/libmlir_c_runner_utils.so [...] Segmentation fault ``` This patch causes the code lowering a `memref.copy` operation in the MemRefToLLVM pass to emit a pair of matching `llvm.intr.stacksave` and `llvm.intr.stackrestore` operations around the promotion of memory descriptors and the subsequent call to `memrefCopy` in order to restore the stack to its original position after the call. Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D135756 -
Oleg Shyshkov authored
`getIteratorTypesArray` should be used instead. It's a better substitute for all the current usages of the interface. The current `ArrayAttr iterator_types()` has a few problems: * It creates an assumption operation has iterators types as an attribute, but it's not always the case. Sometime iterator types can be inferred from other attribute, or they're just static. * ArrayAttr is an obscure contained and required extracting values in the client code. * Makes it hard to migrate iterator types from strings to enums ([RFC](https://discourse.llvm.org/t/rfc-enumattr-for-iterator-types-in-linalg/64535/9)). Concrete ops, like `linalg.generic` will still have iterator types as an attribute if needed. As a side effect, this change helps a bit with migration to prefixed accessors. Differential Revision: https://reviews.llvm.org/D135765
-
Benjamin Kramer authored
-
Leon Clark authored
Add FileCheck directives to existing tests in preparation for new tests. Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D135788
-
Martin Storsjö authored
This matches what was done for the ARM implementation (where getting the instruction sizes right is even more tricky, and hence needed tighter testing). This will allow catching any future cases where prologs and epilogs don't match the instructions within them. Differential Revision: https://reviews.llvm.org/D131394
-
Martin Storsjö authored
Differential Revision: https://reviews.llvm.org/D135817
-
Martin Storsjö authored
If the stack is realigned, we've emitted a frame pointer and already terminated the SEH prologue, making this dead code since a07787c9. The immediate to this SEH opcode was entirely bogus - we don't know how many bytes the AND operation adjusts the SP, and by doing "NumBytes & andMaskEncoded" (where andMaskEncoded was the immediate bitpattern for the AND instruction), the immediate to the opcode was total gibberish. This hasn't had any practical effect, since the original stack pointer always was restored from the frame pointer afterwards anyway. Differential Revision: https://reviews.llvm.org/D135815
-
Martin Storsjö authored
Whenever a call to __chkstk was made, the frame lowering previously omitted the aligning (as NumBytes was reset to zero before doing alignment). This fixes https://github.com/llvm/llvm-project/issues/56182. Differential Revision: https://reviews.llvm.org/D135687
-
Balazs Benics authored
The Clang Static Analyzer will crash on this code: ```lang=C++ struct Box { int value; }; template <Box V> int get() { return V.value; } template int get<Box{-1}>(); ``` https://godbolt.org/z/5Yb1sMMMb The problem is that we don't account for encountering `TemplateParamObjectDecl`s within the `DeclRefExpr` handler in the `ExprEngine`. IMO we should create a new memregion for representing such template param objects, to model their language semantics. Such as: - it should have global static storage - for two identical values, their addresses should be identical as well http://eel.is/c%2B%2Bdraft/temp.param#8 I was thinking of introducing a `TemplateParamObjectRegion` under `DeclRegion` for this purpose. It could have `TemplateParamObjectDecl` as a field. The `TemplateParamObjectDecl::getValue()` returns `APValue`, which might represent multiple levels of structures, unions and other goodies - making the transformation from `APValue` to `SVal` a bit complicated. That being said, for now, I think having `Unknowns` for such cases is definitely an improvement to crashing, hence I'm proposing this patch. Reviewed By: xazax.hun Differential Revision: https://reviews.llvm.org/D135763 -
Xiang Li authored
cbuffer A { float a; float b; } will be translated to a global variable. Something like struct CB_Ty { float a; float b; }; CB_Ty A; And all use of a and b will be replaced with A.a and A.b. Only support none-legacy cbuffer layout now. CodeGen for Resource binding will be in separate patch. In the separate patch, resource binding will map the resource information to the global variable. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D130131 -
Kai Luo authored
Fixed error ``` Command Output (stderr): -- fatal error: error in backend: Objective-C support is unimplemented for object file format ``` Source code in `clang/lib/CodeGen/CGObjCMac.cpp:5080` ``` case llvm::Triple::Wasm: case llvm::Triple::GOFF: case llvm::Triple::SPIRV: case llvm::Triple::XCOFF: case llvm::Triple::DXContainer: llvm::report_fatal_error( "Objective-C support is unimplemented for object file format"); } ``` Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D135848 -
Jordan Rupprecht authored
The functionality is fine (we don't run the breakpoint command twice), but this test forgot to call `FileCheck` and isn't checking the same value isn't there twice..
-
Yaxun (Sam) Liu authored
HIP is installed at /usr or /usr/local on Debin/Fedora, and the version file is at {root}/share/hip/version. Reviewed by: Artem Belevich Differential Revision: https://reviews.llvm.org/D135796 -
Mehdi Amini authored
-
Mehdi Amini authored
-