From fad9bd6b92ba9abd71d4112cb5161780cd5d7ce8 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Mon, 2 Apr 2007 01:01:49 +0000 Subject: 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). llvm-svn: 35567 --- llvm/lib/CodeGen/IntrinsicLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib') diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp index 21b0e514ef6..7b772d78f27 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 -- cgit v1.2.3