Skip to content

Commit d86099f

Browse files
committed
Use AccessPath in LICM.
The LICM algorithm was not robust with respect to address projection because it identifies a projected address by its SILValue. This should never be done! Use AccessPath instead. Fixes regressions caused by rdar://66791257 (Print statement provokes "Can't unsafeBitCast between types of different sizes" when optimizations enabled)
1 parent d9a1483 commit d86099f

File tree

3 files changed

+187
-111
lines changed

3 files changed

+187
-111
lines changed

include/swift/SIL/LoopInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ class SILLoop : public llvm::LoopBase<SILBasicBlock, SILLoop> {
6060
}
6161
}
6262

63+
SILFunction *getFunction() const { return getHeader()->getParent(); }
64+
6365
private:
6466
friend class llvm::LoopInfoBase<SILBasicBlock, SILLoop>;
6567

0 commit comments

Comments
 (0)