Skip to content

Commit c170da9

Browse files
committed
add extra judgement
1 parent e5651f6 commit c170da9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1903,6 +1903,10 @@ static SDValue lowerBUILD_VECTORAsBroadCastLoad(BuildVectorSDNode *BVOp,
19031903
IdentitySrc = BVOp->getOperand(0);
19041904
}
19051905

1906+
// make sure that this load is valid and only has one user.
1907+
if (!IdentitySrc || !BVOp->isOnlyUserOf(IdentitySrc.getNode()))
1908+
return SDValue();
1909+
19061910
if (IsIdeneity) {
19071911
auto *LN = cast<LoadSDNode>(IdentitySrc);
19081912
SDVTList Tys =

0 commit comments

Comments
 (0)