Skip to main content

Questions tagged [llvm]

For questions relating to LLVM, or the collection of 'reusable compiler and toolchain technologies'.

10 votes
2 answers
691 views

Idiomatic memory allocation and garbage collection in LLVM

I am working on a new backend for a programming language using LLVM IR. This language makes a distinction between basic values and pointers to nodes on the heap, and uses a copying collector for ...
user65560's user avatar
  • 200
3 votes
0 answers
144 views

Is there a guide for implementing exceptions in languages with explicit memory management?

I'm looking for a guide for implementing exceptions in a language with explicit memory management like C++. However, the language's type system and exception handling semantics are incompatible with C+...
feldentm's user avatar
  • 2,418
5 votes
1 answer
388 views

Determining the most optimized data type for the platform with type inference

For my programming language, I have built an engine that goes after the parser and before the compiler. This engine analyzes, validates, and simplifies the AST. During the analasys, it determines as ...
Hg0428's user avatar
  • 183
7 votes
1 answer
927 views

What, if any, runtime cost is incurred by using 64-bit ints on 32-bit platforms in LLVM?

I'm writing a language frontend for LLVM, and I noticed that the IR docs say that integers of (almost) any width can be used without limit. I presume this to mean that LLVM or its backends convert ...
Ginger's user avatar
  • 2,707
5 votes
0 answers
325 views

Why has there been little recent work on GPU compiler phase optimization?

While GPU compiler phase optimization has been shown to improve performance significantly (e.g. https://link.springer.com/chapter/10.1007/978-3-319-75178-8_35), there has been very little follow-up ...
Amrit Baveja's user avatar
23 votes
8 answers
5k views

What are the pitfalls of using an existing IR/compiler infrastructure like LLVM?

Using something like LLVM when designing a compiler has a lot of advantages, since tons of work can be saved by using an existing optimizer and code generation for a variety of platforms. Even large, ...
rydwolf's user avatar
  • 4,870
5 votes
1 answer
274 views

How do I explain to ClangFormat that `:=` is an assignment operator in my programming language, rather than label+assignment?

ClangFormat does a relatively good job formatting code written in my programming language. However, one quirky problem is that it inserts whitespace (sometimes even new-line characters) between ...
FlatAssembler's user avatar
6 votes
1 answer
538 views

How do I make LLVM actually inline anything?

I've been working on a draft of a Trilangle compiler using LLVM. Out of curiosity, I took the generated IR (given the Trilangle program ?!oi@) and plugged it into ...
Bbrk24's user avatar
  • 9,672