[AArch64][LFI] Consolidate LFI metadata into centralized type-safe mapping tables#5
Draft
nickdesaulniers wants to merge 11 commits into
Draft
Conversation
…pping tables Refactor the AArch64 Lightweight Fault Isolation (LFI) metadata TableGen architecture by moving all variant mapping relationships into explicit, centralized lookup tables inside AArch64LFI.td. This approach keeps core target files completely untouched by LFI mapping metadata. Instead of dynamically resolving base instruction names from subclass records, this design declares all mappings explicitly in centralized tables (LFIVariantTable, PairVariantTable, SIMDPostTable). This design guarantees 100% compile-time type safety; TableGen verifies that all mapped variant and base instructions are valid records, failing immediately at build-time if there are any typos. - Isolate LFI table entry structures (LFIVariantEntry, LFIPairVariantEntry, LFISIMDPostEntry) and LFIAddrMode constants into AArch64LFIInstrFormats.td. - Completely strip all LFI variant, pair, and SIMD metadata fields (HasLFIVariant, HasPairVariant, HasSIMDPost) from AArch64InstrFormats.td, leaving core formats focused strictly on memory layout properties for the MemInfoTable. - Introduce concise, type-safe helper multiclasses (LFIFamily, LFIPairFamily, LFIPrefetchFamily) in AArch64LFI.td to explicitly and cleanly declare all GPR, FPR, and Prefetch variant mappings. - Maintain type-safe SIMD post-index writeback scaling by mapping over 200 SIMD instructions via loops over structural family definitions in AArch64LFI.td. - Synchronize structure fields in AArch64MCLFIRewriter.cpp with TableGen's generated searchable primary keys.
eb6e583 to
f2b56f1
Compare
zyedidia
pushed a commit
that referenced
this pull request
Jul 7, 2026
…lvm#207008) `Evaluate_DW_OP_convert` dereferenced `eval_ctx.dwarf_cu` (the `DWARFExpression` Delegate) whenever the operand DIE offset was non-zero, and unconditionally read `eval_ctx.stack.back()`. When a DWARF expression is evaluated without a DWARF unit (as the lldb-dwarf-expression-fuzzer does), two operand shapes crash: - `DW_OP_convert` with a non-zero offset calls `dwarf_cu->GetDIEBitSizeAndSign(...)` on a null Delegate. - `DW_OP_convert` with nothing on the stack reads the back of an empty vector. The unit test feeds both with `dwarf_cu == nullptr` and crashes: ``` [ RUN ] DWARFExpression.DW_OP_convert #2 SignalHandler(int, __siginfo*, void*) #4 DWARFExpression::Evaluate(...) #5 Evaluate(ArrayRef<unsigned char>, ...) ``` (SIGSEGV, the process aborts.) Bail out with an error when the stack is empty, and when a non-zero DIE offset is requested without a DWARF unit, instead of crashing. Extends `DWARFExpression.DW_OP_convert` with these two cases, which crash without the fix. --------- Co-authored-by: Michael Buch <michaelbuch12@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor the AArch64 Lightweight Fault Isolation (LFI) metadata TableGen
architecture by moving all variant mapping relationships into explicit,
centralized lookup tables inside AArch64LFI.td.
This approach keeps core target files completely untouched by LFI
mapping metadata. Instead of dynamically resolving base instruction
names from subclass records, this design declares all mappings
explicitly in centralized tables (LFIVariantTable, PairVariantTable,
SIMDPostTable). This design guarantees 100% compile-time type safety;
TableGen verifies that all mapped variant and base instructions are
valid records, failing immediately at build-time if there are any typos.
LFISIMDPostEntry) and LFIAddrMode constants into AArch64LFIInstrFormats.td.
HasPairVariant, HasSIMDPost) from AArch64InstrFormats.td, leaving core formats
focused strictly on memory layout properties for the MemInfoTable.
LFIPrefetchFamily) in AArch64LFI.td to explicitly and cleanly declare all GPR,
FPR, and Prefetch variant mappings.
instructions via loops over structural family definitions in AArch64LFI.td.
generated searchable primary keys.