[llvmlinux] Supporting LLVM IR output during build process

Jan-Simon Moeller dl9pf at gmx.de
Fri Dec 5 09:26:03 UTC 2014


Am Donnerstag, 4. Dezember 2014, 22:17:17 schrieb Jason Gionta:
> Thanks for the clarification. I really appreciate it. Do you think getting
> the IR->vmlinux working could be done in a few days? I am just trying to
> understand the effort required to get this working. I basically have a
> weekend to complete if it's possible.

I can't tell for sure.  Right now we just get a bunch of .bc files out of it 
(not differing loadable modules from built-ins). 
Maybe start w/o loadable modules (to keep things easy) and just collect all 
.bc files and feed it into mcode-generation.  Not sure about the start/boot 
code.


> 
> Again, thanks for the all help.
> 
> -Jason
> 
> On Thu, Dec 4, 2014 at 5:36 PM, Jan-Simon Moeller <dl9pf at gmx.de> wrote:
> > Am Donnerstag, 4. Dezember 2014, 17:34:02 schrieb Jason Gionta:
> > > Hi Jan-Simon,
> > > 
> > > I appreciate the quick reply. I am not currently using the build system
> > 
> > so
> > 
> > > I appreciate the insight.
> > > 
> > > So I believe from what you wrote LLVMLinux can emit the IR but does not
> > 
> > use
> > 
> > > it for final compilation. Is there LLVM IR->bzImage support?
> > 
> > No, we did not go that far. Back then the student just wanted the IR of
> > the
> > single kernel .o files .
> > I'm not sure we can do IR->bzImage atm.
> > IR->vmlinux maybe, but bzImage has some realmode code with might not go
> > through IR to target properly right now.
> > 
> > > Thanks again,
> > > 
> > > Jason
> > > 
> > > On Thu, Dec 4, 2014 at 3:50 PM, Jan-Simon Moeller <dl9pf at gmx.de> wrote:
> > > > Hi Jason,
> > > > 
> > > > Am Donnerstag, 4. Dezember 2014, 15:10:13 schrieb Jason Gionta:
> > > > > Hello all,
> > > > > 
> > > > > I was wondering if someone has looked at or has experience
> > > > > outputting
> > > > 
> > > > LLVM
> > > > 
> > > > > IR of LLVMLinux before linking. I hope to better understand the
> > > > 
> > > > feasibility
> > > > 
> > > > > of deploying IR to perform LTO per machine before final linkage.
> > > > > Does
> > > > > anyone have ideas on how much effort would it take to enable in the
> > > > 
> > > > current
> > > > 
> > > > > LLVMLinux build process (basically the linux build system)?
> > > > > 
> > > > > Thanks,
> > > > 
> > > > This works already with the LLVMLinux build system.  Actually we
> > 
> > compile
> > 
> > > > every
> > > > file twice. One normal compilation and a run for IR .
> > > > 
> > > > cd targets/<yourtarget - eg x86> ; make BITCODE=1
> > > > 
> > > > from make help
> > > > * make BITCODE=1          - Output llvm bitcode to *.bc files
> > > > 
> > > > Best,
> > > > Jan-Simon



More information about the LLVMLinux mailing list