File tree Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Expand file tree Collapse file tree 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -18391,7 +18391,8 @@ bool RISCVTargetLowering::isDesirableToCommuteWithShift(
1839118391 if (Subtarget.hasStdExtZba() && C2->getZExtValue() >= 1 &&
1839218392 C2->getZExtValue() <= 3 && N->hasOneUse() &&
1839318393 N->user_begin()->getOpcode() == ISD::ADD &&
18394- !isUsedByLdSt(*N->user_begin(), nullptr))
18394+ !isUsedByLdSt(*N->user_begin(), nullptr) &&
18395+ !isa<ConstantSDNode>(N->user_begin()->getOperand(1)))
1839518396 return false;
1839618397
1839718398 if (C1 && C2) {
Original file line number Diff line number Diff line change @@ -335,19 +335,11 @@ define i64 @add_shl_moreOneUse_sh4add(i64 %x) {
335335}
336336
337337define i64 @add_shl_rhs_constant (i64 %x , i64 %y ) {
338- ; NO-ZBA-LABEL: add_shl_rhs_constant:
339- ; NO-ZBA: # %bb.0:
340- ; NO-ZBA-NEXT: add a0, a0, a1
341- ; NO-ZBA-NEXT: slli a0, a0, 3
342- ; NO-ZBA-NEXT: ret
343- ;
344- ; ZBA-LABEL: add_shl_rhs_constant:
345- ; ZBA: # %bb.0:
346- ; ZBA-NEXT: add a0, a0, a1
347- ; ZBA-NEXT: addi a0, a0, 1
348- ; ZBA-NEXT: slli a0, a0, 3
349- ; ZBA-NEXT: addi a0, a0, -8
350- ; ZBA-NEXT: ret
338+ ; RV64-LABEL: add_shl_rhs_constant:
339+ ; RV64: # %bb.0:
340+ ; RV64-NEXT: add a0, a0, a1
341+ ; RV64-NEXT: slli a0, a0, 3
342+ ; RV64-NEXT: ret
351343 %a = add i64 %x , 1
352344 %b = add i64 %y , %a
353345 %c = shl i64 %b , 3
You can’t perform that action at this time.
0 commit comments