Skip to content

Commit e7f09af

Browse files
committed
add extra judgement
1 parent 60977f3 commit e7f09af

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1748,6 +1748,10 @@ static SDValue lowerBUILD_VECTORAsBroadCastLoad(BuildVectorSDNode *BVOp,
17481748
IdentitySrc = BVOp->getOperand(0);
17491749
}
17501750

1751+
// make sure that this load is valid and only has one user.
1752+
if (!IdentitySrc || !BVOp->isOnlyUserOf(IdentitySrc.getNode()))
1753+
return SDValue();
1754+
17511755
if (IsIdeneity) {
17521756
auto *LN = cast<LoadSDNode>(IdentitySrc);
17531757
SDVTList Tys =

0 commit comments

Comments
 (0)