[llvm-branch-commits] [llvm] [IR2Vec] Consider only reachable BBs and non-debug instructions (PR #143476)
S. VenkataKeerthy via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jun 10 12:19:19 PDT 2025
================
@@ -218,9 +222,12 @@ void SymbolicEmbedder::computeEmbeddings(const BasicBlock &BB) const {
void SymbolicEmbedder::computeEmbeddings() const {
if (F.isDeclaration())
return;
- for (const auto &BB : F) {
- computeEmbeddings(BB);
- FuncVector += BBVecMap[&BB];
+
+ // Consider only the basic blocks that are reachable from entry
+ ReversePostOrderTraversal<const Function *> RPOT(&F);
----------------
svkeerthy wrote:
Yeah. Also, the current MLInliner considers only reachable blocks (tests have some examples). This check ensures parity, and it makes sense to consider only reachable blocks in general. If we need the embedding of an unreachable block, it can still be obtained by directly invoking `getBBVector()`.
https://github.com/llvm/llvm-project/pull/143476
More information about the llvm-branch-commits
mailing list