[all-commits] [llvm/llvm-project] f6c86b: [LFI] Add MCLFIRewriter infrastructure (#172906)

Zachary Yedidia via All-commits all-commits at lists.llvm.org
Thu Feb 19 14:45:49 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f6c86bd69d92e82096fa98f8e38bb7ebf4ce9274
      https://github.com/llvm/llvm-project/commit/f6c86bd69d92e82096fa98f8e38bb7ebf4ce9274
  Author: Zachary Yedidia <zyedidia at gmail.com>
  Date:   2026-02-19 (Thu, 19 Feb 2026)

  Changed paths:
    M llvm/docs/LFI.rst
    A llvm/include/llvm/MC/MCLFI.h
    A llvm/include/llvm/MC/MCLFIRewriter.h
    M llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h
    M llvm/include/llvm/MC/MCStreamer.h
    M llvm/include/llvm/MC/TargetRegistry.h
    M llvm/lib/MC/CMakeLists.txt
    M llvm/lib/MC/MCAsmStreamer.cpp
    A llvm/lib/MC/MCLFI.cpp
    A llvm/lib/MC/MCLFIRewriter.cpp
    M llvm/lib/MC/MCObjectStreamer.cpp
    M llvm/lib/MC/MCParser/AsmParser.cpp
    M llvm/lib/MC/MCParser/CMakeLists.txt
    A llvm/lib/MC/MCParser/LFIAsmParser.cpp
    M llvm/lib/MC/MCStreamer.cpp
    M llvm/lib/MC/TargetRegistry.cpp
    M llvm/tools/llvm-mc/llvm-mc.cpp

  Log Message:
  -----------
  [LFI] Add MCLFIRewriter infrastructure (#172906)

This is the second patch in the LFI series, adding the following
features:

* `MCLFIRewriter` class, which will be used to perform LFI rewrites on a
per-architecture basis. Each architecture where LFI is supported will
implement a subclass (for example,
`Target/AArch64/MCTargetDesc/AArch64MCLFIRewriter.cpp`) that will
implement the `rewriteInst` function to perform the actual rewriting
(the AArch64 version will be added in the next PR). The generic rewriter
class provides some instruction info utilities (`mayLoad`, `mayStore`)
and is used to call `rewriteInst` during instruction emission. It also
provides `onLabel` which allows the rewriter to know possible branch
targets, making certain optimizations like guard elimination possible.
* LFI streamer initialization that marks object files with a NOTE
section to indicate that the object file is using LFI.
* A basic LFI assembly parser that introduces the `.lfi_rewrite_disable`
and `.lfi_rewrite_enable` directives that can be used to control whether
rewriting is enabled or not in hand-written assembly.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list