mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 04:02:41 +01:00
4a18d9e5d2
happily accept things like "sext <2 x i32> to <999 x i64>". It would also accept "sext <2 x i32> to i64", though the verifier would catch that later. Fixed by having castIsValid check that vector lengths match except when doing a bitcast. (2) When creating a cast instruction, check that the cast is valid (this was already done when creating constexpr casts). While there, replace getScalarSizeInBits (used to allow more vector casts) with getPrimitiveSizeInBits in getCastOpcode and isCastable since vector to vector casts are now handled explicitly by passing to the element types; i.e. this bit should result in no functional change. llvm-svn: 131532
7 lines
132 B
LLVM
7 lines
132 B
LLVM
; RUN: not llvm-as < %s |& grep {invalid cast opcode}
|
|
|
|
define i8 @foo(<4 x i64> %x) {
|
|
%y = trunc <4 x i64> %x to i8
|
|
ret i8 %y
|
|
}
|