[llvm-commits] [llvm] r168931 - in /llvm/trunk: include/llvm/Target/TargetTransformImpl.h include/llvm/TargetTransformInfo.h lib/Target/X86/X86ISelLowering.cpp lib/Target/X86/X86ISelLowering.h lib/Target/X86/X86TargetMachine.h lib/Transforms/Scalar/LoopIdiomRecognize.cpp test/Transforms/LoopIdiom/popcnt.ll

Chandler Carruth chandlerc at google.com
Sat Dec 8 13:30:25 PST 2012


On Fri, Dec 7, 2012 at 8:17 PM, Shuxin Yang <shuxin.llvm at gmail.com> wrote:

>  Hi, Chandler:
>
>   Thank you for pointing out the problem. Yes, the "&&" should be replaced
> with "||".
> I will commit the fix after some tests.  I don't feel like to include a
> testing case for
> such inadvertent bug.
>

No, it is really important that we include just such test cases. See
Duncan's email.


You also ignored the other bug I pointed out. It only required changing two
lines of one your test cases to reproduce the crash:

define i32 @popcount(i64 %a, i32 %b) nounwind uwtable readnone ssp {
entry:
  %tobool3 = icmp eq i64 %a, 0
  br i1 %tobool3, label %while.end, label %while.body

while.body:                                       ; preds = %entry,
%while.body
  %c.05 = phi i32 [ %inc, %while.body ], [ %b, %entry ]
  %a.addr.04 = phi i64 [ %and, %while.body ], [ %a, %entry ]
  %inc = add nsw i32 %c.05, 1
  %sub = add i64 %a.addr.04, -1
  %and = and i64 %sub, %a.addr.04
  %tobool = icmp eq i64 %and, 0
  br i1 %tobool, label %while.end, label %while.body

while.end:                                        ; preds = %while.body,
%entry
  %c.0.lcssa = phi i32 [ 0, %entry ], [ %inc, %while.body ]
  ret i32 %c.0.lcssa
}

I'm going to revert this patch while you fix it so that I can compile code
again targeting corei7.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121208/f179f293/attachment.html>


More information about the llvm-commits mailing list