Optimizations in C++ Compilers
queue.acm.org
Optimizations in C++ Compilers
1–10 of 21 posts
Re: Optimizations in C++ Compilers
#2Nice try. You can’t escape being known as a verb now.
Everyone knows the tool as godbolt.
Re: Optimizations in C++ Compilers
#3> I went home that evening and created Compiler Explorer. Nice try. You can’t escape being known as a verb now. Everyone knows the tool as godbolt.
Re: Optimizations in C++ Compilers
#4> I went home that evening and created Compiler Explorer. Nice try. You can’t escape being known as a verb now. Everyone knows the tool as godbolt.
Re: Optimizations in C++ Compilers
#5> I went home that evening and created Compiler Explorer. Nice try. You can’t escape being known as a verb now. Everyone knows the tool as godbolt.
Re: Optimizations in C++ Compilers
#6It's amazing how many more code generation questions occur to me now that there's so much less friction in getting the answers.
Re: Optimizations in C++ Compilers
#7> I went home that evening and created Compiler Explorer. Nice try. You can’t escape being known as a verb now. Everyone knows the tool as godbolt.
Re: Optimizations in C++ Compilers
#8Re: Optimizations in C++ Compilers
#9Most important: this optimization enables pipelined execution.
When people talk about a CPU executing an integer add instruction in ~1 cycle, what they actually mean is that the add has this latency when the CPU pipelines are full.
If you have an 11 stage pipeline... the add can often have a latency of ~11 cycles... if you write the _right_ code for it.
Re: Optimizations in C++ Compilers
#10> Tail call removal. A recursive function that ends in a call to itself can often be rewritten as a loop, reducing call overhead and reducing the chance of stack overflow. Most important: this optimization enables pipelined execution. When people talk about a CPU executing an integer add instruction in ~1 cycle, what they actually mean is that the add has this latency when the CPU pipelines are full. If you have an 1…