]> granicus.if.org Git - llvm/commitdiff
[InstCombine] Disable fold from D64285 for non-integer types
authorDavid Bolvansky <david.bolvansky@gmail.com>
Fri, 12 Jul 2019 21:14:21 +0000 (21:14 +0000)
committerDavid Bolvansky <david.bolvansky@gmail.com>
Fri, 12 Jul 2019 21:14:21 +0000 (21:14 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365959 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/InstCombine/InstCombineSelect.cpp

index 1184a1be82633ebb2ac4cd7502b2e28a4b8910d2..aefaf5af17507d7bb12077cccfcf469c9b3c0355 100644 (file)
@@ -542,6 +542,8 @@ static Value *foldSelectICmpLshrAshr(const ICmpInst *IC, Value *TrueVal,
   ICmpInst::Predicate Pred = IC->getPredicate();
   Value *CmpLHS = IC->getOperand(0);
   Value *CmpRHS = IC->getOperand(1);
+  if (!CmpRHS->getType()->isIntOrIntVectorTy())
+    return nullptr;
 
   Value *X, *Y;
   unsigned Bitwidth = CmpRHS->getType()->getScalarSizeInBits();