[llvm] 6b313f1 - [AArch64][SVE] Remove asserts from AArch64ISelLowering for bfloat16 types

Kerry McLaughlin via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 06:54:56 PDT 2020


Author: Kerry McLaughlin
Date: 2020-06-26T14:51:27+01:00
New Revision: 6b313f198c95218b953f2c992f702f178c61cd1d

URL: https://github.com/llvm/llvm-project/commit/6b313f198c95218b953f2c992f702f178c61cd1d
DIFF: https://github.com/llvm/llvm-project/commit/6b313f198c95218b953f2c992f702f178c61cd1d.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/Target/AArch64/AArch64ISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index 90aff7185aa9..b25b9f799c44 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<const AArch64Subtarget &>(DAG.getSubtarget()).hasBF16() &&
-        "Unsupported type (BF16)");
+  if (VT == MVT::nxv8bf16 &&
+      !static_cast<const AArch64Subtarget &>(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<const AArch64Subtarget &>(DAG.getSubtarget()).hasBF16() &&
-        "Unsupported type (BF16)");
+  if (DataVT == MVT::nxv8bf16 &&
+      !static_cast<const AArch64Subtarget &>(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<const AArch64Subtarget &>(DAG.getSubtarget()).hasBF16() &&
-        "Unsupported type (BF16)");
+  if (DataVT == MVT::nxv8bf16 &&
+      !static_cast<const AArch64Subtarget &>(DAG.getSubtarget()).hasBF16())
+    return SDValue();
 
   if (DataVT.isFloatingPoint())
     Data = DAG.getNode(ISD::BITCAST, DL, DataVT.changeTypeToInteger(), Data);


        


More information about the llvm-commits mailing list