Fix this recently moved code to use the correct type. CI is now a
ConstantInt, and SI is the original cast instruction. This fixes
PR2996.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58549 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp
index 70b5aef..75a1ffe 100644
--- a/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -8551,8 +8551,8 @@
In = InsertNewInstBefore(BinaryOperator::CreateAShr(In, Sh,
In->getName()+".lobit"),
*ICI);
- if (In->getType() != CI->getType())
- In = CastInst::CreateIntegerCast(In, CI->getType(),
+ if (In->getType() != SI.getType())
+ In = CastInst::CreateIntegerCast(In, SI.getType(),
true/*SExt*/, "tmp", ICI);
if (Pred == ICmpInst::ICMP_SGT)