[LLVMbugs] [Bug 21611] New: Reassociate: nsw/nuw dropped when merging add into mul

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Nov 19 22:41:56 PST 2014


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

            Bug ID: 21611
           Summary: Reassociate: nsw/nuw dropped when merging add into mul
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: david.majnemer at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

consider:
define i32 @triple_i(i32 %x) {
  %1 = add nsw i32 %x, %x
  %2 = add nsw i32 %1, %x
  ret i32 %2
}

after running with opt -reassociate:
define i32 @triple_i(i32 %x) {
  %factor = mul i32 %x, 3
  ret i32 %factor
}

-- 
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/20141120/852e50dc/attachment.html>


More information about the llvm-bugs mailing list