[llvm] [LoopFuse] Change placeholder from `undef` to `poison` (PR #131535)

via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 16 11:56:04 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Pedro Lobo (pedroclobo)

<details>
<summary>Changes</summary>

Use `poison` instead of `undef` as a placeholder for phi entries of unreachable predecessors.

---
Full diff: https://github.com/llvm/llvm-project/pull/131535.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Scalar/LoopFuse.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Transforms/Scalar/LoopFuse.cpp b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
index eaf89b23c26f7..5bba3016ba4a1 100644
--- a/llvm/lib/Transforms/Scalar/LoopFuse.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopFuse.cpp
@@ -1968,7 +1968,7 @@ struct LoopFuser {
           PHINode::Create(LCV->getType(), 2, LCPHI->getName() + ".afterFC0");
       L1HeaderPHI->insertBefore(L1HeaderIP);
       L1HeaderPHI->addIncoming(LCV, FC0.Latch);
-      L1HeaderPHI->addIncoming(UndefValue::get(LCV->getType()),
+      L1HeaderPHI->addIncoming(PoisonValue::get(LCV->getType()),
                                FC0.ExitingBlock);
 
       LCPHI->setIncomingValue(L1LatchBBIdx, L1HeaderPHI);

``````````

</details>


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


More information about the llvm-commits mailing list