[LLVMbugs] [Bug 8817] New: GVN should CSE llvm.uadd/llvm.sadd with add

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sun Dec 19 11:14:44 PST 2010


           Summary: GVN should CSE llvm.uadd/llvm.sadd with add
           Product: libraries
           Version: 1.0
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu

GVN should replace "add5" with uadd's 0th value:

%0 = type { i64, i1 }

define i64 @add(i64 %a, i64 %b) nounwind ssp {
  %uadd = tail call %0 @llvm.uadd.with.overflow.i64(i64 %a, i64 %b)
  %cmp = extractvalue %0 %uadd, 1
  br i1 %cmp, label %if.then, label %if.end

if.then:                                          ; preds = %entry
  tail call void @exit(i32 0) noreturn nounwind

if.end:                                           ; preds = %entry
  %add5 = add i64 %b, %a
  ret i64 %add5

declare void @exit(i32) noreturn

declare %0 @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone

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