[llvm] [SandboxIR] Implement missing PHINode functions (PR #101734)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 13:24:25 PDT 2024
================
@@ -1150,6 +1150,22 @@ Value *PHINode::hasConstantValue() const {
llvm::Value *LLVMV = cast<llvm::PHINode>(Val)->hasConstantValue();
return LLVMV != nullptr ? Ctx.getValue(LLVMV) : nullptr;
}
+void PHINode::replaceIncomingBlockWith (const BasicBlock *Old, BasicBlock *New) {
+ assert(New && Old && "Sandbox IR PHI node got a null basic block!");
+ for (unsigned Op = 0,
+ NumOps = cast<llvm::PHINode>(Val)->getNumOperands(); Op != NumOps; ++Op)
+ if (getIncomingBlock(Op) == Old)
+ setIncomingBlock(Op, New);
+}
+void PHINode::removeIncomingValueIf(function_ref< bool(unsigned)> Predicate,
+ bool DeletePHIIfEmpty) {
----------------
Sterling-Augustine wrote:
Good catch, should be passed through to the llvmir function.
https://github.com/llvm/llvm-project/pull/101734
More information about the llvm-commits
mailing list