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

           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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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


%0 = type { i64, i1 }

define i64 @add(i64 %a, i64 %b) nounwind ssp {
entry:
  %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
  unreachable

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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to