[llvm] [LVI] Handle freeze instruction in BlockValue (PR #65399)

Mariusz Sikora via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 11:47:00 PDT 2023


https://github.com/mariusz-sikora-at-amd created https://github.com/llvm/llvm-project/pull/65399:

Skip freeze instruction and take its source Value
for further processing.

>From 5126782ccbfe559c4004ecc1f6d6216c89cb1513 Mon Sep 17 00:00:00 2001
From: Mariusz Sikora <mariusz.sikora at amd.com>
Date: Tue, 5 Sep 2023 20:29:45 +0200
Subject: [PATCH] [LVI] Handle freeze instruction in BlockValue

Skip freeze instruction and take its source Value
for further processing.
---
 llvm/lib/Analysis/LazyValueInfo.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 80136a090a8010d..281dad531ccc8fd 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -629,6 +629,9 @@ LazyValueInfoImpl::solveBlockValueImpl(Value *Val, BasicBlock *BB) {
       return solveBlockValueIntrinsic(II, BB);
   }
 
+  if (auto *FI = dyn_cast<FreezeInst>(BBI))
+      return solveBlockValueImpl(FI->getOperand(0), BB);
+
   LLVM_DEBUG(dbgs() << " compute BB '" << BB->getName()
                     << "' - unknown inst def found.\n");
   return getFromRangeMetadata(BBI);



More information about the llvm-commits mailing list