Open gingerBill opened 1 year ago
For the questions, currently tb_inst_set_region_name
does not require unique names but it will bite you once i make the flattened IR form if you reuse the same name.
If you wanna know the previous "instructions" to a region, you can check the inputs list and it'll tell you all the predecessors, you can do tb_get_parent_region(region->inputs[i])
if you want the top of that predecessor, but the actual inputs[i]
is almost always a projection (TB_PROJ
) stemming from a branch, you can reach the branch with another ->inputs[0]
.
There we go, linearized IR printing. It uses the TB_FuncOpt
which is usually is preserved for optimizations but i might rename it because it's really just for analysis/transformations and flattening the IR is a form of analysis.
Feature Request:
@gingerBill @RealNeGate I have a crazy off-topic idea/question for you guys. Odin is "done". So why not write a C compiler(or at least compiler backend) in Odin?
I imagine Odin will provide great productivity gains and correctness as well.
(I am currently playing with Odin and I love it, and I heard that GB wants to replace LLVM with Tilde)
I will add to this as I go along when I see things which may be missing.
API
const char*
also take a length where possibleptrdiff_t
is -1, it's NUL terminatedf16
typeu16
internally or whateverTB_Node*
(useful in some instructions that require an explicit alignment)Instructions
alloca
equivalenttb_inst_ptr
is missingtb_inst_sint
/tb_inst_uint
for types >64 bits (e.g. 128-bits)tb_inst_memmove
TB_
(SHL
|SHR
|SAR
) with slightly different to C semanticsx<<2
==(x<<1)<<1
TB_BSWAP
work with floatsTB_MULPAIR
TB_ArithmeticBehavior
maybe?wasm.memory.grow
wasm.memory.size
wasm.memory.atomic.wait32
wasm.memory.atomic.notify
tb_inst_memzero
helper?"Intrinsics"
cpu_relax
pause
on amd64isb
on arm64x86_cpuid
x86_xgetbv
IR Debugging
Debug Information
Questions
tb_inst_set_region_name
require that the name passed is in unique to that function or does Tilde handle this?