[llvm] [MemCpyOpt] fix miscompile for non-dominated use of src alloca for stack-move optimization (PR #66618)

Kohei Asano via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 02:00:33 PDT 2023


================
@@ -1481,28 +1481,35 @@ bool MemCpyOptPass::performStackMoveOptzn(Instruction *Load, Instruction *Store,
     Worklist.push_back(AI);
     unsigned MaxUsesToExplore = getDefaultMaxUsesToExploreForCaptureTracking();
     Worklist.reserve(MaxUsesToExplore);
-    SmallSet<const Use *, 20> Visited;
+    SmallSet<Instruction *, 20> Visited;
----------------
khei4 wrote:

Ah, ... Sorry, that was style noises, I thought it'd be neat to handle Instruction type uniformly if it can be used, (although the const modifier is dropped...). I could revert this because of no rationale for improvements.

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


More information about the llvm-commits mailing list