- Sep 25, 2023
-
-
jeanPerier authored
- Just use genDeallocateIfAllocate. - Port/share the related FIR test.
-
Job Noorman authored
Currently, obj2yaml doesn't emit the offset of program headers, leaving it to yaml2obj to calculate offsets based on `FirstSec` and `LastSec`. This causes an obj2yaml->yaml2obj round trip to often produce an ELF file that is not equivalent to the original, especially since it seems common to have program headers at offset 0 whose first section starts at a higher address. Besides being non-equivalent, the produced ELF files also do not seem to work propery and readelf complains about them. Taking a simple hello world program in C, compiled using either GCC or Clang, the original ELF file has the following program headers (only showing some relevant ones): ``` Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align PHDR 0x0000000000000040 0x0000000000000040 0x0000000000000040 0x00000000000002d8 0x00000000000002d8 R 0x8 INTERP 0x0000000000000318 0x0000000000000318 0x0000000000000318 0x000000000000001c 0x000000000000001c R 0x1 [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000630 0x0000000000000630 R 0x1000 LOAD 0x0000000000001000 0x0000000000001000 0x0000000000001000 0x0000000000000161 0x0000000000000161 R E 0x1000 ... Section to Segment mapping: Segment Sections... 00 01 .interp 02 .interp .note.gnu.property .note.gnu.build-id .note.ABI-tag .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn .rela.plt 03 .init .plt .text .fini ... ``` While this is the result of an obj2yaml->yaml2obj round trip: ``` Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align PHDR 0x0000000000000000 0x0000000000000040 0x0000000000000040 0x0000000000000000 0x0000000000000000 R 0x8 readelf: Error: the PHDR segment is not covered by a LOAD segment INTERP 0x0000000000000318 0x0000000000000318 0x0000000000000318 0x000000000000001c 0x000000000000001c R 0x1 [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] LOAD 0x0000000000000318 0x0000000000000000 0x0000000000000000 0x0000000000000318 0x0000000000000318 R 0x1000 LOAD 0x0000000000001000 0x0000000000001000 0x0000000000001000 0x0000000000000161 0x0000000000000161 R E 0x1000 ... Section to Segment mapping: Segment Sections... 00 01 .interp 02 03 .init .plt .text .fini ... ``` Note that the offset of segment 2 changed from 0x0 to 0x318. This has two effects: - readelf complains "Error: the PHDR segment is not covered by a LOAD segment" since PHDR was originally covered by segment 2 but not anymore; - Segment 2 effectively became empty according to the section to segment mapping. I addition to these, the output doesn't correctly execute anymore, crashing with a "SIGSEGV (Address boundary error)". This patch fixes the difference in program header layout after a round trip by explicitly emitting offsets. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D145555 -
Haojian Wu authored
-
Jinyun (Joey) Ye authored
transform::PrintOp::build(OpBuilder &builder, OperationState &result, StringRef name) does not set name correctly. Calling PrintOp::build(builder, result, "whatever name") is going to end up with a PrintOp with no name. This patch fixes it by replicating the approach from tablegen created code. Refer to build/mlir/include/mlir/Dialect/Transform/IR/TransformOps.cpp.inc
-
Paulo Matos authored
Adds new extension SPV_KHR_expect_assume, new capability ExpectAssumeKHR as well as the new instructions: * OpExpectKHR * OpAssumeTrueKHR These are lowered from respectively llvm.expect.<ty> and llvm.assume intrinsics. Previously https://reviews.llvm.org/D157696
-
Oleksandr "Alex" Zinenko authored
This chapter demonstrates how one can replicate Halide DSL transformations using transform dialect operations transforming payload expressed using Linalg. This was a part of the live tutorial presented at EuroLLVM 2023.
-
Yingwei Zheng authored
This patch further improves the simplification of pattern `icmp eq/ne min|max(X, Y), Z` as discussed in [D156238](https://reviews.llvm.org/D156238). When `X < Z`: `min(X, Y) == Z -> false` `min(X, Y) != Z -> true` `max(X, Y) == Z -> Y == Z` `max(Y, Z) != Z -> Y != Z` When `X > Z`: `max(X, Y) == Z -> false` `max(X, Y) != Z -> true` `min(X, Y) == Z -> Y == Z` `min(Y, Z) != Z -> Y != Z` Alive2: https://alive2.llvm.org/ce/z/evkmaq
-
Amara Emerson authored
Use wrappers and helpers to tidy it up, and remove some debug prints.
-
Amara Emerson authored
-
Kunwar Grover authored
This patch fixes a bug in PresburgerSpace::convertVarKind where the identifiers were not moved properly due to offset being invalidated.
-
Frederic Cambus authored
Reference: https://github.com/openbsd/src/blob/master/sys/sys/exec_elf.h
-
Felix Schneider authored
`scf::ForallOp` has `shared_outs` tensor operands which are used to insert partial results into in the parallel terminator. The `scf::ForallOp` returns one tensor for each `shared_out` which then contains the combined result from all threads. Since the parallel terminator cannot change the shape of the `shared_out`, ForallOp is a `DestinationStyleOp` and this patch implements the interface by declaring the `outputs` operands as `inits` in the language of the DPS interface. For this change to work, we need to add an exception to the Pattern that folds `tensor.cast` Ops into DPS Ops because `scf::Forall` needs special handling of its `BlockArgument` Type during this folding.
-
Kazushi Marukawa authored
Add VE cache file for the ease of compiling.
-
Kunwar Grover authored
MLIR TableGen definitions usually use absolute includes instead of relative includes. This patch makes it consistent for OpenACC operation definations.
-
Brandon Wu authored
-
Yeting Kuo authored
This fixes two wrong offset uses, 1. .cfi_offset of callee saves are not pushed by cm.push. 2. Reference of frame objests by frame pointer.
-
Ruiling Song authored
-
Vitaly Buka authored
-
Owen Pan authored
Fixes #67116.
-
Vitaly Buka authored
It's the same for char, but it's more appropriate here.
-
Vitaly Buka authored
arch64 triggers -Wframe-larger-than=530.
-
Zhangyin authored
Reviewed By: #libc, philnik Differential Revision: https://reviews.llvm.org/D159514
-
XChy authored
This patch extends function TryToSimplifyUncondBranchFromEmptyBlock to handle the similar cases below. ```llvm define i8 @src(i8 noundef %arg) { start: switch i8 %arg, label %unreachable [ i8 0, label %case012 i8 1, label %case1 i8 2, label %case2 i8 3, label %end ] unreachable: unreachable case1: br label %case012 case2: br label %case012 case012: %phi1 = phi i8 [ 3, %case2 ], [ 2, %case1 ], [ 1, %start ] br label %end end: %phi2 = phi i8 [ %phi1, %case012 ], [ 4, %start ] ret i8 %phi2 } ``` The phis here should be merged into one phi, so that we can better optimize it: ```llvm define i8 @tgt(i8 noundef %arg) { start: switch i8 %arg, label %unreachable [ i8 0, label %end i8 1, label %case1 i8 2, label %case2 i8 3, label %case3 ] unreachable: unreachable case1: br label %end case2: br label %end case3: br label %end end: %phi = phi i8 [ 4, %case3 ], [ 3, %case2 ], [ 2, %case1 ], [ 1, %start ] ret i8 %phi } ``` Proof: [normal](https://alive2.llvm.org/ce/z/vAWi88) [multiple stages](https://alive2.llvm.org/ce/z/DDBQqp) [multiple stages 2](https://alive2.llvm.org/ce/z/nGkeqN) [multiple phi combinations](https://alive2.llvm.org/ce/z/VQeEdp) And lookup table optimization should convert it into add %arg 1. This patch just match similar CFG structure and merge the phis in different cases. Maybe such transform can be applied to other situations besides switch, but I'm not sure whether it's better than not merging. Therefore, I only try it in switch, Related issue: #63876 [Migrated](https://reviews.llvm.org/D155940) -
Vitaly Buka authored
Details in https://reviews.llvm.org/D156238 This reverts commit d2abe8dc.
-
Takuya Shimizu authored
This change introduces `-Wformat-overflow` and `-Wformat-truncation` warning flags that were formerly diagnosed from `-Wfortify-source` warning group. This also introduces `-Wformat-overflow-non-kprintf` and `-Wformat-truncation-non-kprintf`, both of which will be used when the format string contains `%p` format string. The rationale for this is that Linux kernel has its own extension for `%p` format specifier, and we need some way to suppress false positives in kernel codebase. The approach of this patch aims NOT to affect non-kernel codebases. Note that GCC stops format size estimation upon `%p` format specifier. As requested in https://github.com/llvm/llvm-project/issues/64871
-
Owen Pan authored
-
Fangrui Song authored
The hook introduced by https://reviews.llvm.org/D22815 for AMDGPU was removed by commit ce2258c1 in 2020.
-
Owen Pan authored
-
Shraiysh authored
This patch adds basic support for `omp teams` to the OpenMPIRBuilder. The outlined function after code extraction is called from a wrapper function with appropriate arguments. This wrapper function is passed to the runtime calls. This approach is different from the Clang approach - clang directly emits the runtime call to the outlined function. The outlining utility (OutlineInfo) simply outlines the code and generates a function call to the outlined function. After the function has been generated by the outlining utility, there is no easy way to alter the function arguments without meddling with the outlining itself. Hence the wrapper function approach is taken.
-
Florian Hahn authored
Update the logic to update the successors and predecessors of region blocks directly. This adds special handling for header and latch blocks in place, and removes the separate loop to fix up the region blocks. Helps to simplify D158333. Reviewed By: Ayal Differential Revision: https://reviews.llvm.org/D159136
-
Yingwei Zheng authored
-
Brad Smith authored
-
Yingwei Zheng authored
This patch further improves the simplification of pattern `icmp eq/ne min|max(X, Y), Z` as discussed in [D156238](https://reviews.llvm.org/D156238). When `X < Z`: `min(X, Y) == Z -> false` `min(X, Y) != Z -> true` `max(X, Y) == Z -> Y == Z` `max(Y, Z) != Z -> Y != Z` When `X > Z`: `max(X, Y) == Z -> false` `max(X, Y) != Z -> true` `min(X, Y) == Z -> Y == Z` `min(Y, Z) != Z -> Y != Z` Alive2: https://alive2.llvm.org/ce/z/evkmaq
-
Fangrui Song authored
And revert commit 1f3fa96e.
-
Richard Smith authored
corresponds to a parameter pack. Fixes #67244.
-
Yingwei Zheng authored
-
Yingwei Zheng authored
-
Yingwei Zheng authored
Alive2: https://alive2.llvm.org/ce/z/wZ41t7
-
- Sep 24, 2023
-
-
Yingwei Zheng authored
-