This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "unmatched_xdsl": [ | |
| "llvm.call_intrinsic", | |
| "llvm.mlir.addressof", | |
| "llvm.mlir.constant", | |
| "llvm.mlir.global", | |
| "llvm.mlir.null", | |
| "llvm.mlir.undef", | |
| "llvm.mlir.zero" | |
| ], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "llvm.add": "add", | |
| "llvm.fadd": "fadd", | |
| "llvm.sub": "sub", | |
| "llvm.fsub": "fsub", | |
| "llvm.mul": "mul", | |
| "llvm.fmul": "fmul", | |
| "llvm.udiv": "udiv", | |
| "llvm.sdiv": "sdiv", | |
| "llvm.fdiv": "fdiv", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| set -o pipefail | |
| # llvmlite | |
| uv run python tests/backend/llvm/generate_types_ir.py --mlir > source.mlir | |
| uv run python tests/backend/llvm/generate_types_ir.py --llvm > generated.ll | |
| # mlir-translate | |
| cat source.mlir | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| I think it might make sense to `@cache`. | |
| retrieval benchmark results: | |
| - mixed types: 1.57x speedup | |
| - repeated types: 2.31x speedup | |
| - unique types: 0.68x speedup | |
| - avg speed: 1.52x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "xdsl.dialects.builtin": { | |
| "IntegerType": "ir.IntType", | |
| "IndexType": "ir.IntType(64)", | |
| "Float16Type": "ir.HalfType", | |
| "Float32Type": "ir.FloatType", | |
| "Float64Type": "ir.DoubleType", | |
| "BFloat16Type": null, | |
| "Float80Type": null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from xdsl.dialects import scf, arith, func | |
| from xdsl.ir import Block, Region | |
| from xdsl.context import Context | |
| from xdsl.pattern_rewriter import PatternRewriteWalker, PatternRewriter, GreedyRewritePatternApplier | |
| from xdsl.transforms.canonicalization_patterns.scf import IfPropagateConstantCondition | |
| from xdsl.printer import Printer | |
| ctx = Context() | |
| ctx.load_dialect(scf.Scf) | |
| ctx.load_dialect(arith.Arith) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from xdsl.context import Context | |
| from xdsl.dialects import scf, arith, func, builtin | |
| from xdsl.dialects.builtin import ModuleOp | |
| from xdsl.ir import Block, Region | |
| from xdsl.transforms.canonicalization_patterns.scf import IfPropagateConstantCondition | |
| from xdsl.pattern_rewriter import PatternRewriteWalker | |
| ctx = Context() | |
| ctx.load_dialect(scf.Scf) | |
| ctx.load_dialect(arith.Arith) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /// script | |
| # requires-python = ">=3.11" | |
| # dependencies = [ | |
| # "llvmlite==0.46.0", | |
| # ] | |
| # /// | |
| import llvmlite.binding as llvm | |
| import llvmlite.ir as ir |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ---------- new branch | |
| git switch -c <name> | |
| git push origin <name> | |
| git branch -r | |
| # reset to upstream | |
| git remote add upstream https://github.com/xdslproject/xdsl/ | |
| git config pull.rebase false | |
| git pull upstream main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from xdsl.builder import Builder, InsertPoint | |
| from xdsl.context import Context | |
| from xdsl.dialects import riscv | |
| from xdsl.dialects.builtin import ModuleOp | |
| from xdsl.transforms.canonicalize import CanonicalizePass | |
| from xdsl.printer import Printer | |
| ctx = Context() | |
| ctx.load_dialect(riscv.RISCV) |
NewerOlder