[llvm] [DSE] Apply initializes attribute to DSE (PR #107282)

Haopeng Liu via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 14:17:44 PDT 2024


================
@@ -911,7 +1020,8 @@ struct DSEState {
 
         auto *MD = dyn_cast_or_null<MemoryDef>(MA);
         if (MD && MemDefs.size() < MemorySSADefsPerBlockLimit &&
-            (getLocForWrite(&I) || isMemTerminatorInst(&I)))
+            (getLocForWrite(&I) || isMemTerminatorInst(&I) ||
+             HasInitializesAttr(&I)))
----------------
haopliu wrote:

Yes, it's better to check the `EnableInitializesImprovement` at the beginning as well. Done!

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


More information about the llvm-commits mailing list