Index: llvm/lib/Target/Hexagon/HexagonISelLowering.h =================================================================== --- llvm/lib/Target/Hexagon/HexagonISelLowering.h +++ llvm/lib/Target/Hexagon/HexagonISelLowering.h @@ -379,7 +379,9 @@ const SDLoc &dl, SelectionDAG &DAG) const; MVT ty(SDValue Op) const { - return Op.getValueType().getSimpleVT(); + if (Op.getValueType().isSimple()) + return Op.getValueType().getSimpleVT(); + return MVT::INVALID_SIMPLE_VALUE_TYPE; } TypePair ty(const VectorPair &Ops) const { return { Ops.first.getValueType().getSimpleVT(), Index: llvm/test/CodeGen/Hexagon/hvx-isel-vselect-v256i16.ll =================================================================== --- /dev/null +++ llvm/test/CodeGen/Hexagon/hvx-isel-vselect-v256i16.ll @@ -0,0 +1,13 @@ +; RUN: llc -march=hexagon -mattr=+hvxv65,+hvx-length128b < %s | FileCheck %s +; This used to crash with +; "llvm::MVT llvm::EVT::getSimpleVT() const: Assertion `isSimple() && +; Expected a SimpleValueType!' failed." + +; CHECK: vmax +define <256 x i16> @f0(<128 x i16> %v0, <128 x i16> %v1) { + %v01 = shufflevector <128 x i16> %v0, <128 x i16> %v1, <256 x i32> + %v10 = shufflevector <128 x i16> %v1, <128 x i16> %v0, <256 x i32> + %p0 = icmp sgt <256 x i16> %v01, %v10 + %res = select <256 x i1> %p0, <256 x i16> %v01, <256 x i16> %v10 + ret <256 x i16> %res +}