From 45d183ccf01f6f796ff9adc76b4f3871a011335a Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 17 Jan 2011 18:00:28 +0000 Subject: Fix an off-by-one error in ctpop combining. llvm-svn: 123664 --- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 1621d61..514f175 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -1876,7 +1876,7 @@ TargetLowering::SimplifySetCC(EVT VT, SDValue N0, SDValue N1, CTPOP = N0.getOperand(0); if (CTPOP.hasOneUse() && CTPOP.getOpcode() == ISD::CTPOP && - (N0 == CTPOP || N0.getValueType().getSizeInBits() >= + (N0 == CTPOP || N0.getValueType().getSizeInBits() > Log2_32_Ceil(CTPOP.getValueType().getSizeInBits()))) { EVT CTVT = CTPOP.getValueType(); SDValue CTOp = CTPOP.getOperand(0); -- cgit v1.1