[LLVMbugs] [Bug 10534] LoopUnroll not keeping induction variable canonical in result loop

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 9 21:35:01 PDT 2011


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

Andrew Trick <atrick at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #22 from Andrew Trick <atrick at apple.com> 2011-08-09 23:35:00 CDT ---
Fixed in r137203.

LoopUnroll now calls SimplifyIndvar to cleanup after itself.
Note: The complete fix currently requires -disable-iv-rewrite. But that will be
the default mode in a matter of weeks, and the test case requires a nondefault
flag anyway.

opt -O3 -S FlipBitRun.bc -unroll-count=4 -disable-iv-rewrite


define void @FlipBitRun(i32* nocapture %bitmap, i32 %bit_addr, i32 %nbits)
nounwind {
entry:
  br label %while.body.3

while.end:                                        ; preds = %while.body.3
  ret void

while.body.3:                                     ; preds = %entry,
%while.body.3
  %nbits.addr.02 = phi i32 [ 128, %entry ], [ %dec.3, %while.body.3 ]
  %bit_addr.addr.01 = phi i32 [ 0, %entry ], [ %inc.3, %while.body.3 ]
  %shr = lshr i32 %bit_addr.addr.01, 5
  %rem = and i32 %bit_addr.addr.01, 28
  %shl = shl i32 1, %rem
  %arrayidx = getelementptr inbounds i32* %bitmap, i32 %shr
  %tmp6 = load i32* %arrayidx, align 4
  %xor = xor i32 %tmp6, %shl
  %inc3 = and i32 %bit_addr.addr.01, 28
  %rem.1 = or i32 %inc3, 1
  %shl.1 = shl i32 1, %rem.1
  %xor.1 = xor i32 %xor, %shl.1
  %inc.14 = and i32 %bit_addr.addr.01, 28
  %rem.2 = or i32 %inc.14, 2
  %shl.2 = shl i32 1, %rem.2
  %xor.2 = xor i32 %xor.1, %shl.2
  %dec.3 = add i32 %nbits.addr.02, -4
  %inc.25 = and i32 %bit_addr.addr.01, 28
  %rem.3 = or i32 %inc.25, 3
  %shl.3 = shl i32 1, %rem.3
  %xor.3 = xor i32 %xor.2, %shl.3
  store i32 %xor.3, i32* %arrayidx, align 4
  %inc.3 = add i32 %bit_addr.addr.01, 4
  %tobool.3 = icmp eq i32 %dec.3, 0
  br i1 %tobool.3, label %while.end, label %while.body.3

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list