[all-commits] [llvm/llvm-project] 1b1145: [RISCV] Fix crash in convertToVLMAX when AVL is an...

Pengcheng Wang via All-commits all-commits at lists.llvm.org
Thu Jul 30 23:58:14 PDT 2026


  Branch: refs/heads/release/23.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 1b1145f5648f4acc5ace66146ea78aff97883c89
      https://github.com/llvm/llvm-project/commit/1b1145f5648f4acc5ace66146ea78aff97883c89
  Author: Pengcheng Wang <wangpengcheng.pp at bytedance.com>
  Date:   2026-07-31 (Fri, 31 Jul 2026)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVVectorPeephole.cpp
    A llvm/test/CodeGen/RISCV/rvv/vlmax-peephole.mir

  Log Message:
  -----------
  [RISCV] Fix crash in convertToVLMAX when AVL is an ADDI of a frame index (#212923)

`getConstant()` recognizes an AVL that is an immediate by checking
the opcode is `ADDI`, then reading the second operand and checking
if it is `X0`. However the second operand may be a frame index and
`getReg()` asserts with "This is not a register operand!".

We should guard the register access with `isReg()` before comparing
against `X0`.

Fixes #212797.

(cherry picked from commit ef7f2f611993a4bc59e181d2bf8fc6269d7e1c7d)



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list