File tree 2 files changed +7
-14
lines changed 2 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -18391,7 +18391,8 @@ bool RISCVTargetLowering::isDesirableToCommuteWithShift(
18391
18391
if (Subtarget.hasStdExtZba() && C2->getZExtValue() >= 1 &&
18392
18392
C2->getZExtValue() <= 3 && N->hasOneUse() &&
18393
18393
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)))
18395
18396
return false;
18396
18397
18397
18398
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) {
335
335
}
336
336
337
337
define 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
351
343
%a = add i64 %x , 1
352
344
%b = add i64 %y , %a
353
345
%c = shl i64 %b , 3
You can’t perform that action at this time.
0 commit comments