Skip to content

Commit 8072205

Browse files
committed
Don't consider ADDI for sentinel value
1 parent 7364a51 commit 8072205

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4814,14 +4814,14 @@ bool RISCV::isVLKnownLE(const MachineOperand &LHS, const MachineOperand &RHS,
48144814
if (LHS.isReg() && RHS.isReg() && LHS.getReg().isVirtual() &&
48154815
LHS.getReg() == RHS.getReg())
48164816
return true;
4817-
std::optional<int64_t> LHSImm = getEffectiveImm(LHS, MRI),
4818-
RHSImm = getEffectiveImm(RHS, MRI);
4819-
if (RHSImm == RISCV::VLMaxSentinel)
4817+
if (RHS.isImm() && RHS.getImm() == RISCV::VLMaxSentinel)
48204818
return true;
4821-
if (LHSImm == 0)
4819+
if (LHS.isImm() && LHS.getImm() == 0)
48224820
return true;
4823-
if (LHSImm == RISCV::VLMaxSentinel)
4821+
if (LHS.isImm() && LHS.getImm() == RISCV::VLMaxSentinel)
48244822
return false;
4823+
std::optional<int64_t> LHSImm = getEffectiveImm(LHS, MRI),
4824+
RHSImm = getEffectiveImm(RHS, MRI);
48254825
if (!LHSImm || !RHSImm)
48264826
return false;
48274827
return LHSImm <= RHSImm;

0 commit comments

Comments
 (0)