diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp index 21b0e514ef6c..7b772d78f279 100644 --- a/llvm/lib/CodeGen/IntrinsicLowering.cpp +++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp @@ -218,7 +218,7 @@ static Value *LowerCTPOP(Value *V, Instruction *IP) { V = BinaryOperator::createAdd(LHS, RHS, "ctpop.step", IP); } - return V; + return CastInst::createIntegerCast(V, Type::Int32Ty, false, "ctpop", IP); } /// LowerCTLZ - Emit the code to lower ctlz of V before the specified