Skip to content

Commit 8ec7dec

Browse files
committed
Add a comment to the verifier that explains that if cond_br is ever changed to take something different than an i1, then the ARC optimizer will need to be changed.
1 parent f81b669 commit 8ec7dec

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/SIL/Verifier.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,6 +2596,12 @@ class SILVerifier : public SILVerifierBase<SILVerifier> {
25962596
}
25972597

25982598
void checkCondBranchInst(CondBranchInst *CBI) {
2599+
// It is important that cond_br keeps an i1 type. ARC Sequence Opts assumes
2600+
// that cond_br does not use reference counted values or decrement reference
2601+
// counted values under the assumption that the instruction that computes
2602+
// the i1 is the use/decrement that ARC cares about and that after that
2603+
// instruction is evaluated, the scalar i1 has a different identity and the
2604+
// object can be deallocated.
25992605
require(CBI->getCondition().getType() ==
26002606
SILType::getBuiltinIntegerType(1,
26012607
CBI->getCondition().getType().getASTContext()),

0 commit comments

Comments
 (0)