Skip to content

Commit 07028b5

Browse files
author
Sjoerd Meijer
committed
[SCEV] Follow up of D71563: addressing post commit comment. NFC.
1 parent 6d6a459 commit 07028b5

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

llvm/lib/Analysis/ScalarEvolution.cpp

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4507,17 +4507,6 @@ static Optional<BinaryOp> MatchBinaryOp(Value *V, DominatorTree &DT) {
45074507
if (!Op)
45084508
return None;
45094509

4510-
// Recognise intrinsic loop.decrement.reg, and as this has exactly the same
4511-
// semantics as a Sub, return a binary sub expression.
4512-
if (auto *II = dyn_cast<IntrinsicInst>(V)) {
4513-
switch (II->getIntrinsicID()) {
4514-
case Intrinsic::loop_decrement_reg:
4515-
return BinaryOp(Instruction::Sub, II->getOperand(0), II->getOperand(1));
4516-
default:
4517-
return None;
4518-
}
4519-
}
4520-
45214510
// Implementation detail: all the cleverness here should happen without
45224511
// creating new SCEV expressions -- our caller knowns tricks to avoid creating
45234512
// SCEV expressions when possible, and we should not break that.
@@ -4586,6 +4575,12 @@ static Optional<BinaryOp> MatchBinaryOp(Value *V, DominatorTree &DT) {
45864575
break;
45874576
}
45884577

4578+
// Recognise intrinsic loop.decrement.reg, and as this has exactly the same
4579+
// semantics as a Sub, return a binary sub expression.
4580+
if (auto *II = dyn_cast<IntrinsicInst>(V))
4581+
if (II->getIntrinsicID() == Intrinsic::loop_decrement_reg)
4582+
return BinaryOp(Instruction::Sub, II->getOperand(0), II->getOperand(1));
4583+
45894584
return None;
45904585
}
45914586

0 commit comments

Comments
 (0)