Skip to content

Commit f151a96

Browse files
committed
Add a comment on replaceUsesOfExtract per review feedback.
1 parent 9447d73 commit f151a96

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/SILOptimizer/Utils/CanonicalizeInstruction.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,15 @@ simplifyAndReplace(SILInstruction *inst, CanonicalizeInstruction &pass) {
110110
// Canonicalize Memory Operations
111111
//===----------------------------------------------------------------------===//
112112

113-
// Replace all uses of an original struct or tuple extract instruction, with the
113+
// Replace all uses of an original struct or tuple extract instruction with the
114114
// given load instruction. The caller ensures that the load only loads the
115115
// extracted field.
116+
//
117+
// \p extract has the form:
118+
// (struct_extract (load %base), #field)
119+
//
120+
// \p loadInst has the form:
121+
// (load (struct_element_addr %base, #field)
116122
static void replaceUsesOfExtract(SingleValueInstruction *extract,
117123
LoadInst *loadInst,
118124
CanonicalizeInstruction &pass) {

0 commit comments

Comments
 (0)