Skip to content

Commit 3a27268

Browse files
committed
[InstCombine] Address review comments.
1 parent 3b13bda commit 3a27268

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,8 +1014,9 @@ Value *InstCombinerImpl::simplifyNonNullOperand(Value *V,
10141014
if (auto *PHI = dyn_cast<PHINode>(V)) {
10151015
bool Changed = false;
10161016
for (Use &U : PHI->incoming_values()) {
1017-
if (auto *Res =
1018-
simplifyNonNullOperand(U.get(), HasDereferenceable, Depth + 1)) {
1017+
// We set Depth to RecursionLimit to avoid expensive recursion.
1018+
if (auto *Res = simplifyNonNullOperand(U.get(), HasDereferenceable,
1019+
RecursionLimit)) {
10191020
replaceUse(U, Res);
10201021
Changed = true;
10211022
}

0 commit comments

Comments
 (0)