summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/InstructionSimplify.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-07-21 21:56:00 +0000
committerSanjay Patel <spatel@rotateright.com>2016-07-21 21:56:00 +0000
commite9fc79bb13e833644548416f5aece0571f8c175d (patch)
tree1a39c712fa82f497e5f60e60611b785610a0b141 /llvm/lib/Analysis/InstructionSimplify.cpp
parentb8d2873d93c1e40d99fae9c25505246f3815c0d7 (diff)
downloadbcm5719-llvm-e9fc79bb13e833644548416f5aece0571f8c175d.tar.gz
bcm5719-llvm-e9fc79bb13e833644548416f5aece0571f8c175d.zip
[InstSimplify] don't crash handling a pointer or aggregate type
llvm-svn: 276345
Diffstat (limited to 'llvm/lib/Analysis/InstructionSimplify.cpp')
-rw-r--r--llvm/lib/Analysis/InstructionSimplify.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp
index 7e4148ca4d2..c7e1724ac9b 100644
--- a/llvm/lib/Analysis/InstructionSimplify.cpp
+++ b/llvm/lib/Analysis/InstructionSimplify.cpp
@@ -3412,6 +3412,9 @@ static Value *simplifySelectWithFakeICmpEq(Value *CmpLHS, Value *TrueVal,
Value *FalseVal,
bool TrueWhenUnset) {
unsigned BitWidth = TrueVal->getType()->getScalarSizeInBits();
+ if (!BitWidth)
+ return nullptr;
+
APInt MinSignedValue;
Value *X;
if (match(CmpLHS, m_Trunc(m_Value(X))) && (X == TrueVal || X == FalseVal)) {
OpenPOWER on IntegriCloud