Skip to content

"Part type doesn't match vector breakdown!" assertion when mixing SIMD and MIPS #33230

@alexcrichton

Description

@alexcrichton
Bugzilla Link 33883
Resolution FIXED
Resolved on Aug 01, 2017 16:45
Version 5.0
OS All
Blocks #33196
CC @zmodem

Extended Description

In trying to upgrade rust-lang/rust to LLVM 5.0 we've discovered that one of our tests is failing, namely this IR:

; ModuleID = 'simd.cgu-0.rs'
source_filename = "simd.cgu-0.rs"
target datalayout = "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64"
target triple = "mips-unknown-linux-gnu"

; simd::foo
; Function Attrs: uwtable
define <4 x float> @​_ZN4simd3foo17hebb969c5fb39a194E(<4 x float>) unnamed_addr #​0 {
start:
%1 = call <4 x float> @​llvm.sqrt.v4f32(<4 x float> %0)
br label %bb1

bb1: ; preds = %start
ret <4 x float> %1
}

; simd::bar
; Function Attrs: uwtable
define <4 x i32> @​_ZN4simd3bar17hdc8ee07458cf8c7bE(<4 x i32>, <4 x i32>) unnamed_addr #​0 {
start:
%2 = call <4 x i32> @​integer(<4 x i32> %0, <4 x i32> %1)
br label %bb1

bb1: ; preds = %start
ret <4 x i32> %2
}

; Function Attrs: nounwind readnone speculatable
declare <4 x float> @​llvm.sqrt.v4f32(<4 x float>) unnamed_addr #​1

; Function Attrs: nounwind
declare <4 x i32> @​integer(<4 x i32>, <4 x i32>) unnamed_addr #​2

attributes #​0 = { uwtable }
attributes #​1 = { nounwind readnone speculatable }
attributes #​2 = { nounwind }

when compiled with llc -filetype=obj -mtriple=mips-unknown-linux-gnu foo.ll will fail with

llc: /home/alex/code/rust3/src/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:616: void getCopyToPartsVector(llvm::SelectionDAG&, const llvm::SDLoc&, llvm::SDValue, llvm::SDValue*, unsigned int, llvm::MVT, const llvm::Value*, bool): Assertion `RegisterVT == PartVT && "Part type doesn't match vector breakdown!"' failed.

and this stack trace: https://gist.github.com/alexcrichton/4697cc30fdb94c56a480e1d2c2952479

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions