<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 - DAGCombiner doesn't check legality for merging stores with noimplicitfloat"
   href="https://bugs.llvm.org/show_bug.cgi?id=40294">40294</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>DAGCombiner doesn't check legality for merging stores with noimplicitfloat
          </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>All
          </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>Common Code Generator Code
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>nemanja.i.ibm@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This can be reproduced as follows:
$ cat a.ll 
define dso_local void @test(i64* nocapture %arr1) local_unnamed_addr #0 {
entry:
  %arrayidx = getelementptr inbounds i64, i64* %arr1, i64 2
  %0 = load i64, i64* %arrayidx, align 8
  store i64 %0, i64* %arr1, align 8
  %arrayidx2 = getelementptr inbounds i64, i64* %arr1, i64 3
  %1 = load i64, i64* %arrayidx2, align 8
  %arrayidx3 = getelementptr inbounds i64, i64* %arr1, i64 1
  store i64 %1, i64* %arrayidx3, align 8
  ret void
}

attributes #0 = { noimplicitfloat }

$ llc a.ll -mtriple=powerpc64le-unknown-unknown
llc:
/home/nemanjai/llvm/llvm-clean/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:970:
void {anonymous}::SelectionDAGLegalize::LegalizeOp(llvm::SDNode*): Assertion
`(TLI.getTypeAction(*DAG.getContext(), Op.getValueType()) ==
TargetLowering::TypeLegal || TLI.isTypeLegal(Op.getValueType()) ||
Op.getOpcode() == ISD::TargetConstant || Op.getOpcode() == ISD::Register) &&
"Unexpected illegal type!"' failed.


The problem is that PPC does not override
TargetLowering::mergeStoresAfterLegalization() and the merging will produce an
i128 which isn't legal.
It will of course produce it prior to legalization as well, but the legalizer
will undo that, the problem is after legalization.

Note that without the noimplicitfloat attribute, things work because using
vectors is allowed and then it will find a corresponding vector type.</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>