[PATCH] D133386: [nfc] Refactor SlotIndex::getInstrDistance to better reflect actual functionality
Matthias Braun via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 6 17:46:31 PDT 2022
MatzeB added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/SlotIndexes.h:219-221
+ /// indices are packed as densely as possible. This assumption is only true
+ /// in practice if an instruction is inserted in between two existing
+ /// instructions. Otherwise, this function will return a value greater than
----------------
This assumption is also not true after inserting one instruction. You have to insert `InstrDist / Slot_Count` instructions I believe until you reach the limit (currently 4). And also the 5th insertion would trigger a renumbering making this approximate again...
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133386/new/
https://reviews.llvm.org/D133386
More information about the llvm-commits
mailing list