Skip to content

Commit 0b3f6ff

Browse files
committed
[RISCV] Disable hasAllNBitUsers for vector types.
RISCVGenDAGISel.inc can call this before it checks the node type. Ensure the type is scalar before wasting time to do the more computationally expensive checks. This also avoids an assertion if we hit a VMV_X_S instruction which doesn't have a VL operand which vectorPseudoHasAllNBitUsers expects.
1 parent 859b5c7 commit 0b3f6ff

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,6 +2878,11 @@ bool RISCVDAGToDAGISel::hasAllNBitUsers(SDNode *Node, unsigned Bits,
28782878
if (Depth >= SelectionDAG::MaxRecursionDepth)
28792879
return false;
28802880

2881+
// The PatFrags that call this may run before RISCVGenDAGISel.inc has checked
2882+
// the VT. Ensure the type is scalar to avoid wasting time on vectors.
2883+
if (!Node->getValueType(0).isScalarInteger())
2884+
return false;
2885+
28812886
for (auto UI = Node->use_begin(), UE = Node->use_end(); UI != UE; ++UI) {
28822887
SDNode *User = *UI;
28832888
// Users of this node should have already been instruction selected

0 commit comments

Comments
 (0)