From 00d04e85f7215a10dc339aeb1e0c423c63c9dfff Mon Sep 17 00:00:00 2001 From: David Bolvansky Date: Fri, 12 Jul 2019 21:14:21 +0000 Subject: [PATCH] [InstCombine] Disable fold from D64285 for non-integer types git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365959 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/InstCombine/InstCombineSelect.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Transforms/InstCombine/InstCombineSelect.cpp b/lib/Transforms/InstCombine/InstCombineSelect.cpp index 1184a1be826..aefaf5af175 100644 --- a/lib/Transforms/InstCombine/InstCombineSelect.cpp +++ b/lib/Transforms/InstCombine/InstCombineSelect.cpp @@ -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(); -- 2.40.0