TBAA in LLVM IR

Overview of type-based alias analysis in LLMV IR.

These views do not in any way represent those of NVIDIA or any other organization or institution that I am professionally associated with. These views are entirely my own.

LLVM Alias Analysis

Alias analysis answers the question “do these two addresses alias each other?” with three possible responses. Two addresses either MayAlias, MustAlias, or they do NotAlias (which is how they are spelled in the LLVM alias analysis api).

Alias analyses can take into account lots of factors (control flow, field analysis (when analyzing structures), etc), but we’re only talking about type-based alias analysis (TBAA).

TBAA leverages the rules in the type system of the given programming language to prove something about the aliasing relationship between two addresses.

LLVM TBAA Metadata

What is TBAA


Written on Dec 2nd, 2022