[llvm] [SandboxIR] Implement missing PHINode functions (PR #101734)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 2 12:39:53 PDT 2024


================
@@ -1974,7 +1974,18 @@ define void @foo(i32 %arg) {
   EXPECT_EQ(PHI->hasConstantOrUndefValue(), LLVMPHI->hasConstantOrUndefValue());
   // Check isComplete().
   EXPECT_EQ(PHI->isComplete(), LLVMPHI->isComplete());
-
+  // Check replaceIncomingBlockWith
+  OrigBB = PHI->getIncomingBlock(0);
+  EXPECT_EQ(OrigBB, BB1);
----------------
vporpo wrote:

nit: I would use a `NewBB` variable to make it a bit more explicit, and use `OrigBB` and `NewBB` in `replaceIncomingBlockWith()`, like so:
```
OrigBB = PHI->getIncomingBlock(0);
auto *NewBB = BB2;
EXPECT_NE(NewBB, OrigBB);
PHI->replaceIncomingBlockWith(OrigBB, NewBB);
```

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


More information about the llvm-commits mailing list