Skip to content

Commit 9adbe3f

Browse files
authored
Merge pull request #64399 from meg-gupta/looprotateguaranteedphi
Enable LoopRotate on header blocks with forwarding instructions
2 parents e137b32 + 49d9ba5 commit 9adbe3f

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

lib/SILOptimizer/LoopTransforms/LoopRotate.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ canDuplicateOrMoveToPreheader(SILLoop *loop, SILBasicBlock *preheader,
7979
if (isa<DeallocStackInst>(inst)) {
8080
return false;
8181
}
82-
OwnershipForwardingMixin *ofm = nullptr;
83-
if ((ofm = OwnershipForwardingMixin::get(inst)) &&
84-
ofm->getForwardingOwnershipKind() == OwnershipKind::Guaranteed) {
85-
return false;
86-
}
8782
if (isa<FunctionRefInst>(inst)) {
8883
moves.push_back(inst);
8984
invariants.insert(inst);

test/SILOptimizer/looprotate_nontrivial_ossa.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ exit:
203203
// A guaranteed value whose ownership has been forwarded must not be reborrowed.
204204
//
205205
// CHECK-LABEL: sil [ossa] @forwarded_borrow_cant_be_reborrowed : $@convention(thin) (@owned BoxStruct) -> () {
206-
// CHECK-NOT: {{bb[0-9]+}}({{%[^,]+}} : @guaranteed $BoxStruct, {{%[^,]+}} : @guaranteed $Klass):
206+
// CHECK: {{bb[0-9]+}}({{%[^,]+}} : @guaranteed $BoxStruct, {{%[^,]+}} : @guaranteed $Klass):
207207
// CHECK-LABEL: } // end sil function 'forwarded_borrow_cant_be_reborrowed'
208208
sil [ossa] @forwarded_borrow_cant_be_reborrowed : $@convention(thin) (@owned BoxStruct) -> () {
209209
bb0(%0 : @owned $BoxStruct):

0 commit comments

Comments
 (0)