« first day (206 days earlier)      last day (751 days later) » 

00:01
halp how to declare variable length array in llvm
well yeah
but do i do a mul to get the length
that doesn't seem right
I could do array of pointers
but that is not always best solutoni
@Downgoat llvm has no better solution
can't be right
I checked clangs output and it doesn't do that
well actually i have idea
@Downgoat pls show clang's output?
clang probably calls C malloc instead
no
it uses zest
malloc is too heavy dependency
also complicated memory mangement
ok I have this so far:
; VSL LLVM IR. v1.0
source_filename = "#filename"

; @0 = c-string
; @1 = lengt
%String = type { i8*, i8 }

define i32 @main(i32, i8**) {
entry:
    %i1 = alloca i32, align 4
    jp at1
r1:


at1:
    %iv = load i32, i32* %i1, align 4
    %i2 = add nsw i32 %iv, i32 1
    %i3 = store i32 %i2, i32* %i1, align 4
    %i4 = icmp slt i32 %i3, i32 %0
    br i1 %i4, %label r1

    call void @entry(%.args)
    ret 0
}

define void @entry(%String*) {
entry:
    ; #source
    ret void
}
%String is obviously temporary
oh wait this is simple
I can just zest it
shit have to handle 64-bit v 32-bit
halp how to do
00:51
@Downgoat two different llvm generators
nah
we can just have mem_t
or equivilient
for 32-bit will be mem_t = i32
but actually
we might have to do some more zesting
llvm should of not named functions sext and zest
0/10 bad idea
what is zest
expand int type, left-filling 0s, signed w/ 0,1 overflow
actually looks as simple as:
  %42 = getelementptr inbounds %struct.String, %struct.String* %4, i64 %41, i32 1
  store i32 0, i32* %42, align 8, !tbaa !1
  %43 = add nsw i64 %29, 7
:O VSL is already faster than C
:O @PhiNotPi has his own LLVM instruction
@Downgoat O.o where
pls halp understand because gaot does not understand wat instruction does tho ;_;
01:01
In compiler design, static single assignment form (often abbreviated as SSA form or simply SSA) is a property of an intermediate representation (IR), which requires that each variable is assigned exactly once, and every variable is defined before it is used. Existing variables in the original IR are split into versions, new variables typically indicated by the original name with a subscript in textbooks, so that every definition gets its own version. In SSA form, use-def chains are explicit and each contains a single element. SSA was developed by Ron Cytron, Jeanne Ferrante, Barry K. Rosen, Mark...
switch-case value based on last executed block (in that case Loop or LoopHeader)
wat
wat is swich case value
ok so basically
%indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ] means:
if %last_executed_block == %LoopHeader:
    %indvar = 0
else if %last_executed_block == %Loop:
    %indvar = %nextindvar
wat wow 10/10 vrey helpful
@Downgoat ?
halp how to sizeof in LLVM
01:08
13
Q: How can I find the size of a type?

OakI'm holding a Type* in my hand. How do I find out its size (the size objects of this type will occupy in memory) in bits / bytes? I see all kinds of methods allowing me to get "primitive" or "scalar" size, but that won't help me with aggregate types...

sorry, sizeof pointer
well i'm pretty sure c hardcodes sizeof values, idk
not possible
I am trying to get length of argc
@Downgoat then ^^^^^
type != pointer
01:14
@Downgoat ok then idk
that should still work for pointer though i think
can't make 0 sense
@Downgoat ???
they are doing int size = (int) *pointer
pls halp solve problem major bottleneck
here is progress:
; VSL LLVM IR. v1.0
source_filename = "#filename"

; @0 char* = c-string
; @1 int   = length
@class.String = type { i8*, i32 }

define i32 @main(i32, i8**) {
entry:
    %.args = alloca @class.String, i32 %0, align 16
    %i1 = alloca i32, align 4
    jp at1
r1:
    %i5 = load i32, i32* %i1, align 4
    ;String*[i32: index, %i5][i32 1: length]
    %i6 = getelementptr inbounds @class.String, @class.String* %.args, i64 %i5, i32 1
    %i7 = <somehow calculate sizeof the char>
    store i32 %i7, i32 %i6, align 8
 
22 hours later…
23:53
@ASCII-only hello

« first day (206 days earlier)      last day (751 days later) »