[llvm] [SimplifyCFG] Use hash map to continue hoisting the common instructions (PR #78615)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 20 08:35:49 PDT 2024


================
@@ -1739,18 +1840,44 @@ bool SimplifyCFGOpt::hoistCommonCodeFromSuccessors(BasicBlock *BB,
         // leave any that were not hoisted behind (by calling moveBefore
         // rather than moveBeforePreserving).
         I1->moveBefore(TI);
-        for (auto &SuccIter : OtherSuccIterRange) {
-          Instruction *I2 = &*SuccIter++;
+        for (auto *I2 : OtherInsts) {
           assert(I2 != I1);
-          if (!I2->use_empty())
+          // Update hashcode of all instructions using I2
+          if (!I2->use_empty()) {
+            SmallVector<llvm::Instruction *, 8> PrevUsers;
----------------
nikic wrote:

Don't use `llvm::` prefix in upstream LLVM.

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


More information about the llvm-commits mailing list