[LLVMbugs] [Bug 1810] New: Scalar evolution incorrectly handles Or instruction

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Nov 18 05:50:10 PST 2007


           Summary: Scalar evolution incorrectly handles Or instruction
           Product: new-bugs
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: miscompilation
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: wmatyjewicz at fastmail.fm
                CC: llvmbugs at cs.uiuc.edu

Given the following code:

define void @fun() {
        br label %header
        %i = phi i32 [ 1, %entry ], [ %i.next, %body ]
        %cond = icmp eq i32 %i, 10
        br i1 %cond, label %exit, label %body
        %a = mul i32 %i, 5
        %b = or i32 %a, 1
        %i.next = add i32 %i, 1
        br label %header
        ret void

scalar evolution pass (opt -analyze -scalar-evolution) produces incorrect chrec
for %b:
  %a = mul i32 %i, 5   
--> { 5,+, 5}<header>
  %b = or i32 %a, 1
--> { 6,+, 5}<header>
It is incorrect, because at the first iteration %b should be assigned 5, not 6.

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