mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
[SVE] Fix warnings in SelectInst::areInvalidOperands
We should be comparing the element counts rather than the numbers of elements. Differential Revision: https://reviews.llvm.org/D80634
This commit is contained in:
parent
b0b422a9b8
commit
149631f346
@ -81,7 +81,7 @@ const char *SelectInst::areInvalidOperands(Value *Op0, Value *Op1, Value *Op2) {
|
||||
VectorType *ET = dyn_cast<VectorType>(Op1->getType());
|
||||
if (!ET)
|
||||
return "selected values for vector select must be vectors";
|
||||
if (ET->getNumElements() != VT->getNumElements())
|
||||
if (ET->getElementCount() != VT->getElementCount())
|
||||
return "vector select requires selected vectors to have "
|
||||
"the same vector length as select condition";
|
||||
} else if (Op0->getType() != Type::getInt1Ty(Op0->getContext())) {
|
||||
|
10
test/CodeGen/AArch64/sve-bad-select.ll
Normal file
10
test/CodeGen/AArch64/sve-bad-select.ll
Normal file
@ -0,0 +1,10 @@
|
||||
; RUN: not llc -mtriple=aarch64-linux-gnu -mattr=+sve < %s 2>&1 | FileCheck %s
|
||||
|
||||
define <vscale x 16 x i8> @badsel1_nxv16i8(<16 x i1> %p,
|
||||
<vscale x 16 x i8> %dst,
|
||||
<vscale x 16 x i8> %a) {
|
||||
%sel = select <16 x i1> %p, <vscale x 16 x i8> %a, <vscale x 16 x i8> %dst
|
||||
ret <vscale x 16 x i8> %sel
|
||||
}
|
||||
|
||||
; CHECK: error: vector select requires selected vectors to have the same vector length as select condition
|
Loading…
Reference in New Issue
Block a user