| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[mlir][emitc] Fix ineffective tests (#168197) These tests were only checking the specialized prefix, leaving common code unchecked (and incorrect). Checked code was also not using patterns for SSA values. | 9 个月前 | |
[mlir][EmitC]Expand the MemRefToEmitC pass - Lowering AllocOp (#148257) This aims to lower memref.alloc to emitc.call_opaque “malloc” or emitc.call_opaque “aligned_alloc” From: module{ func.func @allocating() { %alloc_5 = memref.alloc() : memref<999xi32> return } } To: module { emitc.include <"stdlib.h"> func.func @allocating() { %0 = emitc.call_opaque "sizeof"() {args = [i32]} : () -> !emitc.size_t %1 = "emitc.constant"() <{value = 999 : index}> : () -> index %2 = emitc.mul %0, %1 : (!emitc.size_t, index) -> !emitc.size_t %3 = emitc.call_opaque "malloc"(%2) : (!emitc.size_t) -> !emitc.ptr<!emitc.opaque<"void">> %4 = emitc.cast %3 : !emitc.ptr<!emitc.opaque<"void">> to !emitc.ptr<i32> return } } Which is then translated as: #include <stdlib.h> void allocating() { size_t v1 = sizeof(int32_t); size_t v2 = 999; size_t v3 = v1 * v2; void* v4 = malloc(v3); int32_t* v5 = (int32_t*) v4; return; } | 1 年前 | |
[mlir][emitc] Fix ineffective tests (#168197) These tests were only checking the specialized prefix, leaving common code unchecked (and incorrect). Checked code was also not using patterns for SSA values. | 9 个月前 | |
[mlir][EmitC] Expand the MemRefToEmitC pass - Lowering CopyOp (#151206) This patch lowers memref.copy to emitc.call_opaque "memcpy". From: func.func @copying(%arg0 : memref<9x4x5x7xf32>, %arg1 : memref<9x4x5x7xf32>) { memref.copy %arg0, %arg1 : memref<9x4x5x7xf32> to memref<9x4x5x7xf32> return } To: cpp #include <cstring> void copying(float v1[9][4][5][7], float v2[9][4][5][7]) { size_t v3 = 0; float* v4 = &v2[v3][v3][v3][v3]; float* v5 = &v1[v3][v3][v3][v3]; size_t v6 = sizeof(float); size_t v7 = 1260; size_t v8 = v6 * v7; memcpy(v5, v4, v8); return; } | 1 年前 | |
[mlir][EmitC]Expand the MemRefToEmitC pass - Adding scalars (#148055) This aims to expand the the MemRefToEmitC pass so that it can accept global scalars. From: memref.global "private" constant @__constant_xi32 : memref<i32> = dense<-1> func.func @globals() { memref.get_global @__constant_xi32 : memref<i32> } To: emitc.global static const @__constant_xi32 : i32 = -1 emitc.func @globals() { %0 = get_global @__constant_xi32 : !emitc.lvalue<i32> %1 = apply "&"(%0) : (!emitc.lvalue<i32>) -> !emitc.ptr<i32> return } | 1 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 9 个月前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 |