@@ -91,8 +91,12 @@ misattributed to a block containing one of the instructions-to-be-merged.
9191
9292Examples of transformations that should follow this rule include:
9393
94- * Merging identical loads/stores which occur on both sides of a CFG diamond
95- (see the ``MergedLoadStoreMotion `` pass).
94+ * Hoisting identical instructions from all successors of a conditional branch
95+ or sinking those from all paths to a postdominating block. For example,
96+ merging identical loads/stores which occur on both sides of a CFG diamond
97+ (see the ``MergedLoadStoreMotion `` pass). For each group of identical
98+ instructions being hoisted/sunk, the merge of all their locations should be
99+ applied to the merged instruction.
96100
97101* Merging identical loop-invariant stores (see the LICM utility
98102 ``llvm::promoteLoopAccessesToScalars ``).
@@ -115,9 +119,11 @@ Examples of transformations for which this rule *does not* apply include:
115119 single-stepping experience. The rule for
116120 :ref: `dropping locations<WhenToDropLocation> ` should apply here.
117121
118- * Hoisting identical instructions which appear in several successor blocks into
119- a predecessor block (see ``BranchFolder::HoistCommonCodeInSuccs ``). In this
120- case there is no single merged instruction. The rule for
122+ * Hoisting/sinking that would make a location reachable when it previously
123+ wasn't. Consider hoisting two identical instructions with the same location
124+ from first two cases of a switch that has three cases. Merging their
125+ locations would make the location from the first two cases reachable when the
126+ third case is taken. The rule for
121127 :ref: `dropping locations<WhenToDropLocation> ` applies.
122128
123129.. _WhenToDropLocation :
0 commit comments