[LLVMbugs] [Bug 19183] New: can't delete empty, terminating, strided loop

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 18 15:40:11 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19183

            Bug ID: 19183
           Summary: can't delete empty, terminating, strided loop
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: richard-llvm at metafoo.co.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

We can't delete the trivial terminating empty loop in this code:

void f(unsigned k) {
  for (unsigned n = 0; n != (k & -32); n += 32) {
  }
}

The above results in this IR at -O3:

define void @_Z1fj(i32 %k) #0 {
entry:
  %and = and i32 %k, -32
  br label %for.cond

for.cond:                                         ; preds = %for.cond, %entry
  %n.0 = phi i32 [ 0, %entry ], [ %add, %for.cond ]
  %cmp = icmp eq i32 %n.0, %and
  %add = add i32 %n.0, 32
  br i1 %cmp, label %for.end, label %for.cond

for.end:                                          ; preds = %for.cond
  ret void
}

Such loop structures are created by the vectorizer.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140318/631565d1/attachment.html>


More information about the llvm-bugs mailing list