[llvm] [SandboxIR] Implement missing PHINode functions (PR #101734)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 2 15:20:19 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:
Blah. It turns out that deleting empty PHINodes is unimplemented in the tracker right now, and needs cleanup in several places. I'll delete this use for now and fix it in a variety of places in a later follow up.
https://github.com/llvm/llvm-project/pull/101734
More information about the llvm-commits
mailing list