<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - vectorized code produces wrong result after r307036"
   href="https://bugs.llvm.org/show_bug.cgi?id=34919">34919</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>vectorized code produces wrong result after r307036
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>GlobalISel
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>wmi@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, zvi.rackover@intel.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>----------------------- 1.ll ------------------------------
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

declare i32 @printf(i8* nocapture readonly, ...) local_unnamed_addr
@.str = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1

define float @foo(<4 x i1> %t423, <4 x float> %t380) {
  %t424 = select <4 x i1> %t423, <4 x float> zeroinitializer, <4 x float> %t380
  %t427 = extractelement <4 x i1> %t423, i32 0
  %t429 = extractelement <4 x i1> %t423, i32 1
  %t431 = extractelement <4 x i1> %t423, i32 2
  %t438 = extractelement <4 x i1> %t423, i32 3

  %t428 = extractelement <4 x float> %t380, i32 0
  %t432 = extractelement <4 x float> %t380, i32 2

  %t433 = insertelement <2 x i1> undef, i1 %t427, i32 0
  %t434 = insertelement <2 x i1> %t433, i1 %t431, i32 1

  %t435 = insertelement <2 x float> undef, float %t428, i32 0
  %t436 = insertelement <2 x float> %t435, float %t432, i32 1

  %t437 = select <2 x i1> %t434, <2 x float> zeroinitializer, <2 x float> %t436
  %t454 = extractelement <4 x float> %t424, i32 2
  %t455 = extractelement <2 x float> %t437, i32 1
  %t456 = fsub float %t455, %t454
  ret float %t456
}

define void @main() {
  %ret = call float @foo(<4 x i1> <i1 1, i1 0, i1 1, i1 1>, <4 x float> <float
1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00>)
  %conv = fpext float %ret to double
  %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x
i8], [4 x i8]* @.str, i64 0, i64 0), double %conv)
  ret void
}
----------------------------------------------------------------------

~/workarea/llvm-r307035/dbuild/bin/llc -O0 -relocation-model=pic < 1.ll > 1.s
gcc 1.s -o a.out
./a.out
0.000000

~/workarea/llvm-r307036/dbuild/bin/llc -O0 -relocation-model=pic < 1.ll > 1.s
gcc 1.s -o a.out
./a.out
3.000000</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>