[LLVMbugs] [Bug 10534] New: No Opt being performed

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 29 11:29:56 PDT 2011


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

           Summary: No Opt being performed
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Global Analyses
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: dnicacios at yahoo.com.br
                CC: llvmbugs at cs.uiuc.edu


I used opt -std-compile-opts on llvm-2.9 and everything was fine, but on the
trunk version it does not perform some simple optimizations. When I run "opt
-std-compile-opts -debug -S FlipBitRun.bc -o FlipBitRun1.bc", it outputs the
following IR:

while.body:                                       ; preds = %while.body, %entry
  %0 = phi i32 [ 0, %entry ], [ %inc.3, %while.body ]
  %shr = lshr i32 %0, 5
  %rem = and i32 %0, 28
  %shl = shl i32 1, %rem
  %arrayidx = getelementptr inbounds i32* %bitmap, i32 %shr
  %tmp6 = load i32* %arrayidx, align 4
  %xor = xor i32 %tmp6, %shl
  store i32 %xor, i32* %arrayidx, align 4
  %shr.1 = lshr i32 %0, 5
  %inc5 = and i32 %0, 28
  %rem.1 = or i32 %inc5, 1
  %shl.1 = shl i32 1, %rem.1
  %arrayidx.1 = getelementptr inbounds i32* %bitmap, i32 %shr.1
  %tmp6.1 = load i32* %arrayidx.1, align 4
  %xor.1 = xor i32 %tmp6.1, %shl.1
  store i32 %xor.1, i32* %arrayidx.1, align 4
  %shr.2 = lshr i32 %0, 5
  %inc.16 = and i32 %0, 28
  %rem.2 = or i32 %inc.16, 2
  %shl.2 = shl i32 1, %rem.2
  %arrayidx.2 = getelementptr inbounds i32* %bitmap, i32 %shr.2
  %tmp6.2 = load i32* %arrayidx.2, align 4
  %xor.2 = xor i32 %tmp6.2, %shl.2
  store i32 %xor.2, i32* %arrayidx.2, align 4
  %shr.3 = lshr i32 %0, 5
  %inc.27 = and i32 %0, 28
  %rem.3 = or i32 %inc.27, 3
  %shl.3 = shl i32 1, %rem.3
  %arrayidx.3 = getelementptr inbounds i32* %bitmap, i32 %shr.3
  %tmp6.3 = load i32* %arrayidx.3, align 4
  %xor.3 = xor i32 %tmp6.3, %shl.3
  store i32 %xor.3, i32* %arrayidx.3, align 4
  %inc.3 = add i32 %0, 4
  %exitcond.3 = icmp eq i32 %inc.3, 128
  br i1 %exitcond.3, label %while.end, label %while.body

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



clearly, all load, stores should be collapsed into a single one. And identical
instruction are not being eliminated, like "%rem = and i32 %0, 28" and "%inc5 =
and i32 %0, 28".

All those opt were being done successfully on the 2.9 release version, but not
on the trunk version.

-- 
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