[llvm] [InstCombine] Treat identical operands as one in pushFreezeToPreventPoisonFromPropagating (PR #145348)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 16 05:22:38 PDT 2025


================
@@ -4899,13 +4899,15 @@ InstCombinerImpl::pushFreezeToPreventPoisonFromPropagating(FreezeInst &OrigFI) {
   // If operand is guaranteed not to be poison, there is no need to add freeze
   // to the operand. So we first find the operand that is not guaranteed to be
   // poison.
-  Use *MaybePoisonOperand = nullptr;
+  Value *MaybePoisonOperand = nullptr;
   for (Use &U : OrigOpInst->operands()) {
----------------
nikic wrote:

```suggestion
  for (Value *V : OrigOpInst->operands()) {
```
No need to go through Use anymore.

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


More information about the llvm-commits mailing list