[llvm] [llubi] Add basic support for icmp, terminators and function calls (PR #181393)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 14 01:15:52 PST 2026
================
@@ -204,6 +206,39 @@ class InstExecutor : public InstVisitor<InstExecutor, void> {
});
}
+ void jumpTo(Instruction &Terminator, BasicBlock *DestBB) {
+ if (!Handler.onBBJump(Terminator, *DestBB))
+ return;
+ BasicBlock *From = CurrentFrame->BB;
+ CurrentFrame->BB = DestBB;
+ CurrentFrame->PC = DestBB->begin();
+ // Update PHI nodes in batch to avoid the interference between PHI nodes.
+ // We need to store the incoming values into a temporary buffer.
+ // Otherwise, the incoming value may be overwritten before it is
+ // used by other PHI nodes.
+ SmallVector<std::pair<PHINode *, AnyValue>> IncomingValues;
+ PHINode *PHI = nullptr;
+ while ((PHI = dyn_cast<PHINode>(CurrentFrame->PC))) {
+ Value *Incoming = PHI->getIncomingValueForBlock(From);
+ // Bail out on the self-referential value.
----------------
nikic wrote:
Hm, why do we need to handle this explicitly? If the value is self-referential, the value stays the same, but wouldn't we still want it to go through setResult() for the print?
https://github.com/llvm/llvm-project/pull/181393
More information about the llvm-commits
mailing list