File tree Expand file tree Collapse file tree 4 files changed +1297
-79
lines changed
lib/SILOptimizer/LoopTransforms Expand file tree Collapse file tree 4 files changed +1297
-79
lines changed Original file line number Diff line number Diff line change @@ -541,6 +541,7 @@ class SILInstruction
541541 SILValue getOperand (unsigned Num) const {
542542 return getAllOperands ()[Num].get ();
543543 }
544+ Operand &getOperandRef (unsigned Num) { return getAllOperands ()[Num]; }
544545 void setOperand (unsigned Num, SILValue V) { getAllOperands ()[Num].set (V); }
545546 void swapOperands (unsigned Num1, unsigned Num2) {
546547 getAllOperands ()[Num1].swap (getAllOperands ()[Num2]);
Original file line number Diff line number Diff line change @@ -125,6 +125,9 @@ class StructUseCollector {
125125 if (!ElementAddressUsers.empty ())
126126 return false ;
127127 for (SILInstruction *user : StructAddressUsers) {
128+ // ignore load users
129+ if (isa<LoadInst>(user))
130+ continue ;
128131 if (user != use1 && user != use2)
129132 return false ;
130133 }
@@ -184,6 +187,7 @@ class StructUseCollector {
184187 // Found a use of the struct at the given access path.
185188 if (auto *LoadI = dyn_cast<LoadInst>(UseInst)) {
186189 StructLoads.push_back (LoadI);
190+ StructAddressUsers.push_back (LoadI);
187191 continue ;
188192 }
189193
You can’t perform that action at this time.
0 commit comments