lli

how to perform TargetLowering in a IR-trasformation pass?

橙三吉。 提交于 2019-12-24 01:54:42
问题 To provide TLS support to orcjit, I'm like to transforom llvm::Modules without TLS emulation to ones that emulateTLS and depend on a Runtime. Similar functionality is already implemented in TargetLowering::LowerToTLSEmulatedModel , however it does not operate on IR. So, how can i implement and perform this operation as an llvm::Pass ? 来源: https://stackoverflow.com/questions/42163796/how-to-perform-targetlowering-in-a-ir-trasformation-pass

LLVM produced by rustc gives error about argument type of main when run with lli

二次信任 提交于 2019-12-23 10:19:57
问题 I'm trying to learn a little about the LLVM IR, particularly what exactly rustc outputs. I'm having a little bit of trouble running even a very simple case. I put the following in a source file simple.rs : fn main() { let x = 7u32; let y = x + 2; } and run rustc --emit llvm-ir simple.rs to get the file simple.ll , containing ; ModuleID = 'simple.cgu-0.rs' source_filename = "simple.cgu-0.rs" target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu"

How to run LLVM interpreter with a shared library?

爱⌒轻易说出口 提交于 2019-12-13 14:34:23
问题 I have mylib.c file which has some functions. I want to use those functions from my .c file as external ones in compiled llvm code. I'm playing with LLVM interpreter ( lli-4.0 ) and I wonder how can I tell lli to use functions from my .c file? 回答1: lli has a -load argument so you compile your C file to a dynamic library and then just do lli -load path-to-your-dynamic-library .... 来源: https://stackoverflow.com/questions/44189232/how-to-run-llvm-interpreter-with-a-shared-library

Compiled Haskell program to LLVM IR is missing main

别说谁变了你拦得住时间么 提交于 2019-12-02 07:13:15
问题 following this SO post regarding the compilation of Haskell programs to LLVM IR, I took the same Haskell program and tried to run its resulting LLVM IR code: quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) xs main = print(quicksort([5,2,1,0,8,3])) I first compiled it to LLVM IR with $ ghc -keep-llvm-files main.hs Then I transformed it to bitcode with: $ llvm-as main.ll However, when I tried to run it

Compiled Haskell program to LLVM IR is missing main

一世执手 提交于 2019-12-02 06:26:00
following this SO post regarding the compilation of Haskell programs to LLVM IR, I took the same Haskell program and tried to run its resulting LLVM IR code: quicksort [] = [] quicksort (p:xs) = (quicksort lesser) ++ [p] ++ (quicksort greater) where lesser = filter (< p) xs greater = filter (>= p) xs main = print(quicksort([5,2,1,0,8,3])) I first compiled it to LLVM IR with $ ghc -keep-llvm-files main.hs Then I transformed it to bitcode with: $ llvm-as main.ll However, when I tried to run it with lli I get the following error regarding a missing main: $ lli main.bc 'main' function not found in