From dc1966e6bac9d323e18db2e18d955885e0edd702 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 2 Apr 2007 01:01:49 +0000 Subject: [PATCH] For PR1297: Make sure that the CTPOP result is casted to i32 as the bit counting intrinsics all return i32 now (this affects CTLZ and CTTZ as well). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35567 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/IntrinsicLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 21b0e514ef6..7b772d78f27 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/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