From 6b313f198c95218b953f2c992f702f178c61cd1d Mon Sep 17 00:00:00 2001 From: Kerry McLaughlin Date: Fri, 26 Jun 2020 13:55:46 +0100 Subject: [PATCH] [AArch64][SVE] Remove asserts from AArch64ISelLowering for bfloat16 types Remove the asserts in performLDNT1Combine & performST[NT]1Combine to ensure we get a failure where the type is a bfloat16 and hasBF16() is false, regardless of whether asserts are enabled. --- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 90aff7185aa..b25b9f799c4 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -12078,10 +12078,9 @@ static SDValue performLDNT1Combine(SDNode *N, SelectionDAG &DAG) { EVT VT = N->getValueType(0); EVT PtrTy = N->getOperand(3).getValueType(); - if (VT == MVT::nxv8bf16) - assert( - static_cast(DAG.getSubtarget()).hasBF16() && - "Unsupported type (BF16)"); + if (VT == MVT::nxv8bf16 && + !static_cast(DAG.getSubtarget()).hasBF16()) + return SDValue(); EVT LoadVT = VT; if (VT.isFloatingPoint()) @@ -12131,10 +12130,9 @@ static SDValue performST1Combine(SDNode *N, SelectionDAG &DAG) { EVT HwSrcVt = getSVEContainerType(DataVT); SDValue InputVT = DAG.getValueType(DataVT); - if (DataVT == MVT::nxv8bf16) - assert( - static_cast(DAG.getSubtarget()).hasBF16() && - "Unsupported type (BF16)"); + if (DataVT == MVT::nxv8bf16 && + !static_cast(DAG.getSubtarget()).hasBF16()) + return SDValue(); if (DataVT.isFloatingPoint()) InputVT = DAG.getValueType(HwSrcVt); @@ -12162,10 +12160,9 @@ static SDValue performSTNT1Combine(SDNode *N, SelectionDAG &DAG) { EVT DataVT = Data.getValueType(); EVT PtrTy = N->getOperand(4).getValueType(); - if (DataVT == MVT::nxv8bf16) - assert( - static_cast(DAG.getSubtarget()).hasBF16() && - "Unsupported type (BF16)"); + if (DataVT == MVT::nxv8bf16 && + !static_cast(DAG.getSubtarget()).hasBF16()) + return SDValue(); if (DataVT.isFloatingPoint()) Data = DAG.getNode(ISD::BITCAST, DL, DataVT.changeTypeToInteger(), Data); -- 2.11.0