[PATCH] D60656: [LVI][CVP] Calculate with.overflow result range
Philip Reames via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 22 09:54:28 PDT 2019
reames accepted this revision.
reames added a comment.
Also, LGTM
================
Comment at: llvm/lib/Analysis/LazyValueInfo.cpp:1083
+ ValueLatticeElement &BBLV, WithOverflowInst *WO, BasicBlock *BB) {
+ Optional<ConstantRange> LHSRes = getRangeForOperand(0, WO, BB);
+ Optional<ConstantRange> RHSRes = getRangeForOperand(1, WO, BB);
----------------
If I'm putting this together correctly, you don't need the filter clause from the actual binary operator version under the assumption that all of the overflowing binary operators are supported right? If so, that probably warrants a comment.
================
Comment at: llvm/lib/Analysis/LazyValueInfo.cpp:1092
+ Instruction::BinaryOps BinOp = WO->getBinaryOp();
+ BBLV = ValueLatticeElement::getRange(LHSRange.binaryOp(BinOp, RHSRange));
+ return true;
----------------
This (correctly) only handles one of two outputs for the overflow inst. Are you planning on adding support for the other? Just curious.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60656/new/
https://reviews.llvm.org/D60656
More information about the llvm-commits
mailing list