[InstCombine/InstSimplify] add comments about code duplication; NFC
authorSanjay Patel <spatel@rotateright.com>
Mon, 8 May 2017 16:21:55 +0000 (16:21 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 8 May 2017 16:21:55 +0000 (16:21 +0000)
llvm-svn: 302436

llvm/lib/Analysis/InstructionSimplify.cpp
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

index 4e7f2eb..66a1e74 100644 (file)
@@ -2535,6 +2535,9 @@ static Value *simplifyICmpWithConstant(CmpInst::Predicate Pred, Value *LHS,
   return nullptr;
 }
 
+/// TODO: A large part of this logic is duplicated in InstCombine's
+/// foldICmpBinOp(). We should be able to share that and avoid the code
+/// duplication.
 static Value *simplifyICmpWithBinOp(CmpInst::Predicate Pred, Value *LHS,
                                     Value *RHS, const SimplifyQuery &Q,
                                     unsigned MaxRecurse) {
index 34ce235..d71d0c1 100644 (file)
@@ -2785,6 +2785,9 @@ Instruction *InstCombiner::foldICmpInstWithConstantNotInt(ICmpInst &I) {
 }
 
 /// Try to fold icmp (binop), X or icmp X, (binop).
+/// TODO: A large part of this logic is duplicated in InstSimplify's
+/// simplifyICmpWithBinOp(). We should be able to share that and avoid the code
+/// duplication.
 Instruction *InstCombiner::foldICmpBinOp(ICmpInst &I) {
   Value *Op0 = I.getOperand(0), *Op1 = I.getOperand(1);