[llvm] [AArch64] Expand vector ops when NEON and SVE are unavailable. (PR #90833)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 02:56:58 PDT 2024


================
@@ -3731,8 +3731,10 @@ bool SelectionDAGLegalize::ExpandNode(SDNode *Node) {
   }
   case ISD::SUB: {
     EVT VT = Node->getValueType(0);
-    assert(TLI.isOperationLegalOrCustom(ISD::ADD, VT) &&
-           TLI.isOperationLegalOrCustom(ISD::XOR, VT) &&
+    assert((VT.isFixedLengthVector() || // fixed length ADD can be expanded to
----------------
paulwalker-arm wrote:

This change looks weird.  The assert is checking whether it is safe to create `ADD` and `XOR` nodes, which you're bypassing?  What does the failing test case look like?  Part of me thinks the original assert should be an `if` statement, but then I'm also wondering why `VectorLegalizer::LegalizeOp` hasn't already unrolled the operation.

https://github.com/llvm/llvm-project/pull/90833


More information about the llvm-commits mailing list