Four years on code generation for hardware that isn't a plain CPU: GPU backends at AMD, PowerPC at IBM.
AMD, AMDGPU backend. LLVM's MachineVerifier: catching illegal VGPR-to-SGPR
copies and operand size mismatches at machine-IR level, before they could turn into
silent miscompiles. Alongside it, correctness and performance triage with the ROCm
library teams.
IBM, PowerPC. Decimal BCD arithmetic builtins end to end: Clang semantic analysis with constant-argument range validation, new LLVM IR intrinsic definitions, and lowering for both AIX and Linux.
Thirty puzzles on what the optimiser actually does to your code. Pick an answer,
flip the card, see the real assembly. Every listing is output from clang 18 at -O2.
Two to try right here
What does clang -O2 emit for this?
int f(int x) { return x + 1 > x; }answer
f:
mov eax, 1
retIt always returns 1 and never does the addition. Signed overflow is undefined
behaviour, so the compiler may assume x + 1 > x always holds and folds the whole
function to a constant. At INT_MAX the "right" answer would be 0, but the standard
says that program has no meaning, so there is nothing to be right about.
One of these folds away and one doesn't. Which, and why?
float a(float x) { return x + 0.0f; }
float m(float x) { return x * 1.0f; }answer
m folds to a bare ret. a keeps its addss.
Adding zero is not the identity on IEEE-754 floats: if x is -0.0, then x + 0.0
is +0.0. Multiplying by one preserves the sign, negative zero included, and
preserves NaN, so it genuinely is the identity. One signed zero is the entire
difference between the two lines.
Open to work in LLVM, MLIR, or backend bring-up for new hardware.


