Think In Geek

In geek we trust

A very simple memory pool in C++11

I’ve been implementing an algorithm that works on a graph. That algorithm needs to create and destroy lots of nodes and edges to keep track of the algorithm state correctly. The algorithm also needs to be fast in order to be competitive against a similar algorithm that uses sets of stacks instead of graphs. Profiles show that memory allocations are impacting negatively the performance, so maybe a memory pool can help.

Continue reading “A very simple memory pool in C++11” »

Exploring AArch64 assembler – Chapter 9

In chapter 6 we saw conditional branches and we ended commenting that they can be used to implement higher control constructs. In this chapter we will see a few of them.
Continue reading “Exploring AArch64 assembler – Chapter 9” »

Walk-through flang – Part 5

In the previous installment of this series we saw how flang parses the statements using an LR(1) algorithm. As the parser recognized the parts of the statements it invokes semantic actions. Today we’re going to talk more about them.

Continue reading “Walk-through flang – Part 5” »

Walk-through flang – Part 4

In the last installment we saw how flang splits the input in tokens. Once we have the tokens identified we need to parse them.
Continue reading “Walk-through flang – Part 4” »

Walk-through flang – Part 3

In the last chapter we saw how the driver handles the compilation and how it invokes flang1 and flang2. In this chapter we are going to start with flang1.
Continue reading “Walk-through flang – Part 3” »

Walk-through flang – Part 2

In the previous installment of this series we saw basically how to install flang and we ran a simple smoke test. In this post we will see a high level overview of what happens when we compile a Fortran program using flang. We will also compare it with what usually happens with clang.

Continue reading “Walk-through flang – Part 2” »

Walk-through flang – Part 1

Flang is an open source project to create a Fortran compiler for LLVM. It is based on NVIDIA/PGI Fortran and it has been released under Apache License 2.0. In this series we will do a walk-through the code of this compiler and how it has been integrated in the existing LLVM infrastructure.

Continue reading “Walk-through flang – Part 1” »

10 years of Think In Geek

10 years ago Bernat (brafales) started this blog. This is still his blog though he is a bit busy these days and he cannot publish as much as he wants.

All in all, without his initiative this blog would not exist. As would not exist many of the posts I published here since 2012, when Bernat insisted that I should collaborate. I guess his persistence has somehow paid off 🙂

Consider this post a very small celebration of those 10 years. Hopefully we will be able to celebrate many more years.

Compilers as a memory error detectors

This is a small anecdote of something that happened me the other day.
Continue reading “Compilers as a memory error detectors” »

Exploring AArch64 assembler – Chapter 8

In the last chapter we saw how to call a function. We mentioned a special memory called the stack but we did not delve into it. Let’s see in this chapter how we can use the stack and why it is important in function calls.

Continue reading “Exploring AArch64 assembler – Chapter 8” »

Previous Posts