Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [llvm]

LLVM is a compiler infrastructure written in C++ that is designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages.

1
vote
1answer
121 views

Is it feasible to write an IR-to-assembly compiler as opposed to an LLVM backend?

I've made a virtual processor with a simple instruction set and memory model as a learning exercise (and mostly just for fun). I can write programs in its assembly language, assemble them with my ...
14
votes
1answer
1k views

Why does LLVM have an assembly-like IR rather than a tree-like IR? Or: why do projects target LLVM IR instead of clang's AST?

Why is LLVM's intermediate representation assembly-like rather than tree-like? Alternatively, why do language implementations target LLVM IR rather than clang's AST? I'm not trying to ask two ...
0
votes
2answers
207 views

How does the LLVM compiler treat arithmetic operations in parentheses?

When it sees the parentheses, does it have the machine do the operations in the parentheses first, or does it distribute out the parentheses? Like, if I have the following line of code: int i = 2 * (...
10
votes
1answer
242 views

Machine code JITs and the Execution Disable bit

How is runtime-generated machine-code (such as the output of a JIT), actually executed by the CPU if the CPU/OS has an Execution Disable bit? As far as I know, many modern processors and Operating ...
4
votes
1answer
2k views

How do I add link-time optimization capabilities to my LLVM-based compiler?

I am designing and implementing a programming language, and I am using LLVM for native code generation. Among others, performance is a key feature of the language, and as such, I am looking to ...
1
vote
1answer
289 views

LLVM case: is the success due to the algorithms? [closed]

I'm not sure if this is a subjective question, I hope not but I'm not proficient with LLVM so I'm just wondering: how come it's become so popular and so widespread used in the industry? Were the ...
3
votes
2answers
3k views

Learning YACC nowadays, does it make sense? [closed]

I have a huge project that is using YACC and I would need to fix a bug in it. I might ask someone else who wrote that to fix it but I'm interested in how compilers work. Does it make sense to learn ...
21
votes
3answers
33k views

How to run C++ code in browser using asm.js?

An asm.js application is very fast (near native C++ speed): http://kripken.github.io/mloc_emscripten_talk/micro4b.png But how is it possible to write one in C++, convert it to LLVM code, then do ...
20
votes
4answers
3k views

GCC vs clang/LLVM — pros and cons of each [closed]

What are the pros and cons of GCC vs clang/LLVM?
12
votes
4answers
2k views

In what way(s) is LLVM Low Level?

In what way(s) is LLVM (Low Level Virtual Machine) Low Level? (At the time of writing, I did not find this expansion of the abbreviation "LLVM" on its web site, but on Wikipedia.) Is it called "Low ...
6
votes
3answers
3k views

Reason to use mingw win32 headers and libs with LLVM/Clang

Is there any good reason (except "GCC is better") to use the MinGW win32api/headers/libs with LLVM/Clang. Suppose that in two to three years, Clang has matured enough (in C++0x and performance) that ...
10
votes
3answers
2k views

Is Clang/LLVM ready for prime time? [closed]

Clang is able to be used instead of gcc? What your experience on that? What disadvantages there are yet? Performance of compilation is very better than gcc but about performance of code generated ...