<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Compilers | Mahbub H. Raton</title><link>https://mahbub-hr.github.io/tag/compilers/</link><atom:link href="https://mahbub-hr.github.io/tag/compilers/index.xml" rel="self" type="application/rss+xml"/><description>Compilers</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><copyright>© 2026 Mahbub H. Raton</copyright><lastBuildDate>Sun, 01 Feb 2026 00:00:00 +0000</lastBuildDate><image><url>https://mahbub-hr.github.io/media/icon_hu0b7a4cb9992c9ac0e91bd28ffd38dd00_9727_512x512_fill_lanczos_center_2.png</url><title>Compilers</title><link>https://mahbub-hr.github.io/tag/compilers/</link></image><item><title>IR-Sentinel: LLVM-IR Security Analysis via MCP</title><link>https://mahbub-hr.github.io/project/ir-sentinel-llvm-ir-security-analysis-via-mcp/</link><pubDate>Sun, 01 Feb 2026 00:00:00 +0000</pubDate><guid>https://mahbub-hr.github.io/project/ir-sentinel-llvm-ir-security-analysis-via-mcp/</guid><description>&lt;p>Language models are good at recognizing patterns in code and bad at knowing what the compiler actually did with it. IR-Sentinel is a proof of concept that closes that gap by handing the model the compiler.&lt;/p>
&lt;p>It is a &lt;strong>Model Context Protocol (MCP)&lt;/strong> server, built on &lt;code>FastMCP&lt;/code>, that exposes a local LLVM toolchain — &lt;code>clang&lt;/code> and &lt;code>opt&lt;/code> — as tools an AI agent can call. The agent pipeline then:&lt;/p>
&lt;ol>
&lt;li>Compiles C++ source to &lt;strong>LLVM IR&lt;/strong>,&lt;/li>
&lt;li>Extracts &lt;strong>control flow graph&lt;/strong> metrics from it,&lt;/li>
&lt;li>Iteratively queries &lt;strong>Gemini&lt;/strong> against that structured view to identify use-after-free vulnerability patterns.&lt;/li>
&lt;/ol>
&lt;p>The interesting part is that the model reasons over the IR and the CFG rather than over surface syntax, so it sees the program the way the optimizer does.&lt;/p>
&lt;p>&lt;em>Built with Python, LLVM, Gemini, and FastMCP.&lt;/em>&lt;/p></description></item><item><title>AEGIS: An LLVM Pass for Hardware Reliability</title><link>https://mahbub-hr.github.io/project/aegis-llvm-compiler-pass-for-hardware-reliability/</link><pubDate>Fri, 01 Aug 2025 00:00:00 +0000</pubDate><guid>https://mahbub-hr.github.io/project/aegis-llvm-compiler-pass-for-hardware-reliability/</guid><description>&lt;p>Transient hardware faults — a bit flipped in a cache line or a register by a stray particle or a marginal voltage — do not announce themselves. The machine keeps running and quietly produces the wrong answer. AEGIS is an LLVM pass that makes a program check its own arithmetic, so that a corrupted value is caught before it can escape.&lt;/p>
&lt;p>The pass implements &lt;strong>Error Detection by Duplicated Instructions (EDDI)&lt;/strong>. It duplicates global, stack, and heap values and compares the two copies at the points where a wrong value would become observable: before a store, before a branch, and before a function call. Getting this to work on real programs meant more than duplicating instructions:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Call boundaries.&lt;/strong> Call sites are rewritten to pass shadow arguments and retrieve shadow return values, so duplication survives across function calls rather than stopping at each one.&lt;/li>
&lt;li>&lt;strong>Pointer sizes.&lt;/strong> Knowing how much memory to duplicate behind a pointer is not something the IR tells you. The pass recovers it from DWARF debug metadata, falling back to a signature table for library calls.&lt;/li>
&lt;li>&lt;strong>Extensibility.&lt;/strong> Hardening schemes are registered through a strategy registry, so adding a new one is a single self-registering file rather than an edit threaded through the pass.&lt;/li>
&lt;li>&lt;strong>Testing.&lt;/strong> A regression suite validates both that the transformation is correct and that fault-detection coverage holds across the benchmark suite.&lt;/li>
&lt;/ul>
&lt;p>Measured against L1 cache fault injection, AEGIS reduces silent data corruption by &lt;strong>1.3× to 29×&lt;/strong> across &lt;code>qsort&lt;/code>, &lt;code>matmul&lt;/code>, and &lt;code>CRC32&lt;/code>, at a runtime cost of 1.6× to 3.0×.&lt;/p>
&lt;p>&lt;em>Built with C++, LLVM, Clang, and CMake.&lt;/em>&lt;/p></description></item><item><title>Architectural Hurdles: Exploring the Difficulties of x86-to-ARM Binary Cross-Compilation</title><link>https://mahbub-hr.github.io/publication/architectural-hurdles/</link><pubDate>Sun, 01 Jun 2025 00:00:00 +0000</pubDate><guid>https://mahbub-hr.github.io/publication/architectural-hurdles/</guid><description/></item><item><title>Cross-Compiling x86 Binaries to ARM</title><link>https://mahbub-hr.github.io/project/cross-compiling-x86-binaries-to-arm/</link><pubDate>Sat, 01 Jun 2024 00:00:00 +0000</pubDate><guid>https://mahbub-hr.github.io/project/cross-compiling-x86-binaries-to-arm/</guid><description>&lt;p>Moving a program to a new instruction set architecture is straightforward when you have the source. When you do not, you have to reconstruct enough of the program&amp;rsquo;s meaning from the binary itself to emit correct code for a different machine.&lt;/p>
&lt;p>This project extended &lt;a href="https://github.com/trailofbits/binrec-tob" target="_blank" rel="noopener">Binrec&lt;/a> — a dynamic binary lifting framework that recovers LLVM IR by observing concrete executions — to target AArch64 from x86 input. The work centered on two things:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Adapting the lifting pipeline.&lt;/strong> Binrec&amp;rsquo;s dynamic execution and IR recovery stages assumed an x86 target throughout; retargeting them meant separating what was genuinely architecture-neutral in the recovered IR from what had quietly encoded x86 assumptions.&lt;/li>
&lt;li>&lt;strong>A translation layer for library calls.&lt;/strong> Calls out to the C library cross the boundary where the two calling conventions disagree. An x64-to-AArch64 shim translates arguments and return values at that boundary.&lt;/li>
&lt;/ul>
&lt;p>The result runs two real-world SPEC CPU 2017 programs, &lt;code>mcf&lt;/code> and &lt;code>xalancbmk&lt;/code>, correctly on ARM, at roughly &lt;strong>6× slowdown relative to native&lt;/strong>.&lt;/p>
&lt;p>A manuscript on the architectural mismatches this work surfaced is in preparation.&lt;/p>
&lt;p>&lt;em>Built with LLVM, C++, S2E, and x86/ARM assembly.&lt;/em>&lt;/p></description></item><item><title>WARIR: A WebAssembly Optimizing Compiler</title><link>https://mahbub-hr.github.io/project/warir-wasm-optimizer-compiler/</link><pubDate>Sat, 01 Jun 2024 00:00:00 +0000</pubDate><guid>https://mahbub-hr.github.io/project/warir-wasm-optimizer-compiler/</guid><description>&lt;p>A complete compiler pipeline from the SMPL teaching language down to WebAssembly, written for a graduate compilers course.&lt;/p>
&lt;p>The back end is where most of the work went:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Graph-coloring register allocation&lt;/strong>, building the interference graph from live ranges and spilling when the graph is not colorable with the available registers.&lt;/li>
&lt;li>&lt;strong>SSA-based dataflow analysis&lt;/strong> driving common subexpression elimination and copy propagation, with the optimizations expressed as transformations on the SSA form rather than ad-hoc peephole rules.&lt;/li>
&lt;/ul>
&lt;p>&lt;em>Built with Python, Node.js, and WebAssembly.&lt;/em>&lt;/p></description></item></channel></rss>