conditional execution experiment (part 1) - shylie - feb 2025 - <-

a short introduction

Lately, I’ve been thinking about a processor feature called conditional execution. Basically, it’s a flag contained in the instruction that will prevent the instruction from running past the decode stage if the condition described by the flag is false.

Though it most likely has an effect on performance, I am more interested in the effects of conditional execution on code density. To put it in simple terms, code density is the amount of “stuff done” per unit of code (in this case, binary size).

the idea

With that background out of the way, I can get to the overall idea. I intend to create two simple load-store instruction set architectures, one with conditional execution, and one without. Then, I will use the LLVM compiler infrastructure to create a backend for these architectures. I will also need to write optimization passes for the architecture with conditional execution that convert branches into conditional execution.

prerequisites

Honestly, I’ve got no idea how to write an LLVM backend. Before I begin running this experiment, I will most definitely need to learn how to do so.

Additionally, I need to better understand how to design an experiment. I’ve not done something like this before, so I want to take extra care to ensure that my experiment is fundamentally sound