diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-09-15 21:35:30 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-09-15 21:35:30 +0000 |
commit | af91d1f81e8e407c5bad925067981fc6f770efa1 (patch) | |
tree | 467f190a5bfc52c48c8bd8652d008710b5772a64 /llvm/lib/Transforms/InstCombine/InstCombineInternal.h | |
parent | aa9f1c59d2700629c4619d5d4e30e309de6fe4e5 (diff) | |
download | bcm5719-llvm-af91d1f81e8e407c5bad925067981fc6f770efa1.tar.gz bcm5719-llvm-af91d1f81e8e407c5bad925067981fc6f770efa1.zip |
[InstCombine] allow icmp (shr/shl) folds for vectors
These 2 helper functions were already using APInt internally, so just
change the API and caller to allow folds for splats. The scalar
regression tests look quite thorough, so I just added a couple of
tests to prove that vectors are handled too.
These folds should be grouped with the other cmp+shift folds though.
That can be an NFC follow-up.
llvm-svn: 281663
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineInternal.h')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineInternal.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h index 5b256cd9912..d2149392cb8 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineInternal.h +++ b/llvm/lib/Transforms/InstCombine/InstCombineInternal.h @@ -549,9 +549,9 @@ private: Instruction *foldFCmpIntToFPConst(FCmpInst &I, Instruction *LHSI, Constant *RHSC); Instruction *foldICmpCstShrConst(ICmpInst &I, Value *Op, Value *A, - ConstantInt *CI1, ConstantInt *CI2); + const APInt &C1, const APInt &C2); Instruction *foldICmpCstShlConst(ICmpInst &I, Value *Op, Value *A, - ConstantInt *CI1, ConstantInt *CI2); + const APInt &C1, const APInt &C2); Instruction *foldICmpAddOpConst(Instruction &ICI, Value *X, ConstantInt *CI, ICmpInst::Predicate Pred); Instruction *foldICmpWithCastAndCast(ICmpInst &ICI); |