LLVM vs Pure ASM

Programming, for all ages and all languages.
Post Reply
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

LLVM vs Pure ASM

Post by monobogdan »

Yes, it's really stupid question, but, what better is LLVM or Pure ASM generation?

LLVM is easy but generates garbage

Pure is only for single architecture, but no garbage or anything.
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: LLVM vs Pure ASM

Post by monobogdan »

P.S it's theme for selecting code generation tehnique for my compiler, not only opinion based.
User avatar
Roman
Member
Member
Posts: 568
Joined: Thu Mar 27, 2014 3:57 am
Location: Moscow, Russia
Contact:

Re: LLVM vs Pure ASM

Post by Roman »

If you think that you're smarter and have more man-years than all the people behind LLVM then pure assembly is better.
LLVM is easy but generates garbage
This is false.
Last edited by Roman on Mon Jan 30, 2017 2:19 am, edited 1 time in total.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
glauxosdever
Member
Member
Posts: 501
Joined: Wed Jun 17, 2015 9:40 am
Libera.chat IRC: glauxosdever
Location: Athens, Greece

Re: LLVM vs Pure ASM

Post by glauxosdever »

Hi,


My final compiler will generate some kind of pre-optimised AST, instead of machine-code object files. Then the AST files will be linked together into another AST file, which will be copied to the standard library directory, or converted into machine code executables on the end-user's machine.

However, for the initial compiler I'll (most likely) use LLVM's backend to speed up on development time. This way, in order to have good optimisations between different objects, LLVM's IR is probably the only sane option.

What I'm saying is that LLVM's IR isn't exactly ideal, but it's probably the best of what we have now.


Regards,
glauxosdever
Last edited by glauxosdever on Mon Jan 30, 2017 2:19 am, edited 1 time in total.
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: LLVM vs Pure ASM

Post by monobogdan »

glauxosdever wrote:Hi,


My final compiler will generate some kind of pre-optimised AST, instead of machine-code object files. Then the AST files will be linked together into another AST file, which will be copied to the standard library directory, or converted into machine code executables on the end-user's machine.

However, for the initial compiler I'll (most likely) use LLVM's backend to speed up on development time. This way, in order to have good optimisations between different objects, LLVM's IR is probably the only sane option.

What I'm saying is that LLVM's IR isn't exactly the best solution, but it's probably the best of what we have now.


Regards,
glauxosdever
LLVM can't compile bootsector, it's too large.
User avatar
dchapiesky
Member
Member
Posts: 204
Joined: Sun Dec 25, 2016 1:54 am
Libera.chat IRC: dchapiesky

Re: LLVM vs Pure ASM

Post by dchapiesky »

monobogdan wrote: LLVM can't compile bootsector, it's too large.
This is false.

llvm.org - read the docs
Plagiarize. Plagiarize. Let not one line escape thine eyes...
User avatar
dchapiesky
Member
Member
Posts: 204
Joined: Sun Dec 25, 2016 1:54 am
Libera.chat IRC: dchapiesky

Re: LLVM vs Pure ASM

Post by dchapiesky »

glauxosdever wrote:Hi,


My final compiler will generate some kind of pre-optimised AST, instead of machine-code object files. Then the AST files will be linked together into another AST file, which will be copied to the standard library directory, or converted into machine code executables on the end-user's machine.

However, for the initial compiler I'll (most likely) use LLVM's backend to speed up on development time. This way, in order to have good optimisations between different objects, LLVM's IR is probably the only sane option.

What I'm saying is that LLVM's IR isn't exactly ideal, but it's probably the best of what we have now.


Regards,
glauxosdever
In the context of your example - llvm shines since you can write custom "passes" which allow you to modify the AST... so as you try different optimizations you can snapshot the AST, compare the AST, etc... google has some really nice llvm AST manipulation tools
Plagiarize. Plagiarize. Let not one line escape thine eyes...
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: LLVM vs Pure ASM

Post by dozniak »

monobogdan wrote: LLVM can't compile bootsector, it's too large.
Your misconceptions drive your desire to develop bicycles and invent wheels instead of learning something useful from already made projects. You may start getting smarter and read, or keep writing.
Learn to read.
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: LLVM vs Pure ASM

Post by monobogdan »

dchapiesky wrote:
glauxosdever wrote:Hi,


My final compiler will generate some kind of pre-optimised AST, instead of machine-code object files. Then the AST files will be linked together into another AST file, which will be copied to the standard library directory, or converted into machine code executables on the end-user's machine.

However, for the initial compiler I'll (most likely) use LLVM's backend to speed up on development time. This way, in order to have good optimisations between different objects, LLVM's IR is probably the only sane option.

What I'm saying is that LLVM's IR isn't exactly ideal, but it's probably the best of what we have now.


Regards,
glauxosdever
In the context of your example - llvm shines since you can write custom "passes" which allow you to modify the AST... so as you try different optimizations you can snapshot the AST, compare the AST, etc... google has some really nice llvm AST manipulation tools
may be my acknowledge about llvm is too small.

So, i'm try to port tcc to OGDOS.

It's seems to be interestring.
Boris
Member
Member
Posts: 145
Joined: Sat Nov 07, 2015 3:12 pm

Re: LLVM vs Pure ASM

Post by Boris »

Garbage comes when you feed something with wrong input. Did you tell llvm to generate 16 bit code ?

I think if you don't know what you do , llvm will help you reducing your code size
User avatar
dchapiesky
Member
Member
Posts: 204
Joined: Sun Dec 25, 2016 1:54 am
Libera.chat IRC: dchapiesky

Re: LLVM vs Pure ASM

Post by dchapiesky »

monobogdan wrote:So, i'm try to port tcc to OGDOS.
tcc is good --- though there is a version for 64bit if you look for it...

tcc shouldn't need much of a port at all

post if you need help

cheers
Plagiarize. Plagiarize. Let not one line escape thine eyes...
monobogdan
Member
Member
Posts: 71
Joined: Wed Jan 25, 2017 3:37 pm

Re: LLVM vs Pure ASM

Post by monobogdan »

dchapiesky wrote:
monobogdan wrote:So, i'm try to port tcc to OGDOS.
tcc is good --- though there is a version for 64bit if you look for it...

tcc shouldn't need much of a port at all

post if you need help

cheers
Hm. May be make freedos kernel only... first stage kernel? Like in windows.

ntoskrnl is like to first stage kernel(and main kernel), kernel32.dll is api to kernel(and may be kernel stage two because it's 32 bit).

So, example boot scheme:

FreeDOS bootloader->FreeDOS kernel->32 bit bootloader->32 bit kernel->GUI
Post Reply