[llvm] [DeadStoreElimination] Optimize tautological assignments (PR #75744)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 09:35:40 PST 2024


================
@@ -1901,6 +1901,51 @@ struct DSEState {
     return true;
   }
 
+  // Check if there is a dominating condition, that implies that the value
+  // being stored in a ptr is already present in the ptr.
+  bool dominatingConditionImpliesValue(MemoryDef *Def) {
+    auto *StoreI = dyn_cast<StoreInst>(Def->getMemoryInst());
----------------
hiraditya wrote:

What happens when dyn_cast returns nullptr?

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


More information about the llvm-commits mailing list