Skip to content

Commit e7cd1c5

Browse files
committed
Handle end_apply results in RegionAnalyzer
1 parent cd1fb77 commit e7cd1c5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/SILOptimizer/Analysis/RegionAnalysis.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2659,6 +2659,13 @@ class PartitionOpTranslator {
26592659
return translateSILBuiltin(bi);
26602660
}
26612661

2662+
if (auto *eai = dyn_cast<EndApplyInst>(inst)) {
2663+
// FIXME: This might not be not entirely correct.
2664+
auto *bai = eai->getBeginApply();
2665+
return translateSILMultiAssign(eai->getResults(),
2666+
makeOperandRefRange(bai->getAllOperands()));
2667+
}
2668+
26622669
auto fas = FullApplySite::isa(inst);
26632670
assert(bool(fas) && "Builtins should be handled above");
26642671

@@ -3509,7 +3516,6 @@ CONSTANT_TRANSLATION(EndUnpairedAccessInst, Ignored)
35093516
CONSTANT_TRANSLATION(HopToExecutorInst, Ignored)
35103517
CONSTANT_TRANSLATION(InjectEnumAddrInst, Ignored)
35113518
CONSTANT_TRANSLATION(DestroyNotEscapedClosureInst, Ignored)
3512-
CONSTANT_TRANSLATION(EndApplyInst, Ignored)
35133519
CONSTANT_TRANSLATION(AbortApplyInst, Ignored)
35143520
CONSTANT_TRANSLATION(DebugStepInst, Ignored)
35153521
CONSTANT_TRANSLATION(IncrementProfilerCounterInst, Ignored)
@@ -3632,6 +3638,7 @@ CONSTANT_TRANSLATION(ApplyInst, Apply)
36323638
CONSTANT_TRANSLATION(BeginApplyInst, Apply)
36333639
CONSTANT_TRANSLATION(BuiltinInst, Apply)
36343640
CONSTANT_TRANSLATION(TryApplyInst, Apply)
3641+
CONSTANT_TRANSLATION(EndApplyInst, Apply)
36353642

36363643
//===---
36373644
// Asserting

0 commit comments

Comments
 (0)