[llvm] [ObjectSizeOffsetVisitor] Bail after visiting 100 instructions (PR #67479)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 26 14:14:25 PDT 2023
================
@@ -729,13 +742,16 @@ SizeOffsetType ObjectSizeOffsetVisitor::compute(Value *V) {
SOT.second.getBitWidth() > 1 ? SOT.second + Offset : SOT.second};
}
-SizeOffsetType ObjectSizeOffsetVisitor::computeImpl(Value *V) {
+SizeOffsetType ObjectSizeOffsetVisitor::computeValue(Value *V) {
if (Instruction *I = dyn_cast<Instruction>(V)) {
// If we have already seen this instruction, bail out. Cycles can happen in
// unreachable code after constant propagation.
auto P = SeenInsts.try_emplace(I, unknown());
if (!P.second)
return P.first->second;
+ ++InstructionsVisited;
+ if (InstructionsVisited > ObjectSizeOffsetVisitorMaxVisitInstructions)
----------------
nikic wrote:
Could check `SeenInsts.count()` instead of a separate variable here?
https://github.com/llvm/llvm-project/pull/67479
More information about the llvm-commits
mailing list