diff options
author | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2020-01-13 08:54:38 +0000 |
---|---|---|
committer | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2020-01-13 08:54:38 +0000 |
commit | 07028b5a87803a3a857d6dd6320a0f7de4db23ad (patch) | |
tree | a0f579f4ecd0e249ba8562bef6f7d2d90a73b4b3 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 6d6a4590c5d4c7fc7445d72fe685f966b0a8cafb (diff) | |
download | bcm5719-llvm-07028b5a87803a3a857d6dd6320a0f7de4db23ad.tar.gz bcm5719-llvm-07028b5a87803a3a857d6dd6320a0f7de4db23ad.zip |
[SCEV] Follow up of D71563: addressing post commit comment. NFC.
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 648412a63a0..26a9a5ddf1e 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -4507,17 +4507,6 @@ static Optional<BinaryOp> MatchBinaryOp(Value *V, DominatorTree &DT) { if (!Op) return None; - // Recognise intrinsic loop.decrement.reg, and as this has exactly the same - // semantics as a Sub, return a binary sub expression. - if (auto *II = dyn_cast<IntrinsicInst>(V)) { - switch (II->getIntrinsicID()) { - case Intrinsic::loop_decrement_reg: - return BinaryOp(Instruction::Sub, II->getOperand(0), II->getOperand(1)); - default: - return None; - } - } - // Implementation detail: all the cleverness here should happen without // creating new SCEV expressions -- our caller knowns tricks to avoid creating // SCEV expressions when possible, and we should not break that. @@ -4586,6 +4575,12 @@ static Optional<BinaryOp> MatchBinaryOp(Value *V, DominatorTree &DT) { break; } + // Recognise intrinsic loop.decrement.reg, and as this has exactly the same + // semantics as a Sub, return a binary sub expression. + if (auto *II = dyn_cast<IntrinsicInst>(V)) + if (II->getIntrinsicID() == Intrinsic::loop_decrement_reg) + return BinaryOp(Instruction::Sub, II->getOperand(0), II->getOperand(1)); + return None; } |