[llvm-bugs] [Bug 36305] New: [DAGCombine] Difference in behaviour for SDIV undef, %X on scalar and vector types

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Feb 8 11:15:09 PST 2018


https://bugs.llvm.org/show_bug.cgi?id=36305

            Bug ID: 36305
           Summary: [DAGCombine] Difference in behaviour for SDIV undef,
                    %X on scalar and vector types
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: llvm-bugs at lists.llvm.org, spatel+llvm at rotateright.com

llvm\test\CodeGen\X86\combine-sdiv.ll

; fold (sdiv undef, x) -> 0
define i32 @combine_sdiv_undef0(i32 %x) {
; CHECK-LABEL: combine_sdiv_undef0:
; CHECK:       # %bb.0:
; CHECK-NEXT:    xorl %eax, %eax
; CHECK-NEXT:    retq
  %1 = sdiv i32 undef, %x
  ret i32 %1
}

define <4 x i32> @combine_vec_sdiv_undef0(<4 x i32> %x) {
; CHECK-LABEL: combine_vec_sdiv_undef0:
; CHECK:       # %bb.0:
; CHECK-NEXT:    retq
  %1 = sdiv <4 x i32> undef, %x
  ret <4 x i32> %1
}

Scalar divisions by undef combine to zero, while vectors combine to undef.

Similar behaviour for udiv, srem, urem.

-- 
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/20180208/ceeee682/attachment.html>


More information about the llvm-bugs mailing list