<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </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 --- - Vector element count mismatch!"
   href="http://llvm.org/bugs/show_bug.cgi?id=21572">21572</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Vector element count mismatch!
          </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>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Backend: ARM
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>eugeni.stepanov@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat >1.cc
void f (short *pb, float *pf)
{
    for (int i = 0; i < 8; ++i)
      pb[i] = pf[i] * 2;
}

$ clang++ -cc1 -triple armv7--linux-androideabi -emit-obj -O2 -vectorize-slp
1.cc
clang++: ../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:2877: llvm::SDValue
llvm::SelectionDAG::getNode(unsigned int, llvm::SDLoc, llvm::EVT,
llvm::SDValue): Assertion `(!VT.isVector() || VT.getVectorNumElements() ==
Operand.getValueType().getVectorNumElements()) && "Vector element count
mismatch!"' failed.
0  clang++         0x000000000141d1a8 llvm::sys::PrintStackTrace(_IO_FILE*) +
40
1  clang++         0x000000000141e80b
2  libpthread.so.0 0x00007f1c932f2340
3  libc.so.6       0x00007f1c92519bb9 gsignal + 57
4  libc.so.6       0x00007f1c9251cfc8 abort + 328
5  libc.so.6       0x00007f1c92512a76
6  libc.so.6       0x00007f1c92512b22
7  clang++         0x0000000001725206 llvm::SelectionDAG::getNode(unsigned int,
llvm::SDLoc, llvm::EVT, llvm::SDValue) + 11942
8  clang++         0x00000000008a5667
llvm::ARMTargetLowering::PerformDAGCombine(llvm::SDNode*,
llvm::TargetLowering::DAGCombinerInfo&) const + 22791
9  clang++         0x0000000001697c17
10 clang++         0x00000000016972a4
llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AliasAnalysis&,
llvm::CodeGenOpt::Level) + 2324
11 clang++         0x000000000179755e
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 910
12 clang++         0x0000000001796a18
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 8632
13 clang++         0x0000000001793924
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1316
14 clang++         0x000000000085ad46
15 clang++         0x0000000000f1eccc
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 124
16 clang++         0x00000000011468b3
llvm::FPPassManager::runOnFunction(llvm::Function&) + 499
17 clang++         0x0000000001146b2b
llvm::FPPassManager::runOnModule(llvm::Module&) + 43
18 clang++         0x0000000001147087
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 935
19 clang++         0x0000000001844c0d
clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions
const&, clang::TargetOptions const&, clang::LangOptions const&,
llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) +
7517
20 clang++         0x0000000001839c95
21 clang++         0x0000000001dd46f3 clang::ParseAST(clang::Sema&, bool, bool)
+ 483
22 clang++         0x00000000015bcf3e clang::FrontendAction::Execute() + 62
23 clang++         0x000000000158eacc
clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 892
24 clang++         0x0000000001640192
clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 3090
25 clang++         0x00000000006c2ca7 cc1_main(llvm::ArrayRef<char const*>,
char const*, void*) + 679
26 clang++         0x00000000006c1a52 main + 12290
27 libc.so.6       0x00007f1c92504ec5 __libc_start_main + 245
28 clang++         0x00000000006be94b
Stack dump:
0.      Program arguments: /code/llvm/build/bin/clang++ -cc1 -triple
armv7--linux-androideabi -emit-obj -O2 -vectorize-slp 1.ii 
1.      <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module '1.ii'.
4.      Running pass 'ARM Instruction Selection' on function '@_Z1fPsPf'


Bitcode:
# cat >1.ll
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv7--linux-androideabi"

; Function Attrs: nounwind
define void @_Z1fPsPf(i16* nocapture %pb, float* nocapture readonly %pf) #0 {
entry:
  %0 = bitcast float* %pf to <8 x float>*
  %1 = load <8 x float>* %0, align 4
  %2 = fmul <8 x float> %1, <float 2.000000e+00, float 2.000000e+00, float
2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float
2.000000e+00, float 2.000000e+00>
  %3 = fptosi <8 x float> %2 to <8 x i16>
  %4 = bitcast i16* %pb to <8 x i16>*
  store <8 x i16> %3, <8 x i16>* %4, align 2
  ret void
}

attributes #0 = { nounwind "less-precise-fpmad"="false"
"no-frame-pointer-elim"="false" "no-infs-fp-math"="false"
"no-nans-fp-math"="false" "no-realign-stack" "stack-protector-buffer-size"="8"
"unsafe-fp-math"="false" "use-soft-float"="false" }

# llc 1.ll
...
the same error
...</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>