[llvm-bugs] [Bug 37879] New: Folding i64 scalar masking breaks isel

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 20 06:56:37 PDT 2018


            Bug ID: 37879
           Summary: Folding i64 scalar masking breaks isel
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
          Assignee: unassignedbugs at nondot.org
          Reporter: mikhail.dvoretckii at intel.com
                CC: llvm-bugs at lists.llvm.org

The following LLVM IR fails to compile with any optimizations on:

target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: norecurse nounwind readonly uwtable
define double @foo(i32** nocapture readonly) #0 {
  %2 = load i64, i64* undef, align 8
  %3 = and i64 %2, 1
  %4 = icmp eq i64 %3, 0
  %5 = sitofp i64 %2 to double
  %6 = select i1 %4, double 1.000000e+00, double %5
  ret double %6

attributes #0 = { "target-features"="+avx512bw" }

The "and 1/icmp 0" expression for scalar masking is folded by the code
introduced in D45203. This code has checks to ensure that the scalar_to_vector
DAG node is not connected to an i16 input, but doesn't have the equivalent
check against i64 inputs.

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/20180620/cf6305e5/attachment.html>

More information about the llvm-bugs mailing list