Skip to content

Commit 51446d9

Browse files
committed
[RISCV] Only check for scalar VT at depth 0 in hasAllNBitUsers.
VTs on already selected instructions can be arbitrary. Reviewing the isel table I see i32 used for instructions that are part of multiple instruction output patterns. Looks like tblgen to just picks the lowest numbered MVT that is legal for the destination register class of the instruction. Seems better to just not check types for already selected nodes.
1 parent a876385 commit 51446d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2880,7 +2880,7 @@ bool RISCVDAGToDAGISel::hasAllNBitUsers(SDNode *Node, unsigned Bits,
28802880

28812881
// The PatFrags that call this may run before RISCVGenDAGISel.inc has checked
28822882
// the VT. Ensure the type is scalar to avoid wasting time on vectors.
2883-
if (!Node->getValueType(0).isScalarInteger())
2883+
if (Depth == 0 && !Node->getValueType(0).isScalarInteger())
28842884
return false;
28852885

28862886
for (auto UI = Node->use_begin(), UE = Node->use_end(); UI != UE; ++UI) {

0 commit comments

Comments
 (0)