[llvm] [SimplifyCFG] Fix hoisting problem in SimplifyCFG (PR #78615)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 5 09:24:44 PST 2024


================
@@ -1742,15 +1767,6 @@ bool SimplifyCFGOpt::hoistCommonCodeFromSuccessors(BasicBlock *BB,
       continue;
     }
 
-    SmallVector<Instruction *, 8> OtherInsts;
-    if (SameLevelHoist) { 
----------------
amehsan wrote:

To rephrase my second point: The proposed change is not neccarily algorithmically equivalent to the current implementation. IIUC, and the motivation is only to make the code easier to understand, then

1. this improvement is not that significant.
2. The work would require understanding corner cases, where the two algorithm behave differently and making sure they are handled properly.

So my question for @DianQK is could you clarify what are the benefits of separating (1) and (2).

Thanks 

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


More information about the llvm-commits mailing list