Open ent0n29 opened 7 months ago
I was discussing this yesterday with @jonmasters. Ideally this would be a script that takes llm.c and transforms it into specialized but still legible C code for a particular architecture. It could do buffer size tuning etc like Mojoš„
It would also be nice to have a memory/cache layout visualizer.
@blasty has some great human friendly inline assembler examples https://github.com/blasty/unwyze/blob/638e7d17e752a30a3e758f51e436f752954afbd4/exploit/src/main.c#L180
looking into it!
Here is a little example:
multiplications where one operand is a power of 2 and a constant integer, are optimized with a shift operation and the shift amount is calculated using the logBase2 of the constant.
and we need to add a call to the opt in a
runOnBasicBlock
function:to apply the passes we need to convert
train_gpt2
to a LLVM-IR using the clang compiler: