summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-08-16 17:54:36 +0000
committerSanjay Patel <spatel@rotateright.com>2016-08-16 17:54:36 +0000
commita3f4f0828bb791d2b7b396ccc61a95f4b0e76ba6 (patch)
treeddb72e1da1e7f9666527bc83bb324962182acb8d /llvm/lib/Transforms/InstCombine/InstCombineInternal.h
parent5cd57177a51abc7b0bfe18f70566572dbccab9a0 (diff)
downloadbcm5719-llvm-a3f4f0828bb791d2b7b396ccc61a95f4b0e76ba6.tar.gz
bcm5719-llvm-a3f4f0828bb791d2b7b396ccc61a95f4b0e76ba6.zip
[InstCombine] add helper functions for foldICmpWithConstant; NFCI
Besides breaking up a 700 line function to improve readability, this sinks the 'FIXME: ConstantInt' check into each helper. So now we can independently break that restriction within any of the helper functions. As much as possible, the code was only {cut/paste/clang-format}'ed to minimize risk (no functional changes intended), so several more readability improvements are still possible. llvm-svn: 278828
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineInternal.h32
1 files changed, 28 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
index 88c52e2413d..7ce5ac17451 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
+++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h
@@ -548,10 +548,10 @@ private:
ConstantInt *AndCst = nullptr);
Instruction *foldFCmpIntToFPConst(FCmpInst &I, Instruction *LHSI,
Constant *RHSC);
- Instruction *foldICmpDivConst(ICmpInst &ICI, BinaryOperator *DivI,
- ConstantInt *DivRHS);
- Instruction *foldICmpShrConst(ICmpInst &ICI, BinaryOperator *DivI,
- ConstantInt *DivRHS);
+ Instruction *foldICmpDivConstConst(ICmpInst &ICI, BinaryOperator *DivI,
+ ConstantInt *DivRHS);
+ Instruction *foldICmpShrConstConst(ICmpInst &ICI, BinaryOperator *DivI,
+ ConstantInt *DivRHS);
Instruction *foldICmpCstShrConst(ICmpInst &I, Value *Op, Value *A,
ConstantInt *CI1, ConstantInt *CI2);
Instruction *foldICmpCstShlConst(ICmpInst &I, Value *Op, Value *A,
@@ -560,6 +560,30 @@ private:
ICmpInst::Predicate Pred);
Instruction *foldICmpWithCastAndCast(ICmpInst &ICI);
Instruction *foldICmpWithConstant(ICmpInst &ICI);
+
+ Instruction *foldICmpTruncConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpAndConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpXorConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpOrConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpMulConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpShlConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpShrConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpUDivConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpDivConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpSubConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+ Instruction *foldICmpAddConstant(ICmpInst &ICI, Instruction *LHSI,
+ const APInt *RHSV);
+
Instruction *foldICmpEqualityWithConstant(ICmpInst &ICI);
Instruction *foldICmpIntrinsicWithConstant(ICmpInst &ICI);
OpenPOWER on IntegriCloud