[llvm] [llubi] Implements common library functions (PR #190147)

Zhige Chen via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 23:27:19 PDT 2026


================
@@ -266,23 +268,26 @@ class InstExecutor : public InstVisitor<InstExecutor, void>,
     if (auto *RV = RI.getReturnValue())
       CurrentFrame->RetVal = getValue(RV);
     CurrentFrame->State = FrameState::Exit;
-    Status &= Handler.onInstructionExecuted(RI, None);
+    if (getExecutionStatus())
+      if (!Handler.onInstructionExecuted(RI, None))
+        requestProgramExit(ProgramExitInfo::ProgramExitKind::Failed);
   }
 
-  void visitUncondBrInst(UncondBrInst &BI) { jumpTo(BI, BI.getSuccessor()); }
-
-  void visitCondBrInst(CondBrInst &BI) {
-    switch (getValue(BI.getCondition()).asBoolean()) {
-    case BooleanKind::True:
-      jumpTo(BI, BI.getSuccessor(0));
-      return;
-    case BooleanKind::False:
-      jumpTo(BI, BI.getSuccessor(1));
-      return;
-    case BooleanKind::Poison:
-      reportImmediateUB("Branch on poison condition.");
-      return;
+  void visitBranchInst(BranchInst &BI) {
----------------
nofe1248 wrote:

Maybe a mistake in rebasing, thanks for pointing that out!

https://github.com/llvm/llvm-project/pull/190147


More information about the llvm-commits mailing list