diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-07-20 23:40:01 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-07-20 23:40:01 +0000 |
commit | 5f3c70307d7e195b802048a04e8c33c8b2ff6a50 (patch) | |
tree | ba8df2af9a032b241979c5741d47d76a4879eb3f /llvm/lib/Transforms | |
parent | 192c4f1a4a129ae769577c23182352e8dd1ad62b (diff) | |
download | bcm5719-llvm-5f3c70307d7e195b802048a04e8c33c8b2ff6a50.tar.gz bcm5719-llvm-5f3c70307d7e195b802048a04e8c33c8b2ff6a50.zip |
[InstSimplify][InstCombine] don't crash when folding vector selects of icmp
Differential Revision: https://reviews.llvm.org/D22602
llvm-svn: 276209
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp index d7eed790e2a..8f1ff8ac0e6 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -553,8 +553,11 @@ Instruction *InstCombiner::visitSelectInstWithICmp(SelectInst &SI, } } + // FIXME: This code is nearly duplicated in InstSimplify. Using/refactoring + // decomposeBitTestICmp() might help. { - unsigned BitWidth = DL.getTypeSizeInBits(TrueVal->getType()); + unsigned BitWidth = + DL.getTypeSizeInBits(TrueVal->getType()->getScalarType()); APInt MinSignedValue = APInt::getSignBit(BitWidth); Value *X; const APInt *Y, *C; |