[llvm] r302436 - [InstCombine/InstSimplify] add comments about code duplication; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Mon May 8 09:21:55 PDT 2017
Author: spatel
Date: Mon May 8 11:21:55 2017
New Revision: 302436
URL: http://llvm.org/viewvc/llvm-project?rev=302436&view=rev
Log:
[InstCombine/InstSimplify] add comments about code duplication; NFC
Modified:
llvm/trunk/lib/Analysis/InstructionSimplify.cpp
llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
Modified: llvm/trunk/lib/Analysis/InstructionSimplify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InstructionSimplify.cpp?rev=302436&r1=302435&r2=302436&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InstructionSimplify.cpp (original)
+++ llvm/trunk/lib/Analysis/InstructionSimplify.cpp Mon May 8 11:21:55 2017
@@ -2535,6 +2535,9 @@ static Value *simplifyICmpWithConstant(C
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) {
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=302436&r1=302435&r2=302436&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Mon May 8 11:21:55 2017
@@ -2785,6 +2785,9 @@ Instruction *InstCombiner::foldICmpInstW
}
/// 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);
More information about the llvm-commits
mailing list