[llvm] [RISCV] Handle non uimm5 VL constants in isVLKnownLE (PR #156639)
Pengcheng Wang via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 3 03:54:13 PDT 2025
================
@@ -4796,8 +4796,21 @@ unsigned RISCV::getDestLog2EEW(const MCInstrDesc &Desc, unsigned Log2SEW) {
return Scaled;
}
+static std::optional<int64_t> getEffectiveImm(const MachineOperand &MO,
+ const MachineRegisterInfo *MRI) {
+ assert(MO.isImm() || MO.getReg().isVirtual());
+ if (MO.isImm())
+ return MO.getImm();
+ MachineInstr *Def = MRI->getVRegDef(MO.getReg());
+ if (Def->getOpcode() == RISCV::ADDI &&
----------------
wangpc-pp wrote:
We should make this a predicate. We have a lot of code doing the same judgement, like `isLoadImm`.
https://github.com/llvm/llvm-project/pull/156639
More information about the llvm-commits
mailing list