Skip to content

Commit d7580e4

Browse files
committed
Optimizer: move the Value.lookThroughTruncOrBitCast from SimplifyPointerToAddress.swift to OptUtils.swift
1 parent 29541fa commit d7580e4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

SwiftCompilerSources/Sources/Optimizer/InstructionSimplification/SimplifyPointerToAddress.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -293,13 +293,6 @@ private extension Value {
293293
return self
294294
}
295295
}
296-
297-
var lookThroughTruncOrBitCast: Value {
298-
if let truncOrBitCast = self as? BuiltinInst, truncOrBitCast.id == .TruncOrBitCast {
299-
return truncOrBitCast.arguments[0]
300-
}
301-
return self
302-
}
303296
}
304297

305298
private extension BuiltinInst {

SwiftCompilerSources/Sources/Optimizer/Utilities/OptUtils.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ extension Value {
4545
}
4646
}
4747

48+
var lookThroughTruncOrBitCast: Value {
49+
if let truncOrBitCast = self as? BuiltinInst, truncOrBitCast.id == .TruncOrBitCast {
50+
return truncOrBitCast.arguments[0]
51+
}
52+
return self
53+
}
54+
4855
func isInLexicalLiverange(_ context: some Context) -> Bool {
4956
var worklist = ValueWorklist(context)
5057
defer { worklist.deinitialize() }

0 commit comments

Comments
 (0)