Skip to content

Commit 3ef1bf6

Browse files
author
v01dxyz
committed
[SCEV] visitAndClearUsers support WithOverflowInst more simply
1 parent 612b1cd commit 3ef1bf6

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8412,34 +8412,8 @@ void ScalarEvolution::visitAndClearUsers(
84128412
SmallVectorImpl<const SCEV *> &ToForget) {
84138413
while (!Worklist.empty()) {
84148414
Instruction *I = Worklist.pop_back_val();
8415-
if (!isSCEVable(I->getType())) {
8416-
// detect if a user is matching the pattern
8417-
// extractvalue 0, (with-overflow-inst op1, op2))
8418-
auto *WO = dyn_cast<WithOverflowInst>(I);
8419-
if (!WO)
8420-
continue;
8421-
8422-
for (auto *WOUser : WO->users()) {
8423-
auto *EVO = dyn_cast<ExtractValueInst>(WOUser);
8424-
8425-
if (!EVO)
8426-
continue;
8427-
8428-
if (EVO->getNumIndices() != 1 || EVO->getIndices()[0] != 0)
8429-
continue;
8430-
8431-
ValueExprMapType::iterator It =
8432-
ValueExprMap.find_as(static_cast<Value *>(EVO));
8433-
if (It != ValueExprMap.end()) {
8434-
eraseValueFromMap(It->first);
8435-
ToForget.push_back(It->second);
8436-
}
8437-
8438-
PushDefUseChildren(EVO, Worklist, Visited);
8439-
}
8440-
8415+
if (!isSCEVable(I->getType()) && !isa<WithOverflowInst>(I))
84418416
continue;
8442-
}
84438417

84448418
ValueExprMapType::iterator It =
84458419
ValueExprMap.find_as(static_cast<Value *>(I));

0 commit comments

Comments
 (0)