[LLVMbugs] [Bug 12979] New: gvn replaces an 'add' with an 'add nsw'

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue May 29 07:26:29 PDT 2012


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

             Bug #: 12979
           Summary: gvn replaces an 'add' with an 'add nsw'
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rafael.espindola at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Running gvn in

define i32 @foo(i32 %x, i32 %y) {
  %add1 = add nsw i32 %x, %y
  %add2 = add     i32 %x, %y
  %foo = add i32 %add1, %add2
  ret i32 %foo
}

produces

define i32 @foo(i32 %x, i32 %y) {
  %add1 = add nsw i32 %x, %y
  %foo = add i32 %add1, %add1
  ret i32 %foo
}

note that it replaced an 'add' (add2) with an 'add nsw' (add1).

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