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

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 09:40:34 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());
+    BasicBlock *StoreBB = StoreI->getParent();
+    Value *StorePtr = StoreI->getPointerOperand();
----------------
hiraditya wrote:

nit: We don't need StorePtr and StoreVal until later, so we might move these down.

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


More information about the llvm-commits mailing list