Skip to content

Commit 4d8a564

Browse files
Address reviewer's comments made on Oct 21st, 2nd part.
1 parent 60777d5 commit 4d8a564

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

llvm/lib/Analysis/InstructionSimplify.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4866,9 +4866,9 @@ static Value *simplifySelectWithFCmp(Value *Cond, Value *T, Value *F,
48664866
return nullptr;
48674867
}
48684868

4869-
/// Look for the following pattern and simplify %1 to %identicalPhi.
4870-
/// Here %phi, %1 and %phi.next perform the same functionality as
4871-
/// %identicalPhi and hence the select instruction %1 can be folded
4869+
/// Look for the following pattern and simplify %to_fold to %identicalPhi.
4870+
/// Here %phi, %to_fold and %phi.next perform the same functionality as
4871+
/// %identicalPhi and hence the select instruction %to_fold can be folded
48724872
/// into %identicalPhi.
48734873
///
48744874
/// BB1:
@@ -4877,9 +4877,9 @@ static Value *simplifySelectWithFCmp(Value *Cond, Value *T, Value *F,
48774877
/// ...
48784878
/// %identicalPhi.next = select %cmp, %val, %identicalPhi
48794879
/// (or select %cmp, %identicalPhi, %val)
4880-
/// %1 = select %cmp2, %identicalPhi, %phi
4881-
/// %phi.next = select %cmp, %val, %1
4882-
/// (or select %cmp, %1, %val)
4880+
/// %to_fold = select %cmp2, %identicalPhi, %phi
4881+
/// %phi.next = select %cmp, %val, %to_fold
4882+
/// (or select %cmp, %to_fold, %val)
48834883
///
48844884
/// Prove that %phi and %identicalPhi are the same by induction:
48854885
///
@@ -4888,11 +4888,11 @@ static Value *simplifySelectWithFCmp(Value *Cond, Value *T, Value *F,
48884888
/// Suppose %phi and %identicalPhi are equal at iteration i.
48894889
/// We look at their values at iteration i+1 which are %phi.next and
48904890
/// %identicalPhi.next. They would have become different only when %cmp is
4891-
/// false and the corresponding values %1 and %identicalPhi differ
4891+
/// false and the corresponding values %to_fold and %identicalPhi differ
48924892
/// (similar reason for the other "or" case in the bracket).
48934893
///
4894-
/// The only condition when %1 and %identicalPh could differ is when %cmp2
4895-
/// is false and %1 is %phi, which contradicts our inductive hypothesis
4894+
/// The only condition when %to_fold and %identicalPh could differ is when %cmp2
4895+
/// is false and %to_fold is %phi, which contradicts our inductive hypothesis
48964896
/// that %phi and %identicalPhi are equal. Thus %phi and %identicalPhi are
48974897
/// always equal at iteration i+1.
48984898
bool isSimplifierIdenticalPHI(PHINode &PN, PHINode &IdenticalPN) {
@@ -4937,8 +4937,8 @@ bool isSimplifierIdenticalPHI(PHINode &PN, PHINode &IdenticalPN) {
49374937
return false;
49384938
}
49394939

4940-
// Now check that the other values in select, i.e., %1 and %identicalPhi,
4941-
// are essentially the same value within the same BB.
4940+
// Now check that the other values in select, i.e., %to_fold and
4941+
// %identicalPhi, are essentially the same value.
49424942
if (!SIOtherVal || IdenticalSIOtherVal != &IdenticalPN)
49434943
return false;
49444944
if (!(SIOtherVal->getTrueValue() == &IdenticalPN &&

0 commit comments

Comments
 (0)