@@ -91,8 +91,12 @@ misattributed to a block containing one of the instructions-to-be-merged.
91
91
92
92
Examples of transformations that should follow this rule include:
93
93
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.
96
100
97
101
* Merging identical loop-invariant stores (see the LICM utility
98
102
``llvm::promoteLoopAccessesToScalars ``).
@@ -115,9 +119,11 @@ Examples of transformations for which this rule *does not* apply include:
115
119
single-stepping experience. The rule for
116
120
:ref: `dropping locations<WhenToDropLocation> ` should apply here.
117
121
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
121
127
:ref: `dropping locations<WhenToDropLocation> ` applies.
122
128
123
129
.. _WhenToDropLocation :
0 commit comments