Skip to content

Commit f78f7d3

Browse files
committed
address comments
1 parent be1adea commit f78f7d3

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

llvm/lib/Target/LoongArch/LoongArchISelLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,13 +2516,13 @@ static SDValue lowerBUILD_VECTORAsBroadCastLoad(BuildVectorSDNode *BVOp,
25162516
}
25172517

25182518
// make sure that this load is valid and only has one user.
2519-
if (!IdentitySrc || !BVOp->isOnlyUserOf(IdentitySrc.getNode()))
2519+
if (!IsIdeneity || !IdentitySrc || !BVOp->isOnlyUserOf(IdentitySrc.getNode()))
25202520
return SDValue();
25212521

25222522
auto *LN = cast<LoadSDNode>(IdentitySrc);
25232523
auto ExtType = LN->getExtensionType();
25242524

2525-
if (IsIdeneity && (ExtType == ISD::EXTLOAD || ExtType == ISD::NON_EXTLOAD)) {
2525+
if (ExtType == ISD::EXTLOAD || ExtType == ISD::NON_EXTLOAD) {
25262526
SDVTList Tys =
25272527
LN->isIndexed()
25282528
? DAG.getVTList(VT, LN->getBasePtr().getValueType(), MVT::Other)

llvm/test/CodeGen/LoongArch/lsx/broadcast-load.ll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
; RUN: llc --mtriple=loongarch32 -mattr=+32s,+lsx < %s | FileCheck %s --check-prefixes=CHECK,LA32
33
; RUN: llc --mtriple=loongarch64 -mattr=+lsx < %s | FileCheck %s --check-prefixes=CHECK,LA64
44

5-
; TODO: Load a element and splat it to a vector could be lowerd to vldrepl
6-
75
; A load has more than one user shouldn't be lowered to vldrepl
86
define <2 x i64> @should_not_be_optimized(ptr %ptr, ptr %dst){
97
; LA32-LABEL: should_not_be_optimized:

0 commit comments

Comments
 (0)