[PATCH] D154064: [InstructionSimplify] Limit threadCmpOverPHI recursion depth to 1
Dhruv Chawla via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 20 01:50:11 PDT 2023
0xdc03 updated this revision to Diff 542376.
0xdc03 added a comment.
- Change the patch order
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D154064/new/
https://reviews.llvm.org/D154064
Files:
llvm/lib/Analysis/InstructionSimplify.cpp
Index: llvm/lib/Analysis/InstructionSimplify.cpp
===================================================================
--- llvm/lib/Analysis/InstructionSimplify.cpp
+++ llvm/lib/Analysis/InstructionSimplify.cpp
@@ -4011,7 +4011,8 @@
// If the comparison is with the result of a phi instruction, check whether
// doing the compare with each incoming phi value yields a common result.
if (isa<PHINode>(LHS) || isa<PHINode>(RHS))
- if (Value *V = threadCmpOverPHI(Pred, LHS, RHS, Q, MaxRecurse))
+ if (Value *V = threadCmpOverPHI(Pred, LHS, RHS, Q,
+ MaxRecurse > 1 ? 1 : MaxRecurse))
return V;
return nullptr;
@@ -4237,7 +4238,8 @@
// If the comparison is with the result of a phi instruction, check whether
// doing the compare with each incoming phi value yields a common result.
if (isa<PHINode>(LHS) || isa<PHINode>(RHS))
- if (Value *V = threadCmpOverPHI(Pred, LHS, RHS, Q, MaxRecurse))
+ if (Value *V = threadCmpOverPHI(Pred, LHS, RHS, Q,
+ MaxRecurse > 1 ? 1 : MaxRecurse))
return V;
return nullptr;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D154064.542376.patch
Type: text/x-patch
Size: 1127 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/3780ada5/attachment.bin>
More information about the llvm-commits
mailing list