[PATCH] D132657: [DSE] Eliminate noop store even through has clobbering between LoadI and StoreI

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 01:55:55 PDT 2022


nikic accepted this revision.
nikic added a comment.

LGTM



================
Comment at: llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp:1881
+            // value, so we can safely ignore it if alignment is as expected.
+            if (auto *CurrentDef = dyn_cast<MemoryDef>(Current))
+              if (auto *CurrentStoreI =
----------------
You can make this `auto *CurrentDef = cast<MemoryDef>(Current);` and save the if. See the assert a few lines above.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132657/new/

https://reviews.llvm.org/D132657



More information about the llvm-commits mailing list